| 1 |
|
| 2 |
|
| 3 |
from __future__ import annotations |
| 4 |
|
| 5 |
import typing |
| 6 |
|
| 7 |
from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper |
| 8 |
from ...core.pagination import AsyncPager, SyncPager |
| 9 |
from ...core.request_options import RequestOptions |
| 10 |
from ...types.action_module_action import ActionModuleAction |
| 11 |
from ...types.action_module_dependency_request import ActionModuleDependencyRequest |
| 12 |
from ...types.action_module_list_item import ActionModuleListItem |
| 13 |
from ...types.action_module_secret_request import ActionModuleSecretRequest |
| 14 |
from ...types.create_action_module_response_content import CreateActionModuleResponseContent |
| 15 |
from ...types.get_action_module_actions_response_content import GetActionModuleActionsResponseContent |
| 16 |
from ...types.get_action_module_response_content import GetActionModuleResponseContent |
| 17 |
from ...types.get_action_modules_response_content import GetActionModulesResponseContent |
| 18 |
from ...types.rollback_action_module_response_content import RollbackActionModuleResponseContent |
| 19 |
from ...types.update_action_module_response_content import UpdateActionModuleResponseContent |
| 20 |
from .raw_client import AsyncRawModulesClient, RawModulesClient |
| 21 |
|
| 22 |
if typing.TYPE_CHECKING: |
| 23 |
from .versions.client import AsyncVersionsClient, VersionsClient |
| 24 |
|
| 25 |
OMIT = typing.cast(typing.Any, ...) |
| 26 |
|
| 27 |
|
| 28 |
class ModulesClient: |
| 29 |
def __init__(self, *, client_wrapper: SyncClientWrapper): |
| 30 |
self._raw_client = RawModulesClient(client_wrapper=client_wrapper) |
| 31 |
self._client_wrapper = client_wrapper |
| 32 |
self._versions: typing.Optional[VersionsClient] = None |
| 33 |
|
| 34 |
@property |
| 35 |
def with_raw_response(self) -> RawModulesClient: |
| 36 |
""" |
| 37 |
Retrieves a raw implementation of this client that returns raw responses. |
| 38 |
|
| 39 |
Returns |
| 40 |
------- |
| 41 |
RawModulesClient |
| 42 |
""" |
| 43 |
return self._raw_client |
| 44 |
|
| 45 |
def list( |
| 46 |
self, |
| 47 |
*, |
| 48 |
page: typing.Optional[int] = 0, |
| 49 |
per_page: typing.Optional[int] = 50, |
| 50 |
request_options: typing.Optional[RequestOptions] = None, |
| 51 |
) -> SyncPager[ActionModuleListItem, GetActionModulesResponseContent]: |
| 52 |
""" |
| 53 |
Retrieve a paginated list of all Actions Modules with optional filtering and totals. |
| 54 |
|
| 55 |
Parameters |
| 56 |
---------- |
| 57 |
page : typing.Optional[int] |
| 58 |
Page index of the results to return. First page is 0. |
| 59 |
|
| 60 |
per_page : typing.Optional[int] |
| 61 |
Number of results per page. Paging is disabled if parameter not sent. |
| 62 |
|
| 63 |
request_options : typing.Optional[RequestOptions] |
| 64 |
Request-specific configuration. |
| 65 |
|
| 66 |
Returns |
| 67 |
------- |
| 68 |
SyncPager[ActionModuleListItem, GetActionModulesResponseContent] |
| 69 |
The action modules were retrieved. |
| 70 |
|
| 71 |
Examples |
| 72 |
-------- |
| 73 |
from auth0 import Auth0 |
| 74 |
|
| 75 |
client = Auth0( |
| 76 |
token="YOUR_TOKEN", |
| 77 |
) |
| 78 |
response = client.actions.modules.list( |
| 79 |
page=1, |
| 80 |
per_page=1, |
| 81 |
) |
| 82 |
for item in response: |
| 83 |
yield item |
| 84 |
# alternatively, you can paginate page-by-page |
| 85 |
for page in response.iter_pages(): |
| 86 |
yield page |
| 87 |
""" |
| 88 |
return self._raw_client.list(page=page, per_page=per_page, request_options=request_options) |
| 89 |
|
| 90 |
def create( |
| 91 |
self, |
| 92 |
*, |
| 93 |
name: str, |
| 94 |
code: str, |
| 95 |
secrets: typing.Optional[typing.Sequence[ActionModuleSecretRequest]] = OMIT, |
| 96 |
dependencies: typing.Optional[typing.Sequence[ActionModuleDependencyRequest]] = OMIT, |
| 97 |
api_version: typing.Optional[str] = OMIT, |
| 98 |
publish: typing.Optional[bool] = OMIT, |
| 99 |
request_options: typing.Optional[RequestOptions] = None, |
| 100 |
) -> CreateActionModuleResponseContent: |
| 101 |
""" |
| 102 |
Create a new Actions Module for reusable code across actions. |
| 103 |
|
| 104 |
Parameters |
| 105 |
---------- |
| 106 |
name : str |
| 107 |
The name of the action module. |
| 108 |
|
| 109 |
code : str |
| 110 |
The source code of the action module. |
| 111 |
|
| 112 |
secrets : typing.Optional[typing.Sequence[ActionModuleSecretRequest]] |
| 113 |
The secrets to associate with the action module. |
| 114 |
|
| 115 |
dependencies : typing.Optional[typing.Sequence[ActionModuleDependencyRequest]] |
| 116 |
The npm dependencies of the action module. |
| 117 |
|
| 118 |
api_version : typing.Optional[str] |
| 119 |
The API version of the module. |
| 120 |
|
| 121 |
publish : typing.Optional[bool] |
| 122 |
Whether to publish the module immediately after creation. |
| 123 |
|
| 124 |
request_options : typing.Optional[RequestOptions] |
| 125 |
Request-specific configuration. |
| 126 |
|
| 127 |
Returns |
| 128 |
------- |
| 129 |
CreateActionModuleResponseContent |
| 130 |
The action module was created. |
| 131 |
|
| 132 |
Examples |
| 133 |
-------- |
| 134 |
from auth0 import Auth0 |
| 135 |
|
| 136 |
client = Auth0( |
| 137 |
token="YOUR_TOKEN", |
| 138 |
) |
| 139 |
client.actions.modules.create( |
| 140 |
name="name", |
| 141 |
code="code", |
| 142 |
) |
| 143 |
""" |
| 144 |
_response = self._raw_client.create( |
| 145 |
name=name, |
| 146 |
code=code, |
| 147 |
secrets=secrets, |
| 148 |
dependencies=dependencies, |
| 149 |
api_version=api_version, |
| 150 |
publish=publish, |
| 151 |
request_options=request_options, |
| 152 |
) |
| 153 |
return _response.data |
| 154 |
|
| 155 |
def get( |
| 156 |
self, id: str, *, request_options: typing.Optional[RequestOptions] = None |
| 157 |
) -> GetActionModuleResponseContent: |
| 158 |
""" |
| 159 |
Retrieve details of a specific Actions Module by its unique identifier. |
| 160 |
|
| 161 |
Parameters |
| 162 |
---------- |
| 163 |
id : str |
| 164 |
The ID of the action module to retrieve. |
| 165 |
|
| 166 |
request_options : typing.Optional[RequestOptions] |
| 167 |
Request-specific configuration. |
| 168 |
|
| 169 |
Returns |
| 170 |
------- |
| 171 |
GetActionModuleResponseContent |
| 172 |
The action module was retrieved. |
| 173 |
|
| 174 |
Examples |
| 175 |
-------- |
| 176 |
from auth0 import Auth0 |
| 177 |
|
| 178 |
client = Auth0( |
| 179 |
token="YOUR_TOKEN", |
| 180 |
) |
| 181 |
client.actions.modules.get( |
| 182 |
id="id", |
| 183 |
) |
| 184 |
""" |
| 185 |
_response = self._raw_client.get(id, request_options=request_options) |
| 186 |
return _response.data |
| 187 |
|
| 188 |
def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None: |
| 189 |
""" |
| 190 |
Permanently delete an Actions Module. This will fail if the module is still in use by any actions. |
| 191 |
|
| 192 |
Parameters |
| 193 |
---------- |
| 194 |
id : str |
| 195 |
The ID of the Actions Module to delete. |
| 196 |
|
| 197 |
request_options : typing.Optional[RequestOptions] |
| 198 |
Request-specific configuration. |
| 199 |
|
| 200 |
Returns |
| 201 |
------- |
| 202 |
None |
| 203 |
|
| 204 |
Examples |
| 205 |
-------- |
| 206 |
from auth0 import Auth0 |
| 207 |
|
| 208 |
client = Auth0( |
| 209 |
token="YOUR_TOKEN", |
| 210 |
) |
| 211 |
client.actions.modules.delete( |
| 212 |
id="id", |
| 213 |
) |
| 214 |
""" |
| 215 |
_response = self._raw_client.delete(id, request_options=request_options) |
| 216 |
return _response.data |
| 217 |
|
| 218 |
def update( |
| 219 |
self, |
| 220 |
id: str, |
| 221 |
*, |
| 222 |
code: typing.Optional[str] = OMIT, |
| 223 |
secrets: typing.Optional[typing.Sequence[ActionModuleSecretRequest]] = OMIT, |
| 224 |
dependencies: typing.Optional[typing.Sequence[ActionModuleDependencyRequest]] = OMIT, |
| 225 |
request_options: typing.Optional[RequestOptions] = None, |
| 226 |
) -> UpdateActionModuleResponseContent: |
| 227 |
""" |
| 228 |
Update properties of an existing Actions Module, such as code, dependencies, or secrets. |
| 229 |
|
| 230 |
Parameters |
| 231 |
---------- |
| 232 |
id : str |
| 233 |
The ID of the action module to update. |
| 234 |
|
| 235 |
code : typing.Optional[str] |
| 236 |
The source code of the action module. |
| 237 |
|
| 238 |
secrets : typing.Optional[typing.Sequence[ActionModuleSecretRequest]] |
| 239 |
The secrets to associate with the action module. |
| 240 |
|
| 241 |
dependencies : typing.Optional[typing.Sequence[ActionModuleDependencyRequest]] |
| 242 |
The npm dependencies of the action module. |
| 243 |
|
| 244 |
request_options : typing.Optional[RequestOptions] |
| 245 |
Request-specific configuration. |
| 246 |
|
| 247 |
Returns |
| 248 |
------- |
| 249 |
UpdateActionModuleResponseContent |
| 250 |
The action module was updated. |
| 251 |
|
| 252 |
Examples |
| 253 |
-------- |
| 254 |
from auth0 import Auth0 |
| 255 |
|
| 256 |
client = Auth0( |
| 257 |
token="YOUR_TOKEN", |
| 258 |
) |
| 259 |
client.actions.modules.update( |
| 260 |
id="id", |
| 261 |
) |
| 262 |
""" |
| 263 |
_response = self._raw_client.update( |
| 264 |
id, code=code, secrets=secrets, dependencies=dependencies, request_options=request_options |
| 265 |
) |
| 266 |
return _response.data |
| 267 |
|
| 268 |
def list_actions( |
| 269 |
self, |
| 270 |
id: str, |
| 271 |
*, |
| 272 |
page: typing.Optional[int] = 0, |
| 273 |
per_page: typing.Optional[int] = 50, |
| 274 |
request_options: typing.Optional[RequestOptions] = None, |
| 275 |
) -> SyncPager[ActionModuleAction, GetActionModuleActionsResponseContent]: |
| 276 |
""" |
| 277 |
Lists all actions that are using a specific Actions Module, showing which deployed action versions reference this Actions Module. |
| 278 |
|
| 279 |
Parameters |
| 280 |
---------- |
| 281 |
id : str |
| 282 |
The unique ID of the module. |
| 283 |
|
| 284 |
page : typing.Optional[int] |
| 285 |
Page index of the results to return. First page is 0. |
| 286 |
|
| 287 |
per_page : typing.Optional[int] |
| 288 |
Number of results per page. |
| 289 |
|
| 290 |
request_options : typing.Optional[RequestOptions] |
| 291 |
Request-specific configuration. |
| 292 |
|
| 293 |
Returns |
| 294 |
------- |
| 295 |
SyncPager[ActionModuleAction, GetActionModuleActionsResponseContent] |
| 296 |
The actions were retrieved. |
| 297 |
|
| 298 |
Examples |
| 299 |
-------- |
| 300 |
from auth0 import Auth0 |
| 301 |
|
| 302 |
client = Auth0( |
| 303 |
token="YOUR_TOKEN", |
| 304 |
) |
| 305 |
response = client.actions.modules.list_actions( |
| 306 |
id="id", |
| 307 |
page=1, |
| 308 |
per_page=1, |
| 309 |
) |
| 310 |
for item in response: |
| 311 |
yield item |
| 312 |
# alternatively, you can paginate page-by-page |
| 313 |
for page in response.iter_pages(): |
| 314 |
yield page |
| 315 |
""" |
| 316 |
return self._raw_client.list_actions(id, page=page, per_page=per_page, request_options=request_options) |
| 317 |
|
| 318 |
def rollback( |
| 319 |
self, id: str, *, module_version_id: str, request_options: typing.Optional[RequestOptions] = None |
| 320 |
) -> RollbackActionModuleResponseContent: |
| 321 |
""" |
| 322 |
Rolls back an Actions Module's draft to a previously created version. This action copies the code, dependencies, and secrets from the specified version into the current draft. |
| 323 |
|
| 324 |
Parameters |
| 325 |
---------- |
| 326 |
id : str |
| 327 |
The unique ID of the module to roll back. |
| 328 |
|
| 329 |
module_version_id : str |
| 330 |
The unique ID of the module version to roll back to. |
| 331 |
|
| 332 |
request_options : typing.Optional[RequestOptions] |
| 333 |
Request-specific configuration. |
| 334 |
|
| 335 |
Returns |
| 336 |
------- |
| 337 |
RollbackActionModuleResponseContent |
| 338 |
The rollback was successful. |
| 339 |
|
| 340 |
Examples |
| 341 |
-------- |
| 342 |
from auth0 import Auth0 |
| 343 |
|
| 344 |
client = Auth0( |
| 345 |
token="YOUR_TOKEN", |
| 346 |
) |
| 347 |
client.actions.modules.rollback( |
| 348 |
id="id", |
| 349 |
module_version_id="module_version_id", |
| 350 |
) |
| 351 |
""" |
| 352 |
_response = self._raw_client.rollback(id, module_version_id=module_version_id, request_options=request_options) |
| 353 |
return _response.data |
| 354 |
|
| 355 |
@property |
| 356 |
def versions(self): |
| 357 |
if self._versions is None: |
| 358 |
from .versions.client import VersionsClient |
| 359 |
|
| 360 |
self._versions = VersionsClient(client_wrapper=self._client_wrapper) |
| 361 |
return self._versions |
| 362 |
|
| 363 |
|
| 364 |
class AsyncModulesClient: |
| 365 |
def __init__(self, *, client_wrapper: AsyncClientWrapper): |
| 366 |
self._raw_client = AsyncRawModulesClient(client_wrapper=client_wrapper) |
| 367 |
self._client_wrapper = client_wrapper |
| 368 |
self._versions: typing.Optional[AsyncVersionsClient] = None |
| 369 |
|
| 370 |
@property |
| 371 |
def with_raw_response(self) -> AsyncRawModulesClient: |
| 372 |
""" |
| 373 |
Retrieves a raw implementation of this client that returns raw responses. |
| 374 |
|
| 375 |
Returns |
| 376 |
------- |
| 377 |
AsyncRawModulesClient |
| 378 |
""" |
| 379 |
return self._raw_client |
| 380 |
|
| 381 |
async def list( |
| 382 |
self, |
| 383 |
*, |
| 384 |
page: typing.Optional[int] = 0, |
| 385 |
per_page: typing.Optional[int] = 50, |
| 386 |
request_options: typing.Optional[RequestOptions] = None, |
| 387 |
) -> AsyncPager[ActionModuleListItem, GetActionModulesResponseContent]: |
| 388 |
""" |
| 389 |
Retrieve a paginated list of all Actions Modules with optional filtering and totals. |
| 390 |
|
| 391 |
Parameters |
| 392 |
---------- |
| 393 |
page : typing.Optional[int] |
| 394 |
Page index of the results to return. First page is 0. |
| 395 |
|
| 396 |
per_page : typing.Optional[int] |
| 397 |
Number of results per page. Paging is disabled if parameter not sent. |
| 398 |
|
| 399 |
request_options : typing.Optional[RequestOptions] |
| 400 |
Request-specific configuration. |
| 401 |
|
| 402 |
Returns |
| 403 |
------- |
| 404 |
AsyncPager[ActionModuleListItem, GetActionModulesResponseContent] |
| 405 |
The action modules were retrieved. |
| 406 |
|
| 407 |
Examples |
| 408 |
-------- |
| 409 |
import asyncio |
| 410 |
|
| 411 |
from auth0 import AsyncAuth0 |
| 412 |
|
| 413 |
client = AsyncAuth0( |
| 414 |
token="YOUR_TOKEN", |
| 415 |
) |
| 416 |
|
| 417 |
|
| 418 |
async def main() -> None: |
| 419 |
response = await client.actions.modules.list( |
| 420 |
page=1, |
| 421 |
per_page=1, |
| 422 |
) |
| 423 |
async for item in response: |
| 424 |
yield item |
| 425 |
|
| 426 |
# alternatively, you can paginate page-by-page |
| 427 |
async for page in response.iter_pages(): |
| 428 |
yield page |
| 429 |
|
| 430 |
|
| 431 |
asyncio.run(main()) |
| 432 |
""" |
| 433 |
return await self._raw_client.list(page=page, per_page=per_page, request_options=request_options) |
| 434 |
|
| 435 |
async def create( |
| 436 |
self, |
| 437 |
*, |
| 438 |
name: str, |
| 439 |
code: str, |
| 440 |
secrets: typing.Optional[typing.Sequence[ActionModuleSecretRequest]] = OMIT, |
| 441 |
dependencies: typing.Optional[typing.Sequence[ActionModuleDependencyRequest]] = OMIT, |
| 442 |
api_version: typing.Optional[str] = OMIT, |
| 443 |
publish: typing.Optional[bool] = OMIT, |
| 444 |
request_options: typing.Optional[RequestOptions] = None, |
| 445 |
) -> CreateActionModuleResponseContent: |
| 446 |
""" |
| 447 |
Create a new Actions Module for reusable code across actions. |
| 448 |
|
| 449 |
Parameters |
| 450 |
---------- |
| 451 |
name : str |
| 452 |
The name of the action module. |
| 453 |
|
| 454 |
code : str |
| 455 |
The source code of the action module. |
| 456 |
|
| 457 |
secrets : typing.Optional[typing.Sequence[ActionModuleSecretRequest]] |
| 458 |
The secrets to associate with the action module. |
| 459 |
|
| 460 |
dependencies : typing.Optional[typing.Sequence[ActionModuleDependencyRequest]] |
| 461 |
The npm dependencies of the action module. |
| 462 |
|
| 463 |
api_version : typing.Optional[str] |
| 464 |
The API version of the module. |
| 465 |
|
| 466 |
publish : typing.Optional[bool] |
| 467 |
Whether to publish the module immediately after creation. |
| 468 |
|
| 469 |
request_options : typing.Optional[RequestOptions] |
| 470 |
Request-specific configuration. |
| 471 |
|
| 472 |
Returns |
| 473 |
------- |
| 474 |
CreateActionModuleResponseContent |
| 475 |
The action module was created. |
| 476 |
|
| 477 |
Examples |
| 478 |
-------- |
| 479 |
import asyncio |
| 480 |
|
| 481 |
from auth0 import AsyncAuth0 |
| 482 |
|
| 483 |
client = AsyncAuth0( |
| 484 |
token="YOUR_TOKEN", |
| 485 |
) |
| 486 |
|
| 487 |
|
| 488 |
async def main() -> None: |
| 489 |
await client.actions.modules.create( |
| 490 |
name="name", |
| 491 |
code="code", |
| 492 |
) |
| 493 |
|
| 494 |
|
| 495 |
asyncio.run(main()) |
| 496 |
""" |
| 497 |
_response = await self._raw_client.create( |
| 498 |
name=name, |
| 499 |
code=code, |
| 500 |
secrets=secrets, |
| 501 |
dependencies=dependencies, |
| 502 |
api_version=api_version, |
| 503 |
publish=publish, |
| 504 |
request_options=request_options, |
| 505 |
) |
| 506 |
return _response.data |
| 507 |
|
| 508 |
async def get( |
| 509 |
self, id: str, *, request_options: typing.Optional[RequestOptions] = None |
| 510 |
) -> GetActionModuleResponseContent: |
| 511 |
""" |
| 512 |
Retrieve details of a specific Actions Module by its unique identifier. |
| 513 |
|
| 514 |
Parameters |
| 515 |
---------- |
| 516 |
id : str |
| 517 |
The ID of the action module to retrieve. |
| 518 |
|
| 519 |
request_options : typing.Optional[RequestOptions] |
| 520 |
Request-specific configuration. |
| 521 |
|
| 522 |
Returns |
| 523 |
------- |
| 524 |
GetActionModuleResponseContent |
| 525 |
The action module was retrieved. |
| 526 |
|
| 527 |
Examples |
| 528 |
-------- |
| 529 |
import asyncio |
| 530 |
|
| 531 |
from auth0 import AsyncAuth0 |
| 532 |
|
| 533 |
client = AsyncAuth0( |
| 534 |
token="YOUR_TOKEN", |
| 535 |
) |
| 536 |
|
| 537 |
|
| 538 |
async def main() -> None: |
| 539 |
await client.actions.modules.get( |
| 540 |
id="id", |
| 541 |
) |
| 542 |
|
| 543 |
|
| 544 |
asyncio.run(main()) |
| 545 |
""" |
| 546 |
_response = await self._raw_client.get(id, request_options=request_options) |
| 547 |
return _response.data |
| 548 |
|
| 549 |
async def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None: |
| 550 |
""" |
| 551 |
Permanently delete an Actions Module. This will fail if the module is still in use by any actions. |
| 552 |
|
| 553 |
Parameters |
| 554 |
---------- |
| 555 |
id : str |
| 556 |
The ID of the Actions Module to delete. |
| 557 |
|
| 558 |
request_options : typing.Optional[RequestOptions] |
| 559 |
Request-specific configuration. |
| 560 |
|
| 561 |
Returns |
| 562 |
------- |
| 563 |
None |
| 564 |
|
| 565 |
Examples |
| 566 |
-------- |
| 567 |
import asyncio |
| 568 |
|
| 569 |
from auth0 import AsyncAuth0 |
| 570 |
|
| 571 |
client = AsyncAuth0( |
| 572 |
token="YOUR_TOKEN", |
| 573 |
) |
| 574 |
|
| 575 |
|
| 576 |
async def main() -> None: |
| 577 |
await client.actions.modules.delete( |
| 578 |
id="id", |
| 579 |
) |
| 580 |
|
| 581 |
|
| 582 |
asyncio.run(main()) |
| 583 |
""" |
| 584 |
_response = await self._raw_client.delete(id, request_options=request_options) |
| 585 |
return _response.data |
| 586 |
|
| 587 |
async def update( |
| 588 |
self, |
| 589 |
id: str, |
| 590 |
*, |
| 591 |
code: typing.Optional[str] = OMIT, |
| 592 |
secrets: typing.Optional[typing.Sequence[ActionModuleSecretRequest]] = OMIT, |
| 593 |
dependencies: typing.Optional[typing.Sequence[ActionModuleDependencyRequest]] = OMIT, |
| 594 |
request_options: typing.Optional[RequestOptions] = None, |
| 595 |
) -> UpdateActionModuleResponseContent: |
| 596 |
""" |
| 597 |
Update properties of an existing Actions Module, such as code, dependencies, or secrets. |
| 598 |
|
| 599 |
Parameters |
| 600 |
---------- |
| 601 |
id : str |
| 602 |
The ID of the action module to update. |
| 603 |
|
| 604 |
code : typing.Optional[str] |
| 605 |
The source code of the action module. |
| 606 |
|
| 607 |
secrets : typing.Optional[typing.Sequence[ActionModuleSecretRequest]] |
| 608 |
The secrets to associate with the action module. |
| 609 |
|
| 610 |
dependencies : typing.Optional[typing.Sequence[ActionModuleDependencyRequest]] |
| 611 |
The npm dependencies of the action module. |
| 612 |
|
| 613 |
request_options : typing.Optional[RequestOptions] |
| 614 |
Request-specific configuration. |
| 615 |
|
| 616 |
Returns |
| 617 |
------- |
| 618 |
UpdateActionModuleResponseContent |
| 619 |
The action module was updated. |
| 620 |
|
| 621 |
Examples |
| 622 |
-------- |
| 623 |
import asyncio |
| 624 |
|
| 625 |
from auth0 import AsyncAuth0 |
| 626 |
|
| 627 |
client = AsyncAuth0( |
| 628 |
token="YOUR_TOKEN", |
| 629 |
) |
| 630 |
|
| 631 |
|
| 632 |
async def main() -> None: |
| 633 |
await client.actions.modules.update( |
| 634 |
id="id", |
| 635 |
) |
| 636 |
|
| 637 |
|
| 638 |
asyncio.run(main()) |
| 639 |
""" |
| 640 |
_response = await self._raw_client.update( |
| 641 |
id, code=code, secrets=secrets, dependencies=dependencies, request_options=request_options |
| 642 |
) |
| 643 |
return _response.data |
| 644 |
|
| 645 |
async def list_actions( |
| 646 |
self, |
| 647 |
id: str, |
| 648 |
*, |
| 649 |
page: typing.Optional[int] = 0, |
| 650 |
per_page: typing.Optional[int] = 50, |
| 651 |
request_options: typing.Optional[RequestOptions] = None, |
| 652 |
) -> AsyncPager[ActionModuleAction, GetActionModuleActionsResponseContent]: |
| 653 |
""" |
| 654 |
Lists all actions that are using a specific Actions Module, showing which deployed action versions reference this Actions Module. |
| 655 |
|
| 656 |
Parameters |
| 657 |
---------- |
| 658 |
id : str |
| 659 |
The unique ID of the module. |
| 660 |
|
| 661 |
page : typing.Optional[int] |
| 662 |
Page index of the results to return. First page is 0. |
| 663 |
|
| 664 |
per_page : typing.Optional[int] |
| 665 |
Number of results per page. |
| 666 |
|
| 667 |
request_options : typing.Optional[RequestOptions] |
| 668 |
Request-specific configuration. |
| 669 |
|
| 670 |
Returns |
| 671 |
------- |
| 672 |
AsyncPager[ActionModuleAction, GetActionModuleActionsResponseContent] |
| 673 |
The actions were retrieved. |
| 674 |
|
| 675 |
Examples |
| 676 |
-------- |
| 677 |
import asyncio |
| 678 |
|
| 679 |
from auth0 import AsyncAuth0 |
| 680 |
|
| 681 |
client = AsyncAuth0( |
| 682 |
token="YOUR_TOKEN", |
| 683 |
) |
| 684 |
|
| 685 |
|
| 686 |
async def main() -> None: |
| 687 |
response = await client.actions.modules.list_actions( |
| 688 |
id="id", |
| 689 |
page=1, |
| 690 |
per_page=1, |
| 691 |
) |
| 692 |
async for item in response: |
| 693 |
yield item |
| 694 |
|
| 695 |
# alternatively, you can paginate page-by-page |
| 696 |
async for page in response.iter_pages(): |
| 697 |
yield page |
| 698 |
|
| 699 |
|
| 700 |
asyncio.run(main()) |
| 701 |
""" |
| 702 |
return await self._raw_client.list_actions(id, page=page, per_page=per_page, request_options=request_options) |
| 703 |
|
| 704 |
async def rollback( |
| 705 |
self, id: str, *, module_version_id: str, request_options: typing.Optional[RequestOptions] = None |
| 706 |
) -> RollbackActionModuleResponseContent: |
| 707 |
""" |
| 708 |
Rolls back an Actions Module's draft to a previously created version. This action copies the code, dependencies, and secrets from the specified version into the current draft. |
| 709 |
|
| 710 |
Parameters |
| 711 |
---------- |
| 712 |
id : str |
| 713 |
The unique ID of the module to roll back. |
| 714 |
|
| 715 |
module_version_id : str |
| 716 |
The unique ID of the module version to roll back to. |
| 717 |
|
| 718 |
request_options : typing.Optional[RequestOptions] |
| 719 |
Request-specific configuration. |
| 720 |
|
| 721 |
Returns |
| 722 |
------- |
| 723 |
RollbackActionModuleResponseContent |
| 724 |
The rollback was successful. |
| 725 |
|
| 726 |
Examples |
| 727 |
-------- |
| 728 |
import asyncio |
| 729 |
|
| 730 |
from auth0 import AsyncAuth0 |
| 731 |
|
| 732 |
client = AsyncAuth0( |
| 733 |
token="YOUR_TOKEN", |
| 734 |
) |
| 735 |
|
| 736 |
|
| 737 |
async def main() -> None: |
| 738 |
await client.actions.modules.rollback( |
| 739 |
id="id", |
| 740 |
module_version_id="module_version_id", |
| 741 |
) |
| 742 |
|
| 743 |
|
| 744 |
asyncio.run(main()) |
| 745 |
""" |
| 746 |
_response = await self._raw_client.rollback( |
| 747 |
id, module_version_id=module_version_id, request_options=request_options |
| 748 |
) |
| 749 |
return _response.data |
| 750 |
|
| 751 |
@property |
| 752 |
def versions(self): |
| 753 |
if self._versions is None: |
| 754 |
from .versions.client import AsyncVersionsClient |
| 755 |
|
| 756 |
self._versions = AsyncVersionsClient(client_wrapper=self._client_wrapper) |
| 757 |
return self._versions |