Class: RunApi::Core::RequestOptions

Inherits:
Struct
  • Object
show all
Defined in:
lib/runapi/core/types.rb

Overview

Per-request options that override client-level defaults.

Examples:

client.text_to_image.run(
  { prompt: "A sunset" },
  options: RequestOptions.new(timeout: 30, headers: { "X-Custom" => "value" })
)

Instance Attribute Summary collapse

Instance Attribute Details

#headersHash<String, String>?

Returns Additional HTTP headers. Merged with client-level headers.

Returns:

  • (Hash<String, String>, nil)

    Additional HTTP headers. Merged with client-level headers.



75
76
77
78
79
80
# File 'lib/runapi/core/types.rb', line 75

RequestOptions = Struct.new(
  :headers,
  :timeout,
  :max_retries,
  keyword_init: true
)

#max_retriesInteger?

Returns Maximum retry attempts. Overrides client-level max_retries.

Returns:

  • (Integer, nil)

    Maximum retry attempts. Overrides client-level max_retries.



75
76
77
78
79
80
# File 'lib/runapi/core/types.rb', line 75

RequestOptions = Struct.new(
  :headers,
  :timeout,
  :max_retries,
  keyword_init: true
)

#timeoutInteger?

Returns Request timeout in seconds. Overrides client-level timeout.

Returns:

  • (Integer, nil)

    Request timeout in seconds. Overrides client-level timeout.



75
76
77
78
79
80
# File 'lib/runapi/core/types.rb', line 75

RequestOptions = Struct.new(
  :headers,
  :timeout,
  :max_retries,
  keyword_init: true
)