vellum_ai 1.5.4 → 1.5.6

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