Class: Mindee::V2::Product::Split::Params::SplitParameters

Inherits:
Input::BaseParameters show all
Defined in:
lib/mindee/v2/product/split/params/split_parameters.rb

Overview

Parameters accepted by the split utility v2 endpoint.

Instance Attribute Summary

Attributes inherited from Input::BaseParameters

#close_file, #file_alias, #model_id, #polling_options, #webhook_ids

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Input::BaseParameters

#append_form_data, load_from_hash, #slug, #validate_async_params

Constructor Details

#initialize(model_id, file_alias: nil, webhook_ids: nil, polling_options: nil, close_file: true) ⇒ SplitParameters

Returns a new instance of SplitParameters.

Parameters:

  • model_id (String)

    ID of the model

  • file_alias (String, nil) (defaults to: nil)

    File alias, if applicable.

  • webhook_ids (Array<String>, nil) (defaults to: nil)

    List of webhook IDs to propagate the API response to.

  • polling_options (Hash, nil) (defaults to: nil)

    Options for polling. Set only if having timeout issues.

  • close_file (Boolean, nil) (defaults to: true)

    Whether to close the file after parsing.



22
23
24
25
26
27
28
29
30
# File 'lib/mindee/v2/product/split/params/split_parameters.rb', line 22

def initialize(
  model_id,
  file_alias: nil,
  webhook_ids: nil,
  polling_options: nil,
  close_file: true
)
  super
end

Class Method Details

.from_hash(params: {}) ⇒ SplitParameters

Loads the parameters from a Hash.

Parameters:

  • params (Hash) (defaults to: {})

    Parameters to provide as a hash.

Returns:



35
36
37
38
39
40
41
42
# File 'lib/mindee/v2/product/split/params/split_parameters.rb', line 35

def self.from_hash(params: {})
  SplitParameters.new(
    params.fetch(:model_id),
    file_alias: params.fetch(:file_alias, nil),
    webhook_ids: params.fetch(:webhook_ids, nil),
    close_file: params.fetch(:close_file, true)
  )
end

.slugString

Returns Slug for the endpoint.

Returns:

  • (String)

    Slug for the endpoint.



13
14
15
# File 'lib/mindee/v2/product/split/params/split_parameters.rb', line 13

def self.slug
  'split'
end