Skip to content

Commit

Permalink
SDK regeneration (#225)
Browse files Browse the repository at this point in the history
Co-authored-by: fern-api <115122769+fern-api[bot]@users.noreply.github.com>
  • Loading branch information
fern-api[bot] authored Nov 7, 2024
1 parent ca1cfd9 commit 99b5fef
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 = [
Expand Down
8 changes: 8 additions & 0 deletions reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -1831,6 +1831,14 @@ client.project.get_project_entities(
<dl>
<dd>

**combined_hs_codes:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Only return entities that have shipped or received the specified HS code(s).

</dd>
</dl>

<dl>
<dd>

**translation:** `typing.Optional[str]` — The language code to translate the entity labels to. Defaults to the user's preferred language.

</dd>
Expand Down
2 changes: 1 addition & 1 deletion src/sayari/core/client_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 10 additions & 0 deletions src/sayari/project/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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(
Expand Down
26 changes: 26 additions & 0 deletions src/sayari/project/types/get_project_entities_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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=[
Expand Down Expand Up @@ -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,
),
),
],
),
),
),
)
"""
Expand Down
1 change: 1 addition & 0 deletions src/sayari/project/types/project_entities_aggs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions src/sayari/project/types/project_entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions src/sayari/project/types/project_entity_upstream.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 5 additions & 4 deletions src/sayari/trade/types/shipment_search_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
),
Expand Down

0 comments on commit 99b5fef

Please sign in to comment.