Skip to content

LongLivedTokenRevokeRequest

Bases: OCIRequest

Revoke all previously issued long lived tokens. If the userId is not specified, revoke all tokens in the system. If the userId is specified, revoke all tokens issued to the user. The response is either a SuccessResponse or an ErrorResponse.

Attributes:

user_id (Optional[str]):
Source code in src/mercury_ocip/commands/commands.py
@dataclass(kw_only=True)
class LongLivedTokenRevokeRequest(OCIRequest):
    """Revoke all previously issued long lived tokens.
        If the userId is not specified, revoke all tokens in the system.
        If the userId is specified, revoke all tokens issued to the user.
        The response is either a SuccessResponse or an ErrorResponse.

    Attributes:

        user_id (Optional[str]):

    """

    user_id: Optional[str] = field(default=None, metadata={"alias": "userId"})

Responses

Bases: OCIResponse

Source code in src/mercury_ocip/commands/base_command.py
class SuccessResponse(OCIResponse):
    pass

Bases: OCIResponse

Source code in src/mercury_ocip/commands/base_command.py
class ErrorResponse(OCIResponse):
    errorCode: Optional[int] = None
    summary: str
    summaryEnglish: str
    detail: Optional[str] = None

Example Usage

from mercury_ocip.client import Client
from mercury_ocip.commands import LongLivedTokenRevokeRequest

client = Client()

command = LongLivedTokenRevokeRequest(
    user_id=...,
)

response = client.command(command)

print(response)

Example 2 with Raw Command

from mercury_ocip.client import Client

client = Client()

response = client.raw_command("LongLivedTokenRevokeRequest",
    user_id=...,
)

print(response)