# This file was generated by liblab | https://liblab.com/

from .services.accounting import AccountingService
from .services.managers import ManagersService
from .services.people import PeopleService
from .services.eor import EorService
from .services.global_payroll import GlobalPayrollService
from .services.contractors import ContractorsService
from .services.adjustments import AdjustmentsService
from .services.candidates import CandidatesService
from .services.partner_managed import PartnerManagedService
from .services.contracts import ContractsService
from .services.tasks import TasksService
from .services.timesheets import TimesheetsService
from .services.milestones import MilestonesService
from .services.off_cycle_payments import OffCyclePaymentsService
from .services.time_off import TimeOffService
from .services.invoices import InvoicesService
from .services.organizations import OrganizationsService
from .services.lookups import LookupsService
from .services.webhooks import WebhooksService
from .services.token import TokenService
from .services.carta import CartaService
from .net.environment import Environment


class DeelSdk:
    def __init__(self, access_token: str, base_url: str = Environment.DEFAULT.value):
        """
        Initializes DeelSdk the SDK class.
        """
        self.accounting = AccountingService(base_url=base_url)
        self.managers = ManagersService(base_url=base_url)
        self.people = PeopleService(base_url=base_url)
        self.eor = EorService(base_url=base_url)
        self.global_payroll = GlobalPayrollService(base_url=base_url)
        self.contractors = ContractorsService(base_url=base_url)
        self.adjustments = AdjustmentsService(base_url=base_url)
        self.candidates = CandidatesService(base_url=base_url)
        self.partner_managed = PartnerManagedService(base_url=base_url)
        self.contracts = ContractsService(base_url=base_url)
        self.tasks = TasksService(base_url=base_url)
        self.timesheets = TimesheetsService(base_url=base_url)
        self.milestones = MilestonesService(base_url=base_url)
        self.off_cycle_payments = OffCyclePaymentsService(base_url=base_url)
        self.time_off = TimeOffService(base_url=base_url)
        self.invoices = InvoicesService(base_url=base_url)
        self.organizations = OrganizationsService(base_url=base_url)
        self.lookups = LookupsService(base_url=base_url)
        self.webhooks = WebhooksService(base_url=base_url)
        self.token = TokenService(base_url=base_url)
        self.carta = CartaService(base_url=base_url)
        self.set_access_token(access_token)

    def set_base_url(self, base_url):
        """
        Sets the base URL for the entire SDK.
        """
        self.accounting.set_base_url(base_url)
        self.managers.set_base_url(base_url)
        self.people.set_base_url(base_url)
        self.eor.set_base_url(base_url)
        self.global_payroll.set_base_url(base_url)
        self.contractors.set_base_url(base_url)
        self.adjustments.set_base_url(base_url)
        self.candidates.set_base_url(base_url)
        self.partner_managed.set_base_url(base_url)
        self.contracts.set_base_url(base_url)
        self.tasks.set_base_url(base_url)
        self.timesheets.set_base_url(base_url)
        self.milestones.set_base_url(base_url)
        self.off_cycle_payments.set_base_url(base_url)
        self.time_off.set_base_url(base_url)
        self.invoices.set_base_url(base_url)
        self.organizations.set_base_url(base_url)
        self.lookups.set_base_url(base_url)
        self.webhooks.set_base_url(base_url)
        self.token.set_base_url(base_url)
        self.carta.set_base_url(base_url)

        return self

    def set_access_token(self, access_token: str):
        """
        Sets the access token for the entire SDK.
        """
        self.accounting.set_access_token(access_token)
        self.managers.set_access_token(access_token)
        self.people.set_access_token(access_token)
        self.eor.set_access_token(access_token)
        self.global_payroll.set_access_token(access_token)
        self.contractors.set_access_token(access_token)
        self.adjustments.set_access_token(access_token)
        self.candidates.set_access_token(access_token)
        self.partner_managed.set_access_token(access_token)
        self.contracts.set_access_token(access_token)
        self.tasks.set_access_token(access_token)
        self.timesheets.set_access_token(access_token)
        self.milestones.set_access_token(access_token)
        self.off_cycle_payments.set_access_token(access_token)
        self.time_off.set_access_token(access_token)
        self.invoices.set_access_token(access_token)
        self.organizations.set_access_token(access_token)
        self.lookups.set_access_token(access_token)
        self.webhooks.set_access_token(access_token)
        self.token.set_access_token(access_token)
        self.carta.set_access_token(access_token)

        return self


# c029837e0e474b76bc487506e8799df5e3335891efe4fb02bda7a1441840310c
