| 1 |
|
| 2 |
|
| 3 |
import typing |
| 4 |
|
| 5 |
from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper |
| 6 |
from ...core.request_options import RequestOptions |
| 7 |
from ...types.event_stream_delivery import EventStreamDelivery |
| 8 |
from ...types.get_event_stream_delivery_history_response_content import GetEventStreamDeliveryHistoryResponseContent |
| 9 |
from .raw_client import AsyncRawDeliveriesClient, RawDeliveriesClient |
| 10 |
|
| 11 |
|
| 12 |
class DeliveriesClient: |
| 13 |
def __init__(self, *, client_wrapper: SyncClientWrapper): |
| 14 |
self._raw_client = RawDeliveriesClient(client_wrapper=client_wrapper) |
| 15 |
|
| 16 |
@property |
| 17 |
def with_raw_response(self) -> RawDeliveriesClient: |
| 18 |
""" |
| 19 |
Retrieves a raw implementation of this client that returns raw responses. |
| 20 |
|
| 21 |
Returns |
| 22 |
------- |
| 23 |
RawDeliveriesClient |
| 24 |
""" |
| 25 |
return self._raw_client |
| 26 |
|
| 27 |
def list( |
| 28 |
self, |
| 29 |
id: str, |
| 30 |
*, |
| 31 |
statuses: typing.Optional[str] = None, |
| 32 |
event_types: typing.Optional[str] = None, |
| 33 |
date_from: typing.Optional[str] = None, |
| 34 |
date_to: typing.Optional[str] = None, |
| 35 |
from_: typing.Optional[str] = None, |
| 36 |
take: typing.Optional[int] = 50, |
| 37 |
request_options: typing.Optional[RequestOptions] = None, |
| 38 |
) -> typing.List[EventStreamDelivery]: |
| 39 |
""" |
| 40 |
Parameters |
| 41 |
---------- |
| 42 |
id : str |
| 43 |
Unique identifier for the event stream. |
| 44 |
|
| 45 |
statuses : typing.Optional[str] |
| 46 |
Comma-separated list of statuses by which to filter |
| 47 |
|
| 48 |
event_types : typing.Optional[str] |
| 49 |
Comma-separated list of event types by which to filter |
| 50 |
|
| 51 |
date_from : typing.Optional[str] |
| 52 |
An RFC-3339 date-time for redelivery start, inclusive. Does not allow sub-second precision. |
| 53 |
|
| 54 |
date_to : typing.Optional[str] |
| 55 |
An RFC-3339 date-time for redelivery end, exclusive. Does not allow sub-second precision. |
| 56 |
|
| 57 |
from_ : typing.Optional[str] |
| 58 |
Optional Id from which to start selection. |
| 59 |
|
| 60 |
take : typing.Optional[int] |
| 61 |
Number of results per page. Defaults to 50. |
| 62 |
|
| 63 |
request_options : typing.Optional[RequestOptions] |
| 64 |
Request-specific configuration. |
| 65 |
|
| 66 |
Returns |
| 67 |
------- |
| 68 |
typing.List[EventStreamDelivery] |
| 69 |
Event stream deliveries successfully retrieved. |
| 70 |
|
| 71 |
Examples |
| 72 |
-------- |
| 73 |
from auth0 import Auth0 |
| 74 |
|
| 75 |
client = Auth0( |
| 76 |
token="YOUR_TOKEN", |
| 77 |
) |
| 78 |
client.event_streams.deliveries.list( |
| 79 |
id="id", |
| 80 |
statuses="statuses", |
| 81 |
event_types="event_types", |
| 82 |
date_from="date_from", |
| 83 |
date_to="date_to", |
| 84 |
from_="from", |
| 85 |
take=1, |
| 86 |
) |
| 87 |
""" |
| 88 |
_response = self._raw_client.list( |
| 89 |
id, |
| 90 |
statuses=statuses, |
| 91 |
event_types=event_types, |
| 92 |
date_from=date_from, |
| 93 |
date_to=date_to, |
| 94 |
from_=from_, |
| 95 |
take=take, |
| 96 |
request_options=request_options, |
| 97 |
) |
| 98 |
return _response.data |
| 99 |
|
| 100 |
def get_history( |
| 101 |
self, id: str, event_id: str, *, request_options: typing.Optional[RequestOptions] = None |
| 102 |
) -> GetEventStreamDeliveryHistoryResponseContent: |
| 103 |
""" |
| 104 |
Parameters |
| 105 |
---------- |
| 106 |
id : str |
| 107 |
Unique identifier for the event stream. |
| 108 |
|
| 109 |
event_id : str |
| 110 |
Unique identifier for the event |
| 111 |
|
| 112 |
request_options : typing.Optional[RequestOptions] |
| 113 |
Request-specific configuration. |
| 114 |
|
| 115 |
Returns |
| 116 |
------- |
| 117 |
GetEventStreamDeliveryHistoryResponseContent |
| 118 |
Delivery history for event successfully retrieved. |
| 119 |
|
| 120 |
Examples |
| 121 |
-------- |
| 122 |
from auth0 import Auth0 |
| 123 |
|
| 124 |
client = Auth0( |
| 125 |
token="YOUR_TOKEN", |
| 126 |
) |
| 127 |
client.event_streams.deliveries.get_history( |
| 128 |
id="id", |
| 129 |
event_id="event_id", |
| 130 |
) |
| 131 |
""" |
| 132 |
_response = self._raw_client.get_history(id, event_id, request_options=request_options) |
| 133 |
return _response.data |
| 134 |
|
| 135 |
|
| 136 |
class AsyncDeliveriesClient: |
| 137 |
def __init__(self, *, client_wrapper: AsyncClientWrapper): |
| 138 |
self._raw_client = AsyncRawDeliveriesClient(client_wrapper=client_wrapper) |
| 139 |
|
| 140 |
@property |
| 141 |
def with_raw_response(self) -> AsyncRawDeliveriesClient: |
| 142 |
""" |
| 143 |
Retrieves a raw implementation of this client that returns raw responses. |
| 144 |
|
| 145 |
Returns |
| 146 |
------- |
| 147 |
AsyncRawDeliveriesClient |
| 148 |
""" |
| 149 |
return self._raw_client |
| 150 |
|
| 151 |
async def list( |
| 152 |
self, |
| 153 |
id: str, |
| 154 |
*, |
| 155 |
statuses: typing.Optional[str] = None, |
| 156 |
event_types: typing.Optional[str] = None, |
| 157 |
date_from: typing.Optional[str] = None, |
| 158 |
date_to: typing.Optional[str] = None, |
| 159 |
from_: typing.Optional[str] = None, |
| 160 |
take: typing.Optional[int] = 50, |
| 161 |
request_options: typing.Optional[RequestOptions] = None, |
| 162 |
) -> typing.List[EventStreamDelivery]: |
| 163 |
""" |
| 164 |
Parameters |
| 165 |
---------- |
| 166 |
id : str |
| 167 |
Unique identifier for the event stream. |
| 168 |
|
| 169 |
statuses : typing.Optional[str] |
| 170 |
Comma-separated list of statuses by which to filter |
| 171 |
|
| 172 |
event_types : typing.Optional[str] |
| 173 |
Comma-separated list of event types by which to filter |
| 174 |
|
| 175 |
date_from : typing.Optional[str] |
| 176 |
An RFC-3339 date-time for redelivery start, inclusive. Does not allow sub-second precision. |
| 177 |
|
| 178 |
date_to : typing.Optional[str] |
| 179 |
An RFC-3339 date-time for redelivery end, exclusive. Does not allow sub-second precision. |
| 180 |
|
| 181 |
from_ : typing.Optional[str] |
| 182 |
Optional Id from which to start selection. |
| 183 |
|
| 184 |
take : typing.Optional[int] |
| 185 |
Number of results per page. Defaults to 50. |
| 186 |
|
| 187 |
request_options : typing.Optional[RequestOptions] |
| 188 |
Request-specific configuration. |
| 189 |
|
| 190 |
Returns |
| 191 |
------- |
| 192 |
typing.List[EventStreamDelivery] |
| 193 |
Event stream deliveries successfully retrieved. |
| 194 |
|
| 195 |
Examples |
| 196 |
-------- |
| 197 |
import asyncio |
| 198 |
|
| 199 |
from auth0 import AsyncAuth0 |
| 200 |
|
| 201 |
client = AsyncAuth0( |
| 202 |
token="YOUR_TOKEN", |
| 203 |
) |
| 204 |
|
| 205 |
|
| 206 |
async def main() -> None: |
| 207 |
await client.event_streams.deliveries.list( |
| 208 |
id="id", |
| 209 |
statuses="statuses", |
| 210 |
event_types="event_types", |
| 211 |
date_from="date_from", |
| 212 |
date_to="date_to", |
| 213 |
from_="from", |
| 214 |
take=1, |
| 215 |
) |
| 216 |
|
| 217 |
|
| 218 |
asyncio.run(main()) |
| 219 |
""" |
| 220 |
_response = await self._raw_client.list( |
| 221 |
id, |
| 222 |
statuses=statuses, |
| 223 |
event_types=event_types, |
| 224 |
date_from=date_from, |
| 225 |
date_to=date_to, |
| 226 |
from_=from_, |
| 227 |
take=take, |
| 228 |
request_options=request_options, |
| 229 |
) |
| 230 |
return _response.data |
| 231 |
|
| 232 |
async def get_history( |
| 233 |
self, id: str, event_id: str, *, request_options: typing.Optional[RequestOptions] = None |
| 234 |
) -> GetEventStreamDeliveryHistoryResponseContent: |
| 235 |
""" |
| 236 |
Parameters |
| 237 |
---------- |
| 238 |
id : str |
| 239 |
Unique identifier for the event stream. |
| 240 |
|
| 241 |
event_id : str |
| 242 |
Unique identifier for the event |
| 243 |
|
| 244 |
request_options : typing.Optional[RequestOptions] |
| 245 |
Request-specific configuration. |
| 246 |
|
| 247 |
Returns |
| 248 |
------- |
| 249 |
GetEventStreamDeliveryHistoryResponseContent |
| 250 |
Delivery history for event successfully retrieved. |
| 251 |
|
| 252 |
Examples |
| 253 |
-------- |
| 254 |
import asyncio |
| 255 |
|
| 256 |
from auth0 import AsyncAuth0 |
| 257 |
|
| 258 |
client = AsyncAuth0( |
| 259 |
token="YOUR_TOKEN", |
| 260 |
) |
| 261 |
|
| 262 |
|
| 263 |
async def main() -> None: |
| 264 |
await client.event_streams.deliveries.get_history( |
| 265 |
id="id", |
| 266 |
event_id="event_id", |
| 267 |
) |
| 268 |
|
| 269 |
|
| 270 |
asyncio.run(main()) |
| 271 |
""" |
| 272 |
_response = await self._raw_client.get_history(id, event_id, request_options=request_options) |
| 273 |
return _response.data |