vellum_ai 1.5.4 → 1.5.5
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/lib/requests.rb +2 -2
- data/lib/types_export.rb +15 -0
- data/lib/vellum_ai/integration_auth_configs/client.rb +116 -0
- data/lib/vellum_ai/integration_providers/client.rb +196 -0
- data/lib/vellum_ai/integrations/client.rb +180 -24
- data/lib/vellum_ai/test_suite_runs/client.rb +8 -10
- data/lib/vellum_ai/types/components_schemas_composio_integration_exec_config.rb +6 -0
- data/lib/vellum_ai/types/components_schemas_slim_composio_tool_definition.rb +6 -0
- data/lib/vellum_ai/types/composio_integration_exec_config.rb +61 -0
- data/lib/vellum_ai/types/composio_tool_definition.rb +28 -8
- data/lib/vellum_ai/types/integration_auth_config_integration_credential.rb +55 -0
- data/lib/vellum_ai/types/integration_credential_access_type.rb +12 -0
- data/lib/vellum_ai/types/integration_name.rb +30 -0
- data/lib/vellum_ai/types/integration_provider.rb +5 -0
- data/lib/vellum_ai/types/integration_read.rb +100 -0
- data/lib/vellum_ai/types/paginated_slim_integration_auth_config_read_list.rb +83 -0
- data/lib/vellum_ai/types/paginated_slim_integration_read_list.rb +81 -0
- data/lib/vellum_ai/types/paginated_slim_tool_definition_list.rb +81 -0
- data/lib/vellum_ai/types/slim_composio_tool_definition.rb +81 -0
- data/lib/vellum_ai/types/slim_integration_auth_config_read.rb +76 -0
- data/lib/vellum_ai/types/slim_integration_read.rb +86 -0
- data/lib/vellum_ai/types/tool_definition_integration.rb +72 -0
- data/lib/vellum_ai.rb +14 -0
- metadata +19 -2
@@ -0,0 +1,100 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require_relative "integration_name"
|
3
|
+
require_relative "integration_provider"
|
4
|
+
require_relative "components_schemas_composio_integration_exec_config"
|
5
|
+
require "ostruct"
|
6
|
+
require "json"
|
7
|
+
require_relative "composio_integration_exec_config"
|
8
|
+
|
9
|
+
module Vellum
|
10
|
+
class IntegrationRead
|
11
|
+
# @return [String]
|
12
|
+
attr_reader :id
|
13
|
+
# @return [String]
|
14
|
+
attr_reader :label
|
15
|
+
# @return [String]
|
16
|
+
attr_reader :icon_url
|
17
|
+
# @return [Vellum::IntegrationName]
|
18
|
+
attr_reader :name
|
19
|
+
# @return [Vellum::INTEGRATION_PROVIDER]
|
20
|
+
attr_reader :provider
|
21
|
+
# @return [Vellum::COMPONENTS_SCHEMAS_COMPOSIO_INTEGRATION_EXEC_CONFIG] Integration provider specific information needed for filtering tools.
|
22
|
+
attr_reader :exec_config
|
23
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
24
|
+
attr_reader :additional_properties
|
25
|
+
# @return [Object]
|
26
|
+
attr_reader :_field_set
|
27
|
+
protected :_field_set
|
28
|
+
|
29
|
+
OMIT = Object.new
|
30
|
+
|
31
|
+
# @param id [String]
|
32
|
+
# @param label [String]
|
33
|
+
# @param icon_url [String]
|
34
|
+
# @param name [Vellum::IntegrationName]
|
35
|
+
# @param provider [Vellum::INTEGRATION_PROVIDER]
|
36
|
+
# @param exec_config [Vellum::COMPONENTS_SCHEMAS_COMPOSIO_INTEGRATION_EXEC_CONFIG] Integration provider specific information needed for filtering tools.
|
37
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
38
|
+
# @return [Vellum::IntegrationRead]
|
39
|
+
def initialize(id: OMIT, label: OMIT, icon_url:, name:, provider:, exec_config:, additional_properties: nil)
|
40
|
+
@id = id if id != OMIT
|
41
|
+
@label = label if label != OMIT
|
42
|
+
@icon_url = icon_url
|
43
|
+
@name = name
|
44
|
+
@provider = provider
|
45
|
+
@exec_config = exec_config
|
46
|
+
@additional_properties = additional_properties
|
47
|
+
@_field_set = { "id": id, "label": label, "icon_url": icon_url, "name": name, "provider": provider, "exec_config": exec_config }.reject do | _k, v |
|
48
|
+
v == OMIT
|
49
|
+
end
|
50
|
+
end
|
51
|
+
# Deserialize a JSON object to an instance of IntegrationRead
|
52
|
+
#
|
53
|
+
# @param json_object [String]
|
54
|
+
# @return [Vellum::IntegrationRead]
|
55
|
+
def self.from_json(json_object:)
|
56
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
57
|
+
parsed_json = JSON.parse(json_object)
|
58
|
+
id = parsed_json["id"]
|
59
|
+
label = parsed_json["label"]
|
60
|
+
icon_url = parsed_json["icon_url"]
|
61
|
+
name = parsed_json["name"]
|
62
|
+
provider = parsed_json["provider"]
|
63
|
+
unless parsed_json["exec_config"].nil?
|
64
|
+
exec_config = parsed_json["exec_config"].to_json
|
65
|
+
exec_config = Vellum::ComposioIntegrationExecConfig.from_json(json_object: exec_config)
|
66
|
+
else
|
67
|
+
exec_config = nil
|
68
|
+
end
|
69
|
+
new(
|
70
|
+
id: id,
|
71
|
+
label: label,
|
72
|
+
icon_url: icon_url,
|
73
|
+
name: name,
|
74
|
+
provider: provider,
|
75
|
+
exec_config: exec_config,
|
76
|
+
additional_properties: struct
|
77
|
+
)
|
78
|
+
end
|
79
|
+
# Serialize an instance of IntegrationRead to a JSON object
|
80
|
+
#
|
81
|
+
# @return [String]
|
82
|
+
def to_json
|
83
|
+
@_field_set&.to_json
|
84
|
+
end
|
85
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
86
|
+
# hash and check each fields type against the current object's property
|
87
|
+
# definitions.
|
88
|
+
#
|
89
|
+
# @param obj [Object]
|
90
|
+
# @return [Void]
|
91
|
+
def self.validate_raw(obj:)
|
92
|
+
obj.id&.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
|
93
|
+
obj.label&.is_a?(String) != false || raise("Passed value for field obj.label is not the expected type, validation failed.")
|
94
|
+
obj.icon_url.is_a?(String) != false || raise("Passed value for field obj.icon_url is not the expected type, validation failed.")
|
95
|
+
obj.name.is_a?(Vellum::IntegrationName) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
|
96
|
+
obj.provider.is_a?(String) != false || raise("Passed value for field obj.provider is not the expected type, validation failed.")
|
97
|
+
Vellum::ComposioIntegrationExecConfig.validate_raw(obj: obj.exec_config)
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
@@ -0,0 +1,83 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require_relative "slim_integration_auth_config_read"
|
3
|
+
require "ostruct"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module Vellum
|
7
|
+
class PaginatedSlimIntegrationAuthConfigReadList
|
8
|
+
# @return [Integer]
|
9
|
+
attr_reader :count
|
10
|
+
# @return [String]
|
11
|
+
attr_reader :next_
|
12
|
+
# @return [String]
|
13
|
+
attr_reader :previous
|
14
|
+
# @return [Array<Vellum::SlimIntegrationAuthConfigRead>]
|
15
|
+
attr_reader :results
|
16
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
17
|
+
attr_reader :additional_properties
|
18
|
+
# @return [Object]
|
19
|
+
attr_reader :_field_set
|
20
|
+
protected :_field_set
|
21
|
+
|
22
|
+
OMIT = Object.new
|
23
|
+
|
24
|
+
# @param count [Integer]
|
25
|
+
# @param next_ [String]
|
26
|
+
# @param previous [String]
|
27
|
+
# @param results [Array<Vellum::SlimIntegrationAuthConfigRead>]
|
28
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
29
|
+
# @return [Vellum::PaginatedSlimIntegrationAuthConfigReadList]
|
30
|
+
def initialize(count: OMIT, next_: OMIT, previous: OMIT, results: OMIT, additional_properties: nil)
|
31
|
+
@count = count if count != OMIT
|
32
|
+
@next_ = next_ if next_ != OMIT
|
33
|
+
@previous = previous if previous != OMIT
|
34
|
+
@results = results if results != OMIT
|
35
|
+
@additional_properties = additional_properties
|
36
|
+
@_field_set = { "count": count, "next": next_, "previous": previous, "results": results }.reject do | _k, v |
|
37
|
+
v == OMIT
|
38
|
+
end
|
39
|
+
end
|
40
|
+
# Deserialize a JSON object to an instance of
|
41
|
+
# PaginatedSlimIntegrationAuthConfigReadList
|
42
|
+
#
|
43
|
+
# @param json_object [String]
|
44
|
+
# @return [Vellum::PaginatedSlimIntegrationAuthConfigReadList]
|
45
|
+
def self.from_json(json_object:)
|
46
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
47
|
+
parsed_json = JSON.parse(json_object)
|
48
|
+
count = parsed_json["count"]
|
49
|
+
next_ = parsed_json["next"]
|
50
|
+
previous = parsed_json["previous"]
|
51
|
+
results = parsed_json["results"]&.map do | item |
|
52
|
+
item = item.to_json
|
53
|
+
Vellum::SlimIntegrationAuthConfigRead.from_json(json_object: item)
|
54
|
+
end
|
55
|
+
new(
|
56
|
+
count: count,
|
57
|
+
next_: next_,
|
58
|
+
previous: previous,
|
59
|
+
results: results,
|
60
|
+
additional_properties: struct
|
61
|
+
)
|
62
|
+
end
|
63
|
+
# Serialize an instance of PaginatedSlimIntegrationAuthConfigReadList to a JSON
|
64
|
+
# object
|
65
|
+
#
|
66
|
+
# @return [String]
|
67
|
+
def to_json
|
68
|
+
@_field_set&.to_json
|
69
|
+
end
|
70
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
71
|
+
# hash and check each fields type against the current object's property
|
72
|
+
# definitions.
|
73
|
+
#
|
74
|
+
# @param obj [Object]
|
75
|
+
# @return [Void]
|
76
|
+
def self.validate_raw(obj:)
|
77
|
+
obj.count&.is_a?(Integer) != false || raise("Passed value for field obj.count is not the expected type, validation failed.")
|
78
|
+
obj.next_&.is_a?(String) != false || raise("Passed value for field obj.next_ is not the expected type, validation failed.")
|
79
|
+
obj.previous&.is_a?(String) != false || raise("Passed value for field obj.previous is not the expected type, validation failed.")
|
80
|
+
obj.results&.is_a?(Array) != false || raise("Passed value for field obj.results is not the expected type, validation failed.")
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
@@ -0,0 +1,81 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require_relative "slim_integration_read"
|
3
|
+
require "ostruct"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module Vellum
|
7
|
+
class PaginatedSlimIntegrationReadList
|
8
|
+
# @return [Integer]
|
9
|
+
attr_reader :count
|
10
|
+
# @return [String]
|
11
|
+
attr_reader :next_
|
12
|
+
# @return [String]
|
13
|
+
attr_reader :previous
|
14
|
+
# @return [Array<Vellum::SlimIntegrationRead>]
|
15
|
+
attr_reader :results
|
16
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
17
|
+
attr_reader :additional_properties
|
18
|
+
# @return [Object]
|
19
|
+
attr_reader :_field_set
|
20
|
+
protected :_field_set
|
21
|
+
|
22
|
+
OMIT = Object.new
|
23
|
+
|
24
|
+
# @param count [Integer]
|
25
|
+
# @param next_ [String]
|
26
|
+
# @param previous [String]
|
27
|
+
# @param results [Array<Vellum::SlimIntegrationRead>]
|
28
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
29
|
+
# @return [Vellum::PaginatedSlimIntegrationReadList]
|
30
|
+
def initialize(count: OMIT, next_: OMIT, previous: OMIT, results: OMIT, additional_properties: nil)
|
31
|
+
@count = count if count != OMIT
|
32
|
+
@next_ = next_ if next_ != OMIT
|
33
|
+
@previous = previous if previous != OMIT
|
34
|
+
@results = results if results != OMIT
|
35
|
+
@additional_properties = additional_properties
|
36
|
+
@_field_set = { "count": count, "next": next_, "previous": previous, "results": results }.reject do | _k, v |
|
37
|
+
v == OMIT
|
38
|
+
end
|
39
|
+
end
|
40
|
+
# Deserialize a JSON object to an instance of PaginatedSlimIntegrationReadList
|
41
|
+
#
|
42
|
+
# @param json_object [String]
|
43
|
+
# @return [Vellum::PaginatedSlimIntegrationReadList]
|
44
|
+
def self.from_json(json_object:)
|
45
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
46
|
+
parsed_json = JSON.parse(json_object)
|
47
|
+
count = parsed_json["count"]
|
48
|
+
next_ = parsed_json["next"]
|
49
|
+
previous = parsed_json["previous"]
|
50
|
+
results = parsed_json["results"]&.map do | item |
|
51
|
+
item = item.to_json
|
52
|
+
Vellum::SlimIntegrationRead.from_json(json_object: item)
|
53
|
+
end
|
54
|
+
new(
|
55
|
+
count: count,
|
56
|
+
next_: next_,
|
57
|
+
previous: previous,
|
58
|
+
results: results,
|
59
|
+
additional_properties: struct
|
60
|
+
)
|
61
|
+
end
|
62
|
+
# Serialize an instance of PaginatedSlimIntegrationReadList to a JSON object
|
63
|
+
#
|
64
|
+
# @return [String]
|
65
|
+
def to_json
|
66
|
+
@_field_set&.to_json
|
67
|
+
end
|
68
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
69
|
+
# hash and check each fields type against the current object's property
|
70
|
+
# definitions.
|
71
|
+
#
|
72
|
+
# @param obj [Object]
|
73
|
+
# @return [Void]
|
74
|
+
def self.validate_raw(obj:)
|
75
|
+
obj.count&.is_a?(Integer) != false || raise("Passed value for field obj.count is not the expected type, validation failed.")
|
76
|
+
obj.next_&.is_a?(String) != false || raise("Passed value for field obj.next_ is not the expected type, validation failed.")
|
77
|
+
obj.previous&.is_a?(String) != false || raise("Passed value for field obj.previous is not the expected type, validation failed.")
|
78
|
+
obj.results&.is_a?(Array) != false || raise("Passed value for field obj.results is not the expected type, validation failed.")
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
@@ -0,0 +1,81 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require_relative "components_schemas_slim_composio_tool_definition"
|
3
|
+
require "ostruct"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module Vellum
|
7
|
+
class PaginatedSlimToolDefinitionList
|
8
|
+
# @return [Integer]
|
9
|
+
attr_reader :count
|
10
|
+
# @return [String]
|
11
|
+
attr_reader :next_
|
12
|
+
# @return [String]
|
13
|
+
attr_reader :previous
|
14
|
+
# @return [Array<Vellum::COMPONENTS_SCHEMAS_SLIM_COMPOSIO_TOOL_DEFINITION>]
|
15
|
+
attr_reader :results
|
16
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
17
|
+
attr_reader :additional_properties
|
18
|
+
# @return [Object]
|
19
|
+
attr_reader :_field_set
|
20
|
+
protected :_field_set
|
21
|
+
|
22
|
+
OMIT = Object.new
|
23
|
+
|
24
|
+
# @param count [Integer]
|
25
|
+
# @param next_ [String]
|
26
|
+
# @param previous [String]
|
27
|
+
# @param results [Array<Vellum::COMPONENTS_SCHEMAS_SLIM_COMPOSIO_TOOL_DEFINITION>]
|
28
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
29
|
+
# @return [Vellum::PaginatedSlimToolDefinitionList]
|
30
|
+
def initialize(count: OMIT, next_: OMIT, previous: OMIT, results: OMIT, additional_properties: nil)
|
31
|
+
@count = count if count != OMIT
|
32
|
+
@next_ = next_ if next_ != OMIT
|
33
|
+
@previous = previous if previous != OMIT
|
34
|
+
@results = results if results != OMIT
|
35
|
+
@additional_properties = additional_properties
|
36
|
+
@_field_set = { "count": count, "next": next_, "previous": previous, "results": results }.reject do | _k, v |
|
37
|
+
v == OMIT
|
38
|
+
end
|
39
|
+
end
|
40
|
+
# Deserialize a JSON object to an instance of PaginatedSlimToolDefinitionList
|
41
|
+
#
|
42
|
+
# @param json_object [String]
|
43
|
+
# @return [Vellum::PaginatedSlimToolDefinitionList]
|
44
|
+
def self.from_json(json_object:)
|
45
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
46
|
+
parsed_json = JSON.parse(json_object)
|
47
|
+
count = parsed_json["count"]
|
48
|
+
next_ = parsed_json["next"]
|
49
|
+
previous = parsed_json["previous"]
|
50
|
+
results = parsed_json["results"]&.map do | item |
|
51
|
+
item = item.to_json
|
52
|
+
Vellum::SlimComposioToolDefinition.from_json(json_object: item)
|
53
|
+
end
|
54
|
+
new(
|
55
|
+
count: count,
|
56
|
+
next_: next_,
|
57
|
+
previous: previous,
|
58
|
+
results: results,
|
59
|
+
additional_properties: struct
|
60
|
+
)
|
61
|
+
end
|
62
|
+
# Serialize an instance of PaginatedSlimToolDefinitionList to a JSON object
|
63
|
+
#
|
64
|
+
# @return [String]
|
65
|
+
def to_json
|
66
|
+
@_field_set&.to_json
|
67
|
+
end
|
68
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
69
|
+
# hash and check each fields type against the current object's property
|
70
|
+
# definitions.
|
71
|
+
#
|
72
|
+
# @param obj [Object]
|
73
|
+
# @return [Void]
|
74
|
+
def self.validate_raw(obj:)
|
75
|
+
obj.count&.is_a?(Integer) != false || raise("Passed value for field obj.count is not the expected type, validation failed.")
|
76
|
+
obj.next_&.is_a?(String) != false || raise("Passed value for field obj.next_ is not the expected type, validation failed.")
|
77
|
+
obj.previous&.is_a?(String) != false || raise("Passed value for field obj.previous is not the expected type, validation failed.")
|
78
|
+
obj.results&.is_a?(Array) != false || raise("Passed value for field obj.results is not the expected type, validation failed.")
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
@@ -0,0 +1,81 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require_relative "tool_definition_integration"
|
3
|
+
require "ostruct"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module Vellum
|
7
|
+
class SlimComposioToolDefinition
|
8
|
+
# @return [String]
|
9
|
+
attr_reader :provider
|
10
|
+
# @return [Vellum::ToolDefinitionIntegration]
|
11
|
+
attr_reader :integration
|
12
|
+
# @return [String]
|
13
|
+
attr_reader :name
|
14
|
+
# @return [String]
|
15
|
+
attr_reader :description
|
16
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
17
|
+
attr_reader :additional_properties
|
18
|
+
# @return [Object]
|
19
|
+
attr_reader :_field_set
|
20
|
+
protected :_field_set
|
21
|
+
|
22
|
+
OMIT = Object.new
|
23
|
+
|
24
|
+
# @param provider [String]
|
25
|
+
# @param integration [Vellum::ToolDefinitionIntegration]
|
26
|
+
# @param name [String]
|
27
|
+
# @param description [String]
|
28
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
29
|
+
# @return [Vellum::SlimComposioToolDefinition]
|
30
|
+
def initialize(provider:, integration:, name:, description:, additional_properties: nil)
|
31
|
+
@provider = provider
|
32
|
+
@integration = integration
|
33
|
+
@name = name
|
34
|
+
@description = description
|
35
|
+
@additional_properties = additional_properties
|
36
|
+
@_field_set = { "provider": provider, "integration": integration, "name": name, "description": description }
|
37
|
+
end
|
38
|
+
# Deserialize a JSON object to an instance of SlimComposioToolDefinition
|
39
|
+
#
|
40
|
+
# @param json_object [String]
|
41
|
+
# @return [Vellum::SlimComposioToolDefinition]
|
42
|
+
def self.from_json(json_object:)
|
43
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
44
|
+
parsed_json = JSON.parse(json_object)
|
45
|
+
provider = parsed_json["provider"]
|
46
|
+
unless parsed_json["integration"].nil?
|
47
|
+
integration = parsed_json["integration"].to_json
|
48
|
+
integration = Vellum::ToolDefinitionIntegration.from_json(json_object: integration)
|
49
|
+
else
|
50
|
+
integration = nil
|
51
|
+
end
|
52
|
+
name = parsed_json["name"]
|
53
|
+
description = parsed_json["description"]
|
54
|
+
new(
|
55
|
+
provider: provider,
|
56
|
+
integration: integration,
|
57
|
+
name: name,
|
58
|
+
description: description,
|
59
|
+
additional_properties: struct
|
60
|
+
)
|
61
|
+
end
|
62
|
+
# Serialize an instance of SlimComposioToolDefinition to a JSON object
|
63
|
+
#
|
64
|
+
# @return [String]
|
65
|
+
def to_json
|
66
|
+
@_field_set&.to_json
|
67
|
+
end
|
68
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
69
|
+
# hash and check each fields type against the current object's property
|
70
|
+
# definitions.
|
71
|
+
#
|
72
|
+
# @param obj [Object]
|
73
|
+
# @return [Void]
|
74
|
+
def self.validate_raw(obj:)
|
75
|
+
obj.provider.is_a?(String) != false || raise("Passed value for field obj.provider is not the expected type, validation failed.")
|
76
|
+
Vellum::ToolDefinitionIntegration.validate_raw(obj: obj.integration)
|
77
|
+
obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
|
78
|
+
obj.description.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.")
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
@@ -0,0 +1,76 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require_relative "integration_auth_config_integration_credential"
|
3
|
+
require_relative "integration_credential_access_type"
|
4
|
+
require "ostruct"
|
5
|
+
require "json"
|
6
|
+
|
7
|
+
module Vellum
|
8
|
+
# A slim representation of an Integration Auth Config.
|
9
|
+
class SlimIntegrationAuthConfigRead
|
10
|
+
# @return [String]
|
11
|
+
attr_reader :id
|
12
|
+
# @return [Array<Vellum::IntegrationAuthConfigIntegrationCredential>]
|
13
|
+
attr_reader :integration_credentials
|
14
|
+
# @return [Vellum::IntegrationCredentialAccessType]
|
15
|
+
attr_reader :default_access_type
|
16
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
17
|
+
attr_reader :additional_properties
|
18
|
+
# @return [Object]
|
19
|
+
attr_reader :_field_set
|
20
|
+
protected :_field_set
|
21
|
+
|
22
|
+
OMIT = Object.new
|
23
|
+
|
24
|
+
# @param id [String]
|
25
|
+
# @param integration_credentials [Array<Vellum::IntegrationAuthConfigIntegrationCredential>]
|
26
|
+
# @param default_access_type [Vellum::IntegrationCredentialAccessType]
|
27
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
28
|
+
# @return [Vellum::SlimIntegrationAuthConfigRead]
|
29
|
+
def initialize(id: OMIT, integration_credentials: OMIT, default_access_type: OMIT, additional_properties: nil)
|
30
|
+
@id = id if id != OMIT
|
31
|
+
@integration_credentials = integration_credentials if integration_credentials != OMIT
|
32
|
+
@default_access_type = default_access_type if default_access_type != OMIT
|
33
|
+
@additional_properties = additional_properties
|
34
|
+
@_field_set = { "id": id, "integration_credentials": integration_credentials, "default_access_type": default_access_type }.reject do | _k, v |
|
35
|
+
v == OMIT
|
36
|
+
end
|
37
|
+
end
|
38
|
+
# Deserialize a JSON object to an instance of SlimIntegrationAuthConfigRead
|
39
|
+
#
|
40
|
+
# @param json_object [String]
|
41
|
+
# @return [Vellum::SlimIntegrationAuthConfigRead]
|
42
|
+
def self.from_json(json_object:)
|
43
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
44
|
+
parsed_json = JSON.parse(json_object)
|
45
|
+
id = parsed_json["id"]
|
46
|
+
integration_credentials = parsed_json["integration_credentials"]&.map do | item |
|
47
|
+
item = item.to_json
|
48
|
+
Vellum::IntegrationAuthConfigIntegrationCredential.from_json(json_object: item)
|
49
|
+
end
|
50
|
+
default_access_type = parsed_json["default_access_type"]
|
51
|
+
new(
|
52
|
+
id: id,
|
53
|
+
integration_credentials: integration_credentials,
|
54
|
+
default_access_type: default_access_type,
|
55
|
+
additional_properties: struct
|
56
|
+
)
|
57
|
+
end
|
58
|
+
# Serialize an instance of SlimIntegrationAuthConfigRead to a JSON object
|
59
|
+
#
|
60
|
+
# @return [String]
|
61
|
+
def to_json
|
62
|
+
@_field_set&.to_json
|
63
|
+
end
|
64
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
65
|
+
# hash and check each fields type against the current object's property
|
66
|
+
# definitions.
|
67
|
+
#
|
68
|
+
# @param obj [Object]
|
69
|
+
# @return [Void]
|
70
|
+
def self.validate_raw(obj:)
|
71
|
+
obj.id&.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
|
72
|
+
obj.integration_credentials&.is_a?(Array) != false || raise("Passed value for field obj.integration_credentials is not the expected type, validation failed.")
|
73
|
+
obj.default_access_type&.is_a?(Vellum::IntegrationCredentialAccessType) != false || raise("Passed value for field obj.default_access_type is not the expected type, validation failed.")
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
@@ -0,0 +1,86 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require_relative "integration_name"
|
3
|
+
require_relative "integration_provider"
|
4
|
+
require "ostruct"
|
5
|
+
require "json"
|
6
|
+
|
7
|
+
module Vellum
|
8
|
+
class SlimIntegrationRead
|
9
|
+
# @return [String]
|
10
|
+
attr_reader :id
|
11
|
+
# @return [String]
|
12
|
+
attr_reader :label
|
13
|
+
# @return [String]
|
14
|
+
attr_reader :icon_url
|
15
|
+
# @return [Vellum::IntegrationName]
|
16
|
+
attr_reader :name
|
17
|
+
# @return [Vellum::INTEGRATION_PROVIDER]
|
18
|
+
attr_reader :provider
|
19
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
20
|
+
attr_reader :additional_properties
|
21
|
+
# @return [Object]
|
22
|
+
attr_reader :_field_set
|
23
|
+
protected :_field_set
|
24
|
+
|
25
|
+
OMIT = Object.new
|
26
|
+
|
27
|
+
# @param id [String]
|
28
|
+
# @param label [String]
|
29
|
+
# @param icon_url [String]
|
30
|
+
# @param name [Vellum::IntegrationName]
|
31
|
+
# @param provider [Vellum::INTEGRATION_PROVIDER]
|
32
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
33
|
+
# @return [Vellum::SlimIntegrationRead]
|
34
|
+
def initialize(id: OMIT, label: OMIT, icon_url:, name:, provider:, additional_properties: nil)
|
35
|
+
@id = id if id != OMIT
|
36
|
+
@label = label if label != OMIT
|
37
|
+
@icon_url = icon_url
|
38
|
+
@name = name
|
39
|
+
@provider = provider
|
40
|
+
@additional_properties = additional_properties
|
41
|
+
@_field_set = { "id": id, "label": label, "icon_url": icon_url, "name": name, "provider": provider }.reject do | _k, v |
|
42
|
+
v == OMIT
|
43
|
+
end
|
44
|
+
end
|
45
|
+
# Deserialize a JSON object to an instance of SlimIntegrationRead
|
46
|
+
#
|
47
|
+
# @param json_object [String]
|
48
|
+
# @return [Vellum::SlimIntegrationRead]
|
49
|
+
def self.from_json(json_object:)
|
50
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
51
|
+
parsed_json = JSON.parse(json_object)
|
52
|
+
id = parsed_json["id"]
|
53
|
+
label = parsed_json["label"]
|
54
|
+
icon_url = parsed_json["icon_url"]
|
55
|
+
name = parsed_json["name"]
|
56
|
+
provider = parsed_json["provider"]
|
57
|
+
new(
|
58
|
+
id: id,
|
59
|
+
label: label,
|
60
|
+
icon_url: icon_url,
|
61
|
+
name: name,
|
62
|
+
provider: provider,
|
63
|
+
additional_properties: struct
|
64
|
+
)
|
65
|
+
end
|
66
|
+
# Serialize an instance of SlimIntegrationRead to a JSON object
|
67
|
+
#
|
68
|
+
# @return [String]
|
69
|
+
def to_json
|
70
|
+
@_field_set&.to_json
|
71
|
+
end
|
72
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
73
|
+
# hash and check each fields type against the current object's property
|
74
|
+
# definitions.
|
75
|
+
#
|
76
|
+
# @param obj [Object]
|
77
|
+
# @return [Void]
|
78
|
+
def self.validate_raw(obj:)
|
79
|
+
obj.id&.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
|
80
|
+
obj.label&.is_a?(String) != false || raise("Passed value for field obj.label is not the expected type, validation failed.")
|
81
|
+
obj.icon_url.is_a?(String) != false || raise("Passed value for field obj.icon_url is not the expected type, validation failed.")
|
82
|
+
obj.name.is_a?(Vellum::IntegrationName) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
|
83
|
+
obj.provider.is_a?(String) != false || raise("Passed value for field obj.provider is not the expected type, validation failed.")
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require_relative "integration_provider"
|
3
|
+
require_relative "integration_name"
|
4
|
+
require "ostruct"
|
5
|
+
require "json"
|
6
|
+
|
7
|
+
module Vellum
|
8
|
+
class ToolDefinitionIntegration
|
9
|
+
# @return [String]
|
10
|
+
attr_reader :id
|
11
|
+
# @return [Vellum::INTEGRATION_PROVIDER]
|
12
|
+
attr_reader :provider
|
13
|
+
# @return [Vellum::IntegrationName]
|
14
|
+
attr_reader :name
|
15
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
16
|
+
attr_reader :additional_properties
|
17
|
+
# @return [Object]
|
18
|
+
attr_reader :_field_set
|
19
|
+
protected :_field_set
|
20
|
+
|
21
|
+
OMIT = Object.new
|
22
|
+
|
23
|
+
# @param id [String]
|
24
|
+
# @param provider [Vellum::INTEGRATION_PROVIDER]
|
25
|
+
# @param name [Vellum::IntegrationName]
|
26
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
27
|
+
# @return [Vellum::ToolDefinitionIntegration]
|
28
|
+
def initialize(id: OMIT, provider:, name:, additional_properties: nil)
|
29
|
+
@id = id if id != OMIT
|
30
|
+
@provider = provider
|
31
|
+
@name = name
|
32
|
+
@additional_properties = additional_properties
|
33
|
+
@_field_set = { "id": id, "provider": provider, "name": name }.reject do | _k, v |
|
34
|
+
v == OMIT
|
35
|
+
end
|
36
|
+
end
|
37
|
+
# Deserialize a JSON object to an instance of ToolDefinitionIntegration
|
38
|
+
#
|
39
|
+
# @param json_object [String]
|
40
|
+
# @return [Vellum::ToolDefinitionIntegration]
|
41
|
+
def self.from_json(json_object:)
|
42
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
43
|
+
parsed_json = JSON.parse(json_object)
|
44
|
+
id = parsed_json["id"]
|
45
|
+
provider = parsed_json["provider"]
|
46
|
+
name = parsed_json["name"]
|
47
|
+
new(
|
48
|
+
id: id,
|
49
|
+
provider: provider,
|
50
|
+
name: name,
|
51
|
+
additional_properties: struct
|
52
|
+
)
|
53
|
+
end
|
54
|
+
# Serialize an instance of ToolDefinitionIntegration to a JSON object
|
55
|
+
#
|
56
|
+
# @return [String]
|
57
|
+
def to_json
|
58
|
+
@_field_set&.to_json
|
59
|
+
end
|
60
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
61
|
+
# hash and check each fields type against the current object's property
|
62
|
+
# definitions.
|
63
|
+
#
|
64
|
+
# @param obj [Object]
|
65
|
+
# @return [Void]
|
66
|
+
def self.validate_raw(obj:)
|
67
|
+
obj.id&.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
|
68
|
+
obj.provider.is_a?(String) != false || raise("Passed value for field obj.provider is not the expected type, validation failed.")
|
69
|
+
obj.name.is_a?(Vellum::IntegrationName) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|