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

"""
cookiesapi

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

import os
from cookiesapi.decorators import lazy_property
from cookiesapi.configuration import Configuration
from cookiesapi.configuration import Environment
from cookiesapi.controllers.stores_controller import StoresController
from cookiesapi.controllers.strains_controller import StrainsController
from cookiesapi.controllers.brands_controller import BrandsController


class CookiesapiClient(object):

    @lazy_property
    def stores(self):
        return StoresController(self.config)

    @lazy_property
    def strains(self):
        return StrainsController(self.config)

    @lazy_property
    def brands(self):
        return BrandsController(self.config)

    def __init__(self, timeout=60, max_retries=0, backoff_factor=2,
                 retry_statuses=[408, 413, 429, 500, 502, 503, 504, 521, 522, 524],
                 retry_methods=['GET', 'PUT'], environment=Environment.SANDBOX,
                 apikey=None, config=None):
        if config is None:
            self.config = Configuration(timeout=timeout,
                                        max_retries=max_retries,
                                        backoff_factor=backoff_factor,
                                        retry_statuses=retry_statuses,
                                        retry_methods=retry_methods,
                                        environment=environment,
                                        apikey=apikey or os.environ.get('COOKIES_APIKEY', ''))
        else:
            self.config = config
