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

"""
coingeckopublicapiv3

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

from apimatic_core.authentication.query_auth import QueryAuth


class ApiKeyQueryParam(QueryAuth):

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

        """
        return "ApiKeyQueryParam: x_cg_demo_api_key is undefined."

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


class ApiKeyQueryParamCredentials:

    @property
    def x_cg_demo_api_key(self):
        return self._x_cg_demo_api_key

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

    def clone_with(self, x_cg_demo_api_key=None):
        return ApiKeyQueryParamCredentials(
            x_cg_demo_api_key or self.x_cg_demo_api_key)
