twilio-ruby 5.39.2 → 5.40.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (164) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +1 -1
  3. data/CHANGES.md +107 -1
  4. data/CONTRIBUTING.md +2 -2
  5. data/ISSUE_TEMPLATE.md +5 -1
  6. data/PULL_REQUEST_TEMPLATE.md +1 -1
  7. data/README.md +4 -3
  8. data/lib/twilio-ruby/framework/version.rb +4 -8
  9. data/lib/twilio-ruby/rest/api/v2010/account/application.rb +6 -4
  10. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/local.rb +12 -3
  11. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/machine_to_machine.rb +12 -3
  12. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/mobile.rb +12 -3
  13. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/national.rb +12 -3
  14. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/shared_cost.rb +12 -3
  15. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/toll_free.rb +12 -3
  16. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/voip.rb +12 -3
  17. data/lib/twilio-ruby/rest/api/v2010/account/call.rb +2 -1
  18. data/lib/twilio-ruby/rest/api/v2010/account/call/payment.rb +85 -60
  19. data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +5 -2
  20. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/local.rb +14 -0
  21. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/mobile.rb +14 -0
  22. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/toll_free.rb +14 -0
  23. data/lib/twilio-ruby/rest/api/v2010/account/message.rb +8 -1
  24. data/lib/twilio-ruby/rest/api/v2010/account/message/feedback.rb +3 -1
  25. data/lib/twilio-ruby/rest/api/v2010/account/usage/trigger.rb +2 -1
  26. data/lib/twilio-ruby/rest/autopilot/v1/assistant/field_type/field_value.rb +8 -4
  27. data/lib/twilio-ruby/rest/autopilot/v1/assistant/query.rb +11 -4
  28. data/lib/twilio-ruby/rest/autopilot/v1/assistant/task/sample.rb +13 -6
  29. data/lib/twilio-ruby/rest/client.rb +7 -0
  30. data/lib/twilio-ruby/rest/conversations.rb +39 -3
  31. data/lib/twilio-ruby/rest/conversations/v1.rb +68 -5
  32. data/lib/twilio-ruby/rest/conversations/v1/configuration.rb +268 -0
  33. data/lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb +262 -0
  34. data/lib/twilio-ruby/rest/conversations/v1/conversation.rb +21 -10
  35. data/lib/twilio-ruby/rest/conversations/v1/conversation/message.rb +13 -10
  36. data/lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb +34 -19
  37. data/lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb +48 -32
  38. data/lib/twilio-ruby/rest/conversations/v1/conversation/webhook.rb +14 -11
  39. data/lib/twilio-ruby/rest/conversations/v1/credential.rb +427 -0
  40. data/lib/twilio-ruby/rest/conversations/v1/role.rb +374 -0
  41. data/lib/twilio-ruby/rest/conversations/v1/service.rb +442 -0
  42. data/lib/twilio-ruby/rest/conversations/v1/service/binding.rb +388 -0
  43. data/lib/twilio-ruby/rest/conversations/v1/service/configuration.rb +271 -0
  44. data/lib/twilio-ruby/rest/conversations/v1/service/configuration/notification.rb +315 -0
  45. data/lib/twilio-ruby/rest/conversations/v1/service/conversation.rb +586 -0
  46. data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message.rb +549 -0
  47. data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb +394 -0
  48. data/lib/twilio-ruby/rest/conversations/v1/service/conversation/participant.rb +519 -0
  49. data/lib/twilio-ruby/rest/conversations/v1/service/conversation/webhook.rb +457 -0
  50. data/lib/twilio-ruby/rest/conversations/v1/service/role.rb +395 -0
  51. data/lib/twilio-ruby/rest/conversations/v1/service/user.rb +419 -0
  52. data/lib/twilio-ruby/rest/conversations/v1/user.rb +398 -0
  53. data/lib/twilio-ruby/rest/events.rb +72 -0
  54. data/lib/twilio-ruby/rest/events/v1.rb +90 -0
  55. data/lib/twilio-ruby/rest/events/v1/event_type.rb +291 -0
  56. data/lib/twilio-ruby/rest/events/v1/schema.rb +226 -0
  57. data/lib/twilio-ruby/rest/events/v1/schema/schema_version.rb +290 -0
  58. data/lib/twilio-ruby/rest/events/v1/sink.rb +380 -0
  59. data/lib/twilio-ruby/rest/events/v1/sink/sink_test.rb +115 -0
  60. data/lib/twilio-ruby/rest/events/v1/sink/sink_validate.rb +119 -0
  61. data/lib/twilio-ruby/rest/events/v1/subscription.rb +383 -0
  62. data/lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb +216 -0
  63. data/lib/twilio-ruby/rest/fax/v1/fax.rb +2 -1
  64. data/lib/twilio-ruby/rest/messaging.rb +6 -0
  65. data/lib/twilio-ruby/rest/messaging/v1.rb +7 -0
  66. data/lib/twilio-ruby/rest/messaging/v1/deactivation.rb +164 -0
  67. data/lib/twilio-ruby/rest/messaging/v1/service.rb +6 -3
  68. data/lib/twilio-ruby/rest/notify/v1/credential.rb +12 -6
  69. data/lib/twilio-ruby/rest/notify/v1/service/notification.rb +10 -2
  70. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance.rb +3 -3
  71. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/end_user.rb +16 -2
  72. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/supporting_document.rb +18 -4
  73. data/lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document.rb +10 -5
  74. data/lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document/dependent_hosted_number_order.rb +6 -3
  75. data/lib/twilio-ruby/rest/preview/trusted_comms/business/insights.rb +1 -4
  76. data/lib/twilio-ruby/rest/proxy/v1/service/phone_number.rb +3 -1
  77. data/lib/twilio-ruby/rest/proxy/v1/service/session.rb +45 -4
  78. data/lib/twilio-ruby/rest/proxy/v1/service/session/participant.rb +14 -1
  79. data/lib/twilio-ruby/rest/serverless/v1/service.rb +13 -13
  80. data/lib/twilio-ruby/rest/serverless/v1/service/asset.rb +6 -6
  81. data/lib/twilio-ruby/rest/serverless/v1/service/asset/asset_version.rb +5 -5
  82. data/lib/twilio-ruby/rest/serverless/v1/service/build.rb +8 -8
  83. data/lib/twilio-ruby/rest/serverless/v1/service/environment.rb +6 -8
  84. data/lib/twilio-ruby/rest/serverless/v1/service/environment/deployment.rb +8 -8
  85. data/lib/twilio-ruby/rest/serverless/v1/service/environment/variable.rb +14 -14
  86. data/lib/twilio-ruby/rest/serverless/v1/service/function.rb +4 -4
  87. data/lib/twilio-ruby/rest/serverless/v1/service/function/function_version.rb +7 -7
  88. data/lib/twilio-ruby/rest/serverless/v1/service/function/function_version/function_version_content.rb +1 -1
  89. data/lib/twilio-ruby/rest/supersim/v1/fleet.rb +12 -11
  90. data/lib/twilio-ruby/rest/supersim/v1/sim.rb +17 -7
  91. data/lib/twilio-ruby/rest/supersim/v1/usage_record.rb +75 -9
  92. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb +2 -1
  93. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb +6 -2
  94. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker.rb +1 -4
  95. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb +6 -2
  96. data/lib/twilio-ruby/rest/trunking/v1/trunk.rb +38 -23
  97. data/lib/twilio-ruby/rest/trunking/v1/trunk/ip_access_control_list.rb +2 -1
  98. data/lib/twilio-ruby/rest/trunking/v1/trunk/phone_number.rb +2 -1
  99. data/lib/twilio-ruby/rest/trunking/v1/trunk/recording.rb +201 -0
  100. data/lib/twilio-ruby/rest/verify/v2/service.rb +21 -9
  101. data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb +10 -2
  102. data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +7 -2
  103. data/lib/twilio-ruby/rest/video/v1/composition.rb +7 -3
  104. data/lib/twilio-ruby/rest/video/v1/composition_hook.rb +18 -9
  105. data/lib/twilio-ruby/rest/video/v1/room.rb +2 -1
  106. data/lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_subscribe_rule.rb +0 -6
  107. data/lib/twilio-ruby/rest/voice/v1/dialing_permissions.rb +1 -4
  108. data/lib/twilio-ruby/rest/wireless/v1/rate_plan.rb +2 -1
  109. data/lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb +5 -19
  110. data/lib/twilio-ruby/version.rb +1 -1
  111. data/spec/framework/version_spec.rb +53 -0
  112. data/spec/holodeck/holodeck.rb +3 -3
  113. data/spec/integration/api/v2010/account/incoming_phone_number/local_spec.rb +35 -36
  114. data/spec/integration/api/v2010/account/incoming_phone_number/mobile_spec.rb +39 -40
  115. data/spec/integration/api/v2010/account/incoming_phone_number/toll_free_spec.rb +35 -36
  116. data/spec/integration/api/v2010/account/incoming_phone_number_spec.rb +25 -23
  117. data/spec/integration/api/v2010/account/message_spec.rb +37 -0
  118. data/spec/integration/bulkexports/v1/export/day_spec.rb +5 -5
  119. data/spec/integration/bulkexports/v1/export_configuration_spec.rb +4 -4
  120. data/spec/integration/bulkexports/v1/export_spec.rb +3 -3
  121. data/spec/integration/conversations/v1/{webhook_spec.rb → configuration/webhook_spec.rb} +12 -8
  122. data/spec/integration/conversations/v1/configuration_spec.rb +87 -0
  123. data/spec/integration/conversations/v1/conversation/message/delivery_receipt_spec.rb +4 -0
  124. data/spec/integration/conversations/v1/conversation/message_spec.rb +38 -0
  125. data/spec/integration/conversations/v1/conversation/participant_spec.rb +60 -4
  126. data/spec/integration/conversations/v1/conversation_spec.rb +35 -0
  127. data/spec/integration/conversations/v1/credential_spec.rb +219 -0
  128. data/spec/integration/conversations/v1/role_spec.rb +249 -0
  129. data/spec/integration/conversations/v1/service/binding_spec.rb +166 -0
  130. data/spec/integration/conversations/v1/service/configuration/notification_spec.rb +115 -0
  131. data/spec/integration/conversations/v1/service/configuration_spec.rb +87 -0
  132. data/spec/integration/conversations/v1/service/conversation/message/delivery_receipt_spec.rb +144 -0
  133. data/spec/integration/conversations/v1/service/conversation/message_spec.rb +429 -0
  134. data/spec/integration/conversations/v1/service/conversation/participant_spec.rb +407 -0
  135. data/spec/integration/conversations/v1/service/conversation/webhook_spec.rb +299 -0
  136. data/spec/integration/conversations/v1/service/conversation_spec.rb +289 -0
  137. data/spec/integration/conversations/v1/service/role_spec.rb +260 -0
  138. data/spec/integration/conversations/v1/service/user_spec.rb +230 -0
  139. data/spec/integration/conversations/v1/service_spec.rb +174 -0
  140. data/spec/integration/conversations/v1/user_spec.rb +220 -0
  141. data/spec/integration/events/v1/event_type_spec.rb +133 -0
  142. data/spec/integration/events/v1/schema/schema_version_spec.rb +126 -0
  143. data/spec/integration/events/v1/schema_spec.rb +46 -0
  144. data/spec/integration/events/v1/sink/sink_test_spec.rb +42 -0
  145. data/spec/integration/events/v1/sink/sink_validate_spec.rb +44 -0
  146. data/spec/integration/events/v1/sink_spec.rb +217 -0
  147. data/spec/integration/events/v1/subscription/subscribed_event_spec.rb +91 -0
  148. data/spec/integration/events/v1/subscription_spec.rb +243 -0
  149. data/spec/integration/messaging/v1/deactivation_spec.rb +40 -0
  150. data/spec/integration/numbers/v2/regulatory_compliance/end_user_spec.rb +27 -0
  151. data/spec/integration/numbers/v2/regulatory_compliance/supporting_document_spec.rb +27 -0
  152. data/spec/integration/studio/v1/flow/execution/execution_step_spec.rb +1 -0
  153. data/spec/integration/studio/v2/flow/execution/execution_step_spec.rb +1 -0
  154. data/spec/integration/supersim/v1/sim_spec.rb +23 -0
  155. data/spec/integration/supersim/v1/usage_record_spec.rb +463 -18
  156. data/spec/integration/trunking/v1/trunk/recording_spec.rb +79 -0
  157. data/spec/integration/trunking/v1/trunk_spec.rb +4 -0
  158. data/spec/integration/verify/v2/service/access_token_spec.rb +1 -1
  159. data/spec/integration/verify/v2/service/entity/challenge_spec.rb +8 -8
  160. data/spec/integration/video/v1/room_spec.rb +37 -0
  161. data/spec/integration/wireless/v1/sim/data_session_spec.rb +2 -2
  162. data/spec/spec_helper.rb +1 -1
  163. metadata +82 -5
  164. data/lib/twilio-ruby/rest/conversations/v1/webhook.rb +0 -262
@@ -34,7 +34,9 @@ module Twilio
34
34
  # Unlike stream(), this operation is eager and will load `limit` records into
35
35
  # memory before returning.
36
36
  # @param [String] language The [ISO
37
- # language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used by the Query resources to read. For example: `en-US`.
37
+ # language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html)
38
+ # string that specifies the language used by the Query resources to read. For
39
+ # example: `en-US`.
38
40
  # @param [String] model_build The SID or unique name of the [Model
39
41
  # Build](https://www.twilio.com/docs/autopilot/api/model-build) to be queried.
40
42
  # @param [String] status The status of the resources to read. Can be:
@@ -64,7 +66,9 @@ module Twilio
64
66
  # This operation lazily loads records as efficiently as possible until the limit
65
67
  # is reached.
66
68
  # @param [String] language The [ISO
67
- # language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used by the Query resources to read. For example: `en-US`.
69
+ # language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html)
70
+ # string that specifies the language used by the Query resources to read. For
71
+ # example: `en-US`.
68
72
  # @param [String] model_build The SID or unique name of the [Model
69
73
  # Build](https://www.twilio.com/docs/autopilot/api/model-build) to be queried.
70
74
  # @param [String] status The status of the resources to read. Can be:
@@ -110,7 +114,9 @@ module Twilio
110
114
  # Retrieve a single page of QueryInstance records from the API.
111
115
  # Request is executed immediately.
112
116
  # @param [String] language The [ISO
113
- # language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used by the Query resources to read. For example: `en-US`.
117
+ # language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html)
118
+ # string that specifies the language used by the Query resources to read. For
119
+ # example: `en-US`.
114
120
  # @param [String] model_build The SID or unique name of the [Model
115
121
  # Build](https://www.twilio.com/docs/autopilot/api/model-build) to be queried.
116
122
  # @param [String] status The status of the resources to read. Can be:
@@ -153,7 +159,8 @@ module Twilio
153
159
  ##
154
160
  # Create the QueryInstance
155
161
  # @param [String] language The [ISO
156
- # language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the new query. For example: `en-US`.
162
+ # language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html)
163
+ # string that specifies the language used for the new query. For example: `en-US`.
157
164
  # @param [String] query The end-user's natural language input. It can be up to
158
165
  # 2048 characters long.
159
166
  # @param [String] tasks The list of tasks to limit the new query to. Tasks are
@@ -38,7 +38,8 @@ module Twilio
38
38
  # Unlike stream(), this operation is eager and will load `limit` records into
39
39
  # memory before returning.
40
40
  # @param [String] language The [ISO
41
- # language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the sample. For example: `en-US`.
41
+ # language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html)
42
+ # string that specifies the language used for the sample. For example: `en-US`.
42
43
  # @param [Integer] limit Upper limit for the number of records to return. stream()
43
44
  # guarantees to never return more than limit. Default is no limit
44
45
  # @param [Integer] page_size Number of records to fetch per request, when
@@ -55,7 +56,8 @@ module Twilio
55
56
  # This operation lazily loads records as efficiently as possible until the limit
56
57
  # is reached.
57
58
  # @param [String] language The [ISO
58
- # language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the sample. For example: `en-US`.
59
+ # language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html)
60
+ # string that specifies the language used for the sample. For example: `en-US`.
59
61
  # @param [Integer] limit Upper limit for the number of records to return. stream()
60
62
  # guarantees to never return more than limit. Default is no limit.
61
63
  # @param [Integer] page_size Number of records to fetch per request, when
@@ -89,7 +91,8 @@ module Twilio
89
91
  # Retrieve a single page of SampleInstance records from the API.
90
92
  # Request is executed immediately.
91
93
  # @param [String] language The [ISO
92
- # language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the sample. For example: `en-US`.
94
+ # language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html)
95
+ # string that specifies the language used for the sample. For example: `en-US`.
93
96
  # @param [String] page_token PageToken provided by the API
94
97
  # @param [Integer] page_number Page Number, this value is simply for client state
95
98
  # @param [Integer] page_size Number of records to return, defaults to 50
@@ -123,7 +126,9 @@ module Twilio
123
126
  ##
124
127
  # Create the SampleInstance
125
128
  # @param [String] language The [ISO
126
- # language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the new sample. For example: `en-US`.
129
+ # language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html)
130
+ # string that specifies the language used for the new sample. For example:
131
+ # `en-US`.
127
132
  # @param [String] tagged_text The text example of how end users might express the
128
133
  # task. The sample can contain [Field tag
129
134
  # blocks](https://www.twilio.com/docs/autopilot/api/task-sample#field-tagging).
@@ -232,7 +237,8 @@ module Twilio
232
237
  ##
233
238
  # Update the SampleInstance
234
239
  # @param [String] language The [ISO
235
- # language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the sample. For example: `en-US`.
240
+ # language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html)
241
+ # string that specifies the language used for the sample. For example: `en-US`.
236
242
  # @param [String] tagged_text The text example of how end users might express the
237
243
  # task. The sample can contain [Field tag
238
244
  # blocks](https://www.twilio.com/docs/autopilot/api/task-sample#field-tagging).
@@ -408,7 +414,8 @@ module Twilio
408
414
  ##
409
415
  # Update the SampleInstance
410
416
  # @param [String] language The [ISO
411
- # language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the sample. For example: `en-US`.
417
+ # language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html)
418
+ # string that specifies the language used for the sample. For example: `en-US`.
412
419
  # @param [String] tagged_text The text example of how end users might express the
413
420
  # task. The sample can contain [Field tag
414
421
  # blocks](https://www.twilio.com/docs/autopilot/api/task-sample#field-tagging).
@@ -33,6 +33,7 @@ module Twilio
33
33
  @autopilot = nil
34
34
  @chat = nil
35
35
  @conversations = nil
36
+ @events = nil
36
37
  @fax = nil
37
38
  @flex_api = nil
38
39
  @insights = nil
@@ -160,6 +161,12 @@ module Twilio
160
161
  @conversations ||= Conversations.new self
161
162
  end
162
163
 
164
+ ##
165
+ # Access the Events Twilio Domain
166
+ def events
167
+ @events ||= Events.new self
168
+ end
169
+
163
170
  ##
164
171
  # Access the Fax Twilio Domain
165
172
  def fax
@@ -28,6 +28,12 @@ module Twilio
28
28
  @v1 ||= V1.new self
29
29
  end
30
30
 
31
+ ##
32
+ # @return [Twilio::REST::Conversations::V1::ConfigurationInstance]
33
+ def configuration
34
+ self.v1.configuration()
35
+ end
36
+
31
37
  ##
32
38
  # @param [String] sid A 34 character string that uniquely identifies this
33
39
  # resource.
@@ -38,9 +44,39 @@ module Twilio
38
44
  end
39
45
 
40
46
  ##
41
- # @return [Twilio::REST::Conversations::V1::WebhookInstance]
42
- def webhooks
43
- self.v1.webhooks()
47
+ # @param [String] sid A 34 character string that uniquely identifies this
48
+ # resource.
49
+ # @return [Twilio::REST::Conversations::V1::CredentialInstance] if sid was passed.
50
+ # @return [Twilio::REST::Conversations::V1::CredentialList]
51
+ def credentials(sid=:unset)
52
+ self.v1.credentials(sid)
53
+ end
54
+
55
+ ##
56
+ # @param [String] sid The unique string that we created to identify the Role
57
+ # resource.
58
+ # @return [Twilio::REST::Conversations::V1::RoleInstance] if sid was passed.
59
+ # @return [Twilio::REST::Conversations::V1::RoleList]
60
+ def roles(sid=:unset)
61
+ self.v1.roles(sid)
62
+ end
63
+
64
+ ##
65
+ # @param [String] sid A 34 character string that uniquely identifies this
66
+ # resource.
67
+ # @return [Twilio::REST::Conversations::V1::ServiceInstance] if sid was passed.
68
+ # @return [Twilio::REST::Conversations::V1::ServiceList]
69
+ def services(sid=:unset)
70
+ self.v1.services(sid)
71
+ end
72
+
73
+ ##
74
+ # @param [String] sid The unique string that we created to identify the User
75
+ # resource.
76
+ # @return [Twilio::REST::Conversations::V1::UserInstance] if sid was passed.
77
+ # @return [Twilio::REST::Conversations::V1::UserList]
78
+ def users(sid=:unset)
79
+ self.v1.users(sid)
44
80
  end
45
81
 
46
82
  ##
@@ -15,13 +15,23 @@ module Twilio
15
15
  def initialize(domain)
16
16
  super
17
17
  @version = 'v1'
18
+ @configuration = nil
18
19
  @conversations = nil
19
- @webhooks = nil
20
+ @credentials = nil
21
+ @roles = nil
22
+ @services = nil
23
+ @users = nil
24
+ end
25
+
26
+ ##
27
+ # @return [Twilio::REST::Conversations::V1::ConfigurationContext]
28
+ def configuration
29
+ @configuration ||= ConfigurationContext.new self
20
30
  end
21
31
 
22
32
  ##
23
33
  # @param [String] sid A 34 character string that uniquely identifies this
24
- # resource.
34
+ # resource. Can also be the `unique_name` of the Conversation.
25
35
  # @return [Twilio::REST::Conversations::V1::ConversationContext] if sid was passed.
26
36
  # @return [Twilio::REST::Conversations::V1::ConversationList]
27
37
  def conversations(sid=:unset)
@@ -35,9 +45,62 @@ module Twilio
35
45
  end
36
46
 
37
47
  ##
38
- # @return [Twilio::REST::Conversations::V1::WebhookContext]
39
- def webhooks
40
- @webhooks ||= WebhookContext.new self
48
+ # @param [String] sid A 34 character string that uniquely identifies this
49
+ # resource.
50
+ # @return [Twilio::REST::Conversations::V1::CredentialContext] if sid was passed.
51
+ # @return [Twilio::REST::Conversations::V1::CredentialList]
52
+ def credentials(sid=:unset)
53
+ if sid.nil?
54
+ raise ArgumentError, 'sid cannot be nil'
55
+ elsif sid == :unset
56
+ @credentials ||= CredentialList.new self
57
+ else
58
+ CredentialContext.new(self, sid)
59
+ end
60
+ end
61
+
62
+ ##
63
+ # @param [String] sid The SID of the Role resource to fetch.
64
+ # @return [Twilio::REST::Conversations::V1::RoleContext] if sid was passed.
65
+ # @return [Twilio::REST::Conversations::V1::RoleList]
66
+ def roles(sid=:unset)
67
+ if sid.nil?
68
+ raise ArgumentError, 'sid cannot be nil'
69
+ elsif sid == :unset
70
+ @roles ||= RoleList.new self
71
+ else
72
+ RoleContext.new(self, sid)
73
+ end
74
+ end
75
+
76
+ ##
77
+ # @param [String] sid A 34 character string that uniquely identifies this
78
+ # resource.
79
+ # @return [Twilio::REST::Conversations::V1::ServiceContext] if sid was passed.
80
+ # @return [Twilio::REST::Conversations::V1::ServiceList]
81
+ def services(sid=:unset)
82
+ if sid.nil?
83
+ raise ArgumentError, 'sid cannot be nil'
84
+ elsif sid == :unset
85
+ @services ||= ServiceList.new self
86
+ else
87
+ ServiceContext.new(self, sid)
88
+ end
89
+ end
90
+
91
+ ##
92
+ # @param [String] sid The SID of the User resource to fetch. This value can be
93
+ # either the `sid` or the `identity` of the User resource to fetch.
94
+ # @return [Twilio::REST::Conversations::V1::UserContext] if sid was passed.
95
+ # @return [Twilio::REST::Conversations::V1::UserList]
96
+ def users(sid=:unset)
97
+ if sid.nil?
98
+ raise ArgumentError, 'sid cannot be nil'
99
+ elsif sid == :unset
100
+ @users ||= UserList.new self
101
+ else
102
+ UserContext.new(self, sid)
103
+ end
41
104
  end
42
105
 
43
106
  ##
@@ -0,0 +1,268 @@
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 Conversations < Domain
12
+ class V1 < Version
13
+ ##
14
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
15
+ class ConfigurationList < ListResource
16
+ ##
17
+ # Initialize the ConfigurationList
18
+ # @param [Version] version Version that contains the resource
19
+ # @return [ConfigurationList] ConfigurationList
20
+ def initialize(version)
21
+ super(version)
22
+
23
+ # Path Solution
24
+ @solution = {}
25
+ end
26
+
27
+ ##
28
+ # Provide a user friendly representation
29
+ def to_s
30
+ '#<Twilio.Conversations.V1.ConfigurationList>'
31
+ end
32
+ end
33
+
34
+ ##
35
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
36
+ class ConfigurationPage < Page
37
+ ##
38
+ # Initialize the ConfigurationPage
39
+ # @param [Version] version Version that contains the resource
40
+ # @param [Response] response Response from the API
41
+ # @param [Hash] solution Path solution for the resource
42
+ # @return [ConfigurationPage] ConfigurationPage
43
+ def initialize(version, response, solution)
44
+ super(version, response)
45
+
46
+ # Path Solution
47
+ @solution = solution
48
+ end
49
+
50
+ ##
51
+ # Build an instance of ConfigurationInstance
52
+ # @param [Hash] payload Payload response from the API
53
+ # @return [ConfigurationInstance] ConfigurationInstance
54
+ def get_instance(payload)
55
+ ConfigurationInstance.new(@version, payload, )
56
+ end
57
+
58
+ ##
59
+ # Provide a user friendly representation
60
+ def to_s
61
+ '<Twilio.Conversations.V1.ConfigurationPage>'
62
+ end
63
+ end
64
+
65
+ ##
66
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
67
+ class ConfigurationContext < InstanceContext
68
+ ##
69
+ # Initialize the ConfigurationContext
70
+ # @param [Version] version Version that contains the resource
71
+ # @return [ConfigurationContext] ConfigurationContext
72
+ def initialize(version)
73
+ super(version)
74
+
75
+ # Path Solution
76
+ @solution = {}
77
+ @uri = "/Configuration"
78
+
79
+ # Components
80
+ @webhooks = nil
81
+ end
82
+
83
+ ##
84
+ # Fetch the ConfigurationInstance
85
+ # @return [ConfigurationInstance] Fetched ConfigurationInstance
86
+ def fetch
87
+ payload = @version.fetch('GET', @uri)
88
+
89
+ ConfigurationInstance.new(@version, payload, )
90
+ end
91
+
92
+ ##
93
+ # Update the ConfigurationInstance
94
+ # @param [String] default_chat_service_sid The SID of the default [Conversation
95
+ # Service](https://www.twilio.com/docs/conversations/api/service-resource) to use
96
+ # when creating a conversation.
97
+ # @param [String] default_messaging_service_sid The SID of the default [Messaging
98
+ # Service](https://www.twilio.com/docs/sms/services/api) to use when creating a
99
+ # conversation.
100
+ # @param [String] default_inactive_timer Default ISO8601 duration when
101
+ # conversation will be switched to `inactive` state. Minimum value for this timer
102
+ # is 1 minute.
103
+ # @param [String] default_closed_timer Default ISO8601 duration when conversation
104
+ # will be switched to `closed` state. Minimum value for this timer is 10 minutes.
105
+ # @return [ConfigurationInstance] Updated ConfigurationInstance
106
+ def update(default_chat_service_sid: :unset, default_messaging_service_sid: :unset, default_inactive_timer: :unset, default_closed_timer: :unset)
107
+ data = Twilio::Values.of({
108
+ 'DefaultChatServiceSid' => default_chat_service_sid,
109
+ 'DefaultMessagingServiceSid' => default_messaging_service_sid,
110
+ 'DefaultInactiveTimer' => default_inactive_timer,
111
+ 'DefaultClosedTimer' => default_closed_timer,
112
+ })
113
+
114
+ payload = @version.update('POST', @uri, data: data)
115
+
116
+ ConfigurationInstance.new(@version, payload, )
117
+ end
118
+
119
+ ##
120
+ # Access the webhooks
121
+ # @return [WebhookContext] WebhookContext
122
+ def webhooks
123
+ return WebhookContext.new(@version, )
124
+ end
125
+
126
+ ##
127
+ # Provide a user friendly representation
128
+ def to_s
129
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
130
+ "#<Twilio.Conversations.V1.ConfigurationContext #{context}>"
131
+ end
132
+
133
+ ##
134
+ # Provide a detailed, user friendly representation
135
+ def inspect
136
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
137
+ "#<Twilio.Conversations.V1.ConfigurationContext #{context}>"
138
+ end
139
+ end
140
+
141
+ ##
142
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
143
+ class ConfigurationInstance < InstanceResource
144
+ ##
145
+ # Initialize the ConfigurationInstance
146
+ # @param [Version] version Version that contains the resource
147
+ # @param [Hash] payload payload that contains response from Twilio
148
+ # @return [ConfigurationInstance] ConfigurationInstance
149
+ def initialize(version, payload)
150
+ super(version)
151
+
152
+ # Marshaled Properties
153
+ @properties = {
154
+ 'account_sid' => payload['account_sid'],
155
+ 'default_chat_service_sid' => payload['default_chat_service_sid'],
156
+ 'default_messaging_service_sid' => payload['default_messaging_service_sid'],
157
+ 'default_inactive_timer' => payload['default_inactive_timer'],
158
+ 'default_closed_timer' => payload['default_closed_timer'],
159
+ 'url' => payload['url'],
160
+ 'links' => payload['links'],
161
+ }
162
+
163
+ # Context
164
+ @instance_context = nil
165
+ @params = {}
166
+ end
167
+
168
+ ##
169
+ # Generate an instance context for the instance, the context is capable of
170
+ # performing various actions. All instance actions are proxied to the context
171
+ # @return [ConfigurationContext] ConfigurationContext for this ConfigurationInstance
172
+ def context
173
+ unless @instance_context
174
+ @instance_context = ConfigurationContext.new(@version, )
175
+ end
176
+ @instance_context
177
+ end
178
+
179
+ ##
180
+ # @return [String] The SID of the Account responsible for this configuration.
181
+ def account_sid
182
+ @properties['account_sid']
183
+ end
184
+
185
+ ##
186
+ # @return [String] The SID of the default Conversation Service that every new conversation is associated with.
187
+ def default_chat_service_sid
188
+ @properties['default_chat_service_sid']
189
+ end
190
+
191
+ ##
192
+ # @return [String] The SID of the default Messaging Service that every new conversation is associated with.
193
+ def default_messaging_service_sid
194
+ @properties['default_messaging_service_sid']
195
+ end
196
+
197
+ ##
198
+ # @return [String] Default ISO8601 duration when conversation will be switched to `inactive` state.
199
+ def default_inactive_timer
200
+ @properties['default_inactive_timer']
201
+ end
202
+
203
+ ##
204
+ # @return [String] Default ISO8601 duration when conversation will be switched to `closed` state.
205
+ def default_closed_timer
206
+ @properties['default_closed_timer']
207
+ end
208
+
209
+ ##
210
+ # @return [String] The url
211
+ def url
212
+ @properties['url']
213
+ end
214
+
215
+ ##
216
+ # @return [String] The links
217
+ def links
218
+ @properties['links']
219
+ end
220
+
221
+ ##
222
+ # Fetch the ConfigurationInstance
223
+ # @return [ConfigurationInstance] Fetched ConfigurationInstance
224
+ def fetch
225
+ context.fetch
226
+ end
227
+
228
+ ##
229
+ # Update the ConfigurationInstance
230
+ # @param [String] default_chat_service_sid The SID of the default [Conversation
231
+ # Service](https://www.twilio.com/docs/conversations/api/service-resource) to use
232
+ # when creating a conversation.
233
+ # @param [String] default_messaging_service_sid The SID of the default [Messaging
234
+ # Service](https://www.twilio.com/docs/sms/services/api) to use when creating a
235
+ # conversation.
236
+ # @param [String] default_inactive_timer Default ISO8601 duration when
237
+ # conversation will be switched to `inactive` state. Minimum value for this timer
238
+ # is 1 minute.
239
+ # @param [String] default_closed_timer Default ISO8601 duration when conversation
240
+ # will be switched to `closed` state. Minimum value for this timer is 10 minutes.
241
+ # @return [ConfigurationInstance] Updated ConfigurationInstance
242
+ def update(default_chat_service_sid: :unset, default_messaging_service_sid: :unset, default_inactive_timer: :unset, default_closed_timer: :unset)
243
+ context.update(
244
+ default_chat_service_sid: default_chat_service_sid,
245
+ default_messaging_service_sid: default_messaging_service_sid,
246
+ default_inactive_timer: default_inactive_timer,
247
+ default_closed_timer: default_closed_timer,
248
+ )
249
+ end
250
+
251
+ ##
252
+ # Provide a user friendly representation
253
+ def to_s
254
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
255
+ "<Twilio.Conversations.V1.ConfigurationInstance #{values}>"
256
+ end
257
+
258
+ ##
259
+ # Provide a detailed, user friendly representation
260
+ def inspect
261
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
262
+ "<Twilio.Conversations.V1.ConfigurationInstance #{values}>"
263
+ end
264
+ end
265
+ end
266
+ end
267
+ end
268
+ end