qcs 0.26.2-rc.0

High level interface for running Quil on a QPU
Documentation
# This file is automatically generated by pyo3_stub_gen
# ruff: noqa: E501, F401

import builtins
import collections.abc
import typing
from qcs_api_client_common.configuration import OAuthSession
from qcs_sdk import QcsSdkError

class BuildClientError(ClientError):
    r"""
    Errors encountered while building the QCS API client configuration manually.
    """
    ...

class ClientError(QcsSdkError):
    r"""
    Errors encountered while interacting with a QCS API client.
    """
    ...

class LoadClientError(ClientError):
    r"""
    Errors encountered while loading the QCS API client configuration from the environment configuration.
    """
    ...

@typing.final
class QCSClient:
    r"""
    A client providing helper functionality for accessing QCS APIs
    """
    @property
    def api_url(self) -> builtins.str:
        r"""
        URL to access the QCS API.
        """
    @property
    def grpc_api_url(self) -> builtins.str:
        r"""
        URL to access the QCS gRPC API.
        """
    @property
    def oauth_session(self) -> OAuthSession:
        r"""
        Get a copy of the OAuth session.
        """
    @property
    def quilc_url(self) -> builtins.str:
        r"""
        URL to access the ``quilc`` compiler.
        """
    @property
    def qvm_url(self) -> builtins.str:
        r"""
        URL to access the QVM.
        """
    def __eq__(self, other: builtins.object) -> builtins.bool: ...
    def __new__(cls, oauth_session: typing.Optional[OAuthSession] = None, api_url: typing.Optional[builtins.str] = None, grpc_api_url: typing.Optional[builtins.str] = None, quilc_url: typing.Optional[builtins.str] = None, qvm_url: typing.Optional[builtins.str] = None) -> QCSClient:
        r"""
        Manually construct a `QCSClient`.
        
        Prefer to use `QCSClient.load` to construct an environment-based profile.
        """
    def get_oauth_session_async(self) -> collections.abc.Awaitable[typing.Any]:
        r"""
        Get a copy of the OAuth session in an async context.
        """
    @staticmethod
    def load(profile_name: typing.Optional[builtins.str] = None) -> QCSClient:
        r"""
        Create a `QCSClient` configuration using an environment-based configuration.
        
        :param `profile_name`: The QCS setting's profile name to use. If ``None``, the default value configured in your environment is used.
        
        :raises `LoadClientError`: If there is an issue loading the profile details from the environment.
        """
    @staticmethod
    def load_with_login(profile_name: typing.Optional[builtins.str] = None) -> QCSClient:
        r"""
        Create a `QCSClient` configuration using an environment-based configuration.
        
        If credentials are not found or stale, a PKCE login redirect flow will be initialized.
        Note that this opens up a TCP port on your system to accept a browser HTTP redirect,
        so you should not use this in environments where that is not possible,
        such as hosted `JupyterLab` sessions.
        
        :param `profile_name`: The QCS setting's profile name to use. If ``None``, the default value configured in your environment is used.
        
        :raises `LoadClientError`: If there is an issue loading the profile details from the environment or if the PKCE login flow fails.
        
        See the [QCS documentation](https://docs.rigetti.com/qcs/references/qcs-client-configuration#environment-variables-and-configuration-files)
        for more details.
        """
    @staticmethod
    def load_with_login_async(profile_name: typing.Optional[builtins.str] = None) -> collections.abc.Awaitable[QCSClient]:
        r"""
        Create a `QCSClient` configuration using an environment-based configuration.
        
        If credentials are not found or stale, a PKCE login redirect flow will be initialized.
        Note that this opens up a TCP port on your system to accept a browser HTTP redirect,
        so you should not use this in environments where that is not possible,
        such as hosted `JupyterLab` sessions.
        
        :param `profile_name`: The QCS setting's profile name to use. If ``None``, the default value configured in your environment is used.
        
        :raises `LoadClientError`: If there is an issue loading the profile details from the environment or if the PKCE login flow fails.
        
        See the [QCS documentation](https://docs.rigetti.com/qcs/references/qcs-client-configuration#environment-variables-and-configuration-files)
        for more details.
        """

class RPCQQuilcError(ClientError):
    r"""
    Errors when compiling with RPCQ client.
    """
    ...

class TokenError(ClientError):
    r"""
    Errors that can occur when managing authorization tokens.
    """
    ...