Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/requests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def get_url(request_options: nil, environment:)
end
# @return [Hash{String => String}]
def get_headers
headers = { "X-Fern-Language": 'Ruby', "X-Fern-SDK-Name": 'vellum_ai', "X-Fern-SDK-Version": '1.5.5' }
headers = { "X-Fern-Language": 'Ruby', "X-Fern-SDK-Name": 'vellum_ai', "X-Fern-SDK-Version": '0.3.3' }
headers["X-API-KEY"] = ((@api_key.is_a? Method) ? @api_key.call : @api_key) unless @api_key.nil?
headers
end
Expand Down Expand Up @@ -107,7 +107,7 @@ def get_url(request_options: nil, environment:)
end
# @return [Hash{String => String}]
def get_headers
headers = { "X-Fern-Language": 'Ruby', "X-Fern-SDK-Name": 'vellum_ai', "X-Fern-SDK-Version": '1.5.5' }
headers = { "X-Fern-Language": 'Ruby', "X-Fern-SDK-Name": 'vellum_ai', "X-Fern-SDK-Version": '0.3.3' }
headers["X-API-KEY"] = ((@api_key.is_a? Method) ? @api_key.call : @api_key) unless @api_key.nil?
headers
end
Expand Down
1 change: 1 addition & 0 deletions lib/types_export.rb
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@
require_relative "vellum_ai/types/initiated_workflow_node_result_event"
require_relative "vellum_ai/types/instructor_vectorizer_config"
require_relative "vellum_ai/types/instructor_vectorizer_config_request"
require_relative "vellum_ai/types/integration_auth_config_integration"
require_relative "vellum_ai/types/integration_auth_config_integration_credential"
require_relative "vellum_ai/types/integration_credential_access_type"
require_relative "vellum_ai/types/components_schemas_composio_integration_exec_config"
Expand Down
70 changes: 70 additions & 0 deletions lib/vellum_ai/types/integration_auth_config_integration.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# frozen_string_literal: true
require_relative "integration_provider"
require_relative "integration_name"
require "ostruct"
require "json"

module Vellum
class IntegrationAuthConfigIntegration
# @return [String]
attr_reader :id
# @return [Vellum::INTEGRATION_PROVIDER]
attr_reader :provider
# @return [Vellum::IntegrationName]
attr_reader :name
# @return [OpenStruct] Additional properties unmapped to the current class definition
attr_reader :additional_properties
# @return [Object]
attr_reader :_field_set
protected :_field_set

OMIT = Object.new

# @param id [String]
# @param provider [Vellum::INTEGRATION_PROVIDER]
# @param name [Vellum::IntegrationName]
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
# @return [Vellum::IntegrationAuthConfigIntegration]
def initialize(id:, provider:, name:, additional_properties: nil)
@id = id
@provider = provider
@name = name
@additional_properties = additional_properties
@_field_set = { "id": id, "provider": provider, "name": name }
end
# Deserialize a JSON object to an instance of IntegrationAuthConfigIntegration
#
# @param json_object [String]
# @return [Vellum::IntegrationAuthConfigIntegration]
def self.from_json(json_object:)
struct = JSON.parse(json_object, object_class: OpenStruct)
parsed_json = JSON.parse(json_object)
id = parsed_json["id"]
provider = parsed_json["provider"]
name = parsed_json["name"]
new(
id: id,
provider: provider,
name: name,
additional_properties: struct
)
end
# Serialize an instance of IntegrationAuthConfigIntegration to a JSON object
#
# @return [String]
def to_json
@_field_set&.to_json
end
# Leveraged for Union-type generation, validate_raw attempts to parse the given
# hash and check each fields type against the current object's property
# definitions.
#
# @param obj [Object]
# @return [Void]
def self.validate_raw(obj:)
obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
obj.provider.is_a?(String) != false || raise("Passed value for field obj.provider is not the expected type, validation failed.")
obj.name.is_a?(Vellum::IntegrationName) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,10 @@ class IntegrationAuthConfigIntegrationCredential
# @param id [String]
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
# @return [Vellum::IntegrationAuthConfigIntegrationCredential]
def initialize(id: OMIT, additional_properties: nil)
@id = id if id != OMIT
def initialize(id:, additional_properties: nil)
@id = id
@additional_properties = additional_properties
@_field_set = { "id": id }.reject do | _k, v |
v == OMIT
end
@_field_set = { "id": id }
end
# Deserialize a JSON object to an instance of
# IntegrationAuthConfigIntegrationCredential
Expand All @@ -49,7 +47,7 @@ def to_json
# @param obj [Object]
# @return [Void]
def self.validate_raw(obj:)
obj.id&.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
end
end
end
6 changes: 3 additions & 3 deletions lib/vellum_ai/types/integration_read.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ class IntegrationRead
# @param exec_config [Vellum::COMPONENTS_SCHEMAS_COMPOSIO_INTEGRATION_EXEC_CONFIG] Integration provider specific information needed for filtering tools.
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
# @return [Vellum::IntegrationRead]
def initialize(id: OMIT, label: OMIT, icon_url:, name:, provider:, exec_config:, additional_properties: nil)
@id = id if id != OMIT
def initialize(id:, label: OMIT, icon_url:, name:, provider:, exec_config:, additional_properties: nil)
@id = id
@label = label if label != OMIT
@icon_url = icon_url
@name = name
Expand Down Expand Up @@ -89,7 +89,7 @@ def to_json
# @param obj [Object]
# @return [Void]
def self.validate_raw(obj:)
obj.id&.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
obj.label&.is_a?(String) != false || raise("Passed value for field obj.label is not the expected type, validation failed.")
obj.icon_url.is_a?(String) != false || raise("Passed value for field obj.icon_url is not the expected type, validation failed.")
obj.name.is_a?(Vellum::IntegrationName) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
Expand Down
21 changes: 17 additions & 4 deletions lib/vellum_ai/types/slim_integration_auth_config_read.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true
require_relative "integration_auth_config_integration"
require_relative "integration_auth_config_integration_credential"
require_relative "integration_credential_access_type"
require "ostruct"
Expand All @@ -9,6 +10,8 @@ module Vellum
class SlimIntegrationAuthConfigRead
# @return [String]
attr_reader :id
# @return [Vellum::IntegrationAuthConfigIntegration]
attr_reader :integration
# @return [Array<Vellum::IntegrationAuthConfigIntegrationCredential>]
attr_reader :integration_credentials
# @return [Vellum::IntegrationCredentialAccessType]
Expand All @@ -22,16 +25,18 @@ class SlimIntegrationAuthConfigRead
OMIT = Object.new

# @param id [String]
# @param integration [Vellum::IntegrationAuthConfigIntegration]
# @param integration_credentials [Array<Vellum::IntegrationAuthConfigIntegrationCredential>]
# @param default_access_type [Vellum::IntegrationCredentialAccessType]
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
# @return [Vellum::SlimIntegrationAuthConfigRead]
def initialize(id: OMIT, integration_credentials: OMIT, default_access_type: OMIT, additional_properties: nil)
@id = id if id != OMIT
def initialize(id:, integration:, integration_credentials: OMIT, default_access_type: OMIT, additional_properties: nil)
@id = id
@integration = integration
@integration_credentials = integration_credentials if integration_credentials != OMIT
@default_access_type = default_access_type if default_access_type != OMIT
@additional_properties = additional_properties
@_field_set = { "id": id, "integration_credentials": integration_credentials, "default_access_type": default_access_type }.reject do | _k, v |
@_field_set = { "id": id, "integration": integration, "integration_credentials": integration_credentials, "default_access_type": default_access_type }.reject do | _k, v |
v == OMIT
end
end
Expand All @@ -43,13 +48,20 @@ def self.from_json(json_object:)
struct = JSON.parse(json_object, object_class: OpenStruct)
parsed_json = JSON.parse(json_object)
id = parsed_json["id"]
unless parsed_json["integration"].nil?
integration = parsed_json["integration"].to_json
integration = Vellum::IntegrationAuthConfigIntegration.from_json(json_object: integration)
else
integration = nil
end
integration_credentials = parsed_json["integration_credentials"]&.map do | item |
item = item.to_json
Vellum::IntegrationAuthConfigIntegrationCredential.from_json(json_object: item)
end
default_access_type = parsed_json["default_access_type"]
new(
id: id,
integration: integration,
integration_credentials: integration_credentials,
default_access_type: default_access_type,
additional_properties: struct
Expand All @@ -68,7 +80,8 @@ def to_json
# @param obj [Object]
# @return [Void]
def self.validate_raw(obj:)
obj.id&.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
Vellum::IntegrationAuthConfigIntegration.validate_raw(obj: obj.integration)
obj.integration_credentials&.is_a?(Array) != false || raise("Passed value for field obj.integration_credentials is not the expected type, validation failed.")
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.")
end
Expand Down
6 changes: 3 additions & 3 deletions lib/vellum_ai/types/slim_integration_read.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ class SlimIntegrationRead
# @param provider [Vellum::INTEGRATION_PROVIDER]
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
# @return [Vellum::SlimIntegrationRead]
def initialize(id: OMIT, label: OMIT, icon_url:, name:, provider:, additional_properties: nil)
@id = id if id != OMIT
def initialize(id:, label: OMIT, icon_url:, name:, provider:, additional_properties: nil)
@id = id
@label = label if label != OMIT
@icon_url = icon_url
@name = name
Expand Down Expand Up @@ -76,7 +76,7 @@ def to_json
# @param obj [Object]
# @return [Void]
def self.validate_raw(obj:)
obj.id&.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
obj.label&.is_a?(String) != false || raise("Passed value for field obj.label is not the expected type, validation failed.")
obj.icon_url.is_a?(String) != false || raise("Passed value for field obj.icon_url is not the expected type, validation failed.")
obj.name.is_a?(Vellum::IntegrationName) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
Expand Down
10 changes: 4 additions & 6 deletions lib/vellum_ai/types/tool_definition_integration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,12 @@ class ToolDefinitionIntegration
# @param name [Vellum::IntegrationName]
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
# @return [Vellum::ToolDefinitionIntegration]
def initialize(id: OMIT, provider:, name:, additional_properties: nil)
@id = id if id != OMIT
def initialize(id:, provider:, name:, additional_properties: nil)
@id = id
@provider = provider
@name = name
@additional_properties = additional_properties
@_field_set = { "id": id, "provider": provider, "name": name }.reject do | _k, v |
v == OMIT
end
@_field_set = { "id": id, "provider": provider, "name": name }
end
# Deserialize a JSON object to an instance of ToolDefinitionIntegration
#
Expand Down Expand Up @@ -64,7 +62,7 @@ def to_json
# @param obj [Object]
# @return [Void]
def self.validate_raw(obj:)
obj.id&.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
obj.provider.is_a?(String) != false || raise("Passed value for field obj.provider is not the expected type, validation failed.")
obj.name.is_a?(Vellum::IntegrationName) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
end
Expand Down
2 changes: 1 addition & 1 deletion vellum_ai.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require_relative "lib/gemconfig"

Gem::Specification.new do | spec |
spec.name = "vellum_ai"
spec.version = "1.5.5"
spec.version = "0.3.3"
spec.licenses = ["MIT"]
spec.authors = Vellum::Gemconfig::AUTHORS
spec.email = Vellum::Gemconfig::EMAIL
Expand Down