twilio-ruby 5.74.4 → 5.75.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +27 -0
- data/README.md +2 -2
- data/lib/twilio-ruby/rest/api/v2010/account/queue.rb +3 -3
- data/lib/twilio-ruby/rest/content/v1/content_and_approvals.rb +240 -0
- data/lib/twilio-ruby/rest/content/v1.rb +7 -0
- data/lib/twilio-ruby/rest/content.rb +6 -0
- data/lib/twilio-ruby/rest/flex_api/v1/assessments.rb +88 -0
- data/lib/twilio-ruby/rest/flex_api/v1/insights_conversations.rb +216 -0
- data/lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb +3 -3
- data/lib/twilio-ruby/rest/flex_api/v1.rb +7 -0
- data/lib/twilio-ruby/rest/flex_api.rb +6 -0
- data/lib/twilio-ruby/rest/messaging/v1/domain_cert.rb +4 -4
- data/lib/twilio-ruby/rest/messaging/v1/domain_config_messaging_service.rb +226 -0
- data/lib/twilio-ruby/rest/messaging/v1/linkshortening_messaging_service.rb +218 -0
- data/lib/twilio-ruby/rest/messaging/v1.rb +41 -0
- data/lib/twilio-ruby/rest/messaging.rb +18 -0
- data/lib/twilio-ruby/rest/microvisor/v1/app/app_manifest.rb +192 -0
- data/lib/twilio-ruby/rest/microvisor/v1/app.rb +25 -0
- data/lib/twilio-ruby/rest/supersim/v1/esim_profile.rb +21 -1
- data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +3 -2
- data/lib/twilio-ruby/version.rb +1 -1
- data/twilio-ruby.gemspec +1 -1
- metadata +11 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a57741b264ef9fc43e6be40e817be88de8db660
|
4
|
+
data.tar.gz: 34ecc7f79c806fbc514bb8fd4931e9440a1ede56
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7504504307b32b86498a8ec7848a018951c5e1d4bbd657e9f9cd91e463431502b0f38c2b2d05fd866a83b91feda322a50d4de5e2de5a566671ccc1a994c194a4
|
7
|
+
data.tar.gz: aa97372cf161a1b53a7101646c8412cc4c350e13a8076bc547a1310ab2feac255365022b6034cc78630548911c70f778edf7758cb5593ee196c38c7c75186555
|
data/CHANGES.md
CHANGED
@@ -1,6 +1,33 @@
|
|
1
1
|
twilio-ruby changelog
|
2
2
|
=====================
|
3
3
|
|
4
|
+
[2023-03-22] Version 5.75.0
|
5
|
+
---------------------------
|
6
|
+
**Library - Chore**
|
7
|
+
- [PR #630](https://github.com/twilio/twilio-ruby/pull/630): Accommodate jwt's minor and patch updates. Thanks to [@sato11](https://github.com/sato11)!
|
8
|
+
|
9
|
+
**Api**
|
10
|
+
- Revert Corrected the data type for `friendly_name` in Available Phone Number Local, Mobile and TollFree resources
|
11
|
+
- Corrected the data type for `friendly_name` in Available Phone Number Local, Mobile and TollFree resources **(breaking change)**
|
12
|
+
|
13
|
+
**Messaging**
|
14
|
+
- Add `linkshortening_messaging_service` resource
|
15
|
+
- Add new endpoint for GetDomainConfigByMessagingServiceSid
|
16
|
+
- Remove `validated` parameter and add `cert_in_validation` parameter to Link Shortening API **(breaking change)**
|
17
|
+
|
18
|
+
|
19
|
+
[2023-03-09] Version 5.74.5
|
20
|
+
---------------------------
|
21
|
+
**Api**
|
22
|
+
- Add new categories for whatsapp template
|
23
|
+
|
24
|
+
**Lookups**
|
25
|
+
- Remove `validation_results` from the `default_output_properties`
|
26
|
+
|
27
|
+
**Supersim**
|
28
|
+
- Add ESimProfile's `matching_id` and `activation_code` parameters to libraries
|
29
|
+
|
30
|
+
|
4
31
|
[2023-02-22] Version 5.74.4
|
5
32
|
---------------------------
|
6
33
|
**Api**
|
data/README.md
CHANGED
@@ -34,13 +34,13 @@ This library supports the following Ruby implementations:
|
|
34
34
|
To install using [Bundler][bundler] grab the latest stable version:
|
35
35
|
|
36
36
|
```ruby
|
37
|
-
gem 'twilio-ruby', '~> 5.
|
37
|
+
gem 'twilio-ruby', '~> 5.75.0'
|
38
38
|
```
|
39
39
|
|
40
40
|
To manually install `twilio-ruby` via [Rubygems][rubygems] simply gem install:
|
41
41
|
|
42
42
|
```bash
|
43
|
-
gem install twilio-ruby -v 5.
|
43
|
+
gem install twilio-ruby -v 5.75.0
|
44
44
|
```
|
45
45
|
|
46
46
|
To build and install the development branch yourself from the latest source:
|
@@ -112,7 +112,7 @@ module Twilio
|
|
112
112
|
# @param [String] friendly_name A descriptive string that you created to describe
|
113
113
|
# this resource. It can be up to 64 characters long.
|
114
114
|
# @param [String] max_size The maximum number of calls allowed to be in the queue.
|
115
|
-
# The default is
|
115
|
+
# The default is 1000. The maximum is 5000.
|
116
116
|
# @return [QueueInstance] Created QueueInstance
|
117
117
|
def create(friendly_name: nil, max_size: :unset)
|
118
118
|
data = Twilio::Values.of({'FriendlyName' => friendly_name, 'MaxSize' => max_size, })
|
@@ -193,7 +193,7 @@ module Twilio
|
|
193
193
|
# @param [String] friendly_name A descriptive string that you created to describe
|
194
194
|
# this resource. It can be up to 64 characters long.
|
195
195
|
# @param [String] max_size The maximum number of calls allowed to be in the queue.
|
196
|
-
# The default is
|
196
|
+
# The default is 1000. The maximum is 5000.
|
197
197
|
# @return [QueueInstance] Updated QueueInstance
|
198
198
|
def update(friendly_name: :unset, max_size: :unset)
|
199
199
|
data = Twilio::Values.of({'FriendlyName' => friendly_name, 'MaxSize' => max_size, })
|
@@ -356,7 +356,7 @@ module Twilio
|
|
356
356
|
# @param [String] friendly_name A descriptive string that you created to describe
|
357
357
|
# this resource. It can be up to 64 characters long.
|
358
358
|
# @param [String] max_size The maximum number of calls allowed to be in the queue.
|
359
|
-
# The default is
|
359
|
+
# The default is 1000. The maximum is 5000.
|
360
360
|
# @return [QueueInstance] Updated QueueInstance
|
361
361
|
def update(friendly_name: :unset, max_size: :unset)
|
362
362
|
context.update(friendly_name: friendly_name, max_size: max_size, )
|
@@ -0,0 +1,240 @@
|
|
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 Content < Domain
|
12
|
+
class V1 < Version
|
13
|
+
##
|
14
|
+
# PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
|
15
|
+
class ContentAndApprovalsList < ListResource
|
16
|
+
##
|
17
|
+
# Initialize the ContentAndApprovalsList
|
18
|
+
# @param [Version] version Version that contains the resource
|
19
|
+
# @return [ContentAndApprovalsList] ContentAndApprovalsList
|
20
|
+
def initialize(version)
|
21
|
+
super(version)
|
22
|
+
|
23
|
+
# Path Solution
|
24
|
+
@solution = {}
|
25
|
+
@uri = "/ContentAndApprovals"
|
26
|
+
end
|
27
|
+
|
28
|
+
##
|
29
|
+
# Lists ContentAndApprovalsInstance records from the API as a list.
|
30
|
+
# Unlike stream(), this operation is eager and will load `limit` records into
|
31
|
+
# memory before returning.
|
32
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
33
|
+
# guarantees to never return more than limit. Default is no limit
|
34
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
35
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
36
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
37
|
+
# efficient page size, i.e. min(limit, 1000)
|
38
|
+
# @return [Array] Array of up to limit results
|
39
|
+
def list(limit: nil, page_size: nil)
|
40
|
+
self.stream(limit: limit, page_size: page_size).entries
|
41
|
+
end
|
42
|
+
|
43
|
+
##
|
44
|
+
# Streams ContentAndApprovalsInstance records from the API as an Enumerable.
|
45
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
46
|
+
# is reached.
|
47
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
48
|
+
# guarantees to never return more than limit. Default is no limit.
|
49
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
50
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
51
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
52
|
+
# efficient page size, i.e. min(limit, 1000)
|
53
|
+
# @return [Enumerable] Enumerable that will yield up to limit results
|
54
|
+
def stream(limit: nil, page_size: nil)
|
55
|
+
limits = @version.read_limits(limit, page_size)
|
56
|
+
|
57
|
+
page = self.page(page_size: limits[:page_size], )
|
58
|
+
|
59
|
+
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
60
|
+
end
|
61
|
+
|
62
|
+
##
|
63
|
+
# When passed a block, yields ContentAndApprovalsInstance records from the API.
|
64
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
65
|
+
# is reached.
|
66
|
+
def each
|
67
|
+
limits = @version.read_limits
|
68
|
+
|
69
|
+
page = self.page(page_size: limits[:page_size], )
|
70
|
+
|
71
|
+
@version.stream(page,
|
72
|
+
limit: limits[:limit],
|
73
|
+
page_limit: limits[:page_limit]).each {|x| yield x}
|
74
|
+
end
|
75
|
+
|
76
|
+
##
|
77
|
+
# Retrieve a single page of ContentAndApprovalsInstance records from the API.
|
78
|
+
# Request is executed immediately.
|
79
|
+
# @param [String] page_token PageToken provided by the API
|
80
|
+
# @param [Integer] page_number Page Number, this value is simply for client state
|
81
|
+
# @param [Integer] page_size Number of records to return, defaults to 50
|
82
|
+
# @return [Page] Page of ContentAndApprovalsInstance
|
83
|
+
def page(page_token: :unset, page_number: :unset, page_size: :unset)
|
84
|
+
params = Twilio::Values.of({
|
85
|
+
'PageToken' => page_token,
|
86
|
+
'Page' => page_number,
|
87
|
+
'PageSize' => page_size,
|
88
|
+
})
|
89
|
+
|
90
|
+
response = @version.page('GET', @uri, params: params)
|
91
|
+
|
92
|
+
ContentAndApprovalsPage.new(@version, response, @solution)
|
93
|
+
end
|
94
|
+
|
95
|
+
##
|
96
|
+
# Retrieve a single page of ContentAndApprovalsInstance records from the API.
|
97
|
+
# Request is executed immediately.
|
98
|
+
# @param [String] target_url API-generated URL for the requested results page
|
99
|
+
# @return [Page] Page of ContentAndApprovalsInstance
|
100
|
+
def get_page(target_url)
|
101
|
+
response = @version.domain.request(
|
102
|
+
'GET',
|
103
|
+
target_url
|
104
|
+
)
|
105
|
+
ContentAndApprovalsPage.new(@version, response, @solution)
|
106
|
+
end
|
107
|
+
|
108
|
+
##
|
109
|
+
# Provide a user friendly representation
|
110
|
+
def to_s
|
111
|
+
'#<Twilio.Content.V1.ContentAndApprovalsList>'
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
115
|
+
##
|
116
|
+
# PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
|
117
|
+
class ContentAndApprovalsPage < Page
|
118
|
+
##
|
119
|
+
# Initialize the ContentAndApprovalsPage
|
120
|
+
# @param [Version] version Version that contains the resource
|
121
|
+
# @param [Response] response Response from the API
|
122
|
+
# @param [Hash] solution Path solution for the resource
|
123
|
+
# @return [ContentAndApprovalsPage] ContentAndApprovalsPage
|
124
|
+
def initialize(version, response, solution)
|
125
|
+
super(version, response)
|
126
|
+
|
127
|
+
# Path Solution
|
128
|
+
@solution = solution
|
129
|
+
end
|
130
|
+
|
131
|
+
##
|
132
|
+
# Build an instance of ContentAndApprovalsInstance
|
133
|
+
# @param [Hash] payload Payload response from the API
|
134
|
+
# @return [ContentAndApprovalsInstance] ContentAndApprovalsInstance
|
135
|
+
def get_instance(payload)
|
136
|
+
ContentAndApprovalsInstance.new(@version, payload, )
|
137
|
+
end
|
138
|
+
|
139
|
+
##
|
140
|
+
# Provide a user friendly representation
|
141
|
+
def to_s
|
142
|
+
'<Twilio.Content.V1.ContentAndApprovalsPage>'
|
143
|
+
end
|
144
|
+
end
|
145
|
+
|
146
|
+
##
|
147
|
+
# PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
|
148
|
+
class ContentAndApprovalsInstance < InstanceResource
|
149
|
+
##
|
150
|
+
# Initialize the ContentAndApprovalsInstance
|
151
|
+
# @param [Version] version Version that contains the resource
|
152
|
+
# @param [Hash] payload payload that contains response from Twilio
|
153
|
+
# @return [ContentAndApprovalsInstance] ContentAndApprovalsInstance
|
154
|
+
def initialize(version, payload)
|
155
|
+
super(version)
|
156
|
+
|
157
|
+
# Marshaled Properties
|
158
|
+
@properties = {
|
159
|
+
'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
|
160
|
+
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
|
161
|
+
'sid' => payload['sid'],
|
162
|
+
'account_sid' => payload['account_sid'],
|
163
|
+
'friendly_name' => payload['friendly_name'],
|
164
|
+
'language' => payload['language'],
|
165
|
+
'variables' => payload['variables'],
|
166
|
+
'types' => payload['types'],
|
167
|
+
'approval_requests' => payload['approval_requests'],
|
168
|
+
}
|
169
|
+
end
|
170
|
+
|
171
|
+
##
|
172
|
+
# @return [Time] The RFC 2822 date and time in GMT that the resource was created
|
173
|
+
def date_created
|
174
|
+
@properties['date_created']
|
175
|
+
end
|
176
|
+
|
177
|
+
##
|
178
|
+
# @return [Time] The RFC 2822 date and time in GMT that the resource was last updated
|
179
|
+
def date_updated
|
180
|
+
@properties['date_updated']
|
181
|
+
end
|
182
|
+
|
183
|
+
##
|
184
|
+
# @return [String] The unique string that identifies the resource
|
185
|
+
def sid
|
186
|
+
@properties['sid']
|
187
|
+
end
|
188
|
+
|
189
|
+
##
|
190
|
+
# @return [String] The SID of the Account that created the resource
|
191
|
+
def account_sid
|
192
|
+
@properties['account_sid']
|
193
|
+
end
|
194
|
+
|
195
|
+
##
|
196
|
+
# @return [String] A string name used to describe the Content resource
|
197
|
+
def friendly_name
|
198
|
+
@properties['friendly_name']
|
199
|
+
end
|
200
|
+
|
201
|
+
##
|
202
|
+
# @return [String] Two-letter language code identifying the language the Content resource is in.
|
203
|
+
def language
|
204
|
+
@properties['language']
|
205
|
+
end
|
206
|
+
|
207
|
+
##
|
208
|
+
# @return [Hash] Defines the default placeholder values for variables included in the Content resource
|
209
|
+
def variables
|
210
|
+
@properties['variables']
|
211
|
+
end
|
212
|
+
|
213
|
+
##
|
214
|
+
# @return [Hash] The Content types (e.g. twilio/text) for this Content resource
|
215
|
+
def types
|
216
|
+
@properties['types']
|
217
|
+
end
|
218
|
+
|
219
|
+
##
|
220
|
+
# @return [Hash] The approval status of the Content resource.
|
221
|
+
def approval_requests
|
222
|
+
@properties['approval_requests']
|
223
|
+
end
|
224
|
+
|
225
|
+
##
|
226
|
+
# Provide a user friendly representation
|
227
|
+
def to_s
|
228
|
+
"<Twilio.Content.V1.ContentAndApprovalsInstance>"
|
229
|
+
end
|
230
|
+
|
231
|
+
##
|
232
|
+
# Provide a detailed, user friendly representation
|
233
|
+
def inspect
|
234
|
+
"<Twilio.Content.V1.ContentAndApprovalsInstance>"
|
235
|
+
end
|
236
|
+
end
|
237
|
+
end
|
238
|
+
end
|
239
|
+
end
|
240
|
+
end
|
@@ -16,6 +16,7 @@ module Twilio
|
|
16
16
|
super
|
17
17
|
@version = 'v1'
|
18
18
|
@contents = nil
|
19
|
+
@content_and_approvals = nil
|
19
20
|
@legacy_contents = nil
|
20
21
|
end
|
21
22
|
|
@@ -35,6 +36,12 @@ module Twilio
|
|
35
36
|
end
|
36
37
|
end
|
37
38
|
|
39
|
+
##
|
40
|
+
# @return [Twilio::REST::Content::V1::ContentAndApprovalsContext]
|
41
|
+
def content_and_approvals
|
42
|
+
@content_and_approvals ||= ContentAndApprovalsList.new self
|
43
|
+
end
|
44
|
+
|
38
45
|
##
|
39
46
|
# @return [Twilio::REST::Content::V1::LegacyContentContext]
|
40
47
|
def legacy_contents
|
@@ -37,6 +37,12 @@ module Twilio
|
|
37
37
|
self.v1.contents(sid)
|
38
38
|
end
|
39
39
|
|
40
|
+
##
|
41
|
+
# @return [Twilio::REST::Content::V1::ContentAndApprovalsInstance]
|
42
|
+
def content_and_approvals
|
43
|
+
self.v1.content_and_approvals()
|
44
|
+
end
|
45
|
+
|
40
46
|
##
|
41
47
|
# @return [Twilio::REST::Content::V1::LegacyContentInstance]
|
42
48
|
def legacy_contents
|
@@ -63,6 +63,94 @@ module Twilio
|
|
63
63
|
AssessmentsInstance.new(@version, payload, )
|
64
64
|
end
|
65
65
|
|
66
|
+
##
|
67
|
+
# Lists AssessmentsInstance records from the API as a list.
|
68
|
+
# Unlike stream(), this operation is eager and will load `limit` records into
|
69
|
+
# memory before returning.
|
70
|
+
# @param [String] segment_id The id of the segment.
|
71
|
+
# @param [String] token The Token HTTP request header
|
72
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
73
|
+
# guarantees to never return more than limit. Default is no limit
|
74
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
75
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
76
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
77
|
+
# efficient page size, i.e. min(limit, 1000)
|
78
|
+
# @return [Array] Array of up to limit results
|
79
|
+
def list(segment_id: :unset, token: :unset, limit: nil, page_size: nil)
|
80
|
+
self.stream(segment_id: segment_id, token: token, limit: limit, page_size: page_size).entries
|
81
|
+
end
|
82
|
+
|
83
|
+
##
|
84
|
+
# Streams AssessmentsInstance records from the API as an Enumerable.
|
85
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
86
|
+
# is reached.
|
87
|
+
# @param [String] segment_id The id of the segment.
|
88
|
+
# @param [String] token The Token HTTP request header
|
89
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
90
|
+
# guarantees to never return more than limit. Default is no limit.
|
91
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
92
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
93
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
94
|
+
# efficient page size, i.e. min(limit, 1000)
|
95
|
+
# @return [Enumerable] Enumerable that will yield up to limit results
|
96
|
+
def stream(segment_id: :unset, token: :unset, limit: nil, page_size: nil)
|
97
|
+
limits = @version.read_limits(limit, page_size)
|
98
|
+
|
99
|
+
page = self.page(segment_id: segment_id, token: token, page_size: limits[:page_size], )
|
100
|
+
|
101
|
+
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
102
|
+
end
|
103
|
+
|
104
|
+
##
|
105
|
+
# When passed a block, yields AssessmentsInstance records from the API.
|
106
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
107
|
+
# is reached.
|
108
|
+
def each
|
109
|
+
limits = @version.read_limits
|
110
|
+
|
111
|
+
page = self.page(page_size: limits[:page_size], )
|
112
|
+
|
113
|
+
@version.stream(page,
|
114
|
+
limit: limits[:limit],
|
115
|
+
page_limit: limits[:page_limit]).each {|x| yield x}
|
116
|
+
end
|
117
|
+
|
118
|
+
##
|
119
|
+
# Retrieve a single page of AssessmentsInstance records from the API.
|
120
|
+
# Request is executed immediately.
|
121
|
+
# @param [String] segment_id The id of the segment.
|
122
|
+
# @param [String] token The Token HTTP request header
|
123
|
+
# @param [String] page_token PageToken provided by the API
|
124
|
+
# @param [Integer] page_number Page Number, this value is simply for client state
|
125
|
+
# @param [Integer] page_size Number of records to return, defaults to 50
|
126
|
+
# @return [Page] Page of AssessmentsInstance
|
127
|
+
def page(segment_id: :unset, token: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
|
128
|
+
params = Twilio::Values.of({
|
129
|
+
'SegmentId' => segment_id,
|
130
|
+
'PageToken' => page_token,
|
131
|
+
'Page' => page_number,
|
132
|
+
'PageSize' => page_size,
|
133
|
+
})
|
134
|
+
headers = Twilio::Values.of({'Token' => token, })
|
135
|
+
|
136
|
+
response = @version.page('GET', @uri, params: params, headers: headers)
|
137
|
+
|
138
|
+
AssessmentsPage.new(@version, response, @solution)
|
139
|
+
end
|
140
|
+
|
141
|
+
##
|
142
|
+
# Retrieve a single page of AssessmentsInstance records from the API.
|
143
|
+
# Request is executed immediately.
|
144
|
+
# @param [String] target_url API-generated URL for the requested results page
|
145
|
+
# @return [Page] Page of AssessmentsInstance
|
146
|
+
def get_page(target_url)
|
147
|
+
response = @version.domain.request(
|
148
|
+
'GET',
|
149
|
+
target_url
|
150
|
+
)
|
151
|
+
AssessmentsPage.new(@version, response, @solution)
|
152
|
+
end
|
153
|
+
|
66
154
|
##
|
67
155
|
# Provide a user friendly representation
|
68
156
|
def to_s
|
@@ -0,0 +1,216 @@
|
|
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 FlexApi < Domain
|
12
|
+
class V1 < Version
|
13
|
+
##
|
14
|
+
# PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
|
15
|
+
class InsightsConversationsList < ListResource
|
16
|
+
##
|
17
|
+
# Initialize the InsightsConversationsList
|
18
|
+
# @param [Version] version Version that contains the resource
|
19
|
+
# @return [InsightsConversationsList] InsightsConversationsList
|
20
|
+
def initialize(version)
|
21
|
+
super(version)
|
22
|
+
|
23
|
+
# Path Solution
|
24
|
+
@solution = {}
|
25
|
+
@uri = "/Insights/Conversations"
|
26
|
+
end
|
27
|
+
|
28
|
+
##
|
29
|
+
# Lists InsightsConversationsInstance records from the API as a list.
|
30
|
+
# Unlike stream(), this operation is eager and will load `limit` records into
|
31
|
+
# memory before returning.
|
32
|
+
# @param [String] segment_id Unique Id of the segment for which conversation
|
33
|
+
# details needs to be fetched
|
34
|
+
# @param [String] token The Token HTTP request header
|
35
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
36
|
+
# guarantees to never return more than limit. Default is no limit
|
37
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
38
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
39
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
40
|
+
# efficient page size, i.e. min(limit, 1000)
|
41
|
+
# @return [Array] Array of up to limit results
|
42
|
+
def list(segment_id: :unset, token: :unset, limit: nil, page_size: nil)
|
43
|
+
self.stream(segment_id: segment_id, token: token, limit: limit, page_size: page_size).entries
|
44
|
+
end
|
45
|
+
|
46
|
+
##
|
47
|
+
# Streams InsightsConversationsInstance records from the API as an Enumerable.
|
48
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
49
|
+
# is reached.
|
50
|
+
# @param [String] segment_id Unique Id of the segment for which conversation
|
51
|
+
# details needs to be fetched
|
52
|
+
# @param [String] token The Token HTTP request header
|
53
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
54
|
+
# guarantees to never return more than limit. Default is no limit.
|
55
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
56
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
57
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
58
|
+
# efficient page size, i.e. min(limit, 1000)
|
59
|
+
# @return [Enumerable] Enumerable that will yield up to limit results
|
60
|
+
def stream(segment_id: :unset, token: :unset, limit: nil, page_size: nil)
|
61
|
+
limits = @version.read_limits(limit, page_size)
|
62
|
+
|
63
|
+
page = self.page(segment_id: segment_id, token: token, page_size: limits[:page_size], )
|
64
|
+
|
65
|
+
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
66
|
+
end
|
67
|
+
|
68
|
+
##
|
69
|
+
# When passed a block, yields InsightsConversationsInstance records from the API.
|
70
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
71
|
+
# is reached.
|
72
|
+
def each
|
73
|
+
limits = @version.read_limits
|
74
|
+
|
75
|
+
page = self.page(page_size: limits[:page_size], )
|
76
|
+
|
77
|
+
@version.stream(page,
|
78
|
+
limit: limits[:limit],
|
79
|
+
page_limit: limits[:page_limit]).each {|x| yield x}
|
80
|
+
end
|
81
|
+
|
82
|
+
##
|
83
|
+
# Retrieve a single page of InsightsConversationsInstance records from the API.
|
84
|
+
# Request is executed immediately.
|
85
|
+
# @param [String] segment_id Unique Id of the segment for which conversation
|
86
|
+
# details needs to be fetched
|
87
|
+
# @param [String] token The Token HTTP request header
|
88
|
+
# @param [String] page_token PageToken provided by the API
|
89
|
+
# @param [Integer] page_number Page Number, this value is simply for client state
|
90
|
+
# @param [Integer] page_size Number of records to return, defaults to 50
|
91
|
+
# @return [Page] Page of InsightsConversationsInstance
|
92
|
+
def page(segment_id: :unset, token: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
|
93
|
+
params = Twilio::Values.of({
|
94
|
+
'SegmentId' => segment_id,
|
95
|
+
'PageToken' => page_token,
|
96
|
+
'Page' => page_number,
|
97
|
+
'PageSize' => page_size,
|
98
|
+
})
|
99
|
+
headers = Twilio::Values.of({'Token' => token, })
|
100
|
+
|
101
|
+
response = @version.page('GET', @uri, params: params, headers: headers)
|
102
|
+
|
103
|
+
InsightsConversationsPage.new(@version, response, @solution)
|
104
|
+
end
|
105
|
+
|
106
|
+
##
|
107
|
+
# Retrieve a single page of InsightsConversationsInstance records from the API.
|
108
|
+
# Request is executed immediately.
|
109
|
+
# @param [String] target_url API-generated URL for the requested results page
|
110
|
+
# @return [Page] Page of InsightsConversationsInstance
|
111
|
+
def get_page(target_url)
|
112
|
+
response = @version.domain.request(
|
113
|
+
'GET',
|
114
|
+
target_url
|
115
|
+
)
|
116
|
+
InsightsConversationsPage.new(@version, response, @solution)
|
117
|
+
end
|
118
|
+
|
119
|
+
##
|
120
|
+
# Provide a user friendly representation
|
121
|
+
def to_s
|
122
|
+
'#<Twilio.FlexApi.V1.InsightsConversationsList>'
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
##
|
127
|
+
# PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
|
128
|
+
class InsightsConversationsPage < Page
|
129
|
+
##
|
130
|
+
# Initialize the InsightsConversationsPage
|
131
|
+
# @param [Version] version Version that contains the resource
|
132
|
+
# @param [Response] response Response from the API
|
133
|
+
# @param [Hash] solution Path solution for the resource
|
134
|
+
# @return [InsightsConversationsPage] InsightsConversationsPage
|
135
|
+
def initialize(version, response, solution)
|
136
|
+
super(version, response)
|
137
|
+
|
138
|
+
# Path Solution
|
139
|
+
@solution = solution
|
140
|
+
end
|
141
|
+
|
142
|
+
##
|
143
|
+
# Build an instance of InsightsConversationsInstance
|
144
|
+
# @param [Hash] payload Payload response from the API
|
145
|
+
# @return [InsightsConversationsInstance] InsightsConversationsInstance
|
146
|
+
def get_instance(payload)
|
147
|
+
InsightsConversationsInstance.new(@version, payload, )
|
148
|
+
end
|
149
|
+
|
150
|
+
##
|
151
|
+
# Provide a user friendly representation
|
152
|
+
def to_s
|
153
|
+
'<Twilio.FlexApi.V1.InsightsConversationsPage>'
|
154
|
+
end
|
155
|
+
end
|
156
|
+
|
157
|
+
##
|
158
|
+
# PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
|
159
|
+
class InsightsConversationsInstance < InstanceResource
|
160
|
+
##
|
161
|
+
# Initialize the InsightsConversationsInstance
|
162
|
+
# @param [Version] version Version that contains the resource
|
163
|
+
# @param [Hash] payload payload that contains response from Twilio
|
164
|
+
# @return [InsightsConversationsInstance] InsightsConversationsInstance
|
165
|
+
def initialize(version, payload)
|
166
|
+
super(version)
|
167
|
+
|
168
|
+
# Marshaled Properties
|
169
|
+
@properties = {
|
170
|
+
'account_id' => payload['account_id'],
|
171
|
+
'conversation_id' => payload['conversation_id'],
|
172
|
+
'segment_count' => payload['segment_count'] == nil ? payload['segment_count'] : payload['segment_count'].to_i,
|
173
|
+
'segments' => payload['segments'],
|
174
|
+
}
|
175
|
+
end
|
176
|
+
|
177
|
+
##
|
178
|
+
# @return [String] The account id
|
179
|
+
def account_id
|
180
|
+
@properties['account_id']
|
181
|
+
end
|
182
|
+
|
183
|
+
##
|
184
|
+
# @return [String] Unique conversation Id
|
185
|
+
def conversation_id
|
186
|
+
@properties['conversation_id']
|
187
|
+
end
|
188
|
+
|
189
|
+
##
|
190
|
+
# @return [String] The segment count
|
191
|
+
def segment_count
|
192
|
+
@properties['segment_count']
|
193
|
+
end
|
194
|
+
|
195
|
+
##
|
196
|
+
# @return [Array[Hash]] The conversation segments
|
197
|
+
def segments
|
198
|
+
@properties['segments']
|
199
|
+
end
|
200
|
+
|
201
|
+
##
|
202
|
+
# Provide a user friendly representation
|
203
|
+
def to_s
|
204
|
+
"<Twilio.FlexApi.V1.InsightsConversationsInstance>"
|
205
|
+
end
|
206
|
+
|
207
|
+
##
|
208
|
+
# Provide a detailed, user friendly representation
|
209
|
+
def inspect
|
210
|
+
"<Twilio.FlexApi.V1.InsightsConversationsInstance>"
|
211
|
+
end
|
212
|
+
end
|
213
|
+
end
|
214
|
+
end
|
215
|
+
end
|
216
|
+
end
|