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

"""
coingeckopublicapiv3

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

from apimatic_core.configurations.global_configuration import GlobalConfiguration
from apimatic_core.decorators.lazy_property import LazyProperty
from coingeckopublicapiv3.configuration import Configuration
from coingeckopublicapiv3.controllers.base_controller import BaseController
from coingeckopublicapiv3.configuration import Environment
from coingeckopublicapiv3.http.auth.api_key_auth import ApiKeyAuth
from coingeckopublicapiv3.http.auth.api_key_query_param import ApiKeyQueryParam
from coingeckopublicapiv3.controllers.ping_controller import PingController
from coingeckopublicapiv3.controllers.simple_controller import SimpleController
from coingeckopublicapiv3.controllers.coins_controller import CoinsController
from coingeckopublicapiv3.controllers.contract_controller\
    import ContractController
from coingeckopublicapiv3.controllers.asset_platforms_controller\
    import AssetPlatformsController
from coingeckopublicapiv3.controllers.categories_controller\
    import CategoriesController
from coingeckopublicapiv3.controllers.exchanges_controller\
    import ExchangesController
from coingeckopublicapiv3.controllers.derivatives_controller\
    import DerivativesController
from coingeckopublicapiv3.controllers.nf_ts_beta_controller\
    import NFTsBetaController
from coingeckopublicapiv3.controllers.exchange_rates_controller\
    import ExchangeRatesController
from coingeckopublicapiv3.controllers.search_controller import SearchController
from coingeckopublicapiv3.controllers.trending_controller\
    import TrendingController
from coingeckopublicapiv3.controllers.global_controller import GlobalController
from coingeckopublicapiv3.controllers.companies_beta_controller\
    import CompaniesBetaController


class Coingeckopublicapiv3Client(object):
    @LazyProperty
    def ping(self):
        return PingController(self.global_configuration)

    @LazyProperty
    def simple(self):
        return SimpleController(self.global_configuration)

    @LazyProperty
    def coins(self):
        return CoinsController(self.global_configuration)

    @LazyProperty
    def contract(self):
        return ContractController(self.global_configuration)

    @LazyProperty
    def asset_platforms(self):
        return AssetPlatformsController(self.global_configuration)

    @LazyProperty
    def categories(self):
        return CategoriesController(self.global_configuration)

    @LazyProperty
    def exchanges(self):
        return ExchangesController(self.global_configuration)

    @LazyProperty
    def derivatives(self):
        return DerivativesController(self.global_configuration)

    @LazyProperty
    def nf_ts_beta(self):
        return NFTsBetaController(self.global_configuration)

    @LazyProperty
    def exchange_rates(self):
        return ExchangeRatesController(self.global_configuration)

    @LazyProperty
    def search(self):
        return SearchController(self.global_configuration)

    @LazyProperty
    def trending(self):
        return TrendingController(self.global_configuration)

    @LazyProperty
    def mglobal(self):
        return GlobalController(self.global_configuration)

    @LazyProperty
    def companies_beta(self):
        return CompaniesBetaController(self.global_configuration)

    def __init__(self, http_client_instance=None,
                 override_http_client_configuration=False, http_call_back=None,
                 timeout=60, max_retries=0, backoff_factor=2,
                 retry_statuses=None, retry_methods=None,
                 environment=Environment.PRODUCTION,
                 api_key_auth_credentials=None,
                 api_key_query_param_credentials=None, config=None):
        self.config = config or Configuration(
            http_client_instance=http_client_instance,
            override_http_client_configuration=override_http_client_configuration,
            http_call_back=http_call_back, timeout=timeout,
            max_retries=max_retries, backoff_factor=backoff_factor,
            retry_statuses=retry_statuses, retry_methods=retry_methods,
            environment=environment,
            api_key_auth_credentials=api_key_auth_credentials,
            api_key_query_param_credentials=api_key_query_param_credentials)

        self.global_configuration = GlobalConfiguration(self.config)\
            .global_errors(BaseController.global_errors())\
            .base_uri_executor(self.config.get_base_uri)\
            .user_agent(BaseController.user_agent(), BaseController.user_agent_parameters())

        self.auth_managers = {key: None for key in ['apiKeyAuth',
                                                    'apiKeyQueryParam']}
        self.auth_managers['apiKeyAuth'] = ApiKeyAuth(
            self.config.api_key_auth_credentials)
        self.auth_managers['apiKeyQueryParam'] = ApiKeyQueryParam(
            self.config.api_key_query_param_credentials)
        self.global_configuration = self.global_configuration.auth_managers(self.auth_managers)

