reviewboard.licensing.actions¶
License action definitions.
New in version 7.1.
- LicenseActionData¶
Data passed to an action handler.
This is a mapping of string keys to JSON values.
New in version 7.1.
alias of
Mapping[str,Union[JSONDict,JSONDictImmutable,JSONList,JSONListImmutable,None,bool,float,int,str]]
- class LicenseAction[source]¶
Bases:
TypedDictAn action that can be performed on a license.
These will be displayed in the UI when displaying license information.
New in version 7.1.
- label: StrOrPromise¶
The localized label for the action.
- call_args: NotRequired[JSONDict]¶
Arguments to pass in a call to the License Provider’s action handler.
- extra_data: NotRequired[JSONDict]¶
Extra data to include in the action for client-side handling.
- url: NotRequired[str | None]¶
The URL to navigate to when clicking the action.
If omitted or
None, it’s up to the license implementation to provide JavaScript management for the action.
- __closed__ = None¶
- __extra_items__ = typing_extensions.NoExtraItems¶
- __mutable_keys__ = frozenset({'action_id', 'call_args', 'extra_data', 'label', 'primary', 'url'})¶
- __optional_keys__ = frozenset({})¶
- __readonly_keys__ = frozenset({})¶
- __required_keys__ = frozenset({'action_id', 'call_args', 'extra_data', 'label', 'primary', 'url'})¶
- __total__ = True¶
- class LicenseActionHandler(*args, **kwargs)[source]¶
Bases:
ProtocolProtocol for a method used to handle a license action request.
This is the signature required for any
handle_action_actionmethods on a license provider.New in version 7.1.
- __call__(*, license_info: LicenseInfo, action_data: LicenseActionData, request: HttpRequest | None) SerializableJSONDict[source]¶
Call self as a function.
- __abstractmethods__ = frozenset({})¶
- __callable_proto_members_only__ = True¶
- __init__(*args, **kwargs)¶
- __protocol_attrs__ = {'__call__'}¶
- classmethod __subclasshook__(other)¶
Abstract classes can override this to customize issubclass().
This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).