"""
App enums.
"""

# pylint: disable=too-many-public-methods, unused-import

import typing as t
import typing_extensions as te  # noqa: F401
import typing_extensions as te
from composio.client.enums._action import Action
from composio.client.enums.base import APPS_CACHE, AppData, _AnnotatedEnum, enum

@enum
class App(_AnnotatedEnum[AppData], path=APPS_CACHE):
    """Class to represent `App` entity."""
    ABLY: 'App'
    ACCELO: 'App'
    ACTIVE_CAMPAIGN: 'App'
    ADOBE: 'App'
    AERO_WORKFLOW: 'App'
    AFFINITY: 'App'
    AGENCYZOOM: 'App'
    AIRTABLE: 'App'
    ALCHEMY: 'App'
    ALTOVIZ: 'App'
    AMAZON: 'App'
    AMCARDS: 'App'
    AMPLITUDE: 'App'
    ANTHROPIC: 'App'
    APPDRAG: 'App'
    APPSFLYER: 'App'
    ASANA: 'App'
    ASHBY: 'App'
    ATLASSIAN: 'App'
    ATTIO: 'App'
    AUTH0: 'App'
    AXONAUT: 'App'
    BAMBOOHR: 'App'
    BANNERBEAR: 'App'
    BASEROW: 'App'
    BATTLENET: 'App'
    BEEMINDER: 'App'
    BITBUCKET: 'App'
    BITWARDEN: 'App'
    BLACKBAUD: 'App'
    BLACKBOARD: 'App'
    BOLDSIGN: 'App'
    BOTBABA: 'App'
    BOX: 'App'
    BRAINTREE: 'App'
    BRANDFETCH: 'App'
    BREEZY_HR: 'App'
    BREVO: 'App'
    BREX: 'App'
    BREX_STAGING: 'App'
    BRIGHTPEARL: 'App'
    BROWSEAI: 'App'
    BROWSERBASE_TOOL: 'App'
    BROWSERHUB: 'App'
    BROWSER_TOOL: 'App'
    BUBBLE: 'App'
    CAL: 'App'
    CALENDLY: 'App'
    CANVA: 'App'
    CANVAS: 'App'
    CHATWORK: 'App'
    CHMEETINGS: 'App'
    CLICKUP: 'App'
    CLOSE: 'App'
    CLOUDFLARE: 'App'
    CODEINTERPRETER: 'App'
    CODE_ANALYSIS_TOOL: 'App'
    CODE_FORMAT_TOOL: 'App'
    COINMARKETCAL: 'App'
    COMPOSIO: 'App'
    CONTENTFUL: 'App'
    CUSTOMER_IO: 'App'
    DAILYBOT: 'App'
    DATADOG: 'App'
    DATAGMA: 'App'
    DATAROBOT: 'App'
    DEEL: 'App'
    DEMIO: 'App'
    DIGICERT: 'App'
    DISCORD: 'App'
    DISCORDBOT: 'App'
    DOCMOSIS: 'App'
    DOCUSIGN: 'App'
    DROPBOX: 'App'
    DROPBOX_SIGN: 'App'
    DYNAMICS365: 'App'
    ECHTPOST: 'App'
    ELEVENLABS: 'App'
    EMBED_TOOL: 'App'
    ENTELLIGENCE: 'App'
    EPIC_GAMES: 'App'
    EVENTBRITE: 'App'
    EXA: 'App'
    EXIST: 'App'
    FACEBOOK: 'App'
    FACTORIAL: 'App'
    FIGMA: 'App'
    FILETOOL: 'App'
    FINAGE: 'App'
    FIRECRAWL: 'App'
    FITBIT: 'App'
    FLUTTERWAVE: 'App'
    FOMO: 'App'
    FORMCARRY: 'App'
    FORMSITE: 'App'
    FRESHBOOKS: 'App'
    FRESHDESK: 'App'
    FRONT: 'App'
    GIT: 'App'
    GITHUB: 'App'
    GMAIL: 'App'
    GOOGLEBIGQUERY: 'App'
    GOOGLECALENDAR: 'App'
    GOOGLEDOCS: 'App'
    GOOGLEDRIVE: 'App'
    GOOGLEMEET: 'App'
    GOOGLESHEETS: 'App'
    GOOGLETASKS: 'App'
    GOOGLE_ANALYTICS: 'App'
    GORGIAS: 'App'
    GO_TO_WEBINAR: 'App'
    GREPTILE: 'App'
    GUMROAD: 'App'
    GURU: 'App'
    HACKERNEWS: 'App'
    HACKERRANK_WORK: 'App'
    HARVEST: 'App'
    HELCIM: 'App'
    HEYGEN: 'App'
    HIGHLEVEL: 'App'
    HISTORY_FETCHER: 'App'
    HUBSPOT: 'App'
    HUMANLOOP: 'App'
    ICIMS_TALENT_CLOUD: 'App'
    IDEA_SCALE: 'App'
    IMAGE_ANALYSER: 'App'
    INDUCED_AI: 'App'
    INTERCOM: 'App'
    INTERZOID: 'App'
    JIRA: 'App'
    JUNGLESCOUT: 'App'
    KEAP: 'App'
    KLAVIYO: 'App'
    KLIPFOLIO: 'App'
    LASTPASS: 'App'
    LAUNCH_DARKLY: 'App'
    LEVER: 'App'
    LEVER_SANDBOX: 'App'
    LEXOFFICE: 'App'
    LINEAR: 'App'
    LINKEDIN: 'App'
    LINKHUT: 'App'
    LISTENNOTES: 'App'
    LMNT: 'App'
    MAILCHIMP: 'App'
    MAILERLITE: 'App'
    MAINTAINX: 'App'
    MATHEMATICAL: 'App'
    MBOUM: 'App'
    MEM0: 'App'
    METATEXTAI: 'App'
    MICROSOFT_CLARITY: 'App'
    MICROSOFT_TEAMS: 'App'
    MICROSOFT_TENANT: 'App'
    MIRO: 'App'
    MIXPANEL: 'App'
    MOCEAN: 'App'
    MONDAY: 'App'
    MOPINION: 'App'
    MORE_TREES: 'App'
    MOXIE: 'App'
    MOZ: 'App'
    MULTIONAI: 'App'
    MURAL: 'App'
    NCSCALE: 'App'
    NETSUITE: 'App'
    NGROK: 'App'
    NOTION: 'App'
    ONCEHUB: 'App'
    ONE_DRIVE: 'App'
    OUTLOOK: 'App'
    PANDADOC: 'App'
    PERPLEXITYAI: 'App'
    PIGGY: 'App'
    PIPEDRIVE: 'App'
    PLACEKEY: 'App'
    POSTHOG: 'App'
    PRECORO: 'App'
    PRINTNODE: 'App'
    PROCESS_STREET: 'App'
    PRODUCTBOARD: 'App'
    QUALAROO: 'App'
    RAFFLYS: 'App'
    RAGTOOL: 'App'
    RAVENSEOTOOLS: 'App'
    REDDIT: 'App'
    RING_CENTRAL: 'App'
    RIPPLING: 'App'
    ROCKET_REACH: 'App'
    SAGE: 'App'
    SALESFORCE: 'App'
    SCREENSHOTONE: 'App'
    SEISMIC: 'App'
    SENDGRID: 'App'
    SERPAPI: 'App'
    SERVICEM8: 'App'
    SHARE_POINT: 'App'
    SHELLTOOL: 'App'
    SHOPIFY: 'App'
    SHORTCUT: 'App'
    SIMPLESAT: 'App'
    SLACK: 'App'
    SLACKBOT: 'App'
    SMARTRECRUITERS: 'App'
    SMUGMUG: 'App'
    SNOWFLAKE: 'App'
    SPIDERTOOL: 'App'
    SQLTOOL: 'App'
    SQUARE: 'App'
    STACK_EXCHANGE: 'App'
    SUPABASE: 'App'
    SURVEY_MONKEY: 'App'
    TAPFORM: 'App'
    TAVILY: 'App'
    TERMINUS: 'App'
    TEXTRAZOR: 'App'
    TIMECAMP: 'App'
    TIMEKIT: 'App'
    TIMELY: 'App'
    TINYPNG: 'App'
    TINYURL: 'App'
    TISANE: 'App'
    TODOIST: 'App'
    TONEDEN: 'App'
    TRELLO: 'App'
    TWITCH: 'App'
    TWITTER: 'App'
    TWITTER_MEDIA: 'App'
    VENLY: 'App'
    VERO: 'App'
    VISME: 'App'
    WABOXAPP: 'App'
    WAKATIME: 'App'
    WAVE_ACCOUNTING: 'App'
    WEATHERMAP: 'App'
    WEBEX: 'App'
    WEBFLOW: 'App'
    WEBTOOL: 'App'
    WIZ: 'App'
    WORKIOM: 'App'
    WORKSPACE_TOOL: 'App'
    XERO: 'App'
    YANDEX: 'App'
    YNAB: 'App'
    YOUSEARCH: 'App'
    YOUTUBE: 'App'
    ZENDESK: 'App'
    ZENSERP: 'App'
    ZEPTOOL: 'App'
    ZOHO: 'App'
    ZOHO_BIGIN: 'App'
    ZOHO_BOOKS: 'App'
    ZOHO_DESK: 'App'
    ZOHO_INVENTORY: 'App'
    ZOHO_INVOICE: 'App'
    ZOHO_MAIL: 'App'
    ZOOM: 'App'

    @property
    def is_local(self) -> bool:
        """The tool is local if set to `True`"""
        return self.load().is_local

    @property
    def name(self) -> str:
        """Name of the app."""
        return self.load().name

    def get_actions(self, tags: t.Optional[t.List[str]]=None) -> t.Iterator[Action]:
        """
        Get actions for the given app filtered by the `tags`

        :param tags: List of tags to filter the actions
        :return: Iterator object which yields `Action`
        """
        tags = tags or []
        app = f'{self.slug.lower()}_'
        for action in Action.all():
            if not action.slug.lower().startswith(app):
                continue
            if len(tags) == 0:
                yield action
            if any((tag in action.tags for tag in tags)):
                yield action