Debian Codegraph @

src/auth0/management/keys/custom_signing/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 ...types.custom_signing_key_jwk import CustomSigningKeyJwk
8 from ...types.get_custom_signing_keys_response_content import GetCustomSigningKeysResponseContent
9 from ...types.set_custom_signing_keys_response_content import SetCustomSigningKeysResponseContent
10 from .raw_client import AsyncRawCustomSigningClient, RawCustomSigningClient
11
12 # this is used as the default value for optional parameters
13 OMIT = typing.cast(typing.Any, ...)
14
15
16 class CustomSigningClient:
17 def __init__(self, *, client_wrapper: SyncClientWrapper):
18 self._raw_client = RawCustomSigningClient(client_wrapper=client_wrapper)
19
20 @property
21 def with_raw_response(self) -> RawCustomSigningClient:
22 """
23 Retrieves a raw implementation of this client that returns raw responses.
24
25 Returns
26 -------
27 RawCustomSigningClient
28 """
29 return self._raw_client
30
31 def get(self, *, request_options: typing.Optional[RequestOptions] = None) -> GetCustomSigningKeysResponseContent:
32 """
33 Get entire jwks representation of custom signing keys.
34
35 Parameters
36 ----------
37 request_options : typing.Optional[RequestOptions]
38 Request-specific configuration.
39
40 Returns
41 -------
42 GetCustomSigningKeysResponseContent
43 Custom signing keys were successfully retrieved.
44
45 Examples
46 --------
47 from auth0 import Auth0
48
49 client = Auth0(
50 token="YOUR_TOKEN",
51 )
52 client.keys.custom_signing.get()
53 """
54 _response = self._raw_client.get(request_options=request_options)
55 return _response.data
56
57 def set(
58 self, *, keys: typing.Sequence[CustomSigningKeyJwk], request_options: typing.Optional[RequestOptions] = None
59 ) -> SetCustomSigningKeysResponseContent:
60 """
61 Create or replace entire jwks representation of custom signing keys.
62
63 Parameters
64 ----------
65 keys : typing.Sequence[CustomSigningKeyJwk]
66 An array of custom public signing keys.
67
68 request_options : typing.Optional[RequestOptions]
69 Request-specific configuration.
70
71 Returns
72 -------
73 SetCustomSigningKeysResponseContent
74 Custom signing keys were successfully created or replaced.
75
76 Examples
77 --------
78 from auth0 import Auth0, CustomSigningKeyJwk
79
80 client = Auth0(
81 token="YOUR_TOKEN",
82 )
83 client.keys.custom_signing.set(
84 keys=[
85 CustomSigningKeyJwk(
86 kty="EC",
87 )
88 ],
89 )
90 """
91 _response = self._raw_client.set(keys=keys, request_options=request_options)
92 return _response.data
93
94 def delete(self, *, request_options: typing.Optional[RequestOptions] = None) -> None:
95 """
96 Delete entire jwks representation of custom signing keys.
97
98 Parameters
99 ----------
100 request_options : typing.Optional[RequestOptions]
101 Request-specific configuration.
102
103 Returns
104 -------
105 None
106
107 Examples
108 --------
109 from auth0 import Auth0
110
111 client = Auth0(
112 token="YOUR_TOKEN",
113 )
114 client.keys.custom_signing.delete()
115 """
116 _response = self._raw_client.delete(request_options=request_options)
117 return _response.data
118
119
120 class AsyncCustomSigningClient:
121 def __init__(self, *, client_wrapper: AsyncClientWrapper):
122 self._raw_client = AsyncRawCustomSigningClient(client_wrapper=client_wrapper)
123
124 @property
125 def with_raw_response(self) -> AsyncRawCustomSigningClient:
126 """
127 Retrieves a raw implementation of this client that returns raw responses.
128
129 Returns
130 -------
131 AsyncRawCustomSigningClient
132 """
133 return self._raw_client
134
135 async def get(
136 self, *, request_options: typing.Optional[RequestOptions] = None
137 ) -> GetCustomSigningKeysResponseContent:
138 """
139 Get entire jwks representation of custom signing keys.
140
141 Parameters
142 ----------
143 request_options : typing.Optional[RequestOptions]
144 Request-specific configuration.
145
146 Returns
147 -------
148 GetCustomSigningKeysResponseContent
149 Custom signing keys were successfully retrieved.
150
151 Examples
152 --------
153 import asyncio
154
155 from auth0 import AsyncAuth0
156
157 client = AsyncAuth0(
158 token="YOUR_TOKEN",
159 )
160
161
162 async def main() -> None:
163 await client.keys.custom_signing.get()
164
165
166 asyncio.run(main())
167 """
168 _response = await self._raw_client.get(request_options=request_options)
169 return _response.data
170
171 async def set(
172 self, *, keys: typing.Sequence[CustomSigningKeyJwk], request_options: typing.Optional[RequestOptions] = None
173 ) -> SetCustomSigningKeysResponseContent:
174 """
175 Create or replace entire jwks representation of custom signing keys.
176
177 Parameters
178 ----------
179 keys : typing.Sequence[CustomSigningKeyJwk]
180 An array of custom public signing keys.
181
182 request_options : typing.Optional[RequestOptions]
183 Request-specific configuration.
184
185 Returns
186 -------
187 SetCustomSigningKeysResponseContent
188 Custom signing keys were successfully created or replaced.
189
190 Examples
191 --------
192 import asyncio
193
194 from auth0 import AsyncAuth0, CustomSigningKeyJwk
195
196 client = AsyncAuth0(
197 token="YOUR_TOKEN",
198 )
199
200
201 async def main() -> None:
202 await client.keys.custom_signing.set(
203 keys=[
204 CustomSigningKeyJwk(
205 kty="EC",
206 )
207 ],
208 )
209
210
211 asyncio.run(main())
212 """
213 _response = await self._raw_client.set(keys=keys, request_options=request_options)
214 return _response.data
215
216 async def delete(self, *, request_options: typing.Optional[RequestOptions] = None) -> None:
217 """
218 Delete entire jwks representation of custom signing keys.
219
220 Parameters
221 ----------
222 request_options : typing.Optional[RequestOptions]
223 Request-specific configuration.
224
225 Returns
226 -------
227 None
228
229 Examples
230 --------
231 import asyncio
232
233 from auth0 import AsyncAuth0
234
235 client = AsyncAuth0(
236 token="YOUR_TOKEN",
237 )
238
239
240 async def main() -> None:
241 await client.keys.custom_signing.delete()
242
243
244 asyncio.run(main())
245 """
246 _response = await self._raw_client.delete(request_options=request_options)
247 return _response.data