Skip to content

Commit ba91c9d

Browse files
committed
feat(api): update via SDK Studio
1 parent 32f323e commit ba91c9d

File tree

16 files changed

+929
-15
lines changed

16 files changed

+929
-15
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
configured_endpoints: 13
1+
configured_endpoints: 15
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/sent%2Fsent-5276b9a8b8ff6771c5bb1a8310d0be63ddafa9e4806f0d81de21dd7a7a673c1b.yml

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ It is generated with [Stainless](https://www.stainlessapi.com/).
1010

1111
## Documentation
1212

13-
The REST API documentation can be found on [sent.dm](https://sent.dm/docs). The full API of this library can be found in [api.md](api.md).
13+
The REST API documentation can be found on [www.sent.dm](https://www.sent.dm/docs). The full API of this library can be found in [api.md](api.md).
1414

1515
## Installation
1616

SECURITY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ or products provided by Sent please follow the respective company's security rep
2020

2121
### Sent Terms and Policies
2222

23-
Please contact dev-feedback@sent.com for any questions or concerns regarding security of our services.
23+
Please contact team@sent.dm for any questions or concerns regarding security of our services.
2424

2525
---
2626

api.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,26 @@
1-
# Shared Types
2-
3-
```python
4-
from sent.types import SentDmServicesContractsDataContactDto
5-
```
6-
71
# Contacts
82

93
Types:
104

115
```python
12-
from sent.types import ContactListResponse
6+
from sent.types import SentDmServicesContractsDataContactDto, ContactListResponse
137
```
148

159
Methods:
1610

17-
- <code title="get /contacts">client.contacts.<a href="./src/sent/resources/contacts.py">list</a>(\*\*<a href="src/sent/types/contact_list_params.py">params</a>) -> <a href="./src/sent/types/contact_list_response.py">object</a></code>
11+
- <code title="get /contacts">client.contacts.<a href="./src/sent/resources/contacts/contacts.py">list</a>(\*\*<a href="src/sent/types/contact_list_params.py">params</a>) -> <a href="./src/sent/types/contact_list_response.py">object</a></code>
12+
13+
## ID
14+
15+
Methods:
16+
17+
- <code title="get /contacts/{customerId}/id/{id}">client.contacts.id.<a href="./src/sent/resources/contacts/id.py">retrieve</a>(id, \*, customer_id) -> <a href="./src/sent/types/sent_dm_services_contracts_data_contact_dto.py">SentDmServicesContractsDataContactDto</a></code>
18+
19+
## Phone
20+
21+
Methods:
22+
23+
- <code title="get /contacts/{customerId}/phone/{phoneNumber}">client.contacts.phone.<a href="./src/sent/resources/contacts/phone.py">retrieve</a>(phone_number, \*, customer_id) -> <a href="./src/sent/types/sent_dm_services_contracts_data_contact_dto.py">SentDmServicesContractsDataContactDto</a></code>
1824

1925
# Messages
2026

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description = "The official Python library for the sent API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"
77
authors = [
8-
{ name = "Sent", email = "dev-feedback@sent.com" },
8+
{ name = "Sent", email = "team@sent.dm" },
99
]
1010
dependencies = [
1111
"httpx>=0.23.0, <1",

src/sent/_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def __init__(
9696
if base_url is None:
9797
base_url = os.environ.get("SENT_BASE_URL")
9898
if base_url is None:
99-
base_url = f"https://sent.dm"
99+
base_url = f"https://api.sent.dm"
100100

101101
super().__init__(
102102
version=__version__,
@@ -274,7 +274,7 @@ def __init__(
274274
if base_url is None:
275275
base_url = os.environ.get("SENT_BASE_URL")
276276
if base_url is None:
277-
base_url = f"https://sent.dm"
277+
base_url = f"https://api.sent.dm"
278278

279279
super().__init__(
280280
version=__version__,
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from .id import (
4+
IDResource,
5+
AsyncIDResource,
6+
IDResourceWithRawResponse,
7+
AsyncIDResourceWithRawResponse,
8+
IDResourceWithStreamingResponse,
9+
AsyncIDResourceWithStreamingResponse,
10+
)
11+
from .phone import (
12+
PhoneResource,
13+
AsyncPhoneResource,
14+
PhoneResourceWithRawResponse,
15+
AsyncPhoneResourceWithRawResponse,
16+
PhoneResourceWithStreamingResponse,
17+
AsyncPhoneResourceWithStreamingResponse,
18+
)
19+
from .contacts import (
20+
ContactsResource,
21+
AsyncContactsResource,
22+
ContactsResourceWithRawResponse,
23+
AsyncContactsResourceWithRawResponse,
24+
ContactsResourceWithStreamingResponse,
25+
AsyncContactsResourceWithStreamingResponse,
26+
)
27+
28+
__all__ = [
29+
"IDResource",
30+
"AsyncIDResource",
31+
"IDResourceWithRawResponse",
32+
"AsyncIDResourceWithRawResponse",
33+
"IDResourceWithStreamingResponse",
34+
"AsyncIDResourceWithStreamingResponse",
35+
"PhoneResource",
36+
"AsyncPhoneResource",
37+
"PhoneResourceWithRawResponse",
38+
"AsyncPhoneResourceWithRawResponse",
39+
"PhoneResourceWithStreamingResponse",
40+
"AsyncPhoneResourceWithStreamingResponse",
41+
"ContactsResource",
42+
"AsyncContactsResource",
43+
"ContactsResourceWithRawResponse",
44+
"AsyncContactsResourceWithRawResponse",
45+
"ContactsResourceWithStreamingResponse",
46+
"AsyncContactsResourceWithStreamingResponse",
47+
]
Lines changed: 249 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,249 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
import httpx
6+
7+
from .id import (
8+
IDResource,
9+
AsyncIDResource,
10+
IDResourceWithRawResponse,
11+
AsyncIDResourceWithRawResponse,
12+
IDResourceWithStreamingResponse,
13+
AsyncIDResourceWithStreamingResponse,
14+
)
15+
from .phone import (
16+
PhoneResource,
17+
AsyncPhoneResource,
18+
PhoneResourceWithRawResponse,
19+
AsyncPhoneResourceWithRawResponse,
20+
PhoneResourceWithStreamingResponse,
21+
AsyncPhoneResourceWithStreamingResponse,
22+
)
23+
from ...types import contact_list_params
24+
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
25+
from ..._utils import (
26+
maybe_transform,
27+
async_maybe_transform,
28+
)
29+
from ..._compat import cached_property
30+
from ..._resource import SyncAPIResource, AsyncAPIResource
31+
from ..._response import (
32+
to_raw_response_wrapper,
33+
to_streamed_response_wrapper,
34+
async_to_raw_response_wrapper,
35+
async_to_streamed_response_wrapper,
36+
)
37+
from ..._base_client import make_request_options
38+
39+
__all__ = ["ContactsResource", "AsyncContactsResource"]
40+
41+
42+
class ContactsResource(SyncAPIResource):
43+
@cached_property
44+
def id(self) -> IDResource:
45+
return IDResource(self._client)
46+
47+
@cached_property
48+
def phone(self) -> PhoneResource:
49+
return PhoneResource(self._client)
50+
51+
@cached_property
52+
def with_raw_response(self) -> ContactsResourceWithRawResponse:
53+
"""
54+
This property can be used as a prefix for any HTTP method call to return the
55+
the raw response object instead of the parsed content.
56+
57+
For more information, see https://www.github.com/stainless-sdks/sent-python#accessing-raw-response-data-eg-headers
58+
"""
59+
return ContactsResourceWithRawResponse(self)
60+
61+
@cached_property
62+
def with_streaming_response(self) -> ContactsResourceWithStreamingResponse:
63+
"""
64+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
65+
66+
For more information, see https://www.github.com/stainless-sdks/sent-python#with_streaming_response
67+
"""
68+
return ContactsResourceWithStreamingResponse(self)
69+
70+
def list(
71+
self,
72+
*,
73+
customer_id: str,
74+
page: int,
75+
page_size: int,
76+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
77+
# The extra values given here take precedence over values defined on the client or passed to this method.
78+
extra_headers: Headers | None = None,
79+
extra_query: Query | None = None,
80+
extra_body: Body | None = None,
81+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
82+
) -> object:
83+
"""
84+
Args:
85+
extra_headers: Send extra headers
86+
87+
extra_query: Add additional query parameters to the request
88+
89+
extra_body: Add additional JSON properties to the request
90+
91+
timeout: Override the client-level default timeout for this request, in seconds
92+
"""
93+
return self._get(
94+
"/contacts",
95+
options=make_request_options(
96+
extra_headers=extra_headers,
97+
extra_query=extra_query,
98+
extra_body=extra_body,
99+
timeout=timeout,
100+
query=maybe_transform(
101+
{
102+
"customer_id": customer_id,
103+
"page": page,
104+
"page_size": page_size,
105+
},
106+
contact_list_params.ContactListParams,
107+
),
108+
),
109+
cast_to=object,
110+
)
111+
112+
113+
class AsyncContactsResource(AsyncAPIResource):
114+
@cached_property
115+
def id(self) -> AsyncIDResource:
116+
return AsyncIDResource(self._client)
117+
118+
@cached_property
119+
def phone(self) -> AsyncPhoneResource:
120+
return AsyncPhoneResource(self._client)
121+
122+
@cached_property
123+
def with_raw_response(self) -> AsyncContactsResourceWithRawResponse:
124+
"""
125+
This property can be used as a prefix for any HTTP method call to return the
126+
the raw response object instead of the parsed content.
127+
128+
For more information, see https://www.github.com/stainless-sdks/sent-python#accessing-raw-response-data-eg-headers
129+
"""
130+
return AsyncContactsResourceWithRawResponse(self)
131+
132+
@cached_property
133+
def with_streaming_response(self) -> AsyncContactsResourceWithStreamingResponse:
134+
"""
135+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
136+
137+
For more information, see https://www.github.com/stainless-sdks/sent-python#with_streaming_response
138+
"""
139+
return AsyncContactsResourceWithStreamingResponse(self)
140+
141+
async def list(
142+
self,
143+
*,
144+
customer_id: str,
145+
page: int,
146+
page_size: int,
147+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
148+
# The extra values given here take precedence over values defined on the client or passed to this method.
149+
extra_headers: Headers | None = None,
150+
extra_query: Query | None = None,
151+
extra_body: Body | None = None,
152+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
153+
) -> object:
154+
"""
155+
Args:
156+
extra_headers: Send extra headers
157+
158+
extra_query: Add additional query parameters to the request
159+
160+
extra_body: Add additional JSON properties to the request
161+
162+
timeout: Override the client-level default timeout for this request, in seconds
163+
"""
164+
return await self._get(
165+
"/contacts",
166+
options=make_request_options(
167+
extra_headers=extra_headers,
168+
extra_query=extra_query,
169+
extra_body=extra_body,
170+
timeout=timeout,
171+
query=await async_maybe_transform(
172+
{
173+
"customer_id": customer_id,
174+
"page": page,
175+
"page_size": page_size,
176+
},
177+
contact_list_params.ContactListParams,
178+
),
179+
),
180+
cast_to=object,
181+
)
182+
183+
184+
class ContactsResourceWithRawResponse:
185+
def __init__(self, contacts: ContactsResource) -> None:
186+
self._contacts = contacts
187+
188+
self.list = to_raw_response_wrapper(
189+
contacts.list,
190+
)
191+
192+
@cached_property
193+
def id(self) -> IDResourceWithRawResponse:
194+
return IDResourceWithRawResponse(self._contacts.id)
195+
196+
@cached_property
197+
def phone(self) -> PhoneResourceWithRawResponse:
198+
return PhoneResourceWithRawResponse(self._contacts.phone)
199+
200+
201+
class AsyncContactsResourceWithRawResponse:
202+
def __init__(self, contacts: AsyncContactsResource) -> None:
203+
self._contacts = contacts
204+
205+
self.list = async_to_raw_response_wrapper(
206+
contacts.list,
207+
)
208+
209+
@cached_property
210+
def id(self) -> AsyncIDResourceWithRawResponse:
211+
return AsyncIDResourceWithRawResponse(self._contacts.id)
212+
213+
@cached_property
214+
def phone(self) -> AsyncPhoneResourceWithRawResponse:
215+
return AsyncPhoneResourceWithRawResponse(self._contacts.phone)
216+
217+
218+
class ContactsResourceWithStreamingResponse:
219+
def __init__(self, contacts: ContactsResource) -> None:
220+
self._contacts = contacts
221+
222+
self.list = to_streamed_response_wrapper(
223+
contacts.list,
224+
)
225+
226+
@cached_property
227+
def id(self) -> IDResourceWithStreamingResponse:
228+
return IDResourceWithStreamingResponse(self._contacts.id)
229+
230+
@cached_property
231+
def phone(self) -> PhoneResourceWithStreamingResponse:
232+
return PhoneResourceWithStreamingResponse(self._contacts.phone)
233+
234+
235+
class AsyncContactsResourceWithStreamingResponse:
236+
def __init__(self, contacts: AsyncContactsResource) -> None:
237+
self._contacts = contacts
238+
239+
self.list = async_to_streamed_response_wrapper(
240+
contacts.list,
241+
)
242+
243+
@cached_property
244+
def id(self) -> AsyncIDResourceWithStreamingResponse:
245+
return AsyncIDResourceWithStreamingResponse(self._contacts.id)
246+
247+
@cached_property
248+
def phone(self) -> AsyncPhoneResourceWithStreamingResponse:
249+
return AsyncPhoneResourceWithStreamingResponse(self._contacts.phone)

0 commit comments

Comments
 (0)