twilio-ruby 5.39.1 → 5.40.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +1 -1
  3. data/CHANGES.md +101 -1
  4. data/CONTRIBUTING.md +2 -2
  5. data/ISSUE_TEMPLATE.md +5 -1
  6. data/Makefile +1 -1
  7. data/PULL_REQUEST_TEMPLATE.md +1 -1
  8. data/README.md +4 -3
  9. data/lib/twilio-ruby/framework/version.rb +2 -7
  10. data/lib/twilio-ruby/rest/api/v2010/account/application.rb +6 -4
  11. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/local.rb +3 -3
  12. data/lib/twilio-ruby/rest/api/v2010/account/call/payment.rb +79 -60
  13. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/local.rb +14 -0
  14. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/mobile.rb +14 -0
  15. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/toll_free.rb +14 -0
  16. data/lib/twilio-ruby/rest/client.rb +7 -0
  17. data/lib/twilio-ruby/rest/conversations.rb +52 -0
  18. data/lib/twilio-ruby/rest/conversations/v1.rb +88 -1
  19. data/lib/twilio-ruby/rest/conversations/v1/configuration.rb +258 -0
  20. data/lib/twilio-ruby/rest/conversations/v1/conversation.rb +15 -4
  21. data/lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb +19 -10
  22. data/lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb +12 -2
  23. data/lib/twilio-ruby/rest/conversations/v1/credential.rb +427 -0
  24. data/lib/twilio-ruby/rest/conversations/v1/notification.rb +310 -0
  25. data/lib/twilio-ruby/rest/conversations/v1/role.rb +372 -0
  26. data/lib/twilio-ruby/rest/conversations/v1/service.rb +442 -0
  27. data/lib/twilio-ruby/rest/conversations/v1/service/binding.rb +385 -0
  28. data/lib/twilio-ruby/rest/conversations/v1/service/configuration.rb +259 -0
  29. data/lib/twilio-ruby/rest/conversations/v1/service/conversation.rb +586 -0
  30. data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message.rb +546 -0
  31. data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb +388 -0
  32. data/lib/twilio-ruby/rest/conversations/v1/service/conversation/participant.rb +513 -0
  33. data/lib/twilio-ruby/rest/conversations/v1/service/conversation/webhook.rb +454 -0
  34. data/lib/twilio-ruby/rest/conversations/v1/service/role.rb +393 -0
  35. data/lib/twilio-ruby/rest/conversations/v1/service/user.rb +419 -0
  36. data/lib/twilio-ruby/rest/conversations/v1/user.rb +398 -0
  37. data/lib/twilio-ruby/rest/events.rb +63 -0
  38. data/lib/twilio-ruby/rest/events/v1.rb +74 -0
  39. data/lib/twilio-ruby/rest/events/v1/event_type.rb +291 -0
  40. data/lib/twilio-ruby/rest/events/v1/sink.rb +380 -0
  41. data/lib/twilio-ruby/rest/events/v1/sink/sink_test.rb +115 -0
  42. data/lib/twilio-ruby/rest/events/v1/sink/sink_validate.rb +119 -0
  43. data/lib/twilio-ruby/rest/events/v1/subscription.rb +363 -0
  44. data/lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb +322 -0
  45. data/lib/twilio-ruby/rest/messaging.rb +6 -0
  46. data/lib/twilio-ruby/rest/messaging/v1.rb +7 -0
  47. data/lib/twilio-ruby/rest/messaging/v1/deactivation.rb +164 -0
  48. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance.rb +3 -3
  49. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/end_user.rb +16 -2
  50. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/supporting_document.rb +18 -4
  51. data/lib/twilio-ruby/rest/proxy/v1/service/session.rb +45 -4
  52. data/lib/twilio-ruby/rest/proxy/v1/service/session/participant.rb +14 -1
  53. data/lib/twilio-ruby/rest/serverless/v1/service.rb +13 -13
  54. data/lib/twilio-ruby/rest/serverless/v1/service/asset.rb +6 -6
  55. data/lib/twilio-ruby/rest/serverless/v1/service/asset/asset_version.rb +5 -5
  56. data/lib/twilio-ruby/rest/serverless/v1/service/build.rb +8 -8
  57. data/lib/twilio-ruby/rest/serverless/v1/service/environment.rb +6 -8
  58. data/lib/twilio-ruby/rest/serverless/v1/service/environment/deployment.rb +8 -8
  59. data/lib/twilio-ruby/rest/serverless/v1/service/environment/variable.rb +14 -14
  60. data/lib/twilio-ruby/rest/serverless/v1/service/function.rb +4 -4
  61. data/lib/twilio-ruby/rest/serverless/v1/service/function/function_version.rb +7 -7
  62. data/lib/twilio-ruby/rest/serverless/v1/service/function/function_version/function_version_content.rb +1 -1
  63. data/lib/twilio-ruby/rest/supersim/v1/fleet.rb +12 -11
  64. data/lib/twilio-ruby/rest/supersim/v1/sim.rb +39 -9
  65. data/lib/twilio-ruby/rest/supersim/v1/usage_record.rb +75 -9
  66. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb +2 -1
  67. data/lib/twilio-ruby/rest/trunking/v1/trunk.rb +25 -3
  68. data/lib/twilio-ruby/rest/verify/v2/service.rb +21 -9
  69. data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb +10 -2
  70. data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +4 -1
  71. data/lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_subscribe_rule.rb +0 -6
  72. data/lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb +5 -19
  73. data/lib/twilio-ruby/version.rb +1 -1
  74. data/spec/framework/version_spec.rb +42 -0
  75. data/spec/holodeck/holodeck.rb +3 -3
  76. data/spec/integration/api/v2010/account/incoming_phone_number/local_spec.rb +35 -36
  77. data/spec/integration/api/v2010/account/incoming_phone_number/mobile_spec.rb +39 -40
  78. data/spec/integration/api/v2010/account/incoming_phone_number/toll_free_spec.rb +35 -36
  79. data/spec/integration/api/v2010/account/incoming_phone_number_spec.rb +25 -23
  80. data/spec/integration/api/v2010/account/message_spec.rb +37 -0
  81. data/spec/integration/bulkexports/v1/export/day_spec.rb +5 -5
  82. data/spec/integration/bulkexports/v1/export_configuration_spec.rb +4 -4
  83. data/spec/integration/bulkexports/v1/export_spec.rb +3 -3
  84. data/spec/integration/conversations/v1/configuration_spec.rb +85 -0
  85. data/spec/integration/conversations/v1/conversation/message/delivery_receipt_spec.rb +4 -0
  86. data/spec/integration/conversations/v1/conversation/message_spec.rb +38 -0
  87. data/spec/integration/conversations/v1/conversation/participant_spec.rb +60 -4
  88. data/spec/integration/conversations/v1/conversation_spec.rb +35 -0
  89. data/spec/integration/conversations/v1/credential_spec.rb +219 -0
  90. data/spec/integration/conversations/v1/notification_spec.rb +107 -0
  91. data/spec/integration/conversations/v1/role_spec.rb +249 -0
  92. data/spec/integration/conversations/v1/service/binding_spec.rb +166 -0
  93. data/spec/integration/conversations/v1/service/configuration_spec.rb +87 -0
  94. data/spec/integration/conversations/v1/service/conversation/message/delivery_receipt_spec.rb +144 -0
  95. data/spec/integration/conversations/v1/service/conversation/message_spec.rb +429 -0
  96. data/spec/integration/conversations/v1/service/conversation/participant_spec.rb +407 -0
  97. data/spec/integration/conversations/v1/service/conversation/webhook_spec.rb +299 -0
  98. data/spec/integration/conversations/v1/service/conversation_spec.rb +289 -0
  99. data/spec/integration/conversations/v1/service/role_spec.rb +260 -0
  100. data/spec/integration/conversations/v1/service/user_spec.rb +230 -0
  101. data/spec/integration/conversations/v1/service_spec.rb +174 -0
  102. data/spec/integration/conversations/v1/user_spec.rb +220 -0
  103. data/spec/integration/events/v1/event_type_spec.rb +133 -0
  104. data/spec/integration/events/v1/sink/sink_test_spec.rb +42 -0
  105. data/spec/integration/events/v1/sink/sink_validate_spec.rb +44 -0
  106. data/spec/integration/events/v1/sink_spec.rb +217 -0
  107. data/spec/integration/events/v1/subscription/subscribed_event_spec.rb +212 -0
  108. data/spec/integration/events/v1/subscription_spec.rb +205 -0
  109. data/spec/integration/messaging/v1/deactivation_spec.rb +40 -0
  110. data/spec/integration/numbers/v2/regulatory_compliance/end_user_spec.rb +27 -0
  111. data/spec/integration/numbers/v2/regulatory_compliance/supporting_document_spec.rb +27 -0
  112. data/spec/integration/studio/v1/flow/execution/execution_step_spec.rb +1 -0
  113. data/spec/integration/studio/v2/flow/execution/execution_step_spec.rb +1 -0
  114. data/spec/integration/supersim/v1/sim_spec.rb +23 -0
  115. data/spec/integration/supersim/v1/usage_record_spec.rb +463 -18
  116. data/spec/integration/trunking/v1/trunk_spec.rb +4 -0
  117. data/spec/integration/verify/v2/service/access_token_spec.rb +1 -1
  118. data/spec/integration/verify/v2/service/entity/challenge_spec.rb +8 -8
  119. data/spec/integration/video/v1/room_spec.rb +37 -0
  120. data/spec/integration/wireless/v1/sim/data_session_spec.rb +2 -2
  121. data/spec/spec_helper.rb +1 -1
  122. metadata +70 -2
@@ -0,0 +1,398 @@
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 UserList < ListResource
16
+ ##
17
+ # Initialize the UserList
18
+ # @param [Version] version Version that contains the resource
19
+ # @return [UserList] UserList
20
+ def initialize(version)
21
+ super(version)
22
+
23
+ # Path Solution
24
+ @solution = {}
25
+ @uri = "/Users"
26
+ end
27
+
28
+ ##
29
+ # Create the UserInstance
30
+ # @param [String] identity The application-defined string that uniquely identifies
31
+ # the resource's User within the
32
+ # [Service](https://www.twilio.com/docs/chat/rest/service-resource). This value is
33
+ # often a username or an email address, and is case-sensitive.
34
+ # @param [String] friendly_name The string that you assigned to describe the
35
+ # resource.
36
+ # @param [String] attributes The JSON Object string that stores
37
+ # application-specific data. If attributes have not been set, `{}` is returned.
38
+ # @param [String] role_sid The SID of the
39
+ # [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the
40
+ # user.
41
+ # @return [UserInstance] Created UserInstance
42
+ def create(identity: nil, friendly_name: :unset, attributes: :unset, role_sid: :unset)
43
+ data = Twilio::Values.of({
44
+ 'Identity' => identity,
45
+ 'FriendlyName' => friendly_name,
46
+ 'Attributes' => attributes,
47
+ 'RoleSid' => role_sid,
48
+ })
49
+
50
+ payload = @version.create('POST', @uri, data: data)
51
+
52
+ UserInstance.new(@version, payload, )
53
+ end
54
+
55
+ ##
56
+ # Lists UserInstance records from the API as a list.
57
+ # Unlike stream(), this operation is eager and will load `limit` records into
58
+ # memory before returning.
59
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
60
+ # guarantees to never return more than limit. Default is no limit
61
+ # @param [Integer] page_size Number of records to fetch per request, when
62
+ # not set will use the default value of 50 records. If no page_size is defined
63
+ # but a limit is defined, stream() will attempt to read the limit with the most
64
+ # efficient page size, i.e. min(limit, 1000)
65
+ # @return [Array] Array of up to limit results
66
+ def list(limit: nil, page_size: nil)
67
+ self.stream(limit: limit, page_size: page_size).entries
68
+ end
69
+
70
+ ##
71
+ # Streams UserInstance records from the API as an Enumerable.
72
+ # This operation lazily loads records as efficiently as possible until the limit
73
+ # is reached.
74
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
75
+ # guarantees to never return more than limit. Default is no limit.
76
+ # @param [Integer] page_size Number of records to fetch per request, when
77
+ # not set will use the default value of 50 records. If no page_size is defined
78
+ # but a limit is defined, stream() will attempt to read the limit with the most
79
+ # efficient page size, i.e. min(limit, 1000)
80
+ # @return [Enumerable] Enumerable that will yield up to limit results
81
+ def stream(limit: nil, page_size: nil)
82
+ limits = @version.read_limits(limit, page_size)
83
+
84
+ page = self.page(page_size: limits[:page_size], )
85
+
86
+ @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
87
+ end
88
+
89
+ ##
90
+ # When passed a block, yields UserInstance records from the API.
91
+ # This operation lazily loads records as efficiently as possible until the limit
92
+ # is reached.
93
+ def each
94
+ limits = @version.read_limits
95
+
96
+ page = self.page(page_size: limits[:page_size], )
97
+
98
+ @version.stream(page,
99
+ limit: limits[:limit],
100
+ page_limit: limits[:page_limit]).each {|x| yield x}
101
+ end
102
+
103
+ ##
104
+ # Retrieve a single page of UserInstance records from the API.
105
+ # Request is executed immediately.
106
+ # @param [String] page_token PageToken provided by the API
107
+ # @param [Integer] page_number Page Number, this value is simply for client state
108
+ # @param [Integer] page_size Number of records to return, defaults to 50
109
+ # @return [Page] Page of UserInstance
110
+ def page(page_token: :unset, page_number: :unset, page_size: :unset)
111
+ params = Twilio::Values.of({
112
+ 'PageToken' => page_token,
113
+ 'Page' => page_number,
114
+ 'PageSize' => page_size,
115
+ })
116
+
117
+ response = @version.page('GET', @uri, params: params)
118
+
119
+ UserPage.new(@version, response, @solution)
120
+ end
121
+
122
+ ##
123
+ # Retrieve a single page of UserInstance records from the API.
124
+ # Request is executed immediately.
125
+ # @param [String] target_url API-generated URL for the requested results page
126
+ # @return [Page] Page of UserInstance
127
+ def get_page(target_url)
128
+ response = @version.domain.request(
129
+ 'GET',
130
+ target_url
131
+ )
132
+ UserPage.new(@version, response, @solution)
133
+ end
134
+
135
+ ##
136
+ # Provide a user friendly representation
137
+ def to_s
138
+ '#<Twilio.Conversations.V1.UserList>'
139
+ end
140
+ end
141
+
142
+ ##
143
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
144
+ class UserPage < Page
145
+ ##
146
+ # Initialize the UserPage
147
+ # @param [Version] version Version that contains the resource
148
+ # @param [Response] response Response from the API
149
+ # @param [Hash] solution Path solution for the resource
150
+ # @return [UserPage] UserPage
151
+ def initialize(version, response, solution)
152
+ super(version, response)
153
+
154
+ # Path Solution
155
+ @solution = solution
156
+ end
157
+
158
+ ##
159
+ # Build an instance of UserInstance
160
+ # @param [Hash] payload Payload response from the API
161
+ # @return [UserInstance] UserInstance
162
+ def get_instance(payload)
163
+ UserInstance.new(@version, payload, )
164
+ end
165
+
166
+ ##
167
+ # Provide a user friendly representation
168
+ def to_s
169
+ '<Twilio.Conversations.V1.UserPage>'
170
+ end
171
+ end
172
+
173
+ ##
174
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
175
+ class UserContext < InstanceContext
176
+ ##
177
+ # Initialize the UserContext
178
+ # @param [Version] version Version that contains the resource
179
+ # @param [String] sid The SID of the User resource to fetch. This value can be
180
+ # either the `sid` or the `identity` of the User resource to fetch.
181
+ # @return [UserContext] UserContext
182
+ def initialize(version, sid)
183
+ super(version)
184
+
185
+ # Path Solution
186
+ @solution = {sid: sid, }
187
+ @uri = "/Users/#{@solution[:sid]}"
188
+ end
189
+
190
+ ##
191
+ # Update the UserInstance
192
+ # @param [String] friendly_name The string that you assigned to describe the
193
+ # resource.
194
+ # @param [String] attributes The JSON Object string that stores
195
+ # application-specific data. If attributes have not been set, `{}` is returned.
196
+ # @param [String] role_sid The SID of the
197
+ # [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the
198
+ # user.
199
+ # @return [UserInstance] Updated UserInstance
200
+ def update(friendly_name: :unset, attributes: :unset, role_sid: :unset)
201
+ data = Twilio::Values.of({
202
+ 'FriendlyName' => friendly_name,
203
+ 'Attributes' => attributes,
204
+ 'RoleSid' => role_sid,
205
+ })
206
+
207
+ payload = @version.update('POST', @uri, data: data)
208
+
209
+ UserInstance.new(@version, payload, sid: @solution[:sid], )
210
+ end
211
+
212
+ ##
213
+ # Delete the UserInstance
214
+ # @return [Boolean] true if delete succeeds, false otherwise
215
+ def delete
216
+ @version.delete('DELETE', @uri)
217
+ end
218
+
219
+ ##
220
+ # Fetch the UserInstance
221
+ # @return [UserInstance] Fetched UserInstance
222
+ def fetch
223
+ payload = @version.fetch('GET', @uri)
224
+
225
+ UserInstance.new(@version, payload, sid: @solution[:sid], )
226
+ end
227
+
228
+ ##
229
+ # Provide a user friendly representation
230
+ def to_s
231
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
232
+ "#<Twilio.Conversations.V1.UserContext #{context}>"
233
+ end
234
+
235
+ ##
236
+ # Provide a detailed, user friendly representation
237
+ def inspect
238
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
239
+ "#<Twilio.Conversations.V1.UserContext #{context}>"
240
+ end
241
+ end
242
+
243
+ ##
244
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
245
+ class UserInstance < InstanceResource
246
+ ##
247
+ # Initialize the UserInstance
248
+ # @param [Version] version Version that contains the resource
249
+ # @param [Hash] payload payload that contains response from Twilio
250
+ # @param [String] sid The SID of the User resource to fetch. This value can be
251
+ # either the `sid` or the `identity` of the User resource to fetch.
252
+ # @return [UserInstance] UserInstance
253
+ def initialize(version, payload, sid: nil)
254
+ super(version)
255
+
256
+ # Marshaled Properties
257
+ @properties = {
258
+ 'sid' => payload['sid'],
259
+ 'account_sid' => payload['account_sid'],
260
+ 'chat_service_sid' => payload['chat_service_sid'],
261
+ 'role_sid' => payload['role_sid'],
262
+ 'identity' => payload['identity'],
263
+ 'friendly_name' => payload['friendly_name'],
264
+ 'attributes' => payload['attributes'],
265
+ 'is_online' => payload['is_online'],
266
+ 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
267
+ 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
268
+ 'url' => payload['url'],
269
+ }
270
+
271
+ # Context
272
+ @instance_context = nil
273
+ @params = {'sid' => sid || @properties['sid'], }
274
+ end
275
+
276
+ ##
277
+ # Generate an instance context for the instance, the context is capable of
278
+ # performing various actions. All instance actions are proxied to the context
279
+ # @return [UserContext] UserContext for this UserInstance
280
+ def context
281
+ unless @instance_context
282
+ @instance_context = UserContext.new(@version, @params['sid'], )
283
+ end
284
+ @instance_context
285
+ end
286
+
287
+ ##
288
+ # @return [String] The unique string that identifies the resource
289
+ def sid
290
+ @properties['sid']
291
+ end
292
+
293
+ ##
294
+ # @return [String] The SID of the Account that created the resource
295
+ def account_sid
296
+ @properties['account_sid']
297
+ end
298
+
299
+ ##
300
+ # @return [String] The SID of the Service that the resource is associated with
301
+ def chat_service_sid
302
+ @properties['chat_service_sid']
303
+ end
304
+
305
+ ##
306
+ # @return [String] The SID of the Role assigned to the user
307
+ def role_sid
308
+ @properties['role_sid']
309
+ end
310
+
311
+ ##
312
+ # @return [String] The string that identifies the resource's User
313
+ def identity
314
+ @properties['identity']
315
+ end
316
+
317
+ ##
318
+ # @return [String] The string that you assigned to describe the resource
319
+ def friendly_name
320
+ @properties['friendly_name']
321
+ end
322
+
323
+ ##
324
+ # @return [String] The JSON Object string that stores application-specific data
325
+ def attributes
326
+ @properties['attributes']
327
+ end
328
+
329
+ ##
330
+ # @return [Boolean] Whether the User is actively connected to the Service instance and online
331
+ def is_online
332
+ @properties['is_online']
333
+ end
334
+
335
+ ##
336
+ # @return [Time] The ISO 8601 date and time in GMT when the resource was created
337
+ def date_created
338
+ @properties['date_created']
339
+ end
340
+
341
+ ##
342
+ # @return [Time] The ISO 8601 date and time in GMT when the resource was last updated
343
+ def date_updated
344
+ @properties['date_updated']
345
+ end
346
+
347
+ ##
348
+ # @return [String] The absolute URL of the User resource
349
+ def url
350
+ @properties['url']
351
+ end
352
+
353
+ ##
354
+ # Update the UserInstance
355
+ # @param [String] friendly_name The string that you assigned to describe the
356
+ # resource.
357
+ # @param [String] attributes The JSON Object string that stores
358
+ # application-specific data. If attributes have not been set, `{}` is returned.
359
+ # @param [String] role_sid The SID of the
360
+ # [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the
361
+ # user.
362
+ # @return [UserInstance] Updated UserInstance
363
+ def update(friendly_name: :unset, attributes: :unset, role_sid: :unset)
364
+ context.update(friendly_name: friendly_name, attributes: attributes, role_sid: role_sid, )
365
+ end
366
+
367
+ ##
368
+ # Delete the UserInstance
369
+ # @return [Boolean] true if delete succeeds, false otherwise
370
+ def delete
371
+ context.delete
372
+ end
373
+
374
+ ##
375
+ # Fetch the UserInstance
376
+ # @return [UserInstance] Fetched UserInstance
377
+ def fetch
378
+ context.fetch
379
+ end
380
+
381
+ ##
382
+ # Provide a user friendly representation
383
+ def to_s
384
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
385
+ "<Twilio.Conversations.V1.UserInstance #{values}>"
386
+ end
387
+
388
+ ##
389
+ # Provide a detailed, user friendly representation
390
+ def inspect
391
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
392
+ "<Twilio.Conversations.V1.UserInstance #{values}>"
393
+ end
394
+ end
395
+ end
396
+ end
397
+ end
398
+ end
@@ -0,0 +1,63 @@
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 Events < Domain
12
+ ##
13
+ # Initialize the Events Domain
14
+ def initialize(twilio)
15
+ super
16
+
17
+ @base_url = 'https://events.twilio.com'
18
+ @host = 'events.twilio.com'
19
+ @port = 443
20
+
21
+ # Versions
22
+ @v1 = nil
23
+ end
24
+
25
+ ##
26
+ # Version v1 of events
27
+ def v1
28
+ @v1 ||= V1.new self
29
+ end
30
+
31
+ ##
32
+ # @param [String] type The type
33
+ # @return [Twilio::REST::Events::V1::EventTypeInstance] if type was passed.
34
+ # @return [Twilio::REST::Events::V1::EventTypeList]
35
+ def event_types(type=:unset)
36
+ self.v1.event_types(type)
37
+ end
38
+
39
+ ##
40
+ # @param [String] sid A 34 character string that uniquely identifies this Sink.
41
+ # @return [Twilio::REST::Events::V1::SinkInstance] if sid was passed.
42
+ # @return [Twilio::REST::Events::V1::SinkList]
43
+ def sinks(sid=:unset)
44
+ self.v1.sinks(sid)
45
+ end
46
+
47
+ ##
48
+ # @param [String] sid A 34 character string that uniquely identifies this
49
+ # Subscription.
50
+ # @return [Twilio::REST::Events::V1::SubscriptionInstance] if sid was passed.
51
+ # @return [Twilio::REST::Events::V1::SubscriptionList]
52
+ def subscriptions(sid=:unset)
53
+ self.v1.subscriptions(sid)
54
+ end
55
+
56
+ ##
57
+ # Provide a user friendly representation
58
+ def to_s
59
+ '#<Twilio::REST::Events>'
60
+ end
61
+ end
62
+ end
63
+ end