twilio-ruby 7.3.0 → 7.3.2
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 +21 -0
- data/README.md +2 -2
- data/lib/twilio-ruby/rest/accounts/v1/bulk_consents.rb +133 -0
- data/lib/twilio-ruby/rest/accounts/v1/bulk_contacts.rb +133 -0
- data/lib/twilio-ruby/rest/accounts/v1.rb +12 -0
- data/lib/twilio-ruby/rest/assistants/v1/assistant/assistants_knowledge.rb +355 -0
- data/lib/twilio-ruby/rest/assistants/v1/assistant/assistants_tool.rb +362 -0
- data/lib/twilio-ruby/rest/assistants/v1/assistant/feedback.rb +303 -0
- data/lib/twilio-ruby/rest/assistants/v1/assistant/message.rb +201 -0
- data/lib/twilio-ruby/rest/assistants/v1/assistant.rb +668 -0
- data/lib/twilio-ruby/rest/assistants/v1/knowledge/chunk.rb +229 -0
- data/lib/twilio-ruby/rest/assistants/v1/knowledge/knowledge_status.rb +209 -0
- data/lib/twilio-ruby/rest/assistants/v1/knowledge.rb +591 -0
- data/lib/twilio-ruby/rest/assistants/v1/policy.rb +264 -0
- data/lib/twilio-ruby/rest/assistants/v1/session/message.rb +264 -0
- data/lib/twilio-ruby/rest/assistants/v1/session.rb +328 -0
- data/lib/twilio-ruby/rest/assistants/v1/tool.rb +586 -0
- data/lib/twilio-ruby/rest/assistants/v1.rb +100 -0
- data/lib/twilio-ruby/rest/assistants.rb +6 -0
- data/lib/twilio-ruby/rest/assistants_base.rb +38 -0
- data/lib/twilio-ruby/rest/client.rb +5 -0
- data/lib/twilio-ruby/rest/content/v1/content/approval_fetch.rb +11 -11
- data/lib/twilio-ruby/rest/marketplace/v1/installed_add_on/installed_add_on_usage.rb +11 -24
- data/lib/twilio-ruby/rest/marketplace/v1/module_data_management.rb +28 -15
- data/lib/twilio-ruby/rest/numbers/v1/{porting_webhook_configuration_fetch.rb → webhook.rb} +20 -20
- data/lib/twilio-ruby/rest/numbers/v1.rb +6 -6
- data/lib/twilio-ruby/rest/numbers/v2/bundle_clone.rb +2 -2
- data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb +4 -4
- data/lib/twilio-ruby/rest/serverless/v1/service/environment/deployment.rb +4 -1
- data/lib/twilio-ruby/version.rb +1 -1
- metadata +20 -3
@@ -0,0 +1,201 @@
|
|
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 AssistantContext < InstanceContext
|
21
|
+
|
22
|
+
class MessageList < ListResource
|
23
|
+
|
24
|
+
class AssistantsV1ServiceAssistantSendMessageRequest
|
25
|
+
# @param [identity]: [String] The unique identity of user for the session.
|
26
|
+
# @param [session_id]: [String] The unique name for the session.
|
27
|
+
# @param [body]: [String] The query to ask the assistant.
|
28
|
+
# @param [webhook]: [String] The webhook url to call after the assistant has generated a response or report an error.
|
29
|
+
# @param [mode]: [String] one of the modes 'chat', 'email' or 'voice'
|
30
|
+
attr_accessor :identity, :session_id, :body, :webhook, :mode
|
31
|
+
def initialize(payload)
|
32
|
+
@identity = payload["identity"]
|
33
|
+
@session_id = payload["session_id"]
|
34
|
+
@body = payload["body"]
|
35
|
+
@webhook = payload["webhook"]
|
36
|
+
@mode = payload["mode"]
|
37
|
+
end
|
38
|
+
def to_json(options = {})
|
39
|
+
{
|
40
|
+
identity: @identity,
|
41
|
+
session_id: @session_id,
|
42
|
+
body: @body,
|
43
|
+
webhook: @webhook,
|
44
|
+
mode: @mode,
|
45
|
+
}.to_json(options)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
##
|
50
|
+
# Initialize the MessageList
|
51
|
+
# @param [Version] version Version that contains the resource
|
52
|
+
# @return [MessageList] MessageList
|
53
|
+
def initialize(version, id: nil)
|
54
|
+
super(version)
|
55
|
+
# Path Solution
|
56
|
+
@solution = { id: id }
|
57
|
+
@uri = "/Assistants/#{@solution[:id]}/Messages"
|
58
|
+
|
59
|
+
end
|
60
|
+
##
|
61
|
+
# Create the MessageInstance
|
62
|
+
# @param [AssistantsV1ServiceAssistantSendMessageRequest] assistants_v1_service_assistant_send_message_request
|
63
|
+
# @return [MessageInstance] Created MessageInstance
|
64
|
+
def create(assistants_v1_service_assistant_send_message_request: nil
|
65
|
+
)
|
66
|
+
|
67
|
+
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
|
68
|
+
headers['Content-Type'] = 'application/json'
|
69
|
+
payload = @version.create('POST', @uri, headers: headers, data: assistants_v1_service_assistant_send_message_request.to_json)
|
70
|
+
MessageInstance.new(
|
71
|
+
@version,
|
72
|
+
payload,
|
73
|
+
id: @solution[:id],
|
74
|
+
)
|
75
|
+
end
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
|
80
|
+
# Provide a user friendly representation
|
81
|
+
def to_s
|
82
|
+
'#<Twilio.Assistants.V1.MessageList>'
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
class MessagePage < Page
|
87
|
+
##
|
88
|
+
# Initialize the MessagePage
|
89
|
+
# @param [Version] version Version that contains the resource
|
90
|
+
# @param [Response] response Response from the API
|
91
|
+
# @param [Hash] solution Path solution for the resource
|
92
|
+
# @return [MessagePage] MessagePage
|
93
|
+
def initialize(version, response, solution)
|
94
|
+
super(version, response)
|
95
|
+
|
96
|
+
# Path Solution
|
97
|
+
@solution = solution
|
98
|
+
end
|
99
|
+
|
100
|
+
##
|
101
|
+
# Build an instance of MessageInstance
|
102
|
+
# @param [Hash] payload Payload response from the API
|
103
|
+
# @return [MessageInstance] MessageInstance
|
104
|
+
def get_instance(payload)
|
105
|
+
MessageInstance.new(@version, payload, id: @solution[:id])
|
106
|
+
end
|
107
|
+
|
108
|
+
##
|
109
|
+
# Provide a user friendly representation
|
110
|
+
def to_s
|
111
|
+
'<Twilio.Assistants.V1.MessagePage>'
|
112
|
+
end
|
113
|
+
end
|
114
|
+
class MessageInstance < InstanceResource
|
115
|
+
##
|
116
|
+
# Initialize the MessageInstance
|
117
|
+
# @param [Version] version Version that contains the resource
|
118
|
+
# @param [Hash] payload payload that contains response from Twilio
|
119
|
+
# @param [String] account_sid The SID of the
|
120
|
+
# {Account}[https://www.twilio.com/docs/iam/api/account] that created this Message
|
121
|
+
# resource.
|
122
|
+
# @param [String] sid The SID of the Call resource to fetch.
|
123
|
+
# @return [MessageInstance] MessageInstance
|
124
|
+
def initialize(version, payload , id: nil)
|
125
|
+
super(version)
|
126
|
+
|
127
|
+
# Marshaled Properties
|
128
|
+
@properties = {
|
129
|
+
'status' => payload['status'],
|
130
|
+
'flagged' => payload['flagged'],
|
131
|
+
'aborted' => payload['aborted'],
|
132
|
+
'session_id' => payload['session_id'],
|
133
|
+
'account_sid' => payload['account_sid'],
|
134
|
+
'body' => payload['body'],
|
135
|
+
'error' => payload['error'],
|
136
|
+
}
|
137
|
+
end
|
138
|
+
|
139
|
+
|
140
|
+
##
|
141
|
+
# @return [String] success or failure based on whether the request successfully generated a response.
|
142
|
+
def status
|
143
|
+
@properties['status']
|
144
|
+
end
|
145
|
+
|
146
|
+
##
|
147
|
+
# @return [Boolean] If successful, this property will denote whether the response was flagged or not.
|
148
|
+
def flagged
|
149
|
+
@properties['flagged']
|
150
|
+
end
|
151
|
+
|
152
|
+
##
|
153
|
+
# @return [Boolean] This property will denote whether the request was aborted or not.
|
154
|
+
def aborted
|
155
|
+
@properties['aborted']
|
156
|
+
end
|
157
|
+
|
158
|
+
##
|
159
|
+
# @return [String] The unique name for the session.
|
160
|
+
def session_id
|
161
|
+
@properties['session_id']
|
162
|
+
end
|
163
|
+
|
164
|
+
##
|
165
|
+
# @return [String] The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that sent the Message.
|
166
|
+
def account_sid
|
167
|
+
@properties['account_sid']
|
168
|
+
end
|
169
|
+
|
170
|
+
##
|
171
|
+
# @return [String] If successful, the body of the generated response
|
172
|
+
def body
|
173
|
+
@properties['body']
|
174
|
+
end
|
175
|
+
|
176
|
+
##
|
177
|
+
# @return [String] The error message if generation was not successful
|
178
|
+
def error
|
179
|
+
@properties['error']
|
180
|
+
end
|
181
|
+
|
182
|
+
##
|
183
|
+
# Provide a user friendly representation
|
184
|
+
def to_s
|
185
|
+
"<Twilio.Assistants.V1.MessageInstance>"
|
186
|
+
end
|
187
|
+
|
188
|
+
##
|
189
|
+
# Provide a detailed, user friendly representation
|
190
|
+
def inspect
|
191
|
+
"<Twilio.Assistants.V1.MessageInstance>"
|
192
|
+
end
|
193
|
+
end
|
194
|
+
|
195
|
+
end
|
196
|
+
end
|
197
|
+
end
|
198
|
+
end
|
199
|
+
end
|
200
|
+
|
201
|
+
|