twilio-ruby 7.10.3 → 7.10.4
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 +34 -0
- data/README.md +2 -2
- data/lib/twilio-ruby/rest/flex_api_base.rb +1 -6
- data/lib/twilio-ruby/rest/insights/v2/inbound.rb +570 -0
- data/lib/twilio-ruby/rest/insights/v2/outbound.rb +641 -0
- data/lib/twilio-ruby/rest/insights/v2/report.rb +940 -0
- data/lib/twilio-ruby/rest/insights/v2.rb +79 -0
- data/lib/twilio-ruby/rest/insights_base.rb +6 -1
- data/lib/twilio-ruby/rest/numbers/v1/embedded_session.rb +251 -0
- data/lib/twilio-ruby/rest/numbers/v1/sender_id_registration.rb +333 -0
- data/lib/twilio-ruby/rest/numbers/v1.rb +12 -0
- data/lib/twilio-ruby/rest/numbers/v2/application.rb +153 -8
- data/lib/twilio-ruby/rest/preview_iam/versionless/organization/user.rb +197 -0
- data/lib/twilio-ruby/rest/studio/v2/flow/execution.rb +14 -0
- data/lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb +7 -0
- data/lib/twilio-ruby/rest/studio/v2/flow.rb +7 -0
- data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +2 -2
- data/lib/twilio-ruby/version.rb +1 -1
- metadata +8 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 18a72cbd3261cddb2f97f5239b288f8c6b294f148251908b68fddb06ebb51dfa
|
|
4
|
+
data.tar.gz: 9260e02029af0a3df06ec115313c48593fd96e6b6d3e9370c05797d39ce912c1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5fae0cef7f1cc6e078f3a5078bd8f6f8b25723f9b16eb4d67132dae0dcf1d1ca472dcfd7d65ef3ec943067c21bf021c01b9746dd839dd73acba5183a1e48b812
|
|
7
|
+
data.tar.gz: e7a5a16984257eb40c1abcdad2b41c32ac0677551b55615c5e570f29387d8ca8b8db9231682faeb89047d1087c3c46ff8d96316b62c8a5da290975b485c9c9da
|
data/CHANGES.md
CHANGED
|
@@ -1,6 +1,40 @@
|
|
|
1
1
|
twilio-ruby changelog
|
|
2
2
|
=====================
|
|
3
3
|
|
|
4
|
+
[2026-03-24] Version 7.10.4
|
|
5
|
+
---------------------------
|
|
6
|
+
**Data-ingress**
|
|
7
|
+
- # API Changes
|
|
8
|
+
- ## 2026-03-23
|
|
9
|
+
- Added stage-us1 to supportedRealms for all endpoints
|
|
10
|
+
- ## 2026-03-20
|
|
11
|
+
- **Content updates**:
|
|
12
|
+
- Removed estimatedCompletionTime from `LongRunningOperationResponse`
|
|
13
|
+
- Moved operationId from `LongRunningOperationResponse` to headers
|
|
14
|
+
- ## 2026-03-18
|
|
15
|
+
- **Added 1 new path(s)**:
|
|
16
|
+
- `/v1/ControlPlane/Operations/{OperationId}` (GetControlPlaneOperationStatus)
|
|
17
|
+
- ## 2026-03-11
|
|
18
|
+
- Minor updates (formatting, metadata)
|
|
19
|
+
- ## 2026-03-11
|
|
20
|
+
- Minor updates (formatting, metadata)
|
|
21
|
+
- ## 2026-03-11
|
|
22
|
+
- Minor updates (formatting, metadata)
|
|
23
|
+
- ## 2026-03-11
|
|
24
|
+
- Minor updates (formatting, metadata)
|
|
25
|
+
- ## 2026-03-11
|
|
26
|
+
- Minor updates (formatting, metadata)
|
|
27
|
+
- ## 2026-03-05
|
|
28
|
+
- Initial release with 10 paths and 22 operations
|
|
29
|
+
|
|
30
|
+
**Memory**
|
|
31
|
+
- ## 2026-03-19
|
|
32
|
+
- **Added 1 new path(s)**:
|
|
33
|
+
- `/v1/ControlPlane/Operations/{operationId}` (FetchOperation)
|
|
34
|
+
- ## 2026-03-11
|
|
35
|
+
- Minor updates (formatting, metadata)
|
|
36
|
+
|
|
37
|
+
|
|
4
38
|
[2026-03-10] Version 7.10.3
|
|
5
39
|
---------------------------
|
|
6
40
|
**Library - Chore**
|
data/README.md
CHANGED
|
@@ -39,13 +39,13 @@ This library supports the following Ruby implementations:
|
|
|
39
39
|
To install using [Bundler][bundler] grab the latest stable version:
|
|
40
40
|
|
|
41
41
|
```ruby
|
|
42
|
-
gem 'twilio-ruby', '~> 7.10.
|
|
42
|
+
gem 'twilio-ruby', '~> 7.10.4'
|
|
43
43
|
```
|
|
44
44
|
|
|
45
45
|
To manually install `twilio-ruby` via [Rubygems][rubygems] simply gem install:
|
|
46
46
|
|
|
47
47
|
```bash
|
|
48
|
-
gem install twilio-ruby -v 7.10.
|
|
48
|
+
gem install twilio-ruby -v 7.10.4
|
|
49
49
|
```
|
|
50
50
|
|
|
51
51
|
To build and install the development branch yourself from the latest source:
|
|
@@ -22,21 +22,16 @@ module Twilio
|
|
|
22
22
|
@host = "flex-api.twilio.com"
|
|
23
23
|
@port = 443
|
|
24
24
|
@v1 = nil
|
|
25
|
-
@v2 = nil
|
|
26
25
|
end
|
|
27
26
|
|
|
28
27
|
def v1
|
|
29
28
|
@v1 ||= FlexApi::V1.new self
|
|
30
29
|
end
|
|
31
30
|
|
|
32
|
-
def v2
|
|
33
|
-
@v2 ||= FlexApi::V2.new self
|
|
34
|
-
end
|
|
35
|
-
|
|
36
31
|
##
|
|
37
32
|
# Provide a user friendly representation
|
|
38
33
|
def to_s
|
|
39
|
-
'<Twilio::REST::FlexApi>';
|
|
34
|
+
'<Twilio::REST::FlexApi::V1>';
|
|
40
35
|
end
|
|
41
36
|
end
|
|
42
37
|
end
|
|
@@ -0,0 +1,570 @@
|
|
|
1
|
+
##
|
|
2
|
+
# This code was generated by
|
|
3
|
+
# ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
|
4
|
+
# | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
|
5
|
+
# | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
|
6
|
+
#
|
|
7
|
+
# Sample/reference Twilio API.
|
|
8
|
+
# This is the reference API for the rest-proxy server.
|
|
9
|
+
#
|
|
10
|
+
# NOTE: This class is auto generated by OpenAPI Generator.
|
|
11
|
+
# https://openapi-generator.tech
|
|
12
|
+
# Do not edit the class manually.
|
|
13
|
+
#
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
module Twilio
|
|
17
|
+
module REST
|
|
18
|
+
class Insights < InsightsBase
|
|
19
|
+
class V2 < Version
|
|
20
|
+
class InboundList < ListResource
|
|
21
|
+
|
|
22
|
+
class InsightsV2CreatePhoneNumbersReportRequest
|
|
23
|
+
# @param [time_range]: [InboundList.InsightsV2CreatePhoneNumbersReportRequestTimeRange]
|
|
24
|
+
# @param [filters]: [Array<InboundList.PhoneNumberReportFilter>]
|
|
25
|
+
# @param [size]: [String] The number of max available top Phone Numbers to generate.
|
|
26
|
+
attr_accessor :time_range, :filters, :size
|
|
27
|
+
def initialize(payload)
|
|
28
|
+
@time_range = payload["time_range"]
|
|
29
|
+
@filters = payload["filters"]
|
|
30
|
+
@size = payload["size"]
|
|
31
|
+
end
|
|
32
|
+
def to_json(options = {})
|
|
33
|
+
{
|
|
34
|
+
"time_range": @time_range,
|
|
35
|
+
"filters": @filters,
|
|
36
|
+
"size": @size,
|
|
37
|
+
}.to_json(options)
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
class InsightsV2CreatePhoneNumbersReportRequestTimeRange
|
|
42
|
+
# @param [start_time]: [Time] Start time of the report
|
|
43
|
+
# @param [end_time]: [Time] End time of the report
|
|
44
|
+
attr_accessor :start_time, :end_time
|
|
45
|
+
def initialize(payload)
|
|
46
|
+
@start_time = payload["start_time"]
|
|
47
|
+
@end_time = payload["end_time"]
|
|
48
|
+
end
|
|
49
|
+
def to_json(options = {})
|
|
50
|
+
{
|
|
51
|
+
"start_time": @start_time,
|
|
52
|
+
"end_time": @end_time,
|
|
53
|
+
}.to_json(options)
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
class PhoneNumberReportFilter
|
|
58
|
+
# @param [key]: [String] The name of the filter
|
|
59
|
+
# @param [values]: [Array<String>] List of supported filter values for the field name
|
|
60
|
+
attr_accessor :key, :values
|
|
61
|
+
def initialize(payload)
|
|
62
|
+
@key = payload["key"]
|
|
63
|
+
@values = payload["values"]
|
|
64
|
+
end
|
|
65
|
+
def to_json(options = {})
|
|
66
|
+
{
|
|
67
|
+
"key": @key,
|
|
68
|
+
"values": @values,
|
|
69
|
+
}.to_json(options)
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
class ReportFilter
|
|
74
|
+
# @param [key]: [String] The name of the filter 'call_state', 'call_direction', 'call_type', 'twilio_regions', 'caller_country_code', 'callee_country_code', 'silent'
|
|
75
|
+
# @param [values]: [Array<String>] List of supported filter values for the field name
|
|
76
|
+
attr_accessor :key, :values
|
|
77
|
+
def initialize(payload)
|
|
78
|
+
@key = payload["key"]
|
|
79
|
+
@values = payload["values"]
|
|
80
|
+
end
|
|
81
|
+
def to_json(options = {})
|
|
82
|
+
{
|
|
83
|
+
"key": @key,
|
|
84
|
+
"values": @values,
|
|
85
|
+
}.to_json(options)
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
##
|
|
91
|
+
# Initialize the InboundList
|
|
92
|
+
# @param [Version] version Version that contains the resource
|
|
93
|
+
# @return [InboundList] InboundList
|
|
94
|
+
def initialize(version, report_id: nil)
|
|
95
|
+
super(version)
|
|
96
|
+
|
|
97
|
+
# Path Solution
|
|
98
|
+
@solution = { report_id: report_id }
|
|
99
|
+
@uri = "/Voice/Reports/PhoneNumbers/Inbound/#{@solution[:report_id]}"
|
|
100
|
+
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
##
|
|
104
|
+
# Lists InboundInstance records from the API as a list.
|
|
105
|
+
# Unlike stream(), this operation is eager and will load `limit` records into
|
|
106
|
+
# memory before returning.
|
|
107
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
|
108
|
+
# guarantees to never return more than limit. Default is no limit
|
|
109
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
|
110
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
|
111
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
|
112
|
+
# efficient page size, i.e. min(limit, 1000)
|
|
113
|
+
# @return [Array] Array of up to limit results
|
|
114
|
+
def list(limit: nil, page_size: nil)
|
|
115
|
+
self.stream(
|
|
116
|
+
limit: limit,
|
|
117
|
+
page_size: page_size
|
|
118
|
+
).entries
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
##
|
|
122
|
+
# Streams Instance records from the API as an Enumerable.
|
|
123
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
|
124
|
+
# is reached.
|
|
125
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
|
126
|
+
# guarantees to never return more than limit. Default is no limit
|
|
127
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
|
128
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
|
129
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
|
130
|
+
# efficient page size, i.e. min(limit, 1000)
|
|
131
|
+
# @return [Enumerable] Enumerable that will yield up to limit results
|
|
132
|
+
def stream(limit: nil, page_size: nil)
|
|
133
|
+
limits = @version.read_limits(limit, page_size)
|
|
134
|
+
|
|
135
|
+
page = self.page(
|
|
136
|
+
page_size: limits[:page_size], )
|
|
137
|
+
|
|
138
|
+
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
##
|
|
142
|
+
# Lists InboundPageMetadata records from the API as a list.
|
|
143
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
|
144
|
+
# guarantees to never return more than limit. Default is no limit
|
|
145
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
|
146
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
|
147
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
|
148
|
+
# efficient page size, i.e. min(limit, 1000)
|
|
149
|
+
# @return [Array] Array of up to limit results
|
|
150
|
+
def list_with_metadata(limit: nil, page_size: nil)
|
|
151
|
+
limits = @version.read_limits(limit, page_size)
|
|
152
|
+
params = Twilio::Values.of({
|
|
153
|
+
|
|
154
|
+
'PageSize' => limits[:page_size],
|
|
155
|
+
});
|
|
156
|
+
headers = Twilio::Values.of({})
|
|
157
|
+
|
|
158
|
+
response = @version.page('GET', @uri, params: params, headers: headers)
|
|
159
|
+
|
|
160
|
+
InboundPageMetadata.new(@version, response, @solution, limits[:limit])
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
##
|
|
164
|
+
# When passed a block, yields InboundInstance records from the API.
|
|
165
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
|
166
|
+
# is reached.
|
|
167
|
+
def each
|
|
168
|
+
limits = @version.read_limits
|
|
169
|
+
|
|
170
|
+
page = self.page(page_size: limits[:page_size], )
|
|
171
|
+
|
|
172
|
+
@version.stream(page,
|
|
173
|
+
limit: limits[:limit],
|
|
174
|
+
page_limit: limits[:page_limit]).each {|x| yield x}
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
##
|
|
178
|
+
# Retrieve a single page of InboundInstance records from the API.
|
|
179
|
+
# Request is executed immediately.
|
|
180
|
+
# @param [String] page_token PageToken provided by the API
|
|
181
|
+
# @param [Integer] page_number Page Number, this value is simply for client state
|
|
182
|
+
# @param [Integer] page_size Number of records to return, defaults to 50
|
|
183
|
+
# @return [Page] Page of InboundInstance
|
|
184
|
+
def page(page_token: :unset, page_number: :unset,page_size: :unset)
|
|
185
|
+
params = Twilio::Values.of({
|
|
186
|
+
'PageToken' => page_token,
|
|
187
|
+
'Page' => page_number,
|
|
188
|
+
'PageSize' => page_size,
|
|
189
|
+
})
|
|
190
|
+
headers = Twilio::Values.of({})
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
response = @version.page('GET', @uri, params: params, headers: headers)
|
|
195
|
+
|
|
196
|
+
InboundPage.new(@version, response, @solution)
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
##
|
|
200
|
+
# Retrieve a single page of InboundInstance records from the API.
|
|
201
|
+
# Request is executed immediately.
|
|
202
|
+
# @param [String] target_url API-generated URL for the requested results page
|
|
203
|
+
# @return [Page] Page of InboundInstance
|
|
204
|
+
def get_page(target_url)
|
|
205
|
+
response = @version.domain.request(
|
|
206
|
+
'GET',
|
|
207
|
+
target_url
|
|
208
|
+
)
|
|
209
|
+
InboundPage.new(@version, response, @solution)
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
# Provide a user friendly representation
|
|
215
|
+
def to_s
|
|
216
|
+
'#<Twilio.Insights.V2.InboundList>'
|
|
217
|
+
end
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
class InboundContext < InstanceContext
|
|
222
|
+
##
|
|
223
|
+
# Initialize the InboundContext
|
|
224
|
+
# @param [Version] version Version that contains the resource
|
|
225
|
+
# @param [String] report_id A unique Report Id.
|
|
226
|
+
# @return [InboundContext] InboundContext
|
|
227
|
+
def initialize(version, report_id)
|
|
228
|
+
super(version)
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
# Path Solution
|
|
232
|
+
@solution = { report_id: report_id, }
|
|
233
|
+
@uri = "/Voice/Reports/PhoneNumbers/Inbound"
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
end
|
|
237
|
+
##
|
|
238
|
+
# Create the InboundInstance
|
|
239
|
+
# @param [InsightsV2CreatePhoneNumbersReportRequest] insights_v2_create_phone_numbers_report_request
|
|
240
|
+
# @return [InboundInstance] Created InboundInstance
|
|
241
|
+
def create(insights_v2_create_phone_numbers_report_request: :unset
|
|
242
|
+
)
|
|
243
|
+
|
|
244
|
+
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
|
|
245
|
+
headers['Content-Type'] = 'application/json'
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
payload = @version.create('POST', @uri, headers: headers, data: insights_v2_create_phone_numbers_report_request.to_json)
|
|
251
|
+
InboundInstance.new(
|
|
252
|
+
@version,
|
|
253
|
+
payload,
|
|
254
|
+
report_id: @solution[:report_id],
|
|
255
|
+
)
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
##
|
|
259
|
+
# Create the InboundInstanceMetadata
|
|
260
|
+
# @param [InsightsV2CreatePhoneNumbersReportRequest] insights_v2_create_phone_numbers_report_request
|
|
261
|
+
# @return [InboundInstance] Created InboundInstance
|
|
262
|
+
def create_with_metadata(insights_v2_create_phone_numbers_report_request: :unset
|
|
263
|
+
)
|
|
264
|
+
|
|
265
|
+
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
|
|
266
|
+
headers['Content-Type'] = 'application/json'
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
response = @version.create_with_metadata('POST', @uri, headers: headers, data: insights_v2_create_phone_numbers_report_request.to_json)
|
|
272
|
+
inbound_instance = InboundInstance.new(
|
|
273
|
+
@version,
|
|
274
|
+
response.body,
|
|
275
|
+
report_id: @solution[:report_id],
|
|
276
|
+
)
|
|
277
|
+
InboundInstanceMetadata.new(
|
|
278
|
+
@version,
|
|
279
|
+
inbound_instance,
|
|
280
|
+
response.headers,
|
|
281
|
+
response.status_code
|
|
282
|
+
)
|
|
283
|
+
end
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
##
|
|
287
|
+
# Provide a user friendly representation
|
|
288
|
+
def to_s
|
|
289
|
+
context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
|
|
290
|
+
"#<Twilio.Insights.V2.InboundContext #{context}>"
|
|
291
|
+
end
|
|
292
|
+
|
|
293
|
+
##
|
|
294
|
+
# Provide a detailed, user friendly representation
|
|
295
|
+
def inspect
|
|
296
|
+
context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
|
|
297
|
+
"#<Twilio.Insights.V2.InboundContext #{context}>"
|
|
298
|
+
end
|
|
299
|
+
end
|
|
300
|
+
|
|
301
|
+
class InboundInstanceMetadata < InstanceResourceMetadata
|
|
302
|
+
##
|
|
303
|
+
# Initializes a new InboundInstanceMetadata.
|
|
304
|
+
# @param [Version] version Version that contains the resource
|
|
305
|
+
# @param [}InboundInstance] inbound_instance The instance associated with the metadata.
|
|
306
|
+
# @param [Hash] headers Header object with response headers.
|
|
307
|
+
# @param [Integer] status_code The HTTP status code of the response.
|
|
308
|
+
# @return [InboundInstanceMetadata] The initialized instance with metadata.
|
|
309
|
+
def initialize(version, inbound_instance, headers, status_code)
|
|
310
|
+
super(version, headers, status_code)
|
|
311
|
+
@inbound_instance = inbound_instance
|
|
312
|
+
end
|
|
313
|
+
|
|
314
|
+
def inbound
|
|
315
|
+
@inbound_instance
|
|
316
|
+
end
|
|
317
|
+
|
|
318
|
+
def headers
|
|
319
|
+
@headers
|
|
320
|
+
end
|
|
321
|
+
|
|
322
|
+
def status_code
|
|
323
|
+
@status_code
|
|
324
|
+
end
|
|
325
|
+
|
|
326
|
+
def to_s
|
|
327
|
+
"<Twilio.Api.V2010.InboundInstanceMetadata status=#{@status_code}>"
|
|
328
|
+
end
|
|
329
|
+
end
|
|
330
|
+
|
|
331
|
+
class InboundListResponse < InstanceListResource
|
|
332
|
+
# @param [Array<InboundInstance>] instance
|
|
333
|
+
# @param [Hash{String => Object}] headers
|
|
334
|
+
# @param [Integer] status_code
|
|
335
|
+
def initialize(version, payload, key)
|
|
336
|
+
@inbound_instance = payload.body[key].map do |data|
|
|
337
|
+
InboundInstance.new(version, data)
|
|
338
|
+
end
|
|
339
|
+
@headers = payload.headers
|
|
340
|
+
@status_code = payload.status_code
|
|
341
|
+
end
|
|
342
|
+
|
|
343
|
+
def inbound_instance
|
|
344
|
+
@instance
|
|
345
|
+
end
|
|
346
|
+
end
|
|
347
|
+
|
|
348
|
+
class InboundPage < Page
|
|
349
|
+
##
|
|
350
|
+
# Initialize the InboundPage
|
|
351
|
+
# @param [Version] version Version that contains the resource
|
|
352
|
+
# @param [Response] response Response from the API
|
|
353
|
+
# @param [Hash] solution Path solution for the resource
|
|
354
|
+
# @return [InboundPage] InboundPage
|
|
355
|
+
def initialize(version, response, solution)
|
|
356
|
+
super(version, response)
|
|
357
|
+
|
|
358
|
+
|
|
359
|
+
# Path Solution
|
|
360
|
+
@solution = solution
|
|
361
|
+
end
|
|
362
|
+
|
|
363
|
+
##
|
|
364
|
+
# Build an instance of InboundInstance
|
|
365
|
+
# @param [Hash] payload Payload response from the API
|
|
366
|
+
# @return [InboundInstance] InboundInstance
|
|
367
|
+
def get_instance(payload)
|
|
368
|
+
InboundInstance.new(@version, payload, report_id: @solution[:report_id])
|
|
369
|
+
end
|
|
370
|
+
|
|
371
|
+
##
|
|
372
|
+
# Provide a user friendly representation
|
|
373
|
+
def to_s
|
|
374
|
+
'<Twilio.Insights.V2.InboundPage>'
|
|
375
|
+
end
|
|
376
|
+
end
|
|
377
|
+
|
|
378
|
+
class InboundPageMetadata < PageMetadata
|
|
379
|
+
attr_reader :inbound_page
|
|
380
|
+
|
|
381
|
+
def initialize(version, response, solution, limit)
|
|
382
|
+
super(version, response)
|
|
383
|
+
@inbound_page = []
|
|
384
|
+
@limit = limit
|
|
385
|
+
key = get_key(response.body)
|
|
386
|
+
records = 0
|
|
387
|
+
while( limit != :unset && records < limit )
|
|
388
|
+
@inbound_page << InboundListResponse.new(version, @payload, key, limit - records)
|
|
389
|
+
@payload = self.next_page
|
|
390
|
+
break unless @payload
|
|
391
|
+
records += @payload.body[key].size
|
|
392
|
+
end
|
|
393
|
+
# Path Solution
|
|
394
|
+
@solution = solution
|
|
395
|
+
end
|
|
396
|
+
|
|
397
|
+
def each
|
|
398
|
+
@inbound_page.each do |record|
|
|
399
|
+
yield record
|
|
400
|
+
end
|
|
401
|
+
end
|
|
402
|
+
|
|
403
|
+
def to_s
|
|
404
|
+
'<Twilio::REST::Insights::V2PageMetadata>';
|
|
405
|
+
end
|
|
406
|
+
end
|
|
407
|
+
class InboundListResponse < InstanceListResource
|
|
408
|
+
|
|
409
|
+
# @param [Array<InboundInstance>] instance
|
|
410
|
+
# @param [Hash{String => Object}] headers
|
|
411
|
+
# @param [Integer] status_code
|
|
412
|
+
def initialize(version, payload, key, limit = :unset)
|
|
413
|
+
data_list = payload.body[key]
|
|
414
|
+
if limit != :unset
|
|
415
|
+
data_list = data_list[0, limit]
|
|
416
|
+
end
|
|
417
|
+
@inbound = data_list.map do |data|
|
|
418
|
+
InboundInstance.new(version, data)
|
|
419
|
+
end
|
|
420
|
+
@headers = payload.headers
|
|
421
|
+
@status_code = payload.status_code
|
|
422
|
+
end
|
|
423
|
+
|
|
424
|
+
def inbound
|
|
425
|
+
@inbound
|
|
426
|
+
end
|
|
427
|
+
|
|
428
|
+
def headers
|
|
429
|
+
@headers
|
|
430
|
+
end
|
|
431
|
+
|
|
432
|
+
def status_code
|
|
433
|
+
@status_code
|
|
434
|
+
end
|
|
435
|
+
end
|
|
436
|
+
|
|
437
|
+
class InboundInstance < InstanceResource
|
|
438
|
+
##
|
|
439
|
+
# Initialize the InboundInstance
|
|
440
|
+
# @param [Version] version Version that contains the resource
|
|
441
|
+
# @param [Hash] payload payload that contains response from Twilio
|
|
442
|
+
# @param [String] account_sid The SID of the
|
|
443
|
+
# {Account}[https://www.twilio.com/docs/iam/api/account] that created this Inbound
|
|
444
|
+
# resource.
|
|
445
|
+
# @param [String] sid The SID of the Call resource to fetch.
|
|
446
|
+
# @return [InboundInstance] InboundInstance
|
|
447
|
+
def initialize(version, payload , report_id: nil)
|
|
448
|
+
super(version)
|
|
449
|
+
|
|
450
|
+
|
|
451
|
+
# Marshaled Properties
|
|
452
|
+
@properties = {
|
|
453
|
+
'account_sid' => payload['account_sid'],
|
|
454
|
+
'report_id' => payload['report_id'],
|
|
455
|
+
'status' => payload['status'],
|
|
456
|
+
'request_meta' => payload['request_meta'],
|
|
457
|
+
'url' => payload['url'],
|
|
458
|
+
'handle' => payload['handle'],
|
|
459
|
+
'total_calls' => payload['total_calls'] == nil ? payload['total_calls'] : payload['total_calls'].to_i,
|
|
460
|
+
'call_answer_score' => payload['call_answer_score'],
|
|
461
|
+
'call_state_percentage' => payload['call_state_percentage'],
|
|
462
|
+
'silent_calls_percentage' => payload['silent_calls_percentage'],
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
# Context
|
|
466
|
+
@instance_context = nil
|
|
467
|
+
@params = { 'report_id' => report_id || @properties['report_id'] , }
|
|
468
|
+
end
|
|
469
|
+
|
|
470
|
+
##
|
|
471
|
+
# Generate an instance context for the instance, the context is capable of
|
|
472
|
+
# performing various actions. All instance actions are proxied to the context
|
|
473
|
+
# @return [InboundContext] CallContext for this CallInstance
|
|
474
|
+
def context
|
|
475
|
+
unless @instance_context
|
|
476
|
+
@instance_context = InboundContext.new(@version , @params['report_id'])
|
|
477
|
+
end
|
|
478
|
+
@instance_context
|
|
479
|
+
end
|
|
480
|
+
|
|
481
|
+
##
|
|
482
|
+
# @return [String] The unique SID identifier of the Account.
|
|
483
|
+
def account_sid
|
|
484
|
+
@properties['account_sid']
|
|
485
|
+
end
|
|
486
|
+
|
|
487
|
+
##
|
|
488
|
+
# @return [String] The report identifier as Voice Insights Report TTID.
|
|
489
|
+
def report_id
|
|
490
|
+
@properties['report_id']
|
|
491
|
+
end
|
|
492
|
+
|
|
493
|
+
##
|
|
494
|
+
# @return [ReportStatus]
|
|
495
|
+
def status
|
|
496
|
+
@properties['status']
|
|
497
|
+
end
|
|
498
|
+
|
|
499
|
+
##
|
|
500
|
+
# @return [ReportMetadata]
|
|
501
|
+
def request_meta
|
|
502
|
+
@properties['request_meta']
|
|
503
|
+
end
|
|
504
|
+
|
|
505
|
+
##
|
|
506
|
+
# @return [String] The URL of this resource.
|
|
507
|
+
def url
|
|
508
|
+
@properties['url']
|
|
509
|
+
end
|
|
510
|
+
|
|
511
|
+
##
|
|
512
|
+
# @return [String] Inbound phone number handle represented in the report.
|
|
513
|
+
def handle
|
|
514
|
+
@properties['handle']
|
|
515
|
+
end
|
|
516
|
+
|
|
517
|
+
##
|
|
518
|
+
# @return [String] Total number of calls made with the given handle during the report period.
|
|
519
|
+
def total_calls
|
|
520
|
+
@properties['total_calls']
|
|
521
|
+
end
|
|
522
|
+
|
|
523
|
+
##
|
|
524
|
+
# @return [Float] The call answer score measures customers behavior to the delivered calls. The score is a value between 0 and 100, where 100 indicates that all calls were successfully answered.
|
|
525
|
+
def call_answer_score
|
|
526
|
+
@properties['call_answer_score']
|
|
527
|
+
end
|
|
528
|
+
|
|
529
|
+
##
|
|
530
|
+
# @return [InsightsV2InboundPhoneNumberReportCallStatePercentage]
|
|
531
|
+
def call_state_percentage
|
|
532
|
+
@properties['call_state_percentage']
|
|
533
|
+
end
|
|
534
|
+
|
|
535
|
+
##
|
|
536
|
+
# @return [Float] Percentage of inbound calls with silence tags over total outbound calls. A silent tag is indicative of a connectivity issue or muted audio.
|
|
537
|
+
def silent_calls_percentage
|
|
538
|
+
@properties['silent_calls_percentage']
|
|
539
|
+
end
|
|
540
|
+
|
|
541
|
+
##
|
|
542
|
+
# Create the InboundInstance
|
|
543
|
+
# @param [InsightsV2CreatePhoneNumbersReportRequest] insights_v2_create_phone_numbers_report_request
|
|
544
|
+
# @return [InboundInstance] Created InboundInstance
|
|
545
|
+
def create(insights_v2_create_phone_numbers_report_request: :unset
|
|
546
|
+
)
|
|
547
|
+
|
|
548
|
+
context.create(
|
|
549
|
+
)
|
|
550
|
+
end
|
|
551
|
+
|
|
552
|
+
##
|
|
553
|
+
# Provide a user friendly representation
|
|
554
|
+
def to_s
|
|
555
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
|
556
|
+
"<Twilio.Insights.V2.InboundInstance #{values}>"
|
|
557
|
+
end
|
|
558
|
+
|
|
559
|
+
##
|
|
560
|
+
# Provide a detailed, user friendly representation
|
|
561
|
+
def inspect
|
|
562
|
+
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
|
563
|
+
"<Twilio.Insights.V2.InboundInstance #{values}>"
|
|
564
|
+
end
|
|
565
|
+
end
|
|
566
|
+
|
|
567
|
+
end
|
|
568
|
+
end
|
|
569
|
+
end
|
|
570
|
+
end
|