twilio-ruby 5.22.1 → 5.22.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +12 -0
- data/README.md +2 -2
- data/lib/twilio-ruby/rest/api/v2010/account/address.rb +7 -0
- data/lib/twilio-ruby/rest/autopilot.rb +1 -1
- data/lib/twilio-ruby/rest/autopilot/v1.rb +2 -2
- data/lib/twilio-ruby/rest/autopilot/v1/assistant.rb +55 -61
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/defaults.rb +17 -9
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/dialogue.rb +18 -10
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/field_type.rb +37 -28
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/field_type/field_value.rb +39 -32
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/model_build.rb +37 -27
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/query.rb +58 -53
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/style_sheet.rb +15 -9
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/task.rb +53 -43
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/task/field.rb +38 -25
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/task/sample.rb +56 -50
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_actions.rb +27 -15
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_statistics.rb +24 -18
- data/lib/twilio-ruby/rest/client.rb +39 -39
- data/lib/twilio-ruby/rest/notify.rb +4 -2
- data/lib/twilio-ruby/rest/notify/v1.rb +4 -2
- data/lib/twilio-ruby/rest/notify/v1/credential.rb +47 -42
- data/lib/twilio-ruby/rest/notify/v1/service.rb +118 -103
- data/lib/twilio-ruby/rest/notify/v1/service/binding.rb +74 -63
- data/lib/twilio-ruby/rest/notify/v1/service/notification.rb +108 -111
- data/lib/twilio-ruby/rest/proxy/v1/service/phone_number.rb +7 -0
- data/lib/twilio-ruby/rest/trunking.rb +2 -2
- data/lib/twilio-ruby/rest/trunking/v1.rb +2 -2
- data/lib/twilio-ruby/rest/trunking/v1/trunk.rb +82 -82
- data/lib/twilio-ruby/rest/trunking/v1/trunk/credential_list.rb +19 -14
- data/lib/twilio-ruby/rest/trunking/v1/trunk/ip_access_control_list.rb +16 -15
- data/lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb +51 -50
- data/lib/twilio-ruby/rest/trunking/v1/trunk/phone_number.rb +41 -32
- data/lib/twilio-ruby/rest/trunking/v1/trunk/terminating_sip_domain.rb +30 -31
- data/lib/twilio-ruby/twiml/voice_response.rb +3 -2
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/integration/api/v2010/account/address_spec.rb +4 -0
- data/spec/integration/proxy/v1/service/phone_number_spec.rb +8 -4
- metadata +2 -2
@@ -17,7 +17,9 @@ module Twilio
|
|
17
17
|
##
|
18
18
|
# Initialize the BindingList
|
19
19
|
# @param [Version] version Version that contains the resource
|
20
|
-
# @param [String] service_sid The
|
20
|
+
# @param [String] service_sid The SID of the
|
21
|
+
# [Service](https://www.twilio.com/docs/notify/api/service-resource) the resource
|
22
|
+
# is associated with.
|
21
23
|
# @return [BindingList] BindingList
|
22
24
|
def initialize(version, service_sid: nil)
|
23
25
|
super(version)
|
@@ -30,31 +32,31 @@ module Twilio
|
|
30
32
|
##
|
31
33
|
# Retrieve a single page of BindingInstance records from the API.
|
32
34
|
# Request is executed immediately.
|
33
|
-
# @param [String] identity The
|
34
|
-
#
|
35
|
-
#
|
36
|
-
#
|
37
|
-
#
|
38
|
-
# `sms`,
|
39
|
-
# @param [String] address The
|
40
|
-
#
|
41
|
-
#
|
42
|
-
#
|
43
|
-
# @param [String] tag
|
44
|
-
#
|
45
|
-
#
|
46
|
-
#
|
47
|
-
#
|
48
|
-
#
|
49
|
-
# [Service](https://www.twilio.com/docs/api/notify/rest/services). The current
|
35
|
+
# @param [String] identity The `identity` value that uniquely identifies the new
|
36
|
+
# resource's [User](https://www.twilio.com/docs/chat/rest/users) within the
|
37
|
+
# [Service](https://www.twilio.com/docs/notify/api/service-resource). Up to 20
|
38
|
+
# Bindings can be created for the same Identity in a given Service.
|
39
|
+
# @param [binding.BindingType] binding_type The transport technology to use for
|
40
|
+
# the Binding. Can be: `apn`, `fcm`, `gcm`, `sms`, or `facebook-messenger`.
|
41
|
+
# @param [String] address The channel-specific address. For APNS, the device
|
42
|
+
# token. For FCM and GCM, the registration token. For SMS, a phone number in E.164
|
43
|
+
# format. For Facebook Messenger, the Messenger ID of the user or a phone number
|
44
|
+
# in E.164 format.
|
45
|
+
# @param [String] tag A tag that can be used to select the Bindings to notify.
|
46
|
+
# Repeat this parameter to specify more than one tag, up to a total of 20 tags.
|
47
|
+
# @param [String] notification_protocol_version The protocol version to use to
|
48
|
+
# send the notification. This defaults to the value of
|
49
|
+
# `default_xxxx_notification_protocol_version` for the protocol in the
|
50
|
+
# [Service](https://www.twilio.com/docs/notify/api/service-resource). The current
|
50
51
|
# version is `"3"` for `apn`, `fcm`, and `gcm` type Bindings. The parameter is not
|
51
52
|
# applicable to `sms` and `facebook-messenger` type Bindings as the data format is
|
52
53
|
# fixed.
|
53
|
-
# @param [String] credential_sid The
|
54
|
+
# @param [String] credential_sid The SID of the
|
55
|
+
# [Credential](https://www.twilio.com/docs/notify/api/credential-resource)
|
54
56
|
# resource to be used to send notifications to this Binding. If present, this
|
55
|
-
# overrides the Credential specified in the Service resource.
|
57
|
+
# overrides the Credential specified in the Service resource. Applies to only
|
56
58
|
# `apn`, `fcm`, and `gcm` type Bindings.
|
57
|
-
# @param [String] endpoint
|
59
|
+
# @param [String] endpoint Deprecated.
|
58
60
|
# @return [BindingInstance] Newly created BindingInstance
|
59
61
|
def create(identity: nil, binding_type: nil, address: nil, tag: :unset, notification_protocol_version: :unset, credential_sid: :unset, endpoint: :unset)
|
60
62
|
data = Twilio::Values.of({
|
@@ -80,15 +82,16 @@ module Twilio
|
|
80
82
|
# Lists BindingInstance records from the API as a list.
|
81
83
|
# Unlike stream(), this operation is eager and will load `limit` records into
|
82
84
|
# memory before returning.
|
83
|
-
# @param [Date] start_date Only
|
84
|
-
#
|
85
|
-
# @param [Date] end_date Only
|
86
|
-
#
|
87
|
-
# @param [String] identity
|
88
|
-
#
|
85
|
+
# @param [Date] start_date Only include usage that has occurred on or after this
|
86
|
+
# date. Specify the date in GMT and format as `YYYY-MM-DD`.
|
87
|
+
# @param [Date] end_date Only include usage that occurred on or before this date.
|
88
|
+
# Specify the date in GMT and format as `YYYY-MM-DD`.
|
89
|
+
# @param [String] identity The
|
90
|
+
# [User](https://www.twilio.com/docs/chat/rest/users)'s `identity` value of the
|
91
|
+
# resources to read.
|
89
92
|
# @param [String] tag Only list Bindings that have all of the specified Tags. The
|
90
|
-
# following implicit tags are available: all
|
91
|
-
# facebook-messenger
|
93
|
+
# following implicit tags are available: `all`, `apn`, `fcm`, `gcm`, `sms`,
|
94
|
+
# `facebook-messenger`. Up to 5 tags are allowed.
|
92
95
|
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
93
96
|
# guarantees to never return more than limit. Default is no limit
|
94
97
|
# @param [Integer] page_size Number of records to fetch per request, when
|
@@ -111,15 +114,16 @@ module Twilio
|
|
111
114
|
# Streams BindingInstance records from the API as an Enumerable.
|
112
115
|
# This operation lazily loads records as efficiently as possible until the limit
|
113
116
|
# is reached.
|
114
|
-
# @param [Date] start_date Only
|
115
|
-
#
|
116
|
-
# @param [Date] end_date Only
|
117
|
-
#
|
118
|
-
# @param [String] identity
|
119
|
-
#
|
117
|
+
# @param [Date] start_date Only include usage that has occurred on or after this
|
118
|
+
# date. Specify the date in GMT and format as `YYYY-MM-DD`.
|
119
|
+
# @param [Date] end_date Only include usage that occurred on or before this date.
|
120
|
+
# Specify the date in GMT and format as `YYYY-MM-DD`.
|
121
|
+
# @param [String] identity The
|
122
|
+
# [User](https://www.twilio.com/docs/chat/rest/users)'s `identity` value of the
|
123
|
+
# resources to read.
|
120
124
|
# @param [String] tag Only list Bindings that have all of the specified Tags. The
|
121
|
-
# following implicit tags are available: all
|
122
|
-
# facebook-messenger
|
125
|
+
# following implicit tags are available: `all`, `apn`, `fcm`, `gcm`, `sms`,
|
126
|
+
# `facebook-messenger`. Up to 5 tags are allowed.
|
123
127
|
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
124
128
|
# guarantees to never return more than limit. Default is no limit.
|
125
129
|
# @param [Integer] page_size Number of records to fetch per request, when
|
@@ -158,15 +162,16 @@ module Twilio
|
|
158
162
|
##
|
159
163
|
# Retrieve a single page of BindingInstance records from the API.
|
160
164
|
# Request is executed immediately.
|
161
|
-
# @param [Date] start_date Only
|
162
|
-
#
|
163
|
-
# @param [Date] end_date Only
|
164
|
-
#
|
165
|
-
# @param [String] identity
|
166
|
-
#
|
165
|
+
# @param [Date] start_date Only include usage that has occurred on or after this
|
166
|
+
# date. Specify the date in GMT and format as `YYYY-MM-DD`.
|
167
|
+
# @param [Date] end_date Only include usage that occurred on or before this date.
|
168
|
+
# Specify the date in GMT and format as `YYYY-MM-DD`.
|
169
|
+
# @param [String] identity The
|
170
|
+
# [User](https://www.twilio.com/docs/chat/rest/users)'s `identity` value of the
|
171
|
+
# resources to read.
|
167
172
|
# @param [String] tag Only list Bindings that have all of the specified Tags. The
|
168
|
-
# following implicit tags are available: all
|
169
|
-
# facebook-messenger
|
173
|
+
# following implicit tags are available: `all`, `apn`, `fcm`, `gcm`, `sms`,
|
174
|
+
# `facebook-messenger`. Up to 5 tags are allowed.
|
170
175
|
# @param [String] page_token PageToken provided by the API
|
171
176
|
# @param [Integer] page_number Page Number, this value is simply for client state
|
172
177
|
# @param [Integer] page_size Number of records to return, defaults to 50
|
@@ -246,8 +251,11 @@ module Twilio
|
|
246
251
|
##
|
247
252
|
# Initialize the BindingContext
|
248
253
|
# @param [Version] version Version that contains the resource
|
249
|
-
# @param [String] service_sid The
|
250
|
-
#
|
254
|
+
# @param [String] service_sid The SID of the
|
255
|
+
# [Service](https://www.twilio.com/docs/notify/api/service-resource) to fetch the
|
256
|
+
# resource from.
|
257
|
+
# @param [String] sid The Twilio-provided string that uniquely identifies the
|
258
|
+
# Binding resource to fetch.
|
251
259
|
# @return [BindingContext] BindingContext
|
252
260
|
def initialize(version, service_sid, sid)
|
253
261
|
super(version)
|
@@ -301,8 +309,11 @@ module Twilio
|
|
301
309
|
# Initialize the BindingInstance
|
302
310
|
# @param [Version] version Version that contains the resource
|
303
311
|
# @param [Hash] payload payload that contains response from Twilio
|
304
|
-
# @param [String] service_sid The
|
305
|
-
#
|
312
|
+
# @param [String] service_sid The SID of the
|
313
|
+
# [Service](https://www.twilio.com/docs/notify/api/service-resource) the resource
|
314
|
+
# is associated with.
|
315
|
+
# @param [String] sid The Twilio-provided string that uniquely identifies the
|
316
|
+
# Binding resource to fetch.
|
306
317
|
# @return [BindingInstance] BindingInstance
|
307
318
|
def initialize(version, payload, service_sid: nil, sid: nil)
|
308
319
|
super(version)
|
@@ -342,85 +353,85 @@ module Twilio
|
|
342
353
|
end
|
343
354
|
|
344
355
|
##
|
345
|
-
# @return [String] The
|
356
|
+
# @return [String] The unique string that identifies the resource
|
346
357
|
def sid
|
347
358
|
@properties['sid']
|
348
359
|
end
|
349
360
|
|
350
361
|
##
|
351
|
-
# @return [String] The
|
362
|
+
# @return [String] The SID of the Account that created the resource
|
352
363
|
def account_sid
|
353
364
|
@properties['account_sid']
|
354
365
|
end
|
355
366
|
|
356
367
|
##
|
357
|
-
# @return [String] The
|
368
|
+
# @return [String] The SID of the Service that the resource is associated with
|
358
369
|
def service_sid
|
359
370
|
@properties['service_sid']
|
360
371
|
end
|
361
372
|
|
362
373
|
##
|
363
|
-
# @return [String] The
|
374
|
+
# @return [String] The SID of the Credential resource to be used to send notifications to this Binding
|
364
375
|
def credential_sid
|
365
376
|
@properties['credential_sid']
|
366
377
|
end
|
367
378
|
|
368
379
|
##
|
369
|
-
# @return [Time] The
|
380
|
+
# @return [Time] The RFC 2822 date and time in GMT when the resource was created
|
370
381
|
def date_created
|
371
382
|
@properties['date_created']
|
372
383
|
end
|
373
384
|
|
374
385
|
##
|
375
|
-
# @return [Time] The
|
386
|
+
# @return [Time] The RFC 2822 date and time in GMT when the resource was last updated
|
376
387
|
def date_updated
|
377
388
|
@properties['date_updated']
|
378
389
|
end
|
379
390
|
|
380
391
|
##
|
381
|
-
# @return [String] The version
|
392
|
+
# @return [String] The protocol version to use to send the notification
|
382
393
|
def notification_protocol_version
|
383
394
|
@properties['notification_protocol_version']
|
384
395
|
end
|
385
396
|
|
386
397
|
##
|
387
|
-
# @return [String]
|
398
|
+
# @return [String] Deprecated
|
388
399
|
def endpoint
|
389
400
|
@properties['endpoint']
|
390
401
|
end
|
391
402
|
|
392
403
|
##
|
393
|
-
# @return [String] The
|
404
|
+
# @return [String] The `identity` value that identifies the new resource's User
|
394
405
|
def identity
|
395
406
|
@properties['identity']
|
396
407
|
end
|
397
408
|
|
398
409
|
##
|
399
|
-
# @return [String] The type of the Binding
|
410
|
+
# @return [String] The type of the Binding
|
400
411
|
def binding_type
|
401
412
|
@properties['binding_type']
|
402
413
|
end
|
403
414
|
|
404
415
|
##
|
405
|
-
# @return [String] The
|
416
|
+
# @return [String] The channel-specific address
|
406
417
|
def address
|
407
418
|
@properties['address']
|
408
419
|
end
|
409
420
|
|
410
421
|
##
|
411
|
-
# @return [String] The list of tags associated with this Binding
|
422
|
+
# @return [String] The list of tags associated with this Binding
|
412
423
|
def tags
|
413
424
|
@properties['tags']
|
414
425
|
end
|
415
426
|
|
416
427
|
##
|
417
|
-
# @return [String] The
|
428
|
+
# @return [String] The absolute URL of the Binding resource
|
418
429
|
def url
|
419
430
|
@properties['url']
|
420
431
|
end
|
421
432
|
|
422
433
|
##
|
423
|
-
# @return [String] The
|
434
|
+
# @return [String] The URLs of related resources
|
424
435
|
def links
|
425
436
|
@properties['links']
|
426
437
|
end
|
@@ -17,7 +17,9 @@ module Twilio
|
|
17
17
|
##
|
18
18
|
# Initialize the NotificationList
|
19
19
|
# @param [Version] version Version that contains the resource
|
20
|
-
# @param [String] service_sid The
|
20
|
+
# @param [String] service_sid The SID of the
|
21
|
+
# [Service](https://www.twilio.com/docs/notify/api/service-resource) the resource
|
22
|
+
# is associated with.
|
21
23
|
# @return [NotificationList] NotificationList
|
22
24
|
def initialize(version, service_sid: nil)
|
23
25
|
super(version)
|
@@ -30,98 +32,91 @@ module Twilio
|
|
30
32
|
##
|
31
33
|
# Retrieve a single page of NotificationInstance records from the API.
|
32
34
|
# Request is executed immediately.
|
33
|
-
# @param [String] body
|
34
|
-
#
|
35
|
-
#
|
36
|
-
#
|
37
|
-
#
|
38
|
-
#
|
39
|
-
#
|
40
|
-
#
|
41
|
-
#
|
42
|
-
#
|
43
|
-
#
|
44
|
-
#
|
45
|
-
#
|
46
|
-
#
|
47
|
-
#
|
48
|
-
#
|
49
|
-
#
|
50
|
-
#
|
51
|
-
#
|
52
|
-
#
|
53
|
-
#
|
54
|
-
#
|
55
|
-
#
|
56
|
-
#
|
57
|
-
#
|
58
|
-
#
|
59
|
-
#
|
60
|
-
#
|
61
|
-
# `data.
|
62
|
-
#
|
63
|
-
#
|
64
|
-
#
|
65
|
-
#
|
66
|
-
# APNS. This parameter is not supported by SMS and Facebook Messenger and is
|
67
|
-
# omitted from deliveries via those channels.
|
68
|
-
# @param [Hash] data This parameter specifies the custom key-value pairs of the
|
69
|
-
# notification's payload. Translates to `data` dictionary in FCM and GCM payload.
|
70
|
-
# FCM and GCM [reserves certain
|
35
|
+
# @param [String] body The notification text. For FCM and GCM, translates to
|
36
|
+
# `data.twi_body`. For APNS, translates to `aps.alert.body`. For SMS, translates
|
37
|
+
# to `body`. SMS requires either this `body` value, or a `media_url` attribute
|
38
|
+
# defined in the `sms` parameter of the notification.
|
39
|
+
# @param [notification.Priority] priority The priority of the notification. Can
|
40
|
+
# be: `low` or `high` and the default is `high`. A value of `low` optimizes the
|
41
|
+
# client app's battery consumption; however, notifications may be delivered with
|
42
|
+
# unspecified delay. For FCM and GCM, `low` priority is the same as `Normal`
|
43
|
+
# priority. For APNS `low` priority is the same as `5`. A value of `high` sends
|
44
|
+
# the notification immediately, and can wake up a sleeping device. For FCM and
|
45
|
+
# GCM, `high` is the same as `High` priority. For APNS, `high` is a priority `10`.
|
46
|
+
# SMS does not support this property.
|
47
|
+
# @param [String] ttl How long, in seconds, the notification is valid. Can be an
|
48
|
+
# integer between 0 and 2,419,200, which is 4 weeks, the default and the maximum
|
49
|
+
# supported time to live (TTL). Delivery should be attempted if the device is
|
50
|
+
# offline until the TTL elapses. Zero means that the notification delivery is
|
51
|
+
# attempted immediately, only once, and is not stored for future delivery. SMS
|
52
|
+
# does not support this property.
|
53
|
+
# @param [String] title The notification title. For FCM and GCM, this translates
|
54
|
+
# to the `data.twi_title` value. For APNS, this translates to the
|
55
|
+
# `aps.alert.title` value. SMS does not support this property. This field is not
|
56
|
+
# visible on iOS phones and tablets but appears on Apple Watch and Android
|
57
|
+
# devices.
|
58
|
+
# @param [String] sound The name of the sound to be played for the notification.
|
59
|
+
# For FCM and GCM, this Translates to `data.twi_sound`. For APNS, this translates
|
60
|
+
# to `aps.sound`. SMS does not support this property.
|
61
|
+
# @param [String] action The actions to display for the notification. For APNS,
|
62
|
+
# translates to the `aps.category` value. For GCM, translates to the
|
63
|
+
# `data.twi_action` value. For SMS, this parameter is not supported and is omitted
|
64
|
+
# from deliveries to those channels.
|
65
|
+
# @param [Hash] data The custom key-value pairs of the notification's payload. For
|
66
|
+
# FCM and GCM, this value translates to `data` in the FCM and GCM payloads. FCM
|
67
|
+
# and GCM [reserve certain
|
71
68
|
# keys](https://firebase.google.com/docs/cloud-messaging/http-server-ref) that
|
72
|
-
# cannot be used
|
73
|
-
#
|
74
|
-
#
|
75
|
-
#
|
76
|
-
#
|
77
|
-
#
|
78
|
-
#
|
79
|
-
#
|
80
|
-
#
|
81
|
-
#
|
82
|
-
# attributes. Adds custom key-value pairs to the root of the dictionary. Refer to
|
69
|
+
# cannot be used in those channels. For APNS, attributes of `data` are inserted
|
70
|
+
# into the APNS payload as custom properties outside of the `aps` dictionary. In
|
71
|
+
# all channels, we reserve keys that start with `twi_` for future use. Custom keys
|
72
|
+
# that start with `twi_` are not allowed and are rejected as 400 Bad request with
|
73
|
+
# no delivery attempted. For SMS, this parameter is not supported and is omitted
|
74
|
+
# from deliveries to those channels.
|
75
|
+
# @param [Hash] apn The APNS-specific payload that overrides corresponding
|
76
|
+
# attributes in the generic payload for APNS Bindings. This property maps to the
|
77
|
+
# APNS `Payload` item, therefore the `aps` key must be used to change standard
|
78
|
+
# attributes. Adds custom key-value pairs to the root of the dictionary. See the
|
83
79
|
# [APNS
|
84
|
-
# documentation](https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CommunicatingwithAPNs.html) for more details.
|
85
|
-
# @param [Hash] gcm GCM
|
86
|
-
# in generic payload for Bindings
|
87
|
-
#
|
80
|
+
# documentation](https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CommunicatingwithAPNs.html) for more details. We reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed.
|
81
|
+
# @param [Hash] gcm The GCM-specific payload that overrides corresponding
|
82
|
+
# attributes in the generic payload for GCM Bindings. This property maps to the
|
83
|
+
# root JSON dictionary. See the [GCM
|
88
84
|
# documentation](https://developers.google.com/cloud-messaging/http-server-ref)
|
89
|
-
# for more details.
|
90
|
-
# `notification_key` are not allowed.
|
91
|
-
#
|
92
|
-
#
|
93
|
-
# keys](https://firebase.google.com/docs/cloud-messaging/http-server-ref)
|
94
|
-
#
|
95
|
-
#
|
96
|
-
#
|
97
|
-
#
|
98
|
-
#
|
99
|
-
#
|
100
|
-
#
|
101
|
-
#
|
102
|
-
#
|
103
|
-
# @param [Hash]
|
104
|
-
#
|
105
|
-
#
|
106
|
-
# [
|
107
|
-
#
|
108
|
-
#
|
109
|
-
#
|
110
|
-
#
|
111
|
-
#
|
112
|
-
#
|
113
|
-
#
|
114
|
-
# @param [String]
|
115
|
-
#
|
116
|
-
#
|
117
|
-
#
|
118
|
-
#
|
119
|
-
#
|
120
|
-
#
|
121
|
-
#
|
122
|
-
#
|
123
|
-
#
|
124
|
-
# to notify all Bindings of the given type.
|
85
|
+
# for more details. Target parameters `to`, `registration_ids`, and
|
86
|
+
# `notification_key` are not allowed. We reserve keys that start with `twi_` for
|
87
|
+
# future use. Custom keys that start with `twi_` are not allowed. GCM also
|
88
|
+
# [reserves certain
|
89
|
+
# keys](https://firebase.google.com/docs/cloud-messaging/http-server-ref).
|
90
|
+
# @param [Hash] sms The SMS-specific payload that overrides corresponding
|
91
|
+
# attributes in the generic payload for SMS Bindings. Each attribute in this
|
92
|
+
# value maps to the corresponding `form` parameter of the Twilio
|
93
|
+
# [Message](https://www.twilio.com/docs/sms/send-messages) resource. These
|
94
|
+
# parameters of the Message resource are supported in snake case format: `body`,
|
95
|
+
# `media_urls`, `status_callback`, and `max_price`. The `status_callback`
|
96
|
+
# parameter overrides the corresponding parameter in the messaging service, if
|
97
|
+
# configured. The `media_urls` property expects a JSON array.
|
98
|
+
# @param [Hash] facebook_messenger Deprecated.
|
99
|
+
# @param [Hash] fcm The FCM-specific payload that overrides corresponding
|
100
|
+
# attributes in the generic payload for FCM Bindings. This property maps to the
|
101
|
+
# root JSON dictionary. See the [FCM
|
102
|
+
# documentation](https://firebase.google.com/docs/cloud-messaging/http-server-ref#downstream) for more details. Target parameters `to`, `registration_ids`, `condition`, and `notification_key` are not allowed in this parameter. We reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed. FCM also [reserves certain keys](https://firebase.google.com/docs/cloud-messaging/http-server-ref), which cannot be used in that channel.
|
103
|
+
# @param [String] segment The Segment resource is deprecated. Use the `tag`
|
104
|
+
# parameter, instead.
|
105
|
+
# @param [Hash] alexa Deprecated.
|
106
|
+
# @param [String] to_binding The destination address specified as a JSON string.
|
107
|
+
# Multiple `to_binding` parameters can be included but the total size of the
|
108
|
+
# request entity should not exceed 1MB. This is typically sufficient for 10,000
|
109
|
+
# phone numbers.
|
110
|
+
# @param [String] identity The `identity` value that uniquely identifies the new
|
111
|
+
# resource's [User](https://www.twilio.com/docs/chat/rest/users) within the
|
112
|
+
# [Service](https://www.twilio.com/docs/notify/api/service-resource). Delivery
|
113
|
+
# will be attempted only to Bindings with an Identity in this list. No more than
|
114
|
+
# 20 items are allowed in this list.
|
115
|
+
# @param [String] tag A tag that selects the Bindings to notify. Repeat this
|
116
|
+
# parameter to specify more than one tag, up to a total of 5 tags. The implicit
|
117
|
+
# tag `all` is available to notify all Bindings in a Service instance. Similarly,
|
118
|
+
# the implicit tags `apn`, `fcm`, `gcm`, `sms` and `facebook-messenger` are
|
119
|
+
# available to notify all Bindings in a specific channel.
|
125
120
|
# @return [NotificationInstance] Newly created NotificationInstance
|
126
121
|
def create(body: :unset, priority: :unset, ttl: :unset, title: :unset, sound: :unset, action: :unset, data: :unset, apn: :unset, gcm: :unset, sms: :unset, facebook_messenger: :unset, fcm: :unset, segment: :unset, alexa: :unset, to_binding: :unset, identity: :unset, tag: :unset)
|
127
122
|
data = Twilio::Values.of({
|
@@ -198,7 +193,9 @@ module Twilio
|
|
198
193
|
# Initialize the NotificationInstance
|
199
194
|
# @param [Version] version Version that contains the resource
|
200
195
|
# @param [Hash] payload payload that contains response from Twilio
|
201
|
-
# @param [String] service_sid The
|
196
|
+
# @param [String] service_sid The SID of the
|
197
|
+
# [Service](https://www.twilio.com/docs/notify/api/service-resource) the resource
|
198
|
+
# is associated with.
|
202
199
|
# @return [NotificationInstance] NotificationInstance
|
203
200
|
def initialize(version, payload, service_sid: nil)
|
204
201
|
super(version)
|
@@ -229,121 +226,121 @@ module Twilio
|
|
229
226
|
end
|
230
227
|
|
231
228
|
##
|
232
|
-
# @return [String] The
|
229
|
+
# @return [String] The unique string that identifies the resource
|
233
230
|
def sid
|
234
231
|
@properties['sid']
|
235
232
|
end
|
236
233
|
|
237
234
|
##
|
238
|
-
# @return [String] The
|
235
|
+
# @return [String] The SID of the Account that created the resource
|
239
236
|
def account_sid
|
240
237
|
@properties['account_sid']
|
241
238
|
end
|
242
239
|
|
243
240
|
##
|
244
|
-
# @return [String] The
|
241
|
+
# @return [String] The SID of the Service that the resource is associated with
|
245
242
|
def service_sid
|
246
243
|
@properties['service_sid']
|
247
244
|
end
|
248
245
|
|
249
246
|
##
|
250
|
-
# @return [Time] The
|
247
|
+
# @return [Time] The RFC 2822 date and time in GMT when the resource was created
|
251
248
|
def date_created
|
252
249
|
@properties['date_created']
|
253
250
|
end
|
254
251
|
|
255
252
|
##
|
256
|
-
# @return [String]
|
253
|
+
# @return [String] The list of identity values of the Users to notify
|
257
254
|
def identities
|
258
255
|
@properties['identities']
|
259
256
|
end
|
260
257
|
|
261
258
|
##
|
262
|
-
# @return [String]
|
259
|
+
# @return [String] The tags that select the Bindings to notify
|
263
260
|
def tags
|
264
261
|
@properties['tags']
|
265
262
|
end
|
266
263
|
|
267
264
|
##
|
268
|
-
# @return [String] The
|
265
|
+
# @return [String] The list of Segments to notify
|
269
266
|
def segments
|
270
267
|
@properties['segments']
|
271
268
|
end
|
272
269
|
|
273
270
|
##
|
274
|
-
# @return [notification.Priority]
|
271
|
+
# @return [notification.Priority] The priority of the notification
|
275
272
|
def priority
|
276
273
|
@properties['priority']
|
277
274
|
end
|
278
275
|
|
279
276
|
##
|
280
|
-
# @return [String]
|
277
|
+
# @return [String] How long, in seconds, the notification is valid
|
281
278
|
def ttl
|
282
279
|
@properties['ttl']
|
283
280
|
end
|
284
281
|
|
285
282
|
##
|
286
|
-
# @return [String]
|
283
|
+
# @return [String] The notification title
|
287
284
|
def title
|
288
285
|
@properties['title']
|
289
286
|
end
|
290
287
|
|
291
288
|
##
|
292
|
-
# @return [String]
|
289
|
+
# @return [String] The notification body text
|
293
290
|
def body
|
294
291
|
@properties['body']
|
295
292
|
end
|
296
293
|
|
297
294
|
##
|
298
|
-
# @return [String]
|
295
|
+
# @return [String] The name of the sound to be played for the notification
|
299
296
|
def sound
|
300
297
|
@properties['sound']
|
301
298
|
end
|
302
299
|
|
303
300
|
##
|
304
|
-
# @return [String]
|
301
|
+
# @return [String] The actions to display for the notification
|
305
302
|
def action
|
306
303
|
@properties['action']
|
307
304
|
end
|
308
305
|
|
309
306
|
##
|
310
|
-
# @return [Hash]
|
307
|
+
# @return [Hash] The custom key-value pairs of the notification's payload
|
311
308
|
def data
|
312
309
|
@properties['data']
|
313
310
|
end
|
314
311
|
|
315
312
|
##
|
316
|
-
# @return [Hash] APNS
|
313
|
+
# @return [Hash] The APNS-specific payload that overrides corresponding attributes in a generic payload for APNS Bindings
|
317
314
|
def apn
|
318
315
|
@properties['apn']
|
319
316
|
end
|
320
317
|
|
321
318
|
##
|
322
|
-
# @return [Hash] GCM
|
319
|
+
# @return [Hash] The GCM-specific payload that overrides corresponding attributes in generic payload for GCM Bindings
|
323
320
|
def gcm
|
324
321
|
@properties['gcm']
|
325
322
|
end
|
326
323
|
|
327
324
|
##
|
328
|
-
# @return [Hash] FCM
|
325
|
+
# @return [Hash] The FCM-specific payload that overrides corresponding attributes in generic payload for FCM Bindings
|
329
326
|
def fcm
|
330
327
|
@properties['fcm']
|
331
328
|
end
|
332
329
|
|
333
330
|
##
|
334
|
-
# @return [Hash] SMS
|
331
|
+
# @return [Hash] The SMS-specific payload that overrides corresponding attributes in generic payload for SMS Bindings
|
335
332
|
def sms
|
336
333
|
@properties['sms']
|
337
334
|
end
|
338
335
|
|
339
336
|
##
|
340
|
-
# @return [Hash]
|
337
|
+
# @return [Hash] Deprecated
|
341
338
|
def facebook_messenger
|
342
339
|
@properties['facebook_messenger']
|
343
340
|
end
|
344
341
|
|
345
342
|
##
|
346
|
-
# @return [Hash]
|
343
|
+
# @return [Hash] Deprecated
|
347
344
|
def alexa
|
348
345
|
@properties['alexa']
|
349
346
|
end
|