diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 4208b5cb..1b77f506 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.6.0" + ".": "0.7.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index a13a02a8..998ed687 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 21 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-97cdb78dc0d72e9df643a89660f2b0c9687f12c6e4d93f7767f6cfc1b4f2e4c7.yml -openapi_spec_hash: 92fc94fd8865fabe78c2667490ca3884 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-5ee7a321f8e01d2678d56277f011f71294c2b8ac4d0cff0bda412362c0d9cf73.yml +openapi_spec_hash: bf5d57e3bddb6975770cf85c267b5035 config_hash: 682b89b02a20f5d1c13e2c91ecbcf5ce diff --git a/CHANGELOG.md b/CHANGELOG.md index dcfed0a3..6c00b74a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog +## 0.7.0 (2026-04-09) + +Full Changelog: [v0.6.0...v0.7.0](https://github.com/context-dot-dev/context-python-sdk/compare/v0.6.0...v0.7.0) + +### Features + +* **api:** api update ([51e02cd](https://github.com/context-dot-dev/context-python-sdk/commit/51e02cd1487c13ee0cd96a4ab10bb17108bde531)) +* **api:** api update ([cb80f56](https://github.com/context-dot-dev/context-python-sdk/commit/cb80f56cf54377fe4a80927eecaf3391e2e51622)) +* **api:** api update ([b6df2d5](https://github.com/context-dot-dev/context-python-sdk/commit/b6df2d5e74a018e70fdb3a8dd61fdb388699ef39)) + + +### Bug Fixes + +* **client:** preserve hardcoded query params when merging with user params ([57c6a22](https://github.com/context-dot-dev/context-python-sdk/commit/57c6a2294b05ae0fe0840261d07f89b61dcac0a3)) + ## 0.6.0 (2026-04-04) Full Changelog: [v0.5.0...v0.6.0](https://github.com/context-dot-dev/context-python-sdk/compare/v0.5.0...v0.6.0) diff --git a/pyproject.toml b/pyproject.toml index 875e33d8..c5f19398 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "context.dev" -version = "0.6.0" +version = "0.7.0" description = "The official Python library for the context.dev API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/context/dev/_base_client.py b/src/context/dev/_base_client.py index 99bc641c..f0569e21 100644 --- a/src/context/dev/_base_client.py +++ b/src/context/dev/_base_client.py @@ -540,6 +540,10 @@ def _build_request( files = cast(HttpxRequestFiles, ForceMultipartDict()) prepared_url = self._prepare_url(options.url) + # preserve hard-coded query params from the url + if params and prepared_url.query: + params = {**dict(prepared_url.params.items()), **params} + prepared_url = prepared_url.copy_with(raw_path=prepared_url.raw_path.split(b"?", 1)[0]) if "_" in prepared_url.host: # work around https://github.com/encode/httpx/discussions/2880 kwargs["extensions"] = {"sni_hostname": prepared_url.host.replace("_", "-")} diff --git a/src/context/dev/_version.py b/src/context/dev/_version.py index 6ae04216..7b88fdc4 100644 --- a/src/context/dev/_version.py +++ b/src/context/dev/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "context.dev" -__version__ = "0.6.0" # x-release-please-version +__version__ = "0.7.0" # x-release-please-version diff --git a/src/context/dev/resources/brand.py b/src/context/dev/resources/brand.py index 4e092d1d..24c4252a 100644 --- a/src/context/dev/resources/brand.py +++ b/src/context/dev/resources/brand.py @@ -62,61 +62,126 @@ def retrieve( *, domain: str, force_language: Literal[ + "afrikaans", "albanian", + "amharic", "arabic", + "armenian", + "assamese", + "aymara", "azeri", + "basque", + "belarusian", "bengali", + "bosnian", "bulgarian", + "burmese", "cantonese", + "catalan", "cebuano", + "chinese", + "corsican", "croatian", "czech", "danish", "dutch", "english", + "esperanto", "estonian", "farsi", + "fijian", "finnish", "french", + "galician", + "georgian", "german", + "greek", + "guarani", + "gujarati", + "haitian-creole", "hausa", "hawaiian", + "hebrew", "hindi", + "hmong", "hungarian", "icelandic", + "igbo", "indonesian", + "irish", "italian", + "japanese", + "javanese", + "kannada", "kazakh", + "khmer", + "kinyarwanda", "korean", + "kurdish", "kyrgyz", + "lao", "latin", "latvian", + "lingala", "lithuanian", + "luxembourgish", "macedonian", + "malagasy", + "malay", + "malayalam", + "maltese", + "maori", + "marathi", "mongolian", "nepali", "norwegian", + "odia", + "oromo", "pashto", "pidgin", "polish", "portuguese", + "punjabi", + "quechua", "romanian", "russian", + "samoan", + "scottish-gaelic", "serbian", + "sesotho", + "shona", + "sindhi", + "sinhala", "slovak", "slovene", "somali", "spanish", + "sundanese", "swahili", "swedish", "tagalog", + "tajik", + "tamil", + "tatar", + "telugu", "thai", + "tibetan", + "tigrinya", + "tongan", + "tswana", "turkish", + "turkmen", "ukrainian", "urdu", + "uyghur", "uzbek", "vietnamese", "welsh", + "wolof", + "xhosa", + "yiddish", + "yoruba", + "zulu", ] | Omit = omit, max_speed: bool | Omit = omit, @@ -136,8 +201,7 @@ def retrieve( domain: Domain name to retrieve brand data for (e.g., 'example.com', 'google.com'). Cannot be used with name or ticker parameters. - force_language: Optional parameter to force the language of the retrieved brand data. Works with - all three lookup methods. + force_language: Optional parameter to force the language of the retrieved brand data. max_speed: Optional parameter to optimize the API call for maximum speed. When set to true, the API will skip time-consuming operations for faster response at the cost of @@ -423,61 +487,126 @@ def identify_from_transaction( ] | Omit = omit, force_language: Literal[ + "afrikaans", "albanian", + "amharic", "arabic", + "armenian", + "assamese", + "aymara", "azeri", + "basque", + "belarusian", "bengali", + "bosnian", "bulgarian", + "burmese", "cantonese", + "catalan", "cebuano", + "chinese", + "corsican", "croatian", "czech", "danish", "dutch", "english", + "esperanto", "estonian", "farsi", + "fijian", "finnish", "french", + "galician", + "georgian", "german", + "greek", + "guarani", + "gujarati", + "haitian-creole", "hausa", "hawaiian", + "hebrew", "hindi", + "hmong", "hungarian", "icelandic", + "igbo", "indonesian", + "irish", "italian", + "japanese", + "javanese", + "kannada", "kazakh", + "khmer", + "kinyarwanda", "korean", + "kurdish", "kyrgyz", + "lao", "latin", "latvian", + "lingala", "lithuanian", + "luxembourgish", "macedonian", + "malagasy", + "malay", + "malayalam", + "maltese", + "maori", + "marathi", "mongolian", "nepali", "norwegian", + "odia", + "oromo", "pashto", "pidgin", "polish", "portuguese", + "punjabi", + "quechua", "romanian", "russian", + "samoan", + "scottish-gaelic", "serbian", + "sesotho", + "shona", + "sindhi", + "sinhala", "slovak", "slovene", "somali", "spanish", + "sundanese", "swahili", "swedish", "tagalog", + "tajik", + "tamil", + "tatar", + "telugu", "thai", + "tibetan", + "tigrinya", + "tongan", + "tswana", "turkish", + "turkmen", "ukrainian", "urdu", + "uyghur", "uzbek", "vietnamese", "welsh", + "wolof", + "xhosa", + "yiddish", + "yoruba", + "zulu", ] | Omit = omit, high_confidence_only: bool | Omit = omit, @@ -561,61 +690,126 @@ def retrieve_by_email( *, email: str, force_language: Literal[ + "afrikaans", "albanian", + "amharic", "arabic", + "armenian", + "assamese", + "aymara", "azeri", + "basque", + "belarusian", "bengali", + "bosnian", "bulgarian", + "burmese", "cantonese", + "catalan", "cebuano", + "chinese", + "corsican", "croatian", "czech", "danish", "dutch", "english", + "esperanto", "estonian", "farsi", + "fijian", "finnish", "french", + "galician", + "georgian", "german", + "greek", + "guarani", + "gujarati", + "haitian-creole", "hausa", "hawaiian", + "hebrew", "hindi", + "hmong", "hungarian", "icelandic", + "igbo", "indonesian", + "irish", "italian", + "japanese", + "javanese", + "kannada", "kazakh", + "khmer", + "kinyarwanda", "korean", + "kurdish", "kyrgyz", + "lao", "latin", "latvian", + "lingala", "lithuanian", + "luxembourgish", "macedonian", + "malagasy", + "malay", + "malayalam", + "maltese", + "maori", + "marathi", "mongolian", "nepali", "norwegian", + "odia", + "oromo", "pashto", "pidgin", "polish", "portuguese", + "punjabi", + "quechua", "romanian", "russian", + "samoan", + "scottish-gaelic", "serbian", + "sesotho", + "shona", + "sindhi", + "sinhala", "slovak", "slovene", "somali", "spanish", + "sundanese", "swahili", "swedish", "tagalog", + "tajik", + "tamil", + "tatar", + "telugu", "thai", + "tibetan", + "tigrinya", + "tongan", + "tswana", "turkish", + "turkmen", "ukrainian", "urdu", + "uyghur", "uzbek", "vietnamese", "welsh", + "wolof", + "xhosa", + "yiddish", + "yoruba", + "zulu", ] | Omit = omit, max_speed: bool | Omit = omit, @@ -681,61 +875,126 @@ def retrieve_by_isin( *, isin: str, force_language: Literal[ + "afrikaans", "albanian", + "amharic", "arabic", + "armenian", + "assamese", + "aymara", "azeri", + "basque", + "belarusian", "bengali", + "bosnian", "bulgarian", + "burmese", "cantonese", + "catalan", "cebuano", + "chinese", + "corsican", "croatian", "czech", "danish", "dutch", "english", + "esperanto", "estonian", "farsi", + "fijian", "finnish", "french", + "galician", + "georgian", "german", + "greek", + "guarani", + "gujarati", + "haitian-creole", "hausa", "hawaiian", + "hebrew", "hindi", + "hmong", "hungarian", "icelandic", + "igbo", "indonesian", + "irish", "italian", + "japanese", + "javanese", + "kannada", "kazakh", + "khmer", + "kinyarwanda", "korean", + "kurdish", "kyrgyz", + "lao", "latin", "latvian", + "lingala", "lithuanian", + "luxembourgish", "macedonian", + "malagasy", + "malay", + "malayalam", + "maltese", + "maori", + "marathi", "mongolian", "nepali", "norwegian", + "odia", + "oromo", "pashto", "pidgin", "polish", "portuguese", + "punjabi", + "quechua", "romanian", "russian", + "samoan", + "scottish-gaelic", "serbian", + "sesotho", + "shona", + "sindhi", + "sinhala", "slovak", "slovene", "somali", "spanish", + "sundanese", "swahili", "swedish", "tagalog", + "tajik", + "tamil", + "tatar", + "telugu", "thai", + "tibetan", + "tigrinya", + "tongan", + "tswana", "turkish", + "turkmen", "ukrainian", "urdu", + "uyghur", "uzbek", "vietnamese", "welsh", + "wolof", + "xhosa", + "yiddish", + "yoruba", + "zulu", ] | Omit = omit, max_speed: bool | Omit = omit, @@ -1042,61 +1301,126 @@ def retrieve_by_name( ] | Omit = omit, force_language: Literal[ + "afrikaans", "albanian", + "amharic", "arabic", + "armenian", + "assamese", + "aymara", "azeri", + "basque", + "belarusian", "bengali", + "bosnian", "bulgarian", + "burmese", "cantonese", + "catalan", "cebuano", + "chinese", + "corsican", "croatian", "czech", "danish", "dutch", "english", + "esperanto", "estonian", "farsi", + "fijian", "finnish", "french", + "galician", + "georgian", "german", + "greek", + "guarani", + "gujarati", + "haitian-creole", "hausa", "hawaiian", + "hebrew", "hindi", + "hmong", "hungarian", "icelandic", + "igbo", "indonesian", + "irish", "italian", + "japanese", + "javanese", + "kannada", "kazakh", + "khmer", + "kinyarwanda", "korean", + "kurdish", "kyrgyz", + "lao", "latin", "latvian", + "lingala", "lithuanian", + "luxembourgish", "macedonian", + "malagasy", + "malay", + "malayalam", + "maltese", + "maori", + "marathi", "mongolian", "nepali", "norwegian", + "odia", + "oromo", "pashto", "pidgin", "polish", "portuguese", + "punjabi", + "quechua", "romanian", "russian", + "samoan", + "scottish-gaelic", "serbian", + "sesotho", + "shona", + "sindhi", + "sinhala", "slovak", "slovene", "somali", "spanish", + "sundanese", "swahili", "swedish", "tagalog", + "tajik", + "tamil", + "tatar", + "telugu", "thai", + "tibetan", + "tigrinya", + "tongan", + "tswana", "turkish", + "turkmen", "ukrainian", "urdu", + "uyghur", "uzbek", "vietnamese", "welsh", + "wolof", + "xhosa", + "yiddish", + "yoruba", + "zulu", ] | Omit = omit, max_speed: bool | Omit = omit, @@ -1164,61 +1488,126 @@ def retrieve_by_ticker( *, ticker: str, force_language: Literal[ + "afrikaans", "albanian", + "amharic", "arabic", + "armenian", + "assamese", + "aymara", "azeri", + "basque", + "belarusian", "bengali", + "bosnian", "bulgarian", + "burmese", "cantonese", + "catalan", "cebuano", + "chinese", + "corsican", "croatian", "czech", "danish", "dutch", "english", + "esperanto", "estonian", "farsi", + "fijian", "finnish", "french", + "galician", + "georgian", "german", + "greek", + "guarani", + "gujarati", + "haitian-creole", "hausa", "hawaiian", + "hebrew", "hindi", + "hmong", "hungarian", "icelandic", + "igbo", "indonesian", + "irish", "italian", + "japanese", + "javanese", + "kannada", "kazakh", + "khmer", + "kinyarwanda", "korean", + "kurdish", "kyrgyz", + "lao", "latin", "latvian", + "lingala", "lithuanian", + "luxembourgish", "macedonian", + "malagasy", + "malay", + "malayalam", + "maltese", + "maori", + "marathi", "mongolian", "nepali", "norwegian", + "odia", + "oromo", "pashto", "pidgin", "polish", "portuguese", + "punjabi", + "quechua", "romanian", "russian", + "samoan", + "scottish-gaelic", "serbian", + "sesotho", + "shona", + "sindhi", + "sinhala", "slovak", "slovene", "somali", "spanish", + "sundanese", "swahili", "swedish", "tagalog", + "tajik", + "tamil", + "tatar", + "telugu", "thai", + "tibetan", + "tigrinya", + "tongan", + "tswana", "turkish", + "turkmen", "ukrainian", "urdu", + "uyghur", "uzbek", "vietnamese", "welsh", + "wolof", + "xhosa", + "yiddish", + "yoruba", + "zulu", ] | Omit = omit, max_speed: bool | Omit = omit, @@ -1431,61 +1820,126 @@ async def retrieve( *, domain: str, force_language: Literal[ + "afrikaans", "albanian", + "amharic", "arabic", + "armenian", + "assamese", + "aymara", "azeri", + "basque", + "belarusian", "bengali", + "bosnian", "bulgarian", + "burmese", "cantonese", + "catalan", "cebuano", + "chinese", + "corsican", "croatian", "czech", "danish", "dutch", "english", + "esperanto", "estonian", "farsi", + "fijian", "finnish", "french", + "galician", + "georgian", "german", + "greek", + "guarani", + "gujarati", + "haitian-creole", "hausa", "hawaiian", + "hebrew", "hindi", + "hmong", "hungarian", "icelandic", + "igbo", "indonesian", + "irish", "italian", + "japanese", + "javanese", + "kannada", "kazakh", + "khmer", + "kinyarwanda", "korean", + "kurdish", "kyrgyz", + "lao", "latin", "latvian", + "lingala", "lithuanian", + "luxembourgish", "macedonian", + "malagasy", + "malay", + "malayalam", + "maltese", + "maori", + "marathi", "mongolian", "nepali", "norwegian", + "odia", + "oromo", "pashto", "pidgin", "polish", "portuguese", + "punjabi", + "quechua", "romanian", "russian", + "samoan", + "scottish-gaelic", "serbian", + "sesotho", + "shona", + "sindhi", + "sinhala", "slovak", "slovene", "somali", "spanish", + "sundanese", "swahili", "swedish", "tagalog", + "tajik", + "tamil", + "tatar", + "telugu", "thai", + "tibetan", + "tigrinya", + "tongan", + "tswana", "turkish", + "turkmen", "ukrainian", "urdu", + "uyghur", "uzbek", "vietnamese", "welsh", + "wolof", + "xhosa", + "yiddish", + "yoruba", + "zulu", ] | Omit = omit, max_speed: bool | Omit = omit, @@ -1505,8 +1959,7 @@ async def retrieve( domain: Domain name to retrieve brand data for (e.g., 'example.com', 'google.com'). Cannot be used with name or ticker parameters. - force_language: Optional parameter to force the language of the retrieved brand data. Works with - all three lookup methods. + force_language: Optional parameter to force the language of the retrieved brand data. max_speed: Optional parameter to optimize the API call for maximum speed. When set to true, the API will skip time-consuming operations for faster response at the cost of @@ -1792,61 +2245,126 @@ async def identify_from_transaction( ] | Omit = omit, force_language: Literal[ + "afrikaans", "albanian", + "amharic", "arabic", + "armenian", + "assamese", + "aymara", "azeri", + "basque", + "belarusian", "bengali", + "bosnian", "bulgarian", + "burmese", "cantonese", + "catalan", "cebuano", + "chinese", + "corsican", "croatian", "czech", "danish", "dutch", "english", + "esperanto", "estonian", "farsi", + "fijian", "finnish", "french", + "galician", + "georgian", "german", + "greek", + "guarani", + "gujarati", + "haitian-creole", "hausa", "hawaiian", + "hebrew", "hindi", + "hmong", "hungarian", "icelandic", + "igbo", "indonesian", + "irish", "italian", + "japanese", + "javanese", + "kannada", "kazakh", + "khmer", + "kinyarwanda", "korean", + "kurdish", "kyrgyz", + "lao", "latin", "latvian", + "lingala", "lithuanian", + "luxembourgish", "macedonian", + "malagasy", + "malay", + "malayalam", + "maltese", + "maori", + "marathi", "mongolian", "nepali", "norwegian", + "odia", + "oromo", "pashto", "pidgin", "polish", "portuguese", + "punjabi", + "quechua", "romanian", "russian", + "samoan", + "scottish-gaelic", "serbian", + "sesotho", + "shona", + "sindhi", + "sinhala", "slovak", "slovene", "somali", "spanish", + "sundanese", "swahili", "swedish", "tagalog", + "tajik", + "tamil", + "tatar", + "telugu", "thai", + "tibetan", + "tigrinya", + "tongan", + "tswana", "turkish", + "turkmen", "ukrainian", "urdu", + "uyghur", "uzbek", "vietnamese", "welsh", + "wolof", + "xhosa", + "yiddish", + "yoruba", + "zulu", ] | Omit = omit, high_confidence_only: bool | Omit = omit, @@ -1930,61 +2448,126 @@ async def retrieve_by_email( *, email: str, force_language: Literal[ + "afrikaans", "albanian", + "amharic", "arabic", + "armenian", + "assamese", + "aymara", "azeri", + "basque", + "belarusian", "bengali", + "bosnian", "bulgarian", + "burmese", "cantonese", + "catalan", "cebuano", + "chinese", + "corsican", "croatian", "czech", "danish", "dutch", "english", + "esperanto", "estonian", "farsi", + "fijian", "finnish", "french", + "galician", + "georgian", "german", + "greek", + "guarani", + "gujarati", + "haitian-creole", "hausa", "hawaiian", + "hebrew", "hindi", + "hmong", "hungarian", "icelandic", + "igbo", "indonesian", + "irish", "italian", + "japanese", + "javanese", + "kannada", "kazakh", + "khmer", + "kinyarwanda", "korean", + "kurdish", "kyrgyz", + "lao", "latin", "latvian", + "lingala", "lithuanian", + "luxembourgish", "macedonian", + "malagasy", + "malay", + "malayalam", + "maltese", + "maori", + "marathi", "mongolian", "nepali", "norwegian", + "odia", + "oromo", "pashto", "pidgin", "polish", "portuguese", + "punjabi", + "quechua", "romanian", "russian", + "samoan", + "scottish-gaelic", "serbian", + "sesotho", + "shona", + "sindhi", + "sinhala", "slovak", "slovene", "somali", "spanish", + "sundanese", "swahili", "swedish", "tagalog", + "tajik", + "tamil", + "tatar", + "telugu", "thai", + "tibetan", + "tigrinya", + "tongan", + "tswana", "turkish", + "turkmen", "ukrainian", "urdu", + "uyghur", "uzbek", "vietnamese", "welsh", + "wolof", + "xhosa", + "yiddish", + "yoruba", + "zulu", ] | Omit = omit, max_speed: bool | Omit = omit, @@ -2050,61 +2633,126 @@ async def retrieve_by_isin( *, isin: str, force_language: Literal[ + "afrikaans", "albanian", + "amharic", "arabic", + "armenian", + "assamese", + "aymara", "azeri", + "basque", + "belarusian", "bengali", + "bosnian", "bulgarian", + "burmese", "cantonese", + "catalan", "cebuano", + "chinese", + "corsican", "croatian", "czech", "danish", "dutch", "english", + "esperanto", "estonian", "farsi", + "fijian", "finnish", "french", + "galician", + "georgian", "german", + "greek", + "guarani", + "gujarati", + "haitian-creole", "hausa", "hawaiian", + "hebrew", "hindi", + "hmong", "hungarian", "icelandic", + "igbo", "indonesian", + "irish", "italian", + "japanese", + "javanese", + "kannada", "kazakh", + "khmer", + "kinyarwanda", "korean", + "kurdish", "kyrgyz", + "lao", "latin", "latvian", + "lingala", "lithuanian", + "luxembourgish", "macedonian", + "malagasy", + "malay", + "malayalam", + "maltese", + "maori", + "marathi", "mongolian", "nepali", "norwegian", + "odia", + "oromo", "pashto", "pidgin", "polish", "portuguese", + "punjabi", + "quechua", "romanian", "russian", + "samoan", + "scottish-gaelic", "serbian", + "sesotho", + "shona", + "sindhi", + "sinhala", "slovak", "slovene", "somali", "spanish", + "sundanese", "swahili", "swedish", "tagalog", + "tajik", + "tamil", + "tatar", + "telugu", "thai", + "tibetan", + "tigrinya", + "tongan", + "tswana", "turkish", + "turkmen", "ukrainian", "urdu", + "uyghur", "uzbek", "vietnamese", "welsh", + "wolof", + "xhosa", + "yiddish", + "yoruba", + "zulu", ] | Omit = omit, max_speed: bool | Omit = omit, @@ -2411,61 +3059,126 @@ async def retrieve_by_name( ] | Omit = omit, force_language: Literal[ + "afrikaans", "albanian", + "amharic", "arabic", + "armenian", + "assamese", + "aymara", "azeri", + "basque", + "belarusian", "bengali", + "bosnian", "bulgarian", + "burmese", "cantonese", + "catalan", "cebuano", + "chinese", + "corsican", "croatian", "czech", "danish", "dutch", "english", + "esperanto", "estonian", "farsi", + "fijian", "finnish", "french", + "galician", + "georgian", "german", + "greek", + "guarani", + "gujarati", + "haitian-creole", "hausa", "hawaiian", + "hebrew", "hindi", + "hmong", "hungarian", "icelandic", + "igbo", "indonesian", + "irish", "italian", + "japanese", + "javanese", + "kannada", "kazakh", + "khmer", + "kinyarwanda", "korean", + "kurdish", "kyrgyz", + "lao", "latin", "latvian", + "lingala", "lithuanian", + "luxembourgish", "macedonian", + "malagasy", + "malay", + "malayalam", + "maltese", + "maori", + "marathi", "mongolian", "nepali", "norwegian", + "odia", + "oromo", "pashto", "pidgin", "polish", "portuguese", + "punjabi", + "quechua", "romanian", "russian", + "samoan", + "scottish-gaelic", "serbian", + "sesotho", + "shona", + "sindhi", + "sinhala", "slovak", "slovene", "somali", "spanish", + "sundanese", "swahili", "swedish", "tagalog", + "tajik", + "tamil", + "tatar", + "telugu", "thai", + "tibetan", + "tigrinya", + "tongan", + "tswana", "turkish", + "turkmen", "ukrainian", "urdu", + "uyghur", "uzbek", "vietnamese", "welsh", + "wolof", + "xhosa", + "yiddish", + "yoruba", + "zulu", ] | Omit = omit, max_speed: bool | Omit = omit, @@ -2533,61 +3246,126 @@ async def retrieve_by_ticker( *, ticker: str, force_language: Literal[ + "afrikaans", "albanian", + "amharic", "arabic", + "armenian", + "assamese", + "aymara", "azeri", + "basque", + "belarusian", "bengali", + "bosnian", "bulgarian", + "burmese", "cantonese", + "catalan", "cebuano", + "chinese", + "corsican", "croatian", "czech", "danish", "dutch", "english", + "esperanto", "estonian", "farsi", + "fijian", "finnish", "french", + "galician", + "georgian", "german", + "greek", + "guarani", + "gujarati", + "haitian-creole", "hausa", "hawaiian", + "hebrew", "hindi", + "hmong", "hungarian", "icelandic", + "igbo", "indonesian", + "irish", "italian", + "japanese", + "javanese", + "kannada", "kazakh", + "khmer", + "kinyarwanda", "korean", + "kurdish", "kyrgyz", + "lao", "latin", "latvian", + "lingala", "lithuanian", + "luxembourgish", "macedonian", + "malagasy", + "malay", + "malayalam", + "maltese", + "maori", + "marathi", "mongolian", "nepali", "norwegian", + "odia", + "oromo", "pashto", "pidgin", "polish", "portuguese", + "punjabi", + "quechua", "romanian", "russian", + "samoan", + "scottish-gaelic", "serbian", + "sesotho", + "shona", + "sindhi", + "sinhala", "slovak", "slovene", "somali", "spanish", + "sundanese", "swahili", "swedish", "tagalog", + "tajik", + "tamil", + "tatar", + "telugu", "thai", + "tibetan", + "tigrinya", + "tongan", + "tswana", "turkish", + "turkmen", "ukrainian", "urdu", + "uyghur", "uzbek", "vietnamese", "welsh", + "wolof", + "xhosa", + "yiddish", + "yoruba", + "zulu", ] | Omit = omit, max_speed: bool | Omit = omit, diff --git a/src/context/dev/resources/web.py b/src/context/dev/resources/web.py index a32d4f1f..33c3d6f6 100644 --- a/src/context/dev/resources/web.py +++ b/src/context/dev/resources/web.py @@ -58,7 +58,8 @@ def with_streaming_response(self) -> WebResourceWithStreamingResponse: def screenshot( self, *, - domain: str, + direct_url: str | Omit = omit, + domain: str | Omit = omit, full_screenshot: Literal["true", "false"] | Omit = omit, page: Literal["login", "signup", "blog", "careers", "pricing", "terms", "privacy", "contact"] | Omit = omit, prioritize: Literal["speed", "quality"] | Omit = omit, @@ -73,10 +74,15 @@ def screenshot( Supports both viewport (standard browser view) and full-page screenshots. Can also screenshot specific page types (login, - pricing, etc.) by using heuristics to find the appropriate URL. Returns a URL to - the uploaded screenshot image hosted on our CDN. + pricing, etc.) by using heuristics to find the appropriate URL. Either 'domain' + or 'directUrl' must be provided as a query parameter, but not both. Returns a + URL to the uploaded screenshot image hosted on our CDN. Args: + direct_url: A specific URL to screenshot directly, bypassing domain resolution (e.g., + 'https://example.com/pricing'). When provided, the screenshot is taken of this + exact URL. + domain: Domain name to take screenshot of (e.g., 'example.com', 'google.com'). The domain will be automatically normalized and validated. @@ -87,7 +93,8 @@ def screenshot( page: Optional parameter to specify which page type to screenshot. If provided, the system will scrape the domain's links and use heuristics to find the most appropriate URL for the specified page type (30 supported languages). If not - provided, screenshots the main domain landing page. + provided, screenshots the main domain landing page. Only applicable when using + 'domain', not 'directUrl'. prioritize: Optional parameter to prioritize screenshot capture. If 'speed', optimizes for faster capture with basic quality. If 'quality', optimizes for higher quality @@ -110,6 +117,7 @@ def screenshot( timeout=timeout, query=maybe_transform( { + "direct_url": direct_url, "domain": domain, "full_screenshot": full_screenshot, "page": page, @@ -409,7 +417,8 @@ def with_streaming_response(self) -> AsyncWebResourceWithStreamingResponse: async def screenshot( self, *, - domain: str, + direct_url: str | Omit = omit, + domain: str | Omit = omit, full_screenshot: Literal["true", "false"] | Omit = omit, page: Literal["login", "signup", "blog", "careers", "pricing", "terms", "privacy", "contact"] | Omit = omit, prioritize: Literal["speed", "quality"] | Omit = omit, @@ -424,10 +433,15 @@ async def screenshot( Supports both viewport (standard browser view) and full-page screenshots. Can also screenshot specific page types (login, - pricing, etc.) by using heuristics to find the appropriate URL. Returns a URL to - the uploaded screenshot image hosted on our CDN. + pricing, etc.) by using heuristics to find the appropriate URL. Either 'domain' + or 'directUrl' must be provided as a query parameter, but not both. Returns a + URL to the uploaded screenshot image hosted on our CDN. Args: + direct_url: A specific URL to screenshot directly, bypassing domain resolution (e.g., + 'https://example.com/pricing'). When provided, the screenshot is taken of this + exact URL. + domain: Domain name to take screenshot of (e.g., 'example.com', 'google.com'). The domain will be automatically normalized and validated. @@ -438,7 +452,8 @@ async def screenshot( page: Optional parameter to specify which page type to screenshot. If provided, the system will scrape the domain's links and use heuristics to find the most appropriate URL for the specified page type (30 supported languages). If not - provided, screenshots the main domain landing page. + provided, screenshots the main domain landing page. Only applicable when using + 'domain', not 'directUrl'. prioritize: Optional parameter to prioritize screenshot capture. If 'speed', optimizes for faster capture with basic quality. If 'quality', optimizes for higher quality @@ -461,6 +476,7 @@ async def screenshot( timeout=timeout, query=await async_maybe_transform( { + "direct_url": direct_url, "domain": domain, "full_screenshot": full_screenshot, "page": page, diff --git a/src/context/dev/types/brand_identify_from_transaction_params.py b/src/context/dev/types/brand_identify_from_transaction_params.py index e04b1e53..bd3f5a8f 100644 --- a/src/context/dev/types/brand_identify_from_transaction_params.py +++ b/src/context/dev/types/brand_identify_from_transaction_params.py @@ -263,61 +263,126 @@ class BrandIdentifyFromTransactionParams(TypedDict, total=False): """ force_language: Literal[ + "afrikaans", "albanian", + "amharic", "arabic", + "armenian", + "assamese", + "aymara", "azeri", + "basque", + "belarusian", "bengali", + "bosnian", "bulgarian", + "burmese", "cantonese", + "catalan", "cebuano", + "chinese", + "corsican", "croatian", "czech", "danish", "dutch", "english", + "esperanto", "estonian", "farsi", + "fijian", "finnish", "french", + "galician", + "georgian", "german", + "greek", + "guarani", + "gujarati", + "haitian-creole", "hausa", "hawaiian", + "hebrew", "hindi", + "hmong", "hungarian", "icelandic", + "igbo", "indonesian", + "irish", "italian", + "japanese", + "javanese", + "kannada", "kazakh", + "khmer", + "kinyarwanda", "korean", + "kurdish", "kyrgyz", + "lao", "latin", "latvian", + "lingala", "lithuanian", + "luxembourgish", "macedonian", + "malagasy", + "malay", + "malayalam", + "maltese", + "maori", + "marathi", "mongolian", "nepali", "norwegian", + "odia", + "oromo", "pashto", "pidgin", "polish", "portuguese", + "punjabi", + "quechua", "romanian", "russian", + "samoan", + "scottish-gaelic", "serbian", + "sesotho", + "shona", + "sindhi", + "sinhala", "slovak", "slovene", "somali", "spanish", + "sundanese", "swahili", "swedish", "tagalog", + "tajik", + "tamil", + "tatar", + "telugu", "thai", + "tibetan", + "tigrinya", + "tongan", + "tswana", "turkish", + "turkmen", "ukrainian", "urdu", + "uyghur", "uzbek", "vietnamese", "welsh", + "wolof", + "xhosa", + "yiddish", + "yoruba", + "zulu", ] """Optional parameter to force the language of the retrieved brand data.""" diff --git a/src/context/dev/types/brand_identify_from_transaction_response.py b/src/context/dev/types/brand_identify_from_transaction_response.py index 5c1261dd..5d499eaf 100644 --- a/src/context/dev/types/brand_identify_from_transaction_response.py +++ b/src/context/dev/types/brand_identify_from_transaction_response.py @@ -415,8 +415,42 @@ class BrandLogo(BaseModel): class BrandSocial(BaseModel): - type: Optional[str] = None - """Type of social media, e.g., 'facebook', 'twitter'""" + type: Optional[ + Literal[ + "x", + "facebook", + "instagram", + "linkedin", + "youtube", + "pinterest", + "tiktok", + "dribbble", + "github", + "behance", + "snapchat", + "whatsapp", + "telegram", + "line", + "discord", + "twitch", + "vimeo", + "imdb", + "tumblr", + "flickr", + "giphy", + "medium", + "spotify", + "soundcloud", + "tripadvisor", + "yelp", + "producthunt", + "reddit", + "crunchbase", + "appstore", + "playstore", + ] + ] = None + """Type of social media platform""" url: Optional[str] = None """URL of the social media page""" @@ -470,6 +504,136 @@ class Brand(BaseModel): phone: Optional[str] = None """Company phone number""" + primary_language: Optional[ + Literal[ + "afrikaans", + "albanian", + "amharic", + "arabic", + "armenian", + "assamese", + "aymara", + "azeri", + "basque", + "belarusian", + "bengali", + "bosnian", + "bulgarian", + "burmese", + "cantonese", + "catalan", + "cebuano", + "chinese", + "corsican", + "croatian", + "czech", + "danish", + "dutch", + "english", + "esperanto", + "estonian", + "farsi", + "fijian", + "finnish", + "french", + "galician", + "georgian", + "german", + "greek", + "guarani", + "gujarati", + "haitian-creole", + "hausa", + "hawaiian", + "hebrew", + "hindi", + "hmong", + "hungarian", + "icelandic", + "igbo", + "indonesian", + "irish", + "italian", + "japanese", + "javanese", + "kannada", + "kazakh", + "khmer", + "kinyarwanda", + "korean", + "kurdish", + "kyrgyz", + "lao", + "latin", + "latvian", + "lingala", + "lithuanian", + "luxembourgish", + "macedonian", + "malagasy", + "malay", + "malayalam", + "maltese", + "maori", + "marathi", + "mongolian", + "nepali", + "norwegian", + "odia", + "oromo", + "pashto", + "pidgin", + "polish", + "portuguese", + "punjabi", + "quechua", + "romanian", + "russian", + "samoan", + "scottish-gaelic", + "serbian", + "sesotho", + "shona", + "sindhi", + "sinhala", + "slovak", + "slovene", + "somali", + "spanish", + "sundanese", + "swahili", + "swedish", + "tagalog", + "tajik", + "tamil", + "tatar", + "telugu", + "thai", + "tibetan", + "tigrinya", + "tongan", + "tswana", + "turkish", + "turkmen", + "ukrainian", + "urdu", + "uyghur", + "uzbek", + "vietnamese", + "welsh", + "wolof", + "xhosa", + "yiddish", + "yoruba", + "zulu", + ] + ] = None + """The primary language of the brand's website content. + + Detected from the HTML lang tag, page content analysis, or social media + descriptions. + """ + slogan: Optional[str] = None """The brand's slogan""" diff --git a/src/context/dev/types/brand_retrieve_by_email_params.py b/src/context/dev/types/brand_retrieve_by_email_params.py index 886c2135..84949e7b 100644 --- a/src/context/dev/types/brand_retrieve_by_email_params.py +++ b/src/context/dev/types/brand_retrieve_by_email_params.py @@ -18,61 +18,126 @@ class BrandRetrieveByEmailParams(TypedDict, total=False): """ force_language: Literal[ + "afrikaans", "albanian", + "amharic", "arabic", + "armenian", + "assamese", + "aymara", "azeri", + "basque", + "belarusian", "bengali", + "bosnian", "bulgarian", + "burmese", "cantonese", + "catalan", "cebuano", + "chinese", + "corsican", "croatian", "czech", "danish", "dutch", "english", + "esperanto", "estonian", "farsi", + "fijian", "finnish", "french", + "galician", + "georgian", "german", + "greek", + "guarani", + "gujarati", + "haitian-creole", "hausa", "hawaiian", + "hebrew", "hindi", + "hmong", "hungarian", "icelandic", + "igbo", "indonesian", + "irish", "italian", + "japanese", + "javanese", + "kannada", "kazakh", + "khmer", + "kinyarwanda", "korean", + "kurdish", "kyrgyz", + "lao", "latin", "latvian", + "lingala", "lithuanian", + "luxembourgish", "macedonian", + "malagasy", + "malay", + "malayalam", + "maltese", + "maori", + "marathi", "mongolian", "nepali", "norwegian", + "odia", + "oromo", "pashto", "pidgin", "polish", "portuguese", + "punjabi", + "quechua", "romanian", "russian", + "samoan", + "scottish-gaelic", "serbian", + "sesotho", + "shona", + "sindhi", + "sinhala", "slovak", "slovene", "somali", "spanish", + "sundanese", "swahili", "swedish", "tagalog", + "tajik", + "tamil", + "tatar", + "telugu", "thai", + "tibetan", + "tigrinya", + "tongan", + "tswana", "turkish", + "turkmen", "ukrainian", "urdu", + "uyghur", "uzbek", "vietnamese", "welsh", + "wolof", + "xhosa", + "yiddish", + "yoruba", + "zulu", ] """Optional parameter to force the language of the retrieved brand data.""" diff --git a/src/context/dev/types/brand_retrieve_by_email_response.py b/src/context/dev/types/brand_retrieve_by_email_response.py index 922fa75b..db6b8620 100644 --- a/src/context/dev/types/brand_retrieve_by_email_response.py +++ b/src/context/dev/types/brand_retrieve_by_email_response.py @@ -415,8 +415,42 @@ class BrandLogo(BaseModel): class BrandSocial(BaseModel): - type: Optional[str] = None - """Type of social media, e.g., 'facebook', 'twitter'""" + type: Optional[ + Literal[ + "x", + "facebook", + "instagram", + "linkedin", + "youtube", + "pinterest", + "tiktok", + "dribbble", + "github", + "behance", + "snapchat", + "whatsapp", + "telegram", + "line", + "discord", + "twitch", + "vimeo", + "imdb", + "tumblr", + "flickr", + "giphy", + "medium", + "spotify", + "soundcloud", + "tripadvisor", + "yelp", + "producthunt", + "reddit", + "crunchbase", + "appstore", + "playstore", + ] + ] = None + """Type of social media platform""" url: Optional[str] = None """URL of the social media page""" @@ -470,6 +504,136 @@ class Brand(BaseModel): phone: Optional[str] = None """Company phone number""" + primary_language: Optional[ + Literal[ + "afrikaans", + "albanian", + "amharic", + "arabic", + "armenian", + "assamese", + "aymara", + "azeri", + "basque", + "belarusian", + "bengali", + "bosnian", + "bulgarian", + "burmese", + "cantonese", + "catalan", + "cebuano", + "chinese", + "corsican", + "croatian", + "czech", + "danish", + "dutch", + "english", + "esperanto", + "estonian", + "farsi", + "fijian", + "finnish", + "french", + "galician", + "georgian", + "german", + "greek", + "guarani", + "gujarati", + "haitian-creole", + "hausa", + "hawaiian", + "hebrew", + "hindi", + "hmong", + "hungarian", + "icelandic", + "igbo", + "indonesian", + "irish", + "italian", + "japanese", + "javanese", + "kannada", + "kazakh", + "khmer", + "kinyarwanda", + "korean", + "kurdish", + "kyrgyz", + "lao", + "latin", + "latvian", + "lingala", + "lithuanian", + "luxembourgish", + "macedonian", + "malagasy", + "malay", + "malayalam", + "maltese", + "maori", + "marathi", + "mongolian", + "nepali", + "norwegian", + "odia", + "oromo", + "pashto", + "pidgin", + "polish", + "portuguese", + "punjabi", + "quechua", + "romanian", + "russian", + "samoan", + "scottish-gaelic", + "serbian", + "sesotho", + "shona", + "sindhi", + "sinhala", + "slovak", + "slovene", + "somali", + "spanish", + "sundanese", + "swahili", + "swedish", + "tagalog", + "tajik", + "tamil", + "tatar", + "telugu", + "thai", + "tibetan", + "tigrinya", + "tongan", + "tswana", + "turkish", + "turkmen", + "ukrainian", + "urdu", + "uyghur", + "uzbek", + "vietnamese", + "welsh", + "wolof", + "xhosa", + "yiddish", + "yoruba", + "zulu", + ] + ] = None + """The primary language of the brand's website content. + + Detected from the HTML lang tag, page content analysis, or social media + descriptions. + """ + slogan: Optional[str] = None """The brand's slogan""" diff --git a/src/context/dev/types/brand_retrieve_by_isin_params.py b/src/context/dev/types/brand_retrieve_by_isin_params.py index db559fae..5be121e4 100644 --- a/src/context/dev/types/brand_retrieve_by_isin_params.py +++ b/src/context/dev/types/brand_retrieve_by_isin_params.py @@ -18,61 +18,126 @@ class BrandRetrieveByIsinParams(TypedDict, total=False): """ force_language: Literal[ + "afrikaans", "albanian", + "amharic", "arabic", + "armenian", + "assamese", + "aymara", "azeri", + "basque", + "belarusian", "bengali", + "bosnian", "bulgarian", + "burmese", "cantonese", + "catalan", "cebuano", + "chinese", + "corsican", "croatian", "czech", "danish", "dutch", "english", + "esperanto", "estonian", "farsi", + "fijian", "finnish", "french", + "galician", + "georgian", "german", + "greek", + "guarani", + "gujarati", + "haitian-creole", "hausa", "hawaiian", + "hebrew", "hindi", + "hmong", "hungarian", "icelandic", + "igbo", "indonesian", + "irish", "italian", + "japanese", + "javanese", + "kannada", "kazakh", + "khmer", + "kinyarwanda", "korean", + "kurdish", "kyrgyz", + "lao", "latin", "latvian", + "lingala", "lithuanian", + "luxembourgish", "macedonian", + "malagasy", + "malay", + "malayalam", + "maltese", + "maori", + "marathi", "mongolian", "nepali", "norwegian", + "odia", + "oromo", "pashto", "pidgin", "polish", "portuguese", + "punjabi", + "quechua", "romanian", "russian", + "samoan", + "scottish-gaelic", "serbian", + "sesotho", + "shona", + "sindhi", + "sinhala", "slovak", "slovene", "somali", "spanish", + "sundanese", "swahili", "swedish", "tagalog", + "tajik", + "tamil", + "tatar", + "telugu", "thai", + "tibetan", + "tigrinya", + "tongan", + "tswana", "turkish", + "turkmen", "ukrainian", "urdu", + "uyghur", "uzbek", "vietnamese", "welsh", + "wolof", + "xhosa", + "yiddish", + "yoruba", + "zulu", ] """Optional parameter to force the language of the retrieved brand data.""" diff --git a/src/context/dev/types/brand_retrieve_by_isin_response.py b/src/context/dev/types/brand_retrieve_by_isin_response.py index 21a860e4..3d080e9d 100644 --- a/src/context/dev/types/brand_retrieve_by_isin_response.py +++ b/src/context/dev/types/brand_retrieve_by_isin_response.py @@ -415,8 +415,42 @@ class BrandLogo(BaseModel): class BrandSocial(BaseModel): - type: Optional[str] = None - """Type of social media, e.g., 'facebook', 'twitter'""" + type: Optional[ + Literal[ + "x", + "facebook", + "instagram", + "linkedin", + "youtube", + "pinterest", + "tiktok", + "dribbble", + "github", + "behance", + "snapchat", + "whatsapp", + "telegram", + "line", + "discord", + "twitch", + "vimeo", + "imdb", + "tumblr", + "flickr", + "giphy", + "medium", + "spotify", + "soundcloud", + "tripadvisor", + "yelp", + "producthunt", + "reddit", + "crunchbase", + "appstore", + "playstore", + ] + ] = None + """Type of social media platform""" url: Optional[str] = None """URL of the social media page""" @@ -470,6 +504,136 @@ class Brand(BaseModel): phone: Optional[str] = None """Company phone number""" + primary_language: Optional[ + Literal[ + "afrikaans", + "albanian", + "amharic", + "arabic", + "armenian", + "assamese", + "aymara", + "azeri", + "basque", + "belarusian", + "bengali", + "bosnian", + "bulgarian", + "burmese", + "cantonese", + "catalan", + "cebuano", + "chinese", + "corsican", + "croatian", + "czech", + "danish", + "dutch", + "english", + "esperanto", + "estonian", + "farsi", + "fijian", + "finnish", + "french", + "galician", + "georgian", + "german", + "greek", + "guarani", + "gujarati", + "haitian-creole", + "hausa", + "hawaiian", + "hebrew", + "hindi", + "hmong", + "hungarian", + "icelandic", + "igbo", + "indonesian", + "irish", + "italian", + "japanese", + "javanese", + "kannada", + "kazakh", + "khmer", + "kinyarwanda", + "korean", + "kurdish", + "kyrgyz", + "lao", + "latin", + "latvian", + "lingala", + "lithuanian", + "luxembourgish", + "macedonian", + "malagasy", + "malay", + "malayalam", + "maltese", + "maori", + "marathi", + "mongolian", + "nepali", + "norwegian", + "odia", + "oromo", + "pashto", + "pidgin", + "polish", + "portuguese", + "punjabi", + "quechua", + "romanian", + "russian", + "samoan", + "scottish-gaelic", + "serbian", + "sesotho", + "shona", + "sindhi", + "sinhala", + "slovak", + "slovene", + "somali", + "spanish", + "sundanese", + "swahili", + "swedish", + "tagalog", + "tajik", + "tamil", + "tatar", + "telugu", + "thai", + "tibetan", + "tigrinya", + "tongan", + "tswana", + "turkish", + "turkmen", + "ukrainian", + "urdu", + "uyghur", + "uzbek", + "vietnamese", + "welsh", + "wolof", + "xhosa", + "yiddish", + "yoruba", + "zulu", + ] + ] = None + """The primary language of the brand's website content. + + Detected from the HTML lang tag, page content analysis, or social media + descriptions. + """ + slogan: Optional[str] = None """The brand's slogan""" diff --git a/src/context/dev/types/brand_retrieve_by_name_params.py b/src/context/dev/types/brand_retrieve_by_name_params.py index 847bdb3f..31a9eefe 100644 --- a/src/context/dev/types/brand_retrieve_by_name_params.py +++ b/src/context/dev/types/brand_retrieve_by_name_params.py @@ -263,61 +263,126 @@ class BrandRetrieveByNameParams(TypedDict, total=False): """ force_language: Literal[ + "afrikaans", "albanian", + "amharic", "arabic", + "armenian", + "assamese", + "aymara", "azeri", + "basque", + "belarusian", "bengali", + "bosnian", "bulgarian", + "burmese", "cantonese", + "catalan", "cebuano", + "chinese", + "corsican", "croatian", "czech", "danish", "dutch", "english", + "esperanto", "estonian", "farsi", + "fijian", "finnish", "french", + "galician", + "georgian", "german", + "greek", + "guarani", + "gujarati", + "haitian-creole", "hausa", "hawaiian", + "hebrew", "hindi", + "hmong", "hungarian", "icelandic", + "igbo", "indonesian", + "irish", "italian", + "japanese", + "javanese", + "kannada", "kazakh", + "khmer", + "kinyarwanda", "korean", + "kurdish", "kyrgyz", + "lao", "latin", "latvian", + "lingala", "lithuanian", + "luxembourgish", "macedonian", + "malagasy", + "malay", + "malayalam", + "maltese", + "maori", + "marathi", "mongolian", "nepali", "norwegian", + "odia", + "oromo", "pashto", "pidgin", "polish", "portuguese", + "punjabi", + "quechua", "romanian", "russian", + "samoan", + "scottish-gaelic", "serbian", + "sesotho", + "shona", + "sindhi", + "sinhala", "slovak", "slovene", "somali", "spanish", + "sundanese", "swahili", "swedish", "tagalog", + "tajik", + "tamil", + "tatar", + "telugu", "thai", + "tibetan", + "tigrinya", + "tongan", + "tswana", "turkish", + "turkmen", "ukrainian", "urdu", + "uyghur", "uzbek", "vietnamese", "welsh", + "wolof", + "xhosa", + "yiddish", + "yoruba", + "zulu", ] """Optional parameter to force the language of the retrieved brand data.""" diff --git a/src/context/dev/types/brand_retrieve_by_name_response.py b/src/context/dev/types/brand_retrieve_by_name_response.py index 1e462e7c..9a5b18e5 100644 --- a/src/context/dev/types/brand_retrieve_by_name_response.py +++ b/src/context/dev/types/brand_retrieve_by_name_response.py @@ -415,8 +415,42 @@ class BrandLogo(BaseModel): class BrandSocial(BaseModel): - type: Optional[str] = None - """Type of social media, e.g., 'facebook', 'twitter'""" + type: Optional[ + Literal[ + "x", + "facebook", + "instagram", + "linkedin", + "youtube", + "pinterest", + "tiktok", + "dribbble", + "github", + "behance", + "snapchat", + "whatsapp", + "telegram", + "line", + "discord", + "twitch", + "vimeo", + "imdb", + "tumblr", + "flickr", + "giphy", + "medium", + "spotify", + "soundcloud", + "tripadvisor", + "yelp", + "producthunt", + "reddit", + "crunchbase", + "appstore", + "playstore", + ] + ] = None + """Type of social media platform""" url: Optional[str] = None """URL of the social media page""" @@ -470,6 +504,136 @@ class Brand(BaseModel): phone: Optional[str] = None """Company phone number""" + primary_language: Optional[ + Literal[ + "afrikaans", + "albanian", + "amharic", + "arabic", + "armenian", + "assamese", + "aymara", + "azeri", + "basque", + "belarusian", + "bengali", + "bosnian", + "bulgarian", + "burmese", + "cantonese", + "catalan", + "cebuano", + "chinese", + "corsican", + "croatian", + "czech", + "danish", + "dutch", + "english", + "esperanto", + "estonian", + "farsi", + "fijian", + "finnish", + "french", + "galician", + "georgian", + "german", + "greek", + "guarani", + "gujarati", + "haitian-creole", + "hausa", + "hawaiian", + "hebrew", + "hindi", + "hmong", + "hungarian", + "icelandic", + "igbo", + "indonesian", + "irish", + "italian", + "japanese", + "javanese", + "kannada", + "kazakh", + "khmer", + "kinyarwanda", + "korean", + "kurdish", + "kyrgyz", + "lao", + "latin", + "latvian", + "lingala", + "lithuanian", + "luxembourgish", + "macedonian", + "malagasy", + "malay", + "malayalam", + "maltese", + "maori", + "marathi", + "mongolian", + "nepali", + "norwegian", + "odia", + "oromo", + "pashto", + "pidgin", + "polish", + "portuguese", + "punjabi", + "quechua", + "romanian", + "russian", + "samoan", + "scottish-gaelic", + "serbian", + "sesotho", + "shona", + "sindhi", + "sinhala", + "slovak", + "slovene", + "somali", + "spanish", + "sundanese", + "swahili", + "swedish", + "tagalog", + "tajik", + "tamil", + "tatar", + "telugu", + "thai", + "tibetan", + "tigrinya", + "tongan", + "tswana", + "turkish", + "turkmen", + "ukrainian", + "urdu", + "uyghur", + "uzbek", + "vietnamese", + "welsh", + "wolof", + "xhosa", + "yiddish", + "yoruba", + "zulu", + ] + ] = None + """The primary language of the brand's website content. + + Detected from the HTML lang tag, page content analysis, or social media + descriptions. + """ + slogan: Optional[str] = None """The brand's slogan""" diff --git a/src/context/dev/types/brand_retrieve_by_ticker_params.py b/src/context/dev/types/brand_retrieve_by_ticker_params.py index d3283850..9d1124f8 100644 --- a/src/context/dev/types/brand_retrieve_by_ticker_params.py +++ b/src/context/dev/types/brand_retrieve_by_ticker_params.py @@ -17,61 +17,126 @@ class BrandRetrieveByTickerParams(TypedDict, total=False): """ force_language: Literal[ + "afrikaans", "albanian", + "amharic", "arabic", + "armenian", + "assamese", + "aymara", "azeri", + "basque", + "belarusian", "bengali", + "bosnian", "bulgarian", + "burmese", "cantonese", + "catalan", "cebuano", + "chinese", + "corsican", "croatian", "czech", "danish", "dutch", "english", + "esperanto", "estonian", "farsi", + "fijian", "finnish", "french", + "galician", + "georgian", "german", + "greek", + "guarani", + "gujarati", + "haitian-creole", "hausa", "hawaiian", + "hebrew", "hindi", + "hmong", "hungarian", "icelandic", + "igbo", "indonesian", + "irish", "italian", + "japanese", + "javanese", + "kannada", "kazakh", + "khmer", + "kinyarwanda", "korean", + "kurdish", "kyrgyz", + "lao", "latin", "latvian", + "lingala", "lithuanian", + "luxembourgish", "macedonian", + "malagasy", + "malay", + "malayalam", + "maltese", + "maori", + "marathi", "mongolian", "nepali", "norwegian", + "odia", + "oromo", "pashto", "pidgin", "polish", "portuguese", + "punjabi", + "quechua", "romanian", "russian", + "samoan", + "scottish-gaelic", "serbian", + "sesotho", + "shona", + "sindhi", + "sinhala", "slovak", "slovene", "somali", "spanish", + "sundanese", "swahili", "swedish", "tagalog", + "tajik", + "tamil", + "tatar", + "telugu", "thai", + "tibetan", + "tigrinya", + "tongan", + "tswana", "turkish", + "turkmen", "ukrainian", "urdu", + "uyghur", "uzbek", "vietnamese", "welsh", + "wolof", + "xhosa", + "yiddish", + "yoruba", + "zulu", ] """Optional parameter to force the language of the retrieved brand data.""" diff --git a/src/context/dev/types/brand_retrieve_by_ticker_response.py b/src/context/dev/types/brand_retrieve_by_ticker_response.py index 9815a65a..964d7a45 100644 --- a/src/context/dev/types/brand_retrieve_by_ticker_response.py +++ b/src/context/dev/types/brand_retrieve_by_ticker_response.py @@ -415,8 +415,42 @@ class BrandLogo(BaseModel): class BrandSocial(BaseModel): - type: Optional[str] = None - """Type of social media, e.g., 'facebook', 'twitter'""" + type: Optional[ + Literal[ + "x", + "facebook", + "instagram", + "linkedin", + "youtube", + "pinterest", + "tiktok", + "dribbble", + "github", + "behance", + "snapchat", + "whatsapp", + "telegram", + "line", + "discord", + "twitch", + "vimeo", + "imdb", + "tumblr", + "flickr", + "giphy", + "medium", + "spotify", + "soundcloud", + "tripadvisor", + "yelp", + "producthunt", + "reddit", + "crunchbase", + "appstore", + "playstore", + ] + ] = None + """Type of social media platform""" url: Optional[str] = None """URL of the social media page""" @@ -470,6 +504,136 @@ class Brand(BaseModel): phone: Optional[str] = None """Company phone number""" + primary_language: Optional[ + Literal[ + "afrikaans", + "albanian", + "amharic", + "arabic", + "armenian", + "assamese", + "aymara", + "azeri", + "basque", + "belarusian", + "bengali", + "bosnian", + "bulgarian", + "burmese", + "cantonese", + "catalan", + "cebuano", + "chinese", + "corsican", + "croatian", + "czech", + "danish", + "dutch", + "english", + "esperanto", + "estonian", + "farsi", + "fijian", + "finnish", + "french", + "galician", + "georgian", + "german", + "greek", + "guarani", + "gujarati", + "haitian-creole", + "hausa", + "hawaiian", + "hebrew", + "hindi", + "hmong", + "hungarian", + "icelandic", + "igbo", + "indonesian", + "irish", + "italian", + "japanese", + "javanese", + "kannada", + "kazakh", + "khmer", + "kinyarwanda", + "korean", + "kurdish", + "kyrgyz", + "lao", + "latin", + "latvian", + "lingala", + "lithuanian", + "luxembourgish", + "macedonian", + "malagasy", + "malay", + "malayalam", + "maltese", + "maori", + "marathi", + "mongolian", + "nepali", + "norwegian", + "odia", + "oromo", + "pashto", + "pidgin", + "polish", + "portuguese", + "punjabi", + "quechua", + "romanian", + "russian", + "samoan", + "scottish-gaelic", + "serbian", + "sesotho", + "shona", + "sindhi", + "sinhala", + "slovak", + "slovene", + "somali", + "spanish", + "sundanese", + "swahili", + "swedish", + "tagalog", + "tajik", + "tamil", + "tatar", + "telugu", + "thai", + "tibetan", + "tigrinya", + "tongan", + "tswana", + "turkish", + "turkmen", + "ukrainian", + "urdu", + "uyghur", + "uzbek", + "vietnamese", + "welsh", + "wolof", + "xhosa", + "yiddish", + "yoruba", + "zulu", + ] + ] = None + """The primary language of the brand's website content. + + Detected from the HTML lang tag, page content analysis, or social media + descriptions. + """ + slogan: Optional[str] = None """The brand's slogan""" diff --git a/src/context/dev/types/brand_retrieve_params.py b/src/context/dev/types/brand_retrieve_params.py index 03e102aa..d25c4c0b 100644 --- a/src/context/dev/types/brand_retrieve_params.py +++ b/src/context/dev/types/brand_retrieve_params.py @@ -17,66 +17,128 @@ class BrandRetrieveParams(TypedDict, total=False): """ force_language: Literal[ + "afrikaans", "albanian", + "amharic", "arabic", + "armenian", + "assamese", + "aymara", "azeri", + "basque", + "belarusian", "bengali", + "bosnian", "bulgarian", + "burmese", "cantonese", + "catalan", "cebuano", + "chinese", + "corsican", "croatian", "czech", "danish", "dutch", "english", + "esperanto", "estonian", "farsi", + "fijian", "finnish", "french", + "galician", + "georgian", "german", + "greek", + "guarani", + "gujarati", + "haitian-creole", "hausa", "hawaiian", + "hebrew", "hindi", + "hmong", "hungarian", "icelandic", + "igbo", "indonesian", + "irish", "italian", + "japanese", + "javanese", + "kannada", "kazakh", + "khmer", + "kinyarwanda", "korean", + "kurdish", "kyrgyz", + "lao", "latin", "latvian", + "lingala", "lithuanian", + "luxembourgish", "macedonian", + "malagasy", + "malay", + "malayalam", + "maltese", + "maori", + "marathi", "mongolian", "nepali", "norwegian", + "odia", + "oromo", "pashto", "pidgin", "polish", "portuguese", + "punjabi", + "quechua", "romanian", "russian", + "samoan", + "scottish-gaelic", "serbian", + "sesotho", + "shona", + "sindhi", + "sinhala", "slovak", "slovene", "somali", "spanish", + "sundanese", "swahili", "swedish", "tagalog", + "tajik", + "tamil", + "tatar", + "telugu", "thai", + "tibetan", + "tigrinya", + "tongan", + "tswana", "turkish", + "turkmen", "ukrainian", "urdu", + "uyghur", "uzbek", "vietnamese", "welsh", + "wolof", + "xhosa", + "yiddish", + "yoruba", + "zulu", ] - """Optional parameter to force the language of the retrieved brand data. - - Works with all three lookup methods. - """ + """Optional parameter to force the language of the retrieved brand data.""" max_speed: Annotated[bool, PropertyInfo(alias="maxSpeed")] """Optional parameter to optimize the API call for maximum speed. diff --git a/src/context/dev/types/brand_retrieve_response.py b/src/context/dev/types/brand_retrieve_response.py index 28aea6f0..d272dab6 100644 --- a/src/context/dev/types/brand_retrieve_response.py +++ b/src/context/dev/types/brand_retrieve_response.py @@ -415,8 +415,42 @@ class BrandLogo(BaseModel): class BrandSocial(BaseModel): - type: Optional[str] = None - """Type of social media, e.g., 'facebook', 'twitter'""" + type: Optional[ + Literal[ + "x", + "facebook", + "instagram", + "linkedin", + "youtube", + "pinterest", + "tiktok", + "dribbble", + "github", + "behance", + "snapchat", + "whatsapp", + "telegram", + "line", + "discord", + "twitch", + "vimeo", + "imdb", + "tumblr", + "flickr", + "giphy", + "medium", + "spotify", + "soundcloud", + "tripadvisor", + "yelp", + "producthunt", + "reddit", + "crunchbase", + "appstore", + "playstore", + ] + ] = None + """Type of social media platform""" url: Optional[str] = None """URL of the social media page""" @@ -470,6 +504,136 @@ class Brand(BaseModel): phone: Optional[str] = None """Company phone number""" + primary_language: Optional[ + Literal[ + "afrikaans", + "albanian", + "amharic", + "arabic", + "armenian", + "assamese", + "aymara", + "azeri", + "basque", + "belarusian", + "bengali", + "bosnian", + "bulgarian", + "burmese", + "cantonese", + "catalan", + "cebuano", + "chinese", + "corsican", + "croatian", + "czech", + "danish", + "dutch", + "english", + "esperanto", + "estonian", + "farsi", + "fijian", + "finnish", + "french", + "galician", + "georgian", + "german", + "greek", + "guarani", + "gujarati", + "haitian-creole", + "hausa", + "hawaiian", + "hebrew", + "hindi", + "hmong", + "hungarian", + "icelandic", + "igbo", + "indonesian", + "irish", + "italian", + "japanese", + "javanese", + "kannada", + "kazakh", + "khmer", + "kinyarwanda", + "korean", + "kurdish", + "kyrgyz", + "lao", + "latin", + "latvian", + "lingala", + "lithuanian", + "luxembourgish", + "macedonian", + "malagasy", + "malay", + "malayalam", + "maltese", + "maori", + "marathi", + "mongolian", + "nepali", + "norwegian", + "odia", + "oromo", + "pashto", + "pidgin", + "polish", + "portuguese", + "punjabi", + "quechua", + "romanian", + "russian", + "samoan", + "scottish-gaelic", + "serbian", + "sesotho", + "shona", + "sindhi", + "sinhala", + "slovak", + "slovene", + "somali", + "spanish", + "sundanese", + "swahili", + "swedish", + "tagalog", + "tajik", + "tamil", + "tatar", + "telugu", + "thai", + "tibetan", + "tigrinya", + "tongan", + "tswana", + "turkish", + "turkmen", + "ukrainian", + "urdu", + "uyghur", + "uzbek", + "vietnamese", + "welsh", + "wolof", + "xhosa", + "yiddish", + "yoruba", + "zulu", + ] + ] = None + """The primary language of the brand's website content. + + Detected from the HTML lang tag, page content analysis, or social media + descriptions. + """ + slogan: Optional[str] = None """The brand's slogan""" diff --git a/src/context/dev/types/web_screenshot_params.py b/src/context/dev/types/web_screenshot_params.py index 000ff23b..d278e90f 100644 --- a/src/context/dev/types/web_screenshot_params.py +++ b/src/context/dev/types/web_screenshot_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Literal, Annotated, TypedDict from .._utils import PropertyInfo @@ -10,7 +10,14 @@ class WebScreenshotParams(TypedDict, total=False): - domain: Required[str] + direct_url: Annotated[str, PropertyInfo(alias="directUrl")] + """ + A specific URL to screenshot directly, bypassing domain resolution (e.g., + 'https://example.com/pricing'). When provided, the screenshot is taken of this + exact URL. + """ + + domain: str """Domain name to take screenshot of (e.g., 'example.com', 'google.com'). The domain will be automatically normalized and validated. @@ -28,7 +35,8 @@ class WebScreenshotParams(TypedDict, total=False): If provided, the system will scrape the domain's links and use heuristics to find the most appropriate URL for the specified page type (30 supported - languages). If not provided, screenshots the main domain landing page. + languages). If not provided, screenshots the main domain landing page. Only + applicable when using 'domain', not 'directUrl'. """ prioritize: Literal["speed", "quality"] diff --git a/tests/api_resources/test_brand.py b/tests/api_resources/test_brand.py index f02f01e3..cc2de398 100644 --- a/tests/api_resources/test_brand.py +++ b/tests/api_resources/test_brand.py @@ -38,7 +38,7 @@ def test_method_retrieve(self, client: ContextDev) -> None: def test_method_retrieve_with_all_params(self, client: ContextDev) -> None: brand = client.brand.retrieve( domain="domain", - force_language="albanian", + force_language="afrikaans", max_speed=True, timeout_ms=1000, ) @@ -85,7 +85,7 @@ def test_method_identify_from_transaction_with_all_params(self, client: ContextD transaction_info="transaction_info", city="city", country_gl="ad", - force_language="albanian", + force_language="afrikaans", high_confidence_only=True, max_speed=True, mcc="mcc", @@ -133,7 +133,7 @@ def test_method_retrieve_by_email(self, client: ContextDev) -> None: def test_method_retrieve_by_email_with_all_params(self, client: ContextDev) -> None: brand = client.brand.retrieve_by_email( email="dev@stainless.com", - force_language="albanian", + force_language="afrikaans", max_speed=True, timeout_ms=1000, ) @@ -178,7 +178,7 @@ def test_method_retrieve_by_isin(self, client: ContextDev) -> None: def test_method_retrieve_by_isin_with_all_params(self, client: ContextDev) -> None: brand = client.brand.retrieve_by_isin( isin="SE60513A9993", - force_language="albanian", + force_language="afrikaans", max_speed=True, timeout_ms=1000, ) @@ -224,7 +224,7 @@ def test_method_retrieve_by_name_with_all_params(self, client: ContextDev) -> No brand = client.brand.retrieve_by_name( name="xxx", country_gl="ad", - force_language="albanian", + force_language="afrikaans", max_speed=True, timeout_ms=1000, ) @@ -269,7 +269,7 @@ def test_method_retrieve_by_ticker(self, client: ContextDev) -> None: def test_method_retrieve_by_ticker_with_all_params(self, client: ContextDev) -> None: brand = client.brand.retrieve_by_ticker( ticker="ticker", - force_language="albanian", + force_language="afrikaans", max_speed=True, ticker_exchange="AMEX", timeout_ms=1000, @@ -364,7 +364,7 @@ async def test_method_retrieve(self, async_client: AsyncContextDev) -> None: async def test_method_retrieve_with_all_params(self, async_client: AsyncContextDev) -> None: brand = await async_client.brand.retrieve( domain="domain", - force_language="albanian", + force_language="afrikaans", max_speed=True, timeout_ms=1000, ) @@ -411,7 +411,7 @@ async def test_method_identify_from_transaction_with_all_params(self, async_clie transaction_info="transaction_info", city="city", country_gl="ad", - force_language="albanian", + force_language="afrikaans", high_confidence_only=True, max_speed=True, mcc="mcc", @@ -459,7 +459,7 @@ async def test_method_retrieve_by_email(self, async_client: AsyncContextDev) -> async def test_method_retrieve_by_email_with_all_params(self, async_client: AsyncContextDev) -> None: brand = await async_client.brand.retrieve_by_email( email="dev@stainless.com", - force_language="albanian", + force_language="afrikaans", max_speed=True, timeout_ms=1000, ) @@ -504,7 +504,7 @@ async def test_method_retrieve_by_isin(self, async_client: AsyncContextDev) -> N async def test_method_retrieve_by_isin_with_all_params(self, async_client: AsyncContextDev) -> None: brand = await async_client.brand.retrieve_by_isin( isin="SE60513A9993", - force_language="albanian", + force_language="afrikaans", max_speed=True, timeout_ms=1000, ) @@ -550,7 +550,7 @@ async def test_method_retrieve_by_name_with_all_params(self, async_client: Async brand = await async_client.brand.retrieve_by_name( name="xxx", country_gl="ad", - force_language="albanian", + force_language="afrikaans", max_speed=True, timeout_ms=1000, ) @@ -595,7 +595,7 @@ async def test_method_retrieve_by_ticker(self, async_client: AsyncContextDev) -> async def test_method_retrieve_by_ticker_with_all_params(self, async_client: AsyncContextDev) -> None: brand = await async_client.brand.retrieve_by_ticker( ticker="ticker", - force_language="albanian", + force_language="afrikaans", max_speed=True, ticker_exchange="AMEX", timeout_ms=1000, diff --git a/tests/api_resources/test_web.py b/tests/api_resources/test_web.py index e170d5ec..2d8a511c 100644 --- a/tests/api_resources/test_web.py +++ b/tests/api_resources/test_web.py @@ -27,15 +27,14 @@ class TestWeb: @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_screenshot(self, client: ContextDev) -> None: - web = client.web.screenshot( - domain="domain", - ) + web = client.web.screenshot() assert_matches_type(WebScreenshotResponse, web, path=["response"]) @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_screenshot_with_all_params(self, client: ContextDev) -> None: web = client.web.screenshot( + direct_url="https://example.com", domain="domain", full_screenshot="true", page="login", @@ -46,9 +45,7 @@ def test_method_screenshot_with_all_params(self, client: ContextDev) -> None: @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_screenshot(self, client: ContextDev) -> None: - response = client.web.with_raw_response.screenshot( - domain="domain", - ) + response = client.web.with_raw_response.screenshot() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -58,9 +55,7 @@ def test_raw_response_screenshot(self, client: ContextDev) -> None: @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_screenshot(self, client: ContextDev) -> None: - with client.web.with_streaming_response.screenshot( - domain="domain", - ) as response: + with client.web.with_streaming_response.screenshot() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -285,15 +280,14 @@ class TestAsyncWeb: @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_screenshot(self, async_client: AsyncContextDev) -> None: - web = await async_client.web.screenshot( - domain="domain", - ) + web = await async_client.web.screenshot() assert_matches_type(WebScreenshotResponse, web, path=["response"]) @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_screenshot_with_all_params(self, async_client: AsyncContextDev) -> None: web = await async_client.web.screenshot( + direct_url="https://example.com", domain="domain", full_screenshot="true", page="login", @@ -304,9 +298,7 @@ async def test_method_screenshot_with_all_params(self, async_client: AsyncContex @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_screenshot(self, async_client: AsyncContextDev) -> None: - response = await async_client.web.with_raw_response.screenshot( - domain="domain", - ) + response = await async_client.web.with_raw_response.screenshot() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -316,9 +308,7 @@ async def test_raw_response_screenshot(self, async_client: AsyncContextDev) -> N @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_screenshot(self, async_client: AsyncContextDev) -> None: - async with async_client.web.with_streaming_response.screenshot( - domain="domain", - ) as response: + async with async_client.web.with_streaming_response.screenshot() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/test_client.py b/tests/test_client.py index 9ab03b10..0dfc3940 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -429,6 +429,30 @@ def test_default_query_option(self) -> None: client.close() + def test_hardcoded_query_params_in_url(self, client: ContextDev) -> None: + request = client._build_request(FinalRequestOptions(method="get", url="/foo?beta=true")) + url = httpx.URL(request.url) + assert dict(url.params) == {"beta": "true"} + + request = client._build_request( + FinalRequestOptions( + method="get", + url="/foo?beta=true", + params={"limit": "10", "page": "abc"}, + ) + ) + url = httpx.URL(request.url) + assert dict(url.params) == {"beta": "true", "limit": "10", "page": "abc"} + + request = client._build_request( + FinalRequestOptions( + method="get", + url="/files/a%2Fb?beta=true", + params={"limit": "10"}, + ) + ) + assert request.url.raw_path == b"/files/a%2Fb?beta=true&limit=10" + def test_request_extra_json(self, client: ContextDev) -> None: request = client._build_request( FinalRequestOptions( @@ -1332,6 +1356,30 @@ async def test_default_query_option(self) -> None: await client.close() + async def test_hardcoded_query_params_in_url(self, async_client: AsyncContextDev) -> None: + request = async_client._build_request(FinalRequestOptions(method="get", url="/foo?beta=true")) + url = httpx.URL(request.url) + assert dict(url.params) == {"beta": "true"} + + request = async_client._build_request( + FinalRequestOptions( + method="get", + url="/foo?beta=true", + params={"limit": "10", "page": "abc"}, + ) + ) + url = httpx.URL(request.url) + assert dict(url.params) == {"beta": "true", "limit": "10", "page": "abc"} + + request = async_client._build_request( + FinalRequestOptions( + method="get", + url="/files/a%2Fb?beta=true", + params={"limit": "10"}, + ) + ) + assert request.url.raw_path == b"/files/a%2Fb?beta=true&limit=10" + def test_request_extra_json(self, client: ContextDev) -> None: request = client._build_request( FinalRequestOptions(