# -*- coding: utf-8 -*-

"""
uexcorpapi

This file was automatically generated by APIMATIC v3.0 (
 https://www.apimatic.io ).
"""

from apimatic_core.authentication.header_auth import HeaderAuth


class ApiKey(HeaderAuth):

    @property
    def error_message(self):
        """Display error message on occurrence of authentication failure
        in ApiKey

        """
        return "ApiKey: secret_key is undefined."

    def __init__(self, api_key_credentials):
        auth_params = {}
        if api_key_credentials is not None \
                and api_key_credentials.secret_key is not None:
            auth_params["secret_key"] = api_key_credentials.secret_key
        super().__init__(auth_params=auth_params)


class ApiKeyCredentials:

    @property
    def secret_key(self):
        return self._secret_key

    def __init__(self, secret_key):
        if secret_key is None:
            raise ValueError('secret_key cannot be None')
        self._secret_key = secret_key

    def clone_with(self, secret_key=None):
        return ApiKeyCredentials(secret_key or self.secret_key)
