twilio-ruby 5.21.1 → 5.21.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.
- checksums.yaml +4 -4
- data/CHANGES.md +13 -0
- data/README.md +7 -4
- data/lib/twilio-ruby/rest/api/v2010/account/call.rb +14 -1
- data/lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb +6 -4
- data/lib/twilio-ruby/rest/chat.rb +2 -2
- data/lib/twilio-ruby/rest/chat/v2.rb +4 -2
- data/lib/twilio-ruby/rest/chat/v2/credential.rb +50 -45
- data/lib/twilio-ruby/rest/chat/v2/service.rb +197 -146
- data/lib/twilio-ruby/rest/chat/v2/service/binding.rb +43 -30
- data/lib/twilio-ruby/rest/chat/v2/service/channel.rb +85 -77
- data/lib/twilio-ruby/rest/chat/v2/service/channel/invite.rb +48 -46
- data/lib/twilio-ruby/rest/chat/v2/service/channel/member.rb +117 -113
- data/lib/twilio-ruby/rest/chat/v2/service/channel/message.rb +98 -96
- data/lib/twilio-ruby/rest/chat/v2/service/channel/webhook.rb +90 -36
- data/lib/twilio-ruby/rest/chat/v2/service/role.rb +38 -25
- data/lib/twilio-ruby/rest/chat/v2/service/user.rb +49 -51
- data/lib/twilio-ruby/rest/chat/v2/service/user/user_binding.rb +42 -34
- data/lib/twilio-ruby/rest/chat/v2/service/user/user_channel.rb +37 -31
- data/lib/twilio-ruby/rest/flex_api.rb +8 -0
- data/lib/twilio-ruby/rest/flex_api/v1.rb +15 -0
- data/lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb +515 -0
- data/lib/twilio-ruby/rest/ip_messaging.rb +2 -2
- data/lib/twilio-ruby/rest/ip_messaging/v2.rb +4 -2
- data/lib/twilio-ruby/rest/ip_messaging/v2/credential.rb +50 -45
- data/lib/twilio-ruby/rest/ip_messaging/v2/service.rb +197 -146
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/binding.rb +43 -30
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb +85 -77
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/invite.rb +48 -46
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/member.rb +117 -113
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/message.rb +98 -96
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/webhook.rb +90 -36
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/role.rb +38 -25
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/user.rb +49 -51
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/user/user_binding.rb +42 -34
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/user/user_channel.rb +37 -31
- data/lib/twilio-ruby/rest/verify/v1/service/verification.rb +1 -4
- data/lib/twilio-ruby/rest/voice/v1/voice_permission/settings.rb +207 -0
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/integration/flex_api/v1/flex_flow_spec.rb +255 -0
- data/spec/integration/voice/v1/voice_permission/settings_spec.rb +77 -0
- metadata +8 -2
|
@@ -16,10 +16,12 @@ module Twilio
|
|
|
16
16
|
##
|
|
17
17
|
# Initialize the MessageList
|
|
18
18
|
# @param [Version] version Version that contains the resource
|
|
19
|
-
# @param [String] service_sid The
|
|
20
|
-
# [Service](https://www.twilio.com/docs/chat/
|
|
21
|
-
#
|
|
22
|
-
# @param [String] channel_sid The
|
|
19
|
+
# @param [String] service_sid The SID of the
|
|
20
|
+
# [Service](https://www.twilio.com/docs/chat/rest/services) the resource is
|
|
21
|
+
# associated with.
|
|
22
|
+
# @param [String] channel_sid The unique ID of the
|
|
23
|
+
# [Channel](https://www.twilio.com/docs/chat/channels) the Message resource
|
|
24
|
+
# belongs to.
|
|
23
25
|
# @return [MessageList] MessageList
|
|
24
26
|
def initialize(version, service_sid: nil, channel_sid: nil)
|
|
25
27
|
super(version)
|
|
@@ -32,30 +34,29 @@ module Twilio
|
|
|
32
34
|
##
|
|
33
35
|
# Retrieve a single page of MessageInstance records from the API.
|
|
34
36
|
# Request is executed immediately.
|
|
35
|
-
# @param [String] from The
|
|
36
|
-
#
|
|
37
|
-
#
|
|
38
|
-
#
|
|
39
|
-
#
|
|
40
|
-
#
|
|
41
|
-
#
|
|
42
|
-
#
|
|
43
|
-
#
|
|
44
|
-
#
|
|
45
|
-
#
|
|
46
|
-
#
|
|
47
|
-
# should be
|
|
48
|
-
#
|
|
49
|
-
#
|
|
50
|
-
#
|
|
51
|
-
#
|
|
52
|
-
#
|
|
53
|
-
#
|
|
54
|
-
# structured data by serializing it
|
|
55
|
-
#
|
|
56
|
-
#
|
|
57
|
-
#
|
|
58
|
-
# this Message.
|
|
37
|
+
# @param [String] from The [identity](https://www.twilio.com/docs/chat/identity)
|
|
38
|
+
# of the new message's author. The default value is `system`.
|
|
39
|
+
# @param [String] attributes A valid JSON string that contains
|
|
40
|
+
# application-specific data.
|
|
41
|
+
# @param [Time] date_created The date, specified in [ISO
|
|
42
|
+
# 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource
|
|
43
|
+
# as the date it was created. The default is the current time set by the Chat
|
|
44
|
+
# service. This parameter should only be used when a Chat's history is being
|
|
45
|
+
# recreated from a backup/separate source.
|
|
46
|
+
# @param [Time] date_updated The date, specified in [ISO
|
|
47
|
+
# 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource
|
|
48
|
+
# as the date it was last updated. The default value is `null`. Note that this
|
|
49
|
+
# parameter should only be used when a Chat's history is being recreated from a
|
|
50
|
+
# backup/separate source and where a Message was previously updated.
|
|
51
|
+
# @param [String] last_updated_by The
|
|
52
|
+
# [identity](https://www.twilio.com/docs/chat/identity) of the User who last
|
|
53
|
+
# updated the Message, if applicable.
|
|
54
|
+
# @param [String] body The message to send to the channel. Can also be an empty
|
|
55
|
+
# string or `null`, which sets the value as an empty string. You can send
|
|
56
|
+
# structured data in the body by serializing it as a string.
|
|
57
|
+
# @param [String] media_sid The SID of the
|
|
58
|
+
# [Media](https://www.twilio.com/docs/chat/rest/media) to attach to the new
|
|
59
|
+
# Message.
|
|
59
60
|
# @return [MessageInstance] Newly created MessageInstance
|
|
60
61
|
def create(from: :unset, attributes: :unset, date_created: :unset, date_updated: :unset, last_updated_by: :unset, body: :unset, media_sid: :unset)
|
|
61
62
|
data = Twilio::Values.of({
|
|
@@ -86,9 +87,8 @@ module Twilio
|
|
|
86
87
|
# Lists MessageInstance records from the API as a list.
|
|
87
88
|
# Unlike stream(), this operation is eager and will load `limit` records into
|
|
88
89
|
# memory before returning.
|
|
89
|
-
# @param [message.OrderType] order
|
|
90
|
-
#
|
|
91
|
-
# used as the default.
|
|
90
|
+
# @param [message.OrderType] order The sort order of the returned messages. Can
|
|
91
|
+
# be: `asc` (ascending) or `desc` (descending) with `asc` as the default.
|
|
92
92
|
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
|
93
93
|
# guarantees to never return more than limit. Default is no limit
|
|
94
94
|
# @param [Integer] page_size Number of records to fetch per request, when
|
|
@@ -104,9 +104,8 @@ module Twilio
|
|
|
104
104
|
# Streams MessageInstance records from the API as an Enumerable.
|
|
105
105
|
# This operation lazily loads records as efficiently as possible until the limit
|
|
106
106
|
# is reached.
|
|
107
|
-
# @param [message.OrderType] order
|
|
108
|
-
#
|
|
109
|
-
# used as the default.
|
|
107
|
+
# @param [message.OrderType] order The sort order of the returned messages. Can
|
|
108
|
+
# be: `asc` (ascending) or `desc` (descending) with `asc` as the default.
|
|
110
109
|
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
|
111
110
|
# guarantees to never return more than limit. Default is no limit.
|
|
112
111
|
# @param [Integer] page_size Number of records to fetch per request, when
|
|
@@ -139,9 +138,8 @@ module Twilio
|
|
|
139
138
|
##
|
|
140
139
|
# Retrieve a single page of MessageInstance records from the API.
|
|
141
140
|
# Request is executed immediately.
|
|
142
|
-
# @param [message.OrderType] order
|
|
143
|
-
#
|
|
144
|
-
# used as the default.
|
|
141
|
+
# @param [message.OrderType] order The sort order of the returned messages. Can
|
|
142
|
+
# be: `asc` (ascending) or `desc` (descending) with `asc` as the default.
|
|
145
143
|
# @param [String] page_token PageToken provided by the API
|
|
146
144
|
# @param [Integer] page_number Page Number, this value is simply for client state
|
|
147
145
|
# @param [Integer] page_size Number of records to return, defaults to 50
|
|
@@ -219,13 +217,14 @@ module Twilio
|
|
|
219
217
|
##
|
|
220
218
|
# Initialize the MessageContext
|
|
221
219
|
# @param [Version] version Version that contains the resource
|
|
222
|
-
# @param [String] service_sid
|
|
223
|
-
# [Service](https://www.twilio.com/docs/
|
|
224
|
-
#
|
|
225
|
-
# @param [String] channel_sid
|
|
226
|
-
# [Channel](https://www.twilio.com/docs/
|
|
227
|
-
# to.
|
|
228
|
-
# @param [String] sid
|
|
220
|
+
# @param [String] service_sid The SID of the
|
|
221
|
+
# [Service](https://www.twilio.com/docs/chat/rest/services) to fetch the resource
|
|
222
|
+
# from.
|
|
223
|
+
# @param [String] channel_sid The unique ID of the
|
|
224
|
+
# [Channel](https://www.twilio.com/docs/chat/channels) the message to fetch
|
|
225
|
+
# belongs to. Can be the Channel's `sid` or `unique_name`.
|
|
226
|
+
# @param [String] sid The Twilio-provided string that uniquely identifies the
|
|
227
|
+
# Message resource to fetch.
|
|
229
228
|
# @return [MessageContext] MessageContext
|
|
230
229
|
def initialize(version, service_sid, channel_sid, sid)
|
|
231
230
|
super(version)
|
|
@@ -265,22 +264,22 @@ module Twilio
|
|
|
265
264
|
|
|
266
265
|
##
|
|
267
266
|
# Update the MessageInstance
|
|
268
|
-
# @param [String] body The message
|
|
269
|
-
#
|
|
270
|
-
#
|
|
271
|
-
# @param [String] attributes A
|
|
272
|
-
#
|
|
273
|
-
#
|
|
274
|
-
#
|
|
275
|
-
#
|
|
276
|
-
#
|
|
277
|
-
#
|
|
278
|
-
#
|
|
279
|
-
# @param [String] last_updated_by
|
|
280
|
-
#
|
|
281
|
-
#
|
|
282
|
-
#
|
|
283
|
-
# message's author.
|
|
267
|
+
# @param [String] body The message to send to the channel. Can also be an empty
|
|
268
|
+
# string or `null`, which sets the value as an empty string. You can send
|
|
269
|
+
# structured data in the body by serializing it as a string.
|
|
270
|
+
# @param [String] attributes A valid JSON string that contains
|
|
271
|
+
# application-specific data.
|
|
272
|
+
# @param [Time] date_created The date, specified in [ISO
|
|
273
|
+
# 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource
|
|
274
|
+
# as the date it was created.
|
|
275
|
+
# @param [Time] date_updated The date, specified in [ISO
|
|
276
|
+
# 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource
|
|
277
|
+
# as the date it was last updated.
|
|
278
|
+
# @param [String] last_updated_by The
|
|
279
|
+
# [Identity](https://www.twilio.com/docs/chat/identity) of the User who last
|
|
280
|
+
# updated the Message, if applicable.
|
|
281
|
+
# @param [String] from The [Identity](https://www.twilio.com/docs/chat/identity)
|
|
282
|
+
# of the message's author.
|
|
284
283
|
# @return [MessageInstance] Updated MessageInstance
|
|
285
284
|
def update(body: :unset, attributes: :unset, date_created: :unset, date_updated: :unset, last_updated_by: :unset, from: :unset)
|
|
286
285
|
data = Twilio::Values.of({
|
|
@@ -327,11 +326,14 @@ module Twilio
|
|
|
327
326
|
# Initialize the MessageInstance
|
|
328
327
|
# @param [Version] version Version that contains the resource
|
|
329
328
|
# @param [Hash] payload payload that contains response from Twilio
|
|
330
|
-
# @param [String] service_sid The
|
|
331
|
-
# [Service](https://www.twilio.com/docs/chat/
|
|
332
|
-
#
|
|
333
|
-
# @param [String] channel_sid The
|
|
334
|
-
#
|
|
329
|
+
# @param [String] service_sid The SID of the
|
|
330
|
+
# [Service](https://www.twilio.com/docs/chat/rest/services) the resource is
|
|
331
|
+
# associated with.
|
|
332
|
+
# @param [String] channel_sid The unique ID of the
|
|
333
|
+
# [Channel](https://www.twilio.com/docs/chat/channels) the Message resource
|
|
334
|
+
# belongs to.
|
|
335
|
+
# @param [String] sid The Twilio-provided string that uniquely identifies the
|
|
336
|
+
# Message resource to fetch.
|
|
335
337
|
# @return [MessageInstance] MessageInstance
|
|
336
338
|
def initialize(version, payload, service_sid: nil, channel_sid: nil, sid: nil)
|
|
337
339
|
super(version)
|
|
@@ -382,73 +384,73 @@ module Twilio
|
|
|
382
384
|
end
|
|
383
385
|
|
|
384
386
|
##
|
|
385
|
-
# @return [String]
|
|
387
|
+
# @return [String] The unique string that identifies the resource
|
|
386
388
|
def sid
|
|
387
389
|
@properties['sid']
|
|
388
390
|
end
|
|
389
391
|
|
|
390
392
|
##
|
|
391
|
-
# @return [String] The
|
|
393
|
+
# @return [String] The SID of the Account that created the resource
|
|
392
394
|
def account_sid
|
|
393
395
|
@properties['account_sid']
|
|
394
396
|
end
|
|
395
397
|
|
|
396
398
|
##
|
|
397
|
-
# @return [String]
|
|
399
|
+
# @return [String] The JSON string that stores application-specific data
|
|
398
400
|
def attributes
|
|
399
401
|
@properties['attributes']
|
|
400
402
|
end
|
|
401
403
|
|
|
402
404
|
##
|
|
403
|
-
# @return [String] The
|
|
405
|
+
# @return [String] The SID of the Service that the resource is associated with
|
|
404
406
|
def service_sid
|
|
405
407
|
@properties['service_sid']
|
|
406
408
|
end
|
|
407
409
|
|
|
408
410
|
##
|
|
409
|
-
# @return [String] The
|
|
411
|
+
# @return [String] The SID of the Channel that the message was sent to
|
|
410
412
|
def to
|
|
411
413
|
@properties['to']
|
|
412
414
|
end
|
|
413
415
|
|
|
414
416
|
##
|
|
415
|
-
# @return [String] The
|
|
417
|
+
# @return [String] The unique ID of the Channel the Message resource belongs to
|
|
416
418
|
def channel_sid
|
|
417
419
|
@properties['channel_sid']
|
|
418
420
|
end
|
|
419
421
|
|
|
420
422
|
##
|
|
421
|
-
# @return [Time] The date
|
|
423
|
+
# @return [Time] The RFC 2822 date and time in GMT when the resource was created
|
|
422
424
|
def date_created
|
|
423
425
|
@properties['date_created']
|
|
424
426
|
end
|
|
425
427
|
|
|
426
428
|
##
|
|
427
|
-
# @return [Time] The date
|
|
429
|
+
# @return [Time] The RFC 2822 date and time in GMT when the resource was last updated
|
|
428
430
|
def date_updated
|
|
429
431
|
@properties['date_updated']
|
|
430
432
|
end
|
|
431
433
|
|
|
432
434
|
##
|
|
433
|
-
# @return [String]
|
|
435
|
+
# @return [String] The Identity of the User who last updated the Message
|
|
434
436
|
def last_updated_by
|
|
435
437
|
@properties['last_updated_by']
|
|
436
438
|
end
|
|
437
439
|
|
|
438
440
|
##
|
|
439
|
-
# @return [Boolean]
|
|
441
|
+
# @return [Boolean] Whether the message has been edited since it was created
|
|
440
442
|
def was_edited
|
|
441
443
|
@properties['was_edited']
|
|
442
444
|
end
|
|
443
445
|
|
|
444
446
|
##
|
|
445
|
-
# @return [String] The identity of the message's author
|
|
447
|
+
# @return [String] The identity of the message's author
|
|
446
448
|
def from
|
|
447
449
|
@properties['from']
|
|
448
450
|
end
|
|
449
451
|
|
|
450
452
|
##
|
|
451
|
-
# @return [String] The
|
|
453
|
+
# @return [String] The content of the message
|
|
452
454
|
def body
|
|
453
455
|
@properties['body']
|
|
454
456
|
end
|
|
@@ -460,19 +462,19 @@ module Twilio
|
|
|
460
462
|
end
|
|
461
463
|
|
|
462
464
|
##
|
|
463
|
-
# @return [String] Message type
|
|
465
|
+
# @return [String] The Message type
|
|
464
466
|
def type
|
|
465
467
|
@properties['type']
|
|
466
468
|
end
|
|
467
469
|
|
|
468
470
|
##
|
|
469
|
-
# @return [Hash]
|
|
471
|
+
# @return [Hash] A Media object that describes the Message's media if attached; otherwise, null
|
|
470
472
|
def media
|
|
471
473
|
@properties['media']
|
|
472
474
|
end
|
|
473
475
|
|
|
474
476
|
##
|
|
475
|
-
# @return [String]
|
|
477
|
+
# @return [String] The absolute URL of the Message resource
|
|
476
478
|
def url
|
|
477
479
|
@properties['url']
|
|
478
480
|
end
|
|
@@ -493,22 +495,22 @@ module Twilio
|
|
|
493
495
|
|
|
494
496
|
##
|
|
495
497
|
# Update the MessageInstance
|
|
496
|
-
# @param [String] body The message
|
|
497
|
-
#
|
|
498
|
-
#
|
|
499
|
-
# @param [String] attributes A
|
|
500
|
-
#
|
|
501
|
-
#
|
|
502
|
-
#
|
|
503
|
-
#
|
|
504
|
-
#
|
|
505
|
-
#
|
|
506
|
-
#
|
|
507
|
-
# @param [String] last_updated_by
|
|
508
|
-
#
|
|
509
|
-
#
|
|
510
|
-
#
|
|
511
|
-
# message's author.
|
|
498
|
+
# @param [String] body The message to send to the channel. Can also be an empty
|
|
499
|
+
# string or `null`, which sets the value as an empty string. You can send
|
|
500
|
+
# structured data in the body by serializing it as a string.
|
|
501
|
+
# @param [String] attributes A valid JSON string that contains
|
|
502
|
+
# application-specific data.
|
|
503
|
+
# @param [Time] date_created The date, specified in [ISO
|
|
504
|
+
# 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource
|
|
505
|
+
# as the date it was created.
|
|
506
|
+
# @param [Time] date_updated The date, specified in [ISO
|
|
507
|
+
# 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource
|
|
508
|
+
# as the date it was last updated.
|
|
509
|
+
# @param [String] last_updated_by The
|
|
510
|
+
# [Identity](https://www.twilio.com/docs/chat/identity) of the User who last
|
|
511
|
+
# updated the Message, if applicable.
|
|
512
|
+
# @param [String] from The [Identity](https://www.twilio.com/docs/chat/identity)
|
|
513
|
+
# of the message's author.
|
|
512
514
|
# @return [MessageInstance] Updated MessageInstance
|
|
513
515
|
def update(body: :unset, attributes: :unset, date_created: :unset, date_updated: :unset, last_updated_by: :unset, from: :unset)
|
|
514
516
|
context.update(
|
|
@@ -16,8 +16,12 @@ module Twilio
|
|
|
16
16
|
##
|
|
17
17
|
# Initialize the WebhookList
|
|
18
18
|
# @param [Version] version Version that contains the resource
|
|
19
|
-
# @param [String] service_sid The
|
|
20
|
-
#
|
|
19
|
+
# @param [String] service_sid The SID of the
|
|
20
|
+
# [Service](https://www.twilio.com/docs/chat/rest/services) the resource is
|
|
21
|
+
# associated with.
|
|
22
|
+
# @param [String] channel_sid The SID of the
|
|
23
|
+
# [Channel](https://www.twilio.com/docs/chat/channels) the ChannelWebhook resource
|
|
24
|
+
# belongs to.
|
|
21
25
|
# @return [WebhookList] WebhookList
|
|
22
26
|
def initialize(version, service_sid: nil, channel_sid: nil)
|
|
23
27
|
super(version)
|
|
@@ -112,13 +116,27 @@ module Twilio
|
|
|
112
116
|
##
|
|
113
117
|
# Retrieve a single page of WebhookInstance records from the API.
|
|
114
118
|
# Request is executed immediately.
|
|
115
|
-
# @param [webhook.Type] type The type
|
|
116
|
-
#
|
|
117
|
-
# @param [
|
|
118
|
-
#
|
|
119
|
-
# @param [
|
|
120
|
-
#
|
|
121
|
-
# @param [String]
|
|
119
|
+
# @param [webhook.Type] type The type of webhook. Can be: `webhook`, `studio`, or
|
|
120
|
+
# `trigger`.
|
|
121
|
+
# @param [String] configuration_url The URL of the webhook to call using the
|
|
122
|
+
# `configuration.method`.
|
|
123
|
+
# @param [webhook.Method] configuration_method The HTTP method used to call
|
|
124
|
+
# `configuration.url`. Can be: `GET` or `POST` and the default is `POST`.
|
|
125
|
+
# @param [String] configuration_filters The events that cause us to call the
|
|
126
|
+
# Channel Webhook. Used when `type` is `webhook`. This parameter takes only one
|
|
127
|
+
# event. To specify more than one event, repeat this parameter for each event. For
|
|
128
|
+
# the list of possible events, see [Webhook Event
|
|
129
|
+
# Triggers](https://www.twilio.com/docs/chat/webhook-events#webhook-event-trigger).
|
|
130
|
+
# @param [String] configuration_triggers A string that will cause us to call the
|
|
131
|
+
# webhook when it is found in a message body. This parameter takes only one
|
|
132
|
+
# trigger string. To specify more than one, repeat this parameter for each trigger
|
|
133
|
+
# string up to a total of 5 trigger strings. Used only when `type` = `trigger`.
|
|
134
|
+
# @param [String] configuration_flow_sid The SID of the Studio
|
|
135
|
+
# [Flow](https://www.twilio.com/docs/studio/rest-api/flow) to call when an event
|
|
136
|
+
# in `configuration.filters` occurs. Used only when `type` is `studio`.
|
|
137
|
+
# @param [String] configuration_retry_count The number of times to retry the
|
|
138
|
+
# webhook if the first attempt fails. Can be an integer between 0 and 3,
|
|
139
|
+
# inclusive, and the default is 0.
|
|
122
140
|
# @return [WebhookInstance] Newly created WebhookInstance
|
|
123
141
|
def create(type: nil, configuration_url: :unset, configuration_method: :unset, configuration_filters: :unset, configuration_triggers: :unset, configuration_flow_sid: :unset, configuration_retry_count: :unset)
|
|
124
142
|
data = Twilio::Values.of({
|
|
@@ -190,9 +208,14 @@ module Twilio
|
|
|
190
208
|
##
|
|
191
209
|
# Initialize the WebhookContext
|
|
192
210
|
# @param [Version] version Version that contains the resource
|
|
193
|
-
# @param [String] service_sid The
|
|
194
|
-
#
|
|
195
|
-
#
|
|
211
|
+
# @param [String] service_sid The SID of the
|
|
212
|
+
# [Service](https://www.twilio.com/docs/chat/rest/services) to fetch the resource
|
|
213
|
+
# from.
|
|
214
|
+
# @param [String] channel_sid The SID of the
|
|
215
|
+
# [Channel](https://www.twilio.com/docs/chat/channels) the resource to fetch
|
|
216
|
+
# belongs to.
|
|
217
|
+
# @param [String] sid The Twilio-provided string that uniquely identifies the
|
|
218
|
+
# ChannelWebhook resource to fetch.
|
|
196
219
|
# @return [WebhookContext] WebhookContext
|
|
197
220
|
def initialize(version, service_sid, channel_sid, sid)
|
|
198
221
|
super(version)
|
|
@@ -225,12 +248,25 @@ module Twilio
|
|
|
225
248
|
|
|
226
249
|
##
|
|
227
250
|
# Update the WebhookInstance
|
|
228
|
-
# @param [String] configuration_url The
|
|
229
|
-
#
|
|
230
|
-
# @param [
|
|
231
|
-
#
|
|
232
|
-
# @param [String]
|
|
233
|
-
#
|
|
251
|
+
# @param [String] configuration_url The URL of the webhook to call using the
|
|
252
|
+
# `configuration.method`.
|
|
253
|
+
# @param [webhook.Method] configuration_method The HTTP method used to call
|
|
254
|
+
# `configuration.url`. Can be: `GET` or `POST` and the default is `POST`.
|
|
255
|
+
# @param [String] configuration_filters The events that cause us to call the
|
|
256
|
+
# Channel Webhook. Used when `type` is `webhook`. This parameter takes only one
|
|
257
|
+
# event. To specify more than one event, repeat this parameter for each event. For
|
|
258
|
+
# the list of possible events, see [Webhook Event
|
|
259
|
+
# Triggers](https://www.twilio.com/docs/chat/webhook-events#webhook-event-trigger).
|
|
260
|
+
# @param [String] configuration_triggers A string that will cause us to call the
|
|
261
|
+
# webhook when it is found in a message body. This parameter takes only one
|
|
262
|
+
# trigger string. To specify more than one, repeat this parameter for each trigger
|
|
263
|
+
# string up to a total of 5 trigger strings. Used only when `type` = `trigger`.
|
|
264
|
+
# @param [String] configuration_flow_sid The SID of the Studio
|
|
265
|
+
# [Flow](https://www.twilio.com/docs/studio/rest-api/flow) to call when an event
|
|
266
|
+
# in `configuration.filters` occurs. Used only when `type` = `studio`.
|
|
267
|
+
# @param [String] configuration_retry_count The number of times to retry the
|
|
268
|
+
# webhook if the first attempt fails. Can be an integer between 0 and 3,
|
|
269
|
+
# inclusive, and the default is 0.
|
|
234
270
|
# @return [WebhookInstance] Updated WebhookInstance
|
|
235
271
|
def update(configuration_url: :unset, configuration_method: :unset, configuration_filters: :unset, configuration_triggers: :unset, configuration_flow_sid: :unset, configuration_retry_count: :unset)
|
|
236
272
|
data = Twilio::Values.of({
|
|
@@ -284,9 +320,14 @@ module Twilio
|
|
|
284
320
|
# Initialize the WebhookInstance
|
|
285
321
|
# @param [Version] version Version that contains the resource
|
|
286
322
|
# @param [Hash] payload payload that contains response from Twilio
|
|
287
|
-
# @param [String] service_sid The
|
|
288
|
-
#
|
|
289
|
-
#
|
|
323
|
+
# @param [String] service_sid The SID of the
|
|
324
|
+
# [Service](https://www.twilio.com/docs/chat/rest/services) the resource is
|
|
325
|
+
# associated with.
|
|
326
|
+
# @param [String] channel_sid The SID of the
|
|
327
|
+
# [Channel](https://www.twilio.com/docs/chat/channels) the ChannelWebhook resource
|
|
328
|
+
# belongs to.
|
|
329
|
+
# @param [String] sid The Twilio-provided string that uniquely identifies the
|
|
330
|
+
# ChannelWebhook resource to fetch.
|
|
290
331
|
# @return [WebhookInstance] WebhookInstance
|
|
291
332
|
def initialize(version, payload, service_sid: nil, channel_sid: nil, sid: nil)
|
|
292
333
|
super(version)
|
|
@@ -330,55 +371,55 @@ module Twilio
|
|
|
330
371
|
end
|
|
331
372
|
|
|
332
373
|
##
|
|
333
|
-
# @return [String] The
|
|
374
|
+
# @return [String] The unique string that identifies the resource
|
|
334
375
|
def sid
|
|
335
376
|
@properties['sid']
|
|
336
377
|
end
|
|
337
378
|
|
|
338
379
|
##
|
|
339
|
-
# @return [String] The
|
|
380
|
+
# @return [String] The SID of the Account that created the resource
|
|
340
381
|
def account_sid
|
|
341
382
|
@properties['account_sid']
|
|
342
383
|
end
|
|
343
384
|
|
|
344
385
|
##
|
|
345
|
-
# @return [String] The
|
|
386
|
+
# @return [String] The SID of the Service that the resource is associated with
|
|
346
387
|
def service_sid
|
|
347
388
|
@properties['service_sid']
|
|
348
389
|
end
|
|
349
390
|
|
|
350
391
|
##
|
|
351
|
-
# @return [String] The
|
|
392
|
+
# @return [String] The SID of the Channel the ChannelWebhook resource belongs to
|
|
352
393
|
def channel_sid
|
|
353
394
|
@properties['channel_sid']
|
|
354
395
|
end
|
|
355
396
|
|
|
356
397
|
##
|
|
357
|
-
# @return [String] The type
|
|
398
|
+
# @return [String] The type of webhook
|
|
358
399
|
def type
|
|
359
400
|
@properties['type']
|
|
360
401
|
end
|
|
361
402
|
|
|
362
403
|
##
|
|
363
|
-
# @return [String] The
|
|
404
|
+
# @return [String] The absolute URL of the resource
|
|
364
405
|
def url
|
|
365
406
|
@properties['url']
|
|
366
407
|
end
|
|
367
408
|
|
|
368
409
|
##
|
|
369
|
-
# @return [Hash] The configuration
|
|
410
|
+
# @return [Hash] The JSON string that describes the configuration object for the channel webhook
|
|
370
411
|
def configuration
|
|
371
412
|
@properties['configuration']
|
|
372
413
|
end
|
|
373
414
|
|
|
374
415
|
##
|
|
375
|
-
# @return [Time] The
|
|
416
|
+
# @return [Time] The RFC 2822 date and time in GMT when the resource was created
|
|
376
417
|
def date_created
|
|
377
418
|
@properties['date_created']
|
|
378
419
|
end
|
|
379
420
|
|
|
380
421
|
##
|
|
381
|
-
# @return [Time] The
|
|
422
|
+
# @return [Time] The RFC 2822 date and time in GMT when the resource was last updated
|
|
382
423
|
def date_updated
|
|
383
424
|
@properties['date_updated']
|
|
384
425
|
end
|
|
@@ -392,12 +433,25 @@ module Twilio
|
|
|
392
433
|
|
|
393
434
|
##
|
|
394
435
|
# Update the WebhookInstance
|
|
395
|
-
# @param [String] configuration_url The
|
|
396
|
-
#
|
|
397
|
-
# @param [
|
|
398
|
-
#
|
|
399
|
-
# @param [String]
|
|
400
|
-
#
|
|
436
|
+
# @param [String] configuration_url The URL of the webhook to call using the
|
|
437
|
+
# `configuration.method`.
|
|
438
|
+
# @param [webhook.Method] configuration_method The HTTP method used to call
|
|
439
|
+
# `configuration.url`. Can be: `GET` or `POST` and the default is `POST`.
|
|
440
|
+
# @param [String] configuration_filters The events that cause us to call the
|
|
441
|
+
# Channel Webhook. Used when `type` is `webhook`. This parameter takes only one
|
|
442
|
+
# event. To specify more than one event, repeat this parameter for each event. For
|
|
443
|
+
# the list of possible events, see [Webhook Event
|
|
444
|
+
# Triggers](https://www.twilio.com/docs/chat/webhook-events#webhook-event-trigger).
|
|
445
|
+
# @param [String] configuration_triggers A string that will cause us to call the
|
|
446
|
+
# webhook when it is found in a message body. This parameter takes only one
|
|
447
|
+
# trigger string. To specify more than one, repeat this parameter for each trigger
|
|
448
|
+
# string up to a total of 5 trigger strings. Used only when `type` = `trigger`.
|
|
449
|
+
# @param [String] configuration_flow_sid The SID of the Studio
|
|
450
|
+
# [Flow](https://www.twilio.com/docs/studio/rest-api/flow) to call when an event
|
|
451
|
+
# in `configuration.filters` occurs. Used only when `type` = `studio`.
|
|
452
|
+
# @param [String] configuration_retry_count The number of times to retry the
|
|
453
|
+
# webhook if the first attempt fails. Can be an integer between 0 and 3,
|
|
454
|
+
# inclusive, and the default is 0.
|
|
401
455
|
# @return [WebhookInstance] Updated WebhookInstance
|
|
402
456
|
def update(configuration_url: :unset, configuration_method: :unset, configuration_filters: :unset, configuration_triggers: :unset, configuration_flow_sid: :unset, configuration_retry_count: :unset)
|
|
403
457
|
context.update(
|