Class: ContextDev::Resources::Brand

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

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Brand

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 Brand.

Parameters:



250
251
252
# File 'lib/context_dev/resources/brand.rb', line 250

def initialize(client:)
  @client = client
end

Instance Method Details

#identify_from_transaction(transaction_info:, city: nil, country_gl: nil, force_language: nil, high_confidence_only: nil, max_speed: nil, mcc: nil, phone: nil, timeout_ms: nil, request_options: {}) ⇒ ContextDev::Models::BrandIdentifyFromTransactionResponse

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

Endpoint specially designed for platforms that want to identify transaction data by the transaction title.

Parameters:

  • transaction_info (String)

    Transaction information to identify the brand

  • city (String)

    Optional city name to prioritize when searching for the brand.

  • country_gl (Symbol, ContextDev::Models::BrandIdentifyFromTransactionParams::CountryGl)

    Optional country code (GL parameter) to specify the country. This affects the ge

  • force_language (Symbol, ContextDev::Models::BrandIdentifyFromTransactionParams::ForceLanguage)

    Optional parameter to force the language of the retrieved brand data.

  • high_confidence_only (Boolean)

    When set to true, the API will perform an additional verification steps to ensur

  • max_speed (Boolean)

    Optional parameter to optimize the API call for maximum speed. When set to true,

  • mcc (String)

    Optional Merchant Category Code (MCC) to help identify the business category/ind

  • phone (Float)

    Optional phone number from the transaction to help verify brand match.

  • 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:



70
71
72
73
74
75
76
77
78
79
80
# File 'lib/context_dev/resources/brand.rb', line 70

def identify_from_transaction(params)
  parsed, options = ContextDev::BrandIdentifyFromTransactionParams.dump_request(params)
  query = ContextDev::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "brand/transaction_identifier",
    query: query.transform_keys(max_speed: "maxSpeed", timeout_ms: "timeoutMS"),
    model: ContextDev::Models::BrandIdentifyFromTransactionResponse,
    options: options
  )
end

#retrieve(domain:, force_language: nil, max_speed: nil, timeout_ms: nil, request_options: {}) ⇒ ContextDev::Models::BrandRetrieveResponse

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

Retrieve logos, backdrops, colors, industry, description, and more from any domain

Parameters:

  • domain (String)

    Domain name to retrieve brand data for (e.g., ‘example.com’, ‘google.com’). Cann

  • force_language (Symbol, ContextDev::Models::BrandRetrieveParams::ForceLanguage)

    Optional parameter to force the language of the retrieved brand data.

  • max_speed (Boolean)

    Optional parameter to optimize the API call for maximum speed. When set to true,

  • 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:



27
28
29
30
31
32
33
34
35
36
37
# File 'lib/context_dev/resources/brand.rb', line 27

def retrieve(params)
  parsed, options = ContextDev::BrandRetrieveParams.dump_request(params)
  query = ContextDev::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "brand/retrieve",
    query: query.transform_keys(max_speed: "maxSpeed", timeout_ms: "timeoutMS"),
    model: ContextDev::Models::BrandRetrieveResponse,
    options: options
  )
end

#retrieve_by_email(email:, force_language: nil, max_speed: nil, timeout_ms: nil, request_options: {}) ⇒ ContextDev::Models::BrandRetrieveByEmailResponse

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

Retrieve brand information using an email address while detecting disposable and free email addresses. Disposable and free email addresses (like gmail.com, yahoo.com) will throw a 422 error.

Parameters:

  • email (String)

    Email address to retrieve brand data for (e.g., ‘contact@example.com’). The doma

  • force_language (Symbol, ContextDev::Models::BrandRetrieveByEmailParams::ForceLanguage)

    Optional parameter to force the language of the retrieved brand data.

  • max_speed (Boolean)

    Optional parameter to optimize the API call for maximum speed. When set to true,

  • 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:



104
105
106
107
108
109
110
111
112
113
114
# File 'lib/context_dev/resources/brand.rb', line 104

def retrieve_by_email(params)
  parsed, options = ContextDev::BrandRetrieveByEmailParams.dump_request(params)
  query = ContextDev::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "brand/retrieve-by-email",
    query: query.transform_keys(max_speed: "maxSpeed", timeout_ms: "timeoutMS"),
    model: ContextDev::Models::BrandRetrieveByEmailResponse,
    options: options
  )
end

#retrieve_by_isin(isin:, force_language: nil, max_speed: nil, timeout_ms: nil, request_options: {}) ⇒ ContextDev::Models::BrandRetrieveByIsinResponse

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

Retrieve brand information using an ISIN (International Securities Identification Number).

Parameters:

  • isin (String)

    ISIN (International Securities Identification Number) to retrieve brand data for

  • force_language (Symbol, ContextDev::Models::BrandRetrieveByIsinParams::ForceLanguage)

    Optional parameter to force the language of the retrieved brand data.

  • max_speed (Boolean)

    Optional parameter to optimize the API call for maximum speed. When set to true,

  • 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:



137
138
139
140
141
142
143
144
145
146
147
# File 'lib/context_dev/resources/brand.rb', line 137

def retrieve_by_isin(params)
  parsed, options = ContextDev::BrandRetrieveByIsinParams.dump_request(params)
  query = ContextDev::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "brand/retrieve-by-isin",
    query: query.transform_keys(max_speed: "maxSpeed", timeout_ms: "timeoutMS"),
    model: ContextDev::Models::BrandRetrieveByIsinResponse,
    options: options
  )
end

#retrieve_by_name(name:, country_gl: nil, force_language: nil, max_speed: nil, timeout_ms: nil, request_options: {}) ⇒ ContextDev::Models::BrandRetrieveByNameResponse

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

Retrieve brand information using a company name.

Parameters:

  • name (String)

    Company name to retrieve brand data for (e.g., ‘Apple Inc’, ‘Microsoft Corporati

  • country_gl (Symbol, ContextDev::Models::BrandRetrieveByNameParams::CountryGl)

    Optional country code hint (GL parameter) to specify the country for the company

  • force_language (Symbol, ContextDev::Models::BrandRetrieveByNameParams::ForceLanguage)

    Optional parameter to force the language of the retrieved brand data.

  • max_speed (Boolean)

    Optional parameter to optimize the API call for maximum speed. When set to true,

  • 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:



171
172
173
174
175
176
177
178
179
180
181
# File 'lib/context_dev/resources/brand.rb', line 171

def retrieve_by_name(params)
  parsed, options = ContextDev::BrandRetrieveByNameParams.dump_request(params)
  query = ContextDev::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "brand/retrieve-by-name",
    query: query.transform_keys(max_speed: "maxSpeed", timeout_ms: "timeoutMS"),
    model: ContextDev::Models::BrandRetrieveByNameResponse,
    options: options
  )
end

#retrieve_by_ticker(ticker:, force_language: nil, max_speed: nil, ticker_exchange: nil, timeout_ms: nil, request_options: {}) ⇒ ContextDev::Models::BrandRetrieveByTickerResponse

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

Retrieve brand information using a stock ticker symbol.

Parameters:

Returns:

See Also:



205
206
207
208
209
210
211
212
213
214
215
# File 'lib/context_dev/resources/brand.rb', line 205

def retrieve_by_ticker(params)
  parsed, options = ContextDev::BrandRetrieveByTickerParams.dump_request(params)
  query = ContextDev::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "brand/retrieve-by-ticker",
    query: query.transform_keys(max_speed: "maxSpeed", timeout_ms: "timeoutMS"),
    model: ContextDev::Models::BrandRetrieveByTickerResponse,
    options: options
  )
end

#retrieve_simplified(domain:, timeout_ms: nil, request_options: {}) ⇒ ContextDev::Models::BrandRetrieveSimplifiedResponse

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

Returns a simplified version of brand data containing only essential information: domain, title, colors, logos, and backdrops. Optimized for faster responses and reduced data transfer.

Parameters:

  • domain (String)

    Domain name to retrieve simplified brand data for

  • 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:



235
236
237
238
239
240
241
242
243
244
245
# File 'lib/context_dev/resources/brand.rb', line 235

def retrieve_simplified(params)
  parsed, options = ContextDev::BrandRetrieveSimplifiedParams.dump_request(params)
  query = ContextDev::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "brand/retrieve-simplified",
    query: query.transform_keys(timeout_ms: "timeoutMS"),
    model: ContextDev::Models::BrandRetrieveSimplifiedResponse,
    options: options
  )
end