twilio-ruby 5.19.0 → 5.20.0
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 +2 -2
- data/lib/twilio-ruby/rest/api.rb +16 -13
- data/lib/twilio-ruby/rest/api/v2010/account/address.rb +85 -88
- data/lib/twilio-ruby/rest/api/v2010/account/address/dependent_phone_number.rb +4 -4
- data/lib/twilio-ruby/rest/api/v2010/account/application.rb +135 -146
- data/lib/twilio-ruby/rest/api/v2010/account/authorized_connect_app.rb +21 -17
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb +14 -8
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/local.rb +150 -166
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/machine_to_machine.rb +174 -79
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/mobile.rb +147 -160
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/national.rb +174 -79
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/shared_cost.rb +174 -79
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/toll_free.rb +147 -160
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/voip.rb +174 -79
- data/lib/twilio-ruby/rest/api/v2010/account/connect_app.rb +51 -51
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number.rb +246 -251
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb +31 -26
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb +34 -26
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/local.rb +109 -112
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/mobile.rb +108 -112
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/toll_free.rb +108 -112
- data/lib/twilio-ruby/rest/api/v2010/account/message/feedback.rb +21 -11
- data/lib/twilio-ruby/rest/api/v2010/account/new_key.rb +7 -6
- data/lib/twilio-ruby/rest/api/v2010/account/new_signing_key.rb +7 -6
- data/lib/twilio-ruby/rest/api/v2010/account/notification.rb +32 -25
- data/lib/twilio-ruby/rest/api/v2010/account/outgoing_caller_id.rb +36 -36
- data/lib/twilio-ruby/rest/api/v2010/account/sip.rb +2 -1
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb +70 -66
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types.rb +10 -10
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_calls_mapping.rb +14 -14
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_calls_mapping/auth_calls_credential_list_mapping.rb +26 -23
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_calls_mapping/auth_calls_ip_access_control_list_mapping.rb +26 -23
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_registrations_mapping.rb +12 -12
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_registrations_mapping/auth_registrations_credential_list_mapping.rb +26 -23
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/credential_list_mapping.rb +4 -4
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.rb +4 -4
- data/lib/twilio-ruby/rest/api/v2010/account/token.rb +11 -9
- data/lib/twilio-ruby/rest/api/v2010/account/usage.rb +2 -1
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record.rb +56 -47
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/all_time.rb +59 -44
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/daily.rb +59 -44
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/last_month.rb +59 -47
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/monthly.rb +59 -44
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/this_month.rb +59 -44
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/today.rb +59 -44
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yearly.rb +59 -44
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yesterday.rb +59 -44
- data/lib/twilio-ruby/rest/api/v2010/account/usage/trigger.rb +76 -74
- data/lib/twilio-ruby/rest/authy.rb +8 -8
- data/lib/twilio-ruby/rest/authy/v1.rb +15 -15
- data/lib/twilio-ruby/rest/client.rb +16 -13
- data/lib/twilio-ruby/rest/messaging.rb +15 -0
- data/lib/twilio-ruby/rest/messaging/v1.rb +23 -0
- data/lib/twilio-ruby/rest/messaging/v1/session.rb +482 -0
- data/lib/twilio-ruby/rest/messaging/v1/session/message.rb +434 -0
- data/lib/twilio-ruby/rest/messaging/v1/session/participant.rb +458 -0
- data/lib/twilio-ruby/rest/messaging/v1/webhook.rb +285 -0
- data/lib/twilio-ruby/rest/preview.rb +8 -8
- data/lib/twilio-ruby/rest/preview/marketplace.rb +13 -13
- data/lib/twilio-ruby/rest/proxy/v1/service/session.rb +3 -2
- data/lib/twilio-ruby/rest/video.rb +9 -9
- data/lib/twilio-ruby/rest/video/v1.rb +16 -16
- data/lib/twilio-ruby/rest/video/v1/composition.rb +7 -6
- data/lib/twilio-ruby/rest/video/v1/composition_hook.rb +37 -21
- data/lib/twilio-ruby/rest/video/v1/recording.rb +12 -3
- data/lib/twilio-ruby/security/request_validator.rb +2 -2
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/integration/messaging/v1/session/message_spec.rb +238 -0
- data/spec/integration/messaging/v1/session/participant_spec.rb +256 -0
- data/spec/integration/messaging/v1/session_spec.rb +223 -0
- data/spec/integration/messaging/v1/webhook_spec.rb +92 -0
- data/spec/integration/video/v1/composition_hook_spec.rb +1 -1
- data/spec/security/request_validator_spec.rb +5 -7
- metadata +14 -2
@@ -32,17 +32,22 @@ module Twilio
|
|
32
32
|
# Lists YearlyInstance records from the API as a list.
|
33
33
|
# Unlike stream(), this operation is eager and will load `limit` records into
|
34
34
|
# memory before returning.
|
35
|
-
# @param [yearly.Category] category
|
36
|
-
# category](https://www.twilio.com/docs/api/rest/usage-records#usage-categories)
|
35
|
+
# @param [yearly.Category] category The [usage
|
36
|
+
# category](https://www.twilio.com/docs/api/rest/usage-records#usage-categories)
|
37
|
+
# of the UsageRecord resources to read. Only UsageRecord resources in the
|
38
|
+
# specified category are retrieved.
|
37
39
|
# @param [Date] start_date Only include usage that has occurred on or after this
|
38
|
-
# date.
|
39
|
-
#
|
40
|
-
#
|
41
|
-
# @param [Date] end_date Only include usage that
|
42
|
-
# date
|
43
|
-
#
|
44
|
-
#
|
45
|
-
# @param [Boolean] include_subaccounts
|
40
|
+
# date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify
|
41
|
+
# offsets from the current date, such as: `-30days`, which will set the start date
|
42
|
+
# to be 30 days before the current date.
|
43
|
+
# @param [Date] end_date Only include usage that occurred on or before this date.
|
44
|
+
# Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify
|
45
|
+
# offsets from the current date, such as: `+30days`, which will set the end date
|
46
|
+
# to 30 days from the current date.
|
47
|
+
# @param [Boolean] include_subaccounts Whether to include usage from the master
|
48
|
+
# account and all its subaccounts. Can be: `true` (the default) to include usage
|
49
|
+
# from the master account and all subaccounts or `false` to retrieve usage from
|
50
|
+
# only the specified account.
|
46
51
|
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
47
52
|
# guarantees to never return more than limit. Default is no limit
|
48
53
|
# @param [Integer] page_size Number of records to fetch per request, when
|
@@ -65,17 +70,22 @@ module Twilio
|
|
65
70
|
# Streams YearlyInstance records from the API as an Enumerable.
|
66
71
|
# This operation lazily loads records as efficiently as possible until the limit
|
67
72
|
# is reached.
|
68
|
-
# @param [yearly.Category] category
|
69
|
-
# category](https://www.twilio.com/docs/api/rest/usage-records#usage-categories)
|
73
|
+
# @param [yearly.Category] category The [usage
|
74
|
+
# category](https://www.twilio.com/docs/api/rest/usage-records#usage-categories)
|
75
|
+
# of the UsageRecord resources to read. Only UsageRecord resources in the
|
76
|
+
# specified category are retrieved.
|
70
77
|
# @param [Date] start_date Only include usage that has occurred on or after this
|
71
|
-
# date.
|
72
|
-
#
|
73
|
-
#
|
74
|
-
# @param [Date] end_date Only include usage that
|
75
|
-
# date
|
76
|
-
#
|
77
|
-
#
|
78
|
-
# @param [Boolean] include_subaccounts
|
78
|
+
# date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify
|
79
|
+
# offsets from the current date, such as: `-30days`, which will set the start date
|
80
|
+
# to be 30 days before the current date.
|
81
|
+
# @param [Date] end_date Only include usage that occurred on or before this date.
|
82
|
+
# Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify
|
83
|
+
# offsets from the current date, such as: `+30days`, which will set the end date
|
84
|
+
# to 30 days from the current date.
|
85
|
+
# @param [Boolean] include_subaccounts Whether to include usage from the master
|
86
|
+
# account and all its subaccounts. Can be: `true` (the default) to include usage
|
87
|
+
# from the master account and all subaccounts or `false` to retrieve usage from
|
88
|
+
# only the specified account.
|
79
89
|
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
80
90
|
# guarantees to never return more than limit. Default is no limit.
|
81
91
|
# @param [Integer] page_size Number of records to fetch per request, when
|
@@ -114,17 +124,22 @@ module Twilio
|
|
114
124
|
##
|
115
125
|
# Retrieve a single page of YearlyInstance records from the API.
|
116
126
|
# Request is executed immediately.
|
117
|
-
# @param [yearly.Category] category
|
118
|
-
# category](https://www.twilio.com/docs/api/rest/usage-records#usage-categories)
|
127
|
+
# @param [yearly.Category] category The [usage
|
128
|
+
# category](https://www.twilio.com/docs/api/rest/usage-records#usage-categories)
|
129
|
+
# of the UsageRecord resources to read. Only UsageRecord resources in the
|
130
|
+
# specified category are retrieved.
|
119
131
|
# @param [Date] start_date Only include usage that has occurred on or after this
|
120
|
-
# date.
|
121
|
-
#
|
122
|
-
#
|
123
|
-
# @param [Date] end_date Only include usage that
|
124
|
-
# date
|
125
|
-
#
|
126
|
-
#
|
127
|
-
# @param [Boolean] include_subaccounts
|
132
|
+
# date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify
|
133
|
+
# offsets from the current date, such as: `-30days`, which will set the start date
|
134
|
+
# to be 30 days before the current date.
|
135
|
+
# @param [Date] end_date Only include usage that occurred on or before this date.
|
136
|
+
# Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify
|
137
|
+
# offsets from the current date, such as: `+30days`, which will set the end date
|
138
|
+
# to 30 days from the current date.
|
139
|
+
# @param [Boolean] include_subaccounts Whether to include usage from the master
|
140
|
+
# account and all its subaccounts. Can be: `true` (the default) to include usage
|
141
|
+
# from the master account and all subaccounts or `false` to retrieve usage from
|
142
|
+
# only the specified account.
|
128
143
|
# @param [String] page_token PageToken provided by the API
|
129
144
|
# @param [Integer] page_number Page Number, this value is simply for client state
|
130
145
|
# @param [Integer] page_size Number of records to return, defaults to 50
|
@@ -227,85 +242,85 @@ module Twilio
|
|
227
242
|
end
|
228
243
|
|
229
244
|
##
|
230
|
-
# @return [String] The Account
|
245
|
+
# @return [String] The SID of the Account accrued the usage
|
231
246
|
def account_sid
|
232
247
|
@properties['account_sid']
|
233
248
|
end
|
234
249
|
|
235
250
|
##
|
236
|
-
# @return [String] The
|
251
|
+
# @return [String] The API version used to create the resource
|
237
252
|
def api_version
|
238
253
|
@properties['api_version']
|
239
254
|
end
|
240
255
|
|
241
256
|
##
|
242
|
-
# @return [yearly.Category] The category of usage
|
257
|
+
# @return [yearly.Category] The category of usage
|
243
258
|
def category
|
244
259
|
@properties['category']
|
245
260
|
end
|
246
261
|
|
247
262
|
##
|
248
|
-
# @return [String] The number of usage events
|
263
|
+
# @return [String] The number of usage events
|
249
264
|
def count
|
250
265
|
@properties['count']
|
251
266
|
end
|
252
267
|
|
253
268
|
##
|
254
|
-
# @return [String] The units in which
|
269
|
+
# @return [String] The units in which count is measured
|
255
270
|
def count_unit
|
256
271
|
@properties['count_unit']
|
257
272
|
end
|
258
273
|
|
259
274
|
##
|
260
|
-
# @return [String] A
|
275
|
+
# @return [String] A plain-language description of the usage category
|
261
276
|
def description
|
262
277
|
@properties['description']
|
263
278
|
end
|
264
279
|
|
265
280
|
##
|
266
|
-
# @return [Date] The last date for which usage is included in
|
281
|
+
# @return [Date] The last date for which usage is included in the UsageRecord
|
267
282
|
def end_date
|
268
283
|
@properties['end_date']
|
269
284
|
end
|
270
285
|
|
271
286
|
##
|
272
|
-
# @return [String] The total price of the usage
|
287
|
+
# @return [String] The total price of the usage
|
273
288
|
def price
|
274
289
|
@properties['price']
|
275
290
|
end
|
276
291
|
|
277
292
|
##
|
278
|
-
# @return [String] The currency in which
|
293
|
+
# @return [String] The currency in which `price` is measured
|
279
294
|
def price_unit
|
280
295
|
@properties['price_unit']
|
281
296
|
end
|
282
297
|
|
283
298
|
##
|
284
|
-
# @return [Date] The first date for which usage is included in this UsageRecord
|
299
|
+
# @return [Date] The first date for which usage is included in this UsageRecord
|
285
300
|
def start_date
|
286
301
|
@properties['start_date']
|
287
302
|
end
|
288
303
|
|
289
304
|
##
|
290
|
-
# @return [String]
|
305
|
+
# @return [String] A list of related resources identified by their relative URIs
|
291
306
|
def subresource_uris
|
292
307
|
@properties['subresource_uris']
|
293
308
|
end
|
294
309
|
|
295
310
|
##
|
296
|
-
# @return [String] The URI
|
311
|
+
# @return [String] The URI of the resource, relative to `https://api.twilio.com`
|
297
312
|
def uri
|
298
313
|
@properties['uri']
|
299
314
|
end
|
300
315
|
|
301
316
|
##
|
302
|
-
# @return [String] The amount of
|
317
|
+
# @return [String] The amount of usage
|
303
318
|
def usage
|
304
319
|
@properties['usage']
|
305
320
|
end
|
306
321
|
|
307
322
|
##
|
308
|
-
# @return [String] The units in which
|
323
|
+
# @return [String] The units in which usage is measured
|
309
324
|
def usage_unit
|
310
325
|
@properties['usage_unit']
|
311
326
|
end
|
@@ -32,17 +32,22 @@ module Twilio
|
|
32
32
|
# Lists YesterdayInstance records from the API as a list.
|
33
33
|
# Unlike stream(), this operation is eager and will load `limit` records into
|
34
34
|
# memory before returning.
|
35
|
-
# @param [yesterday.Category] category
|
36
|
-
# category](https://www.twilio.com/docs/api/rest/usage-records#usage-categories)
|
35
|
+
# @param [yesterday.Category] category The [usage
|
36
|
+
# category](https://www.twilio.com/docs/api/rest/usage-records#usage-categories)
|
37
|
+
# of the UsageRecord resources to read. Only UsageRecord resources in the
|
38
|
+
# specified category are retrieved.
|
37
39
|
# @param [Date] start_date Only include usage that has occurred on or after this
|
38
|
-
# date.
|
39
|
-
#
|
40
|
-
#
|
41
|
-
# @param [Date] end_date Only include usage that
|
42
|
-
# date
|
43
|
-
#
|
44
|
-
#
|
45
|
-
# @param [Boolean] include_subaccounts
|
40
|
+
# date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify
|
41
|
+
# offsets from the current date, such as: `-30days`, which will set the start date
|
42
|
+
# to be 30 days before the current date.
|
43
|
+
# @param [Date] end_date Only include usage that occurred on or before this date.
|
44
|
+
# Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify
|
45
|
+
# offsets from the current date, such as: `+30days`, which will set the end date
|
46
|
+
# to 30 days from the current date.
|
47
|
+
# @param [Boolean] include_subaccounts Whether to include usage from the master
|
48
|
+
# account and all its subaccounts. Can be: `true` (the default) to include usage
|
49
|
+
# from the master account and all subaccounts or `false` to retrieve usage from
|
50
|
+
# only the specified account.
|
46
51
|
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
47
52
|
# guarantees to never return more than limit. Default is no limit
|
48
53
|
# @param [Integer] page_size Number of records to fetch per request, when
|
@@ -65,17 +70,22 @@ module Twilio
|
|
65
70
|
# Streams YesterdayInstance records from the API as an Enumerable.
|
66
71
|
# This operation lazily loads records as efficiently as possible until the limit
|
67
72
|
# is reached.
|
68
|
-
# @param [yesterday.Category] category
|
69
|
-
# category](https://www.twilio.com/docs/api/rest/usage-records#usage-categories)
|
73
|
+
# @param [yesterday.Category] category The [usage
|
74
|
+
# category](https://www.twilio.com/docs/api/rest/usage-records#usage-categories)
|
75
|
+
# of the UsageRecord resources to read. Only UsageRecord resources in the
|
76
|
+
# specified category are retrieved.
|
70
77
|
# @param [Date] start_date Only include usage that has occurred on or after this
|
71
|
-
# date.
|
72
|
-
#
|
73
|
-
#
|
74
|
-
# @param [Date] end_date Only include usage that
|
75
|
-
# date
|
76
|
-
#
|
77
|
-
#
|
78
|
-
# @param [Boolean] include_subaccounts
|
78
|
+
# date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify
|
79
|
+
# offsets from the current date, such as: `-30days`, which will set the start date
|
80
|
+
# to be 30 days before the current date.
|
81
|
+
# @param [Date] end_date Only include usage that occurred on or before this date.
|
82
|
+
# Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify
|
83
|
+
# offsets from the current date, such as: `+30days`, which will set the end date
|
84
|
+
# to 30 days from the current date.
|
85
|
+
# @param [Boolean] include_subaccounts Whether to include usage from the master
|
86
|
+
# account and all its subaccounts. Can be: `true` (the default) to include usage
|
87
|
+
# from the master account and all subaccounts or `false` to retrieve usage from
|
88
|
+
# only the specified account.
|
79
89
|
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
80
90
|
# guarantees to never return more than limit. Default is no limit.
|
81
91
|
# @param [Integer] page_size Number of records to fetch per request, when
|
@@ -114,17 +124,22 @@ module Twilio
|
|
114
124
|
##
|
115
125
|
# Retrieve a single page of YesterdayInstance records from the API.
|
116
126
|
# Request is executed immediately.
|
117
|
-
# @param [yesterday.Category] category
|
118
|
-
# category](https://www.twilio.com/docs/api/rest/usage-records#usage-categories)
|
127
|
+
# @param [yesterday.Category] category The [usage
|
128
|
+
# category](https://www.twilio.com/docs/api/rest/usage-records#usage-categories)
|
129
|
+
# of the UsageRecord resources to read. Only UsageRecord resources in the
|
130
|
+
# specified category are retrieved.
|
119
131
|
# @param [Date] start_date Only include usage that has occurred on or after this
|
120
|
-
# date.
|
121
|
-
#
|
122
|
-
#
|
123
|
-
# @param [Date] end_date Only include usage that
|
124
|
-
# date
|
125
|
-
#
|
126
|
-
#
|
127
|
-
# @param [Boolean] include_subaccounts
|
132
|
+
# date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify
|
133
|
+
# offsets from the current date, such as: `-30days`, which will set the start date
|
134
|
+
# to be 30 days before the current date.
|
135
|
+
# @param [Date] end_date Only include usage that occurred on or before this date.
|
136
|
+
# Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify
|
137
|
+
# offsets from the current date, such as: `+30days`, which will set the end date
|
138
|
+
# to 30 days from the current date.
|
139
|
+
# @param [Boolean] include_subaccounts Whether to include usage from the master
|
140
|
+
# account and all its subaccounts. Can be: `true` (the default) to include usage
|
141
|
+
# from the master account and all subaccounts or `false` to retrieve usage from
|
142
|
+
# only the specified account.
|
128
143
|
# @param [String] page_token PageToken provided by the API
|
129
144
|
# @param [Integer] page_number Page Number, this value is simply for client state
|
130
145
|
# @param [Integer] page_size Number of records to return, defaults to 50
|
@@ -227,85 +242,85 @@ module Twilio
|
|
227
242
|
end
|
228
243
|
|
229
244
|
##
|
230
|
-
# @return [String] The Account
|
245
|
+
# @return [String] The SID of the Account accrued the usage
|
231
246
|
def account_sid
|
232
247
|
@properties['account_sid']
|
233
248
|
end
|
234
249
|
|
235
250
|
##
|
236
|
-
# @return [String] The
|
251
|
+
# @return [String] The API version used to create the resource
|
237
252
|
def api_version
|
238
253
|
@properties['api_version']
|
239
254
|
end
|
240
255
|
|
241
256
|
##
|
242
|
-
# @return [yesterday.Category] The category of usage
|
257
|
+
# @return [yesterday.Category] The category of usage
|
243
258
|
def category
|
244
259
|
@properties['category']
|
245
260
|
end
|
246
261
|
|
247
262
|
##
|
248
|
-
# @return [String] The number of usage events
|
263
|
+
# @return [String] The number of usage events
|
249
264
|
def count
|
250
265
|
@properties['count']
|
251
266
|
end
|
252
267
|
|
253
268
|
##
|
254
|
-
# @return [String] The units in which
|
269
|
+
# @return [String] The units in which count is measured
|
255
270
|
def count_unit
|
256
271
|
@properties['count_unit']
|
257
272
|
end
|
258
273
|
|
259
274
|
##
|
260
|
-
# @return [String] A
|
275
|
+
# @return [String] A plain-language description of the usage category
|
261
276
|
def description
|
262
277
|
@properties['description']
|
263
278
|
end
|
264
279
|
|
265
280
|
##
|
266
|
-
# @return [Date] The last date for which usage is included in
|
281
|
+
# @return [Date] The last date for which usage is included in the UsageRecord
|
267
282
|
def end_date
|
268
283
|
@properties['end_date']
|
269
284
|
end
|
270
285
|
|
271
286
|
##
|
272
|
-
# @return [String] The total price of the usage
|
287
|
+
# @return [String] The total price of the usage
|
273
288
|
def price
|
274
289
|
@properties['price']
|
275
290
|
end
|
276
291
|
|
277
292
|
##
|
278
|
-
# @return [String] The currency in which
|
293
|
+
# @return [String] The currency in which `price` is measured
|
279
294
|
def price_unit
|
280
295
|
@properties['price_unit']
|
281
296
|
end
|
282
297
|
|
283
298
|
##
|
284
|
-
# @return [Date] The first date for which usage is included in this UsageRecord
|
299
|
+
# @return [Date] The first date for which usage is included in this UsageRecord
|
285
300
|
def start_date
|
286
301
|
@properties['start_date']
|
287
302
|
end
|
288
303
|
|
289
304
|
##
|
290
|
-
# @return [String]
|
305
|
+
# @return [String] A list of related resources identified by their relative URIs
|
291
306
|
def subresource_uris
|
292
307
|
@properties['subresource_uris']
|
293
308
|
end
|
294
309
|
|
295
310
|
##
|
296
|
-
# @return [String] The URI
|
311
|
+
# @return [String] The URI of the resource, relative to `https://api.twilio.com`
|
297
312
|
def uri
|
298
313
|
@properties['uri']
|
299
314
|
end
|
300
315
|
|
301
316
|
##
|
302
|
-
# @return [String] The amount of
|
317
|
+
# @return [String] The amount of usage
|
303
318
|
def usage
|
304
319
|
@properties['usage']
|
305
320
|
end
|
306
321
|
|
307
322
|
##
|
308
|
-
# @return [String] The units in which
|
323
|
+
# @return [String] The units in which usage is measured
|
309
324
|
def usage_unit
|
310
325
|
@properties['usage_unit']
|
311
326
|
end
|
@@ -30,27 +30,28 @@ module Twilio
|
|
30
30
|
##
|
31
31
|
# Retrieve a single page of TriggerInstance records from the API.
|
32
32
|
# Request is executed immediately.
|
33
|
-
# @param [String] callback_url
|
34
|
-
# trigger fires.
|
35
|
-
# @param [String] trigger_value The
|
36
|
-
#
|
37
|
-
#
|
38
|
-
#
|
39
|
-
# @param [trigger.UsageCategory] usage_category The
|
40
|
-
#
|
41
|
-
# categories](https://www.twilio.com/docs/api/rest/usage-records#usage-categories)
|
42
|
-
#
|
43
|
-
#
|
44
|
-
#
|
45
|
-
#
|
46
|
-
#
|
47
|
-
#
|
48
|
-
#
|
49
|
-
#
|
33
|
+
# @param [String] callback_url The URL we should call using `callback_method` when
|
34
|
+
# the trigger fires.
|
35
|
+
# @param [String] trigger_value The usage value at which the trigger should fire.
|
36
|
+
# For convenience, you can use an offset value such as `+30` to specify a
|
37
|
+
# trigger_value that is 30 units more than the current usage value. Be sure to
|
38
|
+
# urlencode a `+` as `%2B`.
|
39
|
+
# @param [trigger.UsageCategory] usage_category The usage category that the
|
40
|
+
# trigger should watch. Use one of the supported [usage
|
41
|
+
# categories](https://www.twilio.com/docs/api/rest/usage-records#usage-categories)
|
42
|
+
# for this value.
|
43
|
+
# @param [String] callback_method The HTTP method we should use to call
|
44
|
+
# `callback_url`. Can be: `GET` or `POST` and the default is `POST`.
|
45
|
+
# @param [String] friendly_name A descriptive string that you create to describe
|
46
|
+
# the resource. It can be up to 64 characters long.
|
47
|
+
# @param [trigger.Recurring] recurring The frequency of a recurring UsageTrigger.
|
48
|
+
# Can be: `daily`, `monthly`, or `yearly` for recurring triggers or empty for
|
49
|
+
# non-recurring triggers. A trigger will only fire once during each period.
|
50
|
+
# Recurring times are in GMT.
|
50
51
|
# @param [trigger.TriggerField] trigger_by The field in the
|
51
|
-
# [UsageRecord](https://www.twilio.com/docs/api/rest/usage-records) that
|
52
|
-
# the trigger.
|
53
|
-
# [UsageRecords
|
52
|
+
# [UsageRecord](https://www.twilio.com/docs/api/rest/usage-records) resource that
|
53
|
+
# should fire the trigger. Can be: `count`, `usage`, or `price` as described in
|
54
|
+
# the [UsageRecords
|
54
55
|
# documentation](https://www.twilio.com/docs/api/rest/usage-records#usage-count-price). The default is `usage`.
|
55
56
|
# @return [TriggerInstance] Newly created TriggerInstance
|
56
57
|
def create(callback_url: nil, trigger_value: nil, usage_category: nil, callback_method: :unset, friendly_name: :unset, recurring: :unset, trigger_by: :unset)
|
@@ -77,15 +78,14 @@ module Twilio
|
|
77
78
|
# Lists TriggerInstance records from the API as a list.
|
78
79
|
# Unlike stream(), this operation is eager and will load `limit` records into
|
79
80
|
# memory before returning.
|
80
|
-
# @param [trigger.Recurring] recurring
|
81
|
-
#
|
82
|
-
#
|
83
|
-
# @param [trigger.TriggerField] trigger_by
|
84
|
-
#
|
85
|
-
# described in the [UsageRecords
|
81
|
+
# @param [trigger.Recurring] recurring The frequency of recurring UsageTriggers to
|
82
|
+
# read. Can be: `daily`, `monthly`, or `yearly` to read recurring UsageTriggers.
|
83
|
+
# An empty value or a value of `alltime` reads non-recurring UsageTriggers.
|
84
|
+
# @param [trigger.TriggerField] trigger_by The trigger field of the UsageTriggers
|
85
|
+
# to read. Can be: `count`, `usage`, or `price` as described in the [UsageRecords
|
86
86
|
# documentation](https://www.twilio.com/docs/api/rest/usage-records#usage-count-price).
|
87
|
-
# @param [trigger.UsageCategory] usage_category
|
88
|
-
#
|
87
|
+
# @param [trigger.UsageCategory] usage_category The usage category of the
|
88
|
+
# UsageTriggers to read. Must be a supported [usage
|
89
89
|
# categories](https://www.twilio.com/docs/api/rest/usage-records#usage-categories).
|
90
90
|
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
91
91
|
# guarantees to never return more than limit. Default is no limit
|
@@ -108,15 +108,14 @@ module Twilio
|
|
108
108
|
# Streams TriggerInstance records from the API as an Enumerable.
|
109
109
|
# This operation lazily loads records as efficiently as possible until the limit
|
110
110
|
# is reached.
|
111
|
-
# @param [trigger.Recurring] recurring
|
112
|
-
#
|
113
|
-
#
|
114
|
-
# @param [trigger.TriggerField] trigger_by
|
115
|
-
#
|
116
|
-
# described in the [UsageRecords
|
111
|
+
# @param [trigger.Recurring] recurring The frequency of recurring UsageTriggers to
|
112
|
+
# read. Can be: `daily`, `monthly`, or `yearly` to read recurring UsageTriggers.
|
113
|
+
# An empty value or a value of `alltime` reads non-recurring UsageTriggers.
|
114
|
+
# @param [trigger.TriggerField] trigger_by The trigger field of the UsageTriggers
|
115
|
+
# to read. Can be: `count`, `usage`, or `price` as described in the [UsageRecords
|
117
116
|
# documentation](https://www.twilio.com/docs/api/rest/usage-records#usage-count-price).
|
118
|
-
# @param [trigger.UsageCategory] usage_category
|
119
|
-
#
|
117
|
+
# @param [trigger.UsageCategory] usage_category The usage category of the
|
118
|
+
# UsageTriggers to read. Must be a supported [usage
|
120
119
|
# categories](https://www.twilio.com/docs/api/rest/usage-records#usage-categories).
|
121
120
|
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
122
121
|
# guarantees to never return more than limit. Default is no limit.
|
@@ -155,15 +154,14 @@ module Twilio
|
|
155
154
|
##
|
156
155
|
# Retrieve a single page of TriggerInstance records from the API.
|
157
156
|
# Request is executed immediately.
|
158
|
-
# @param [trigger.Recurring] recurring
|
159
|
-
#
|
160
|
-
#
|
161
|
-
# @param [trigger.TriggerField] trigger_by
|
162
|
-
#
|
163
|
-
# described in the [UsageRecords
|
157
|
+
# @param [trigger.Recurring] recurring The frequency of recurring UsageTriggers to
|
158
|
+
# read. Can be: `daily`, `monthly`, or `yearly` to read recurring UsageTriggers.
|
159
|
+
# An empty value or a value of `alltime` reads non-recurring UsageTriggers.
|
160
|
+
# @param [trigger.TriggerField] trigger_by The trigger field of the UsageTriggers
|
161
|
+
# to read. Can be: `count`, `usage`, or `price` as described in the [UsageRecords
|
164
162
|
# documentation](https://www.twilio.com/docs/api/rest/usage-records#usage-count-price).
|
165
|
-
# @param [trigger.UsageCategory] usage_category
|
166
|
-
#
|
163
|
+
# @param [trigger.UsageCategory] usage_category The usage category of the
|
164
|
+
# UsageTriggers to read. Must be a supported [usage
|
167
165
|
# categories](https://www.twilio.com/docs/api/rest/usage-records#usage-categories).
|
168
166
|
# @param [String] page_token PageToken provided by the API
|
169
167
|
# @param [Integer] page_number Page Number, this value is simply for client state
|
@@ -239,8 +237,11 @@ module Twilio
|
|
239
237
|
##
|
240
238
|
# Initialize the TriggerContext
|
241
239
|
# @param [Version] version Version that contains the resource
|
242
|
-
# @param [String] account_sid The
|
243
|
-
#
|
240
|
+
# @param [String] account_sid The SID of the
|
241
|
+
# [Account](https://www.twilio.com/docs/api/rest/account) that created the
|
242
|
+
# UsageTrigger resource to fetch.
|
243
|
+
# @param [String] sid The Twilio-provided string that uniquely identifies the
|
244
|
+
# UsageTrigger resource to fetch.
|
244
245
|
# @return [TriggerContext] TriggerContext
|
245
246
|
def initialize(version, account_sid, sid)
|
246
247
|
super(version)
|
@@ -267,12 +268,12 @@ module Twilio
|
|
267
268
|
|
268
269
|
##
|
269
270
|
# Update the TriggerInstance
|
270
|
-
# @param [String] callback_method The HTTP method
|
271
|
-
#
|
272
|
-
# @param [String] callback_url
|
273
|
-
# trigger fires.
|
274
|
-
# @param [String] friendly_name A
|
275
|
-
#
|
271
|
+
# @param [String] callback_method The HTTP method we should use to call
|
272
|
+
# `callback_url`. Can be: `GET` or `POST` and the default is `POST`.
|
273
|
+
# @param [String] callback_url The URL we should call using `callback_method` when
|
274
|
+
# the trigger fires.
|
275
|
+
# @param [String] friendly_name A descriptive string that you create to describe
|
276
|
+
# the resource. It can be up to 64 characters long.
|
276
277
|
# @return [TriggerInstance] Updated TriggerInstance
|
277
278
|
def update(callback_method: :unset, callback_url: :unset, friendly_name: :unset)
|
278
279
|
data = Twilio::Values.of({
|
@@ -312,7 +313,8 @@ module Twilio
|
|
312
313
|
# @param [Hash] payload payload that contains response from Twilio
|
313
314
|
# @param [String] account_sid A 34 character string that uniquely identifies this
|
314
315
|
# resource.
|
315
|
-
# @param [String] sid The
|
316
|
+
# @param [String] sid The Twilio-provided string that uniquely identifies the
|
317
|
+
# UsageTrigger resource to fetch.
|
316
318
|
# @return [TriggerInstance] TriggerInstance
|
317
319
|
def initialize(version, payload, account_sid: nil, sid: nil)
|
318
320
|
super(version)
|
@@ -354,85 +356,85 @@ module Twilio
|
|
354
356
|
end
|
355
357
|
|
356
358
|
##
|
357
|
-
# @return [String] The
|
359
|
+
# @return [String] The SID of the Account that this trigger monitors
|
358
360
|
def account_sid
|
359
361
|
@properties['account_sid']
|
360
362
|
end
|
361
363
|
|
362
364
|
##
|
363
|
-
# @return [String] The
|
365
|
+
# @return [String] The API version used to create the resource
|
364
366
|
def api_version
|
365
367
|
@properties['api_version']
|
366
368
|
end
|
367
369
|
|
368
370
|
##
|
369
|
-
# @return [String] HTTP method
|
371
|
+
# @return [String] The HTTP method we use to call callback_url
|
370
372
|
def callback_method
|
371
373
|
@properties['callback_method']
|
372
374
|
end
|
373
375
|
|
374
376
|
##
|
375
|
-
# @return [String] URL
|
377
|
+
# @return [String] he URL we call when the trigger fires
|
376
378
|
def callback_url
|
377
379
|
@properties['callback_url']
|
378
380
|
end
|
379
381
|
|
380
382
|
##
|
381
|
-
# @return [String] The current value of the field the trigger is watching
|
383
|
+
# @return [String] The current value of the field the trigger is watching
|
382
384
|
def current_value
|
383
385
|
@properties['current_value']
|
384
386
|
end
|
385
387
|
|
386
388
|
##
|
387
|
-
# @return [Time] The date
|
389
|
+
# @return [Time] The RFC 2822 date and time in GMT that the resource was created
|
388
390
|
def date_created
|
389
391
|
@properties['date_created']
|
390
392
|
end
|
391
393
|
|
392
394
|
##
|
393
|
-
# @return [Time] The date the trigger was last fired
|
395
|
+
# @return [Time] The RFC 2822 date and time in GMT that the trigger was last fired
|
394
396
|
def date_fired
|
395
397
|
@properties['date_fired']
|
396
398
|
end
|
397
399
|
|
398
400
|
##
|
399
|
-
# @return [Time] The date
|
401
|
+
# @return [Time] The RFC 2822 date and time in GMT that the resource was last updated
|
400
402
|
def date_updated
|
401
403
|
@properties['date_updated']
|
402
404
|
end
|
403
405
|
|
404
406
|
##
|
405
|
-
# @return [String]
|
407
|
+
# @return [String] The string that you assigned to describe the trigger
|
406
408
|
def friendly_name
|
407
409
|
@properties['friendly_name']
|
408
410
|
end
|
409
411
|
|
410
412
|
##
|
411
|
-
# @return [trigger.Recurring]
|
413
|
+
# @return [trigger.Recurring] The frequency of a recurring UsageTrigger
|
412
414
|
def recurring
|
413
415
|
@properties['recurring']
|
414
416
|
end
|
415
417
|
|
416
418
|
##
|
417
|
-
# @return [String] The
|
419
|
+
# @return [String] The unique string that identifies the resource
|
418
420
|
def sid
|
419
421
|
@properties['sid']
|
420
422
|
end
|
421
423
|
|
422
424
|
##
|
423
|
-
# @return [trigger.TriggerField] The field in the UsageRecord that fires the trigger
|
425
|
+
# @return [trigger.TriggerField] The field in the UsageRecord resource that fires the trigger
|
424
426
|
def trigger_by
|
425
427
|
@properties['trigger_by']
|
426
428
|
end
|
427
429
|
|
428
430
|
##
|
429
|
-
# @return [String]
|
431
|
+
# @return [String] The value at which the trigger will fire
|
430
432
|
def trigger_value
|
431
433
|
@properties['trigger_value']
|
432
434
|
end
|
433
435
|
|
434
436
|
##
|
435
|
-
# @return [String] The URI
|
437
|
+
# @return [String] The URI of the resource, relative to `https://api.twilio.com`
|
436
438
|
def uri
|
437
439
|
@properties['uri']
|
438
440
|
end
|
@@ -444,7 +446,7 @@ module Twilio
|
|
444
446
|
end
|
445
447
|
|
446
448
|
##
|
447
|
-
# @return [String] The URI of the UsageRecord this trigger
|
449
|
+
# @return [String] The URI of the UsageRecord resource this trigger watches
|
448
450
|
def usage_record_uri
|
449
451
|
@properties['usage_record_uri']
|
450
452
|
end
|
@@ -458,12 +460,12 @@ module Twilio
|
|
458
460
|
|
459
461
|
##
|
460
462
|
# Update the TriggerInstance
|
461
|
-
# @param [String] callback_method The HTTP method
|
462
|
-
#
|
463
|
-
# @param [String] callback_url
|
464
|
-
# trigger fires.
|
465
|
-
# @param [String] friendly_name A
|
466
|
-
#
|
463
|
+
# @param [String] callback_method The HTTP method we should use to call
|
464
|
+
# `callback_url`. Can be: `GET` or `POST` and the default is `POST`.
|
465
|
+
# @param [String] callback_url The URL we should call using `callback_method` when
|
466
|
+
# the trigger fires.
|
467
|
+
# @param [String] friendly_name A descriptive string that you create to describe
|
468
|
+
# the resource. It can be up to 64 characters long.
|
467
469
|
# @return [TriggerInstance] Updated TriggerInstance
|
468
470
|
def update(callback_method: :unset, callback_url: :unset, friendly_name: :unset)
|
469
471
|
context.update(
|