twilio-ruby 5.22.1 → 5.22.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 (40) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +12 -0
  3. data/README.md +2 -2
  4. data/lib/twilio-ruby/rest/api/v2010/account/address.rb +7 -0
  5. data/lib/twilio-ruby/rest/autopilot.rb +1 -1
  6. data/lib/twilio-ruby/rest/autopilot/v1.rb +2 -2
  7. data/lib/twilio-ruby/rest/autopilot/v1/assistant.rb +55 -61
  8. data/lib/twilio-ruby/rest/autopilot/v1/assistant/defaults.rb +17 -9
  9. data/lib/twilio-ruby/rest/autopilot/v1/assistant/dialogue.rb +18 -10
  10. data/lib/twilio-ruby/rest/autopilot/v1/assistant/field_type.rb +37 -28
  11. data/lib/twilio-ruby/rest/autopilot/v1/assistant/field_type/field_value.rb +39 -32
  12. data/lib/twilio-ruby/rest/autopilot/v1/assistant/model_build.rb +37 -27
  13. data/lib/twilio-ruby/rest/autopilot/v1/assistant/query.rb +58 -53
  14. data/lib/twilio-ruby/rest/autopilot/v1/assistant/style_sheet.rb +15 -9
  15. data/lib/twilio-ruby/rest/autopilot/v1/assistant/task.rb +53 -43
  16. data/lib/twilio-ruby/rest/autopilot/v1/assistant/task/field.rb +38 -25
  17. data/lib/twilio-ruby/rest/autopilot/v1/assistant/task/sample.rb +56 -50
  18. data/lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_actions.rb +27 -15
  19. data/lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_statistics.rb +24 -18
  20. data/lib/twilio-ruby/rest/client.rb +39 -39
  21. data/lib/twilio-ruby/rest/notify.rb +4 -2
  22. data/lib/twilio-ruby/rest/notify/v1.rb +4 -2
  23. data/lib/twilio-ruby/rest/notify/v1/credential.rb +47 -42
  24. data/lib/twilio-ruby/rest/notify/v1/service.rb +118 -103
  25. data/lib/twilio-ruby/rest/notify/v1/service/binding.rb +74 -63
  26. data/lib/twilio-ruby/rest/notify/v1/service/notification.rb +108 -111
  27. data/lib/twilio-ruby/rest/proxy/v1/service/phone_number.rb +7 -0
  28. data/lib/twilio-ruby/rest/trunking.rb +2 -2
  29. data/lib/twilio-ruby/rest/trunking/v1.rb +2 -2
  30. data/lib/twilio-ruby/rest/trunking/v1/trunk.rb +82 -82
  31. data/lib/twilio-ruby/rest/trunking/v1/trunk/credential_list.rb +19 -14
  32. data/lib/twilio-ruby/rest/trunking/v1/trunk/ip_access_control_list.rb +16 -15
  33. data/lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb +51 -50
  34. data/lib/twilio-ruby/rest/trunking/v1/trunk/phone_number.rb +41 -32
  35. data/lib/twilio-ruby/rest/trunking/v1/trunk/terminating_sip_domain.rb +30 -31
  36. data/lib/twilio-ruby/twiml/voice_response.rb +3 -2
  37. data/lib/twilio-ruby/version.rb +1 -1
  38. data/spec/integration/api/v2010/account/address_spec.rb +4 -0
  39. data/spec/integration/proxy/v1/service/phone_number_spec.rb +8 -4
  40. 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 service_sid
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 Identity to which this Binding belongs to. Identity
34
- # is defined by your application. Up to 20 Bindings can be created for the same
35
- # Identity in a given Service.
36
- # @param [binding.BindingType] binding_type The type of the Binding. This
37
- # determines the transport technology to use. Allowed values: `apn`, `fcm`, `gcm`,
38
- # `sms`, and `facebook-messenger`.
39
- # @param [String] address The address specific to the channel. For APNS it is the
40
- # device token. For FCM and GCM it is the registration token. For SMS it is a
41
- # phone number in E.164 format. For Facebook Messenger it is the Messenger ID of
42
- # the user or a phone number in E.164 format.
43
- # @param [String] tag The list of tags associated with this Binding. Tags can be
44
- # used to select the Bindings to use when sending a notification. Maximum 20 tags
45
- # are allowed.
46
- # @param [String] notification_protocol_version The version of the protocol (data
47
- # format) used to send the notification. This defaults to the value of
48
- # DefaultXXXNotificationProtocolVersion in the
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 unique identifier (SID) of the Credential
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. Applicable only to
57
+ # overrides the Credential specified in the Service resource. Applies to only
56
58
  # `apn`, `fcm`, and `gcm` type Bindings.
57
- # @param [String] endpoint DEPRECATED*
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 list Bindings created on or after the given date.
84
- # Should be formatted as YYYY-MM-DD. All dates considered in UTC.
85
- # @param [Date] end_date Only list Bindings created on or before the given date.
86
- # Should be formatted as YYYY-MM-DD. All dates considered in UTC.
87
- # @param [String] identity Only list Bindings that have any of the specified
88
- # Identities.
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, apn, fcm, gcm, sms,
91
- # facebook-messenger. Maximum 5 tags are allowed.
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 list Bindings created on or after the given date.
115
- # Should be formatted as YYYY-MM-DD. All dates considered in UTC.
116
- # @param [Date] end_date Only list Bindings created on or before the given date.
117
- # Should be formatted as YYYY-MM-DD. All dates considered in UTC.
118
- # @param [String] identity Only list Bindings that have any of the specified
119
- # Identities.
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, apn, fcm, gcm, sms,
122
- # facebook-messenger. Maximum 5 tags are allowed.
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 list Bindings created on or after the given date.
162
- # Should be formatted as YYYY-MM-DD. All dates considered in UTC.
163
- # @param [Date] end_date Only list Bindings created on or before the given date.
164
- # Should be formatted as YYYY-MM-DD. All dates considered in UTC.
165
- # @param [String] identity Only list Bindings that have any of the specified
166
- # Identities.
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, apn, fcm, gcm, sms,
169
- # facebook-messenger. Maximum 5 tags are allowed.
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 service_sid
250
- # @param [String] sid The sid
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 service_sid
305
- # @param [String] sid The sid
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 sid
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 account_sid
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 service_sid
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 unique identifier of the Credential resource to be used to send notifications to this Binding.
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 date_created
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 date_updated
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 of the protocol used to send the notification.
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] DEPRECATED*
398
+ # @return [String] Deprecated
388
399
  def endpoint
389
400
  @properties['endpoint']
390
401
  end
391
402
 
392
403
  ##
393
- # @return [String] The Identity to which this Binding belongs to.
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 address specific to the channel.
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 url
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 links
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 service_sid
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 (optional for all except Alexa) Indicates the notification
34
- # body text. Translates to `data.twi_body` for FCM and GCM, `aps.alert.body` for
35
- # APNS, `Body` for SMS and Facebook Messenger and `request.message.data` for
36
- # Alexa. For SMS either this, `body`, or the `media_url` attribute of the `Sms`
37
- # parameter is required. For Facebook Messenger either this parameter or the body
38
- # attribute in the `FacebookMessenger` parameter is required.
39
- # @param [notification.Priority] priority Two priorities defined: `low` and `high`
40
- # (default). `low` optimizes the client app's battery consumption, and
41
- # notifications may be delivered with unspecified delay. This is the same as
42
- # Normal priority for FCM and GCM or priority 5 for APNS. `high` sends the
43
- # notification immediately, and can wake up a sleeping device. This is the same as
44
- # High priority for FCM and GCM or priority 10 for APNS. This feature is not
45
- # supported by SMS and Facebook Messenger and will be ignored for deliveries via
46
- # those channels.
47
- # @param [String] ttl This parameter specifies how long (in seconds) the
48
- # notification is valid. Delivery should be attempted if the device is offline.
49
- # The maximum time to live supported is 4 weeks. The value zero means that the
50
- # notification delivery is attempted immediately once but not stored for future
51
- # delivery. The default value is 4 weeks. This feature is not supported by SMS
52
- # and Facebook Messenger and will be ignored for deliveries via those channels.
53
- # @param [String] title (optional for all except Alexa) Indicates the notification
54
- # title. This field is not visible on iOS phones and tablets but it is on Apple
55
- # Watch and Android devices. Translates to `data.twi_title` for FCM and GCM,
56
- # `aps.alert.title` for APNS and `displayInfo.content[0].title`,
57
- # `displayInfo.content[].toast.primaryText` of `request.message` for Alexa. It is
58
- # not supported for SMS and Facebook Messenger and will be omitted from deliveries
59
- # via those channels.
60
- # @param [String] sound Indicates a sound to be played. Translates to
61
- # `data.twi_sound` for FCM and GCM and `aps.sound` for APNS. This parameter is
62
- # not supported by SMS and Facebook Messenger and is omitted from deliveries via
63
- # those channels.
64
- # @param [String] action Specifies the actions to be displayed for the
65
- # notification. Translates to `data.twi_action` for GCM and `aps.category` for
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 for those channels. For APNS, attributes of `Data` will be
73
- # inserted into the APNS payload as custom properties outside of the `aps`
74
- # dictionary. For Alexa they are added to `request.message.data`. For all
75
- # channels, the `twi_` prefix is reserved for Twilio for future use. Requests
76
- # including custom data with keys starting with `twi_` will be rejected as 400 Bad
77
- # request and no delivery will be attempted. This parameter is not supported by
78
- # SMS and Facebook Messenger and is omitted from deliveries via those channels.
79
- # @param [Hash] apn APNS specific payload that overrides corresponding attributes
80
- # in a generic payload for Bindings with the apn BindingType. This value is mapped
81
- # to the Payload item, therefore the `aps` key has to be used to change standard
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. The `twi_` key prefix for custom key-value pairs is reserved for Twilio for future use. Custom data with keys starting with `twi_` is not allowed.
85
- # @param [Hash] gcm GCM specific payload that overrides corresponding attributes
86
- # in generic payload for Bindings with gcm BindingType. This value is mapped to
87
- # the root json dictionary. Refer to [GCM
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. Target parameters `to`, `registration_ids`, and
90
- # `notification_key` are not allowed. The `twi_` key prefix for custom key-value
91
- # pairs is reserved for Twilio for future use. Custom data with keys starting with
92
- # `twi_` is not allowed. FCM and GCM [reserves certain
93
- # keys](https://firebase.google.com/docs/cloud-messaging/http-server-ref) that
94
- # cannot be used for those channels.
95
- # @param [Hash] sms SMS specific payload that overrides corresponding attributes
96
- # in generic payload for Bindings with sms BindingType. Each attribute in this
97
- # JSON object is mapped to the corresponding form parameter of the Twilio
98
- # [Message](https://www.twilio.com/docs/api/rest/sending-messages) resource. The
99
- # following parameters of the Message resource are supported in snake case format:
100
- # `body`, `media_urls`, `status_callback`, and `max_price`. The `status_callback`
101
- # parameter overrides the corresponding parameter in the messaging service if
102
- # configured. The `media_urls` expects a JSON array.
103
- # @param [Hash] facebook_messenger Messenger specific payload that overrides
104
- # corresponding attributes in generic payload for Bindings with facebook-messenger
105
- # BindingType. This value is mapped to the root json dictionary of Facebook's
106
- # [Send API
107
- # request](https://developers.facebook.com/docs/messenger-platform/send-api-reference). Overriding the `recipient` parameter is not allowed.
108
- # @param [Hash] fcm FCM specific payload that overrides corresponding attributes
109
- # in generic payload for Bindings with fcm BindingType. This value is mapped to
110
- # the root json dictionary. Refer to [FCM
111
- # 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. The `twi_` key prefix for custom key-value pairs is reserved for Twilio for future use. Custom data with keys starting with `twi_` is not allowed. Custom data with keys starting with `twi_` is not allowed. FCM and GCM [reserves certain keys](https://firebase.google.com/docs/cloud-messaging/http-server-ref) that cannot be used for those channels.
112
- # @param [String] segment The segment
113
- # @param [Hash] alexa The alexa
114
- # @param [String] to_binding The destination address in a JSON object (see
115
- # attributes below). Multiple ToBinding parameters can be included but the total
116
- # size of the request entity should not exceed 1MB. This is typically sufficient
117
- # for 10,000 phone numbers.
118
- # @param [String] identity Delivery will be attempted only to Bindings with an
119
- # Identity in this list. Maximum 20 items allowed in this list.
120
- # @param [String] tag Delivery will be attempted only to Bindings that have all of
121
- # the Tags in this list. Maximum 5 items allowed in this list. The implicit tag
122
- # "all" is available to notify all Bindings in a Service instance. Similarly the
123
- # implicit tags "apn", "fcm", "gcm", "sms" and "facebook-messenger" are available
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 service_sid
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 sid
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 account_sid
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 service_sid
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 date_created
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] List of Identities.
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] List of Tags
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 segments
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] Two priorities defined: low and high.
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] This parameter specifies how long the notification is valid.
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] Indicates the notification title.
283
+ # @return [String] The notification title
287
284
  def title
288
285
  @properties['title']
289
286
  end
290
287
 
291
288
  ##
292
- # @return [String] Indicates the notification body text.
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] Indicates a sound to be played.
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] Specifies the actions to be displayed for the notification.
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] This parameter specifies the custom key-value pairs of the notification's payload.
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 specific payload that overrides corresponding attributes in a generic payload for Bindings with the apn BindingType.
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 specific payload that overrides corresponding attributes in generic payload for Bindings with gcm BindingType.
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 specific payload that overrides corresponding attributes in generic payload for Bindings with fcm BindingType.
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 specific payload that overrides corresponding attributes in generic payload for Bindings with sms BindingType.
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] Messenger specific payload that overrides corresponding attributes in generic payload for Bindings with facebook-messenger BindingType.
337
+ # @return [Hash] Deprecated
341
338
  def facebook_messenger
342
339
  @properties['facebook_messenger']
343
340
  end
344
341
 
345
342
  ##
346
- # @return [Hash] The alexa
343
+ # @return [Hash] Deprecated
347
344
  def alexa
348
345
  @properties['alexa']
349
346
  end