import builtins
import collections.abc
import typing
from qcs_api_client_common import QcsApiClientError
API_URL_VAR: typing.Final = 'QCS_SETTINGS_APPLICATIONS_API_URL'
DEFAULT_API_URL: typing.Final = 'https://api.qcs.rigetti.com'
DEFAULT_GRPC_API_URL: typing.Final = 'https://grpc.qcs.rigetti.com'
DEFAULT_PROFILE_NAME: typing.Final = 'default'
DEFAULT_QUILC_URL: typing.Final = 'tcp://127.0.0.1:5555'
DEFAULT_QVM_URL: typing.Final = 'http://127.0.0.1:5000'
DEFAULT_SECRETS_PATH: typing.Final = '~/.qcs/secrets.toml'
DEFAULT_SETTINGS_PATH: typing.Final = '~/.qcs/settings.toml'
GRPC_API_URL_VAR: typing.Final = 'QCS_SETTINGS_APPLICATIONS_GRPC_URL'
PROFILE_NAME_VAR: typing.Final = 'QCS_PROFILE_NAME'
QUILC_URL_VAR: typing.Final = 'QCS_SETTINGS_APPLICATIONS_QUILC_URL'
QVM_URL_VAR: typing.Final = 'QCS_SETTINGS_APPLICATIONS_QVM_URL'
SECRETS_PATH_VAR: typing.Final = 'QCS_SECRETS_FILE_PATH'
SETTINGS_PATH_VAR: typing.Final = 'QCS_SETTINGS_FILE_PATH'
@typing.final
class AuthServer:
@property
def client_id(self) -> builtins.str:
@client_id.setter
def client_id(self, value: builtins.str) -> None:
@property
def issuer(self) -> builtins.str:
@issuer.setter
def issuer(self, value: builtins.str) -> None:
@property
def scopes(self) -> typing.Optional[builtins.list[builtins.str]]:
@scopes.setter
def scopes(self, value: typing.Optional[builtins.list[builtins.str]]) -> None:
def __eq__(self, other: builtins.object) -> builtins.bool: ...
def __new__(cls, client_id: builtins.str, issuer: builtins.str, scopes: typing.Optional[typing.Sequence[builtins.str]] = None) -> AuthServer: ...
def __repr__(self) -> builtins.str:
@staticmethod
def default() -> AuthServer: ...
@typing.final
class ClientConfiguration:
@property
def api_url(self) -> builtins.str:
@property
def grpc_api_url(self) -> builtins.str:
@property
def quilc_url(self) -> builtins.str:
@property
def qvm_url(self) -> builtins.str:
def __new__(cls, 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, oauth_session: typing.Optional[OAuthSession] = None) -> ClientConfiguration: ...
def __repr__(self) -> builtins.str:
@staticmethod
def builder() -> ClientConfigurationBuilder: ...
def get_bearer_access_token(self) -> SecretAccessToken:
def get_bearer_access_token_async(self) -> collections.abc.Awaitable[SecretAccessToken]: ...
def get_oauth_session(self) -> OAuthSession:
def get_oauth_session_async(self) -> collections.abc.Awaitable[OAuthSession]: ...
@staticmethod
def load_default() -> ClientConfiguration: ...
@staticmethod
def load_default_with_login() -> ClientConfiguration: ...
@staticmethod
def load_profile(profile_name: builtins.str) -> ClientConfiguration: ...
@typing.final
class ClientConfigurationBuilder:
@property
def api_url(self) -> typing.Optional[builtins.str]:
@api_url.setter
def api_url(self, value: typing.Optional[builtins.str]) -> None:
@property
def grpc_api_url(self) -> typing.Optional[builtins.str]:
@grpc_api_url.setter
def grpc_api_url(self, value: typing.Optional[builtins.str]) -> None:
@property
def oauth_session(self) -> typing.Optional[typing.Optional[TokenDispatcher]]:
@oauth_session.setter
def oauth_session(self, value: typing.Optional[OAuthSession]) -> None:
@property
def quilc_url(self) -> typing.Optional[builtins.str]:
@quilc_url.setter
def quilc_url(self, value: typing.Optional[builtins.str]) -> None:
@property
def qvm_url(self) -> typing.Optional[builtins.str]:
@qvm_url.setter
def qvm_url(self, value: typing.Optional[builtins.str]) -> None:
def __new__(cls) -> ClientConfigurationBuilder: ...
def build(self) -> ClientConfiguration: ...
class ClientConfigurationBuilderError(ConfigurationError):
...
@typing.final
class ClientCredentials:
@property
def client_id(self) -> builtins.str:
@property
def client_secret(self) -> ClientSecret:
def __eq__(self, other: builtins.object) -> builtins.bool: ...
def __new__(cls, client_id: builtins.str, client_secret: builtins.str) -> ClientCredentials: ...
def __repr__(self) -> builtins.str:
@typing.final
class ClientSecret:
@property
def is_empty(self) -> builtins.bool:
@property
def secret(self) -> builtins.str:
def __eq__(self, other: builtins.object) -> builtins.bool: ...
def __new__(cls, value: builtins.str) -> ClientSecret: ...
def __repr__(self) -> builtins.str:
class ConfigurationError(QcsApiClientError):
...
@typing.final
class ExternallyManaged:
def __new__(cls, refresh_function: collections.abc.Callable[[AuthServer], str]) -> ExternallyManaged: ...
def __repr__(self) -> builtins.str:
class LoadError(ConfigurationError):
...
@typing.final
class OAuthSession:
@property
def access_token(self) -> typing.Optional[SecretAccessToken]:
@property
def auth_server(self) -> AuthServer:
@property
def payload(self) -> RefreshToken | ClientConfiguration | ExternallyManaged | PkceFlow:
def __new__(cls, payload: RefreshToken | ClientConfiguration | ExternallyManaged | PkceFlow, auth_server: AuthServer, access_token: typing.Optional[SecretAccessToken] = None) -> OAuthSession: ...
def __repr__(self) -> builtins.str:
def request_access_token(self) -> SecretAccessToken: ...
def request_access_token_async(self) -> collections.abc.Awaitable[SecretAccessToken]: ...
def validate(self) -> SecretAccessToken: ...
@typing.final
class PkceFlow:
@property
def access_token(self) -> SecretAccessToken:
@property
def refresh_token(self) -> typing.Optional[RefreshToken]:
def __eq__(self, other: builtins.object) -> builtins.bool: ...
def __new__(cls, auth_server: AuthServer) -> PkceFlow: ...
def __repr__(self) -> builtins.str:
@typing.final
class RefreshToken:
@property
def refresh_token(self) -> SecretRefreshToken:
@refresh_token.setter
def refresh_token(self, value: SecretRefreshToken) -> None:
def __eq__(self, other: builtins.object) -> builtins.bool: ...
def __new__(cls, refresh_token: SecretRefreshToken) -> RefreshToken: ...
def __repr__(self) -> builtins.str:
@typing.final
class SecretAccessToken:
@property
def is_empty(self) -> builtins.bool:
@property
def secret(self) -> builtins.str:
def __eq__(self, other: builtins.object) -> builtins.bool: ...
def __new__(cls, value: builtins.str) -> SecretAccessToken: ...
def __repr__(self) -> builtins.str:
@typing.final
class SecretRefreshToken:
@property
def is_empty(self) -> builtins.bool:
@property
def secret(self) -> builtins.str:
def __eq__(self, other: builtins.object) -> builtins.bool: ...
def __new__(cls, value: builtins.str) -> SecretRefreshToken: ...
def __repr__(self) -> builtins.str:
@typing.final
class TokenDispatcher:
...
class TokenError(ConfigurationError):
...
def get_bearer_access_token(configuration: ClientConfiguration) -> SecretAccessToken:
def get_bearer_access_token_async(configuration: ClientConfiguration) -> collections.abc.Awaitable[SecretAccessToken]:
def get_oauth_session(tokens: typing.Optional[TokenDispatcher]) -> OAuthSession: ...
def get_oauth_session_async(tokens: typing.Optional[TokenDispatcher]) -> collections.abc.Awaitable[OAuthSession]: ...
def request_access_token(session: OAuthSession) -> SecretAccessToken:
def request_access_token_async(session: OAuthSession) -> collections.abc.Awaitable[SecretAccessToken]: