|
| 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 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.logs_exclude_attribute_processor_type import LogsExcludeAttributeProcessorType |
| 18 | + |
| 19 | + |
| 20 | +class LogsExcludeAttributeProcessor(ModelNormal): |
| 21 | + @cached_property |
| 22 | + def openapi_types(_): |
| 23 | + from datadog_api_client.v1.model.logs_exclude_attribute_processor_type import LogsExcludeAttributeProcessorType |
| 24 | + |
| 25 | + return { |
| 26 | + "attribute_to_exclude": (str,), |
| 27 | + "is_enabled": (bool,), |
| 28 | + "name": (str,), |
| 29 | + "type": (LogsExcludeAttributeProcessorType,), |
| 30 | + } |
| 31 | + |
| 32 | + attribute_map = { |
| 33 | + "attribute_to_exclude": "attribute_to_exclude", |
| 34 | + "is_enabled": "is_enabled", |
| 35 | + "name": "name", |
| 36 | + "type": "type", |
| 37 | + } |
| 38 | + |
| 39 | + def __init__( |
| 40 | + self_, |
| 41 | + attribute_to_exclude: str, |
| 42 | + type: LogsExcludeAttributeProcessorType, |
| 43 | + is_enabled: Union[bool, UnsetType] = unset, |
| 44 | + name: Union[str, UnsetType] = unset, |
| 45 | + **kwargs, |
| 46 | + ): |
| 47 | + """ |
| 48 | + Use this processor to remove an attribute from a log during processing. |
| 49 | + The processor strips the specified attribute from the log event, which is useful |
| 50 | + when the attribute contains sensitive data or is no longer needed downstream. |
| 51 | +
|
| 52 | + :param attribute_to_exclude: Name of the log attribute to remove from the log event. |
| 53 | + :type attribute_to_exclude: str |
| 54 | +
|
| 55 | + :param is_enabled: Whether or not the processor is enabled. |
| 56 | + :type is_enabled: bool, optional |
| 57 | +
|
| 58 | + :param name: Name of the processor. |
| 59 | + :type name: str, optional |
| 60 | +
|
| 61 | + :param type: Type of logs exclude attribute processor. |
| 62 | + :type type: LogsExcludeAttributeProcessorType |
| 63 | + """ |
| 64 | + if is_enabled is not unset: |
| 65 | + kwargs["is_enabled"] = is_enabled |
| 66 | + if name is not unset: |
| 67 | + kwargs["name"] = name |
| 68 | + super().__init__(kwargs) |
| 69 | + |
| 70 | + self_.attribute_to_exclude = attribute_to_exclude |
| 71 | + self_.type = type |
0 commit comments