Skip to content

RequestPermissionResponse

Base classes

Name Children Inherits
Response
aclientp.schema.base
Base request model.

⋔ Inheritance diagram

graph TD
  95970860961056["client_responses.RequestPermissionResponse"]
  95970861210848["base.Response"]
  95970862258240["base.AnnotatedObject"]
  95970862254416["base.Schema"]
  95970851503232["main.BaseModel"]
  125067848591872["builtins.object"]
  95970861210848 --> 95970860961056
  95970862258240 --> 95970861210848
  95970862254416 --> 95970862258240
  95970851503232 --> 95970862254416
  125067848591872 --> 95970851503232

🛈 DocStrings

Bases: Response

Response to a permission request.

Source code in src/aclientp/schema/client_responses.py
class RequestPermissionResponse(Response):
    """Response to a permission request."""

    outcome: RequestPermissionOutcome
    """The user's decision on the permission request."""

    @classmethod
    def denied(cls, metadata: dict[str, Any] | None = None) -> Self:
        """Create a response indicating that the permission request was denied."""
        return cls(outcome=DeniedOutcome(), field_meta=metadata)

    @classmethod
    def allowed(cls, option_id: str, metadata: dict[str, Any] | None = None) -> Self:
        """Create a response indicating that the permission request was allowed."""
        return cls(outcome=AllowedOutcome(option_id=option_id), field_meta=metadata)

outcome instance-attribute

The user's decision on the permission request.

allowed classmethod

allowed(option_id: str, metadata: dict[str, Any] | None = None) -> Self

Create a response indicating that the permission request was allowed.

Source code in src/aclientp/schema/client_responses.py
@classmethod
def allowed(cls, option_id: str, metadata: dict[str, Any] | None = None) -> Self:
    """Create a response indicating that the permission request was allowed."""
    return cls(outcome=AllowedOutcome(option_id=option_id), field_meta=metadata)

denied classmethod

denied(metadata: dict[str, Any] | None = None) -> Self

Create a response indicating that the permission request was denied.

Source code in src/aclientp/schema/client_responses.py
@classmethod
def denied(cls, metadata: dict[str, Any] | None = None) -> Self:
    """Create a response indicating that the permission request was denied."""
    return cls(outcome=DeniedOutcome(), field_meta=metadata)

:fa-brands-github: Show source on GitHub