diff --git a/poetry.lock b/poetry.lock index 9b6cbce..03652bf 100644 --- a/poetry.lock +++ b/poetry.lock @@ -132,13 +132,13 @@ socks = ["socksio (==1.*)"] [[package]] name = "idna" -version = "3.6" +version = "3.7" description = "Internationalized Domain Names in Applications (IDNA)" optional = false python-versions = ">=3.5" files = [ - {file = "idna-3.6-py3-none-any.whl", hash = "sha256:c05567e9c24a6b9faaa835c4821bad0590fbb9d5779e7caa6e1cc4978e7eb24f"}, - {file = "idna-3.6.tar.gz", hash = "sha256:9ecdbbd083b06798ae1e86adcbfe8ab1479cf864e4ee30fe4e46a003d12491ca"}, + {file = "idna-3.7-py3-none-any.whl", hash = "sha256:82fee1fc78add43492d3a1898bfa6d8a904cc97d8427f683ed8e798d07761aa0"}, + {file = "idna-3.7.tar.gz", hash = "sha256:028ff3aadf0609c1fd278d8ea3089299412a7a8b9bd005dd08b9f8285bcb5cfc"}, ] [[package]] diff --git a/pyproject.toml b/pyproject.toml index 4fa0754..8bfd39b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "flagright" -version = "1.5.0" +version = "1.5.1" description = "" readme = "README.md" authors = [] diff --git a/src/flagright/__init__.py b/src/flagright/__init__.py index 932c8b3..c93e6b0 100644 --- a/src/flagright/__init__.py +++ b/src/flagright/__init__.py @@ -146,6 +146,7 @@ UserStateDetails, UserWithRulesResult, WalletDetails, + WalletDetailsNetwork, WalletPaymentMethod, WebhookEvent, WebhookEventBase, @@ -321,6 +322,7 @@ "UserStateDetails", "UserWithRulesResult", "WalletDetails", + "WalletDetailsNetwork", "WalletPaymentMethod", "WebhookEvent", "WebhookEventBase", diff --git a/src/flagright/core/client_wrapper.py b/src/flagright/core/client_wrapper.py index 4b6dcd7..000c456 100644 --- a/src/flagright/core/client_wrapper.py +++ b/src/flagright/core/client_wrapper.py @@ -14,7 +14,7 @@ def get_headers(self) -> typing.Dict[str, str]: headers: typing.Dict[str, str] = { "X-Fern-Language": "Python", "X-Fern-SDK-Name": "flagright", - "X-Fern-SDK-Version": "1.5.0", + "X-Fern-SDK-Version": "1.5.1", } headers["x-api-key"] = self.api_key return headers diff --git a/src/flagright/types/__init__.py b/src/flagright/types/__init__.py index 27f16a6..095d9e1 100644 --- a/src/flagright/types/__init__.py +++ b/src/flagright/types/__init__.py @@ -151,6 +151,7 @@ from .user_state_details import UserStateDetails from .user_with_rules_result import UserWithRulesResult from .wallet_details import WalletDetails +from .wallet_details_network import WalletDetailsNetwork from .wallet_payment_method import WalletPaymentMethod from .webhook_event import WebhookEvent from .webhook_event_base import WebhookEventBase @@ -304,6 +305,7 @@ "UserStateDetails", "UserWithRulesResult", "WalletDetails", + "WalletDetailsNetwork", "WalletPaymentMethod", "WebhookEvent", "WebhookEventBase", diff --git a/src/flagright/types/wallet_details.py b/src/flagright/types/wallet_details.py index 75fba32..fffff15 100644 --- a/src/flagright/types/wallet_details.py +++ b/src/flagright/types/wallet_details.py @@ -7,6 +7,7 @@ from .amount import Amount from .email_id import EmailId from .tag import Tag +from .wallet_details_network import WalletDetailsNetwork try: import pydantic.v1 as pydantic # type: ignore @@ -36,6 +37,7 @@ class WalletDetails(pydantic.BaseModel): alias="walletPhoneNumber", description="Phone number associated with the wallet, if any" ) wallet_balance: typing.Optional[Amount] = pydantic.Field(alias="walletBalance") + network: typing.Optional[WalletDetailsNetwork] = pydantic.Field(description="Network of the wallet") def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/src/flagright/types/wallet_details_network.py b/src/flagright/types/wallet_details_network.py new file mode 100644 index 0000000..04ad5e0 --- /dev/null +++ b/src/flagright/types/wallet_details_network.py @@ -0,0 +1,113 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class WalletDetailsNetwork(str, enum.Enum): + """ + Network of the wallet + """ + + BITCOIN = "BITCOIN" + ETHEREUM = "ETHEREUM" + POLYGON = "POLYGON" + BNB_SMART_CHAIN = "BNB_SMART_CHAIN" + BNB_BEACON_CHAIN = "BNB_BEACON_CHAIN" + ARBITRUM_L_2 = "ARBITRUM_L2" + SOLANA = "SOLANA" + AVALANCHE_C_CHAIN = "AVALANCHE_C_CHAIN" + LITECOIN = "LITECOIN" + BITCOIN_CASH = "BITCOIN_CASH" + RIPPLE = "RIPPLE" + STELLAR = "STELLAR" + EOS_PUBLIC = "EOS_PUBLIC" + TRON = "TRON" + CARDANO = "CARDANO" + POLKADOT = "POLKADOT" + NEAR_PROTOCOL = "NEAR_PROTOCOL" + COSMOS = "COSMOS" + DOGECOIN = "DOGECOIN" + OPTIMISM_MAINNET = "OPTIMISM_MAINNET" + FANTOM = "FANTOM" + HEDERA = "HEDERA" + ALGORAND = "ALGORAND" + CELESTIA = "CELESTIA" + + def visit( + self, + bitcoin: typing.Callable[[], T_Result], + ethereum: typing.Callable[[], T_Result], + polygon: typing.Callable[[], T_Result], + bnb_smart_chain: typing.Callable[[], T_Result], + bnb_beacon_chain: typing.Callable[[], T_Result], + arbitrum_l_2: typing.Callable[[], T_Result], + solana: typing.Callable[[], T_Result], + avalanche_c_chain: typing.Callable[[], T_Result], + litecoin: typing.Callable[[], T_Result], + bitcoin_cash: typing.Callable[[], T_Result], + ripple: typing.Callable[[], T_Result], + stellar: typing.Callable[[], T_Result], + eos_public: typing.Callable[[], T_Result], + tron: typing.Callable[[], T_Result], + cardano: typing.Callable[[], T_Result], + polkadot: typing.Callable[[], T_Result], + near_protocol: typing.Callable[[], T_Result], + cosmos: typing.Callable[[], T_Result], + dogecoin: typing.Callable[[], T_Result], + optimism_mainnet: typing.Callable[[], T_Result], + fantom: typing.Callable[[], T_Result], + hedera: typing.Callable[[], T_Result], + algorand: typing.Callable[[], T_Result], + celestia: typing.Callable[[], T_Result], + ) -> T_Result: + if self is WalletDetailsNetwork.BITCOIN: + return bitcoin() + if self is WalletDetailsNetwork.ETHEREUM: + return ethereum() + if self is WalletDetailsNetwork.POLYGON: + return polygon() + if self is WalletDetailsNetwork.BNB_SMART_CHAIN: + return bnb_smart_chain() + if self is WalletDetailsNetwork.BNB_BEACON_CHAIN: + return bnb_beacon_chain() + if self is WalletDetailsNetwork.ARBITRUM_L_2: + return arbitrum_l_2() + if self is WalletDetailsNetwork.SOLANA: + return solana() + if self is WalletDetailsNetwork.AVALANCHE_C_CHAIN: + return avalanche_c_chain() + if self is WalletDetailsNetwork.LITECOIN: + return litecoin() + if self is WalletDetailsNetwork.BITCOIN_CASH: + return bitcoin_cash() + if self is WalletDetailsNetwork.RIPPLE: + return ripple() + if self is WalletDetailsNetwork.STELLAR: + return stellar() + if self is WalletDetailsNetwork.EOS_PUBLIC: + return eos_public() + if self is WalletDetailsNetwork.TRON: + return tron() + if self is WalletDetailsNetwork.CARDANO: + return cardano() + if self is WalletDetailsNetwork.POLKADOT: + return polkadot() + if self is WalletDetailsNetwork.NEAR_PROTOCOL: + return near_protocol() + if self is WalletDetailsNetwork.COSMOS: + return cosmos() + if self is WalletDetailsNetwork.DOGECOIN: + return dogecoin() + if self is WalletDetailsNetwork.OPTIMISM_MAINNET: + return optimism_mainnet() + if self is WalletDetailsNetwork.FANTOM: + return fantom() + if self is WalletDetailsNetwork.HEDERA: + return hedera() + if self is WalletDetailsNetwork.ALGORAND: + return algorand() + if self is WalletDetailsNetwork.CELESTIA: + return celestia()