Class: Vellum::AsyncFolderEntitiesClient
- Inherits:
-
Object
- Object
- Vellum::AsyncFolderEntitiesClient
- Defined in:
- lib/vellum_ai/folder_entities/client.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#add_entity_to_folder(folder_id:, entity_id:, request_options: nil) ⇒ Object
api.folder_entities.add_entity_to_folder(folder_id: "folder_id", entity_id: "entity_id").
- #initialize(request_client:) ⇒ Vellum::AsyncFolderEntitiesClient constructor
-
#list(entity_status: nil, limit: nil, offset: nil, ordering: nil, parent_folder_id:, request_options: nil) ⇒ Object
api.folder_entities.list(parent_folder_id: "parent_folder_id").
Constructor Details
#initialize(request_client:) ⇒ Vellum::AsyncFolderEntitiesClient
120 121 122 |
# File 'lib/vellum_ai/folder_entities/client.rb', line 120 def initialize(request_client:) @request_client = request_client end |
Instance Attribute Details
#request_client ⇒ Vellum::AsyncRequestClient (readonly)
115 116 117 |
# File 'lib/vellum_ai/folder_entities/client.rb', line 115 def request_client @request_client end |
Instance Method Details
#add_entity_to_folder(folder_id:, entity_id:, request_options: nil) ⇒ Object
api.folder_entities.add_entity_to_folder(folder_id: "folder_id", entity_id: "entity_id")
196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 |
# File 'lib/vellum_ai/folder_entities/client.rb', line 196 def add_entity_to_folder(folder_id:, entity_id:, request_options: nil) Async do response = @request_client.conn.post do | req | unless &.timeout_in_seconds.nil? req..timeout = .timeout_in_seconds end unless &.api_key.nil? req.headers["X-API-KEY"] = .api_key end unless &.api_version.nil? req.headers["X-API-Version"] = .api_version else req.headers["X-API-Version"] = "2025-07-30" end req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact unless .nil? || &.additional_query_parameters.nil? req.params = { **(&.additional_query_parameters || {}) }.compact end req.body = { **(&.additional_body_parameters || {}), entity_id: entity_id }.compact req.url "#{@request_client.get_url(environment: Default, request_options: request_options)}/v1/folders/#{folder_id}/add-entity" end end end |
#list(entity_status: nil, limit: nil, offset: nil, ordering: nil, parent_folder_id:, request_options: nil) ⇒ Object
api.folder_entities.list(parent_folder_id: "parent_folder_id")
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 |
# File 'lib/vellum_ai/folder_entities/client.rb', line 151 def list(entity_status: nil, limit: nil, offset: nil, ordering: nil, parent_folder_id:, request_options: nil) Async do response = @request_client.conn.get do | req | unless &.timeout_in_seconds.nil? req..timeout = .timeout_in_seconds end unless &.api_key.nil? req.headers["X-API-KEY"] = .api_key end unless &.api_version.nil? req.headers["X-API-Version"] = .api_version else req.headers["X-API-Version"] = "2025-07-30" end req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact req.params = { **(&.additional_query_parameters || {}), "entity_status": entity_status, "limit": limit, "offset": offset, "ordering": ordering, "parent_folder_id": parent_folder_id }.compact unless .nil? || &.additional_body_parameters.nil? req.body = { **(&.additional_body_parameters || {}) }.compact end req.url "#{@request_client.get_url(environment: Default, request_options: request_options)}/v1/folder-entities" end Vellum::PaginatedFolderEntityList.from_json(json_object: response.body) end end |