Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "2.7.0"
".": "2.8.0"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 37
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-758c3a2fbd5b7be61c8e6e0ad2e6a5ec30695747bb675960d888c497647d13d7.yml
openapi_spec_hash: 00002d90bde02f67e174368ae470c597
config_hash: 2bea1743c84d63bd61f8501a6ea63065
configured_endpoints: 38
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-155e4761d62255841349c0f8a01b0a9c463ea1d1f2d6c4fd8d1a75c8bef6f226.yml
openapi_spec_hash: ab91f77e7c9d992400cbc7fc8a9e76c1
config_hash: bff282047fafdad771fb7ec685f56944
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 2.8.0 (2026-08-05)

Full Changelog: [v2.7.0...v2.8.0](https://github.com/context-dot-dev/context-ruby-sdk/compare/v2.7.0...v2.8.0)

### Features

* **api:** manual updates ([054713e](https://github.com/context-dot-dev/context-ruby-sdk/commit/054713ecd7a6c12c29a2aaf0df0ea0eeb0ff61fc))

## 2.7.0 (2026-08-01)

Full Changelog: [v2.6.0...v2.7.0](https://github.com/context-dot-dev/context-ruby-sdk/compare/v2.6.0...v2.7.0)
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ GIT
PATH
remote: .
specs:
context.dev (2.7.0)
context.dev (2.8.0)
cgi
connection_pool

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ To use this gem, install via Bundler by adding the following to your application
<!-- x-release-please-start-version -->

```ruby
gem "context.dev", "~> 2.7.0"
gem "context.dev", "~> 2.8.0"
```

<!-- x-release-please-end -->
Expand Down
2 changes: 2 additions & 0 deletions lib/context_dev.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@
require_relative "context_dev/models/brand_retrieve_response"
require_relative "context_dev/models/brand_retrieve_simplified_params"
require_relative "context_dev/models/brand_retrieve_simplified_response"
require_relative "context_dev/models/brand_search_params"
require_relative "context_dev/models/brand_search_response"
require_relative "context_dev/models/crawl_controls"
require_relative "context_dev/models/failure"
require_relative "context_dev/models/industry_retrieve_naics_params"
Expand Down
2 changes: 2 additions & 0 deletions lib/context_dev/models.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ module ContextDev

BrandRetrieveSimplifiedParams = ContextDev::Models::BrandRetrieveSimplifiedParams

BrandSearchParams = ContextDev::Models::BrandSearchParams

CrawlControls = ContextDev::Models::CrawlControls

Failure = ContextDev::Models::Failure
Expand Down
36 changes: 36 additions & 0 deletions lib/context_dev/models/brand_search_params.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# frozen_string_literal: true

module ContextDev
module Models
# @see ContextDev::Resources::Brand#search
class BrandSearchParams < ContextDev::Internal::Type::BaseModel
extend ContextDev::Internal::Type::RequestParameters::Converter
include ContextDev::Internal::Type::RequestParameters

# @!attribute query
# Search term, matched against brand names and domains by prefix (e.g. 'nike',
# 'nike.com', 'nik').
#
# @return [String]
required :query, String

# @!attribute tags
# Optional comma-separated caller-defined tags for tracking this request. Tags are
# recorded on the request's usage log and can be used to filter usage on the
# dashboard usage page. Up to 20 tags, each 1-50 characters.
#
# @return [Array<String>, nil]
optional :tags, ContextDev::Internal::Type::ArrayOf[String]

# @!method initialize(query:, tags: nil, request_options: {})
# Some parameter documentations has been truncated, see
# {ContextDev::Models::BrandSearchParams} for more details.
#
# @param query [String] Search term, matched against brand names and domains by prefix (e.g. 'nike', 'ni
#
# @param tags [Array<String>] Optional comma-separated caller-defined tags for tracking this request. Tags are
#
# @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}]
end
end
end
84 changes: 84 additions & 0 deletions lib/context_dev/models/brand_search_response.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# frozen_string_literal: true

module ContextDev
module Models
# @see ContextDev::Resources::Brand#search
class BrandSearchResponse < ContextDev::Internal::Type::BaseModel
# @!attribute results
# Up to 10 matching brands, most popular first. Empty when nothing matches.
#
# @return [Array<ContextDev::Models::BrandSearchResponse::Result>]
required :results,
-> { ContextDev::Internal::Type::ArrayOf[ContextDev::Models::BrandSearchResponse::Result] }

# @!attribute key_metadata
# Metadata about the API key used for the request. Included in every response
# whenever a valid API key is provided, even when the response status is not 200.
#
# @return [ContextDev::Models::BrandSearchResponse::KeyMetadata, nil]
optional :key_metadata, -> { ContextDev::Models::BrandSearchResponse::KeyMetadata }

# @!method initialize(results:, key_metadata: nil)
# Some parameter documentations has been truncated, see
# {ContextDev::Models::BrandSearchResponse} for more details.
#
# @param results [Array<ContextDev::Models::BrandSearchResponse::Result>] Up to 10 matching brands, most popular first. Empty when nothing matches.
#
# @param key_metadata [ContextDev::Models::BrandSearchResponse::KeyMetadata] Metadata about the API key used for the request. Included in every response when

class Result < ContextDev::Internal::Type::BaseModel
# @!attribute domain
# The brand's domain.
#
# @return [String]
required :domain, String

# @!attribute logo
# Logo link URL that serves the brand's logo, generated per request for the
# calling organization.
#
# @return [String]
required :logo, String

# @!attribute name
# The brand's name. Empty string when unknown.
#
# @return [String]
required :name, String

# @!method initialize(domain:, logo:, name:)
# Some parameter documentations has been truncated, see
# {ContextDev::Models::BrandSearchResponse::Result} for more details.
#
# @param domain [String] The brand's domain.
#
# @param logo [String] Logo link URL that serves the brand's logo, generated per request for the callin
#
# @param name [String] The brand's name. Empty string when unknown.
end

# @see ContextDev::Models::BrandSearchResponse#key_metadata
class KeyMetadata < ContextDev::Internal::Type::BaseModel
# @!attribute credits_consumed
# The number of credits consumed by this request.
#
# @return [Integer]
required :credits_consumed, Integer

# @!attribute credits_remaining
# The number of credits remaining for your organization after this request.
#
# @return [Integer]
required :credits_remaining, Integer

# @!method initialize(credits_consumed:, credits_remaining:)
# Metadata about the API key used for the request. Included in every response
# whenever a valid API key is provided, even when the response status is not 200.
#
# @param credits_consumed [Integer] The number of credits consumed by this request.
#
# @param credits_remaining [Integer] The number of credits remaining for your organization after this request.
end
end
end
end
34 changes: 34 additions & 0 deletions lib/context_dev/resources/brand.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,40 @@ def retrieve_simplified(params)
)
end

# Some parameter documentations has been truncated, see
# {ContextDev::Models::BrandSearchParams} for more details.
#
# Search brands by name or domain and get back up to 10 lightweight matches
# (domain, name, logo), most popular first: by Tranco rank, then market cap for
# brands outside the Tranco list, with text relevance breaking ties. Matching is
# prefix-based with no typo tolerance, so it is suited to autocomplete. Only
# brands already in the Context.dev index are returned — use /brand/retrieve to
# fetch (and index) a specific domain. Free on Pro and Scale plans; costs 1 credit
# per request on the Free and Starter plans.
#
# @overload search(query:, tags: nil, request_options: {})
#
# @param query [String] Search term, matched against brand names and domains by prefix (e.g. 'nike', 'ni
#
# @param tags [Array<String>] Optional comma-separated caller-defined tags for tracking this request. Tags are
#
# @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
#
# @return [ContextDev::Models::BrandSearchResponse]
#
# @see ContextDev::Models::BrandSearchParams
def search(params)
parsed, options = ContextDev::BrandSearchParams.dump_request(params)
query = ContextDev::Internal::Util.encode_query_params(parsed)
@client.request(
method: :get,
path: "brand/search",
query: query,
model: ContextDev::Models::BrandSearchResponse,
options: options
)
end

# @api private
#
# @param client [ContextDev::Client]
Expand Down
2 changes: 1 addition & 1 deletion lib/context_dev/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module ContextDev
VERSION = "2.7.0"
VERSION = "2.8.0"
end
2 changes: 2 additions & 0 deletions rbi/context_dev/models.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ module ContextDev
BrandRetrieveSimplifiedParams =
ContextDev::Models::BrandRetrieveSimplifiedParams

BrandSearchParams = ContextDev::Models::BrandSearchParams

CrawlControls = ContextDev::Models::CrawlControls

Failure = ContextDev::Models::Failure
Expand Down
60 changes: 60 additions & 0 deletions rbi/context_dev/models/brand_search_params.rbi
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# typed: strong

module ContextDev
module Models
class BrandSearchParams < ContextDev::Internal::Type::BaseModel
extend ContextDev::Internal::Type::RequestParameters::Converter
include ContextDev::Internal::Type::RequestParameters

OrHash =
T.type_alias do
T.any(ContextDev::BrandSearchParams, ContextDev::Internal::AnyHash)
end

# Search term, matched against brand names and domains by prefix (e.g. 'nike',
# 'nike.com', 'nik').
sig { returns(String) }
attr_accessor :query

# Optional comma-separated caller-defined tags for tracking this request. Tags are
# recorded on the request's usage log and can be used to filter usage on the
# dashboard usage page. Up to 20 tags, each 1-50 characters.
sig { returns(T.nilable(T::Array[String])) }
attr_reader :tags

sig { params(tags: T::Array[String]).void }
attr_writer :tags

sig do
params(
query: String,
tags: T::Array[String],
request_options: ContextDev::RequestOptions::OrHash
).returns(T.attached_class)
end
def self.new(
# Search term, matched against brand names and domains by prefix (e.g. 'nike',
# 'nike.com', 'nik').
query:,
# Optional comma-separated caller-defined tags for tracking this request. Tags are
# recorded on the request's usage log and can be used to filter usage on the
# dashboard usage page. Up to 20 tags, each 1-50 characters.
tags: nil,
request_options: {}
)
end

sig do
override.returns(
{
query: String,
tags: T::Array[String],
request_options: ContextDev::RequestOptions
}
)
end
def to_hash
end
end
end
end
Loading