-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Regenerate client from commit e4382f34 of spec repo
- Loading branch information
ci.datadog-api-spec
committed
Nov 15, 2023
1 parent
6cf238b
commit 7195142
Showing
13 changed files
with
482 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
""" | ||
Patch a Synthetics test returns "OK" response | ||
""" | ||
|
||
from os import environ | ||
from datadog_api_client import ApiClient, Configuration | ||
from datadog_api_client.v1.api.synthetics_api import SyntheticsApi | ||
from datadog_api_client.v1.model.synthetics_patch_test_body import SyntheticsPatchTestBody | ||
from datadog_api_client.v1.model.synthetics_patch_test_operation import SyntheticsPatchTestOperation | ||
from datadog_api_client.v1.model.synthetics_patch_test_operation_name import SyntheticsPatchTestOperationName | ||
|
||
# there is a valid "synthetics_api_test" in the system | ||
SYNTHETICS_API_TEST_PUBLIC_ID = environ["SYNTHETICS_API_TEST_PUBLIC_ID"] | ||
|
||
body = SyntheticsPatchTestBody( | ||
data=[ | ||
SyntheticsPatchTestOperation( | ||
op=SyntheticsPatchTestOperationName.REPLACE, | ||
path="/name", | ||
value="New test name", | ||
), | ||
SyntheticsPatchTestOperation( | ||
op=SyntheticsPatchTestOperationName.REMOVE, | ||
path="/config/assertions/0", | ||
), | ||
], | ||
) | ||
|
||
configuration = Configuration() | ||
with ApiClient(configuration) as api_client: | ||
api_instance = SyntheticsApi(api_client) | ||
response = api_instance.patch_test(public_id=SYNTHETICS_API_TEST_PUBLIC_ID, body=body) | ||
|
||
print(response) |
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
42 changes: 42 additions & 0 deletions
42
src/datadog_api_client/v1/model/synthetics_patch_test_body.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,42 @@ | ||
# 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_patch_test_operation import SyntheticsPatchTestOperation | ||
|
||
|
||
class SyntheticsPatchTestBody(ModelNormal): | ||
@cached_property | ||
def openapi_types(_): | ||
from datadog_api_client.v1.model.synthetics_patch_test_operation import SyntheticsPatchTestOperation | ||
|
||
return { | ||
"data": ([SyntheticsPatchTestOperation],), | ||
} | ||
|
||
attribute_map = { | ||
"data": "data", | ||
} | ||
|
||
def __init__(self_, data: Union[List[SyntheticsPatchTestOperation], UnsetType] = unset, **kwargs): | ||
""" | ||
Wrapper around an array of `JSON Patch <https://jsonpatch.com>`_ operations to perform on the test | ||
:param data: Array of `JSON Patch <https://jsonpatch.com>`_ operations to perform on the test | ||
:type data: [SyntheticsPatchTestOperation], optional | ||
""" | ||
if data is not unset: | ||
kwargs["data"] = data | ||
super().__init__(kwargs) |
Oops, something went wrong.