Skip to content

Commit

Permalink
Document new api/app key schemas (#1755)
Browse files Browse the repository at this point in the history
Co-authored-by: ci.datadog-api-spec <[email protected]>
  • Loading branch information
api-clients-generation-pipeline[bot] and ci.datadog-api-spec authored Nov 17, 2023
1 parent 6a6ac2f commit 83ad6b1
Show file tree
Hide file tree
Showing 10 changed files with 280 additions and 4 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": "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"
}
}
}
40 changes: 40 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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.
Expand Down
28 changes: 28 additions & 0 deletions docs/datadog_api_client.v2.model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
---------------

Expand Down Expand Up @@ -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
------------------------------------

Expand Down
10 changes: 10 additions & 0 deletions src/datadog_api_client/v2/model/api_keys_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -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,
):
"""
Expand All @@ -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)
54 changes: 54 additions & 0 deletions src/datadog_api_client/v2/model/api_keys_response_meta.py
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.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)
36 changes: 36 additions & 0 deletions src/datadog_api_client/v2/model/api_keys_response_meta_page.py
Original file line number Diff line number Diff line change
@@ -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)
54 changes: 54 additions & 0 deletions src/datadog_api_client/v2/model/application_key_response_meta.py
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.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)
Original file line number Diff line number Diff line change
@@ -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)
Loading

0 comments on commit 83ad6b1

Please sign in to comment.