| 1 |
|
| 2 |
|
| 3 |
import typing |
| 4 |
|
| 5 |
from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper |
| 6 |
from ...core.request_options import RequestOptions |
| 7 |
from ...types.list_self_service_profile_custom_text_response_content import ( |
| 8 |
ListSelfServiceProfileCustomTextResponseContent, |
| 9 |
) |
| 10 |
from ...types.self_service_profile_custom_text_language_enum import SelfServiceProfileCustomTextLanguageEnum |
| 11 |
from ...types.self_service_profile_custom_text_page_enum import SelfServiceProfileCustomTextPageEnum |
| 12 |
from ...types.set_self_service_profile_custom_text_request_content import SetSelfServiceProfileCustomTextRequestContent |
| 13 |
from ...types.set_self_service_profile_custom_text_response_content import ( |
| 14 |
SetSelfServiceProfileCustomTextResponseContent, |
| 15 |
) |
| 16 |
from .raw_client import AsyncRawCustomTextClient, RawCustomTextClient |
| 17 |
|
| 18 |
|
| 19 |
OMIT = typing.cast(typing.Any, ...) |
| 20 |
|
| 21 |
|
| 22 |
class CustomTextClient: |
| 23 |
def __init__(self, *, client_wrapper: SyncClientWrapper): |
| 24 |
self._raw_client = RawCustomTextClient(client_wrapper=client_wrapper) |
| 25 |
|
| 26 |
@property |
| 27 |
def with_raw_response(self) -> RawCustomTextClient: |
| 28 |
""" |
| 29 |
Retrieves a raw implementation of this client that returns raw responses. |
| 30 |
|
| 31 |
Returns |
| 32 |
------- |
| 33 |
RawCustomTextClient |
| 34 |
""" |
| 35 |
return self._raw_client |
| 36 |
|
| 37 |
def list( |
| 38 |
self, |
| 39 |
id: str, |
| 40 |
language: SelfServiceProfileCustomTextLanguageEnum, |
| 41 |
page: SelfServiceProfileCustomTextPageEnum, |
| 42 |
*, |
| 43 |
request_options: typing.Optional[RequestOptions] = None, |
| 44 |
) -> ListSelfServiceProfileCustomTextResponseContent: |
| 45 |
""" |
| 46 |
Retrieves text customizations for a given self-service profile, language and Self-Service Enterprise Configuration flow page. |
| 47 |
|
| 48 |
Parameters |
| 49 |
---------- |
| 50 |
id : str |
| 51 |
The id of the self-service profile. |
| 52 |
|
| 53 |
language : SelfServiceProfileCustomTextLanguageEnum |
| 54 |
The language of the custom text. |
| 55 |
|
| 56 |
page : SelfServiceProfileCustomTextPageEnum |
| 57 |
The page where the custom text is shown. |
| 58 |
|
| 59 |
request_options : typing.Optional[RequestOptions] |
| 60 |
Request-specific configuration. |
| 61 |
|
| 62 |
Returns |
| 63 |
------- |
| 64 |
ListSelfServiceProfileCustomTextResponseContent |
| 65 |
Retrieved custom text. |
| 66 |
|
| 67 |
Examples |
| 68 |
-------- |
| 69 |
from auth0 import Auth0 |
| 70 |
|
| 71 |
client = Auth0( |
| 72 |
token="YOUR_TOKEN", |
| 73 |
) |
| 74 |
client.self_service_profiles.custom_text.list( |
| 75 |
id="id", |
| 76 |
language="en", |
| 77 |
page="get-started", |
| 78 |
) |
| 79 |
""" |
| 80 |
_response = self._raw_client.list(id, language, page, request_options=request_options) |
| 81 |
return _response.data |
| 82 |
|
| 83 |
def set( |
| 84 |
self, |
| 85 |
id: str, |
| 86 |
language: SelfServiceProfileCustomTextLanguageEnum, |
| 87 |
page: SelfServiceProfileCustomTextPageEnum, |
| 88 |
*, |
| 89 |
request: SetSelfServiceProfileCustomTextRequestContent, |
| 90 |
request_options: typing.Optional[RequestOptions] = None, |
| 91 |
) -> SetSelfServiceProfileCustomTextResponseContent: |
| 92 |
""" |
| 93 |
Updates text customizations for a given self-service profile, language and Self-Service Enterprise Configuration flow page. |
| 94 |
|
| 95 |
Parameters |
| 96 |
---------- |
| 97 |
id : str |
| 98 |
The id of the self-service profile. |
| 99 |
|
| 100 |
language : SelfServiceProfileCustomTextLanguageEnum |
| 101 |
The language of the custom text. |
| 102 |
|
| 103 |
page : SelfServiceProfileCustomTextPageEnum |
| 104 |
The page where the custom text is shown. |
| 105 |
|
| 106 |
request : SetSelfServiceProfileCustomTextRequestContent |
| 107 |
|
| 108 |
request_options : typing.Optional[RequestOptions] |
| 109 |
Request-specific configuration. |
| 110 |
|
| 111 |
Returns |
| 112 |
------- |
| 113 |
SetSelfServiceProfileCustomTextResponseContent |
| 114 |
Updated custom text. |
| 115 |
|
| 116 |
Examples |
| 117 |
-------- |
| 118 |
from auth0 import Auth0 |
| 119 |
|
| 120 |
client = Auth0( |
| 121 |
token="YOUR_TOKEN", |
| 122 |
) |
| 123 |
client.self_service_profiles.custom_text.set( |
| 124 |
id="id", |
| 125 |
language="en", |
| 126 |
page="get-started", |
| 127 |
request={"key": "value"}, |
| 128 |
) |
| 129 |
""" |
| 130 |
_response = self._raw_client.set(id, language, page, request=request, request_options=request_options) |
| 131 |
return _response.data |
| 132 |
|
| 133 |
|
| 134 |
class AsyncCustomTextClient: |
| 135 |
def __init__(self, *, client_wrapper: AsyncClientWrapper): |
| 136 |
self._raw_client = AsyncRawCustomTextClient(client_wrapper=client_wrapper) |
| 137 |
|
| 138 |
@property |
| 139 |
def with_raw_response(self) -> AsyncRawCustomTextClient: |
| 140 |
""" |
| 141 |
Retrieves a raw implementation of this client that returns raw responses. |
| 142 |
|
| 143 |
Returns |
| 144 |
------- |
| 145 |
AsyncRawCustomTextClient |
| 146 |
""" |
| 147 |
return self._raw_client |
| 148 |
|
| 149 |
async def list( |
| 150 |
self, |
| 151 |
id: str, |
| 152 |
language: SelfServiceProfileCustomTextLanguageEnum, |
| 153 |
page: SelfServiceProfileCustomTextPageEnum, |
| 154 |
*, |
| 155 |
request_options: typing.Optional[RequestOptions] = None, |
| 156 |
) -> ListSelfServiceProfileCustomTextResponseContent: |
| 157 |
""" |
| 158 |
Retrieves text customizations for a given self-service profile, language and Self-Service Enterprise Configuration flow page. |
| 159 |
|
| 160 |
Parameters |
| 161 |
---------- |
| 162 |
id : str |
| 163 |
The id of the self-service profile. |
| 164 |
|
| 165 |
language : SelfServiceProfileCustomTextLanguageEnum |
| 166 |
The language of the custom text. |
| 167 |
|
| 168 |
page : SelfServiceProfileCustomTextPageEnum |
| 169 |
The page where the custom text is shown. |
| 170 |
|
| 171 |
request_options : typing.Optional[RequestOptions] |
| 172 |
Request-specific configuration. |
| 173 |
|
| 174 |
Returns |
| 175 |
------- |
| 176 |
ListSelfServiceProfileCustomTextResponseContent |
| 177 |
Retrieved custom text. |
| 178 |
|
| 179 |
Examples |
| 180 |
-------- |
| 181 |
import asyncio |
| 182 |
|
| 183 |
from auth0 import AsyncAuth0 |
| 184 |
|
| 185 |
client = AsyncAuth0( |
| 186 |
token="YOUR_TOKEN", |
| 187 |
) |
| 188 |
|
| 189 |
|
| 190 |
async def main() -> None: |
| 191 |
await client.self_service_profiles.custom_text.list( |
| 192 |
id="id", |
| 193 |
language="en", |
| 194 |
page="get-started", |
| 195 |
) |
| 196 |
|
| 197 |
|
| 198 |
asyncio.run(main()) |
| 199 |
""" |
| 200 |
_response = await self._raw_client.list(id, language, page, request_options=request_options) |
| 201 |
return _response.data |
| 202 |
|
| 203 |
async def set( |
| 204 |
self, |
| 205 |
id: str, |
| 206 |
language: SelfServiceProfileCustomTextLanguageEnum, |
| 207 |
page: SelfServiceProfileCustomTextPageEnum, |
| 208 |
*, |
| 209 |
request: SetSelfServiceProfileCustomTextRequestContent, |
| 210 |
request_options: typing.Optional[RequestOptions] = None, |
| 211 |
) -> SetSelfServiceProfileCustomTextResponseContent: |
| 212 |
""" |
| 213 |
Updates text customizations for a given self-service profile, language and Self-Service Enterprise Configuration flow page. |
| 214 |
|
| 215 |
Parameters |
| 216 |
---------- |
| 217 |
id : str |
| 218 |
The id of the self-service profile. |
| 219 |
|
| 220 |
language : SelfServiceProfileCustomTextLanguageEnum |
| 221 |
The language of the custom text. |
| 222 |
|
| 223 |
page : SelfServiceProfileCustomTextPageEnum |
| 224 |
The page where the custom text is shown. |
| 225 |
|
| 226 |
request : SetSelfServiceProfileCustomTextRequestContent |
| 227 |
|
| 228 |
request_options : typing.Optional[RequestOptions] |
| 229 |
Request-specific configuration. |
| 230 |
|
| 231 |
Returns |
| 232 |
------- |
| 233 |
SetSelfServiceProfileCustomTextResponseContent |
| 234 |
Updated custom text. |
| 235 |
|
| 236 |
Examples |
| 237 |
-------- |
| 238 |
import asyncio |
| 239 |
|
| 240 |
from auth0 import AsyncAuth0 |
| 241 |
|
| 242 |
client = AsyncAuth0( |
| 243 |
token="YOUR_TOKEN", |
| 244 |
) |
| 245 |
|
| 246 |
|
| 247 |
async def main() -> None: |
| 248 |
await client.self_service_profiles.custom_text.set( |
| 249 |
id="id", |
| 250 |
language="en", |
| 251 |
page="get-started", |
| 252 |
request={"key": "value"}, |
| 253 |
) |
| 254 |
|
| 255 |
|
| 256 |
asyncio.run(main()) |
| 257 |
""" |
| 258 |
_response = await self._raw_client.set(id, language, page, request=request, request_options=request_options) |
| 259 |
return _response.data |