Skip to content

Commit

Permalink
Regenerate client from commit a96ed3f8 of spec repo
Browse files Browse the repository at this point in the history
  • Loading branch information
ci.datadog-api-spec committed Apr 4, 2024
1 parent ac273ef commit 9e73fac
Show file tree
Hide file tree
Showing 13 changed files with 475 additions and 10 deletions.
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2024-04-04 17:56:42.820919",
"spec_repo_commit": "bf950df2"
"regenerated": "2024-04-04 19:26:54.191355",
"spec_repo_commit": "a96ed3f8"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-04-04 17:56:42.841894",
"spec_repo_commit": "bf950df2"
"regenerated": "2024-04-04 19:26:54.209619",
"spec_repo_commit": "a96ed3f8"
}
}
}
35 changes: 35 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15866,6 +15866,11 @@ components:
maximum: 65535
minimum: 1
type: integer
files:
description: Files to be used as part of the request in the test.
items:
$ref: '#/components/schemas/SyntheticsTestRequestBodyFile'
type: array
follow_redirects:
description: Specifies whether or not the request follows redirects.
type: boolean
Expand Down Expand Up @@ -15932,6 +15937,32 @@ components:
example: https://example.com
type: string
type: object
SyntheticsTestRequestBodyFile:
description: Object describing a file to be used as part of the request in the
test.
properties:
bucketKey:
description: Bucket key of the file.
type: string
content:
description: Content of the file.
maxLength: 3145728
type: string
name:
description: Name of the file.
maxLength: 1500
type: string
size:
description: Size of the file.
format: int64
maximum: 3145728
minimum: 1
type: integer
type:
description: Type of the file.
maxLength: 1500
type: string
type: object
SyntheticsTestRequestBodyType:
description: Type of the request body.
enum:
Expand All @@ -15941,6 +15972,8 @@ components:
- text/html
- application/x-www-form-urlencoded
- graphql
- application/octet-stream
- multipart/form-data
example: text/plain
type: string
x-enum-varnames:
Expand All @@ -15950,6 +15983,8 @@ components:
- TEXT_HTML
- APPLICATION_X_WWW_FORM_URLENCODED
- GRAPHQL
- APPLICATION_OCTET_STREAM
- MULTIPART_FORM_DATA
SyntheticsTestRequestCertificate:
description: Client certificate to use when performing the test request.
properties:
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 @@ -4621,6 +4621,13 @@ synthetics\_test\_request
:members:
:show-inheritance:

synthetics\_test\_request\_body\_file
-------------------------------------

.. automodule:: datadog_api_client.v1.model.synthetics_test_request_body_file
:members:
:show-inheritance:

synthetics\_test\_request\_body\_type
-------------------------------------

Expand Down
159 changes: 159 additions & 0 deletions examples/v1/synthetics/CreateSyntheticsAPITest_1241981394.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
"""
Create an API test with a file payload returns "OK - Returns the created test details." response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v1.api.synthetics_api import SyntheticsApi
from datadog_api_client.v1.model.synthetics_api_test import SyntheticsAPITest
from datadog_api_client.v1.model.synthetics_api_test_config import SyntheticsAPITestConfig
from datadog_api_client.v1.model.synthetics_api_test_type import SyntheticsAPITestType
from datadog_api_client.v1.model.synthetics_assertion_json_path_operator import SyntheticsAssertionJSONPathOperator
from datadog_api_client.v1.model.synthetics_assertion_json_path_target import SyntheticsAssertionJSONPathTarget
from datadog_api_client.v1.model.synthetics_assertion_json_path_target_target import (
SyntheticsAssertionJSONPathTargetTarget,
)
from datadog_api_client.v1.model.synthetics_assertion_operator import SyntheticsAssertionOperator
from datadog_api_client.v1.model.synthetics_assertion_target import SyntheticsAssertionTarget
from datadog_api_client.v1.model.synthetics_assertion_timings_scope import SyntheticsAssertionTimingsScope
from datadog_api_client.v1.model.synthetics_assertion_type import SyntheticsAssertionType
from datadog_api_client.v1.model.synthetics_assertion_x_path_operator import SyntheticsAssertionXPathOperator
from datadog_api_client.v1.model.synthetics_assertion_x_path_target import SyntheticsAssertionXPathTarget
from datadog_api_client.v1.model.synthetics_assertion_x_path_target_target import SyntheticsAssertionXPathTargetTarget
from datadog_api_client.v1.model.synthetics_basic_auth_oauth_client import SyntheticsBasicAuthOauthClient
from datadog_api_client.v1.model.synthetics_basic_auth_oauth_client_type import SyntheticsBasicAuthOauthClientType
from datadog_api_client.v1.model.synthetics_basic_auth_oauth_token_api_authentication import (
SyntheticsBasicAuthOauthTokenApiAuthentication,
)
from datadog_api_client.v1.model.synthetics_config_variable import SyntheticsConfigVariable
from datadog_api_client.v1.model.synthetics_config_variable_type import SyntheticsConfigVariableType
from datadog_api_client.v1.model.synthetics_test_details_sub_type import SyntheticsTestDetailsSubType
from datadog_api_client.v1.model.synthetics_test_headers import SyntheticsTestHeaders
from datadog_api_client.v1.model.synthetics_test_options import SyntheticsTestOptions
from datadog_api_client.v1.model.synthetics_test_options_http_version import SyntheticsTestOptionsHTTPVersion
from datadog_api_client.v1.model.synthetics_test_options_retry import SyntheticsTestOptionsRetry
from datadog_api_client.v1.model.synthetics_test_request import SyntheticsTestRequest
from datadog_api_client.v1.model.synthetics_test_request_body_file import SyntheticsTestRequestBodyFile
from datadog_api_client.v1.model.synthetics_test_request_body_type import SyntheticsTestRequestBodyType
from datadog_api_client.v1.model.synthetics_test_request_certificate import SyntheticsTestRequestCertificate
from datadog_api_client.v1.model.synthetics_test_request_certificate_item import SyntheticsTestRequestCertificateItem
from datadog_api_client.v1.model.synthetics_test_request_proxy import SyntheticsTestRequestProxy

body = SyntheticsAPITest(
config=SyntheticsAPITestConfig(
assertions=[
SyntheticsAssertionTarget(
operator=SyntheticsAssertionOperator.IS,
_property="{{ PROPERTY }}",
target="text/html",
type=SyntheticsAssertionType.HEADER,
),
SyntheticsAssertionTarget(
operator=SyntheticsAssertionOperator.LESS_THAN,
target=2000,
type=SyntheticsAssertionType.RESPONSE_TIME,
timings_scope=SyntheticsAssertionTimingsScope.WITHOUT_DNS,
),
SyntheticsAssertionJSONPathTarget(
operator=SyntheticsAssertionJSONPathOperator.VALIDATES_JSON_PATH,
target=SyntheticsAssertionJSONPathTargetTarget(
json_path="topKey",
operator="isNot",
target_value="0",
),
type=SyntheticsAssertionType.BODY,
),
SyntheticsAssertionXPathTarget(
operator=SyntheticsAssertionXPathOperator.VALIDATES_X_PATH,
target=SyntheticsAssertionXPathTargetTarget(
x_path="target-xpath",
target_value="0",
operator="contains",
),
type=SyntheticsAssertionType.BODY,
),
],
config_variables=[
SyntheticsConfigVariable(
example="content-type",
name="PROPERTY",
pattern="content-type",
type=SyntheticsConfigVariableType.TEXT,
),
],
request=SyntheticsTestRequest(
certificate=SyntheticsTestRequestCertificate(
cert=SyntheticsTestRequestCertificateItem(
content="cert-content",
filename="cert-filename",
updated_at="2020-10-16T09:23:24.857Z",
),
key=SyntheticsTestRequestCertificateItem(
content="key-content",
filename="key-filename",
updated_at="2020-10-16T09:23:24.857Z",
),
),
headers=SyntheticsTestHeaders(
unique="examplesynthetic",
),
method="GET",
timeout=10.0,
url="https://datadoghq.com",
proxy=SyntheticsTestRequestProxy(
url="https://datadoghq.com",
headers=SyntheticsTestHeaders(),
),
body_type=SyntheticsTestRequestBodyType.APPLICATION_OCTET_STREAM,
files=[
SyntheticsTestRequestBodyFile(
name="file name",
content="file content",
type="file type",
),
],
basic_auth=SyntheticsBasicAuthOauthClient(
access_token_url="https://datadog-token.com",
audience="audience",
client_id="client-id",
client_secret="client-secret",
resource="resource",
scope="yoyo",
token_api_authentication=SyntheticsBasicAuthOauthTokenApiAuthentication.HEADER,
type=SyntheticsBasicAuthOauthClientType.OAUTH_CLIENT,
),
persist_cookies=True,
),
),
locations=[
"aws:us-east-2",
],
message="BDD test payload: synthetics_api_http_test_payload.json",
name="Example-Synthetic",
options=SyntheticsTestOptions(
accept_self_signed=False,
allow_insecure=True,
follow_redirects=True,
min_failure_duration=10,
min_location_failed=1,
monitor_name="Example-Synthetic",
monitor_priority=5,
retry=SyntheticsTestOptionsRetry(
count=3,
interval=10.0,
),
tick_every=60,
http_version=SyntheticsTestOptionsHTTPVersion.HTTP2,
),
subtype=SyntheticsTestDetailsSubType.HTTP,
tags=[
"testing:api",
],
type=SyntheticsAPITestType.API,
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = SyntheticsApi(api_client)
response = api_instance.create_synthetics_api_test(body=body)

print(response)
4 changes: 4 additions & 0 deletions examples/v1/synthetics/UpdateBrowserTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
)
from datadog_api_client.v1.model.synthetics_test_pause_status import SyntheticsTestPauseStatus
from datadog_api_client.v1.model.synthetics_test_request import SyntheticsTestRequest
from datadog_api_client.v1.model.synthetics_test_request_body_file import SyntheticsTestRequestBodyFile
from datadog_api_client.v1.model.synthetics_test_request_body_type import SyntheticsTestRequestBodyType
from datadog_api_client.v1.model.synthetics_test_request_certificate import SyntheticsTestRequestCertificate
from datadog_api_client.v1.model.synthetics_test_request_certificate_item import SyntheticsTestRequestCertificateItem
Expand Down Expand Up @@ -59,6 +60,9 @@
key=SyntheticsTestRequestCertificateItem(),
),
certificate_domains=[],
files=[
SyntheticsTestRequestBodyFile(),
],
http_version=SyntheticsTestOptionsHTTPVersion.HTTP1,
proxy=SyntheticsTestRequestProxy(
url="https://example.com",
Expand Down
10 changes: 10 additions & 0 deletions src/datadog_api_client/v1/model/synthetics_test_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from datadog_api_client.v1.model.synthetics_test_request_body_type import SyntheticsTestRequestBodyType
from datadog_api_client.v1.model.synthetics_test_call_type import SyntheticsTestCallType
from datadog_api_client.v1.model.synthetics_test_request_certificate import SyntheticsTestRequestCertificate
from datadog_api_client.v1.model.synthetics_test_request_body_file import SyntheticsTestRequestBodyFile
from datadog_api_client.v1.model.synthetics_test_headers import SyntheticsTestHeaders
from datadog_api_client.v1.model.synthetics_test_options_http_version import SyntheticsTestOptionsHTTPVersion
from datadog_api_client.v1.model.synthetics_test_metadata import SyntheticsTestMetadata
Expand Down Expand Up @@ -48,6 +49,7 @@ def openapi_types(_):
from datadog_api_client.v1.model.synthetics_test_request_body_type import SyntheticsTestRequestBodyType
from datadog_api_client.v1.model.synthetics_test_call_type import SyntheticsTestCallType
from datadog_api_client.v1.model.synthetics_test_request_certificate import SyntheticsTestRequestCertificate
from datadog_api_client.v1.model.synthetics_test_request_body_file import SyntheticsTestRequestBodyFile
from datadog_api_client.v1.model.synthetics_test_headers import SyntheticsTestHeaders
from datadog_api_client.v1.model.synthetics_test_options_http_version import SyntheticsTestOptionsHTTPVersion
from datadog_api_client.v1.model.synthetics_test_metadata import SyntheticsTestMetadata
Expand All @@ -65,6 +67,7 @@ def openapi_types(_):
"compressed_proto_file": (str,),
"dns_server": (str,),
"dns_server_port": (int,),
"files": ([SyntheticsTestRequestBodyFile],),
"follow_redirects": (bool,),
"headers": (SyntheticsTestHeaders,),
"host": (str,),
Expand Down Expand Up @@ -97,6 +100,7 @@ def openapi_types(_):
"compressed_proto_file": "compressedProtoFile",
"dns_server": "dnsServer",
"dns_server_port": "dnsServerPort",
"files": "files",
"follow_redirects": "follow_redirects",
"headers": "headers",
"host": "host",
Expand Down Expand Up @@ -139,6 +143,7 @@ def __init__(
compressed_proto_file: Union[str, UnsetType] = unset,
dns_server: Union[str, UnsetType] = unset,
dns_server_port: Union[int, UnsetType] = unset,
files: Union[List[SyntheticsTestRequestBodyFile], UnsetType] = unset,
follow_redirects: Union[bool, UnsetType] = unset,
headers: Union[SyntheticsTestHeaders, UnsetType] = unset,
host: Union[str, UnsetType] = unset,
Expand Down Expand Up @@ -195,6 +200,9 @@ def __init__(
:param dns_server_port: DNS server port to use for DNS tests.
:type dns_server_port: int, optional
:param files: Files to be used as part of the request in the test.
:type files: [SyntheticsTestRequestBodyFile], optional
:param follow_redirects: Specifies whether or not the request follows redirects.
:type follow_redirects: bool, optional
Expand Down Expand Up @@ -273,6 +281,8 @@ def __init__(
kwargs["dns_server"] = dns_server
if dns_server_port is not unset:
kwargs["dns_server_port"] = dns_server_port
if files is not unset:
kwargs["files"] = files
if follow_redirects is not unset:
kwargs["follow_redirects"] = follow_redirects
if headers is not unset:
Expand Down
Loading

0 comments on commit 9e73fac

Please sign in to comment.