From 83ad6b10a8bd2c1de98052a493c780823db2dbc7 Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Fri, 17 Nov 2023 18:34:49 +0000 Subject: [PATCH] Document new api/app key schemas (#1755) Co-authored-by: ci.datadog-api-spec --- .apigentools-info | 8 +-- .generator/schemas/v2/openapi.yaml | 40 ++++++++++++++ docs/datadog_api_client.v2.model.rst | 28 ++++++++++ .../v2/model/api_keys_response.py | 10 ++++ .../v2/model/api_keys_response_meta.py | 54 +++++++++++++++++++ .../v2/model/api_keys_response_meta_page.py | 36 +++++++++++++ .../v2/model/application_key_response_meta.py | 54 +++++++++++++++++++ .../application_key_response_meta_page.py | 36 +++++++++++++ .../model/list_application_keys_response.py | 10 ++++ src/datadog_api_client/v2/models/__init__.py | 8 +++ 10 files changed, 280 insertions(+), 4 deletions(-) create mode 100644 src/datadog_api_client/v2/model/api_keys_response_meta.py create mode 100644 src/datadog_api_client/v2/model/api_keys_response_meta_page.py create mode 100644 src/datadog_api_client/v2/model/application_key_response_meta.py create mode 100644 src/datadog_api_client/v2/model/application_key_response_meta_page.py diff --git a/.apigentools-info b/.apigentools-info index 52833acb97..eb7a197801 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2023-11-17 12:18:28.002474", - "spec_repo_commit": "d2efeed9" + "regenerated": "2023-11-17 18:13:33.996478", + "spec_repo_commit": "46090fc1" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2023-11-17 12:18:28.020826", - "spec_repo_commit": "d2efeed9" + "regenerated": "2023-11-17 18:13:34.052011", + "spec_repo_commit": "46090fc1" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 5c17bd74e9..a7f2df358f 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -689,6 +689,26 @@ components: items: $ref: '#/components/schemas/APIKeyResponseIncludedItem' type: array + meta: + $ref: '#/components/schemas/APIKeysResponseMeta' + type: object + APIKeysResponseMeta: + description: Additional information related to api keys response. + properties: + max_allowed: + description: Max allowed number of API keys. + format: int64 + type: integer + page: + $ref: '#/components/schemas/APIKeysResponseMetaPage' + type: object + APIKeysResponseMetaPage: + description: Additional information related to the API keys response. + properties: + total_filtered_count: + description: Total filtered application key count. + format: int64 + type: integer type: object APIKeysSort: default: name @@ -833,6 +853,24 @@ components: oneOf: - $ref: '#/components/schemas/User' - $ref: '#/components/schemas/Role' + ApplicationKeyResponseMeta: + description: Additional information related to the application key response. + properties: + max_allowed_per_user: + description: Max allowed number of application keys per user. + format: int64 + type: integer + page: + $ref: '#/components/schemas/ApplicationKeyResponseMetaPage' + type: object + ApplicationKeyResponseMetaPage: + description: Additional information related to the application key response. + properties: + total_filtered_count: + description: Total filtered application key count. + format: int64 + type: integer + type: object ApplicationKeyUpdateAttributes: description: Attributes used to update an application Key. properties: @@ -8667,6 +8705,8 @@ components: items: $ref: '#/components/schemas/ApplicationKeyResponseIncludedItem' type: array + meta: + $ref: '#/components/schemas/ApplicationKeyResponseMeta' type: object ListDowntimesResponse: description: Response for retrieving all downtimes. diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index 1007210491..558e9a1ec0 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -106,6 +106,20 @@ api\_keys\_response :members: :show-inheritance: +api\_keys\_response\_meta +------------------------- + +.. automodule:: datadog_api_client.v2.model.api_keys_response_meta + :members: + :show-inheritance: + +api\_keys\_response\_meta\_page +------------------------------- + +.. automodule:: datadog_api_client.v2.model.api_keys_response_meta_page + :members: + :show-inheritance: + api\_keys\_sort --------------- @@ -169,6 +183,20 @@ application\_key\_response\_included\_item :members: :show-inheritance: +application\_key\_response\_meta +-------------------------------- + +.. automodule:: datadog_api_client.v2.model.application_key_response_meta + :members: + :show-inheritance: + +application\_key\_response\_meta\_page +-------------------------------------- + +.. automodule:: datadog_api_client.v2.model.application_key_response_meta_page + :members: + :show-inheritance: + application\_key\_update\_attributes ------------------------------------ diff --git a/src/datadog_api_client/v2/model/api_keys_response.py b/src/datadog_api_client/v2/model/api_keys_response.py index 6dfa83aa54..750f17110b 100644 --- a/src/datadog_api_client/v2/model/api_keys_response.py +++ b/src/datadog_api_client/v2/model/api_keys_response.py @@ -16,6 +16,7 @@ if TYPE_CHECKING: from datadog_api_client.v2.model.partial_api_key import PartialAPIKey from datadog_api_client.v2.model.api_key_response_included_item import APIKeyResponseIncludedItem + from datadog_api_client.v2.model.api_keys_response_meta import APIKeysResponseMeta from datadog_api_client.v2.model.user import User @@ -24,21 +25,25 @@ class APIKeysResponse(ModelNormal): def openapi_types(_): from datadog_api_client.v2.model.partial_api_key import PartialAPIKey from datadog_api_client.v2.model.api_key_response_included_item import APIKeyResponseIncludedItem + from datadog_api_client.v2.model.api_keys_response_meta import APIKeysResponseMeta return { "data": ([PartialAPIKey],), "included": ([APIKeyResponseIncludedItem],), + "meta": (APIKeysResponseMeta,), } attribute_map = { "data": "data", "included": "included", + "meta": "meta", } def __init__( self_, data: Union[List[PartialAPIKey], UnsetType] = unset, included: Union[List[Union[APIKeyResponseIncludedItem, User]], UnsetType] = unset, + meta: Union[APIKeysResponseMeta, UnsetType] = unset, **kwargs, ): """ @@ -49,9 +54,14 @@ def __init__( :param included: Array of objects related to the API key. :type included: [APIKeyResponseIncludedItem], optional + + :param meta: Additional information related to api keys response. + :type meta: APIKeysResponseMeta, optional """ if data is not unset: kwargs["data"] = data if included is not unset: kwargs["included"] = included + if meta is not unset: + kwargs["meta"] = meta super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/api_keys_response_meta.py b/src/datadog_api_client/v2/model/api_keys_response_meta.py new file mode 100644 index 0000000000..d08bacbe76 --- /dev/null +++ b/src/datadog_api_client/v2/model/api_keys_response_meta.py @@ -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.api_keys_response_meta_page import APIKeysResponseMetaPage + + +class APIKeysResponseMeta(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.api_keys_response_meta_page import APIKeysResponseMetaPage + + return { + "max_allowed": (int,), + "page": (APIKeysResponseMetaPage,), + } + + attribute_map = { + "max_allowed": "max_allowed", + "page": "page", + } + + def __init__( + self_, + max_allowed: Union[int, UnsetType] = unset, + page: Union[APIKeysResponseMetaPage, UnsetType] = unset, + **kwargs, + ): + """ + Additional information related to api keys response. + + :param max_allowed: Max allowed number of API keys. + :type max_allowed: int, optional + + :param page: Additional information related to the API keys response. + :type page: APIKeysResponseMetaPage, optional + """ + if max_allowed is not unset: + kwargs["max_allowed"] = max_allowed + if page is not unset: + kwargs["page"] = page + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/api_keys_response_meta_page.py b/src/datadog_api_client/v2/model/api_keys_response_meta_page.py new file mode 100644 index 0000000000..2744042e88 --- /dev/null +++ b/src/datadog_api_client/v2/model/api_keys_response_meta_page.py @@ -0,0 +1,36 @@ +# 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 + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class APIKeysResponseMetaPage(ModelNormal): + @cached_property + def openapi_types(_): + return { + "total_filtered_count": (int,), + } + + attribute_map = { + "total_filtered_count": "total_filtered_count", + } + + def __init__(self_, total_filtered_count: Union[int, UnsetType] = unset, **kwargs): + """ + Additional information related to the API keys response. + + :param total_filtered_count: Total filtered application key count. + :type total_filtered_count: int, optional + """ + if total_filtered_count is not unset: + kwargs["total_filtered_count"] = total_filtered_count + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/application_key_response_meta.py b/src/datadog_api_client/v2/model/application_key_response_meta.py new file mode 100644 index 0000000000..3798e65f8f --- /dev/null +++ b/src/datadog_api_client/v2/model/application_key_response_meta.py @@ -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.application_key_response_meta_page import ApplicationKeyResponseMetaPage + + +class ApplicationKeyResponseMeta(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.application_key_response_meta_page import ApplicationKeyResponseMetaPage + + return { + "max_allowed_per_user": (int,), + "page": (ApplicationKeyResponseMetaPage,), + } + + attribute_map = { + "max_allowed_per_user": "max_allowed_per_user", + "page": "page", + } + + def __init__( + self_, + max_allowed_per_user: Union[int, UnsetType] = unset, + page: Union[ApplicationKeyResponseMetaPage, UnsetType] = unset, + **kwargs, + ): + """ + Additional information related to the application key response. + + :param max_allowed_per_user: Max allowed number of application keys per user. + :type max_allowed_per_user: int, optional + + :param page: Additional information related to the application key response. + :type page: ApplicationKeyResponseMetaPage, optional + """ + if max_allowed_per_user is not unset: + kwargs["max_allowed_per_user"] = max_allowed_per_user + if page is not unset: + kwargs["page"] = page + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/application_key_response_meta_page.py b/src/datadog_api_client/v2/model/application_key_response_meta_page.py new file mode 100644 index 0000000000..862d297dfb --- /dev/null +++ b/src/datadog_api_client/v2/model/application_key_response_meta_page.py @@ -0,0 +1,36 @@ +# 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 + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class ApplicationKeyResponseMetaPage(ModelNormal): + @cached_property + def openapi_types(_): + return { + "total_filtered_count": (int,), + } + + attribute_map = { + "total_filtered_count": "total_filtered_count", + } + + def __init__(self_, total_filtered_count: Union[int, UnsetType] = unset, **kwargs): + """ + Additional information related to the application key response. + + :param total_filtered_count: Total filtered application key count. + :type total_filtered_count: int, optional + """ + if total_filtered_count is not unset: + kwargs["total_filtered_count"] = total_filtered_count + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/list_application_keys_response.py b/src/datadog_api_client/v2/model/list_application_keys_response.py index 830a9ebe94..be24002a36 100644 --- a/src/datadog_api_client/v2/model/list_application_keys_response.py +++ b/src/datadog_api_client/v2/model/list_application_keys_response.py @@ -16,6 +16,7 @@ if TYPE_CHECKING: from datadog_api_client.v2.model.partial_application_key import PartialApplicationKey from datadog_api_client.v2.model.application_key_response_included_item import ApplicationKeyResponseIncludedItem + from datadog_api_client.v2.model.application_key_response_meta import ApplicationKeyResponseMeta from datadog_api_client.v2.model.user import User from datadog_api_client.v2.model.role import Role @@ -27,21 +28,25 @@ def openapi_types(_): from datadog_api_client.v2.model.application_key_response_included_item import ( ApplicationKeyResponseIncludedItem, ) + from datadog_api_client.v2.model.application_key_response_meta import ApplicationKeyResponseMeta return { "data": ([PartialApplicationKey],), "included": ([ApplicationKeyResponseIncludedItem],), + "meta": (ApplicationKeyResponseMeta,), } attribute_map = { "data": "data", "included": "included", + "meta": "meta", } def __init__( self_, data: Union[List[PartialApplicationKey], UnsetType] = unset, included: Union[List[Union[ApplicationKeyResponseIncludedItem, User, Role]], UnsetType] = unset, + meta: Union[ApplicationKeyResponseMeta, UnsetType] = unset, **kwargs, ): """ @@ -52,9 +57,14 @@ def __init__( :param included: Array of objects related to the application key. :type included: [ApplicationKeyResponseIncludedItem], optional + + :param meta: Additional information related to the application key response. + :type meta: ApplicationKeyResponseMeta, optional """ if data is not unset: kwargs["data"] = data if included is not unset: kwargs["included"] = included + if meta is not unset: + kwargs["meta"] = meta super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 0864fc2e76..a783f23121 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -9,6 +9,8 @@ from datadog_api_client.v2.model.api_key_update_data import APIKeyUpdateData from datadog_api_client.v2.model.api_key_update_request import APIKeyUpdateRequest from datadog_api_client.v2.model.api_keys_response import APIKeysResponse +from datadog_api_client.v2.model.api_keys_response_meta import APIKeysResponseMeta +from datadog_api_client.v2.model.api_keys_response_meta_page import APIKeysResponseMetaPage from datadog_api_client.v2.model.api_keys_sort import APIKeysSort from datadog_api_client.v2.model.api_keys_type import APIKeysType from datadog_api_client.v2.model.active_billing_dimensions_attributes import ActiveBillingDimensionsAttributes @@ -22,6 +24,8 @@ from datadog_api_client.v2.model.application_key_relationships import ApplicationKeyRelationships from datadog_api_client.v2.model.application_key_response import ApplicationKeyResponse from datadog_api_client.v2.model.application_key_response_included_item import ApplicationKeyResponseIncludedItem +from datadog_api_client.v2.model.application_key_response_meta import ApplicationKeyResponseMeta +from datadog_api_client.v2.model.application_key_response_meta_page import ApplicationKeyResponseMetaPage from datadog_api_client.v2.model.application_key_update_attributes import ApplicationKeyUpdateAttributes from datadog_api_client.v2.model.application_key_update_data import ApplicationKeyUpdateData from datadog_api_client.v2.model.application_key_update_request import ApplicationKeyUpdateRequest @@ -1520,6 +1524,8 @@ "APIKeyUpdateData", "APIKeyUpdateRequest", "APIKeysResponse", + "APIKeysResponseMeta", + "APIKeysResponseMetaPage", "APIKeysSort", "APIKeysType", "ActiveBillingDimensionsAttributes", @@ -1533,6 +1539,8 @@ "ApplicationKeyRelationships", "ApplicationKeyResponse", "ApplicationKeyResponseIncludedItem", + "ApplicationKeyResponseMeta", + "ApplicationKeyResponseMetaPage", "ApplicationKeyUpdateAttributes", "ApplicationKeyUpdateData", "ApplicationKeyUpdateRequest",