|
| 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.v1.model.monitor_formula_and_function_data_quality_model_type_override import ( |
| 18 | + MonitorFormulaAndFunctionDataQualityModelTypeOverride, |
| 19 | + ) |
| 20 | + |
| 21 | + |
| 22 | +class MonitorFormulaAndFunctionDataQualityMonitorOptions(ModelNormal): |
| 23 | + @cached_property |
| 24 | + def openapi_types(_): |
| 25 | + from datadog_api_client.v1.model.monitor_formula_and_function_data_quality_model_type_override import ( |
| 26 | + MonitorFormulaAndFunctionDataQualityModelTypeOverride, |
| 27 | + ) |
| 28 | + |
| 29 | + return { |
| 30 | + "crontab_override": (str,), |
| 31 | + "custom_sql": (str,), |
| 32 | + "custom_where": (str,), |
| 33 | + "group_by_columns": ([str],), |
| 34 | + "model_type_override": (MonitorFormulaAndFunctionDataQualityModelTypeOverride,), |
| 35 | + } |
| 36 | + |
| 37 | + attribute_map = { |
| 38 | + "crontab_override": "crontab_override", |
| 39 | + "custom_sql": "custom_sql", |
| 40 | + "custom_where": "custom_where", |
| 41 | + "group_by_columns": "group_by_columns", |
| 42 | + "model_type_override": "model_type_override", |
| 43 | + } |
| 44 | + |
| 45 | + def __init__( |
| 46 | + self_, |
| 47 | + crontab_override: Union[str, UnsetType] = unset, |
| 48 | + custom_sql: Union[str, UnsetType] = unset, |
| 49 | + custom_where: Union[str, UnsetType] = unset, |
| 50 | + group_by_columns: Union[List[str], UnsetType] = unset, |
| 51 | + model_type_override: Union[MonitorFormulaAndFunctionDataQualityModelTypeOverride, UnsetType] = unset, |
| 52 | + **kwargs, |
| 53 | + ): |
| 54 | + """ |
| 55 | + Monitor configuration options for data quality queries. |
| 56 | +
|
| 57 | + :param crontab_override: Crontab expression to override the default schedule. |
| 58 | + :type crontab_override: str, optional |
| 59 | +
|
| 60 | + :param custom_sql: Custom SQL query for the monitor. |
| 61 | + :type custom_sql: str, optional |
| 62 | +
|
| 63 | + :param custom_where: Custom WHERE clause for the query. |
| 64 | + :type custom_where: str, optional |
| 65 | +
|
| 66 | + :param group_by_columns: Columns to group results by. |
| 67 | + :type group_by_columns: [str], optional |
| 68 | +
|
| 69 | + :param model_type_override: Override for the model type used in anomaly detection. |
| 70 | + :type model_type_override: MonitorFormulaAndFunctionDataQualityModelTypeOverride, optional |
| 71 | + """ |
| 72 | + if crontab_override is not unset: |
| 73 | + kwargs["crontab_override"] = crontab_override |
| 74 | + if custom_sql is not unset: |
| 75 | + kwargs["custom_sql"] = custom_sql |
| 76 | + if custom_where is not unset: |
| 77 | + kwargs["custom_where"] = custom_where |
| 78 | + if group_by_columns is not unset: |
| 79 | + kwargs["group_by_columns"] = group_by_columns |
| 80 | + if model_type_override is not unset: |
| 81 | + kwargs["model_type_override"] = model_type_override |
| 82 | + super().__init__(kwargs) |
0 commit comments