|
| 1 | +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. |
| 2 | +# This product includes software developed at Datadog (https://www.datadoghq.com/). |
| 3 | +# Copyright 2019-Present Datadog, Inc. |
| 4 | +from __future__ import annotations |
| 5 | + |
| 6 | +from typing import List, Union, TYPE_CHECKING |
| 7 | + |
| 8 | +from datadog_api_client.model_utils import ( |
| 9 | + ModelNormal, |
| 10 | + cached_property, |
| 11 | + unset, |
| 12 | + UnsetType, |
| 13 | +) |
| 14 | + |
| 15 | + |
| 16 | +if TYPE_CHECKING: |
| 17 | + from datadog_api_client.v2.model.datastore_trigger import DatastoreTrigger |
| 18 | + |
| 19 | + |
| 20 | +class DatastoreTriggerWrapper(ModelNormal): |
| 21 | + @cached_property |
| 22 | + def openapi_types(_): |
| 23 | + from datadog_api_client.v2.model.datastore_trigger import DatastoreTrigger |
| 24 | + |
| 25 | + return { |
| 26 | + "datastore_trigger": (DatastoreTrigger,), |
| 27 | + "start_step_names": ([str],), |
| 28 | + } |
| 29 | + |
| 30 | + attribute_map = { |
| 31 | + "datastore_trigger": "datastoreTrigger", |
| 32 | + "start_step_names": "startStepNames", |
| 33 | + } |
| 34 | + |
| 35 | + def __init__( |
| 36 | + self_, datastore_trigger: DatastoreTrigger, start_step_names: Union[List[str], UnsetType] = unset, **kwargs |
| 37 | + ): |
| 38 | + """ |
| 39 | + Schema for a Datastore-based trigger. |
| 40 | +
|
| 41 | + :param datastore_trigger: Trigger a workflow from a Datastore. For automatic triggering a handle must be configured and the workflow must be published. |
| 42 | + :type datastore_trigger: DatastoreTrigger |
| 43 | +
|
| 44 | + :param start_step_names: A list of steps that run first after a trigger fires. |
| 45 | + :type start_step_names: [str], optional |
| 46 | + """ |
| 47 | + if start_step_names is not unset: |
| 48 | + kwargs["start_step_names"] = start_step_names |
| 49 | + super().__init__(kwargs) |
| 50 | + |
| 51 | + self_.datastore_trigger = datastore_trigger |
0 commit comments