class Vellum::AsyncSandboxesClient

def delete_sandbox_scenario(id:, scenario_id:, request_options: nil)

Returns:
  • (Void) -

Parameters:
  • request_options (RequestOptions) --
  • scenario_id (String) -- An id identifying the scenario that you'd like to delete
  • id (String) -- A UUID string identifying this sandbox.
def delete_sandbox_scenario(id:, scenario_id:, request_options: nil)
  Async do
    @request_client.conn.delete do |req|
      req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
      req.headers["X_API_KEY"] = request_options.api_key unless request_options&.api_key.nil?
      req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
      req.url "#{@request_client.default_environment[:Default]}/v1/sandboxes/#{id}/scenarios/#{scenario_id}"
    end
  end
end

def initialize(request_client:)

Returns:
  • (AsyncSandboxesClient) -

Parameters:
  • request_client (AsyncRequestClient) --
def initialize(request_client:)
  # @type [AsyncRequestClient]
  @request_client = request_client
end

def upsert_sandbox_scenario(id:, inputs:, label: nil, scenario_id: nil, request_options: nil)

Returns:
  • (SandboxScenario) -

Parameters:
  • request_options (RequestOptions) --
  • scenario_id (String) -- The id of the scenario to update. If none is provided, an id will be generated and a new scenario will be appended.
  • inputs (Array) -- The inputs for the scenarioRequest of type Array, as a Hash
  • label (String) --
  • id (String) -- A UUID string identifying this sandbox.
def upsert_sandbox_scenario(id:, inputs:, label: nil, scenario_id: nil, request_options: nil)
  Async do
    response = @request_client.conn.post do |req|
      req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
      req.headers["X_API_KEY"] = request_options.api_key unless request_options&.api_key.nil?
      req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
      req.body = {
        **(request_options&.additional_body_parameters || {}),
        label: label,
        inputs: inputs,
        scenario_id: scenario_id
      }.compact
      req.url "#{@request_client.default_environment[:Default]}/v1/sandboxes/#{id}/scenarios"
    end
    SandboxScenario.from_json(json_object: response.body)
  end
end