Debian Codegraph @

src/auth0/management/users/risk_assessments/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.assessors_type_enum import AssessorsTypeEnum
8 from .raw_client import AsyncRawRiskAssessmentsClient, RawRiskAssessmentsClient
9
10 # this is used as the default value for optional parameters
11 OMIT = typing.cast(typing.Any, ...)
12
13
14 class RiskAssessmentsClient:
15 def __init__(self, *, client_wrapper: SyncClientWrapper):
16 self._raw_client = RawRiskAssessmentsClient(client_wrapper=client_wrapper)
17
18 @property
19 def with_raw_response(self) -> RawRiskAssessmentsClient:
20 """
21 Retrieves a raw implementation of this client that returns raw responses.
22
23 Returns
24 -------
25 RawRiskAssessmentsClient
26 """
27 return self._raw_client
28
29 def clear(
30 self,
31 id: str,
32 *,
33 connection: str,
34 assessors: typing.Sequence[AssessorsTypeEnum],
35 request_options: typing.Optional[RequestOptions] = None,
36 ) -> None:
37 """
38 Clear risk assessment assessors for a specific user
39
40 Parameters
41 ----------
42 id : str
43 ID of the user to clear assessors for.
44
45 connection : str
46 The name of the connection containing the user whose assessors should be cleared.
47
48 assessors : typing.Sequence[AssessorsTypeEnum]
49 List of assessors to clear.
50
51 request_options : typing.Optional[RequestOptions]
52 Request-specific configuration.
53
54 Returns
55 -------
56 None
57
58 Examples
59 --------
60 from auth0 import Auth0
61
62 client = Auth0(
63 token="YOUR_TOKEN",
64 )
65 client.users.risk_assessments.clear(
66 id="id",
67 connection="connection",
68 assessors=["new-device"],
69 )
70 """
71 _response = self._raw_client.clear(
72 id, connection=connection, assessors=assessors, request_options=request_options
73 )
74 return _response.data
75
76
77 class AsyncRiskAssessmentsClient:
78 def __init__(self, *, client_wrapper: AsyncClientWrapper):
79 self._raw_client = AsyncRawRiskAssessmentsClient(client_wrapper=client_wrapper)
80
81 @property
82 def with_raw_response(self) -> AsyncRawRiskAssessmentsClient:
83 """
84 Retrieves a raw implementation of this client that returns raw responses.
85
86 Returns
87 -------
88 AsyncRawRiskAssessmentsClient
89 """
90 return self._raw_client
91
92 async def clear(
93 self,
94 id: str,
95 *,
96 connection: str,
97 assessors: typing.Sequence[AssessorsTypeEnum],
98 request_options: typing.Optional[RequestOptions] = None,
99 ) -> None:
100 """
101 Clear risk assessment assessors for a specific user
102
103 Parameters
104 ----------
105 id : str
106 ID of the user to clear assessors for.
107
108 connection : str
109 The name of the connection containing the user whose assessors should be cleared.
110
111 assessors : typing.Sequence[AssessorsTypeEnum]
112 List of assessors to clear.
113
114 request_options : typing.Optional[RequestOptions]
115 Request-specific configuration.
116
117 Returns
118 -------
119 None
120
121 Examples
122 --------
123 import asyncio
124
125 from auth0 import AsyncAuth0
126
127 client = AsyncAuth0(
128 token="YOUR_TOKEN",
129 )
130
131
132 async def main() -> None:
133 await client.users.risk_assessments.clear(
134 id="id",
135 connection="connection",
136 assessors=["new-device"],
137 )
138
139
140 asyncio.run(main())
141 """
142 _response = await self._raw_client.clear(
143 id, connection=connection, assessors=assessors, request_options=request_options
144 )
145 return _response.data