Class: Vellum::FolderEntitiesClient
- Inherits:
-
Object
- Object
- Vellum::FolderEntitiesClient
- Defined in:
- lib/vellum_ai/folder_entities/client.rb
Instance Attribute Summary collapse
-
#request_client ⇒ Object
readonly
Returns the value of attribute request_client.
Instance Method Summary collapse
-
#add_entity_to_folder(folder_id:, entity_id:, request_options: nil) ⇒ Void
Add an entity to a specific folder or root directory.
- #initialize(request_client:) ⇒ FolderEntitiesClient constructor
Constructor Details
#initialize(request_client:) ⇒ FolderEntitiesClient
12 13 14 15 |
# File 'lib/vellum_ai/folder_entities/client.rb', line 12 def initialize(request_client:) # @type [RequestClient] @request_client = request_client end |
Instance Attribute Details
#request_client ⇒ Object (readonly)
Returns the value of attribute request_client.
8 9 10 |
# File 'lib/vellum_ai/folder_entities/client.rb', line 8 def request_client @request_client end |
Instance Method Details
#add_entity_to_folder(folder_id:, entity_id:, request_options: nil) ⇒ Void
Add an entity to a specific folder or root directory.
Adding an entity to a folder will remove it from any other folders it might have been a member of.
25 26 27 28 29 30 31 32 33 |
# File 'lib/vellum_ai/folder_entities/client.rb', line 25 def add_entity_to_folder(folder_id:, entity_id:, request_options: nil) @request_client.conn.post do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["X_API_KEY"] = .api_key unless &.api_key.nil? req.headers = { **req.headers, **(&.additional_headers || {}) }.compact req.body = { **(&.additional_body_parameters || {}), entity_id: entity_id }.compact req.url "#{@request_client.default_environment[:Default]}/v1/folders/#{folder_id}/add-entity" end end |