# Copyright (c) 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 core_account_id, environment

# NOTE: if this feature is deployed into reactor, then you should import reactor_account_id instead of core_account_id


def iapi(api: str):
    return client.invoked(
        namespace=lambda _: os.environ.get('VIEWS_NAMESPACE') or os.environ['NAMESPACE'],
        feature='views',
        account_id=lambda: core_account_id(environment(os.environ['NAMESPACE'])),
        api=api,
    )
