Class: Algolia::TransformationOptions
- Inherits:
-
Object
- Object
- Algolia::TransformationOptions
- Defined in:
- lib/algolia/api/search_client.rb
Overview
Configuration options for the ingestion transporter used by *_with_transformation helpers. When passed to SearchClient.with_transformation or set via set_transformation_options, the ingestion transporter is eagerly created using Ingestion API defaults (25s timeouts, no compression). Only fields explicitly set here override those defaults. See www.algolia.com/doc/libraries/ruby/v3/methods/ingestion
Instance Attribute Summary collapse
-
#compression_type ⇒ Object
Returns the value of attribute compression_type.
-
#connect_timeout ⇒ Object
Returns the value of attribute connect_timeout.
-
#header_params ⇒ Object
Returns the value of attribute header_params.
-
#hosts ⇒ Object
Returns the value of attribute hosts.
-
#read_timeout ⇒ Object
Returns the value of attribute read_timeout.
-
#region ⇒ Object
Returns the value of attribute region.
-
#write_timeout ⇒ Object
Returns the value of attribute write_timeout.
Instance Method Summary collapse
-
#initialize(region, opts = {}) ⇒ TransformationOptions
constructor
A new instance of TransformationOptions.
Constructor Details
#initialize(region, opts = {}) ⇒ TransformationOptions
Returns a new instance of TransformationOptions.
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/algolia/api/search_client.rb', line 25 def initialize(region, opts = {}) if region.nil? || region.to_s.strip.empty? raise( ArgumentError, "`region` is required in `TransformationOptions`. See https://www.algolia.com/doc/libraries/ruby/v3/methods/ingestion" ) end valid_keys = %i[connect_timeout read_timeout write_timeout hosts compression_type header_params] unknown = opts.keys - valid_keys unless unknown.empty? raise( ArgumentError, "Unknown TransformationOptions keys: #{unknown.join(", ")}. Valid keys are: #{valid_keys.join(", ")}" ) end @region = region @connect_timeout = opts[:connect_timeout] @read_timeout = opts[:read_timeout] @write_timeout = opts[:write_timeout] @hosts = opts[:hosts] @compression_type = opts[:compression_type] @header_params = opts[:header_params] end |
Instance Attribute Details
#compression_type ⇒ Object
Returns the value of attribute compression_type.
15 16 17 |
# File 'lib/algolia/api/search_client.rb', line 15 def compression_type @compression_type end |
#connect_timeout ⇒ Object
Returns the value of attribute connect_timeout.
15 16 17 |
# File 'lib/algolia/api/search_client.rb', line 15 def connect_timeout @connect_timeout end |
#header_params ⇒ Object
Returns the value of attribute header_params.
15 16 17 |
# File 'lib/algolia/api/search_client.rb', line 15 def header_params @header_params end |
#hosts ⇒ Object
Returns the value of attribute hosts.
15 16 17 |
# File 'lib/algolia/api/search_client.rb', line 15 def hosts @hosts end |
#read_timeout ⇒ Object
Returns the value of attribute read_timeout.
15 16 17 |
# File 'lib/algolia/api/search_client.rb', line 15 def read_timeout @read_timeout end |
#region ⇒ Object
Returns the value of attribute region.
15 16 17 |
# File 'lib/algolia/api/search_client.rb', line 15 def region @region end |
#write_timeout ⇒ Object
Returns the value of attribute write_timeout.
15 16 17 |
# File 'lib/algolia/api/search_client.rb', line 15 def write_timeout @write_timeout end |