Debian Codegraph @

src/auth0/management/jobs/errors/client.py

raw symbols SCIP
1 # This file was auto-generated by Fern from our API Definition.
2
3 import typing
4
5 from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
6 from ...core.request_options import RequestOptions
7 from .raw_client import AsyncRawErrorsClient, RawErrorsClient
8 from .types.errors_get_response import ErrorsGetResponse
9
10
11 class ErrorsClient:
12 def __init__(self, *, client_wrapper: SyncClientWrapper):
13 self._raw_client = RawErrorsClient(client_wrapper=client_wrapper)
14
15 @property
16 def with_raw_response(self) -> RawErrorsClient:
17 """
18 Retrieves a raw implementation of this client that returns raw responses.
19
20 Returns
21 -------
22 RawErrorsClient
23 """
24 return self._raw_client
25
26 def get(
27 self, id: str, *, request_options: typing.Optional[RequestOptions] = None
28 ) -> typing.Optional[ErrorsGetResponse]:
29 """
30 Retrieve error details of a failed job.
31
32 Parameters
33 ----------
34 id : str
35 ID of the job.
36
37 request_options : typing.Optional[RequestOptions]
38 Request-specific configuration.
39
40 Returns
41 -------
42 typing.Optional[ErrorsGetResponse]
43 Job successfully retrieved.
44
45 Examples
46 --------
47 from auth0 import Auth0
48
49 client = Auth0(
50 token="YOUR_TOKEN",
51 )
52 client.jobs.errors.get(
53 id="id",
54 )
55 """
56 _response = self._raw_client.get(id, request_options=request_options)
57 return _response.data
58
59
60 class AsyncErrorsClient:
61 def __init__(self, *, client_wrapper: AsyncClientWrapper):
62 self._raw_client = AsyncRawErrorsClient(client_wrapper=client_wrapper)
63
64 @property
65 def with_raw_response(self) -> AsyncRawErrorsClient:
66 """
67 Retrieves a raw implementation of this client that returns raw responses.
68
69 Returns
70 -------
71 AsyncRawErrorsClient
72 """
73 return self._raw_client
74
75 async def get(
76 self, id: str, *, request_options: typing.Optional[RequestOptions] = None
77 ) -> typing.Optional[ErrorsGetResponse]:
78 """
79 Retrieve error details of a failed job.
80
81 Parameters
82 ----------
83 id : str
84 ID of the job.
85
86 request_options : typing.Optional[RequestOptions]
87 Request-specific configuration.
88
89 Returns
90 -------
91 typing.Optional[ErrorsGetResponse]
92 Job successfully retrieved.
93
94 Examples
95 --------
96 import asyncio
97
98 from auth0 import AsyncAuth0
99
100 client = AsyncAuth0(
101 token="YOUR_TOKEN",
102 )
103
104
105 async def main() -> None:
106 await client.jobs.errors.get(
107 id="id",
108 )
109
110
111 asyncio.run(main())
112 """
113 _response = await self._raw_client.get(id, request_options=request_options)
114 return _response.data