# Copyright (c) 2022 CloudZero - ALL RIGHTS RESERVED - PROPRIETARY AND CONFIDENTIAL
# Unauthorized copying of this file and/or project, via any medium is strictly prohibited.
# Direct all questions to legal@cloudzero.com
import os

import czc.internal_api.client as client
from czc.aws_environment import environment, reactor_account_id


def _iapi(api: str):
    return client.invoked(
        namespace=lambda _: os.environ['NAMESPACE'],
        feature='cost-adaptor-anycost',
        account_id=lambda: reactor_account_id(environment(os.environ['NAMESPACE'])),
        api=api,
    )


@_iapi('update-connection-credentials')
def update_connection_credentials(
    *, organization_id: str, cloud_provider: str, connection_id: str, provider_config: dict, credentials: dict
):
    pass


@_iapi('validate-conn-credentials')
def validate_connection_credentials(
    *, billing_account_id: str = '', cloud_provider: str, provider_config: dict, credentials: dict
):
    pass


@_iapi('call-adaptor-api')
def call_adaptor_api(
    *, organization_id: str, cloud_provider: str, connection_id: str, method_name: str, method_args: dict | None = None
):
    pass


@_iapi('get-adaptor-setup-script')
def get_adaptor_setup_script(
    *,
    organization_id: str,
    cloud_provider: str,
    connection_id: str,
):
    pass


@_iapi('get-account-prices')
def get_account_prices(
    *,
    organization_id: str,
    connection_id: str,
):
    pass


@_iapi('verify-provider-config')
def verify_provider_config(
    *,
    cloud_provider: str,
    provider_config: dict,
):
    pass


@_iapi('verify-provider-credentials')
def verify_provider_credentials(
    *,
    cloud_provider: str,
    credentials: dict,
):
    pass


@_iapi('get-provider-details')
def get_provider_details(
    *,
    cloud_provider: str,
):
    pass
