Skip to content

Commit 32798a9

Browse files
chore(internal): codegen related update (#67)
1 parent affe056 commit 32798a9

11 files changed

+55
-126
lines changed

.stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 5
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prelude%2Fprelude-ba7ca51ae8c674c16740d0254504bc208d0c3ea5f9970e347e49e70a22dd9072.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prelude%2Fprelude-ca3f4103971d8bfdb9ea7c345b6112409a62e183460acd29da40a155192d2213.yml

src/prelude_python_sdk/resources/transactional.py

-14
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ def send(
5555
correlation_id: str | NotGiven = NOT_GIVEN,
5656
expires_at: str | NotGiven = NOT_GIVEN,
5757
from_: str | NotGiven = NOT_GIVEN,
58-
locale: str | NotGiven = NOT_GIVEN,
5958
variables: Dict[str, str] | NotGiven = NOT_GIVEN,
6059
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
6160
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -80,11 +79,6 @@ def send(
8079
8180
from_: The Sender ID.
8281
83-
locale: A BCP-47 formatted locale string with the language the text message will be sent
84-
to. If there's no locale set, the language will be determined by the country
85-
code of the phone number. If the language specified doesn't exist, the default
86-
set on the template will be used.
87-
8882
variables: The variables to be replaced in the template.
8983
9084
extra_headers: Send extra headers
@@ -105,7 +99,6 @@ def send(
10599
"correlation_id": correlation_id,
106100
"expires_at": expires_at,
107101
"from_": from_,
108-
"locale": locale,
109102
"variables": variables,
110103
},
111104
transactional_send_params.TransactionalSendParams,
@@ -146,7 +139,6 @@ async def send(
146139
correlation_id: str | NotGiven = NOT_GIVEN,
147140
expires_at: str | NotGiven = NOT_GIVEN,
148141
from_: str | NotGiven = NOT_GIVEN,
149-
locale: str | NotGiven = NOT_GIVEN,
150142
variables: Dict[str, str] | NotGiven = NOT_GIVEN,
151143
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
152144
# 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(
171163
172164
from_: The Sender ID.
173165
174-
locale: A BCP-47 formatted locale string with the language the text message will be sent
175-
to. If there's no locale set, the language will be determined by the country
176-
code of the phone number. If the language specified doesn't exist, the default
177-
set on the template will be used.
178-
179166
variables: The variables to be replaced in the template.
180167
181168
extra_headers: Send extra headers
@@ -196,7 +183,6 @@ async def send(
196183
"correlation_id": correlation_id,
197184
"expires_at": expires_at,
198185
"from_": from_,
199-
"locale": locale,
200186
"variables": variables,
201187
},
202188
transactional_send_params.TransactionalSendParams,

src/prelude_python_sdk/resources/verification.py

-8
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ def create(
4949
self,
5050
*,
5151
target: verification_create_params.Target,
52-
dispatch_id: str | NotGiven = NOT_GIVEN,
5352
metadata: verification_create_params.Metadata | NotGiven = NOT_GIVEN,
5453
options: verification_create_params.Options | NotGiven = NOT_GIVEN,
5554
signals: verification_create_params.Signals | NotGiven = NOT_GIVEN,
@@ -69,8 +68,6 @@ def create(
6968
Args:
7069
target: The target. Currently this can only be an E.164 formatted phone number.
7170
72-
dispatch_id: The identifier of the dispatch that came from the front-end SDK.
73-
7471
metadata: The metadata for this verification. This object will be returned with every
7572
response or webhook sent that refers to this verification.
7673
@@ -91,7 +88,6 @@ def create(
9188
body=maybe_transform(
9289
{
9390
"target": target,
94-
"dispatch_id": dispatch_id,
9591
"metadata": metadata,
9692
"options": options,
9793
"signals": signals,
@@ -172,7 +168,6 @@ async def create(
172168
self,
173169
*,
174170
target: verification_create_params.Target,
175-
dispatch_id: str | NotGiven = NOT_GIVEN,
176171
metadata: verification_create_params.Metadata | NotGiven = NOT_GIVEN,
177172
options: verification_create_params.Options | NotGiven = NOT_GIVEN,
178173
signals: verification_create_params.Signals | NotGiven = NOT_GIVEN,
@@ -192,8 +187,6 @@ async def create(
192187
Args:
193188
target: The target. Currently this can only be an E.164 formatted phone number.
194189
195-
dispatch_id: The identifier of the dispatch that came from the front-end SDK.
196-
197190
metadata: The metadata for this verification. This object will be returned with every
198191
response or webhook sent that refers to this verification.
199192
@@ -214,7 +207,6 @@ async def create(
214207
body=await async_maybe_transform(
215208
{
216209
"target": target,
217-
"dispatch_id": dispatch_id,
218210
"metadata": metadata,
219211
"options": options,
220212
"signals": signals,

src/prelude_python_sdk/types/transactional_send_params.py

-8
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,5 @@ class TransactionalSendParams(TypedDict, total=False):
2929
from_: Annotated[str, PropertyInfo(alias="from")]
3030
"""The Sender ID."""
3131

32-
locale: str
33-
"""
34-
A BCP-47 formatted locale string with the language the text message will be sent
35-
to. If there's no locale set, the language will be determined by the country
36-
code of the phone number. If the language specified doesn't exist, the default
37-
set on the template will be used.
38-
"""
39-
4032
variables: Dict[str, str]
4133
"""The variables to be replaced in the template."""

src/prelude_python_sdk/types/verification_check_response.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ class Metadata(BaseModel):
1313

1414

1515
class VerificationCheckResponse(BaseModel):
16-
status: Literal["success", "failure", "expired_or_not_found"]
17-
"""The status of the check."""
18-
1916
id: Optional[str] = None
2017
"""The verification identifier."""
2118

2219
metadata: Optional[Metadata] = None
2320
"""The metadata for this verification."""
2421

2522
request_id: Optional[str] = None
23+
24+
status: Optional[Literal["success", "failure", "expired"]] = None
25+
"""The status of the check."""

src/prelude_python_sdk/types/verification_create_params.py

+7-35
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,13 @@
44

55
from typing_extensions import Literal, Required, TypedDict
66

7-
__all__ = ["VerificationCreateParams", "Target", "Metadata", "Options", "OptionsAppRealm", "Signals"]
7+
__all__ = ["VerificationCreateParams", "Target", "Metadata", "Options", "Signals"]
88

99

1010
class VerificationCreateParams(TypedDict, total=False):
1111
target: Required[Target]
1212
"""The target. Currently this can only be an E.164 formatted phone number."""
1313

14-
dispatch_id: str
15-
"""The identifier of the dispatch that came from the front-end SDK."""
16-
1714
metadata: Metadata
1815
"""The metadata for this verification.
1916
@@ -41,37 +38,12 @@ class Metadata(TypedDict, total=False):
4138
"""A user-defined identifier to correlate this verification with."""
4239

4340

44-
class OptionsAppRealm(TypedDict, total=False):
45-
platform: Required[Literal["android"]]
46-
"""The platform the SMS will be sent to.
47-
48-
We are currently only supporting "android".
49-
"""
50-
51-
value: Required[str]
52-
"""The Android SMS Retriever API hash code that identifies your app."""
53-
54-
5541
class Options(TypedDict, total=False):
56-
app_realm: OptionsAppRealm
57-
"""This allows you to automatically retrieve and fill the OTP code on mobile apps.
58-
59-
Currently only Android devices are supported.
60-
"""
61-
62-
code_size: int
63-
"""The size of the code generated.
64-
65-
It should be between 4 and 8. Defaults to the code size specified from the
66-
Dashboard.
67-
"""
68-
69-
custom_code: str
70-
"""The custom code to use for OTP verification.
42+
app_realm: str
43+
"""The Android SMS Retriever API hash code that identifies your app.
7144
72-
This feature is only available for compatibility purposes and subject to
73-
Prelude’s approval. Contact us to discuss your use case. For more details, refer
74-
to [Multi Routing](/concepts/multi-routing).
45+
This allows you to automatically retrieve and fill the OTP code on Android
46+
devices.
7547
"""
7648

7749
locale: str
@@ -110,13 +82,13 @@ class Signals(TypedDict, total=False):
11082
device_model: str
11183
"""The model of the user's device."""
11284

113-
device_platform: Literal["android", "ios", "ipados", "tvos", "web"]
85+
device_platform: Literal["android", "ios", "web"]
11486
"""The type of the user's device."""
11587

11688
ip: str
11789
"""The IP address of the user's device."""
11890

119-
is_trusted_user: bool
91+
is_trusted_user: str
12092
"""
12193
This signal should provide a higher level of trust, indicating that the user is
12294
genuine. For more details, refer to [Signals](/guides/prevent-fraud#signals).

src/prelude_python_sdk/types/verification_create_response.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@ class Metadata(BaseModel):
1313

1414

1515
class VerificationCreateResponse(BaseModel):
16-
id: str
16+
id: Optional[str] = None
1717
"""The verification identifier."""
1818

19-
method: Literal["message"]
20-
"""The method used for verifying this phone number."""
21-
22-
status: Literal["success", "retry", "blocked"]
23-
"""The status of the verification."""
24-
2519
metadata: Optional[Metadata] = None
2620
"""The metadata for this verification."""
2721

22+
method: Optional[Literal["message"]] = None
23+
"""The method used for verifying this phone number."""
24+
2825
request_id: Optional[str] = None
26+
27+
status: Optional[Literal["success", "retry", "blocked"]] = None
28+
"""The status of the verification."""
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3+
from typing import Optional
34

45
from .._models import BaseModel
56

67
__all__ = ["WatchFeedBackResponse"]
78

89

910
class WatchFeedBackResponse(BaseModel):
10-
id: str
11+
id: Optional[str] = None
1112
"""A unique identifier for your feedback request."""

src/prelude_python_sdk/types/watch_predict_response.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ class Reasoning(BaseModel):
2020

2121

2222
class WatchPredictResponse(BaseModel):
23-
id: str
23+
id: Optional[str] = None
2424
"""A unique identifier for your prediction request."""
2525

26-
prediction: Literal["allow", "block"]
26+
prediction: Optional[Literal["allow", "block"]] = None
2727
"""A label indicating the trustworthiness of the phone number."""
2828

29-
reasoning: Reasoning
29+
reasoning: Optional[Reasoning] = None

tests/api_resources/test_transactional.py

+18-20
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ class TestTransactional:
2323
@parametrize
2424
def test_method_send(self, client: Prelude) -> None:
2525
transactional = client.transactional.send(
26-
template_id="template_01jd1xq0cffycayqtdkdbv4d61",
27-
to="+30123456789",
26+
template_id="template_id",
27+
to="to",
2828
)
2929
assert_matches_type(TransactionalSendResponse, transactional, path=["response"])
3030

@@ -34,14 +34,13 @@ def test_method_send(self, client: Prelude) -> None:
3434
@parametrize
3535
def test_method_send_with_all_params(self, client: Prelude) -> None:
3636
transactional = client.transactional.send(
37-
template_id="template_01jd1xq0cffycayqtdkdbv4d61",
38-
to="+30123456789",
37+
template_id="template_id",
38+
to="to",
3939
callback_url="callback_url",
4040
correlation_id="correlation_id",
4141
expires_at="expires_at",
4242
from_="from",
43-
locale="el-GR",
44-
variables={"foo": "bar"},
43+
variables={"foo": "string"},
4544
)
4645
assert_matches_type(TransactionalSendResponse, transactional, path=["response"])
4746

@@ -51,8 +50,8 @@ def test_method_send_with_all_params(self, client: Prelude) -> None:
5150
@parametrize
5251
def test_raw_response_send(self, client: Prelude) -> None:
5352
response = client.transactional.with_raw_response.send(
54-
template_id="template_01jd1xq0cffycayqtdkdbv4d61",
55-
to="+30123456789",
53+
template_id="template_id",
54+
to="to",
5655
)
5756

5857
assert response.is_closed is True
@@ -66,8 +65,8 @@ def test_raw_response_send(self, client: Prelude) -> None:
6665
@parametrize
6766
def test_streaming_response_send(self, client: Prelude) -> None:
6867
with client.transactional.with_streaming_response.send(
69-
template_id="template_01jd1xq0cffycayqtdkdbv4d61",
70-
to="+30123456789",
68+
template_id="template_id",
69+
to="to",
7170
) as response:
7271
assert not response.is_closed
7372
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -87,8 +86,8 @@ class TestAsyncTransactional:
8786
@parametrize
8887
async def test_method_send(self, async_client: AsyncPrelude) -> None:
8988
transactional = await async_client.transactional.send(
90-
template_id="template_01jd1xq0cffycayqtdkdbv4d61",
91-
to="+30123456789",
89+
template_id="template_id",
90+
to="to",
9291
)
9392
assert_matches_type(TransactionalSendResponse, transactional, path=["response"])
9493

@@ -98,14 +97,13 @@ async def test_method_send(self, async_client: AsyncPrelude) -> None:
9897
@parametrize
9998
async def test_method_send_with_all_params(self, async_client: AsyncPrelude) -> None:
10099
transactional = await async_client.transactional.send(
101-
template_id="template_01jd1xq0cffycayqtdkdbv4d61",
102-
to="+30123456789",
100+
template_id="template_id",
101+
to="to",
103102
callback_url="callback_url",
104103
correlation_id="correlation_id",
105104
expires_at="expires_at",
106105
from_="from",
107-
locale="el-GR",
108-
variables={"foo": "bar"},
106+
variables={"foo": "string"},
109107
)
110108
assert_matches_type(TransactionalSendResponse, transactional, path=["response"])
111109

@@ -115,8 +113,8 @@ async def test_method_send_with_all_params(self, async_client: AsyncPrelude) ->
115113
@parametrize
116114
async def test_raw_response_send(self, async_client: AsyncPrelude) -> None:
117115
response = await async_client.transactional.with_raw_response.send(
118-
template_id="template_01jd1xq0cffycayqtdkdbv4d61",
119-
to="+30123456789",
116+
template_id="template_id",
117+
to="to",
120118
)
121119

122120
assert response.is_closed is True
@@ -130,8 +128,8 @@ async def test_raw_response_send(self, async_client: AsyncPrelude) -> None:
130128
@parametrize
131129
async def test_streaming_response_send(self, async_client: AsyncPrelude) -> None:
132130
async with async_client.transactional.with_streaming_response.send(
133-
template_id="template_01jd1xq0cffycayqtdkdbv4d61",
134-
to="+30123456789",
131+
template_id="template_id",
132+
to="to",
135133
) as response:
136134
assert not response.is_closed
137135
assert response.http_request.headers.get("X-Stainless-Lang") == "python"

0 commit comments

Comments
 (0)