Class: Vellum::WorkflowDeploymentsClient
- Inherits:
-
Object
- Object
- Vellum::WorkflowDeploymentsClient
- Defined in:
- lib/vellum_ai/workflow_deployments/client.rb
Instance Attribute Summary collapse
-
#request_client ⇒ Object
readonly
Returns the value of attribute request_client.
Instance Method Summary collapse
- #initialize(request_client:) ⇒ WorkflowDeploymentsClient constructor
- #list(limit: nil, offset: nil, ordering: nil, status: nil, request_options: nil) ⇒ PaginatedSlimWorkflowDeploymentList
-
#retrieve(id:, request_options: nil) ⇒ WorkflowDeploymentRead
Used to retrieve a workflow deployment given its ID or name.
Constructor Details
#initialize(request_client:) ⇒ WorkflowDeploymentsClient
15 16 17 18 |
# File 'lib/vellum_ai/workflow_deployments/client.rb', line 15 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.
11 12 13 |
# File 'lib/vellum_ai/workflow_deployments/client.rb', line 11 def request_client @request_client end |
Instance Method Details
#list(limit: nil, offset: nil, ordering: nil, status: nil, request_options: nil) ⇒ PaginatedSlimWorkflowDeploymentList
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/vellum_ai/workflow_deployments/client.rb', line 26 def list(limit: nil, offset: nil, ordering: nil, status: nil, request_options: nil) response = @request_client.conn.get 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.params = { **(&.additional_query_parameters || {}), "limit": limit, "offset": offset, "ordering": ordering, "status": status }.compact req.url "#{@request_client.default_environment[:Default]}/v1/workflow-deployments" end PaginatedSlimWorkflowDeploymentList.from_json(json_object: response.body) end |
#retrieve(id:, request_options: nil) ⇒ WorkflowDeploymentRead
Used to retrieve a workflow deployment given its ID or name.
48 49 50 51 52 53 54 55 56 |
# File 'lib/vellum_ai/workflow_deployments/client.rb', line 48 def retrieve(id:, request_options: nil) response = @request_client.conn.get 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.url "#{@request_client.default_environment[:Default]}/v1/workflow-deployments/#{id}" end WorkflowDeploymentRead.from_json(json_object: response.body) end |