|
| 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 TYPE_CHECKING, Union |
| 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.synthetics_assertion_x_path_operator import SyntheticsAssertionXPathOperator |
| 18 | + from datadog_api_client.v1.model.synthetics_assertion_x_path_target_target import ( |
| 19 | + SyntheticsAssertionXPathTargetTarget, |
| 20 | + ) |
| 21 | + from datadog_api_client.v1.model.synthetics_assertion_type import SyntheticsAssertionType |
| 22 | + |
| 23 | + |
| 24 | +class SyntheticsAssertionXPathTarget(ModelNormal): |
| 25 | + @cached_property |
| 26 | + def openapi_types(_): |
| 27 | + from datadog_api_client.v1.model.synthetics_assertion_x_path_operator import SyntheticsAssertionXPathOperator |
| 28 | + from datadog_api_client.v1.model.synthetics_assertion_x_path_target_target import ( |
| 29 | + SyntheticsAssertionXPathTargetTarget, |
| 30 | + ) |
| 31 | + from datadog_api_client.v1.model.synthetics_assertion_type import SyntheticsAssertionType |
| 32 | + |
| 33 | + return { |
| 34 | + "operator": (SyntheticsAssertionXPathOperator,), |
| 35 | + "_property": (str,), |
| 36 | + "target": (SyntheticsAssertionXPathTargetTarget,), |
| 37 | + "type": (SyntheticsAssertionType,), |
| 38 | + } |
| 39 | + |
| 40 | + attribute_map = { |
| 41 | + "operator": "operator", |
| 42 | + "_property": "property", |
| 43 | + "target": "target", |
| 44 | + "type": "type", |
| 45 | + } |
| 46 | + |
| 47 | + def __init__( |
| 48 | + self_, |
| 49 | + operator: SyntheticsAssertionXPathOperator, |
| 50 | + type: SyntheticsAssertionType, |
| 51 | + _property: Union[str, UnsetType] = unset, |
| 52 | + target: Union[SyntheticsAssertionXPathTargetTarget, UnsetType] = unset, |
| 53 | + **kwargs, |
| 54 | + ): |
| 55 | + """ |
| 56 | + An assertion for the ``validatesXPath`` operator. |
| 57 | +
|
| 58 | + :param operator: Assertion operator to apply. |
| 59 | + :type operator: SyntheticsAssertionXPathOperator |
| 60 | +
|
| 61 | + :param _property: The associated assertion property. |
| 62 | + :type _property: str, optional |
| 63 | +
|
| 64 | + :param target: Composed target for ``validatesXPath`` operator. |
| 65 | + :type target: SyntheticsAssertionXPathTargetTarget, optional |
| 66 | +
|
| 67 | + :param type: Type of the assertion. |
| 68 | + :type type: SyntheticsAssertionType |
| 69 | + """ |
| 70 | + if _property is not unset: |
| 71 | + kwargs["_property"] = _property |
| 72 | + if target is not unset: |
| 73 | + kwargs["target"] = target |
| 74 | + super().__init__(kwargs) |
| 75 | + |
| 76 | + self_.operator = operator |
| 77 | + self_.type = type |
0 commit comments