Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 49 additions & 3 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -35243,7 +35289,7 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/SyntheticsTestDetails'
$ref: '#/components/schemas/SyntheticsTestDetailsWithoutSteps'
description: OK
'403':
content:
Expand Down
7 changes: 7 additions & 0 deletions docs/datadog_api_client.v1.model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
----------------------------------------------------------------------

Expand Down
13 changes: 7 additions & 6 deletions src/datadog_api_client/v1/api/synthetics_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand All @@ -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,
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand All @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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`` ,
Expand Down
Original file line number Diff line number Diff line change
@@ -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)
2 changes: 2 additions & 0 deletions src/datadog_api_client/v1/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -1855,6 +1856,7 @@
"SyntheticsTestDetails",
"SyntheticsTestDetailsSubType",
"SyntheticsTestDetailsType",
"SyntheticsTestDetailsWithoutSteps",
"SyntheticsTestExecutionRule",
"SyntheticsTestHeaders",
"SyntheticsTestMetadata",
Expand Down