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:



85
86
87
# File 'lib/context_dev/resources/industry.rb', line 85

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

#retrieve_sic(input:, max_results: nil, min_results: nil, timeout_ms: nil, type: nil, request_options: {}) ⇒ ContextDev::Models::IndustryRetrieveSicResponse

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

Classify any brand into Standard Industrial Classification (SIC) codes from its domain or name. Choose between the original 1987 SIC system (‘original_sic`) or the latest SIC list maintained by the SEC (`latest_sec`).

Parameters:

  • input (String)

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

  • max_results (Integer)

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

  • min_results (Integer)

    Minimum number of SIC 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

  • type (Symbol, ContextDev::Models::IndustryRetrieveSicParams::Type)

    Which SIC dataset to classify against. ‘original_sic` uses the 1987 Standard Ind

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

Returns:

See Also:



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/context_dev/resources/industry.rb', line 66

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