33# Copyright 2019-Present Datadog, Inc.
44from __future__ import annotations
55
6- from typing import List , TYPE_CHECKING
6+ from typing import List , Union , TYPE_CHECKING
77
88from datadog_api_client .model_utils import (
99 ModelNormal ,
1010 cached_property ,
11+ unset ,
12+ UnsetType ,
1113)
1214
1315
1416if TYPE_CHECKING :
17+ from datadog_api_client .v2 .model .observability_pipeline_datadog_logs_destination_route import (
18+ ObservabilityPipelineDatadogLogsDestinationRoute ,
19+ )
1520 from datadog_api_client .v2 .model .observability_pipeline_datadog_logs_destination_type import (
1621 ObservabilityPipelineDatadogLogsDestinationType ,
1722 )
1823
1924
2025class ObservabilityPipelineDatadogLogsDestination (ModelNormal ):
26+ validations = {
27+ "routes" : {
28+ "max_items" : 100 ,
29+ },
30+ }
31+
2132 @cached_property
2233 def openapi_types (_ ):
34+ from datadog_api_client .v2 .model .observability_pipeline_datadog_logs_destination_route import (
35+ ObservabilityPipelineDatadogLogsDestinationRoute ,
36+ )
2337 from datadog_api_client .v2 .model .observability_pipeline_datadog_logs_destination_type import (
2438 ObservabilityPipelineDatadogLogsDestinationType ,
2539 )
2640
2741 return {
2842 "id" : (str ,),
2943 "inputs" : ([str ],),
44+ "routes" : ([ObservabilityPipelineDatadogLogsDestinationRoute ],),
3045 "type" : (ObservabilityPipelineDatadogLogsDestinationType ,),
3146 }
3247
3348 attribute_map = {
3449 "id" : "id" ,
3550 "inputs" : "inputs" ,
51+ "routes" : "routes" ,
3652 "type" : "type" ,
3753 }
3854
39- def __init__ (self_ , id : str , inputs : List [str ], type : ObservabilityPipelineDatadogLogsDestinationType , ** kwargs ):
55+ def __init__ (
56+ self_ ,
57+ id : str ,
58+ inputs : List [str ],
59+ type : ObservabilityPipelineDatadogLogsDestinationType ,
60+ routes : Union [List [ObservabilityPipelineDatadogLogsDestinationRoute ], UnsetType ] = unset ,
61+ ** kwargs ,
62+ ):
4063 """
4164 The ``datadog_logs`` destination forwards logs to Datadog Log Management.
4265
@@ -48,9 +71,14 @@ def __init__(self_, id: str, inputs: List[str], type: ObservabilityPipelineDatad
4871 :param inputs: A list of component IDs whose output is used as the ``input`` for this component.
4972 :type inputs: [str]
5073
74+ :param routes: A list of routing rules that forward matching logs to Datadog using dedicated API keys.
75+ :type routes: [ObservabilityPipelineDatadogLogsDestinationRoute], optional
76+
5177 :param type: The destination type. The value should always be ``datadog_logs``.
5278 :type type: ObservabilityPipelineDatadogLogsDestinationType
5379 """
80+ if routes is not unset :
81+ kwargs ["routes" ] = routes
5482 super ().__init__ (kwargs )
5583
5684 self_ .id = id
0 commit comments