From 99b5fef62b15733d0b2f4a92efde0f9dbb52c1c8 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Thu, 7 Nov 2024 10:42:39 -0500 Subject: [PATCH] SDK regeneration (#225) Co-authored-by: fern-api <115122769+fern-api[bot]@users.noreply.github.com> --- pyproject.toml | 2 +- reference.md | 8 ++++++ src/sayari/core/client_wrapper.py | 2 +- src/sayari/project/client.py | 10 +++++++ .../types/get_project_entities_response.py | 26 +++++++++++++++++++ .../project/types/project_entities_aggs.py | 1 + src/sayari/project/types/project_entity.py | 5 ++++ .../project/types/project_entity_upstream.py | 2 ++ .../trade/types/shipment_search_response.py | 9 ++++--- 9 files changed, 59 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 46a7091..c707123 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "sayari" -version = "0.1.22" +version = "0.1.23" description = "A Python SDK for Sayari" readme = "README.md" authors = [ diff --git a/reference.md b/reference.md index 42d2e55..0e6be61 100644 --- a/reference.md +++ b/reference.md @@ -1831,6 +1831,14 @@ client.project.get_project_entities(
+**combined_hs_codes:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Only return entities that have shipped or received the specified HS code(s). + +
+
+ +
+
+ **translation:** `typing.Optional[str]` — The language code to translate the entity labels to. Defaults to the user's preferred language.
diff --git a/src/sayari/core/client_wrapper.py b/src/sayari/core/client_wrapper.py index 558f4cb..d272ad8 100644 --- a/src/sayari/core/client_wrapper.py +++ b/src/sayari/core/client_wrapper.py @@ -22,7 +22,7 @@ def get_headers(self) -> typing.Dict[str, str]: headers: typing.Dict[str, str] = { "X-Fern-Language": "Python", "X-Fern-SDK-Name": "sayari", - "X-Fern-SDK-Version": "0.1.22", + "X-Fern-SDK-Version": "0.1.23", } token = self._get_token() if token is not None: diff --git a/src/sayari/project/client.py b/src/sayari/project/client.py index 01a3201..3b456a7 100644 --- a/src/sayari/project/client.py +++ b/src/sayari/project/client.py @@ -301,6 +301,7 @@ def get_project_entities( hs_codes: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, received_hs_codes: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, shipped_hs_codes: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + combined_hs_codes: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, translation: typing.Optional[str] = None, sort: typing.Optional[SortField] = None, filters: typing.Optional[typing.Union[ProjectEntitiesFilter, typing.Sequence[ProjectEntitiesFilter]]] = None, @@ -344,6 +345,9 @@ def get_project_entities( shipped_hs_codes : typing.Optional[typing.Union[str, typing.Sequence[str]]] Only return entities that shipped the specified HS code(s). + combined_hs_codes : typing.Optional[typing.Union[str, typing.Sequence[str]]] + Only return entities that have shipped or received the specified HS code(s). + translation : typing.Optional[str] The language code to translate the entity labels to. Defaults to the user's preferred language. @@ -387,6 +391,7 @@ def get_project_entities( "hs_codes": hs_codes, "received_hs_codes": received_hs_codes, "shipped_hs_codes": shipped_hs_codes, + "combined_hs_codes": combined_hs_codes, "translation": translation, "sort": sort, "filters": convert_and_respect_annotation_metadata( @@ -861,6 +866,7 @@ async def get_project_entities( hs_codes: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, received_hs_codes: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, shipped_hs_codes: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + combined_hs_codes: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, translation: typing.Optional[str] = None, sort: typing.Optional[SortField] = None, filters: typing.Optional[typing.Union[ProjectEntitiesFilter, typing.Sequence[ProjectEntitiesFilter]]] = None, @@ -904,6 +910,9 @@ async def get_project_entities( shipped_hs_codes : typing.Optional[typing.Union[str, typing.Sequence[str]]] Only return entities that shipped the specified HS code(s). + combined_hs_codes : typing.Optional[typing.Union[str, typing.Sequence[str]]] + Only return entities that have shipped or received the specified HS code(s). + translation : typing.Optional[str] The language code to translate the entity labels to. Defaults to the user's preferred language. @@ -955,6 +964,7 @@ async def main() -> None: "hs_codes": hs_codes, "received_hs_codes": received_hs_codes, "shipped_hs_codes": shipped_hs_codes, + "combined_hs_codes": combined_hs_codes, "translation": translation, "sort": sort, "filters": convert_and_respect_annotation_metadata( diff --git a/src/sayari/project/types/get_project_entities_response.py b/src/sayari/project/types/get_project_entities_response.py index 6421765..b16974d 100644 --- a/src/sayari/project/types/get_project_entities_response.py +++ b/src/sayari/project/types/get_project_entities_response.py @@ -52,6 +52,7 @@ class GetProjectEntitiesResponse(PaginatedResponse): }, received_hs_codes=["271290", "271220"], shipped_hs_codes=[], + combined_hs_codes=["271290", "271220"], trade_count_incl_mg=TradeCount( receiver_of=5, shipper_of=0, @@ -71,6 +72,8 @@ class GetProjectEntitiesResponse(PaginatedResponse): risk=[], countries=[], entities=0, + match_has_upstream={"FyI9lrlmA-7z_3enlTOhlw": False}, + match_products={"FyI9lrlmA-7z_3enlTOhlw": []}, ), psa=PsaSummary( risk=[ @@ -376,6 +379,29 @@ class GetProjectEntitiesResponse(PaginatedResponse): buckets=[], ), ), + combined_hs_codes=HsCodeAgg( + doc_count=2, + hs_code_terms=HsCodeAggTerms( + doc_count_error_upper_bound=0, + sum_other_doc_count=0, + buckets=[ + HsCodeAggBucket( + key="271290", + doc_count=1, + hs_code_sums=IntKeyValue( + value=4, + ), + ), + HsCodeAggBucket( + key="271220", + doc_count=1, + hs_code_sums=IntKeyValue( + value=1, + ), + ), + ], + ), + ), ), ) """ diff --git a/src/sayari/project/types/project_entities_aggs.py b/src/sayari/project/types/project_entities_aggs.py index 6646752..1da4ee2 100644 --- a/src/sayari/project/types/project_entities_aggs.py +++ b/src/sayari/project/types/project_entities_aggs.py @@ -29,6 +29,7 @@ class ProjectEntitiesAggs(UniversalBaseModel): shipment_counts: typing.Optional[typing.List[BucketAgg]] = None shipped_hs_codes: typing.Optional[HsCodeAgg] = None received_hs_codes: typing.Optional[HsCodeAgg] = None + combined_hs_codes: typing.Optional[HsCodeAgg] = None match_results: typing.Optional[typing.List[BucketAgg]] = None custom_fields: typing.Optional[typing.List[BucketAgg]] = None custom_fields_count: typing.Optional[IntKeyValue] = None diff --git a/src/sayari/project/types/project_entity.py b/src/sayari/project/types/project_entity.py index 86ed6de..5244378 100644 --- a/src/sayari/project/types/project_entity.py +++ b/src/sayari/project/types/project_entity.py @@ -50,6 +50,11 @@ class ProjectEntity(UniversalBaseModel): HS codes received by the entity. """ + combined_hs_codes: typing.List[str] = pydantic.Field() + """ + HS codes shipped or received by the entity. + """ + trade_count_incl_mg: TradeCount = pydantic.Field() """ Counts of sent and received shipments for this entity and its match group. diff --git a/src/sayari/project/types/project_entity_upstream.py b/src/sayari/project/types/project_entity_upstream.py index 50b2114..76f160a 100644 --- a/src/sayari/project/types/project_entity_upstream.py +++ b/src/sayari/project/types/project_entity_upstream.py @@ -12,6 +12,8 @@ class ProjectEntityUpstream(UniversalBaseModel): risk: typing.List[Risk] countries: typing.List[Country] entities: int + match_has_upstream: typing.Dict[str, bool] + match_products: typing.Dict[str, typing.List[str]] if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/sayari/trade/types/shipment_search_response.py b/src/sayari/trade/types/shipment_search_response.py index 4ff83fe..eeeccbe 100644 --- a/src/sayari/trade/types/shipment_search_response.py +++ b/src/sayari/trade/types/shipment_search_response.py @@ -371,12 +371,13 @@ class ShipmentSearchResponse(PaginatedResponse): ], ) ], - arrival_date="2024-05-14", - arrival_country=["RUS"], - departure_country=["DEU"], arrival_address=ShipmentAddress( - country="RUS", + country="RUS - BRB", ), + arrival_date="2022-05-25", + arrival_country=[], + departure_date="2022-05", + departure_country=["USA"], departure_address=ShipmentAddress( country="DEU", ),