Skip to content
Closed
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
26 changes: 25 additions & 1 deletion .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14574,6 +14574,7 @@ components:
type: string
x-enum-varnames: ["CIPIPELINE_RESOURCE_REQUEST"]
CIAppEventAttributes:
additionalProperties: {}
description: JSON object containing all event attributes and their associated values.
properties:
attributes:
Expand Down Expand Up @@ -14895,6 +14896,7 @@ components:
$ref: "#/components/schemas/CIAppPipelineEventTypeName"
type: object
CIAppPipelineEventAttributes:
additionalProperties: {}
description: JSON object containing all event attributes and their associated values.
properties:
attributes:
Expand Down Expand Up @@ -15789,7 +15791,7 @@ components:
options:
$ref: "#/components/schemas/CIAppQueryOptions"
page:
$ref: "#/components/schemas/CIAppQueryPageOptions"
$ref: "#/components/schemas/CIAppTestQueryPageOptions"
sort:
$ref: "#/components/schemas/CIAppSort"
type: object
Expand All @@ -15812,6 +15814,28 @@ components:
example: test
type: string
x-enum-varnames: ["SESSION", "MODULE", "SUITE", "TEST"]
CIAppTestQueryPageLimit:
default: 10
description: Maximum number of events in the response, supplied as an integer or a string containing decimal digits.
example: 25
oneOf:
- format: int32
maximum: 1000
minimum: 0
type: integer
- pattern: "^(?:[0-9]{1,3}|1000)$"
type: string
CIAppTestQueryPageOptions:
description: Paging attributes for listing test events.
properties:
cursor:
description: |-
List following results with a cursor provided in the previous query.
example: "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ=="
type: string
limit:
$ref: "#/components/schemas/CIAppTestQueryPageLimit"
type: object
CIAppTestsAggregateRequest:
description: The object sent with the request to retrieve aggregation buckets of test events from your organization.
properties:
Expand Down
4 changes: 2 additions & 2 deletions examples/v2/ci-visibility-tests/SearchCIAppTestEvents.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.ci_visibility_tests_api import CIVisibilityTestsApi
from datadog_api_client.v2.model.ci_app_query_options import CIAppQueryOptions
from datadog_api_client.v2.model.ci_app_query_page_options import CIAppQueryPageOptions
from datadog_api_client.v2.model.ci_app_sort import CIAppSort
from datadog_api_client.v2.model.ci_app_test_events_request import CIAppTestEventsRequest
from datadog_api_client.v2.model.ci_app_test_query_page_options import CIAppTestQueryPageOptions
from datadog_api_client.v2.model.ci_app_tests_query_filter import CIAppTestsQueryFilter

body = CIAppTestEventsRequest(
Expand All @@ -19,7 +19,7 @@
options=CIAppQueryOptions(
timezone="GMT",
),
page=CIAppQueryPageOptions(
page=CIAppTestQueryPageOptions(
limit=25,
),
sort=CIAppSort.TIMESTAMP_ASCENDING,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.ci_visibility_tests_api import CIVisibilityTestsApi
from datadog_api_client.v2.model.ci_app_query_page_options import CIAppQueryPageOptions
from datadog_api_client.v2.model.ci_app_sort import CIAppSort
from datadog_api_client.v2.model.ci_app_test_events_request import CIAppTestEventsRequest
from datadog_api_client.v2.model.ci_app_test_query_page_options import CIAppTestQueryPageOptions
from datadog_api_client.v2.model.ci_app_tests_query_filter import CIAppTestsQueryFilter

body = CIAppTestEventsRequest(
Expand All @@ -15,7 +15,7 @@
query="@test.status:pass AND -@language:python",
to="now",
),
page=CIAppQueryPageOptions(
page=CIAppTestQueryPageOptions(
limit=2,
),
sort=CIAppSort.TIMESTAMP_ASCENDING,
Expand Down
12 changes: 6 additions & 6 deletions src/datadog_api_client/v2/model/ci_app_test_events_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
if TYPE_CHECKING:
from datadog_api_client.v2.model.ci_app_tests_query_filter import CIAppTestsQueryFilter
from datadog_api_client.v2.model.ci_app_query_options import CIAppQueryOptions
from datadog_api_client.v2.model.ci_app_query_page_options import CIAppQueryPageOptions
from datadog_api_client.v2.model.ci_app_test_query_page_options import CIAppTestQueryPageOptions
from datadog_api_client.v2.model.ci_app_sort import CIAppSort


Expand All @@ -25,13 +25,13 @@ class CIAppTestEventsRequest(ModelNormal):
def openapi_types(_):
from datadog_api_client.v2.model.ci_app_tests_query_filter import CIAppTestsQueryFilter
from datadog_api_client.v2.model.ci_app_query_options import CIAppQueryOptions
from datadog_api_client.v2.model.ci_app_query_page_options import CIAppQueryPageOptions
from datadog_api_client.v2.model.ci_app_test_query_page_options import CIAppTestQueryPageOptions
from datadog_api_client.v2.model.ci_app_sort import CIAppSort

return {
"filter": (CIAppTestsQueryFilter,),
"options": (CIAppQueryOptions,),
"page": (CIAppQueryPageOptions,),
"page": (CIAppTestQueryPageOptions,),
"sort": (CIAppSort,),
}

Expand All @@ -46,7 +46,7 @@ def __init__(
self_,
filter: Union[CIAppTestsQueryFilter, UnsetType] = unset,
options: Union[CIAppQueryOptions, UnsetType] = unset,
page: Union[CIAppQueryPageOptions, UnsetType] = unset,
page: Union[CIAppTestQueryPageOptions, UnsetType] = unset,
sort: Union[CIAppSort, UnsetType] = unset,
**kwargs,
):
Expand All @@ -60,8 +60,8 @@ def __init__(
Only supply timezone or time offset, not both. Otherwise, the query fails.
:type options: CIAppQueryOptions, optional

:param page: Paging attributes for listing events.
:type page: CIAppQueryPageOptions, optional
:param page: Paging attributes for listing test events.
:type page: CIAppTestQueryPageOptions, optional

:param sort: Sort parameters when querying events.
:type sort: CIAppSort, optional
Expand Down
34 changes: 34 additions & 0 deletions src/datadog_api_client/v2/model/ci_app_test_query_page_limit.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# 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 datadog_api_client.model_utils import (
ModelComposed,
cached_property,
)


class CIAppTestQueryPageLimit(ModelComposed):
def __init__(self, **kwargs):
"""
Maximum number of events in the response, supplied as an integer or a string containing decimal digits.
"""
super().__init__(kwargs)

@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
return {
"oneOf": [
int,
str,
],
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# 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 Union, TYPE_CHECKING

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


if TYPE_CHECKING:
from datadog_api_client.v2.model.ci_app_test_query_page_limit import CIAppTestQueryPageLimit


class CIAppTestQueryPageOptions(ModelNormal):
@cached_property
def openapi_types(_):
from datadog_api_client.v2.model.ci_app_test_query_page_limit import CIAppTestQueryPageLimit

return {
"cursor": (str,),
"limit": (CIAppTestQueryPageLimit,),
}

attribute_map = {
"cursor": "cursor",
"limit": "limit",
}

def __init__(
self_,
cursor: Union[str, UnsetType] = unset,
limit: Union[CIAppTestQueryPageLimit, int, str, UnsetType] = unset,
**kwargs,
):
"""
Paging attributes for listing test events.

:param cursor: List following results with a cursor provided in the previous query.
:type cursor: str, optional

:param limit: Maximum number of events in the response, supplied as an integer or a string containing decimal digits.
:type limit: CIAppTestQueryPageLimit, optional
"""
if cursor is not unset:
kwargs["cursor"] = cursor
if limit is not unset:
kwargs["limit"] = limit
super().__init__(kwargs)
4 changes: 4 additions & 0 deletions src/datadog_api_client/v2/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1008,6 +1008,8 @@
from datadog_api_client.v2.model.ci_app_test_events_request import CIAppTestEventsRequest
from datadog_api_client.v2.model.ci_app_test_events_response import CIAppTestEventsResponse
from datadog_api_client.v2.model.ci_app_test_level import CIAppTestLevel
from datadog_api_client.v2.model.ci_app_test_query_page_limit import CIAppTestQueryPageLimit
from datadog_api_client.v2.model.ci_app_test_query_page_options import CIAppTestQueryPageOptions
from datadog_api_client.v2.model.ci_app_tests_aggregate_request import CIAppTestsAggregateRequest
from datadog_api_client.v2.model.ci_app_tests_aggregation_buckets_response import CIAppTestsAggregationBucketsResponse
from datadog_api_client.v2.model.ci_app_tests_analytics_aggregate_response import CIAppTestsAnalyticsAggregateResponse
Expand Down Expand Up @@ -12298,6 +12300,8 @@
"CIAppTestEventsRequest",
"CIAppTestEventsResponse",
"CIAppTestLevel",
"CIAppTestQueryPageLimit",
"CIAppTestQueryPageOptions",
"CIAppTestsAggregateRequest",
"CIAppTestsAggregationBucketsResponse",
"CIAppTestsAnalyticsAggregateResponse",
Expand Down
Loading