Skip to content

Commit

Permalink
Regenerate client from commit 86b68b75 of spec repo
Browse files Browse the repository at this point in the history
  • Loading branch information
ci.datadog-api-spec committed Jun 25, 2024
1 parent cf8110a commit 06b4325
Show file tree
Hide file tree
Showing 17 changed files with 333 additions and 145 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-06-19 10:10:09.090441",
"spec_repo_commit": "4edb50e4"
"regenerated": "2024-06-25 09:59:17.409553",
"spec_repo_commit": "86b68b75"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-06-19 10:10:09.107922",
"spec_repo_commit": "4edb50e4"
"regenerated": "2024-06-25 09:59:17.430030",
"spec_repo_commit": "86b68b75"
}
}
}
112 changes: 71 additions & 41 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13370,59 +13370,23 @@ components:
type: object
SyntheticsAPIStep:
description: The steps used in a Synthetic multistep API test.
properties:
allowFailure:
description: Determines whether or not to continue with test if this step
fails.
type: boolean
assertions:
default: []
description: Array of assertions used for the test.
example:
- operator: lessThan
target: 1000
type: responseTime
items:
$ref: '#/components/schemas/SyntheticsAssertion'
type: array
extractedValues:
description: Array of values to parse and save as variables from the response.
items:
$ref: '#/components/schemas/SyntheticsParsingOptions'
type: array
isCritical:
description: 'Determines whether or not to consider the entire test as failed
if this step fails.

Can be used only if `allowFailure` is `true`.'
type: boolean
name:
description: The name of the step.
example: Example step name
type: string
request:
$ref: '#/components/schemas/SyntheticsTestRequest'
retry:
$ref: '#/components/schemas/SyntheticsTestOptionsRetry'
subtype:
$ref: '#/components/schemas/SyntheticsAPIStepSubtype'
required:
- assertions
- request
- name
- subtype
oneOf:
- $ref: '#/components/schemas/SyntheticsAPITestStep'
- $ref: '#/components/schemas/SyntheticsAPIWaitStep'
type: object
SyntheticsAPIStepSubtype:
description: The subtype of the Synthetic multistep API test step, currently
only supporting `http`.
enum:
- http
- grpc
- wait
example: http
type: string
x-enum-varnames:
- HTTP
- GRPC
- WAIT
SyntheticsAPITest:
description: Object containing details about a Synthetic API test.
properties:
Expand Down Expand Up @@ -13611,6 +13575,50 @@ components:
timings:
$ref: '#/components/schemas/SyntheticsTiming'
type: object
SyntheticsAPITestStep:
description: The Test step used in a Synthetic multistep API test.
properties:
allowFailure:
description: Determines whether or not to continue with test if this step
fails.
type: boolean
assertions:
default: []
description: Array of assertions used for the test.
example:
- operator: lessThan
target: 1000
type: responseTime
items:
$ref: '#/components/schemas/SyntheticsAssertion'
type: array
extractedValues:
description: Array of values to parse and save as variables from the response.
items:
$ref: '#/components/schemas/SyntheticsParsingOptions'
type: array
isCritical:
description: 'Determines whether or not to consider the entire test as failed
if this step fails.

Can be used only if `allowFailure` is `true`.'
type: boolean
name:
description: The name of the step.
example: Example step name
type: string
request:
$ref: '#/components/schemas/SyntheticsTestRequest'
retry:
$ref: '#/components/schemas/SyntheticsTestOptionsRetry'
subtype:
$ref: '#/components/schemas/SyntheticsAPIStepSubtype'
required:
- assertions
- request
- name
- subtype
type: object
SyntheticsAPITestType:
default: api
description: Type of the Synthetic test, `api`.
Expand All @@ -13620,6 +13628,28 @@ components:
type: string
x-enum-varnames:
- API
SyntheticsAPIWaitStep:
description: The Wait step used in a Synthetic multistep API test.
properties:
name:
description: The name of the step.
example: Example step name
type: string
subtype:
$ref: '#/components/schemas/SyntheticsAPIStepSubtype'
value:
description: The time to wait in seconds. Minimum value is 0, maximum value
is 180.
example: 5
format: int32
maximum: 180
minimum: 0
type: integer
required:
- name
- subtype
- value
type: object
SyntheticsApiTestFailureCode:
description: Error code that can be returned by a Synthetic test.
enum:
Expand Down
14 changes: 14 additions & 0 deletions docs/datadog_api_client.v1.model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3844,13 +3844,27 @@ synthetics\_api\_test\_result\_short\_result
:members:
:show-inheritance:

synthetics\_api\_test\_step
---------------------------

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

synthetics\_api\_test\_type
---------------------------

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

synthetics\_api\_wait\_step
---------------------------

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

synthetics\_assertion
---------------------

Expand Down
12 changes: 9 additions & 3 deletions examples/v1/synthetics/CreateSyntheticsAPITest_1279271422.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@

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_step import SyntheticsAPIStep
from datadog_api_client.v1.model.synthetics_api_step_subtype import SyntheticsAPIStepSubtype
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_step import SyntheticsAPITestStep
from datadog_api_client.v1.model.synthetics_api_test_type import SyntheticsAPITestType
from datadog_api_client.v1.model.synthetics_api_wait_step import SyntheticsAPIWaitStep
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_type import SyntheticsAssertionType
Expand Down Expand Up @@ -39,7 +40,7 @@
),
],
steps=[
SyntheticsAPIStep(
SyntheticsAPITestStep(
allow_failure=True,
assertions=[
SyntheticsAssertionTarget(
Expand Down Expand Up @@ -73,7 +74,12 @@
),
subtype=SyntheticsAPIStepSubtype.HTTP,
),
SyntheticsAPIStep(
SyntheticsAPIWaitStep(
name="Wait",
subtype=SyntheticsAPIStepSubtype.WAIT,
value=1,
),
SyntheticsAPITestStep(
name="GRPC CALL",
subtype=SyntheticsAPIStepSubtype.GRPC,
extracted_values=[],
Expand Down
94 changes: 26 additions & 68 deletions src/datadog_api_client/v1/model/synthetics_api_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,65 +3,15 @@
# Copyright 2019-Present Datadog, Inc.
from __future__ import annotations

from typing import List, Union, TYPE_CHECKING

from datadog_api_client.model_utils import (
ModelNormal,
ModelComposed,
cached_property,
unset,
UnsetType,
)


if TYPE_CHECKING:
from datadog_api_client.v1.model.synthetics_parsing_options import SyntheticsParsingOptions
from datadog_api_client.v1.model.synthetics_test_request import SyntheticsTestRequest
from datadog_api_client.v1.model.synthetics_test_options_retry import SyntheticsTestOptionsRetry
from datadog_api_client.v1.model.synthetics_api_step_subtype import SyntheticsAPIStepSubtype


class SyntheticsAPIStep(ModelNormal):
@cached_property
def openapi_types(_):
from datadog_api_client.v1.model.synthetics_assertion import SyntheticsAssertion
from datadog_api_client.v1.model.synthetics_parsing_options import SyntheticsParsingOptions
from datadog_api_client.v1.model.synthetics_test_request import SyntheticsTestRequest
from datadog_api_client.v1.model.synthetics_test_options_retry import SyntheticsTestOptionsRetry
from datadog_api_client.v1.model.synthetics_api_step_subtype import SyntheticsAPIStepSubtype

return {
"allow_failure": (bool,),
"assertions": ([SyntheticsAssertion],),
"extracted_values": ([SyntheticsParsingOptions],),
"is_critical": (bool,),
"name": (str,),
"request": (SyntheticsTestRequest,),
"retry": (SyntheticsTestOptionsRetry,),
"subtype": (SyntheticsAPIStepSubtype,),
}

attribute_map = {
"allow_failure": "allowFailure",
"assertions": "assertions",
"extracted_values": "extractedValues",
"is_critical": "isCritical",
"name": "name",
"request": "request",
"retry": "retry",
"subtype": "subtype",
}

def __init__(
self_,
name: str,
request: SyntheticsTestRequest,
subtype: SyntheticsAPIStepSubtype,
allow_failure: Union[bool, UnsetType] = unset,
extracted_values: Union[List[SyntheticsParsingOptions], UnsetType] = unset,
is_critical: Union[bool, UnsetType] = unset,
retry: Union[SyntheticsTestOptionsRetry, UnsetType] = unset,
**kwargs,
):
class SyntheticsAPIStep(ModelComposed):
def __init__(self, **kwargs):
"""
The steps used in a Synthetic multistep API test.
Expand All @@ -75,7 +25,7 @@ def __init__(
:type extracted_values: [SyntheticsParsingOptions], optional
:param is_critical: Determines whether or not to consider the entire test as failed if this step fails.
Can be used only if ``allowFailure`` is ``true``.
Can be used only if `allowFailure` is `true`.
:type is_critical: bool, optional
:param name: The name of the step.
Expand All @@ -87,21 +37,29 @@ def __init__(
:param retry: Object describing the retry strategy to apply to a Synthetic test.
:type retry: SyntheticsTestOptionsRetry, optional
:param subtype: The subtype of the Synthetic multistep API test step, currently only supporting ``http``.
:param subtype: The subtype of the Synthetic multistep API test step, currently only supporting `http`.
:type subtype: SyntheticsAPIStepSubtype
:param value: The time to wait in seconds. Minimum value is 0, maximum value is 180.
:type value: int
"""
if allow_failure is not unset:
kwargs["allow_failure"] = allow_failure
if extracted_values is not unset:
kwargs["extracted_values"] = extracted_values
if is_critical is not unset:
kwargs["is_critical"] = is_critical
if retry is not unset:
kwargs["retry"] = retry
super().__init__(kwargs)
assertions = kwargs.get("assertions", [])

self_.assertions = assertions
self_.name = name
self_.request = request
self_.subtype = subtype
@cached_property
def _composed_schemas(_):
# we need this here to make our import statements work
# we must store _composed_schemas in here so the code is only run
# when we invoke this method. If we kept this at the class
# level we would get an error because the class level
# code would be run when this module is imported, and these composed
# classes don't exist yet because their module has not finished
# loading
from datadog_api_client.v1.model.synthetics_api_test_step import SyntheticsAPITestStep
from datadog_api_client.v1.model.synthetics_api_wait_step import SyntheticsAPIWaitStep

return {
"oneOf": [
SyntheticsAPITestStep,
SyntheticsAPIWaitStep,
],
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,18 @@ class SyntheticsAPIStepSubtype(ModelSimple):
"""
The subtype of the Synthetic multistep API test step, currently only supporting `http`.
:param value: Must be one of ["http", "grpc"].
:param value: Must be one of ["http", "grpc", "wait"].
:type value: str
"""

allowed_values = {
"http",
"grpc",
"wait",
}
HTTP: ClassVar["SyntheticsAPIStepSubtype"]
GRPC: ClassVar["SyntheticsAPIStepSubtype"]
WAIT: ClassVar["SyntheticsAPIStepSubtype"]

@cached_property
def openapi_types(_):
Expand All @@ -36,3 +38,4 @@ def openapi_types(_):

SyntheticsAPIStepSubtype.HTTP = SyntheticsAPIStepSubtype("http")
SyntheticsAPIStepSubtype.GRPC = SyntheticsAPIStepSubtype("grpc")
SyntheticsAPIStepSubtype.WAIT = SyntheticsAPIStepSubtype("wait")
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
from datadog_api_client.v1.model.synthetics_assertion_json_path_target import SyntheticsAssertionJSONPathTarget
from datadog_api_client.v1.model.synthetics_assertion_json_schema_target import SyntheticsAssertionJSONSchemaTarget
from datadog_api_client.v1.model.synthetics_assertion_x_path_target import SyntheticsAssertionXPathTarget
from datadog_api_client.v1.model.synthetics_api_test_step import SyntheticsAPITestStep
from datadog_api_client.v1.model.synthetics_api_wait_step import SyntheticsAPIWaitStep


class SyntheticsAPITestConfig(ModelNormal):
Expand Down Expand Up @@ -66,7 +68,7 @@ def __init__(
] = unset,
config_variables: Union[List[SyntheticsConfigVariable], UnsetType] = unset,
request: Union[SyntheticsTestRequest, UnsetType] = unset,
steps: Union[List[SyntheticsAPIStep], UnsetType] = unset,
steps: Union[List[Union[SyntheticsAPIStep, SyntheticsAPITestStep, SyntheticsAPIWaitStep]], UnsetType] = unset,
variables_from_script: Union[str, UnsetType] = unset,
**kwargs,
):
Expand Down
Loading

0 comments on commit 06b4325

Please sign in to comment.