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: InvokerClient

A client that overrides the resolution context of the wrapped client.

Parameters:
client: InvokerClient
get_implementations(uri: Uri, apply_resolution: bool = True) List[Uri] | None[source]

Get implementations of an interface with its URI.

Parameters:
  • uri (Uri) – URI of the interface.

  • apply_resolution (bool) – If True, apply resolution to the URI and interfaces.

Returns:

List of implementations or None if not found.

Return type:

Optional[List[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:
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:
Returns:

URI Resolution Result.

Return type:

Any