diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index dba7bb99f9..44fd406c7f 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -16568,7 +16568,7 @@ components: tests: description: Array of Synthetic tests configuration. items: - $ref: '#/components/schemas/SyntheticsTestDetails' + $ref: '#/components/schemas/SyntheticsTestDetailsWithoutSteps' type: array type: object SyntheticsLocalVariableParsingOptionsType: @@ -17599,7 +17599,7 @@ components: status: $ref: '#/components/schemas/SyntheticsTestPauseStatus' steps: - description: For browser test, the steps of the test. + description: The steps of the test if they exist. items: $ref: '#/components/schemas/SyntheticsStep' type: array @@ -17651,6 +17651,52 @@ components: - API - BROWSER - MOBILE + SyntheticsTestDetailsWithoutSteps: + description: Object containing details about your Synthetic test, without test + steps. + properties: + config: + $ref: '#/components/schemas/SyntheticsTestConfig' + creator: + $ref: '#/components/schemas/Creator' + locations: + description: Array of locations used to run the test. + example: + - aws:eu-west-3 + items: + description: A location from which the test was run. + type: string + type: array + message: + description: Notification message associated with the test. + type: string + monitor_id: + description: The associated monitor ID. + format: int64 + readOnly: true + type: integer + name: + description: Name of the test. + type: string + options: + $ref: '#/components/schemas/SyntheticsTestOptions' + public_id: + description: The test public ID. + readOnly: true + type: string + status: + $ref: '#/components/schemas/SyntheticsTestPauseStatus' + subtype: + $ref: '#/components/schemas/SyntheticsTestDetailsSubType' + tags: + description: Array of tags attached to the test. + items: + description: A tag attached to the test. + type: string + type: array + type: + $ref: '#/components/schemas/SyntheticsTestDetailsType' + type: object SyntheticsTestExecutionRule: description: Execution rule for a Synthetic test. enum: @@ -35243,7 +35289,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/SyntheticsTestDetails' + $ref: '#/components/schemas/SyntheticsTestDetailsWithoutSteps' description: OK '403': content: diff --git a/docs/datadog_api_client.v1.model.rst b/docs/datadog_api_client.v1.model.rst index 60a000a874..551a66106e 100644 --- a/docs/datadog_api_client.v1.model.rst +++ b/docs/datadog_api_client.v1.model.rst @@ -5128,6 +5128,13 @@ datadog\_api\_client.v1.model.synthetics\_test\_details\_type module :members: :show-inheritance: +datadog\_api\_client.v1.model.synthetics\_test\_details\_without\_steps module +------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v1.model.synthetics_test_details_without_steps + :members: + :show-inheritance: + datadog\_api\_client.v1.model.synthetics\_test\_execution\_rule module ---------------------------------------------------------------------- diff --git a/src/datadog_api_client/v1/api/synthetics_api.py b/src/datadog_api_client/v1/api/synthetics_api.py index 1091f187c8..900dbbdd9e 100644 --- a/src/datadog_api_client/v1/api/synthetics_api.py +++ b/src/datadog_api_client/v1/api/synthetics_api.py @@ -21,7 +21,7 @@ ) from datadog_api_client.v1.model.synthetics_private_location import SyntheticsPrivateLocation from datadog_api_client.v1.model.synthetics_list_tests_response import SyntheticsListTestsResponse -from datadog_api_client.v1.model.synthetics_test_details import SyntheticsTestDetails +from datadog_api_client.v1.model.synthetics_test_details_without_steps import SyntheticsTestDetailsWithoutSteps from datadog_api_client.v1.model.synthetics_api_test import SyntheticsAPITest from datadog_api_client.v1.model.synthetics_browser_test import SyntheticsBrowserTest from datadog_api_client.v1.model.synthetics_get_browser_test_latest_results_response import ( @@ -36,6 +36,7 @@ from datadog_api_client.v1.model.synthetics_ci_test_body import SyntheticsCITestBody from datadog_api_client.v1.model.synthetics_test_uptime import SyntheticsTestUptime from datadog_api_client.v1.model.synthetics_fetch_uptimes_payload import SyntheticsFetchUptimesPayload +from datadog_api_client.v1.model.synthetics_test_details import SyntheticsTestDetails from datadog_api_client.v1.model.synthetics_patch_test_body import SyntheticsPatchTestBody from datadog_api_client.v1.model.synthetics_get_api_test_latest_results_response import ( SyntheticsGetAPITestLatestResultsResponse, @@ -569,7 +570,7 @@ def __init__(self, api_client=None): self._get_test_endpoint = _Endpoint( settings={ - "response_type": (SyntheticsTestDetails,), + "response_type": (SyntheticsTestDetailsWithoutSteps,), "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], "endpoint_path": "/api/v1/synthetics/tests/{public_id}", "operation_id": "get_test", @@ -1305,14 +1306,14 @@ def get_synthetics_default_locations( def get_test( self, public_id: str, - ) -> SyntheticsTestDetails: + ) -> SyntheticsTestDetailsWithoutSteps: """Get a test configuration. Get the detailed configuration associated with a Synthetic test. :param public_id: The public ID of the test to get details from. :type public_id: str - :rtype: SyntheticsTestDetails + :rtype: SyntheticsTestDetailsWithoutSteps """ kwargs: Dict[str, Any] = {} kwargs["public_id"] = public_id @@ -1374,7 +1375,7 @@ def list_tests_with_pagination( *, page_size: Union[int, UnsetType] = unset, page_number: Union[int, UnsetType] = unset, - ) -> collections.abc.Iterable[SyntheticsTestDetails]: + ) -> collections.abc.Iterable[SyntheticsTestDetailsWithoutSteps]: """Get the list of all Synthetic tests. Provide a paginated version of :meth:`list_tests`, returning all items. @@ -1385,7 +1386,7 @@ def list_tests_with_pagination( :type page_number: int, optional :return: A generator of paginated results. - :rtype: collections.abc.Iterable[SyntheticsTestDetails] + :rtype: collections.abc.Iterable[SyntheticsTestDetailsWithoutSteps] """ kwargs: Dict[str, Any] = {} if page_size is not unset: diff --git a/src/datadog_api_client/v1/model/synthetics_list_tests_response.py b/src/datadog_api_client/v1/model/synthetics_list_tests_response.py index 81d17c783a..bc622150d5 100644 --- a/src/datadog_api_client/v1/model/synthetics_list_tests_response.py +++ b/src/datadog_api_client/v1/model/synthetics_list_tests_response.py @@ -14,28 +14,28 @@ if TYPE_CHECKING: - from datadog_api_client.v1.model.synthetics_test_details import SyntheticsTestDetails + from datadog_api_client.v1.model.synthetics_test_details_without_steps import SyntheticsTestDetailsWithoutSteps class SyntheticsListTestsResponse(ModelNormal): @cached_property def openapi_types(_): - from datadog_api_client.v1.model.synthetics_test_details import SyntheticsTestDetails + from datadog_api_client.v1.model.synthetics_test_details_without_steps import SyntheticsTestDetailsWithoutSteps return { - "tests": ([SyntheticsTestDetails],), + "tests": ([SyntheticsTestDetailsWithoutSteps],), } attribute_map = { "tests": "tests", } - def __init__(self_, tests: Union[List[SyntheticsTestDetails], UnsetType] = unset, **kwargs): + def __init__(self_, tests: Union[List[SyntheticsTestDetailsWithoutSteps], UnsetType] = unset, **kwargs): """ Object containing an array of Synthetic tests configuration. :param tests: Array of Synthetic tests configuration. - :type tests: [SyntheticsTestDetails], optional + :type tests: [SyntheticsTestDetailsWithoutSteps], optional """ if tests is not unset: kwargs["tests"] = tests diff --git a/src/datadog_api_client/v1/model/synthetics_test_details.py b/src/datadog_api_client/v1/model/synthetics_test_details.py index b65bba683a..a4693558d6 100644 --- a/src/datadog_api_client/v1/model/synthetics_test_details.py +++ b/src/datadog_api_client/v1/model/synthetics_test_details.py @@ -119,7 +119,7 @@ def __init__( Synthetic test. :type status: SyntheticsTestPauseStatus, optional - :param steps: For browser test, the steps of the test. + :param steps: The steps of the test if they exist. :type steps: [SyntheticsStep], optional :param subtype: The subtype of the Synthetic API test, ``http`` , ``ssl`` , ``tcp`` , diff --git a/src/datadog_api_client/v1/model/synthetics_test_details_without_steps.py b/src/datadog_api_client/v1/model/synthetics_test_details_without_steps.py new file mode 100644 index 0000000000..d818a4b8a4 --- /dev/null +++ b/src/datadog_api_client/v1/model/synthetics_test_details_without_steps.py @@ -0,0 +1,151 @@ +# 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 List, 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_test_config import SyntheticsTestConfig + from datadog_api_client.v1.model.creator import Creator + from datadog_api_client.v1.model.synthetics_test_options import SyntheticsTestOptions + from datadog_api_client.v1.model.synthetics_test_pause_status import SyntheticsTestPauseStatus + from datadog_api_client.v1.model.synthetics_test_details_sub_type import SyntheticsTestDetailsSubType + from datadog_api_client.v1.model.synthetics_test_details_type import SyntheticsTestDetailsType + + +class SyntheticsTestDetailsWithoutSteps(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v1.model.synthetics_test_config import SyntheticsTestConfig + from datadog_api_client.v1.model.creator import Creator + from datadog_api_client.v1.model.synthetics_test_options import SyntheticsTestOptions + from datadog_api_client.v1.model.synthetics_test_pause_status import SyntheticsTestPauseStatus + from datadog_api_client.v1.model.synthetics_test_details_sub_type import SyntheticsTestDetailsSubType + from datadog_api_client.v1.model.synthetics_test_details_type import SyntheticsTestDetailsType + + return { + "config": (SyntheticsTestConfig,), + "creator": (Creator,), + "locations": ([str],), + "message": (str,), + "monitor_id": (int,), + "name": (str,), + "options": (SyntheticsTestOptions,), + "public_id": (str,), + "status": (SyntheticsTestPauseStatus,), + "subtype": (SyntheticsTestDetailsSubType,), + "tags": ([str],), + "type": (SyntheticsTestDetailsType,), + } + + attribute_map = { + "config": "config", + "creator": "creator", + "locations": "locations", + "message": "message", + "monitor_id": "monitor_id", + "name": "name", + "options": "options", + "public_id": "public_id", + "status": "status", + "subtype": "subtype", + "tags": "tags", + "type": "type", + } + read_only_vars = { + "creator", + "monitor_id", + "public_id", + } + + def __init__( + self_, + config: Union[SyntheticsTestConfig, UnsetType] = unset, + creator: Union[Creator, UnsetType] = unset, + locations: Union[List[str], UnsetType] = unset, + message: Union[str, UnsetType] = unset, + monitor_id: Union[int, UnsetType] = unset, + name: Union[str, UnsetType] = unset, + options: Union[SyntheticsTestOptions, UnsetType] = unset, + public_id: Union[str, UnsetType] = unset, + status: Union[SyntheticsTestPauseStatus, UnsetType] = unset, + subtype: Union[SyntheticsTestDetailsSubType, UnsetType] = unset, + tags: Union[List[str], UnsetType] = unset, + type: Union[SyntheticsTestDetailsType, UnsetType] = unset, + **kwargs, + ): + """ + Object containing details about your Synthetic test, without test steps. + + :param config: Configuration object for a Synthetic test. + :type config: SyntheticsTestConfig, optional + + :param creator: Object describing the creator of the shared element. + :type creator: Creator, optional + + :param locations: Array of locations used to run the test. + :type locations: [str], optional + + :param message: Notification message associated with the test. + :type message: str, optional + + :param monitor_id: The associated monitor ID. + :type monitor_id: int, optional + + :param name: Name of the test. + :type name: str, optional + + :param options: Object describing the extra options for a Synthetic test. + :type options: SyntheticsTestOptions, optional + + :param public_id: The test public ID. + :type public_id: str, optional + + :param status: Define whether you want to start ( ``live`` ) or pause ( ``paused`` ) a + Synthetic test. + :type status: SyntheticsTestPauseStatus, optional + + :param subtype: The subtype of the Synthetic API test, ``http`` , ``ssl`` , ``tcp`` , + ``dns`` , ``icmp`` , ``udp`` , ``websocket`` , ``grpc`` or ``multi``. + :type subtype: SyntheticsTestDetailsSubType, optional + + :param tags: Array of tags attached to the test. + :type tags: [str], optional + + :param type: Type of the Synthetic test, either ``api`` or ``browser``. + :type type: SyntheticsTestDetailsType, optional + """ + if config is not unset: + kwargs["config"] = config + if creator is not unset: + kwargs["creator"] = creator + if locations is not unset: + kwargs["locations"] = locations + if message is not unset: + kwargs["message"] = message + if monitor_id is not unset: + kwargs["monitor_id"] = monitor_id + if name is not unset: + kwargs["name"] = name + if options is not unset: + kwargs["options"] = options + if public_id is not unset: + kwargs["public_id"] = public_id + if status is not unset: + kwargs["status"] = status + if subtype is not unset: + kwargs["subtype"] = subtype + if tags is not unset: + kwargs["tags"] = tags + if type is not unset: + kwargs["type"] = type + super().__init__(kwargs) diff --git a/src/datadog_api_client/v1/models/__init__.py b/src/datadog_api_client/v1/models/__init__.py index 062b19bebe..7dda7f9989 100644 --- a/src/datadog_api_client/v1/models/__init__.py +++ b/src/datadog_api_client/v1/models/__init__.py @@ -860,6 +860,7 @@ from datadog_api_client.v1.model.synthetics_test_details import SyntheticsTestDetails from datadog_api_client.v1.model.synthetics_test_details_sub_type import SyntheticsTestDetailsSubType from datadog_api_client.v1.model.synthetics_test_details_type import SyntheticsTestDetailsType +from datadog_api_client.v1.model.synthetics_test_details_without_steps import SyntheticsTestDetailsWithoutSteps from datadog_api_client.v1.model.synthetics_test_execution_rule import SyntheticsTestExecutionRule from datadog_api_client.v1.model.synthetics_test_headers import SyntheticsTestHeaders from datadog_api_client.v1.model.synthetics_test_metadata import SyntheticsTestMetadata @@ -1855,6 +1856,7 @@ "SyntheticsTestDetails", "SyntheticsTestDetailsSubType", "SyntheticsTestDetailsType", + "SyntheticsTestDetailsWithoutSteps", "SyntheticsTestExecutionRule", "SyntheticsTestHeaders", "SyntheticsTestMetadata",