diff --git a/.gitignore b/.gitignore index 87797408..95ceb189 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ .prism.log -.vscode _dev __pycache__ diff --git a/.release-please-manifest.json b/.release-please-manifest.json index e8fdcd65..caf14871 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.10.1" + ".": "1.11.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 2a58fb88..8e1aa707 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 9 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brand-dev%2Fbrand.dev-70f44e886c51bd700af031ad9b5c8f0042ef15fde038ba83ed08f61cd9d05266.yml -openapi_spec_hash: 9b834ba9e373689a8e2fbd8312b1f2de +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brand-dev%2Fbrand.dev-a41dc66f0aa3dbc9e8fe1da75f1101cbcb2fac79f728de42e4877cfe1bde3b6e.yml +openapi_spec_hash: 63c1a53e0899fb63a514dad395fd48f9 config_hash: 4b10254ea5b8e26ce632222b94a918aa diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..5b010307 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "python.analysis.importFormat": "relative", +} diff --git a/CHANGELOG.md b/CHANGELOG.md index 559e27ab..bcf33fb2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog +## 1.11.0 (2025-07-31) + +Full Changelog: [v1.10.1...v1.11.0](https://github.com/brand-dot-dev/python-sdk/compare/v1.10.1...v1.11.0) + +### Features + +* **api:** manual updates ([59f9ac6](https://github.com/brand-dot-dev/python-sdk/commit/59f9ac61748a337bcbec52a0034f06cac9e1b3d9)) +* **api:** manual updates ([59002c5](https://github.com/brand-dot-dev/python-sdk/commit/59002c5632848838141179929202e55c3c53d6a9)) +* **client:** support file upload requests ([5a700a4](https://github.com/brand-dot-dev/python-sdk/commit/5a700a45169a4bf3e13f7d27fd1eb0698db48b53)) + + +### Chores + +* **project:** add settings file for vscode ([5218747](https://github.com/brand-dot-dev/python-sdk/commit/5218747ee50439e600cfb756f14364d9a7e7aef3)) + ## 1.10.1 (2025-07-23) Full Changelog: [v1.10.0...v1.10.1](https://github.com/brand-dot-dev/python-sdk/compare/v1.10.0...v1.10.1) diff --git a/pyproject.toml b/pyproject.toml index 72e6d2cf..2fa06216 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "brand.dev" -version = "1.10.1" +version = "1.11.0" description = "The official Python library for the brand.dev API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/brand/dev/_base_client.py b/src/brand/dev/_base_client.py index fcf0f405..5687adf1 100644 --- a/src/brand/dev/_base_client.py +++ b/src/brand/dev/_base_client.py @@ -532,7 +532,10 @@ def _build_request( is_body_allowed = options.method.lower() != "get" if is_body_allowed: - kwargs["json"] = json_data if is_given(json_data) else None + if isinstance(json_data, bytes): + kwargs["content"] = json_data + else: + kwargs["json"] = json_data if is_given(json_data) else None kwargs["files"] = files else: headers.pop("Content-Type", None) diff --git a/src/brand/dev/_files.py b/src/brand/dev/_files.py index 715cc207..cc14c14f 100644 --- a/src/brand/dev/_files.py +++ b/src/brand/dev/_files.py @@ -69,12 +69,12 @@ def _transform_file(file: FileTypes) -> HttpxFileTypes: return file if is_tuple_t(file): - return (file[0], _read_file_content(file[1]), *file[2:]) + return (file[0], read_file_content(file[1]), *file[2:]) raise TypeError(f"Expected file types input to be a FileContent type or to be a tuple") -def _read_file_content(file: FileContent) -> HttpxFileContent: +def read_file_content(file: FileContent) -> HttpxFileContent: if isinstance(file, os.PathLike): return pathlib.Path(file).read_bytes() return file @@ -111,12 +111,12 @@ async def _async_transform_file(file: FileTypes) -> HttpxFileTypes: return file if is_tuple_t(file): - return (file[0], await _async_read_file_content(file[1]), *file[2:]) + return (file[0], await async_read_file_content(file[1]), *file[2:]) raise TypeError(f"Expected file types input to be a FileContent type or to be a tuple") -async def _async_read_file_content(file: FileContent) -> HttpxFileContent: +async def async_read_file_content(file: FileContent) -> HttpxFileContent: if isinstance(file, os.PathLike): return await anyio.Path(file).read_bytes() diff --git a/src/brand/dev/_version.py b/src/brand/dev/_version.py index 9cf18052..641ac2a3 100644 --- a/src/brand/dev/_version.py +++ b/src/brand/dev/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "brand.dev" -__version__ = "1.10.1" # x-release-please-version +__version__ = "1.11.0" # x-release-please-version diff --git a/src/brand/dev/types/brand_ai_query_response.py b/src/brand/dev/types/brand_ai_query_response.py index 0e9909b1..53edd47c 100644 --- a/src/brand/dev/types/brand_ai_query_response.py +++ b/src/brand/dev/types/brand_ai_query_response.py @@ -22,5 +22,8 @@ class BrandAIQueryResponse(BaseModel): domain: Optional[str] = None """The domain that was analyzed""" + status: Optional[str] = None + """Status of the response, e.g., 'ok'""" + urls_analyzed: Optional[List[str]] = None """List of URLs that were analyzed""" diff --git a/src/brand/dev/types/brand_identify_from_transaction_response.py b/src/brand/dev/types/brand_identify_from_transaction_response.py index a48a4df1..a4ca52c8 100644 --- a/src/brand/dev/types/brand_identify_from_transaction_response.py +++ b/src/brand/dev/types/brand_identify_from_transaction_response.py @@ -1,6 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List, Optional +from typing_extensions import Literal from .._models import BaseModel @@ -52,6 +53,9 @@ class BrandBackdropColor(BaseModel): class BrandBackdropResolution(BaseModel): + aspect_ratio: Optional[float] = None + """Aspect ratio of the image (width/height)""" + height: Optional[int] = None """Height of the image in pixels""" @@ -87,6 +91,9 @@ class BrandLogoColor(BaseModel): class BrandLogoResolution(BaseModel): + aspect_ratio: Optional[float] = None + """Aspect ratio of the image (width/height)""" + height: Optional[int] = None """Height of the image in pixels""" @@ -98,17 +105,21 @@ class BrandLogo(BaseModel): colors: Optional[List[BrandLogoColor]] = None """Array of colors in the logo""" - group: Optional[int] = None - """Group identifier for logos""" - - mode: Optional[str] = None - """Mode of the logo, e.g., 'dark', 'light'""" + mode: Optional[Literal["light", "dark", "has_opaque_background"]] = None + """ + Indicates when this logo is best used: 'light' = best for light mode, 'dark' = + best for dark mode, 'has_opaque_background' = can be used for either as image + has its own background + """ resolution: Optional[BrandLogoResolution] = None """Resolution of the logo image""" + type: Optional[Literal["icon", "logo"]] = None + """Type of the logo based on resolution (e.g., 'icon', 'logo')""" + url: Optional[str] = None - """URL of the logo image""" + """CDN hosted url of the logo (ready for display)""" class BrandSocial(BaseModel): @@ -143,9 +154,18 @@ class Brand(BaseModel): domain: Optional[str] = None """The domain name of the brand""" + email: Optional[str] = None + """Company email address""" + + is_nsfw: Optional[bool] = None + """Indicates whether the brand content is not safe for work (NSFW)""" + logos: Optional[List[BrandLogo]] = None """An array of logos associated with the brand""" + phone: Optional[str] = None + """Company phone number""" + slogan: Optional[str] = None """The brand's slogan""" diff --git a/src/brand/dev/types/brand_retrieve_by_ticker_response.py b/src/brand/dev/types/brand_retrieve_by_ticker_response.py index fb0cfced..918b67c0 100644 --- a/src/brand/dev/types/brand_retrieve_by_ticker_response.py +++ b/src/brand/dev/types/brand_retrieve_by_ticker_response.py @@ -1,6 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List, Optional +from typing_extensions import Literal from .._models import BaseModel @@ -52,6 +53,9 @@ class BrandBackdropColor(BaseModel): class BrandBackdropResolution(BaseModel): + aspect_ratio: Optional[float] = None + """Aspect ratio of the image (width/height)""" + height: Optional[int] = None """Height of the image in pixels""" @@ -87,6 +91,9 @@ class BrandLogoColor(BaseModel): class BrandLogoResolution(BaseModel): + aspect_ratio: Optional[float] = None + """Aspect ratio of the image (width/height)""" + height: Optional[int] = None """Height of the image in pixels""" @@ -98,17 +105,21 @@ class BrandLogo(BaseModel): colors: Optional[List[BrandLogoColor]] = None """Array of colors in the logo""" - group: Optional[int] = None - """Group identifier for logos""" - - mode: Optional[str] = None - """Mode of the logo, e.g., 'dark', 'light'""" + mode: Optional[Literal["light", "dark", "has_opaque_background"]] = None + """ + Indicates when this logo is best used: 'light' = best for light mode, 'dark' = + best for dark mode, 'has_opaque_background' = can be used for either as image + has its own background + """ resolution: Optional[BrandLogoResolution] = None """Resolution of the logo image""" + type: Optional[Literal["icon", "logo"]] = None + """Type of the logo based on resolution (e.g., 'icon', 'logo')""" + url: Optional[str] = None - """URL of the logo image""" + """CDN hosted url of the logo (ready for display)""" class BrandSocial(BaseModel): @@ -143,9 +154,18 @@ class Brand(BaseModel): domain: Optional[str] = None """The domain name of the brand""" + email: Optional[str] = None + """Company email address""" + + is_nsfw: Optional[bool] = None + """Indicates whether the brand content is not safe for work (NSFW)""" + logos: Optional[List[BrandLogo]] = None """An array of logos associated with the brand""" + phone: Optional[str] = None + """Company phone number""" + slogan: Optional[str] = None """The brand's slogan""" diff --git a/src/brand/dev/types/brand_retrieve_response.py b/src/brand/dev/types/brand_retrieve_response.py index 32f21157..a684da9e 100644 --- a/src/brand/dev/types/brand_retrieve_response.py +++ b/src/brand/dev/types/brand_retrieve_response.py @@ -1,6 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List, Optional +from typing_extensions import Literal from .._models import BaseModel @@ -52,6 +53,9 @@ class BrandBackdropColor(BaseModel): class BrandBackdropResolution(BaseModel): + aspect_ratio: Optional[float] = None + """Aspect ratio of the image (width/height)""" + height: Optional[int] = None """Height of the image in pixels""" @@ -87,6 +91,9 @@ class BrandLogoColor(BaseModel): class BrandLogoResolution(BaseModel): + aspect_ratio: Optional[float] = None + """Aspect ratio of the image (width/height)""" + height: Optional[int] = None """Height of the image in pixels""" @@ -98,17 +105,21 @@ class BrandLogo(BaseModel): colors: Optional[List[BrandLogoColor]] = None """Array of colors in the logo""" - group: Optional[int] = None - """Group identifier for logos""" - - mode: Optional[str] = None - """Mode of the logo, e.g., 'dark', 'light'""" + mode: Optional[Literal["light", "dark", "has_opaque_background"]] = None + """ + Indicates when this logo is best used: 'light' = best for light mode, 'dark' = + best for dark mode, 'has_opaque_background' = can be used for either as image + has its own background + """ resolution: Optional[BrandLogoResolution] = None """Resolution of the logo image""" + type: Optional[Literal["icon", "logo"]] = None + """Type of the logo based on resolution (e.g., 'icon', 'logo')""" + url: Optional[str] = None - """URL of the logo image""" + """CDN hosted url of the logo (ready for display)""" class BrandSocial(BaseModel): @@ -143,9 +154,18 @@ class Brand(BaseModel): domain: Optional[str] = None """The domain name of the brand""" + email: Optional[str] = None + """Company email address""" + + is_nsfw: Optional[bool] = None + """Indicates whether the brand content is not safe for work (NSFW)""" + logos: Optional[List[BrandLogo]] = None """An array of logos associated with the brand""" + phone: Optional[str] = None + """Company phone number""" + slogan: Optional[str] = None """The brand's slogan""" diff --git a/src/brand/dev/types/brand_retrieve_simplified_response.py b/src/brand/dev/types/brand_retrieve_simplified_response.py index b865ff8c..523fe188 100644 --- a/src/brand/dev/types/brand_retrieve_simplified_response.py +++ b/src/brand/dev/types/brand_retrieve_simplified_response.py @@ -1,6 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List, Optional +from typing_extensions import Literal from .._models import BaseModel @@ -78,20 +79,21 @@ class BrandLogo(BaseModel): colors: Optional[List[BrandLogoColor]] = None """Array of colors in the logo""" - group: Optional[int] = None - """Group identifier for logos""" - - mode: Optional[str] = None - """Mode of the logo, e.g., 'dark', 'light'""" + mode: Optional[Literal["light", "dark", "has_opaque_background"]] = None + """ + Indicates when this logo is best used: 'light' = best for light mode, 'dark' = + best for dark mode, 'has_opaque_background' = can be used for either as image + has its own background + """ resolution: Optional[BrandLogoResolution] = None """Resolution of the logo image""" - type: Optional[str] = None - """Type of the logo based on resolution (e.g., 'icon', 'logo', 'banner')""" + type: Optional[Literal["icon", "logo"]] = None + """Type of the logo based on resolution (e.g., 'icon', 'logo')""" url: Optional[str] = None - """URL of the logo image""" + """CDN hosted url of the logo (ready for display)""" class Brand(BaseModel):