-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add JSONSchema assertion support to API and multistep tests (#1925)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com> Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
- Loading branch information
1 parent
dea346e
commit dc9b08e
Showing
30 changed files
with
451 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
src/datadog_api_client/v1/model/synthetics_assertion_json_schema_meta_schema.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. | ||
# This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
# Copyright 2019-Present Datadog, Inc. | ||
from __future__ import annotations | ||
|
||
|
||
from datadog_api_client.model_utils import ( | ||
ModelSimple, | ||
cached_property, | ||
) | ||
|
||
from typing import ClassVar | ||
|
||
|
||
class SyntheticsAssertionJSONSchemaMetaSchema(ModelSimple): | ||
""" | ||
The JSON Schema meta-schema version used in the assertion. | ||
:param value: Must be one of ["draft-07", "draft-06"]. | ||
:type value: str | ||
""" | ||
|
||
allowed_values = { | ||
"draft-07", | ||
"draft-06", | ||
} | ||
DRAFT_07: ClassVar["SyntheticsAssertionJSONSchemaMetaSchema"] | ||
DRAFT_06: ClassVar["SyntheticsAssertionJSONSchemaMetaSchema"] | ||
|
||
@cached_property | ||
def openapi_types(_): | ||
return { | ||
"value": (str,), | ||
} | ||
|
||
|
||
SyntheticsAssertionJSONSchemaMetaSchema.DRAFT_07 = SyntheticsAssertionJSONSchemaMetaSchema("draft-07") | ||
SyntheticsAssertionJSONSchemaMetaSchema.DRAFT_06 = SyntheticsAssertionJSONSchemaMetaSchema("draft-06") |
37 changes: 37 additions & 0 deletions
37
src/datadog_api_client/v1/model/synthetics_assertion_json_schema_operator.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. | ||
# This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
# Copyright 2019-Present Datadog, Inc. | ||
from __future__ import annotations | ||
|
||
|
||
from datadog_api_client.model_utils import ( | ||
ModelSimple, | ||
cached_property, | ||
) | ||
|
||
from typing import ClassVar | ||
|
||
|
||
class SyntheticsAssertionJSONSchemaOperator(ModelSimple): | ||
""" | ||
Assertion operator to apply. | ||
:param value: If omitted defaults to "validatesJSONSchema". Must be one of ["validatesJSONSchema"]. | ||
:type value: str | ||
""" | ||
|
||
allowed_values = { | ||
"validatesJSONSchema", | ||
} | ||
VALIDATES_JSON_SCHEMA: ClassVar["SyntheticsAssertionJSONSchemaOperator"] | ||
|
||
@cached_property | ||
def openapi_types(_): | ||
return { | ||
"value": (str,), | ||
} | ||
|
||
|
||
SyntheticsAssertionJSONSchemaOperator.VALIDATES_JSON_SCHEMA = SyntheticsAssertionJSONSchemaOperator( | ||
"validatesJSONSchema" | ||
) |
73 changes: 73 additions & 0 deletions
73
src/datadog_api_client/v1/model/synthetics_assertion_json_schema_target.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. | ||
# This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
# Copyright 2019-Present Datadog, Inc. | ||
from __future__ import annotations | ||
|
||
from typing import Union, TYPE_CHECKING | ||
|
||
from datadog_api_client.model_utils import ( | ||
ModelNormal, | ||
cached_property, | ||
unset, | ||
UnsetType, | ||
) | ||
|
||
|
||
if TYPE_CHECKING: | ||
from datadog_api_client.v1.model.synthetics_assertion_json_schema_operator import ( | ||
SyntheticsAssertionJSONSchemaOperator, | ||
) | ||
from datadog_api_client.v1.model.synthetics_assertion_json_schema_target_target import ( | ||
SyntheticsAssertionJSONSchemaTargetTarget, | ||
) | ||
from datadog_api_client.v1.model.synthetics_assertion_type import SyntheticsAssertionType | ||
|
||
|
||
class SyntheticsAssertionJSONSchemaTarget(ModelNormal): | ||
@cached_property | ||
def openapi_types(_): | ||
from datadog_api_client.v1.model.synthetics_assertion_json_schema_operator import ( | ||
SyntheticsAssertionJSONSchemaOperator, | ||
) | ||
from datadog_api_client.v1.model.synthetics_assertion_json_schema_target_target import ( | ||
SyntheticsAssertionJSONSchemaTargetTarget, | ||
) | ||
from datadog_api_client.v1.model.synthetics_assertion_type import SyntheticsAssertionType | ||
|
||
return { | ||
"operator": (SyntheticsAssertionJSONSchemaOperator,), | ||
"target": (SyntheticsAssertionJSONSchemaTargetTarget,), | ||
"type": (SyntheticsAssertionType,), | ||
} | ||
|
||
attribute_map = { | ||
"operator": "operator", | ||
"target": "target", | ||
"type": "type", | ||
} | ||
|
||
def __init__( | ||
self_, | ||
operator: SyntheticsAssertionJSONSchemaOperator, | ||
type: SyntheticsAssertionType, | ||
target: Union[SyntheticsAssertionJSONSchemaTargetTarget, UnsetType] = unset, | ||
**kwargs, | ||
): | ||
""" | ||
An assertion for the ``validatesJSONSchema`` operator. | ||
:param operator: Assertion operator to apply. | ||
:type operator: SyntheticsAssertionJSONSchemaOperator | ||
:param target: Composed target for ``validatesJSONSchema`` operator. | ||
:type target: SyntheticsAssertionJSONSchemaTargetTarget, optional | ||
:param type: Type of the assertion. | ||
:type type: SyntheticsAssertionType | ||
""" | ||
if target is not unset: | ||
kwargs["target"] = target | ||
super().__init__(kwargs) | ||
|
||
self_.operator = operator | ||
self_.type = type |
Oops, something went wrong.