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

"""
spotifywebapiwithfixesandimprovementsfromsonallux

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 spotifywebapiwithfixesandimprovementsfromsonallux.configuration import Configuration
from spotifywebapiwithfixesandimprovementsfromsonallux.controllers.base_controller import BaseController
from spotifywebapiwithfixesandimprovementsfromsonallux.configuration import Environment
from spotifywebapiwithfixesandimprovementsfromsonallux.http.auth.o_auth_2 import OAuth2
from spotifywebapiwithfixesandimprovementsfromsonallux.controllers.albums_controller\
    import AlbumsController
from spotifywebapiwithfixesandimprovementsfromsonallux.controllers.artists_controller\
    import ArtistsController
from spotifywebapiwithfixesandimprovementsfromsonallux.controllers.audiobooks_controller\
    import AudiobooksController
from spotifywebapiwithfixesandimprovementsfromsonallux.controllers.categories_controller\
    import CategoriesController
from spotifywebapiwithfixesandimprovementsfromsonallux.controllers.chapters_controller\
    import ChaptersController
from spotifywebapiwithfixesandimprovementsfromsonallux.controllers.episodes_controller\
    import EpisodesController
from spotifywebapiwithfixesandimprovementsfromsonallux.controllers.genres_controller\
    import GenresController
from spotifywebapiwithfixesandimprovementsfromsonallux.controllers.markets_controller\
    import MarketsController
from spotifywebapiwithfixesandimprovementsfromsonallux.controllers.player_controller\
    import PlayerController
from spotifywebapiwithfixesandimprovementsfromsonallux.controllers.playlists_controller\
    import PlaylistsController
from spotifywebapiwithfixesandimprovementsfromsonallux.controllers.search_controller\
    import SearchController
from spotifywebapiwithfixesandimprovementsfromsonallux.controllers.shows_controller\
    import ShowsController
from spotifywebapiwithfixesandimprovementsfromsonallux.controllers.tracks_controller\
    import TracksController
from spotifywebapiwithfixesandimprovementsfromsonallux.controllers.users_controller\
    import UsersController
from spotifywebapiwithfixesandimprovementsfromsonallux.controllers.o_auth_authorization_controller\
    import OAuthAuthorizationController


class SpotifywebapiwithfixesandimprovementsfromsonalluxClient(object):
    @LazyProperty
    def albums(self):
        return AlbumsController(self.global_configuration)

    @LazyProperty
    def artists(self):
        return ArtistsController(self.global_configuration)

    @LazyProperty
    def audiobooks(self):
        return AudiobooksController(self.global_configuration)

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

    @LazyProperty
    def chapters(self):
        return ChaptersController(self.global_configuration)

    @LazyProperty
    def episodes(self):
        return EpisodesController(self.global_configuration)

    @LazyProperty
    def genres(self):
        return GenresController(self.global_configuration)

    @LazyProperty
    def markets(self):
        return MarketsController(self.global_configuration)

    @LazyProperty
    def player(self):
        return PlayerController(self.global_configuration)

    @LazyProperty
    def playlists(self):
        return PlaylistsController(self.global_configuration)

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

    @LazyProperty
    def shows(self):
        return ShowsController(self.global_configuration)

    @LazyProperty
    def tracks(self):
        return TracksController(self.global_configuration)

    @LazyProperty
    def users(self):
        return UsersController(self.global_configuration)

    @LazyProperty
    def o_auth_authorization(self):
        return OAuthAuthorizationController(self.global_configuration)

    @property
    def oauth_2_0(self):
        return self.auth_managers['oauth_2_0']

    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, o_auth_client_id=None,
                 o_auth_client_secret=None, o_auth_redirect_uri=None,
                 o_auth_token=None, o_auth_scopes=None,
                 authorization_code_auth_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, o_auth_client_id=o_auth_client_id,
            o_auth_client_secret=o_auth_client_secret,
            o_auth_redirect_uri=o_auth_redirect_uri, o_auth_token=o_auth_token,
            o_auth_scopes=o_auth_scopes,
            authorization_code_auth_credentials=authorization_code_auth_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 ['oauth_2_0']}
        self.auth_managers['oauth_2_0'] = OAuth2(
            self.config.authorization_code_auth_credentials,
            self.global_configuration)
        self.global_configuration = self.global_configuration.auth_managers(self.auth_managers)

