Class: ContextDev::Resources::Industry

Inherits:
Object
  • Object
show all
Defined in:
lib/context_dev/resources/industry.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Industry

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Industry.

Parameters:



45
46
47
# File 'lib/context_dev/resources/industry.rb', line 45

def initialize(client:)
  @client = client
end

Instance Method Details

#retrieve_naics(input:, max_results: nil, min_results: nil, timeout_ms: nil, request_options: {}) ⇒ ContextDev::Models::IndustryRetrieveNaicsResponse

Some parameter documentations has been truncated, see Models::IndustryRetrieveNaicsParams for more details.

Classify any brand into 2022 NAICS industry codes from its domain or name.

Parameters:

  • input (String)

    Brand domain or title to retrieve NAICS code for. If a valid domain is provided,

  • max_results (Integer)

    Maximum number of NAICS codes to return. Must be between 1 and 10. Defaults to 5

  • min_results (Integer)

    Minimum number of NAICS codes to return. Must be at least 1. Defaults to 1.

  • timeout_ms (Integer)

    Optional timeout in milliseconds for the request. If the request takes longer th

  • request_options (ContextDev::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/context_dev/resources/industry.rb', line 26

def retrieve_naics(params)
  parsed, options = ContextDev::IndustryRetrieveNaicsParams.dump_request(params)
  query = ContextDev::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "web/naics",
    query: query.transform_keys(
      max_results: "maxResults",
      min_results: "minResults",
      timeout_ms: "timeoutMS"
    ),
    model: ContextDev::Models::IndustryRetrieveNaicsResponse,
    options: options
  )
end