voiceml 0.7.1.1 β 0.9.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/README.md +7 -5
- data/lib/voiceml/client.rb +12 -1
- data/lib/voiceml/models/accounts.rb +54 -0
- data/lib/voiceml/models/assistants_v1.rb +239 -0
- data/lib/voiceml/models/conversations_v1.rb +610 -0
- data/lib/voiceml/models/media.rb +48 -0
- data/lib/voiceml/models/notifications.rb +39 -0
- data/lib/voiceml/models/outgoing_caller_ids.rb +70 -0
- data/lib/voiceml/models/routes_v2.rb +31 -0
- data/lib/voiceml/models/sip.rb +184 -0
- data/lib/voiceml/models/user_defined_messages.rb +31 -0
- data/lib/voiceml/models/voice_v1.rb +152 -0
- data/lib/voiceml/resources/assistants_v1.rb +508 -0
- data/lib/voiceml/resources/conversations_v1.rb +1175 -0
- data/lib/voiceml/resources/routes_v2.rb +53 -0
- data/lib/voiceml/resources/sip.rb +210 -0
- data/lib/voiceml/resources/voice_v1.rb +250 -0
- data/lib/voiceml/version.rb +1 -1
- data/lib/voiceml.rb +11 -0
- metadata +17 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f65ec54117bee65194bbf24028d00c20d820cee04cc9200472a42b329cd942f8
|
|
4
|
+
data.tar.gz: 3e2104d7267e31948f3160b37e527cec42acf4a68cb366b4963435f71e55f8ca
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: dbbe6c38b68861d43ed68d7d3ffa335fb9caf7582fa47b091ca37e29ed3fda725f3b492aab06501c7a61d686c2db1e123fa0fd75e5440ed407a4304646feb19a
|
|
7
|
+
data.tar.gz: '09ced634a9e275031687a7d3647795a4c7a287928a8da4ffe5f61babd10c86eee840890e5233552e64ddf4aa68a50319ef42cd2a37afe68975d87cddb16dbe69'
|
data/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# π VoiceML Ruby SDK
|
|
2
2
|
|
|
3
|
-
The official Ruby client for the [VoiceML REST API](https://voicetel.com/docs/api/v0.
|
|
3
|
+
The official Ruby client for the [VoiceML REST API](https://voicetel.com/docs/api/v0.8/voiceml/) β Twilio-compatible outbound voice and answering-machine-detection from VoiceTel, with idiomatic snake_case kwargs, structured errors, and a Twilio-compatible wire format.
|
|
4
4
|
|
|
5
|
-

|
|
6
6
|

|
|
7
7
|

|
|
8
8
|

|
|
@@ -47,10 +47,12 @@ The official Ruby client for the [VoiceML REST API](https://voicetel.com/docs/ap
|
|
|
47
47
|
- **Messages** β create, fetch, list (To/From/DateSent filters + pagination), update (Body redaction; Status=canceled), delete.
|
|
48
48
|
- **IncomingPhoneNumbers** β list, fetch, update.
|
|
49
49
|
- **Notifications** β fetch, list.
|
|
50
|
+
- **SIP** β SIP Trunking: Domains (CRUD), CredentialLists + Credentials (CRUD), IpAccessControlLists + IpAddresses (CRUD), DomainβACL/CredentialList mappings (historical, Auth/Calls, Auth/Registrations namespaces).
|
|
51
|
+
- **Routes V2** β Twilio Inbound Processing Region API: `client.routes_v2.sip_domains.fetch(name)` / `update(name, voice_region:, friendly_name:)`.
|
|
50
52
|
- **Diagnostics** β `/health` deep probe, OpenAPI spec.
|
|
51
53
|
|
|
52
54
|
### π§ͺ Tested
|
|
53
|
-
- **
|
|
55
|
+
- **81 specs** with mocked HTTP layer (`webmock`) covering every resource and pagination edge cases β spec drift gets caught at parse time.
|
|
54
56
|
- Integration smoke spec gated by env vars β safe for CI.
|
|
55
57
|
|
|
56
58
|
### π¦ Clean Distribution
|
|
@@ -108,7 +110,7 @@ client = VoiceML::Client.new(account_sid: 'AC...', api_key: '...')
|
|
|
108
110
|
client.diagnostics.health # uses your AccountSid + key on every call
|
|
109
111
|
```
|
|
110
112
|
|
|
111
|
-
> Don't have credentials yet? See **[voicetel.com/docs/api/v0.
|
|
113
|
+
> Don't have credentials yet? See **[voicetel.com/docs/api/v0.8/voiceml/](https://voicetel.com/docs/api/v0.8/voiceml/)** for issuance and rotation.
|
|
112
114
|
|
|
113
115
|
## πΊοΈ Resource Reference
|
|
114
116
|
|
|
@@ -243,7 +245,7 @@ gem build voiceml.gemspec
|
|
|
243
245
|
|
|
244
246
|
## π API Documentation
|
|
245
247
|
|
|
246
|
-
- **Reference docs:** [voicetel.com/docs/api/v0.
|
|
248
|
+
- **Reference docs:** [voicetel.com/docs/api/v0.8/voiceml/](https://voicetel.com/docs/api/v0.8/voiceml/)
|
|
247
249
|
- **Validator:** [voicetel.com/voiceml/validator/](https://voicetel.com/voiceml/validator/)
|
|
248
250
|
- **SDK catalogue:** [voicetel.com/docs/voiceml-sdks/](https://voicetel.com/docs/voiceml-sdks/)
|
|
249
251
|
- **YARD comments:** every resource method carries `@param` / `@return` docs β `yard doc lib` builds them locally.
|
data/lib/voiceml/client.rb
CHANGED
|
@@ -10,6 +10,11 @@ require_relative 'resources/incoming_phone_numbers'
|
|
|
10
10
|
require_relative 'resources/notifications'
|
|
11
11
|
require_relative 'resources/diagnostics'
|
|
12
12
|
require_relative 'resources/messages'
|
|
13
|
+
require_relative 'resources/sip'
|
|
14
|
+
require_relative 'resources/routes_v2'
|
|
15
|
+
require_relative 'resources/voice_v1'
|
|
16
|
+
require_relative 'resources/conversations_v1'
|
|
17
|
+
require_relative 'resources/assistants_v1'
|
|
13
18
|
|
|
14
19
|
module VoiceML
|
|
15
20
|
# Synchronous client for the VoiceML REST API.
|
|
@@ -28,7 +33,8 @@ module VoiceML
|
|
|
28
33
|
# puts call.sid, call.status
|
|
29
34
|
class Client
|
|
30
35
|
attr_reader :calls, :conferences, :queues, :applications, :recordings,
|
|
31
|
-
:incoming_phone_numbers, :notifications, :diagnostics, :messages
|
|
36
|
+
:incoming_phone_numbers, :notifications, :diagnostics, :messages,
|
|
37
|
+
:sip, :routes_v2, :voice_v1, :conversations_v1, :assistants_v1
|
|
32
38
|
|
|
33
39
|
# @param account_sid [String] Twilio-format AccountSid (`AC` + 32 hex).
|
|
34
40
|
# @param api_key [String, nil] per-tenant API key. Pass either `api_key:` or the
|
|
@@ -70,6 +76,11 @@ module VoiceML
|
|
|
70
76
|
@notifications = NotificationsResource.new(@transport)
|
|
71
77
|
@diagnostics = DiagnosticsResource.new(@transport)
|
|
72
78
|
@messages = MessagesResource.new(@transport)
|
|
79
|
+
@sip = SipResource.new(@transport)
|
|
80
|
+
@routes_v2 = RoutesV2Resource.new(@transport)
|
|
81
|
+
@voice_v1 = VoiceV1Resource.new(@transport)
|
|
82
|
+
@conversations_v1 = ConversationsV1Resource.new(@transport)
|
|
83
|
+
@assistants_v1 = AssistantsV1Resource.new(@transport)
|
|
73
84
|
end
|
|
74
85
|
|
|
75
86
|
def account_sid
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative 'common'
|
|
4
|
+
|
|
5
|
+
module VoiceML
|
|
6
|
+
# Twilio-compatible Account resource. The voiceml SDK is single-account
|
|
7
|
+
# (the credential's account is implicit on every call), so this model
|
|
8
|
+
# exists primarily to decode `GET/POST /Accounts/{Sid}.json` responses
|
|
9
|
+
# round-trip with the Twilio shape β useful for migration tooling that
|
|
10
|
+
# echoes the account record back to the caller.
|
|
11
|
+
class Account
|
|
12
|
+
ATTRIBUTES = %w[
|
|
13
|
+
sid friendly_name status type auth_token owner_account_sid
|
|
14
|
+
date_created date_updated subresource_uris uri
|
|
15
|
+
].freeze
|
|
16
|
+
|
|
17
|
+
attr_reader(*ATTRIBUTES.map(&:to_sym))
|
|
18
|
+
|
|
19
|
+
def initialize(attrs = {})
|
|
20
|
+
ATTRIBUTES.each do |field|
|
|
21
|
+
value = attrs.key?(field) ? attrs[field] : attrs[field.to_sym]
|
|
22
|
+
instance_variable_set("@#{field}", value)
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def self.from_hash(hash)
|
|
27
|
+
return nil if hash.nil?
|
|
28
|
+
|
|
29
|
+
new(hash)
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# `GET /Accounts/{Sid}/Balance.json` β running balance for the account in
|
|
34
|
+
# the account's settlement currency. No `sid` field on the wire (the
|
|
35
|
+
# balance is account-scoped, not its own resource).
|
|
36
|
+
class Balance
|
|
37
|
+
ATTRIBUTES = %w[account_sid balance currency].freeze
|
|
38
|
+
|
|
39
|
+
attr_reader(*ATTRIBUTES.map(&:to_sym))
|
|
40
|
+
|
|
41
|
+
def initialize(attrs = {})
|
|
42
|
+
ATTRIBUTES.each do |field|
|
|
43
|
+
value = attrs.key?(field) ? attrs[field] : attrs[field.to_sym]
|
|
44
|
+
instance_variable_set("@#{field}", value)
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def self.from_hash(hash)
|
|
49
|
+
return nil if hash.nil?
|
|
50
|
+
|
|
51
|
+
new(hash)
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative 'common'
|
|
4
|
+
require_relative 'voice_v1' # V1Pageable lives here; Assistants v1 reuses the same `meta` envelope
|
|
5
|
+
|
|
6
|
+
module VoiceML
|
|
7
|
+
# Assistants v1 (`/v1/Assistants`, `/v1/Tools`, `/v1/Knowledge`, `/v1/Sessions`,
|
|
8
|
+
# `/v1/Policies`) β Twilio AI-Assistants surface. Same /v1 conventions as Voice v1
|
|
9
|
+
# and Conversations v1: Basic-auth account resolution, ISO-8601 dates, `meta`
|
|
10
|
+
# list envelope (V1Pageable). 7 families for v0.9.1:
|
|
11
|
+
# - Assistant (aia_asst_...)
|
|
12
|
+
# - Tool (aia_tool_...) + ToolWithPolicies fetch shape
|
|
13
|
+
# - Knowledge (aia_know_...) + KnowledgeStatus + KnowledgeChunk
|
|
14
|
+
# - Session
|
|
15
|
+
# - Message (aia_msg_...) + SendMessageResponse
|
|
16
|
+
# - Feedback (aia_fdbk_...)
|
|
17
|
+
# - Policy (aia_plcy_...)
|
|
18
|
+
|
|
19
|
+
# AssistantsV1Assistant β `aia_asst_...`. Used by list/create/update/delete responses.
|
|
20
|
+
class AssistantsV1Assistant
|
|
21
|
+
ATTRIBUTES = %w[
|
|
22
|
+
account_sid customer_ai id model name owner url personality_prompt
|
|
23
|
+
date_created date_updated
|
|
24
|
+
].freeze
|
|
25
|
+
attr_reader(*ATTRIBUTES.map(&:to_sym))
|
|
26
|
+
def initialize(attrs = {})
|
|
27
|
+
ATTRIBUTES.each { |f| instance_variable_set("@#{f}", attrs.key?(f) ? attrs[f] : attrs[f.to_sym]) }
|
|
28
|
+
end
|
|
29
|
+
def self.from_hash(h); h.nil? ? nil : new(h); end
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
class AssistantsV1AssistantList
|
|
33
|
+
include V1Pageable
|
|
34
|
+
attr_reader :assistants
|
|
35
|
+
def initialize(hash = {})
|
|
36
|
+
assign_meta_fields(hash)
|
|
37
|
+
@assistants = (hash['assistants'] || []).map { |h| AssistantsV1Assistant.from_hash(h) }
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# AssistantsV1AssistantWithToolsAndKnowledge β fetch-one shape that includes the
|
|
42
|
+
# attached tools and knowledge arrays inline.
|
|
43
|
+
class AssistantsV1AssistantWithToolsAndKnowledge
|
|
44
|
+
ATTRIBUTES = %w[
|
|
45
|
+
account_sid customer_ai id model name owner url personality_prompt
|
|
46
|
+
date_created date_updated tools knowledge
|
|
47
|
+
].freeze
|
|
48
|
+
attr_reader(*ATTRIBUTES.map(&:to_sym))
|
|
49
|
+
def initialize(attrs = {})
|
|
50
|
+
ATTRIBUTES.each { |f| instance_variable_set("@#{f}", attrs.key?(f) ? attrs[f] : attrs[f.to_sym]) }
|
|
51
|
+
end
|
|
52
|
+
def self.from_hash(h); h.nil? ? nil : new(h); end
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# AssistantsV1Tool β `aia_tool_...`.
|
|
56
|
+
class AssistantsV1Tool
|
|
57
|
+
ATTRIBUTES = %w[
|
|
58
|
+
account_sid description enabled id meta name requires_auth type url
|
|
59
|
+
date_created date_updated
|
|
60
|
+
].freeze
|
|
61
|
+
attr_reader(*ATTRIBUTES.map(&:to_sym))
|
|
62
|
+
def initialize(attrs = {})
|
|
63
|
+
ATTRIBUTES.each { |f| instance_variable_set("@#{f}", attrs.key?(f) ? attrs[f] : attrs[f.to_sym]) }
|
|
64
|
+
end
|
|
65
|
+
def self.from_hash(h); h.nil? ? nil : new(h); end
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
class AssistantsV1ToolList
|
|
69
|
+
include V1Pageable
|
|
70
|
+
attr_reader :tools
|
|
71
|
+
def initialize(hash = {})
|
|
72
|
+
assign_meta_fields(hash)
|
|
73
|
+
@tools = (hash['tools'] || []).map { |h| AssistantsV1Tool.from_hash(h) }
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# AssistantsV1ToolWithPolicies β fetch-one shape that includes the policies array inline.
|
|
78
|
+
class AssistantsV1ToolWithPolicies
|
|
79
|
+
ATTRIBUTES = %w[
|
|
80
|
+
account_sid description enabled id meta name requires_auth type url
|
|
81
|
+
date_created date_updated policies
|
|
82
|
+
].freeze
|
|
83
|
+
attr_reader(*ATTRIBUTES.map(&:to_sym))
|
|
84
|
+
def initialize(attrs = {})
|
|
85
|
+
ATTRIBUTES.each { |f| instance_variable_set("@#{f}", attrs.key?(f) ? attrs[f] : attrs[f.to_sym]) }
|
|
86
|
+
end
|
|
87
|
+
def self.from_hash(h); h.nil? ? nil : new(h); end
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# AssistantsV1Knowledge β `aia_know_...`.
|
|
91
|
+
class AssistantsV1Knowledge
|
|
92
|
+
ATTRIBUTES = %w[
|
|
93
|
+
account_sid description id knowledge_source_details name status type url
|
|
94
|
+
embedding_model date_created date_updated
|
|
95
|
+
].freeze
|
|
96
|
+
attr_reader(*ATTRIBUTES.map(&:to_sym))
|
|
97
|
+
def initialize(attrs = {})
|
|
98
|
+
ATTRIBUTES.each { |f| instance_variable_set("@#{f}", attrs.key?(f) ? attrs[f] : attrs[f.to_sym]) }
|
|
99
|
+
end
|
|
100
|
+
def self.from_hash(h); h.nil? ? nil : new(h); end
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
class AssistantsV1KnowledgeList
|
|
104
|
+
include V1Pageable
|
|
105
|
+
attr_reader :knowledge
|
|
106
|
+
def initialize(hash = {})
|
|
107
|
+
assign_meta_fields(hash)
|
|
108
|
+
@knowledge = (hash['knowledge'] || []).map { |h| AssistantsV1Knowledge.from_hash(h) }
|
|
109
|
+
end
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
# AssistantsV1KnowledgeStatus β read-only ingestion status snapshot.
|
|
113
|
+
class AssistantsV1KnowledgeStatus
|
|
114
|
+
ATTRIBUTES = %w[account_sid status last_status date_updated].freeze
|
|
115
|
+
attr_reader(*ATTRIBUTES.map(&:to_sym))
|
|
116
|
+
def initialize(attrs = {})
|
|
117
|
+
ATTRIBUTES.each { |f| instance_variable_set("@#{f}", attrs.key?(f) ? attrs[f] : attrs[f.to_sym]) }
|
|
118
|
+
end
|
|
119
|
+
def self.from_hash(h); h.nil? ? nil : new(h); end
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
# AssistantsV1KnowledgeChunk β single retrieved chunk of indexed Knowledge content.
|
|
123
|
+
class AssistantsV1KnowledgeChunk
|
|
124
|
+
ATTRIBUTES = %w[account_sid content metadata date_created date_updated].freeze
|
|
125
|
+
attr_reader(*ATTRIBUTES.map(&:to_sym))
|
|
126
|
+
def initialize(attrs = {})
|
|
127
|
+
ATTRIBUTES.each { |f| instance_variable_set("@#{f}", attrs.key?(f) ? attrs[f] : attrs[f.to_sym]) }
|
|
128
|
+
end
|
|
129
|
+
def self.from_hash(h); h.nil? ? nil : new(h); end
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
class AssistantsV1KnowledgeChunkList
|
|
133
|
+
include V1Pageable
|
|
134
|
+
attr_reader :chunks
|
|
135
|
+
def initialize(hash = {})
|
|
136
|
+
assign_meta_fields(hash)
|
|
137
|
+
@chunks = (hash['chunks'] || []).map { |h| AssistantsV1KnowledgeChunk.from_hash(h) }
|
|
138
|
+
end
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# AssistantsV1Session β a chat session between an identity and an Assistant.
|
|
142
|
+
class AssistantsV1Session
|
|
143
|
+
ATTRIBUTES = %w[
|
|
144
|
+
id account_sid assistant_id verified identity date_created date_updated
|
|
145
|
+
].freeze
|
|
146
|
+
attr_reader(*ATTRIBUTES.map(&:to_sym))
|
|
147
|
+
def initialize(attrs = {})
|
|
148
|
+
ATTRIBUTES.each { |f| instance_variable_set("@#{f}", attrs.key?(f) ? attrs[f] : attrs[f.to_sym]) }
|
|
149
|
+
end
|
|
150
|
+
def self.from_hash(h); h.nil? ? nil : new(h); end
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
class AssistantsV1SessionList
|
|
154
|
+
include V1Pageable
|
|
155
|
+
attr_reader :sessions
|
|
156
|
+
def initialize(hash = {})
|
|
157
|
+
assign_meta_fields(hash)
|
|
158
|
+
@sessions = (hash['sessions'] || []).map { |h| AssistantsV1Session.from_hash(h) }
|
|
159
|
+
end
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
# AssistantsV1Message β `aia_msg_...`. One message in an Assistant session.
|
|
163
|
+
class AssistantsV1Message
|
|
164
|
+
ATTRIBUTES = %w[
|
|
165
|
+
id account_sid assistant_id session_id identity role content meta
|
|
166
|
+
date_created date_updated
|
|
167
|
+
].freeze
|
|
168
|
+
attr_reader(*ATTRIBUTES.map(&:to_sym))
|
|
169
|
+
def initialize(attrs = {})
|
|
170
|
+
ATTRIBUTES.each { |f| instance_variable_set("@#{f}", attrs.key?(f) ? attrs[f] : attrs[f.to_sym]) }
|
|
171
|
+
end
|
|
172
|
+
def self.from_hash(h); h.nil? ? nil : new(h); end
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
class AssistantsV1MessageList
|
|
176
|
+
include V1Pageable
|
|
177
|
+
attr_reader :messages
|
|
178
|
+
def initialize(hash = {})
|
|
179
|
+
assign_meta_fields(hash)
|
|
180
|
+
@messages = (hash['messages'] || []).map { |h| AssistantsV1Message.from_hash(h) }
|
|
181
|
+
end
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
# AssistantsV1SendMessageResponse β POST /v1/Assistants/{id}/Messages return shape.
|
|
185
|
+
# Distinct from AssistantsV1Message: carries the model's reply body + flag/abort signals.
|
|
186
|
+
class AssistantsV1SendMessageResponse
|
|
187
|
+
ATTRIBUTES = %w[status flagged aborted session_id account_sid body error].freeze
|
|
188
|
+
attr_reader(*ATTRIBUTES.map(&:to_sym))
|
|
189
|
+
def initialize(attrs = {})
|
|
190
|
+
ATTRIBUTES.each { |f| instance_variable_set("@#{f}", attrs.key?(f) ? attrs[f] : attrs[f.to_sym]) }
|
|
191
|
+
end
|
|
192
|
+
def self.from_hash(h); h.nil? ? nil : new(h); end
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
# AssistantsV1Feedback β `aia_fdbk_...`. Numeric score + text feedback on a message.
|
|
196
|
+
class AssistantsV1Feedback
|
|
197
|
+
ATTRIBUTES = %w[
|
|
198
|
+
assistant_id id account_sid user_sid message_id score session_id text
|
|
199
|
+
date_created date_updated
|
|
200
|
+
].freeze
|
|
201
|
+
attr_reader(*ATTRIBUTES.map(&:to_sym))
|
|
202
|
+
def initialize(attrs = {})
|
|
203
|
+
ATTRIBUTES.each { |f| instance_variable_set("@#{f}", attrs.key?(f) ? attrs[f] : attrs[f.to_sym]) }
|
|
204
|
+
end
|
|
205
|
+
def self.from_hash(h); h.nil? ? nil : new(h); end
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
class AssistantsV1FeedbackList
|
|
209
|
+
include V1Pageable
|
|
210
|
+
attr_reader :feedbacks
|
|
211
|
+
def initialize(hash = {})
|
|
212
|
+
assign_meta_fields(hash)
|
|
213
|
+
@feedbacks = (hash['feedbacks'] || []).map { |h| AssistantsV1Feedback.from_hash(h) }
|
|
214
|
+
end
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
# AssistantsV1Policy β `aia_plcy_...`. Read-only β listed under /v1/Policies (filterable
|
|
218
|
+
# by ToolId/KnowledgeId) and embedded inline on Tool fetch responses.
|
|
219
|
+
class AssistantsV1Policy
|
|
220
|
+
ATTRIBUTES = %w[
|
|
221
|
+
id name description account_sid user_sid type policy_details
|
|
222
|
+
date_created date_updated
|
|
223
|
+
].freeze
|
|
224
|
+
attr_reader(*ATTRIBUTES.map(&:to_sym))
|
|
225
|
+
def initialize(attrs = {})
|
|
226
|
+
ATTRIBUTES.each { |f| instance_variable_set("@#{f}", attrs.key?(f) ? attrs[f] : attrs[f.to_sym]) }
|
|
227
|
+
end
|
|
228
|
+
def self.from_hash(h); h.nil? ? nil : new(h); end
|
|
229
|
+
end
|
|
230
|
+
|
|
231
|
+
class AssistantsV1PolicyList
|
|
232
|
+
include V1Pageable
|
|
233
|
+
attr_reader :policies
|
|
234
|
+
def initialize(hash = {})
|
|
235
|
+
assign_meta_fields(hash)
|
|
236
|
+
@policies = (hash['policies'] || []).map { |h| AssistantsV1Policy.from_hash(h) }
|
|
237
|
+
end
|
|
238
|
+
end
|
|
239
|
+
end
|