twilio-ruby 7.10.7 → 7.11.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/.github/workflows/test-and-deploy.yml +43 -67
- data/.gitignore +0 -1
- data/CHANGES.md +46 -0
- data/Gemfile +2 -0
- data/Gemfile.lock +154 -0
- data/README.md +3 -3
- data/Rakefile +1 -1
- data/lib/twilio-ruby/rest/accounts/v1/auth_token_promotion.rb +25 -6
- data/lib/twilio-ruby/rest/accounts/v1/secondary_auth_token.rb +48 -12
- data/lib/twilio-ruby/rest/api/v2010/account/call.rb +6 -0
- data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +56 -2
- data/lib/twilio-ruby/rest/client.rb +0 -5
- data/lib/twilio-ruby/rest/content/v1/content/approval_create.rb +11 -1
- data/lib/twilio-ruby/rest/conversations/v1/conversation/message.rb +10 -10
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message.rb +10 -10
- data/lib/twilio-ruby/rest/conversations/v2/action.rb +2 -2
- data/lib/twilio-ruby/rest/conversations/v2/communication.rb +43 -21
- data/lib/twilio-ruby/rest/conversations/v2/configuration.rb +59 -21
- data/lib/twilio-ruby/rest/conversations/v2/conversation.rb +28 -28
- data/lib/twilio-ruby/rest/conversations/v2/operation.rb +10 -10
- data/lib/twilio-ruby/rest/conversations/v2/participant.rb +58 -58
- data/lib/twilio-ruby/rest/conversations/v2.rb +45 -45
- data/lib/twilio-ruby/rest/iam/v1/new_api_key.rb +2 -2
- data/lib/twilio-ruby/rest/iam/v1/o_auth_app.rb +15 -2
- data/lib/twilio-ruby/rest/iam_base.rb +6 -1
- data/lib/twilio-ruby/rest/insights/v1/call/call_summary.rb +7 -0
- data/lib/twilio-ruby/rest/insights/v1/call/event.rb +7 -0
- data/lib/twilio-ruby/rest/insights/v1/call_summaries.rb +7 -0
- data/lib/twilio-ruby/rest/insights/v3/metadata.rb +1 -1
- data/lib/twilio-ruby/rest/insights/v3/query.rb +1 -1
- data/lib/twilio-ruby/rest/insights/v3.rb +1 -1
- data/lib/twilio-ruby/rest/intelligence/v3/conversation.rb +8 -8
- data/lib/twilio-ruby/rest/intelligence/v3/rule_execution.rb +502 -0
- data/lib/twilio-ruby/rest/intelligence/v3.rb +6 -0
- data/lib/twilio-ruby/rest/knowledge/v2/chunk.rb +28 -0
- data/lib/twilio-ruby/rest/knowledge/v2/knowledge.rb +38 -0
- data/lib/twilio-ruby/rest/knowledge/v2/search.rb +8 -117
- data/lib/twilio-ruby/rest/knowledge/v2.rb +1 -2
- data/lib/twilio-ruby/rest/memory/v1/bulk.rb +9 -118
- data/lib/twilio-ruby/rest/memory/v1/conversation_summary.rb +13 -5
- data/lib/twilio-ruby/rest/memory/v1/data_mapping.rb +6 -12
- data/lib/twilio-ruby/rest/memory/v1/identifier.rb +1 -1
- data/lib/twilio-ruby/rest/memory/v1/identity_resolution_setting.rb +11 -132
- data/lib/twilio-ruby/rest/memory/v1/import.rb +28 -5
- data/lib/twilio-ruby/rest/memory/v1/lookup.rb +1 -1
- data/lib/twilio-ruby/rest/memory/v1/observation.rb +70 -18
- data/lib/twilio-ruby/rest/memory/v1/operation.rb +1 -1
- data/lib/twilio-ruby/rest/memory/v1/profile.rb +2 -2
- data/lib/twilio-ruby/rest/memory/v1/recall.rb +1 -1
- data/lib/twilio-ruby/rest/memory/v1/revision.rb +1 -1
- data/lib/twilio-ruby/rest/memory/v1/store.rb +1 -1
- data/lib/twilio-ruby/rest/memory/v1/trait.rb +1 -1
- data/lib/twilio-ruby/rest/memory/v1/trait_group.rb +56 -6
- data/lib/twilio-ruby/rest/memory/v1.rb +3 -46
- data/lib/twilio-ruby/rest/messaging/v1/brand_registration.rb +0 -18
- data/lib/twilio-ruby/rest/messaging/v2/channels_sender.rb +23 -4
- data/lib/twilio-ruby/rest/messaging/v3/typing_indicator.rb +4 -4
- data/lib/twilio-ruby/rest/numbers/v1/sms_verification.rb +231 -0
- data/lib/twilio-ruby/rest/numbers/v1/sms_verification_check.rb +238 -0
- data/lib/twilio-ruby/rest/numbers/v1/voice_verification.rb +245 -0
- data/lib/twilio-ruby/rest/numbers/v1/voice_verification_check.rb +224 -0
- data/lib/twilio-ruby/rest/numbers/v1.rb +24 -0
- data/lib/twilio-ruby/rest/{assistants/v1/session.rb → numbers/v2/caller_id.rb} +141 -127
- data/lib/twilio-ruby/rest/numbers/v2.rb +16 -0
- data/lib/twilio-ruby/rest/oauth/v2/authorize.rb +14 -2
- data/lib/twilio-ruby/rest/oauth/v2/oauth_authorization_server.rb +259 -0
- data/lib/twilio-ruby/rest/oauth/v2/token.rb +8 -2
- data/lib/twilio-ruby/rest/preview_iam/versionless/organization.rb +0 -19
- data/lib/twilio-ruby/rest/routes/v3/phone_number.rb +465 -0
- data/lib/twilio-ruby/rest/routes/v3.rb +50 -0
- data/lib/twilio-ruby/rest/routes_base.rb +6 -1
- data/lib/twilio-ruby/rest/trusthub/v1/a2p_brand_registration.rb +330 -0
- data/lib/twilio-ruby/rest/trusthub/v1/a2p_brand_registration_embedded_session.rb +233 -0
- data/lib/twilio-ruby/rest/trusthub/v1/a2p_campaign_registration.rb +321 -0
- data/lib/twilio-ruby/rest/trusthub/v1/a2p_campaign_registration_embedded_session.rb +233 -0
- data/lib/twilio-ruby/rest/trusthub/v1/customer_profiles_provisional_copy.rb +445 -0
- data/lib/twilio-ruby/rest/trusthub/v1/trust_products_provisional_copy.rb +445 -0
- data/lib/twilio-ruby/rest/trusthub/v1.rb +74 -0
- data/lib/twilio-ruby/rest/voice/v2/account_default_configuration.rb +556 -0
- data/lib/twilio-ruby/rest/voice/v2/configuration/default.rb +356 -0
- data/lib/twilio-ruby/rest/voice/v2/configuration.rb +412 -0
- data/lib/twilio-ruby/rest/voice/v2/recording.rb +616 -0
- data/lib/twilio-ruby/rest/voice/v2/transcription.rb +591 -0
- data/lib/twilio-ruby/rest/voice/v2/type.rb +518 -0
- data/lib/twilio-ruby/rest/voice/v2.rb +141 -0
- data/lib/twilio-ruby/rest/voice_base.rb +5 -0
- data/lib/twilio-ruby/twiml/voice_response.rb +6 -68
- data/lib/twilio-ruby/version.rb +1 -1
- data/twilio-ruby.gemspec +1 -1
- metadata +33 -21
- data/lib/twilio-ruby/rest/assistants/v1/assistant/assistants_knowledge.rb +0 -558
- data/lib/twilio-ruby/rest/assistants/v1/assistant/assistants_tool.rb +0 -558
- data/lib/twilio-ruby/rest/assistants/v1/assistant/feedback.rb +0 -431
- data/lib/twilio-ruby/rest/assistants/v1/assistant/message.rb +0 -296
- data/lib/twilio-ruby/rest/assistants/v1/assistant.rb +0 -927
- data/lib/twilio-ruby/rest/assistants/v1/knowledge/chunk.rb +0 -325
- data/lib/twilio-ruby/rest/assistants/v1/knowledge/knowledge_status.rb +0 -349
- data/lib/twilio-ruby/rest/assistants/v1/knowledge.rb +0 -871
- data/lib/twilio-ruby/rest/assistants/v1/policy.rb +0 -364
- data/lib/twilio-ruby/rest/assistants/v1/session/message.rb +0 -360
- data/lib/twilio-ruby/rest/assistants/v1/tool.rb +0 -847
- data/lib/twilio-ruby/rest/assistants/v1.rb +0 -104
- data/lib/twilio-ruby/rest/assistants.rb +0 -6
- data/lib/twilio-ruby/rest/assistants_base.rb +0 -38
|
@@ -1,325 +0,0 @@
|
|
|
1
|
-
##
|
|
2
|
-
# This code was generated by
|
|
3
|
-
# ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
|
4
|
-
# | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
|
5
|
-
# | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
|
6
|
-
#
|
|
7
|
-
# Twilio - Assistants
|
|
8
|
-
# This is the public Twilio REST API.
|
|
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 Assistants < AssistantsBase
|
|
19
|
-
class V1 < Version
|
|
20
|
-
class Knowledge < InstanceContext
|
|
21
|
-
|
|
22
|
-
class ChunkList < ListResource
|
|
23
|
-
|
|
24
|
-
##
|
|
25
|
-
# Initialize the ChunkList
|
|
26
|
-
# @param [Version] version Version that contains the resource
|
|
27
|
-
# @return [ChunkList] ChunkList
|
|
28
|
-
def initialize(version, id: nil)
|
|
29
|
-
super(version)
|
|
30
|
-
|
|
31
|
-
# Path Solution
|
|
32
|
-
@solution = { id: id }
|
|
33
|
-
@uri = "/Knowledge/#{@solution[:id]}/Chunks"
|
|
34
|
-
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
##
|
|
38
|
-
# Lists ChunkInstance records from the API as a list.
|
|
39
|
-
# Unlike stream(), this operation is eager and will load `limit` records into
|
|
40
|
-
# memory before returning.
|
|
41
|
-
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
|
42
|
-
# guarantees to never return more than limit. Default is no limit
|
|
43
|
-
# @param [Integer] page_size Number of records to fetch per request, when
|
|
44
|
-
# not set will use the default value of 50 records. If no page_size is defined
|
|
45
|
-
# but a limit is defined, stream() will attempt to read the limit with the most
|
|
46
|
-
# efficient page size, i.e. min(limit, 1000)
|
|
47
|
-
# @return [Array] Array of up to limit results
|
|
48
|
-
def list(limit: nil, page_size: nil)
|
|
49
|
-
self.stream(
|
|
50
|
-
limit: limit,
|
|
51
|
-
page_size: page_size
|
|
52
|
-
).entries
|
|
53
|
-
end
|
|
54
|
-
|
|
55
|
-
##
|
|
56
|
-
# Streams Instance records from the API as an Enumerable.
|
|
57
|
-
# This operation lazily loads records as efficiently as possible until the limit
|
|
58
|
-
# is reached.
|
|
59
|
-
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
|
60
|
-
# guarantees to never return more than limit. Default is no limit
|
|
61
|
-
# @param [Integer] page_size Number of records to fetch per request, when
|
|
62
|
-
# not set will use the default value of 50 records. If no page_size is defined
|
|
63
|
-
# but a limit is defined, stream() will attempt to read the limit with the most
|
|
64
|
-
# efficient page size, i.e. min(limit, 1000)
|
|
65
|
-
# @return [Enumerable] Enumerable that will yield up to limit results
|
|
66
|
-
def stream(limit: nil, page_size: nil)
|
|
67
|
-
limits = @version.read_limits(limit, page_size)
|
|
68
|
-
|
|
69
|
-
page = self.page(
|
|
70
|
-
page_size: limits[:page_size], )
|
|
71
|
-
|
|
72
|
-
return [].each if page.nil?
|
|
73
|
-
|
|
74
|
-
result = @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
|
75
|
-
return [].each if result.nil?
|
|
76
|
-
result
|
|
77
|
-
end
|
|
78
|
-
|
|
79
|
-
##
|
|
80
|
-
# Lists ChunkPageMetadata records from the API as a list.
|
|
81
|
-
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
|
82
|
-
# guarantees to never return more than limit. Default is no limit
|
|
83
|
-
# @param [Integer] page_size Number of records to fetch per request, when
|
|
84
|
-
# not set will use the default value of 50 records. If no page_size is defined
|
|
85
|
-
# but a limit is defined, stream() will attempt to read the limit with the most
|
|
86
|
-
# efficient page size, i.e. min(limit, 1000)
|
|
87
|
-
# @return [Array] Array of up to limit results
|
|
88
|
-
def list_with_metadata(limit: nil, page_size: nil)
|
|
89
|
-
limits = @version.read_limits(limit, page_size)
|
|
90
|
-
params = Twilio::Values.of({
|
|
91
|
-
|
|
92
|
-
'PageSize' => limits[:page_size],
|
|
93
|
-
});
|
|
94
|
-
headers = Twilio::Values.of({})
|
|
95
|
-
|
|
96
|
-
response = @version.page('GET', @uri, params: params, headers: headers)
|
|
97
|
-
|
|
98
|
-
ChunkPageMetadata.new(@version, response, @solution, limits[:limit])
|
|
99
|
-
end
|
|
100
|
-
|
|
101
|
-
##
|
|
102
|
-
# When passed a block, yields ChunkInstance records from the API.
|
|
103
|
-
# This operation lazily loads records as efficiently as possible until the limit
|
|
104
|
-
# is reached.
|
|
105
|
-
def each
|
|
106
|
-
limits = @version.read_limits
|
|
107
|
-
|
|
108
|
-
page = self.page(page_size: limits[:page_size], )
|
|
109
|
-
|
|
110
|
-
return [].each if page.nil?
|
|
111
|
-
|
|
112
|
-
result = @version.stream(page,
|
|
113
|
-
limit: limits[:limit],
|
|
114
|
-
page_limit: limits[:page_limit])
|
|
115
|
-
return [].each if result.nil?
|
|
116
|
-
result.each {|x| yield x}
|
|
117
|
-
end
|
|
118
|
-
|
|
119
|
-
##
|
|
120
|
-
# Retrieve a single page of ChunkInstance records from the API.
|
|
121
|
-
# Request is executed immediately.
|
|
122
|
-
# @param [String] page_token PageToken provided by the API
|
|
123
|
-
# @param [Integer] page_number Page Number, this value is simply for client state
|
|
124
|
-
# @param [Integer] page_size Number of records to return, defaults to 50
|
|
125
|
-
# @return [Page] Page of ChunkInstance
|
|
126
|
-
def page(page_token: :unset, page_number: :unset,page_size: :unset)
|
|
127
|
-
params = Twilio::Values.of({
|
|
128
|
-
'PageToken' => page_token,
|
|
129
|
-
'Page' => page_number,
|
|
130
|
-
'PageSize' => page_size,
|
|
131
|
-
})
|
|
132
|
-
headers = Twilio::Values.of({})
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
response = @version.page('GET', @uri, params: params, headers: headers)
|
|
137
|
-
|
|
138
|
-
ChunkPage.new(@version, response, @solution)
|
|
139
|
-
end
|
|
140
|
-
|
|
141
|
-
##
|
|
142
|
-
# Retrieve a single page of ChunkInstance 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 ChunkInstance
|
|
146
|
-
def get_page(target_url)
|
|
147
|
-
response = @version.domain.request(
|
|
148
|
-
'GET',
|
|
149
|
-
target_url
|
|
150
|
-
)
|
|
151
|
-
ChunkPage.new(@version, response, @solution)
|
|
152
|
-
end
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
# Provide a user friendly representation
|
|
157
|
-
def to_s
|
|
158
|
-
'#<Twilio.Assistants.V1.ChunkList>'
|
|
159
|
-
end
|
|
160
|
-
end
|
|
161
|
-
|
|
162
|
-
class ChunkPage < Page
|
|
163
|
-
##
|
|
164
|
-
# Initialize the ChunkPage
|
|
165
|
-
# @param [Version] version Version that contains the resource
|
|
166
|
-
# @param [Response] response Response from the API
|
|
167
|
-
# @param [Hash] solution Path solution for the resource
|
|
168
|
-
# @return [ChunkPage] ChunkPage
|
|
169
|
-
def initialize(version, response, solution)
|
|
170
|
-
super(version, response)
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
# Path Solution
|
|
174
|
-
@solution = solution
|
|
175
|
-
end
|
|
176
|
-
|
|
177
|
-
##
|
|
178
|
-
# Build an instance of ChunkInstance
|
|
179
|
-
# @param [Hash] payload Payload response from the API
|
|
180
|
-
# @return [ChunkInstance] ChunkInstance
|
|
181
|
-
def get_instance(payload)
|
|
182
|
-
ChunkInstance.new(@version, payload, id: @solution[:id])
|
|
183
|
-
end
|
|
184
|
-
|
|
185
|
-
##
|
|
186
|
-
# Provide a user friendly representation
|
|
187
|
-
def to_s
|
|
188
|
-
'<Twilio.Assistants.V1.ChunkPage>'
|
|
189
|
-
end
|
|
190
|
-
end
|
|
191
|
-
|
|
192
|
-
class ChunkPageMetadata < PageMetadata
|
|
193
|
-
attr_reader :chunk_page
|
|
194
|
-
|
|
195
|
-
def initialize(version, response, solution, limit)
|
|
196
|
-
super(version, response)
|
|
197
|
-
@chunk_page = []
|
|
198
|
-
@limit = limit
|
|
199
|
-
key = get_key(response.body)
|
|
200
|
-
records = 0
|
|
201
|
-
while( limit != :unset && records < limit )
|
|
202
|
-
@chunk_page << ChunkListResponse.new(version, @payload, key, limit - records)
|
|
203
|
-
@payload = self.next_page
|
|
204
|
-
break unless @payload
|
|
205
|
-
records += (@payload.body[key] || []).size
|
|
206
|
-
end
|
|
207
|
-
# Path Solution
|
|
208
|
-
@solution = solution
|
|
209
|
-
end
|
|
210
|
-
|
|
211
|
-
def each
|
|
212
|
-
@chunk_page.each do |record|
|
|
213
|
-
yield record
|
|
214
|
-
end
|
|
215
|
-
end
|
|
216
|
-
|
|
217
|
-
def to_s
|
|
218
|
-
'<Twilio::REST::Assistants::V1PageMetadata>';
|
|
219
|
-
end
|
|
220
|
-
end
|
|
221
|
-
class ChunkListResponse < InstanceListResource
|
|
222
|
-
|
|
223
|
-
# @param [Array<ChunkInstance>] instance
|
|
224
|
-
# @param [Hash{String => Object}] headers
|
|
225
|
-
# @param [Integer] status_code
|
|
226
|
-
def initialize(version, payload, key, limit = :unset)
|
|
227
|
-
data_list = payload.body[key] || []
|
|
228
|
-
if limit != :unset
|
|
229
|
-
data_list = data_list[0, limit]
|
|
230
|
-
end
|
|
231
|
-
@chunk = data_list.map do |data|
|
|
232
|
-
ChunkInstance.new(version, data)
|
|
233
|
-
end
|
|
234
|
-
@headers = payload.headers
|
|
235
|
-
@status_code = payload.status_code
|
|
236
|
-
end
|
|
237
|
-
|
|
238
|
-
def chunk
|
|
239
|
-
@chunk
|
|
240
|
-
end
|
|
241
|
-
|
|
242
|
-
def headers
|
|
243
|
-
@headers
|
|
244
|
-
end
|
|
245
|
-
|
|
246
|
-
def status_code
|
|
247
|
-
@status_code
|
|
248
|
-
end
|
|
249
|
-
end
|
|
250
|
-
|
|
251
|
-
class ChunkInstance < InstanceResource
|
|
252
|
-
##
|
|
253
|
-
# Initialize the ChunkInstance
|
|
254
|
-
# @param [Version] version Version that contains the resource
|
|
255
|
-
# @param [Hash] payload payload that contains response from Twilio
|
|
256
|
-
# @param [String] account_sid The SID of the
|
|
257
|
-
# {Account}[https://www.twilio.com/docs/iam/api/account] that created this Chunk
|
|
258
|
-
# resource.
|
|
259
|
-
# @param [String] sid The SID of the Call resource to fetch.
|
|
260
|
-
# @return [ChunkInstance] ChunkInstance
|
|
261
|
-
def initialize(version, payload , id: nil)
|
|
262
|
-
super(version)
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
# Marshaled Properties
|
|
266
|
-
@properties = {
|
|
267
|
-
'account_sid' => payload['account_sid'],
|
|
268
|
-
'content' => payload['content'],
|
|
269
|
-
'metadata' => payload['metadata'],
|
|
270
|
-
'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
|
|
271
|
-
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
|
|
272
|
-
}
|
|
273
|
-
end
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
##
|
|
277
|
-
# @return [String] The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Knowledge resource.
|
|
278
|
-
def account_sid
|
|
279
|
-
@properties['account_sid']
|
|
280
|
-
end
|
|
281
|
-
|
|
282
|
-
##
|
|
283
|
-
# @return [String] The chunk content.
|
|
284
|
-
def content
|
|
285
|
-
@properties['content']
|
|
286
|
-
end
|
|
287
|
-
|
|
288
|
-
##
|
|
289
|
-
# @return [Hash] The metadata of the chunk.
|
|
290
|
-
def metadata
|
|
291
|
-
@properties['metadata']
|
|
292
|
-
end
|
|
293
|
-
|
|
294
|
-
##
|
|
295
|
-
# @return [Time] The date and time in GMT when the Chunk was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
|
296
|
-
def date_created
|
|
297
|
-
@properties['date_created']
|
|
298
|
-
end
|
|
299
|
-
|
|
300
|
-
##
|
|
301
|
-
# @return [Time] The date and time in GMT when the Chunk was updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
|
302
|
-
def date_updated
|
|
303
|
-
@properties['date_updated']
|
|
304
|
-
end
|
|
305
|
-
|
|
306
|
-
##
|
|
307
|
-
# Provide a user friendly representation
|
|
308
|
-
def to_s
|
|
309
|
-
"<Twilio.Assistants.V1.ChunkInstance>"
|
|
310
|
-
end
|
|
311
|
-
|
|
312
|
-
##
|
|
313
|
-
# Provide a detailed, user friendly representation
|
|
314
|
-
def inspect
|
|
315
|
-
"<Twilio.Assistants.V1.ChunkInstance>"
|
|
316
|
-
end
|
|
317
|
-
end
|
|
318
|
-
|
|
319
|
-
end
|
|
320
|
-
end
|
|
321
|
-
end
|
|
322
|
-
end
|
|
323
|
-
end
|
|
324
|
-
|
|
325
|
-
|
|
@@ -1,349 +0,0 @@
|
|
|
1
|
-
##
|
|
2
|
-
# This code was generated by
|
|
3
|
-
# ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
|
4
|
-
# | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
|
5
|
-
# | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
|
6
|
-
#
|
|
7
|
-
# Twilio - Assistants
|
|
8
|
-
# This is the public Twilio REST API.
|
|
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 Assistants < AssistantsBase
|
|
19
|
-
class V1 < Version
|
|
20
|
-
class Knowledge < InstanceContext
|
|
21
|
-
|
|
22
|
-
class KnowledgeStatusList < ListResource
|
|
23
|
-
|
|
24
|
-
##
|
|
25
|
-
# Initialize the KnowledgeStatusList
|
|
26
|
-
# @param [Version] version Version that contains the resource
|
|
27
|
-
# @return [KnowledgeStatusList] KnowledgeStatusList
|
|
28
|
-
def initialize(version, id: nil)
|
|
29
|
-
super(version)
|
|
30
|
-
|
|
31
|
-
# Path Solution
|
|
32
|
-
@solution = { id: id }
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
# Provide a user friendly representation
|
|
40
|
-
def to_s
|
|
41
|
-
'#<Twilio.Assistants.V1.KnowledgeStatusList>'
|
|
42
|
-
end
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
class KnowledgeStatusContext < InstanceContext
|
|
47
|
-
##
|
|
48
|
-
# Initialize the KnowledgeStatusContext
|
|
49
|
-
# @param [Version] version Version that contains the resource
|
|
50
|
-
# @param [String] id the Knowledge ID.
|
|
51
|
-
# @return [KnowledgeStatusContext] KnowledgeStatusContext
|
|
52
|
-
def initialize(version, id)
|
|
53
|
-
super(version)
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
# Path Solution
|
|
57
|
-
@solution = { id: id, }
|
|
58
|
-
@uri = "/Knowledge/#{@solution[:id]}/Status"
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
end
|
|
62
|
-
##
|
|
63
|
-
# Fetch the KnowledgeStatusInstance
|
|
64
|
-
# @return [KnowledgeStatusInstance] Fetched KnowledgeStatusInstance
|
|
65
|
-
def fetch
|
|
66
|
-
|
|
67
|
-
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
payload = @version.fetch('GET', @uri, headers: headers)
|
|
74
|
-
KnowledgeStatusInstance.new(
|
|
75
|
-
@version,
|
|
76
|
-
payload,
|
|
77
|
-
id: @solution[:id],
|
|
78
|
-
)
|
|
79
|
-
end
|
|
80
|
-
|
|
81
|
-
##
|
|
82
|
-
# Fetch the KnowledgeStatusInstanceMetadata
|
|
83
|
-
# @return [KnowledgeStatusInstance] Fetched KnowledgeStatusInstance
|
|
84
|
-
def fetch_with_metadata
|
|
85
|
-
|
|
86
|
-
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
response = @version.fetch_with_metadata('GET', @uri, headers: headers)
|
|
93
|
-
knowledge_status_instance = KnowledgeStatusInstance.new(
|
|
94
|
-
@version,
|
|
95
|
-
response.body,
|
|
96
|
-
id: @solution[:id],
|
|
97
|
-
)
|
|
98
|
-
KnowledgeStatusInstanceMetadata.new(
|
|
99
|
-
@version,
|
|
100
|
-
knowledge_status_instance,
|
|
101
|
-
response.headers,
|
|
102
|
-
response.status_code
|
|
103
|
-
)
|
|
104
|
-
end
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
##
|
|
108
|
-
# Provide a user friendly representation
|
|
109
|
-
def to_s
|
|
110
|
-
context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
|
|
111
|
-
"#<Twilio.Assistants.V1.KnowledgeStatusContext #{context}>"
|
|
112
|
-
end
|
|
113
|
-
|
|
114
|
-
##
|
|
115
|
-
# Provide a detailed, user friendly representation
|
|
116
|
-
def inspect
|
|
117
|
-
context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
|
|
118
|
-
"#<Twilio.Assistants.V1.KnowledgeStatusContext #{context}>"
|
|
119
|
-
end
|
|
120
|
-
end
|
|
121
|
-
|
|
122
|
-
class KnowledgeStatusInstanceMetadata < InstanceResourceMetadata
|
|
123
|
-
##
|
|
124
|
-
# Initializes a new KnowledgeStatusInstanceMetadata.
|
|
125
|
-
# @param [Version] version Version that contains the resource
|
|
126
|
-
# @param [}KnowledgeStatusInstance] knowledge_status_instance The instance associated with the metadata.
|
|
127
|
-
# @param [Hash] headers Header object with response headers.
|
|
128
|
-
# @param [Integer] status_code The HTTP status code of the response.
|
|
129
|
-
# @return [KnowledgeStatusInstanceMetadata] The initialized instance with metadata.
|
|
130
|
-
def initialize(version, knowledge_status_instance, headers, status_code)
|
|
131
|
-
super(version, headers, status_code)
|
|
132
|
-
@knowledge_status_instance = knowledge_status_instance
|
|
133
|
-
end
|
|
134
|
-
|
|
135
|
-
def knowledge_status
|
|
136
|
-
@knowledge_status_instance
|
|
137
|
-
end
|
|
138
|
-
|
|
139
|
-
def headers
|
|
140
|
-
@headers
|
|
141
|
-
end
|
|
142
|
-
|
|
143
|
-
def status_code
|
|
144
|
-
@status_code
|
|
145
|
-
end
|
|
146
|
-
|
|
147
|
-
def to_s
|
|
148
|
-
"<Twilio.Api.V2010.KnowledgeStatusInstanceMetadata status=#{@status_code}>"
|
|
149
|
-
end
|
|
150
|
-
end
|
|
151
|
-
|
|
152
|
-
class KnowledgeStatusListResponse < InstanceListResource
|
|
153
|
-
# @param [Array<KnowledgeStatusInstance>] instance
|
|
154
|
-
# @param [Hash{String => Object}] headers
|
|
155
|
-
# @param [Integer] status_code
|
|
156
|
-
def initialize(version, payload, key)
|
|
157
|
-
@knowledge_status_instance = payload.body[key].map do |data|
|
|
158
|
-
KnowledgeStatusInstance.new(version, data)
|
|
159
|
-
end
|
|
160
|
-
@headers = payload.headers
|
|
161
|
-
@status_code = payload.status_code
|
|
162
|
-
end
|
|
163
|
-
|
|
164
|
-
def knowledge_status_instance
|
|
165
|
-
@instance
|
|
166
|
-
end
|
|
167
|
-
end
|
|
168
|
-
|
|
169
|
-
class KnowledgeStatusPage < Page
|
|
170
|
-
##
|
|
171
|
-
# Initialize the KnowledgeStatusPage
|
|
172
|
-
# @param [Version] version Version that contains the resource
|
|
173
|
-
# @param [Response] response Response from the API
|
|
174
|
-
# @param [Hash] solution Path solution for the resource
|
|
175
|
-
# @return [KnowledgeStatusPage] KnowledgeStatusPage
|
|
176
|
-
def initialize(version, response, solution)
|
|
177
|
-
super(version, response)
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
# Path Solution
|
|
181
|
-
@solution = solution
|
|
182
|
-
end
|
|
183
|
-
|
|
184
|
-
##
|
|
185
|
-
# Build an instance of KnowledgeStatusInstance
|
|
186
|
-
# @param [Hash] payload Payload response from the API
|
|
187
|
-
# @return [KnowledgeStatusInstance] KnowledgeStatusInstance
|
|
188
|
-
def get_instance(payload)
|
|
189
|
-
KnowledgeStatusInstance.new(@version, payload, id: @solution[:id])
|
|
190
|
-
end
|
|
191
|
-
|
|
192
|
-
##
|
|
193
|
-
# Provide a user friendly representation
|
|
194
|
-
def to_s
|
|
195
|
-
'<Twilio.Assistants.V1.KnowledgeStatusPage>'
|
|
196
|
-
end
|
|
197
|
-
end
|
|
198
|
-
|
|
199
|
-
class KnowledgeStatusPageMetadata < PageMetadata
|
|
200
|
-
attr_reader :knowledge_status_page
|
|
201
|
-
|
|
202
|
-
def initialize(version, response, solution, limit)
|
|
203
|
-
super(version, response)
|
|
204
|
-
@knowledge_status_page = []
|
|
205
|
-
@limit = limit
|
|
206
|
-
key = get_key(response.body)
|
|
207
|
-
records = 0
|
|
208
|
-
while( limit != :unset && records < limit )
|
|
209
|
-
@knowledge_status_page << KnowledgeStatusListResponse.new(version, @payload, key, limit - records)
|
|
210
|
-
@payload = self.next_page
|
|
211
|
-
break unless @payload
|
|
212
|
-
records += (@payload.body[key] || []).size
|
|
213
|
-
end
|
|
214
|
-
# Path Solution
|
|
215
|
-
@solution = solution
|
|
216
|
-
end
|
|
217
|
-
|
|
218
|
-
def each
|
|
219
|
-
@knowledge_status_page.each do |record|
|
|
220
|
-
yield record
|
|
221
|
-
end
|
|
222
|
-
end
|
|
223
|
-
|
|
224
|
-
def to_s
|
|
225
|
-
'<Twilio::REST::Assistants::V1PageMetadata>';
|
|
226
|
-
end
|
|
227
|
-
end
|
|
228
|
-
class KnowledgeStatusListResponse < InstanceListResource
|
|
229
|
-
|
|
230
|
-
# @param [Array<KnowledgeStatusInstance>] instance
|
|
231
|
-
# @param [Hash{String => Object}] headers
|
|
232
|
-
# @param [Integer] status_code
|
|
233
|
-
def initialize(version, payload, key, limit = :unset)
|
|
234
|
-
data_list = payload.body[key] || []
|
|
235
|
-
if limit != :unset
|
|
236
|
-
data_list = data_list[0, limit]
|
|
237
|
-
end
|
|
238
|
-
@knowledge_status = data_list.map do |data|
|
|
239
|
-
KnowledgeStatusInstance.new(version, data)
|
|
240
|
-
end
|
|
241
|
-
@headers = payload.headers
|
|
242
|
-
@status_code = payload.status_code
|
|
243
|
-
end
|
|
244
|
-
|
|
245
|
-
def knowledge_status
|
|
246
|
-
@knowledge_status
|
|
247
|
-
end
|
|
248
|
-
|
|
249
|
-
def headers
|
|
250
|
-
@headers
|
|
251
|
-
end
|
|
252
|
-
|
|
253
|
-
def status_code
|
|
254
|
-
@status_code
|
|
255
|
-
end
|
|
256
|
-
end
|
|
257
|
-
|
|
258
|
-
class KnowledgeStatusInstance < InstanceResource
|
|
259
|
-
##
|
|
260
|
-
# Initialize the KnowledgeStatusInstance
|
|
261
|
-
# @param [Version] version Version that contains the resource
|
|
262
|
-
# @param [Hash] payload payload that contains response from Twilio
|
|
263
|
-
# @param [String] account_sid The SID of the
|
|
264
|
-
# {Account}[https://www.twilio.com/docs/iam/api/account] that created this KnowledgeStatus
|
|
265
|
-
# resource.
|
|
266
|
-
# @param [String] sid The SID of the Call resource to fetch.
|
|
267
|
-
# @return [KnowledgeStatusInstance] KnowledgeStatusInstance
|
|
268
|
-
def initialize(version, payload , id: nil)
|
|
269
|
-
super(version)
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
# Marshaled Properties
|
|
273
|
-
@properties = {
|
|
274
|
-
'account_sid' => payload['account_sid'],
|
|
275
|
-
'status' => payload['status'],
|
|
276
|
-
'last_status' => payload['last_status'],
|
|
277
|
-
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
# Context
|
|
281
|
-
@instance_context = nil
|
|
282
|
-
@params = { 'id' => id || @properties['id'] , }
|
|
283
|
-
end
|
|
284
|
-
|
|
285
|
-
##
|
|
286
|
-
# Generate an instance context for the instance, the context is capable of
|
|
287
|
-
# performing various actions. All instance actions are proxied to the context
|
|
288
|
-
# @return [KnowledgeStatusContext] CallContext for this CallInstance
|
|
289
|
-
def context
|
|
290
|
-
unless @instance_context
|
|
291
|
-
@instance_context = KnowledgeStatusContext.new(@version , @params['id'])
|
|
292
|
-
end
|
|
293
|
-
@instance_context
|
|
294
|
-
end
|
|
295
|
-
|
|
296
|
-
##
|
|
297
|
-
# @return [String] The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Knowledge resource.
|
|
298
|
-
def account_sid
|
|
299
|
-
@properties['account_sid']
|
|
300
|
-
end
|
|
301
|
-
|
|
302
|
-
##
|
|
303
|
-
# @return [String] The status of processing the knowledge source ('QUEUED', 'PROCESSING', 'COMPLETED', 'FAILED')
|
|
304
|
-
def status
|
|
305
|
-
@properties['status']
|
|
306
|
-
end
|
|
307
|
-
|
|
308
|
-
##
|
|
309
|
-
# @return [String] The last status of processing the knowledge source ('QUEUED', 'PROCESSING', 'COMPLETED', 'FAILED')
|
|
310
|
-
def last_status
|
|
311
|
-
@properties['last_status']
|
|
312
|
-
end
|
|
313
|
-
|
|
314
|
-
##
|
|
315
|
-
# @return [Time] The date and time in GMT when the Knowledge was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
|
316
|
-
def date_updated
|
|
317
|
-
@properties['date_updated']
|
|
318
|
-
end
|
|
319
|
-
|
|
320
|
-
##
|
|
321
|
-
# Fetch the KnowledgeStatusInstance
|
|
322
|
-
# @return [KnowledgeStatusInstance] Fetched KnowledgeStatusInstance
|
|
323
|
-
def fetch
|
|
324
|
-
|
|
325
|
-
context.fetch
|
|
326
|
-
end
|
|
327
|
-
|
|
328
|
-
##
|
|
329
|
-
# Provide a user friendly representation
|
|
330
|
-
def to_s
|
|
331
|
-
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
|
332
|
-
"<Twilio.Assistants.V1.KnowledgeStatusInstance #{values}>"
|
|
333
|
-
end
|
|
334
|
-
|
|
335
|
-
##
|
|
336
|
-
# Provide a detailed, user friendly representation
|
|
337
|
-
def inspect
|
|
338
|
-
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
|
339
|
-
"<Twilio.Assistants.V1.KnowledgeStatusInstance #{values}>"
|
|
340
|
-
end
|
|
341
|
-
end
|
|
342
|
-
|
|
343
|
-
end
|
|
344
|
-
end
|
|
345
|
-
end
|
|
346
|
-
end
|
|
347
|
-
end
|
|
348
|
-
|
|
349
|
-
|