def __init__(<EOL>self,<EOL>auth_key,<EOL>auth_context,<EOL>region,<EOL>token_version=<NUM_LIT:2>,<EOL>token_cache_file=None,<EOL>token_lifetime=<NUM_LIT:10>,<EOL>aws_creds=None,<EOL>endpoint_url=None<EOL>):
self.auth_key = auth_key<EOL>if auth_context is None:<EOL><INDENT>self.auth_context = {}<EOL><DEDENT>else:<EOL><INDENT>self.auth_context = auth_context<EOL><DEDENT>self.token_cache_file = token_cache_file<EOL>self.token_lifetime = token_lifetime<EOL>self.region = region<EOL>self.token_version = token_version<EOL>self.aws_creds = aws_creds<EOL>if aws_creds:<EOL><INDENT>self.kms_client = kmsauth.services.get_boto_client(<EOL>'<STR_LIT>',<EOL>region=self.region,<EOL>aws_access_key_id=self.aws_creds['<STR_LIT>'],<EOL>aws_secret_access_key=self.aws_creds['<STR_LIT>'],<EOL>aws_session_token=self.aws_creds['<STR_LIT>'],<EOL>endpoint_url=endpoint_url<EOL>)<EOL><DEDENT>else:<EOL><INDENT>self.kms_client = kmsauth.services.get_boto_client(<EOL>'<STR_LIT>',<EOL>region=self.region,<EOL>endpoint_url=endpoint_url<EOL>)<EOL><DEDENT>self._validate()<EOL>
Create a KMSTokenGenerator object.

        Args:
            auth_key: The KMS key ARN or alias to use for authentication.
                Required.
            auth_context: The KMS encryption context to use for authentication.
                Required.
            region: AWS region to connect to. Required.
            token_version: The version of the authentication token. Default: 2
            token_cache_file: he location to use for caching the auth token.
                If set to empty string, no cache will be used. Default: None
            token_lifetime: Lifetime of the authentication token generated.
                Default: 10
            aws_creds: A dict of AccessKeyId, SecretAccessKey, SessionToken.
                Useful if you wish to pass in assumed role credentials or MFA
                credentials. Default: None
            endpoint_url: A URL to override the default endpoint used to access
                the KMS service. Default: None