diff --git a/.stats.yml b/.stats.yml index f7be301..6028d62 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 5 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prelude%2Fprelude-ba7ca51ae8c674c16740d0254504bc208d0c3ea5f9970e347e49e70a22dd9072.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prelude%2Fprelude-ca3f4103971d8bfdb9ea7c345b6112409a62e183460acd29da40a155192d2213.yml diff --git a/src/prelude_python_sdk/resources/transactional.py b/src/prelude_python_sdk/resources/transactional.py index 5fac16f..a6c7015 100644 --- a/src/prelude_python_sdk/resources/transactional.py +++ b/src/prelude_python_sdk/resources/transactional.py @@ -55,7 +55,6 @@ def send( correlation_id: str | NotGiven = NOT_GIVEN, expires_at: str | NotGiven = NOT_GIVEN, from_: str | NotGiven = NOT_GIVEN, - locale: str | NotGiven = NOT_GIVEN, variables: Dict[str, str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -80,11 +79,6 @@ def send( from_: The Sender ID. - locale: A BCP-47 formatted locale string with the language the text message will be sent - to. If there's no locale set, the language will be determined by the country - code of the phone number. If the language specified doesn't exist, the default - set on the template will be used. - variables: The variables to be replaced in the template. extra_headers: Send extra headers @@ -105,7 +99,6 @@ def send( "correlation_id": correlation_id, "expires_at": expires_at, "from_": from_, - "locale": locale, "variables": variables, }, transactional_send_params.TransactionalSendParams, @@ -146,7 +139,6 @@ async def send( correlation_id: str | NotGiven = NOT_GIVEN, expires_at: str | NotGiven = NOT_GIVEN, from_: str | NotGiven = NOT_GIVEN, - locale: str | NotGiven = NOT_GIVEN, variables: Dict[str, str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -171,11 +163,6 @@ async def send( from_: The Sender ID. - locale: A BCP-47 formatted locale string with the language the text message will be sent - to. If there's no locale set, the language will be determined by the country - code of the phone number. If the language specified doesn't exist, the default - set on the template will be used. - variables: The variables to be replaced in the template. extra_headers: Send extra headers @@ -196,7 +183,6 @@ async def send( "correlation_id": correlation_id, "expires_at": expires_at, "from_": from_, - "locale": locale, "variables": variables, }, transactional_send_params.TransactionalSendParams, diff --git a/src/prelude_python_sdk/resources/verification.py b/src/prelude_python_sdk/resources/verification.py index 735a7cc..e6201e1 100644 --- a/src/prelude_python_sdk/resources/verification.py +++ b/src/prelude_python_sdk/resources/verification.py @@ -49,7 +49,6 @@ def create( self, *, target: verification_create_params.Target, - dispatch_id: str | NotGiven = NOT_GIVEN, metadata: verification_create_params.Metadata | NotGiven = NOT_GIVEN, options: verification_create_params.Options | NotGiven = NOT_GIVEN, signals: verification_create_params.Signals | NotGiven = NOT_GIVEN, @@ -69,8 +68,6 @@ def create( Args: target: The target. Currently this can only be an E.164 formatted phone number. - dispatch_id: The identifier of the dispatch that came from the front-end SDK. - metadata: The metadata for this verification. This object will be returned with every response or webhook sent that refers to this verification. @@ -91,7 +88,6 @@ def create( body=maybe_transform( { "target": target, - "dispatch_id": dispatch_id, "metadata": metadata, "options": options, "signals": signals, @@ -172,7 +168,6 @@ async def create( self, *, target: verification_create_params.Target, - dispatch_id: str | NotGiven = NOT_GIVEN, metadata: verification_create_params.Metadata | NotGiven = NOT_GIVEN, options: verification_create_params.Options | NotGiven = NOT_GIVEN, signals: verification_create_params.Signals | NotGiven = NOT_GIVEN, @@ -192,8 +187,6 @@ async def create( Args: target: The target. Currently this can only be an E.164 formatted phone number. - dispatch_id: The identifier of the dispatch that came from the front-end SDK. - metadata: The metadata for this verification. This object will be returned with every response or webhook sent that refers to this verification. @@ -214,7 +207,6 @@ async def create( body=await async_maybe_transform( { "target": target, - "dispatch_id": dispatch_id, "metadata": metadata, "options": options, "signals": signals, diff --git a/src/prelude_python_sdk/types/transactional_send_params.py b/src/prelude_python_sdk/types/transactional_send_params.py index 02be0af..6aba37f 100644 --- a/src/prelude_python_sdk/types/transactional_send_params.py +++ b/src/prelude_python_sdk/types/transactional_send_params.py @@ -29,13 +29,5 @@ class TransactionalSendParams(TypedDict, total=False): from_: Annotated[str, PropertyInfo(alias="from")] """The Sender ID.""" - locale: str - """ - A BCP-47 formatted locale string with the language the text message will be sent - to. If there's no locale set, the language will be determined by the country - code of the phone number. If the language specified doesn't exist, the default - set on the template will be used. - """ - variables: Dict[str, str] """The variables to be replaced in the template.""" diff --git a/src/prelude_python_sdk/types/verification_check_response.py b/src/prelude_python_sdk/types/verification_check_response.py index 7bca9cf..4bcb3b4 100644 --- a/src/prelude_python_sdk/types/verification_check_response.py +++ b/src/prelude_python_sdk/types/verification_check_response.py @@ -13,9 +13,6 @@ class Metadata(BaseModel): class VerificationCheckResponse(BaseModel): - status: Literal["success", "failure", "expired_or_not_found"] - """The status of the check.""" - id: Optional[str] = None """The verification identifier.""" @@ -23,3 +20,6 @@ class VerificationCheckResponse(BaseModel): """The metadata for this verification.""" request_id: Optional[str] = None + + status: Optional[Literal["success", "failure", "expired"]] = None + """The status of the check.""" diff --git a/src/prelude_python_sdk/types/verification_create_params.py b/src/prelude_python_sdk/types/verification_create_params.py index 9ea69a7..1b59abf 100644 --- a/src/prelude_python_sdk/types/verification_create_params.py +++ b/src/prelude_python_sdk/types/verification_create_params.py @@ -4,16 +4,13 @@ from typing_extensions import Literal, Required, TypedDict -__all__ = ["VerificationCreateParams", "Target", "Metadata", "Options", "OptionsAppRealm", "Signals"] +__all__ = ["VerificationCreateParams", "Target", "Metadata", "Options", "Signals"] class VerificationCreateParams(TypedDict, total=False): target: Required[Target] """The target. Currently this can only be an E.164 formatted phone number.""" - dispatch_id: str - """The identifier of the dispatch that came from the front-end SDK.""" - metadata: Metadata """The metadata for this verification. @@ -41,37 +38,12 @@ class Metadata(TypedDict, total=False): """A user-defined identifier to correlate this verification with.""" -class OptionsAppRealm(TypedDict, total=False): - platform: Required[Literal["android"]] - """The platform the SMS will be sent to. - - We are currently only supporting "android". - """ - - value: Required[str] - """The Android SMS Retriever API hash code that identifies your app.""" - - class Options(TypedDict, total=False): - app_realm: OptionsAppRealm - """This allows you to automatically retrieve and fill the OTP code on mobile apps. - - Currently only Android devices are supported. - """ - - code_size: int - """The size of the code generated. - - It should be between 4 and 8. Defaults to the code size specified from the - Dashboard. - """ - - custom_code: str - """The custom code to use for OTP verification. + app_realm: str + """The Android SMS Retriever API hash code that identifies your app. - This feature is only available for compatibility purposes and subject to - Prelude’s approval. Contact us to discuss your use case. For more details, refer - to [Multi Routing](/concepts/multi-routing). + This allows you to automatically retrieve and fill the OTP code on Android + devices. """ locale: str @@ -110,13 +82,13 @@ class Signals(TypedDict, total=False): device_model: str """The model of the user's device.""" - device_platform: Literal["android", "ios", "ipados", "tvos", "web"] + device_platform: Literal["android", "ios", "web"] """The type of the user's device.""" ip: str """The IP address of the user's device.""" - is_trusted_user: bool + is_trusted_user: str """ This signal should provide a higher level of trust, indicating that the user is genuine. For more details, refer to [Signals](/guides/prevent-fraud#signals). diff --git a/src/prelude_python_sdk/types/verification_create_response.py b/src/prelude_python_sdk/types/verification_create_response.py index fdc66ff..f1121cb 100644 --- a/src/prelude_python_sdk/types/verification_create_response.py +++ b/src/prelude_python_sdk/types/verification_create_response.py @@ -13,16 +13,16 @@ class Metadata(BaseModel): class VerificationCreateResponse(BaseModel): - id: str + id: Optional[str] = None """The verification identifier.""" - method: Literal["message"] - """The method used for verifying this phone number.""" - - status: Literal["success", "retry", "blocked"] - """The status of the verification.""" - metadata: Optional[Metadata] = None """The metadata for this verification.""" + method: Optional[Literal["message"]] = None + """The method used for verifying this phone number.""" + request_id: Optional[str] = None + + status: Optional[Literal["success", "retry", "blocked"]] = None + """The status of the verification.""" diff --git a/src/prelude_python_sdk/types/watch_feed_back_response.py b/src/prelude_python_sdk/types/watch_feed_back_response.py index c879860..aa10b12 100644 --- a/src/prelude_python_sdk/types/watch_feed_back_response.py +++ b/src/prelude_python_sdk/types/watch_feed_back_response.py @@ -1,5 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from typing import Optional from .._models import BaseModel @@ -7,5 +8,5 @@ class WatchFeedBackResponse(BaseModel): - id: str + id: Optional[str] = None """A unique identifier for your feedback request.""" diff --git a/src/prelude_python_sdk/types/watch_predict_response.py b/src/prelude_python_sdk/types/watch_predict_response.py index cb5a871..d85e251 100644 --- a/src/prelude_python_sdk/types/watch_predict_response.py +++ b/src/prelude_python_sdk/types/watch_predict_response.py @@ -20,10 +20,10 @@ class Reasoning(BaseModel): class WatchPredictResponse(BaseModel): - id: str + id: Optional[str] = None """A unique identifier for your prediction request.""" - prediction: Literal["allow", "block"] + prediction: Optional[Literal["allow", "block"]] = None """A label indicating the trustworthiness of the phone number.""" - reasoning: Reasoning + reasoning: Optional[Reasoning] = None diff --git a/tests/api_resources/test_transactional.py b/tests/api_resources/test_transactional.py index b4f77bd..7a105f6 100644 --- a/tests/api_resources/test_transactional.py +++ b/tests/api_resources/test_transactional.py @@ -23,8 +23,8 @@ class TestTransactional: @parametrize def test_method_send(self, client: Prelude) -> None: transactional = client.transactional.send( - template_id="template_01jd1xq0cffycayqtdkdbv4d61", - to="+30123456789", + template_id="template_id", + to="to", ) assert_matches_type(TransactionalSendResponse, transactional, path=["response"]) @@ -34,14 +34,13 @@ def test_method_send(self, client: Prelude) -> None: @parametrize def test_method_send_with_all_params(self, client: Prelude) -> None: transactional = client.transactional.send( - template_id="template_01jd1xq0cffycayqtdkdbv4d61", - to="+30123456789", + template_id="template_id", + to="to", callback_url="callback_url", correlation_id="correlation_id", expires_at="expires_at", from_="from", - locale="el-GR", - variables={"foo": "bar"}, + variables={"foo": "string"}, ) assert_matches_type(TransactionalSendResponse, transactional, path=["response"]) @@ -51,8 +50,8 @@ def test_method_send_with_all_params(self, client: Prelude) -> None: @parametrize def test_raw_response_send(self, client: Prelude) -> None: response = client.transactional.with_raw_response.send( - template_id="template_01jd1xq0cffycayqtdkdbv4d61", - to="+30123456789", + template_id="template_id", + to="to", ) assert response.is_closed is True @@ -66,8 +65,8 @@ def test_raw_response_send(self, client: Prelude) -> None: @parametrize def test_streaming_response_send(self, client: Prelude) -> None: with client.transactional.with_streaming_response.send( - template_id="template_01jd1xq0cffycayqtdkdbv4d61", - to="+30123456789", + template_id="template_id", + to="to", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -87,8 +86,8 @@ class TestAsyncTransactional: @parametrize async def test_method_send(self, async_client: AsyncPrelude) -> None: transactional = await async_client.transactional.send( - template_id="template_01jd1xq0cffycayqtdkdbv4d61", - to="+30123456789", + template_id="template_id", + to="to", ) assert_matches_type(TransactionalSendResponse, transactional, path=["response"]) @@ -98,14 +97,13 @@ async def test_method_send(self, async_client: AsyncPrelude) -> None: @parametrize async def test_method_send_with_all_params(self, async_client: AsyncPrelude) -> None: transactional = await async_client.transactional.send( - template_id="template_01jd1xq0cffycayqtdkdbv4d61", - to="+30123456789", + template_id="template_id", + to="to", callback_url="callback_url", correlation_id="correlation_id", expires_at="expires_at", from_="from", - locale="el-GR", - variables={"foo": "bar"}, + variables={"foo": "string"}, ) assert_matches_type(TransactionalSendResponse, transactional, path=["response"]) @@ -115,8 +113,8 @@ async def test_method_send_with_all_params(self, async_client: AsyncPrelude) -> @parametrize async def test_raw_response_send(self, async_client: AsyncPrelude) -> None: response = await async_client.transactional.with_raw_response.send( - template_id="template_01jd1xq0cffycayqtdkdbv4d61", - to="+30123456789", + template_id="template_id", + to="to", ) assert response.is_closed is True @@ -130,8 +128,8 @@ async def test_raw_response_send(self, async_client: AsyncPrelude) -> None: @parametrize async def test_streaming_response_send(self, async_client: AsyncPrelude) -> None: async with async_client.transactional.with_streaming_response.send( - template_id="template_01jd1xq0cffycayqtdkdbv4d61", - to="+30123456789", + template_id="template_id", + to="to", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/test_verification.py b/tests/api_resources/test_verification.py index 6170e67..df37638 100644 --- a/tests/api_resources/test_verification.py +++ b/tests/api_resources/test_verification.py @@ -37,27 +37,21 @@ def test_method_create_with_all_params(self, client: Prelude) -> None: "type": "phone_number", "value": "+30123456789", }, - dispatch_id="dispatch_id", metadata={"correlation_id": "correlation_id"}, options={ - "app_realm": { - "platform": "android", - "value": "value", - }, - "code_size": 5, - "custom_code": "custom_code", + "app_realm": "app_realm", "locale": "el-GR", "sender_id": "sender_id", "template_id": "template_id", }, signals={ - "app_version": "1.2.34", - "device_id": "8F0B8FDD-C2CB-4387-B20A-56E9B2E5A0D2", - "device_model": "iPhone17,2", + "app_version": "app_version", + "device_id": "device_id", + "device_model": "device_model", "device_platform": "android", - "ip": "192.0.2.1", - "is_trusted_user": False, - "os_version": "18.0.1", + "ip": "8.8.8.8", + "is_trusted_user": "is_trusted_user", + "os_version": "os_version", }, ) assert_matches_type(VerificationCreateResponse, verification, path=["response"]) @@ -156,27 +150,21 @@ async def test_method_create_with_all_params(self, async_client: AsyncPrelude) - "type": "phone_number", "value": "+30123456789", }, - dispatch_id="dispatch_id", metadata={"correlation_id": "correlation_id"}, options={ - "app_realm": { - "platform": "android", - "value": "value", - }, - "code_size": 5, - "custom_code": "custom_code", + "app_realm": "app_realm", "locale": "el-GR", "sender_id": "sender_id", "template_id": "template_id", }, signals={ - "app_version": "1.2.34", - "device_id": "8F0B8FDD-C2CB-4387-B20A-56E9B2E5A0D2", - "device_model": "iPhone17,2", + "app_version": "app_version", + "device_id": "device_id", + "device_model": "device_model", "device_platform": "android", - "ip": "192.0.2.1", - "is_trusted_user": False, - "os_version": "18.0.1", + "ip": "8.8.8.8", + "is_trusted_user": "is_trusted_user", + "os_version": "os_version", }, ) assert_matches_type(VerificationCreateResponse, verification, path=["response"])