twilio-ruby 5.25.0 → 5.25.1
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 +10 -0
- data/README.md +2 -2
- data/lib/twilio-ruby/rest/api/v2010/account/application.rb +4 -4
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record.rb +7 -0
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/all_time.rb +7 -0
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/daily.rb +7 -0
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/last_month.rb +7 -0
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/monthly.rb +7 -0
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/this_month.rb +7 -0
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/today.rb +7 -0
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yearly.rb +7 -0
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yesterday.rb +7 -0
- data/lib/twilio-ruby/rest/studio/v1/flow/execution.rb +3 -2
- data/lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_subscribe_rule.rb +1 -1
- data/lib/twilio-ruby/rest/wireless.rb +6 -0
- data/lib/twilio-ruby/rest/wireless/v1.rb +7 -0
- data/lib/twilio-ruby/rest/wireless/v1/usage_record.rb +231 -0
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/integration/api/v2010/account/application_spec.rb +3 -4
- data/spec/integration/api/v2010/account/token_spec.rb +3 -1
- data/spec/integration/api/v2010/account/usage/record/all_time_spec.rb +1 -0
- data/spec/integration/api/v2010/account/usage/record/daily_spec.rb +1 -0
- data/spec/integration/api/v2010/account/usage/record/last_month_spec.rb +1 -0
- data/spec/integration/api/v2010/account/usage/record/monthly_spec.rb +1 -0
- data/spec/integration/api/v2010/account/usage/record/this_month_spec.rb +1 -0
- data/spec/integration/api/v2010/account/usage/record/today_spec.rb +1 -0
- data/spec/integration/api/v2010/account/usage/record/yearly_spec.rb +1 -0
- data/spec/integration/api/v2010/account/usage/record/yesterday_spec.rb +1 -0
- data/spec/integration/api/v2010/account/usage/record_spec.rb +1 -0
- data/spec/integration/preview/acc_security/service/verification_check_spec.rb +1 -1
- data/spec/integration/preview/acc_security/service/verification_spec.rb +1 -1
- data/spec/integration/verify/v2/service/verification_check_spec.rb +1 -1
- data/spec/integration/verify/v2/service/verification_spec.rb +4 -4
- data/spec/integration/video/v1/room/room_participant/room_participant_subscribe_rule_spec.rb +15 -2
- data/spec/integration/wireless/v1/usage_record_spec.rb +111 -0
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b58a103e6666de5e513ebe153abad8695d26495086154ef645990ba987b9decf
|
4
|
+
data.tar.gz: f7358e904c960836d791a387ed7c9048ec4e3aed58cb4e76b61388fd14b379a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da2d22541acdff845e7db8024d3ab7e1018a80ae6e8993d47c97c411fe4eb504299bbef2f2cb2548492fc703e30dfc54b1de0f4c66dc960edea41c3ea085ec00
|
7
|
+
data.tar.gz: 388f2a0067147efd2ad9d965b47e1d309eaf3557abbc5b8719aefc30c096fbda12f8b717268b066100e99fd23c59f4c76b56c918ff25e554bdd5522fffaa8f72
|
data/CHANGES.md
CHANGED
@@ -1,6 +1,16 @@
|
|
1
1
|
twilio-ruby changelog
|
2
2
|
=====================
|
3
3
|
|
4
|
+
[2019-07-10] Version 5.25.1
|
5
|
+
----------------------------
|
6
|
+
**Api**
|
7
|
+
- Make `friendly_name` optional for applications create
|
8
|
+
- Add new property `as_of` date to Usage Record API calls
|
9
|
+
|
10
|
+
**Wireless**
|
11
|
+
- Added Usage Records resource.
|
12
|
+
|
13
|
+
|
4
14
|
[2019-06-26] Version 5.25.0
|
5
15
|
----------------------------
|
6
16
|
**Autopilot**
|
data/README.md
CHANGED
@@ -26,13 +26,13 @@ in-line code documentation here in the library.
|
|
26
26
|
To install using [Bundler][bundler] grab the latest stable version:
|
27
27
|
|
28
28
|
```ruby
|
29
|
-
gem 'twilio-ruby', '~> 5.25.
|
29
|
+
gem 'twilio-ruby', '~> 5.25.1'
|
30
30
|
```
|
31
31
|
|
32
32
|
To manually install `twilio-ruby` via [Rubygems][rubygems] simply gem install:
|
33
33
|
|
34
34
|
```bash
|
35
|
-
gem install twilio-ruby -v 5.25.
|
35
|
+
gem install twilio-ruby -v 5.25.1
|
36
36
|
```
|
37
37
|
|
38
38
|
To build and install the development branch yourself from the latest source:
|
@@ -30,8 +30,6 @@ module Twilio
|
|
30
30
|
##
|
31
31
|
# Retrieve a single page of ApplicationInstance records from the API.
|
32
32
|
# Request is executed immediately.
|
33
|
-
# @param [String] friendly_name A descriptive string that you create to describe
|
34
|
-
# the new application. It can be up to 64 characters long.
|
35
33
|
# @param [String] api_version The API version to use to start a new TwiML session.
|
36
34
|
# Can be: `2010-04-01` or `2008-08-01`. The default value is the account's default
|
37
35
|
# API version.
|
@@ -62,10 +60,11 @@ module Twilio
|
|
62
60
|
# to send status information about SMS messages sent by the application.
|
63
61
|
# @param [String] message_status_callback The URL we should call using a POST
|
64
62
|
# method to send message status information to your application.
|
63
|
+
# @param [String] friendly_name A descriptive string that you create to describe
|
64
|
+
# the new application. It can be up to 64 characters long.
|
65
65
|
# @return [ApplicationInstance] Newly created ApplicationInstance
|
66
|
-
def create(
|
66
|
+
def create(api_version: :unset, voice_url: :unset, voice_method: :unset, voice_fallback_url: :unset, voice_fallback_method: :unset, status_callback: :unset, status_callback_method: :unset, voice_caller_id_lookup: :unset, sms_url: :unset, sms_method: :unset, sms_fallback_url: :unset, sms_fallback_method: :unset, sms_status_callback: :unset, message_status_callback: :unset, friendly_name: :unset)
|
67
67
|
data = Twilio::Values.of({
|
68
|
-
'FriendlyName' => friendly_name,
|
69
68
|
'ApiVersion' => api_version,
|
70
69
|
'VoiceUrl' => voice_url,
|
71
70
|
'VoiceMethod' => voice_method,
|
@@ -80,6 +79,7 @@ module Twilio
|
|
80
79
|
'SmsFallbackMethod' => sms_fallback_method,
|
81
80
|
'SmsStatusCallback' => sms_status_callback,
|
82
81
|
'MessageStatusCallback' => message_status_callback,
|
82
|
+
'FriendlyName' => friendly_name,
|
83
83
|
})
|
84
84
|
|
85
85
|
payload = @version.create(
|
@@ -299,6 +299,7 @@ module Twilio
|
|
299
299
|
@properties = {
|
300
300
|
'account_sid' => payload['account_sid'],
|
301
301
|
'api_version' => payload['api_version'],
|
302
|
+
'as_of' => payload['as_of'],
|
302
303
|
'category' => payload['category'],
|
303
304
|
'count' => payload['count'],
|
304
305
|
'count_unit' => payload['count_unit'],
|
@@ -326,6 +327,12 @@ module Twilio
|
|
326
327
|
@properties['api_version']
|
327
328
|
end
|
328
329
|
|
330
|
+
##
|
331
|
+
# @return [String] Usage records up to date as of this timestamp
|
332
|
+
def as_of
|
333
|
+
@properties['as_of']
|
334
|
+
end
|
335
|
+
|
329
336
|
##
|
330
337
|
# @return [record.Category] The category of usage
|
331
338
|
def category
|
@@ -226,6 +226,7 @@ module Twilio
|
|
226
226
|
@properties = {
|
227
227
|
'account_sid' => payload['account_sid'],
|
228
228
|
'api_version' => payload['api_version'],
|
229
|
+
'as_of' => payload['as_of'],
|
229
230
|
'category' => payload['category'],
|
230
231
|
'count' => payload['count'],
|
231
232
|
'count_unit' => payload['count_unit'],
|
@@ -253,6 +254,12 @@ module Twilio
|
|
253
254
|
@properties['api_version']
|
254
255
|
end
|
255
256
|
|
257
|
+
##
|
258
|
+
# @return [String] Usage records up to date as of this timestamp
|
259
|
+
def as_of
|
260
|
+
@properties['as_of']
|
261
|
+
end
|
262
|
+
|
256
263
|
##
|
257
264
|
# @return [all_time.Category] The category of usage
|
258
265
|
def category
|
@@ -226,6 +226,7 @@ module Twilio
|
|
226
226
|
@properties = {
|
227
227
|
'account_sid' => payload['account_sid'],
|
228
228
|
'api_version' => payload['api_version'],
|
229
|
+
'as_of' => payload['as_of'],
|
229
230
|
'category' => payload['category'],
|
230
231
|
'count' => payload['count'],
|
231
232
|
'count_unit' => payload['count_unit'],
|
@@ -253,6 +254,12 @@ module Twilio
|
|
253
254
|
@properties['api_version']
|
254
255
|
end
|
255
256
|
|
257
|
+
##
|
258
|
+
# @return [String] Usage records up to date as of this timestamp
|
259
|
+
def as_of
|
260
|
+
@properties['as_of']
|
261
|
+
end
|
262
|
+
|
256
263
|
##
|
257
264
|
# @return [daily.Category] The category of usage
|
258
265
|
def category
|
@@ -226,6 +226,7 @@ module Twilio
|
|
226
226
|
@properties = {
|
227
227
|
'account_sid' => payload['account_sid'],
|
228
228
|
'api_version' => payload['api_version'],
|
229
|
+
'as_of' => payload['as_of'],
|
229
230
|
'category' => payload['category'],
|
230
231
|
'count' => payload['count'],
|
231
232
|
'count_unit' => payload['count_unit'],
|
@@ -253,6 +254,12 @@ module Twilio
|
|
253
254
|
@properties['api_version']
|
254
255
|
end
|
255
256
|
|
257
|
+
##
|
258
|
+
# @return [String] Usage records up to date as of this timestamp
|
259
|
+
def as_of
|
260
|
+
@properties['as_of']
|
261
|
+
end
|
262
|
+
|
256
263
|
##
|
257
264
|
# @return [last_month.Category] The category of usage
|
258
265
|
def category
|
@@ -226,6 +226,7 @@ module Twilio
|
|
226
226
|
@properties = {
|
227
227
|
'account_sid' => payload['account_sid'],
|
228
228
|
'api_version' => payload['api_version'],
|
229
|
+
'as_of' => payload['as_of'],
|
229
230
|
'category' => payload['category'],
|
230
231
|
'count' => payload['count'],
|
231
232
|
'count_unit' => payload['count_unit'],
|
@@ -253,6 +254,12 @@ module Twilio
|
|
253
254
|
@properties['api_version']
|
254
255
|
end
|
255
256
|
|
257
|
+
##
|
258
|
+
# @return [String] Usage records up to date as of this timestamp
|
259
|
+
def as_of
|
260
|
+
@properties['as_of']
|
261
|
+
end
|
262
|
+
|
256
263
|
##
|
257
264
|
# @return [monthly.Category] The category of usage
|
258
265
|
def category
|
@@ -226,6 +226,7 @@ module Twilio
|
|
226
226
|
@properties = {
|
227
227
|
'account_sid' => payload['account_sid'],
|
228
228
|
'api_version' => payload['api_version'],
|
229
|
+
'as_of' => payload['as_of'],
|
229
230
|
'category' => payload['category'],
|
230
231
|
'count' => payload['count'],
|
231
232
|
'count_unit' => payload['count_unit'],
|
@@ -253,6 +254,12 @@ module Twilio
|
|
253
254
|
@properties['api_version']
|
254
255
|
end
|
255
256
|
|
257
|
+
##
|
258
|
+
# @return [String] Usage records up to date as of this timestamp
|
259
|
+
def as_of
|
260
|
+
@properties['as_of']
|
261
|
+
end
|
262
|
+
|
256
263
|
##
|
257
264
|
# @return [this_month.Category] The category of usage
|
258
265
|
def category
|
@@ -226,6 +226,7 @@ module Twilio
|
|
226
226
|
@properties = {
|
227
227
|
'account_sid' => payload['account_sid'],
|
228
228
|
'api_version' => payload['api_version'],
|
229
|
+
'as_of' => payload['as_of'],
|
229
230
|
'category' => payload['category'],
|
230
231
|
'count' => payload['count'],
|
231
232
|
'count_unit' => payload['count_unit'],
|
@@ -253,6 +254,12 @@ module Twilio
|
|
253
254
|
@properties['api_version']
|
254
255
|
end
|
255
256
|
|
257
|
+
##
|
258
|
+
# @return [String] Usage records up to date as of this timestamp
|
259
|
+
def as_of
|
260
|
+
@properties['as_of']
|
261
|
+
end
|
262
|
+
|
256
263
|
##
|
257
264
|
# @return [today.Category] The category of usage
|
258
265
|
def category
|
@@ -226,6 +226,7 @@ module Twilio
|
|
226
226
|
@properties = {
|
227
227
|
'account_sid' => payload['account_sid'],
|
228
228
|
'api_version' => payload['api_version'],
|
229
|
+
'as_of' => payload['as_of'],
|
229
230
|
'category' => payload['category'],
|
230
231
|
'count' => payload['count'],
|
231
232
|
'count_unit' => payload['count_unit'],
|
@@ -253,6 +254,12 @@ module Twilio
|
|
253
254
|
@properties['api_version']
|
254
255
|
end
|
255
256
|
|
257
|
+
##
|
258
|
+
# @return [String] Usage records up to date as of this timestamp
|
259
|
+
def as_of
|
260
|
+
@properties['as_of']
|
261
|
+
end
|
262
|
+
|
256
263
|
##
|
257
264
|
# @return [yearly.Category] The category of usage
|
258
265
|
def category
|
@@ -226,6 +226,7 @@ module Twilio
|
|
226
226
|
@properties = {
|
227
227
|
'account_sid' => payload['account_sid'],
|
228
228
|
'api_version' => payload['api_version'],
|
229
|
+
'as_of' => payload['as_of'],
|
229
230
|
'category' => payload['category'],
|
230
231
|
'count' => payload['count'],
|
231
232
|
'count_unit' => payload['count_unit'],
|
@@ -253,6 +254,12 @@ module Twilio
|
|
253
254
|
@properties['api_version']
|
254
255
|
end
|
255
256
|
|
257
|
+
##
|
258
|
+
# @return [String] Usage records up to date as of this timestamp
|
259
|
+
def as_of
|
260
|
+
@properties['as_of']
|
261
|
+
end
|
262
|
+
|
256
263
|
##
|
257
264
|
# @return [yesterday.Category] The category of usage
|
258
265
|
def category
|
@@ -134,9 +134,10 @@ module Twilio
|
|
134
134
|
# Retrieve a single page of ExecutionInstance records from the API.
|
135
135
|
# Request is executed immediately.
|
136
136
|
# @param [String] to The Contact phone number to start a Studio Flow Execution,
|
137
|
-
# available as variable {{contact.channel.address}}
|
137
|
+
# available as variable `{{contact.channel.address}}`.
|
138
138
|
# @param [String] from The Twilio phone number to send messages or initiate calls
|
139
|
-
# from during the Flow Execution, available as variable
|
139
|
+
# from during the Flow Execution, available as variable
|
140
|
+
# `{{flow.channel.address}}`.
|
140
141
|
# @param [Hash] parameters JSON data that will be added to your flow's context and
|
141
142
|
# can accessed as variables inside your flow. For example, if you pass in
|
142
143
|
# `Parameters={"name":"Zeke"}`, then inside a widget you can reference the
|
@@ -154,7 +154,7 @@ module Twilio
|
|
154
154
|
end
|
155
155
|
|
156
156
|
##
|
157
|
-
# @return [
|
157
|
+
# @return [String] A collection of Subscribe Rules to include or exclude matching Tracks.
|
158
158
|
def rules
|
159
159
|
@properties['rules']
|
160
160
|
end
|
@@ -46,6 +46,12 @@ module Twilio
|
|
46
46
|
self.v1.rate_plans(sid)
|
47
47
|
end
|
48
48
|
|
49
|
+
##
|
50
|
+
# @return [Twilio::REST::Wireless::V1::UsageRecordInstance]
|
51
|
+
def usage_records
|
52
|
+
self.v1.usage_records()
|
53
|
+
end
|
54
|
+
|
49
55
|
##
|
50
56
|
# @param [String] sid A 34 character string that uniquely identifies this
|
51
57
|
# resource.
|
@@ -17,6 +17,7 @@ module Twilio
|
|
17
17
|
@version = 'v1'
|
18
18
|
@commands = nil
|
19
19
|
@rate_plans = nil
|
20
|
+
@usage_records = nil
|
20
21
|
@sims = nil
|
21
22
|
end
|
22
23
|
|
@@ -49,6 +50,12 @@ module Twilio
|
|
49
50
|
end
|
50
51
|
end
|
51
52
|
|
53
|
+
##
|
54
|
+
# @return [Twilio::REST::Wireless::V1::UsageRecordContext]
|
55
|
+
def usage_records
|
56
|
+
@usage_records ||= UsageRecordList.new self
|
57
|
+
end
|
58
|
+
|
52
59
|
##
|
53
60
|
# @param [String] sid A 34 character string that uniquely identifies this
|
54
61
|
# resource.
|
@@ -0,0 +1,231 @@
|
|
1
|
+
##
|
2
|
+
# This code was generated by
|
3
|
+
# \ / _ _ _| _ _
|
4
|
+
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
5
|
+
# / /
|
6
|
+
#
|
7
|
+
# frozen_string_literal: true
|
8
|
+
|
9
|
+
module Twilio
|
10
|
+
module REST
|
11
|
+
class Wireless < Domain
|
12
|
+
class V1 < Version
|
13
|
+
class UsageRecordList < ListResource
|
14
|
+
##
|
15
|
+
# Initialize the UsageRecordList
|
16
|
+
# @param [Version] version Version that contains the resource
|
17
|
+
# @return [UsageRecordList] UsageRecordList
|
18
|
+
def initialize(version)
|
19
|
+
super(version)
|
20
|
+
|
21
|
+
# Path Solution
|
22
|
+
@solution = {}
|
23
|
+
@uri = "/UsageRecords"
|
24
|
+
end
|
25
|
+
|
26
|
+
##
|
27
|
+
# Lists UsageRecordInstance records from the API as a list.
|
28
|
+
# Unlike stream(), this operation is eager and will load `limit` records into
|
29
|
+
# memory before returning.
|
30
|
+
# @param [Time] end_ Only include usage that has occurred on or before this date.
|
31
|
+
# Format is [ISO 8601](http://www.iso.org/iso/home/standards/iso8601.htm).
|
32
|
+
# @param [Time] start Only include usage that has occurred on or after this date.
|
33
|
+
# Format is [ISO 8601](http://www.iso.org/iso/home/standards/iso8601.htm).
|
34
|
+
# @param [usage_record.Granularity] granularity The time-based grouping that
|
35
|
+
# results are aggregated by. Valid values are `daily`, `hourly`, `all`. `all` will
|
36
|
+
# return one Usage Record for the entire period.
|
37
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
38
|
+
# guarantees to never return more than limit. Default is no limit
|
39
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
40
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
41
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
42
|
+
# efficient page size, i.e. min(limit, 1000)
|
43
|
+
# @return [Array] Array of up to limit results
|
44
|
+
def list(end_: :unset, start: :unset, granularity: :unset, limit: nil, page_size: nil)
|
45
|
+
self.stream(
|
46
|
+
end_: end_,
|
47
|
+
start: start,
|
48
|
+
granularity: granularity,
|
49
|
+
limit: limit,
|
50
|
+
page_size: page_size
|
51
|
+
).entries
|
52
|
+
end
|
53
|
+
|
54
|
+
##
|
55
|
+
# Streams UsageRecordInstance records from the API as an Enumerable.
|
56
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
57
|
+
# is reached.
|
58
|
+
# @param [Time] end_ Only include usage that has occurred on or before this date.
|
59
|
+
# Format is [ISO 8601](http://www.iso.org/iso/home/standards/iso8601.htm).
|
60
|
+
# @param [Time] start Only include usage that has occurred on or after this date.
|
61
|
+
# Format is [ISO 8601](http://www.iso.org/iso/home/standards/iso8601.htm).
|
62
|
+
# @param [usage_record.Granularity] granularity The time-based grouping that
|
63
|
+
# results are aggregated by. Valid values are `daily`, `hourly`, `all`. `all` will
|
64
|
+
# return one Usage Record for the entire period.
|
65
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
66
|
+
# guarantees to never return more than limit. Default is no limit.
|
67
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
68
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
69
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
70
|
+
# efficient page size, i.e. min(limit, 1000)
|
71
|
+
# @return [Enumerable] Enumerable that will yield up to limit results
|
72
|
+
def stream(end_: :unset, start: :unset, granularity: :unset, limit: nil, page_size: nil)
|
73
|
+
limits = @version.read_limits(limit, page_size)
|
74
|
+
|
75
|
+
page = self.page(end_: end_, start: start, granularity: granularity, page_size: limits[:page_size], )
|
76
|
+
|
77
|
+
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
78
|
+
end
|
79
|
+
|
80
|
+
##
|
81
|
+
# When passed a block, yields UsageRecordInstance records from the API.
|
82
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
83
|
+
# is reached.
|
84
|
+
def each
|
85
|
+
limits = @version.read_limits
|
86
|
+
|
87
|
+
page = self.page(page_size: limits[:page_size], )
|
88
|
+
|
89
|
+
@version.stream(page,
|
90
|
+
limit: limits[:limit],
|
91
|
+
page_limit: limits[:page_limit]).each {|x| yield x}
|
92
|
+
end
|
93
|
+
|
94
|
+
##
|
95
|
+
# Retrieve a single page of UsageRecordInstance records from the API.
|
96
|
+
# Request is executed immediately.
|
97
|
+
# @param [Time] end_ Only include usage that has occurred on or before this date.
|
98
|
+
# Format is [ISO 8601](http://www.iso.org/iso/home/standards/iso8601.htm).
|
99
|
+
# @param [Time] start Only include usage that has occurred on or after this date.
|
100
|
+
# Format is [ISO 8601](http://www.iso.org/iso/home/standards/iso8601.htm).
|
101
|
+
# @param [usage_record.Granularity] granularity The time-based grouping that
|
102
|
+
# results are aggregated by. Valid values are `daily`, `hourly`, `all`. `all` will
|
103
|
+
# return one Usage Record for the entire period.
|
104
|
+
# @param [String] page_token PageToken provided by the API
|
105
|
+
# @param [Integer] page_number Page Number, this value is simply for client state
|
106
|
+
# @param [Integer] page_size Number of records to return, defaults to 50
|
107
|
+
# @return [Page] Page of UsageRecordInstance
|
108
|
+
def page(end_: :unset, start: :unset, granularity: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
|
109
|
+
params = Twilio::Values.of({
|
110
|
+
'End' => Twilio.serialize_iso8601_datetime(end_),
|
111
|
+
'Start' => Twilio.serialize_iso8601_datetime(start),
|
112
|
+
'Granularity' => granularity,
|
113
|
+
'PageToken' => page_token,
|
114
|
+
'Page' => page_number,
|
115
|
+
'PageSize' => page_size,
|
116
|
+
})
|
117
|
+
response = @version.page(
|
118
|
+
'GET',
|
119
|
+
@uri,
|
120
|
+
params
|
121
|
+
)
|
122
|
+
UsageRecordPage.new(@version, response, @solution)
|
123
|
+
end
|
124
|
+
|
125
|
+
##
|
126
|
+
# Retrieve a single page of UsageRecordInstance records from the API.
|
127
|
+
# Request is executed immediately.
|
128
|
+
# @param [String] target_url API-generated URL for the requested results page
|
129
|
+
# @return [Page] Page of UsageRecordInstance
|
130
|
+
def get_page(target_url)
|
131
|
+
response = @version.domain.request(
|
132
|
+
'GET',
|
133
|
+
target_url
|
134
|
+
)
|
135
|
+
UsageRecordPage.new(@version, response, @solution)
|
136
|
+
end
|
137
|
+
|
138
|
+
##
|
139
|
+
# Provide a user friendly representation
|
140
|
+
def to_s
|
141
|
+
'#<Twilio.Wireless.V1.UsageRecordList>'
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
class UsageRecordPage < Page
|
146
|
+
##
|
147
|
+
# Initialize the UsageRecordPage
|
148
|
+
# @param [Version] version Version that contains the resource
|
149
|
+
# @param [Response] response Response from the API
|
150
|
+
# @param [Hash] solution Path solution for the resource
|
151
|
+
# @return [UsageRecordPage] UsageRecordPage
|
152
|
+
def initialize(version, response, solution)
|
153
|
+
super(version, response)
|
154
|
+
|
155
|
+
# Path Solution
|
156
|
+
@solution = solution
|
157
|
+
end
|
158
|
+
|
159
|
+
##
|
160
|
+
# Build an instance of UsageRecordInstance
|
161
|
+
# @param [Hash] payload Payload response from the API
|
162
|
+
# @return [UsageRecordInstance] UsageRecordInstance
|
163
|
+
def get_instance(payload)
|
164
|
+
UsageRecordInstance.new(@version, payload, )
|
165
|
+
end
|
166
|
+
|
167
|
+
##
|
168
|
+
# Provide a user friendly representation
|
169
|
+
def to_s
|
170
|
+
'<Twilio.Wireless.V1.UsageRecordPage>'
|
171
|
+
end
|
172
|
+
end
|
173
|
+
|
174
|
+
class UsageRecordInstance < InstanceResource
|
175
|
+
##
|
176
|
+
# Initialize the UsageRecordInstance
|
177
|
+
# @param [Version] version Version that contains the resource
|
178
|
+
# @param [Hash] payload payload that contains response from Twilio
|
179
|
+
# @return [UsageRecordInstance] UsageRecordInstance
|
180
|
+
def initialize(version, payload)
|
181
|
+
super(version)
|
182
|
+
|
183
|
+
# Marshaled Properties
|
184
|
+
@properties = {
|
185
|
+
'account_sid' => payload['account_sid'],
|
186
|
+
'period' => payload['period'],
|
187
|
+
'commands' => payload['commands'],
|
188
|
+
'data' => payload['data'],
|
189
|
+
}
|
190
|
+
end
|
191
|
+
|
192
|
+
##
|
193
|
+
# @return [String] The unique id of the Account.
|
194
|
+
def account_sid
|
195
|
+
@properties['account_sid']
|
196
|
+
end
|
197
|
+
|
198
|
+
##
|
199
|
+
# @return [Hash] The time period for which usage is reported.
|
200
|
+
def period
|
201
|
+
@properties['period']
|
202
|
+
end
|
203
|
+
|
204
|
+
##
|
205
|
+
# @return [Hash] An object representing the aggregated Commands usage for all SIMs over the period.
|
206
|
+
def commands
|
207
|
+
@properties['commands']
|
208
|
+
end
|
209
|
+
|
210
|
+
##
|
211
|
+
# @return [Hash] An object representing the aggregated Data usage for all SIMs over the period.
|
212
|
+
def data
|
213
|
+
@properties['data']
|
214
|
+
end
|
215
|
+
|
216
|
+
##
|
217
|
+
# Provide a user friendly representation
|
218
|
+
def to_s
|
219
|
+
"<Twilio.Wireless.V1.UsageRecordInstance>"
|
220
|
+
end
|
221
|
+
|
222
|
+
##
|
223
|
+
# Provide a detailed, user friendly representation
|
224
|
+
def inspect
|
225
|
+
"<Twilio.Wireless.V1.UsageRecordInstance>"
|
226
|
+
end
|
227
|
+
end
|
228
|
+
end
|
229
|
+
end
|
230
|
+
end
|
231
|
+
end
|
data/lib/twilio-ruby/version.rb
CHANGED
@@ -14,15 +14,14 @@ describe 'Application' do
|
|
14
14
|
|
15
15
|
expect {
|
16
16
|
@client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
17
|
-
.applications.create(
|
17
|
+
.applications.create()
|
18
18
|
}.to raise_exception(Twilio::REST::TwilioError)
|
19
19
|
|
20
|
-
values = {
|
20
|
+
values = {}
|
21
21
|
expect(
|
22
22
|
@holodeck.has_request?(Holodeck::Request.new(
|
23
23
|
method: 'post',
|
24
24
|
url: 'https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Applications.json',
|
25
|
-
data: values,
|
26
25
|
))).to eq(true)
|
27
26
|
end
|
28
27
|
|
@@ -56,7 +55,7 @@ describe 'Application' do
|
|
56
55
|
))
|
57
56
|
|
58
57
|
actual = @client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
59
|
-
.applications.create(
|
58
|
+
.applications.create()
|
60
59
|
|
61
60
|
expect(actual).to_not eq(nil)
|
62
61
|
end
|
@@ -35,11 +35,13 @@ describe 'Token' do
|
|
35
35
|
"date_updated": "Fri, 24 Jul 2015 18:43:58 +0000",
|
36
36
|
"ice_servers": [
|
37
37
|
{
|
38
|
-
"url": "stun:global.stun:3478?transport=udp"
|
38
|
+
"url": "stun:global.stun:3478?transport=udp",
|
39
|
+
"urls": "stun:global.stun:3478?transport=udp"
|
39
40
|
},
|
40
41
|
{
|
41
42
|
"credential": "5SR2x8mZK1lTFJW3NVgLGw6UM9C0dja4jI/Hdw3xr+w=",
|
42
43
|
"url": "turn:global.turn:3478?transport=udp",
|
44
|
+
"urls": "turn:global.turn:3478?transport=udp",
|
43
45
|
"username": "cda92e5006c7810494639fc466ecc80182cef8183fdf400f84c4126f3b59d0bb"
|
44
46
|
}
|
45
47
|
],
|
@@ -34,7 +34,7 @@ describe 'VerificationCheck' do
|
|
34
34
|
"sid": "VEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
35
35
|
"service_sid": "VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
36
36
|
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
37
|
-
"to": "+
|
37
|
+
"to": "+15017122661",
|
38
38
|
"channel": "sms",
|
39
39
|
"status": "approved",
|
40
40
|
"valid": false,
|
@@ -34,7 +34,7 @@ describe 'Verification' do
|
|
34
34
|
"sid": "VEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
35
35
|
"service_sid": "VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
36
36
|
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
37
|
-
"to": "+
|
37
|
+
"to": "+15017122661",
|
38
38
|
"channel": "sms",
|
39
39
|
"status": "pending",
|
40
40
|
"valid": null,
|
@@ -34,7 +34,7 @@ describe 'VerificationCheck' do
|
|
34
34
|
"sid": "VEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
35
35
|
"service_sid": "VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
36
36
|
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
37
|
-
"to": "+
|
37
|
+
"to": "+15017122661",
|
38
38
|
"channel": "sms",
|
39
39
|
"status": "approved",
|
40
40
|
"valid": true,
|
@@ -34,7 +34,7 @@ describe 'Verification' do
|
|
34
34
|
"sid": "VEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
35
35
|
"service_sid": "VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
36
36
|
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
37
|
-
"to": "+
|
37
|
+
"to": "+15017122661",
|
38
38
|
"channel": "sms",
|
39
39
|
"status": "pending",
|
40
40
|
"valid": false,
|
@@ -70,7 +70,7 @@ describe 'Verification' do
|
|
70
70
|
"sid": "VEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
71
71
|
"service_sid": "VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
72
72
|
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
73
|
-
"to": "+
|
73
|
+
"to": "+15017122661",
|
74
74
|
"channel": "sms",
|
75
75
|
"status": "pending",
|
76
76
|
"valid": false,
|
@@ -123,7 +123,7 @@ describe 'Verification' do
|
|
123
123
|
"sid": "VEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
124
124
|
"service_sid": "VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
125
125
|
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
126
|
-
"to": "+
|
126
|
+
"to": "+15017122661",
|
127
127
|
"channel": "sms",
|
128
128
|
"status": "canceled",
|
129
129
|
"valid": false,
|
@@ -175,7 +175,7 @@ describe 'Verification' do
|
|
175
175
|
"sid": "VEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
176
176
|
"service_sid": "VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
177
177
|
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
178
|
-
"to": "+
|
178
|
+
"to": "+15017122661",
|
179
179
|
"channel": "sms",
|
180
180
|
"status": "pending",
|
181
181
|
"valid": false,
|
data/spec/integration/video/v1/room/room_participant/room_participant_subscribe_rule_spec.rb
CHANGED
@@ -35,7 +35,16 @@ describe 'SubscribeRules' do
|
|
35
35
|
"room_sid": "RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
36
36
|
"date_created": null,
|
37
37
|
"date_updated": null,
|
38
|
-
"rules": [
|
38
|
+
"rules": [
|
39
|
+
{
|
40
|
+
"type": "include",
|
41
|
+
"all": true,
|
42
|
+
"publisher": null,
|
43
|
+
"track": null,
|
44
|
+
"kind": null,
|
45
|
+
"priority": null
|
46
|
+
}
|
47
|
+
]
|
39
48
|
}
|
40
49
|
]
|
41
50
|
))
|
@@ -76,7 +85,11 @@ describe 'SubscribeRules' do
|
|
76
85
|
"rules": [
|
77
86
|
{
|
78
87
|
"type": "exclude",
|
79
|
-
"all": true
|
88
|
+
"all": true,
|
89
|
+
"publisher": null,
|
90
|
+
"track": null,
|
91
|
+
"kind": null,
|
92
|
+
"priority": null
|
80
93
|
}
|
81
94
|
]
|
82
95
|
}
|
@@ -0,0 +1,111 @@
|
|
1
|
+
##
|
2
|
+
# This code was generated by
|
3
|
+
# \ / _ _ _| _ _
|
4
|
+
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
5
|
+
# / /
|
6
|
+
#
|
7
|
+
# frozen_string_literal: true
|
8
|
+
|
9
|
+
require 'spec_helper.rb'
|
10
|
+
|
11
|
+
describe 'UsageRecord' do
|
12
|
+
it "can read" do
|
13
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
14
|
+
|
15
|
+
expect {
|
16
|
+
@client.wireless.v1.usage_records.list()
|
17
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
18
|
+
|
19
|
+
values = {}
|
20
|
+
expect(
|
21
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
22
|
+
method: 'get',
|
23
|
+
url: 'https://wireless.twilio.com/v1/UsageRecords',
|
24
|
+
))).to eq(true)
|
25
|
+
end
|
26
|
+
|
27
|
+
it "receives fetch responses" do
|
28
|
+
@holodeck.mock(Twilio::Response.new(
|
29
|
+
200,
|
30
|
+
%q[
|
31
|
+
{
|
32
|
+
"usage_records": [
|
33
|
+
{
|
34
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
35
|
+
"commands": {
|
36
|
+
"billing_units": "USD",
|
37
|
+
"billed": 0,
|
38
|
+
"total": 3,
|
39
|
+
"from_sim": 1,
|
40
|
+
"to_sim": 2,
|
41
|
+
"home": {
|
42
|
+
"billing_units": "USD",
|
43
|
+
"billed": 0,
|
44
|
+
"total": 3,
|
45
|
+
"from_sim": 1,
|
46
|
+
"to_sim": 2
|
47
|
+
},
|
48
|
+
"national_roaming": {
|
49
|
+
"billing_units": "USD",
|
50
|
+
"billed": 0,
|
51
|
+
"total": 0,
|
52
|
+
"from_sim": 0,
|
53
|
+
"to_sim": 0
|
54
|
+
},
|
55
|
+
"international_roaming": []
|
56
|
+
},
|
57
|
+
"data": {
|
58
|
+
"billing_units": "USD",
|
59
|
+
"billed": 0.35,
|
60
|
+
"total": 3494609,
|
61
|
+
"upload": 731560,
|
62
|
+
"download": 2763049,
|
63
|
+
"units": "bytes",
|
64
|
+
"home": {
|
65
|
+
"billing_units": "USD",
|
66
|
+
"billed": 0.35,
|
67
|
+
"total": 3494609,
|
68
|
+
"upload": 731560,
|
69
|
+
"download": 2763049,
|
70
|
+
"units": "bytes"
|
71
|
+
},
|
72
|
+
"national_roaming": {
|
73
|
+
"billing_units": "USD",
|
74
|
+
"billed": 0,
|
75
|
+
"total": 0,
|
76
|
+
"upload": 0,
|
77
|
+
"download": 0,
|
78
|
+
"units": "bytes"
|
79
|
+
},
|
80
|
+
"international_roaming": []
|
81
|
+
},
|
82
|
+
"period": {
|
83
|
+
"start": "2015-07-30T20:00:00Z",
|
84
|
+
"end": "2015-07-30T20:00:00Z"
|
85
|
+
}
|
86
|
+
},
|
87
|
+
{
|
88
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
89
|
+
"commands": {},
|
90
|
+
"data": {},
|
91
|
+
"period": {}
|
92
|
+
}
|
93
|
+
],
|
94
|
+
"meta": {
|
95
|
+
"first_page_url": "https://wireless.twilio.com/v1/UsageRecords?Start=2015-07-30T20%3A00%3A00Z&End=2015-07-30T20%3A00%3A00Z&PageSize=50&Page=0",
|
96
|
+
"key": "usage_records",
|
97
|
+
"next_page_url": null,
|
98
|
+
"page": 0,
|
99
|
+
"page_size": 50,
|
100
|
+
"previous_page_url": null,
|
101
|
+
"url": "https://wireless.twilio.com/v1/UsageRecords?Start=2015-07-30T20%3A00%3A00Z&End=2015-07-30T20%3A00%3A00Z&PageSize=50&Page=0"
|
102
|
+
}
|
103
|
+
}
|
104
|
+
]
|
105
|
+
))
|
106
|
+
|
107
|
+
actual = @client.wireless.v1.usage_records.list()
|
108
|
+
|
109
|
+
expect(actual).to_not eq(nil)
|
110
|
+
end
|
111
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: twilio-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.25.
|
4
|
+
version: 5.25.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Twilio API Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-07-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jwt
|
@@ -534,6 +534,7 @@ files:
|
|
534
534
|
- lib/twilio-ruby/rest/wireless/v1/sim.rb
|
535
535
|
- lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb
|
536
536
|
- lib/twilio-ruby/rest/wireless/v1/sim/usage_record.rb
|
537
|
+
- lib/twilio-ruby/rest/wireless/v1/usage_record.rb
|
537
538
|
- lib/twilio-ruby/security/request_validator.rb
|
538
539
|
- lib/twilio-ruby/twiml/fax_response.rb
|
539
540
|
- lib/twilio-ruby/twiml/messaging_response.rb
|
@@ -858,6 +859,7 @@ files:
|
|
858
859
|
- spec/integration/wireless/v1/sim/data_session_spec.rb
|
859
860
|
- spec/integration/wireless/v1/sim/usage_record_spec.rb
|
860
861
|
- spec/integration/wireless/v1/sim_spec.rb
|
862
|
+
- spec/integration/wireless/v1/usage_record_spec.rb
|
861
863
|
- spec/jwt/access_token_spec.rb
|
862
864
|
- spec/jwt/client_capability_spec.rb
|
863
865
|
- spec/jwt/task_router_spec.rb
|
@@ -1220,6 +1222,7 @@ test_files:
|
|
1220
1222
|
- spec/integration/wireless/v1/sim/data_session_spec.rb
|
1221
1223
|
- spec/integration/wireless/v1/sim/usage_record_spec.rb
|
1222
1224
|
- spec/integration/wireless/v1/sim_spec.rb
|
1225
|
+
- spec/integration/wireless/v1/usage_record_spec.rb
|
1223
1226
|
- spec/jwt/access_token_spec.rb
|
1224
1227
|
- spec/jwt/client_capability_spec.rb
|
1225
1228
|
- spec/jwt/task_router_spec.rb
|