twilio-ruby 6.9.0 → 6.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +12 -0
- data/README.md +2 -2
- data/lib/twilio-ruby/http/http_client.rb +3 -2
- data/lib/twilio-ruby/rest/client.rb +0 -5
- data/lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb +27 -27
- data/lib/twilio-ruby/rest/preview/sync/service.rb +27 -27
- data/lib/twilio-ruby/rest/preview.rb +1 -11
- data/lib/twilio-ruby/rest/preview_base.rb +0 -5
- data/lib/twilio-ruby/version.rb +1 -1
- metadata +2 -35
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/defaults.rb +0 -241
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/dialogue.rb +0 -217
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/field_type/field_value.rb +0 -389
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/field_type.rb +0 -435
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/model_build.rb +0 -409
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/query.rb +0 -473
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/style_sheet.rb +0 -241
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/task/field.rb +0 -373
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/task/sample.rb +0 -436
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_actions.rb +0 -253
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_statistics.rb +0 -226
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/task.rb +0 -525
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/webhook.rb +0 -433
- data/lib/twilio-ruby/rest/autopilot/v1/assistant.rb +0 -683
- data/lib/twilio-ruby/rest/autopilot/v1/restore_assistant.rb +0 -207
- data/lib/twilio-ruby/rest/autopilot/v1.rb +0 -55
- data/lib/twilio-ruby/rest/autopilot.rb +0 -22
- data/lib/twilio-ruby/rest/autopilot_base.rb +0 -38
- data/lib/twilio-ruby/rest/preview/understand/assistant/assistant_fallback_actions.rb +0 -241
- data/lib/twilio-ruby/rest/preview/understand/assistant/assistant_initiation_actions.rb +0 -241
- data/lib/twilio-ruby/rest/preview/understand/assistant/dialogue.rb +0 -217
- data/lib/twilio-ruby/rest/preview/understand/assistant/field_type/field_value.rb +0 -389
- data/lib/twilio-ruby/rest/preview/understand/assistant/field_type.rb +0 -435
- data/lib/twilio-ruby/rest/preview/understand/assistant/model_build.rb +0 -409
- data/lib/twilio-ruby/rest/preview/understand/assistant/query.rb +0 -463
- data/lib/twilio-ruby/rest/preview/understand/assistant/style_sheet.rb +0 -241
- data/lib/twilio-ruby/rest/preview/understand/assistant/task/field.rb +0 -373
- data/lib/twilio-ruby/rest/preview/understand/assistant/task/sample.rb +0 -436
- data/lib/twilio-ruby/rest/preview/understand/assistant/task/task_actions.rb +0 -253
- data/lib/twilio-ruby/rest/preview/understand/assistant/task/task_statistics.rb +0 -226
- data/lib/twilio-ruby/rest/preview/understand/assistant/task.rb +0 -525
- data/lib/twilio-ruby/rest/preview/understand/assistant.rb +0 -663
- data/lib/twilio-ruby/rest/preview/understand.rb +0 -49
@@ -1,241 +0,0 @@
|
|
1
|
-
##
|
2
|
-
# This code was generated by
|
3
|
-
# ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
4
|
-
# | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
5
|
-
# | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
6
|
-
#
|
7
|
-
# Twilio - Preview
|
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 Preview < PreviewBase
|
19
|
-
class Understand < Version
|
20
|
-
class AssistantContext < InstanceContext
|
21
|
-
|
22
|
-
class StyleSheetList < ListResource
|
23
|
-
##
|
24
|
-
# Initialize the StyleSheetList
|
25
|
-
# @param [Version] version Version that contains the resource
|
26
|
-
# @return [StyleSheetList] StyleSheetList
|
27
|
-
def initialize(version, assistant_sid: nil)
|
28
|
-
super(version)
|
29
|
-
# Path Solution
|
30
|
-
@solution = { assistant_sid: assistant_sid }
|
31
|
-
|
32
|
-
|
33
|
-
end
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
# Provide a user friendly representation
|
38
|
-
def to_s
|
39
|
-
'#<Twilio.Preview.Understand.StyleSheetList>'
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
|
44
|
-
##
|
45
|
-
#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.
|
46
|
-
class StyleSheetContext < InstanceContext
|
47
|
-
##
|
48
|
-
# Initialize the StyleSheetContext
|
49
|
-
# @param [Version] version Version that contains the resource
|
50
|
-
# @param [String] assistant_sid The unique ID of the Assistant
|
51
|
-
# @return [StyleSheetContext] StyleSheetContext
|
52
|
-
def initialize(version, assistant_sid)
|
53
|
-
super(version)
|
54
|
-
|
55
|
-
# Path Solution
|
56
|
-
@solution = { assistant_sid: assistant_sid, }
|
57
|
-
@uri = "/Assistants/#{@solution[:assistant_sid]}/StyleSheet"
|
58
|
-
|
59
|
-
|
60
|
-
end
|
61
|
-
##
|
62
|
-
# Fetch the StyleSheetInstance
|
63
|
-
# @return [StyleSheetInstance] Fetched StyleSheetInstance
|
64
|
-
def fetch
|
65
|
-
|
66
|
-
payload = @version.fetch('GET', @uri)
|
67
|
-
StyleSheetInstance.new(
|
68
|
-
@version,
|
69
|
-
payload,
|
70
|
-
assistant_sid: @solution[:assistant_sid],
|
71
|
-
)
|
72
|
-
end
|
73
|
-
|
74
|
-
##
|
75
|
-
# Update the StyleSheetInstance
|
76
|
-
# @param [Object] style_sheet The JSON Style sheet string
|
77
|
-
# @return [StyleSheetInstance] Updated StyleSheetInstance
|
78
|
-
def update(
|
79
|
-
style_sheet: :unset
|
80
|
-
)
|
81
|
-
|
82
|
-
data = Twilio::Values.of({
|
83
|
-
'StyleSheet' => Twilio.serialize_object(style_sheet),
|
84
|
-
})
|
85
|
-
|
86
|
-
payload = @version.update('POST', @uri, data: data)
|
87
|
-
StyleSheetInstance.new(
|
88
|
-
@version,
|
89
|
-
payload,
|
90
|
-
assistant_sid: @solution[:assistant_sid],
|
91
|
-
)
|
92
|
-
end
|
93
|
-
|
94
|
-
|
95
|
-
##
|
96
|
-
# Provide a user friendly representation
|
97
|
-
def to_s
|
98
|
-
context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
|
99
|
-
"#<Twilio.Preview.Understand.StyleSheetContext #{context}>"
|
100
|
-
end
|
101
|
-
|
102
|
-
##
|
103
|
-
# Provide a detailed, user friendly representation
|
104
|
-
def inspect
|
105
|
-
context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
|
106
|
-
"#<Twilio.Preview.Understand.StyleSheetContext #{context}>"
|
107
|
-
end
|
108
|
-
end
|
109
|
-
|
110
|
-
class StyleSheetPage < Page
|
111
|
-
##
|
112
|
-
# Initialize the StyleSheetPage
|
113
|
-
# @param [Version] version Version that contains the resource
|
114
|
-
# @param [Response] response Response from the API
|
115
|
-
# @param [Hash] solution Path solution for the resource
|
116
|
-
# @return [StyleSheetPage] StyleSheetPage
|
117
|
-
def initialize(version, response, solution)
|
118
|
-
super(version, response)
|
119
|
-
|
120
|
-
# Path Solution
|
121
|
-
@solution = solution
|
122
|
-
end
|
123
|
-
|
124
|
-
##
|
125
|
-
# Build an instance of StyleSheetInstance
|
126
|
-
# @param [Hash] payload Payload response from the API
|
127
|
-
# @return [StyleSheetInstance] StyleSheetInstance
|
128
|
-
def get_instance(payload)
|
129
|
-
StyleSheetInstance.new(@version, payload, assistant_sid: @solution[:assistant_sid])
|
130
|
-
end
|
131
|
-
|
132
|
-
##
|
133
|
-
# Provide a user friendly representation
|
134
|
-
def to_s
|
135
|
-
'<Twilio.Preview.Understand.StyleSheetPage>'
|
136
|
-
end
|
137
|
-
end
|
138
|
-
class StyleSheetInstance < InstanceResource
|
139
|
-
##
|
140
|
-
# Initialize the StyleSheetInstance
|
141
|
-
# @param [Version] version Version that contains the resource
|
142
|
-
# @param [Hash] payload payload that contains response from Twilio
|
143
|
-
# @param [String] account_sid The SID of the
|
144
|
-
# {Account}[https://www.twilio.com/docs/iam/api/account] that created this StyleSheet
|
145
|
-
# resource.
|
146
|
-
# @param [String] sid The SID of the Call resource to fetch.
|
147
|
-
# @return [StyleSheetInstance] StyleSheetInstance
|
148
|
-
def initialize(version, payload , assistant_sid: nil)
|
149
|
-
super(version)
|
150
|
-
|
151
|
-
# Marshaled Properties
|
152
|
-
@properties = {
|
153
|
-
'account_sid' => payload['account_sid'],
|
154
|
-
'assistant_sid' => payload['assistant_sid'],
|
155
|
-
'url' => payload['url'],
|
156
|
-
'data' => payload['data'],
|
157
|
-
}
|
158
|
-
|
159
|
-
# Context
|
160
|
-
@instance_context = nil
|
161
|
-
@params = { 'assistant_sid' => assistant_sid || @properties['assistant_sid'] , }
|
162
|
-
end
|
163
|
-
|
164
|
-
##
|
165
|
-
# Generate an instance context for the instance, the context is capable of
|
166
|
-
# performing various actions. All instance actions are proxied to the context
|
167
|
-
# @return [StyleSheetContext] CallContext for this CallInstance
|
168
|
-
def context
|
169
|
-
unless @instance_context
|
170
|
-
@instance_context = StyleSheetContext.new(@version , @params['assistant_sid'])
|
171
|
-
end
|
172
|
-
@instance_context
|
173
|
-
end
|
174
|
-
|
175
|
-
##
|
176
|
-
# @return [String] The unique ID of the Account that created this Assistant
|
177
|
-
def account_sid
|
178
|
-
@properties['account_sid']
|
179
|
-
end
|
180
|
-
|
181
|
-
##
|
182
|
-
# @return [String] The unique ID of the Assistant
|
183
|
-
def assistant_sid
|
184
|
-
@properties['assistant_sid']
|
185
|
-
end
|
186
|
-
|
187
|
-
##
|
188
|
-
# @return [String]
|
189
|
-
def url
|
190
|
-
@properties['url']
|
191
|
-
end
|
192
|
-
|
193
|
-
##
|
194
|
-
# @return [Hash] The JSON style sheet object
|
195
|
-
def data
|
196
|
-
@properties['data']
|
197
|
-
end
|
198
|
-
|
199
|
-
##
|
200
|
-
# Fetch the StyleSheetInstance
|
201
|
-
# @return [StyleSheetInstance] Fetched StyleSheetInstance
|
202
|
-
def fetch
|
203
|
-
|
204
|
-
context.fetch
|
205
|
-
end
|
206
|
-
|
207
|
-
##
|
208
|
-
# Update the StyleSheetInstance
|
209
|
-
# @param [Object] style_sheet The JSON Style sheet string
|
210
|
-
# @return [StyleSheetInstance] Updated StyleSheetInstance
|
211
|
-
def update(
|
212
|
-
style_sheet: :unset
|
213
|
-
)
|
214
|
-
|
215
|
-
context.update(
|
216
|
-
style_sheet: style_sheet,
|
217
|
-
)
|
218
|
-
end
|
219
|
-
|
220
|
-
##
|
221
|
-
# Provide a user friendly representation
|
222
|
-
def to_s
|
223
|
-
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
224
|
-
"<Twilio.Preview.Understand.StyleSheetInstance #{values}>"
|
225
|
-
end
|
226
|
-
|
227
|
-
##
|
228
|
-
# Provide a detailed, user friendly representation
|
229
|
-
def inspect
|
230
|
-
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
231
|
-
"<Twilio.Preview.Understand.StyleSheetInstance #{values}>"
|
232
|
-
end
|
233
|
-
end
|
234
|
-
|
235
|
-
end
|
236
|
-
end
|
237
|
-
end
|
238
|
-
end
|
239
|
-
end
|
240
|
-
|
241
|
-
|
@@ -1,373 +0,0 @@
|
|
1
|
-
##
|
2
|
-
# This code was generated by
|
3
|
-
# ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
4
|
-
# | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
5
|
-
# | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
6
|
-
#
|
7
|
-
# Twilio - Preview
|
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 Preview < PreviewBase
|
19
|
-
class Understand < Version
|
20
|
-
class AssistantContext < InstanceContext
|
21
|
-
class TaskContext < InstanceContext
|
22
|
-
|
23
|
-
class FieldList < ListResource
|
24
|
-
##
|
25
|
-
# Initialize the FieldList
|
26
|
-
# @param [Version] version Version that contains the resource
|
27
|
-
# @return [FieldList] FieldList
|
28
|
-
def initialize(version, assistant_sid: nil, task_sid: nil)
|
29
|
-
super(version)
|
30
|
-
# Path Solution
|
31
|
-
@solution = { assistant_sid: assistant_sid, task_sid: task_sid }
|
32
|
-
@uri = "/Assistants/#{@solution[:assistant_sid]}/Tasks/#{@solution[:task_sid]}/Fields"
|
33
|
-
|
34
|
-
end
|
35
|
-
##
|
36
|
-
# Create the FieldInstance
|
37
|
-
# @param [String] field_type The unique name or sid of the FieldType. It can be any [Built-in Field Type](https://www.twilio.com/docs/assistant/api/built-in-field-types) or the unique_name or the Field Type sid of a custom Field Type.
|
38
|
-
# @param [String] unique_name A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long.
|
39
|
-
# @return [FieldInstance] Created FieldInstance
|
40
|
-
def create(
|
41
|
-
field_type: nil,
|
42
|
-
unique_name: nil
|
43
|
-
)
|
44
|
-
|
45
|
-
data = Twilio::Values.of({
|
46
|
-
'FieldType' => field_type,
|
47
|
-
'UniqueName' => unique_name,
|
48
|
-
})
|
49
|
-
|
50
|
-
payload = @version.create('POST', @uri, data: data)
|
51
|
-
FieldInstance.new(
|
52
|
-
@version,
|
53
|
-
payload,
|
54
|
-
assistant_sid: @solution[:assistant_sid],
|
55
|
-
task_sid: @solution[:task_sid],
|
56
|
-
)
|
57
|
-
end
|
58
|
-
|
59
|
-
|
60
|
-
##
|
61
|
-
# Lists FieldInstance records from the API as a list.
|
62
|
-
# Unlike stream(), this operation is eager and will load `limit` records into
|
63
|
-
# memory before returning.
|
64
|
-
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
65
|
-
# guarantees to never return more than limit. Default is no limit
|
66
|
-
# @param [Integer] page_size Number of records to fetch per request, when
|
67
|
-
# not set will use the default value of 50 records. If no page_size is defined
|
68
|
-
# but a limit is defined, stream() will attempt to read the limit with the most
|
69
|
-
# efficient page size, i.e. min(limit, 1000)
|
70
|
-
# @return [Array] Array of up to limit results
|
71
|
-
def list(limit: nil, page_size: nil)
|
72
|
-
self.stream(
|
73
|
-
limit: limit,
|
74
|
-
page_size: page_size
|
75
|
-
).entries
|
76
|
-
end
|
77
|
-
|
78
|
-
##
|
79
|
-
# Streams Instance records from the API as an Enumerable.
|
80
|
-
# This operation lazily loads records as efficiently as possible until the limit
|
81
|
-
# is reached.
|
82
|
-
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
83
|
-
# guarantees to never return more than limit. Default is no limit
|
84
|
-
# @param [Integer] page_size Number of records to fetch per request, when
|
85
|
-
# not set will use the default value of 50 records. If no page_size is defined
|
86
|
-
# but a limit is defined, stream() will attempt to read the limit with the most
|
87
|
-
# efficient page size, i.e. min(limit, 1000)
|
88
|
-
# @return [Enumerable] Enumerable that will yield up to limit results
|
89
|
-
def stream(limit: nil, page_size: nil)
|
90
|
-
limits = @version.read_limits(limit, page_size)
|
91
|
-
|
92
|
-
page = self.page(
|
93
|
-
page_size: limits[:page_size], )
|
94
|
-
|
95
|
-
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
96
|
-
end
|
97
|
-
|
98
|
-
##
|
99
|
-
# When passed a block, yields FieldInstance records from the API.
|
100
|
-
# This operation lazily loads records as efficiently as possible until the limit
|
101
|
-
# is reached.
|
102
|
-
def each
|
103
|
-
limits = @version.read_limits
|
104
|
-
|
105
|
-
page = self.page(page_size: limits[:page_size], )
|
106
|
-
|
107
|
-
@version.stream(page,
|
108
|
-
limit: limits[:limit],
|
109
|
-
page_limit: limits[:page_limit]).each {|x| yield x}
|
110
|
-
end
|
111
|
-
|
112
|
-
##
|
113
|
-
# Retrieve a single page of FieldInstance records from the API.
|
114
|
-
# Request is executed immediately.
|
115
|
-
# @param [String] page_token PageToken provided by the API
|
116
|
-
# @param [Integer] page_number Page Number, this value is simply for client state
|
117
|
-
# @param [Integer] page_size Number of records to return, defaults to 50
|
118
|
-
# @return [Page] Page of FieldInstance
|
119
|
-
def page(page_token: :unset, page_number: :unset, page_size: :unset)
|
120
|
-
params = Twilio::Values.of({
|
121
|
-
'PageToken' => page_token,
|
122
|
-
'Page' => page_number,
|
123
|
-
'PageSize' => page_size,
|
124
|
-
})
|
125
|
-
|
126
|
-
response = @version.page('GET', @uri, params: params)
|
127
|
-
|
128
|
-
FieldPage.new(@version, response, @solution)
|
129
|
-
end
|
130
|
-
|
131
|
-
##
|
132
|
-
# Retrieve a single page of FieldInstance records from the API.
|
133
|
-
# Request is executed immediately.
|
134
|
-
# @param [String] target_url API-generated URL for the requested results page
|
135
|
-
# @return [Page] Page of FieldInstance
|
136
|
-
def get_page(target_url)
|
137
|
-
response = @version.domain.request(
|
138
|
-
'GET',
|
139
|
-
target_url
|
140
|
-
)
|
141
|
-
FieldPage.new(@version, response, @solution)
|
142
|
-
end
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
# Provide a user friendly representation
|
147
|
-
def to_s
|
148
|
-
'#<Twilio.Preview.Understand.FieldList>'
|
149
|
-
end
|
150
|
-
end
|
151
|
-
|
152
|
-
|
153
|
-
##
|
154
|
-
#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.
|
155
|
-
class FieldContext < InstanceContext
|
156
|
-
##
|
157
|
-
# Initialize the FieldContext
|
158
|
-
# @param [Version] version Version that contains the resource
|
159
|
-
# @param [String] assistant_sid The unique ID of the Assistant.
|
160
|
-
# @param [String] task_sid The unique ID of the Task associated with this Field.
|
161
|
-
# @param [String] sid A 34 character string that uniquely identifies this resource.
|
162
|
-
# @return [FieldContext] FieldContext
|
163
|
-
def initialize(version, assistant_sid, task_sid, sid)
|
164
|
-
super(version)
|
165
|
-
|
166
|
-
# Path Solution
|
167
|
-
@solution = { assistant_sid: assistant_sid, task_sid: task_sid, sid: sid, }
|
168
|
-
@uri = "/Assistants/#{@solution[:assistant_sid]}/Tasks/#{@solution[:task_sid]}/Fields/#{@solution[:sid]}"
|
169
|
-
|
170
|
-
|
171
|
-
end
|
172
|
-
##
|
173
|
-
# Delete the FieldInstance
|
174
|
-
# @return [Boolean] True if delete succeeds, false otherwise
|
175
|
-
def delete
|
176
|
-
|
177
|
-
@version.delete('DELETE', @uri)
|
178
|
-
end
|
179
|
-
|
180
|
-
##
|
181
|
-
# Fetch the FieldInstance
|
182
|
-
# @return [FieldInstance] Fetched FieldInstance
|
183
|
-
def fetch
|
184
|
-
|
185
|
-
payload = @version.fetch('GET', @uri)
|
186
|
-
FieldInstance.new(
|
187
|
-
@version,
|
188
|
-
payload,
|
189
|
-
assistant_sid: @solution[:assistant_sid],
|
190
|
-
task_sid: @solution[:task_sid],
|
191
|
-
sid: @solution[:sid],
|
192
|
-
)
|
193
|
-
end
|
194
|
-
|
195
|
-
|
196
|
-
##
|
197
|
-
# Provide a user friendly representation
|
198
|
-
def to_s
|
199
|
-
context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
|
200
|
-
"#<Twilio.Preview.Understand.FieldContext #{context}>"
|
201
|
-
end
|
202
|
-
|
203
|
-
##
|
204
|
-
# Provide a detailed, user friendly representation
|
205
|
-
def inspect
|
206
|
-
context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
|
207
|
-
"#<Twilio.Preview.Understand.FieldContext #{context}>"
|
208
|
-
end
|
209
|
-
end
|
210
|
-
|
211
|
-
class FieldPage < Page
|
212
|
-
##
|
213
|
-
# Initialize the FieldPage
|
214
|
-
# @param [Version] version Version that contains the resource
|
215
|
-
# @param [Response] response Response from the API
|
216
|
-
# @param [Hash] solution Path solution for the resource
|
217
|
-
# @return [FieldPage] FieldPage
|
218
|
-
def initialize(version, response, solution)
|
219
|
-
super(version, response)
|
220
|
-
|
221
|
-
# Path Solution
|
222
|
-
@solution = solution
|
223
|
-
end
|
224
|
-
|
225
|
-
##
|
226
|
-
# Build an instance of FieldInstance
|
227
|
-
# @param [Hash] payload Payload response from the API
|
228
|
-
# @return [FieldInstance] FieldInstance
|
229
|
-
def get_instance(payload)
|
230
|
-
FieldInstance.new(@version, payload, assistant_sid: @solution[:assistant_sid], task_sid: @solution[:task_sid])
|
231
|
-
end
|
232
|
-
|
233
|
-
##
|
234
|
-
# Provide a user friendly representation
|
235
|
-
def to_s
|
236
|
-
'<Twilio.Preview.Understand.FieldPage>'
|
237
|
-
end
|
238
|
-
end
|
239
|
-
class FieldInstance < InstanceResource
|
240
|
-
##
|
241
|
-
# Initialize the FieldInstance
|
242
|
-
# @param [Version] version Version that contains the resource
|
243
|
-
# @param [Hash] payload payload that contains response from Twilio
|
244
|
-
# @param [String] account_sid The SID of the
|
245
|
-
# {Account}[https://www.twilio.com/docs/iam/api/account] that created this Field
|
246
|
-
# resource.
|
247
|
-
# @param [String] sid The SID of the Call resource to fetch.
|
248
|
-
# @return [FieldInstance] FieldInstance
|
249
|
-
def initialize(version, payload , assistant_sid: nil, task_sid: nil, sid: nil)
|
250
|
-
super(version)
|
251
|
-
|
252
|
-
# Marshaled Properties
|
253
|
-
@properties = {
|
254
|
-
'account_sid' => payload['account_sid'],
|
255
|
-
'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
|
256
|
-
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
|
257
|
-
'field_type' => payload['field_type'],
|
258
|
-
'task_sid' => payload['task_sid'],
|
259
|
-
'assistant_sid' => payload['assistant_sid'],
|
260
|
-
'sid' => payload['sid'],
|
261
|
-
'unique_name' => payload['unique_name'],
|
262
|
-
'url' => payload['url'],
|
263
|
-
}
|
264
|
-
|
265
|
-
# Context
|
266
|
-
@instance_context = nil
|
267
|
-
@params = { 'assistant_sid' => assistant_sid || @properties['assistant_sid'] ,'task_sid' => task_sid || @properties['task_sid'] ,'sid' => sid || @properties['sid'] , }
|
268
|
-
end
|
269
|
-
|
270
|
-
##
|
271
|
-
# Generate an instance context for the instance, the context is capable of
|
272
|
-
# performing various actions. All instance actions are proxied to the context
|
273
|
-
# @return [FieldContext] CallContext for this CallInstance
|
274
|
-
def context
|
275
|
-
unless @instance_context
|
276
|
-
@instance_context = FieldContext.new(@version , @params['assistant_sid'], @params['task_sid'], @params['sid'])
|
277
|
-
end
|
278
|
-
@instance_context
|
279
|
-
end
|
280
|
-
|
281
|
-
##
|
282
|
-
# @return [String] The unique ID of the Account that created this Field.
|
283
|
-
def account_sid
|
284
|
-
@properties['account_sid']
|
285
|
-
end
|
286
|
-
|
287
|
-
##
|
288
|
-
# @return [Time] The date that this resource was created
|
289
|
-
def date_created
|
290
|
-
@properties['date_created']
|
291
|
-
end
|
292
|
-
|
293
|
-
##
|
294
|
-
# @return [Time] The date that this resource was last updated
|
295
|
-
def date_updated
|
296
|
-
@properties['date_updated']
|
297
|
-
end
|
298
|
-
|
299
|
-
##
|
300
|
-
# @return [String] The Field Type of this field. It can be any [Built-in Field Type](https://www.twilio.com/docs/assistant/api/built-in-field-types) or the unique_name or sid of a custom Field Type.
|
301
|
-
def field_type
|
302
|
-
@properties['field_type']
|
303
|
-
end
|
304
|
-
|
305
|
-
##
|
306
|
-
# @return [String] The unique ID of the Task associated with this Field.
|
307
|
-
def task_sid
|
308
|
-
@properties['task_sid']
|
309
|
-
end
|
310
|
-
|
311
|
-
##
|
312
|
-
# @return [String] The unique ID of the parent Assistant.
|
313
|
-
def assistant_sid
|
314
|
-
@properties['assistant_sid']
|
315
|
-
end
|
316
|
-
|
317
|
-
##
|
318
|
-
# @return [String] A 34 character string that uniquely identifies this resource.
|
319
|
-
def sid
|
320
|
-
@properties['sid']
|
321
|
-
end
|
322
|
-
|
323
|
-
##
|
324
|
-
# @return [String] A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long.
|
325
|
-
def unique_name
|
326
|
-
@properties['unique_name']
|
327
|
-
end
|
328
|
-
|
329
|
-
##
|
330
|
-
# @return [String]
|
331
|
-
def url
|
332
|
-
@properties['url']
|
333
|
-
end
|
334
|
-
|
335
|
-
##
|
336
|
-
# Delete the FieldInstance
|
337
|
-
# @return [Boolean] True if delete succeeds, false otherwise
|
338
|
-
def delete
|
339
|
-
|
340
|
-
context.delete
|
341
|
-
end
|
342
|
-
|
343
|
-
##
|
344
|
-
# Fetch the FieldInstance
|
345
|
-
# @return [FieldInstance] Fetched FieldInstance
|
346
|
-
def fetch
|
347
|
-
|
348
|
-
context.fetch
|
349
|
-
end
|
350
|
-
|
351
|
-
##
|
352
|
-
# Provide a user friendly representation
|
353
|
-
def to_s
|
354
|
-
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
355
|
-
"<Twilio.Preview.Understand.FieldInstance #{values}>"
|
356
|
-
end
|
357
|
-
|
358
|
-
##
|
359
|
-
# Provide a detailed, user friendly representation
|
360
|
-
def inspect
|
361
|
-
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
362
|
-
"<Twilio.Preview.Understand.FieldInstance #{values}>"
|
363
|
-
end
|
364
|
-
end
|
365
|
-
|
366
|
-
end
|
367
|
-
end
|
368
|
-
end
|
369
|
-
end
|
370
|
-
end
|
371
|
-
end
|
372
|
-
|
373
|
-
|