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 @@
{
".": "1.1.0"
".": "1.2.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: 6
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brand-dev%2Fbrand.dev-c921d60adf854da13dbb83d547cbd8a32fd86d625fb12a325b7d305da7f3a93a.yml
openapi_spec_hash: c02b88f26faaf9fd04177b77d34fd5c3
config_hash: 372b187172495fc2f76f05ba016b4a45
configured_endpoints: 7
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brand-dev%2Fbrand.dev-1f1bc5d70a89b56425a3bafbc06a80c233300b5d5d64438aa633597085a45974.yml
openapi_spec_hash: e87e758c5f59476e0ec486fa59455d60
config_hash: bb3f3ba0dca413263e40968648f9a1a6
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 1.2.0 (2025-06-06)

Full Changelog: [v1.1.0...v1.2.0](https://github.com/brand-dot-dev/python-sdk/compare/v1.1.0...v1.2.0)

### Features

* **api:** manual updates ([9039f16](https://github.com/brand-dot-dev/python-sdk/commit/9039f1632ed997579d6ab4f55a83adcf2fbc3fce))

## 1.1.0 (2025-06-03)

Full Changelog: [v1.0.0...v1.1.0](https://github.com/brand-dot-dev/python-sdk/compare/v1.0.0...v1.1.0)
Expand Down
2 changes: 2 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ from brand.dev.types import (
BrandRetrieveResponse,
BrandAIQueryResponse,
BrandIdentifyFromTransactionResponse,
BrandPrefetchResponse,
BrandRetrieveByTickerResponse,
BrandRetrieveNaicsResponse,
BrandSearchResponse,
Expand All @@ -18,6 +19,7 @@ Methods:
- <code title="get /brand/retrieve">client.brand.<a href="./src/brand/dev/resources/brand.py">retrieve</a>(\*\*<a href="src/brand/dev/types/brand_retrieve_params.py">params</a>) -> <a href="./src/brand/dev/types/brand_retrieve_response.py">BrandRetrieveResponse</a></code>
- <code title="post /brand/ai/query">client.brand.<a href="./src/brand/dev/resources/brand.py">ai_query</a>(\*\*<a href="src/brand/dev/types/brand_ai_query_params.py">params</a>) -> <a href="./src/brand/dev/types/brand_ai_query_response.py">BrandAIQueryResponse</a></code>
- <code title="get /brand/transaction_identifier">client.brand.<a href="./src/brand/dev/resources/brand.py">identify_from_transaction</a>(\*\*<a href="src/brand/dev/types/brand_identify_from_transaction_params.py">params</a>) -> <a href="./src/brand/dev/types/brand_identify_from_transaction_response.py">BrandIdentifyFromTransactionResponse</a></code>
- <code title="post /brand/prefetch">client.brand.<a href="./src/brand/dev/resources/brand.py">prefetch</a>(\*\*<a href="src/brand/dev/types/brand_prefetch_params.py">params</a>) -> <a href="./src/brand/dev/types/brand_prefetch_response.py">BrandPrefetchResponse</a></code>
- <code title="get /brand/retrieve-by-ticker">client.brand.<a href="./src/brand/dev/resources/brand.py">retrieve_by_ticker</a>(\*\*<a href="src/brand/dev/types/brand_retrieve_by_ticker_params.py">params</a>) -> <a href="./src/brand/dev/types/brand_retrieve_by_ticker_response.py">BrandRetrieveByTickerResponse</a></code>
- <code title="get /brand/naics">client.brand.<a href="./src/brand/dev/resources/brand.py">retrieve_naics</a>(\*\*<a href="src/brand/dev/types/brand_retrieve_naics_params.py">params</a>) -> <a href="./src/brand/dev/types/brand_retrieve_naics_response.py">BrandRetrieveNaicsResponse</a></code>
- <code title="get /brand/search">client.brand.<a href="./src/brand/dev/resources/brand.py">search</a>(\*\*<a href="src/brand/dev/types/brand_search_params.py">params</a>) -> <a href="./src/brand/dev/types/brand_search_response.py">BrandSearchResponse</a></code>
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "brand.dev"
version = "1.1.0"
version = "1.2.0"
description = "The official Python library for the brand.dev API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion src/brand/dev/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "brand.dev"
__version__ = "1.1.0" # x-release-please-version
__version__ = "1.2.0" # x-release-please-version
88 changes: 88 additions & 0 deletions src/brand/dev/resources/brand.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from ..types import (
brand_search_params,
brand_ai_query_params,
brand_prefetch_params,
brand_retrieve_params,
brand_retrieve_naics_params,
brand_retrieve_by_ticker_params,
Expand All @@ -28,6 +29,7 @@
from .._base_client import make_request_options
from ..types.brand_search_response import BrandSearchResponse
from ..types.brand_ai_query_response import BrandAIQueryResponse
from ..types.brand_prefetch_response import BrandPrefetchResponse
from ..types.brand_retrieve_response import BrandRetrieveResponse
from ..types.brand_retrieve_naics_response import BrandRetrieveNaicsResponse
from ..types.brand_retrieve_by_ticker_response import BrandRetrieveByTickerResponse
Expand Down Expand Up @@ -247,6 +249,43 @@ def identify_from_transaction(
cast_to=BrandIdentifyFromTransactionResponse,
)

def prefetch(
self,
*,
domain: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> BrandPrefetchResponse:
"""
Signal that you may fetch brand data for a particular domain soon to improve
latency. This endpoint does not charge credits and is available for paid
customers to optimize future requests. [You must be on a paid plan to use this
endpoint]

Args:
domain: Domain name to prefetch brand data for

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
return self._post(
"/brand/prefetch",
body=maybe_transform({"domain": domain}, brand_prefetch_params.BrandPrefetchParams),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=BrandPrefetchResponse,
)

def retrieve_by_ticker(
self,
*,
Expand Down Expand Up @@ -573,6 +612,43 @@ async def identify_from_transaction(
cast_to=BrandIdentifyFromTransactionResponse,
)

async def prefetch(
self,
*,
domain: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> BrandPrefetchResponse:
"""
Signal that you may fetch brand data for a particular domain soon to improve
latency. This endpoint does not charge credits and is available for paid
customers to optimize future requests. [You must be on a paid plan to use this
endpoint]

Args:
domain: Domain name to prefetch brand data for

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
return await self._post(
"/brand/prefetch",
body=await async_maybe_transform({"domain": domain}, brand_prefetch_params.BrandPrefetchParams),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=BrandPrefetchResponse,
)

async def retrieve_by_ticker(
self,
*,
Expand Down Expand Up @@ -705,6 +781,9 @@ def __init__(self, brand: BrandResource) -> None:
self.identify_from_transaction = to_raw_response_wrapper(
brand.identify_from_transaction,
)
self.prefetch = to_raw_response_wrapper(
brand.prefetch,
)
self.retrieve_by_ticker = to_raw_response_wrapper(
brand.retrieve_by_ticker,
)
Expand All @@ -729,6 +808,9 @@ def __init__(self, brand: AsyncBrandResource) -> None:
self.identify_from_transaction = async_to_raw_response_wrapper(
brand.identify_from_transaction,
)
self.prefetch = async_to_raw_response_wrapper(
brand.prefetch,
)
self.retrieve_by_ticker = async_to_raw_response_wrapper(
brand.retrieve_by_ticker,
)
Expand All @@ -753,6 +835,9 @@ def __init__(self, brand: BrandResource) -> None:
self.identify_from_transaction = to_streamed_response_wrapper(
brand.identify_from_transaction,
)
self.prefetch = to_streamed_response_wrapper(
brand.prefetch,
)
self.retrieve_by_ticker = to_streamed_response_wrapper(
brand.retrieve_by_ticker,
)
Expand All @@ -777,6 +862,9 @@ def __init__(self, brand: AsyncBrandResource) -> None:
self.identify_from_transaction = async_to_streamed_response_wrapper(
brand.identify_from_transaction,
)
self.prefetch = async_to_streamed_response_wrapper(
brand.prefetch,
)
self.retrieve_by_ticker = async_to_streamed_response_wrapper(
brand.retrieve_by_ticker,
)
Expand Down
2 changes: 2 additions & 0 deletions src/brand/dev/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@

from .brand_search_params import BrandSearchParams as BrandSearchParams
from .brand_ai_query_params import BrandAIQueryParams as BrandAIQueryParams
from .brand_prefetch_params import BrandPrefetchParams as BrandPrefetchParams
from .brand_retrieve_params import BrandRetrieveParams as BrandRetrieveParams
from .brand_search_response import BrandSearchResponse as BrandSearchResponse
from .brand_ai_query_response import BrandAIQueryResponse as BrandAIQueryResponse
from .brand_prefetch_response import BrandPrefetchResponse as BrandPrefetchResponse
from .brand_retrieve_response import BrandRetrieveResponse as BrandRetrieveResponse
from .brand_retrieve_naics_params import BrandRetrieveNaicsParams as BrandRetrieveNaicsParams
from .brand_retrieve_naics_response import BrandRetrieveNaicsResponse as BrandRetrieveNaicsResponse
Expand Down
12 changes: 12 additions & 0 deletions src/brand/dev/types/brand_prefetch_params.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from __future__ import annotations

from typing_extensions import Required, TypedDict

__all__ = ["BrandPrefetchParams"]


class BrandPrefetchParams(TypedDict, total=False):
domain: Required[str]
"""Domain name to prefetch brand data for"""
18 changes: 18 additions & 0 deletions src/brand/dev/types/brand_prefetch_response.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import Optional

from .._models import BaseModel

__all__ = ["BrandPrefetchResponse"]


class BrandPrefetchResponse(BaseModel):
domain: Optional[str] = None
"""The domain that was queued for prefetching"""

message: Optional[str] = None
"""Success message"""

status: Optional[str] = None
"""Status of the response, e.g., 'ok'"""
69 changes: 69 additions & 0 deletions tests/api_resources/test_brand.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from brand.dev.types import (
BrandSearchResponse,
BrandAIQueryResponse,
BrandPrefetchResponse,
BrandRetrieveResponse,
BrandRetrieveNaicsResponse,
BrandRetrieveByTickerResponse,
Expand Down Expand Up @@ -185,6 +186,40 @@ def test_streaming_response_identify_from_transaction(self, client: BrandDev) ->

assert cast(Any, response.is_closed) is True

@pytest.mark.skip()
@parametrize
def test_method_prefetch(self, client: BrandDev) -> None:
brand = client.brand.prefetch(
domain="domain",
)
assert_matches_type(BrandPrefetchResponse, brand, path=["response"])

@pytest.mark.skip()
@parametrize
def test_raw_response_prefetch(self, client: BrandDev) -> None:
response = client.brand.with_raw_response.prefetch(
domain="domain",
)

assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
brand = response.parse()
assert_matches_type(BrandPrefetchResponse, brand, path=["response"])

@pytest.mark.skip()
@parametrize
def test_streaming_response_prefetch(self, client: BrandDev) -> None:
with client.brand.with_streaming_response.prefetch(
domain="domain",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"

brand = response.parse()
assert_matches_type(BrandPrefetchResponse, brand, path=["response"])

assert cast(Any, response.is_closed) is True

@pytest.mark.skip()
@parametrize
def test_method_retrieve_by_ticker(self, client: BrandDev) -> None:
Expand Down Expand Up @@ -452,6 +487,40 @@ async def test_streaming_response_identify_from_transaction(self, async_client:

assert cast(Any, response.is_closed) is True

@pytest.mark.skip()
@parametrize
async def test_method_prefetch(self, async_client: AsyncBrandDev) -> None:
brand = await async_client.brand.prefetch(
domain="domain",
)
assert_matches_type(BrandPrefetchResponse, brand, path=["response"])

@pytest.mark.skip()
@parametrize
async def test_raw_response_prefetch(self, async_client: AsyncBrandDev) -> None:
response = await async_client.brand.with_raw_response.prefetch(
domain="domain",
)

assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
brand = await response.parse()
assert_matches_type(BrandPrefetchResponse, brand, path=["response"])

@pytest.mark.skip()
@parametrize
async def test_streaming_response_prefetch(self, async_client: AsyncBrandDev) -> None:
async with async_client.brand.with_streaming_response.prefetch(
domain="domain",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"

brand = await response.parse()
assert_matches_type(BrandPrefetchResponse, brand, path=["response"])

assert cast(Any, response.is_closed) is True

@pytest.mark.skip()
@parametrize
async def test_method_retrieve_by_ticker(self, async_client: AsyncBrandDev) -> None:
Expand Down