polywrap_plugin.resolution_context_override_client module
This module defines the ResolutionContextOverrideClient class.
- class polywrap_plugin.resolution_context_override_client.ResolutionContextOverrideClient(client: InvokerClient, resolution_context: UriResolutionContext | None)[source]
Bases:
InvokerClientA client that overrides the resolution context of the wrapped client.
- Parameters:
client (InvokerClient) – The wrapped client.
resolution_context (Optional[UriResolutionContext]) – The resolution context to use.
- client: InvokerClient
- get_implementations(uri: Uri, apply_resolution: bool = True) List[Uri] | None[source]
Get implementations of an interface with its URI.
- invoke(uri: Uri, method: str, args: Any | None = None, env: Any | None = None, resolution_context: UriResolutionContext | None = None, encode_result: bool | None = False) Any[source]
Invoke the Wrapper based on the provided InvokerOptions.
- Parameters:
uri (Uri) – Uri of the wrapper
method (str) – Method to be executed
args (Optional[Any]) – Arguments for the method, structured as a dictionary
env (Optional[Any]) – Override the client’s config for all invokes within this invoke.
resolution_context (Optional[UriResolutionContext]) – A URI resolution context
encode_result (Optional[bool]) – If True, the result will be encoded
- Returns:
invocation result.
- Return type:
Any
- Raises:
WrapInvocationError – If the plugin method is not defined or is not callable.
WrapAbortError – If the plugin method raises an exception.
MsgpackDecodeError – If the plugin method returns invalid msgpack.
- resolution_context: UriResolutionContext | None
- try_resolve_uri(uri: Uri, resolution_context: UriResolutionContext | None = None) Any[source]
Try to resolve a URI to a wrap package, a wrapper, or a URI.
- Parameters:
uri (Uri) – The URI to resolve.
resolution_context (UriResolutionContext) – The resolution context.
- Returns:
URI Resolution Result.
- Return type:
Any