|
| 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_decoder_processor_binary_to_text_encoding import ( |
| 18 | + LogsDecoderProcessorBinaryToTextEncoding, |
| 19 | + ) |
| 20 | + from datadog_api_client.v1.model.logs_decoder_processor_input_representation import ( |
| 21 | + LogsDecoderProcessorInputRepresentation, |
| 22 | + ) |
| 23 | + from datadog_api_client.v1.model.logs_decoder_processor_type import LogsDecoderProcessorType |
| 24 | + |
| 25 | + |
| 26 | +class LogsDecoderProcessor(ModelNormal): |
| 27 | + @cached_property |
| 28 | + def openapi_types(_): |
| 29 | + from datadog_api_client.v1.model.logs_decoder_processor_binary_to_text_encoding import ( |
| 30 | + LogsDecoderProcessorBinaryToTextEncoding, |
| 31 | + ) |
| 32 | + from datadog_api_client.v1.model.logs_decoder_processor_input_representation import ( |
| 33 | + LogsDecoderProcessorInputRepresentation, |
| 34 | + ) |
| 35 | + from datadog_api_client.v1.model.logs_decoder_processor_type import LogsDecoderProcessorType |
| 36 | + |
| 37 | + return { |
| 38 | + "binary_to_text_encoding": (LogsDecoderProcessorBinaryToTextEncoding,), |
| 39 | + "input_representation": (LogsDecoderProcessorInputRepresentation,), |
| 40 | + "is_enabled": (bool,), |
| 41 | + "name": (str,), |
| 42 | + "source": (str,), |
| 43 | + "target": (str,), |
| 44 | + "type": (LogsDecoderProcessorType,), |
| 45 | + } |
| 46 | + |
| 47 | + attribute_map = { |
| 48 | + "binary_to_text_encoding": "binary_to_text_encoding", |
| 49 | + "input_representation": "input_representation", |
| 50 | + "is_enabled": "is_enabled", |
| 51 | + "name": "name", |
| 52 | + "source": "source", |
| 53 | + "target": "target", |
| 54 | + "type": "type", |
| 55 | + } |
| 56 | + |
| 57 | + def __init__( |
| 58 | + self_, |
| 59 | + binary_to_text_encoding: LogsDecoderProcessorBinaryToTextEncoding, |
| 60 | + input_representation: LogsDecoderProcessorInputRepresentation, |
| 61 | + source: str, |
| 62 | + target: str, |
| 63 | + type: LogsDecoderProcessorType, |
| 64 | + is_enabled: Union[bool, UnsetType] = unset, |
| 65 | + name: Union[str, UnsetType] = unset, |
| 66 | + **kwargs, |
| 67 | + ): |
| 68 | + """ |
| 69 | + The decoder processor decodes any source attribute containing a |
| 70 | + base64/base16-encoded UTF-8/ASCII string back to its original value, storing the |
| 71 | + result in a target attribute. |
| 72 | +
|
| 73 | + :param binary_to_text_encoding: The encoding used to represent the binary data. |
| 74 | + :type binary_to_text_encoding: LogsDecoderProcessorBinaryToTextEncoding |
| 75 | +
|
| 76 | + :param input_representation: The original representation of input string. |
| 77 | + :type input_representation: LogsDecoderProcessorInputRepresentation |
| 78 | +
|
| 79 | + :param is_enabled: Whether the processor is enabled. |
| 80 | + :type is_enabled: bool, optional |
| 81 | +
|
| 82 | + :param name: Name of the processor. |
| 83 | + :type name: str, optional |
| 84 | +
|
| 85 | + :param source: Name of the log attribute with the encoded data. |
| 86 | + :type source: str |
| 87 | +
|
| 88 | + :param target: Name of the log attribute that contains the decoded data. |
| 89 | + :type target: str |
| 90 | +
|
| 91 | + :param type: Type of logs decoder processor. |
| 92 | + :type type: LogsDecoderProcessorType |
| 93 | + """ |
| 94 | + if is_enabled is not unset: |
| 95 | + kwargs["is_enabled"] = is_enabled |
| 96 | + if name is not unset: |
| 97 | + kwargs["name"] = name |
| 98 | + super().__init__(kwargs) |
| 99 | + |
| 100 | + self_.binary_to_text_encoding = binary_to_text_encoding |
| 101 | + self_.input_representation = input_representation |
| 102 | + self_.source = source |
| 103 | + self_.target = target |
| 104 | + self_.type = type |
0 commit comments