Class: Vellum::AsyncWorkflowDeploymentsClient
- Inherits:
-
Object
- Object
- Vellum::AsyncWorkflowDeploymentsClient
- 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:) ⇒ AsyncWorkflowDeploymentsClient 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:) ⇒ AsyncWorkflowDeploymentsClient
64 65 66 67 |
# File 'lib/vellum_ai/workflow_deployments/client.rb', line 64 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.
60 61 62 |
# File 'lib/vellum_ai/workflow_deployments/client.rb', line 60 def request_client @request_client end |
Instance Method Details
#list(limit: nil, offset: nil, ordering: nil, status: nil, request_options: nil) ⇒ PaginatedSlimWorkflowDeploymentList
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/vellum_ai/workflow_deployments/client.rb', line 75 def list(limit: nil, offset: nil, ordering: nil, status: nil, request_options: nil) Async do 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 end |
#retrieve(id:, request_options: nil) ⇒ WorkflowDeploymentRead
Used to retrieve a workflow deployment given its ID or name.
99 100 101 102 103 104 105 106 107 108 109 |
# File 'lib/vellum_ai/workflow_deployments/client.rb', line 99 def retrieve(id:, request_options: nil) Async do 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 end |