# coding: utf-8

"""
Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
"""
from __future__ import annotations

from enum import Enum
from json import loads
from typing import Self


class TriggerType(str, Enum):
    """
    The type of the task reflect how it can be used:   - onDemand: a task that runs manually   - schedule: a task that runs regularly, following a given cron expression   - subscription: a task that runs after a subscription event is received from an integration (e.g. Webhook).   - streaming: a task that runs continuously.
    """

    """
    allowed enum values
    """
    ONDEMAND = "onDemand"
    SCHEDULE = "schedule"
    SUBSCRIPTION = "subscription"
    STREAMING = "streaming"

    @classmethod
    def from_json(cls, json_str: str) -> Self:
        """Create an instance of TriggerType from a JSON string"""
        return cls(loads(json_str))
