Class: Vellum::AsyncFolderEntitiesClient
- Inherits:
-
Object
- Object
- Vellum::AsyncFolderEntitiesClient
- 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:) ⇒ AsyncFolderEntitiesClient constructor
Constructor Details
#initialize(request_client:) ⇒ AsyncFolderEntitiesClient
41 42 43 44 |
# File 'lib/vellum_ai/folder_entities/client.rb', line 41 def initialize(request_client:) # @type [AsyncRequestClient] @request_client = request_client end |
Instance Attribute Details
#request_client ⇒ Object (readonly)
Returns the value of attribute request_client.
37 38 39 |
# File 'lib/vellum_ai/folder_entities/client.rb', line 37 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.
54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/vellum_ai/folder_entities/client.rb', line 54 def add_entity_to_folder(folder_id:, entity_id:, request_options: nil) Async do @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 end |