(
        self,
        audience,
        subject_token_type,
        token_url,
        credential_source=None,
        service_account_impersonation_url=None,
        client_id=None,
        client_secret=None,
        quota_project_id=None,
        scopes=None,
        default_scopes=None,
    )
Instantiates an AWS workload external account credentials object.

        Args:
            audience (str): The STS audience field.
            subject_token_type (str): The subject token type.
            token_url (str): The STS endpoint URL.
            credential_source (Mapping): The credential source dictionary used
                to provide instructions on how to retrieve external credential
                to be exchanged for Google access tokens.
            service_account_impersonation_url (Optional[str]): The optional
                service account impersonation getAccessToken URL.
            client_id (Optional[str]): The optional client ID.
            client_secret (Optional[str]): The optional client secret.
            quota_project_id (Optional[str]): The optional quota project ID.
            scopes (Optional[Sequence[str]]): Optional scopes to request during
                the authorization grant.
            default_scopes (Optional[Sequence[str]]): Default scopes passed by a
                Google client library. Use 'scopes' for user-defined scopes.

        Raises:
            google.auth.exceptions.RefreshError: If an error is encountered during
                access token retrieval logic.
            ValueError: For invalid parameters.

        .. note:: Typically one of the helper constructors
            :meth:`from_file` or
            :meth:`from_info` are used instead of calling the constructor directly.
Instantiates an AWS workload external account credentials object.
Instantiates an AWS workload external account credentials object .
def __init__(
        self,
        audience,
        subject_token_type,
        token_url,
        credential_source=None,
        service_account_impersonation_url=None,
        client_id=None,
        client_secret=None,
        quota_project_id=None,
        scopes=None,
        default_scopes=None,
    ):
        """Instantiates an AWS workload external account credentials object.

        Args:
            audience (str): The STS audience field.
            subject_token_type (str): The subject token type.
            token_url (str): The STS endpoint URL.
            credential_source (Mapping): The credential source dictionary used
                to provide instructions on how to retrieve external credential
                to be exchanged for Google access tokens.
            service_account_impersonation_url (Optional[str]): The optional
                service account impersonation getAccessToken URL.
            client_id (Optional[str]): The optional client ID.
            client_secret (Optional[str]): The optional client secret.
            quota_project_id (Optional[str]): The optional quota project ID.
            scopes (Optional[Sequence[str]]): Optional scopes to request during
                the authorization grant.
            default_scopes (Optional[Sequence[str]]): Default scopes passed by a
                Google client library. Use 'scopes' for user-defined scopes.

        Raises:
            google.auth.exceptions.RefreshError: If an error is encountered during
                access token retrieval logic.
            ValueError: For invalid parameters.

        .. note:: Typically one of the helper constructors
            :meth:`from_file` or
            :meth:`from_info` are used instead of calling the constructor directly.
        """
        super(Credentials, self).__init__(
            audience=audience,
            subject_token_type=subject_token_type,
            token_url=token_url,
            credential_source=credential_source,
            service_account_impersonation_url=service_account_impersonation_url,
            client_id=client_id,
            client_secret=client_secret,
            quota_project_id=quota_project_id,
            scopes=scopes,
            default_scopes=default_scopes,
        )
        credential_source = credential_source or {}
        self._environment_id = credential_source.get("environment_id") or ""
        self._region_url = credential_source.get("region_url")
        self._security_credentials_url = credential_source.get("url")
        self._cred_verification_url = credential_source.get(
            "regional_cred_verification_url"
        )
        self._region = None
        self._request_signer = None
        self._target_resource = audience

        # Get the environment ID. Currently, only one version supported (v1).
        matches = re.match(r"^(aws)([\d]+)$", self._environment_id)
        if matches:
            env_id, env_version = matches.groups()
        else:
            env_id, env_version = (None, None)

        if env_id != "aws" or self._cred_verification_url is None:
            raise ValueError("No valid AWS 'credential_source' provided")
        elif int(env_version or "") != 1:
            raise ValueError(
                "aws version '{}' is not supported in the current build.".format(
                    env_version
                )
            )
def __init__ ( self , audience , subject_token_type , token_url , credential_source = None , service_account_impersonation_url = None , client_id = None , client_secret = None , quota_project_id = None , scopes = None , default_scopes = None , ) : super ( Credentials , self ) . __init__ ( audience = audience , subject_token_type = subject_token_type , token_url = token_url , credential_source = credential_source , service_account_impersonation_url = service_account_impersonation_url , client_id = client_id , client_secret = client_secret , quota_project_id = quota_project_id , scopes = scopes , default_scopes = default_scopes , ) credential_source = credential_source or { } self . _environment_id = credential_source . get ( "environment_id" ) or "" self . _region_url = credential_source . get ( "region_url" ) self . _security_credentials_url = credential_source . get ( "url" ) self . _cred_verification_url = credential_source . get ( "regional_cred_verification_url" ) self . _region = None self . _request_signer = None self . _target_resource = audience # Get the environment ID. Currently, only one version supported (v1). matches = re . match ( r"^(aws)([\d]+)$" , self . _environment_id ) if matches : env_id , env_version = matches . groups ( ) else : env_id , env_version = ( None , None ) if env_id != "aws" or self . _cred_verification_url is None : raise ValueError ( "No valid AWS 'credential_source' provided" ) elif int ( env_version or "" ) != 1 : raise ValueError ( "aws version '{}' is not supported in the current build." . format ( env_version ) )