Skip to content

Commit 0b230ed

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
and
ci.datadog-api-spec
authored
Add support for API management ListAPIs (#1995)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 1d3b9dd commit 0b230ed

File tree

13 files changed

+446
-4
lines changed

13 files changed

+446
-4
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2024-06-11 09:38:14.314414",
8-
"spec_repo_commit": "cee92551"
7+
"regenerated": "2024-06-11 14:30:50.078498",
8+
"spec_repo_commit": "71f2f0da"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-06-11 09:38:14.335187",
13-
"spec_repo_commit": "cee92551"
12+
"regenerated": "2024-06-11 14:30:50.097371",
13+
"spec_repo_commit": "71f2f0da"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10554,6 +10554,52 @@ components:
1055410554
description: Jira project key
1055510555
type: string
1055610556
type: object
10557+
ListAPIsResponse:
10558+
description: Response for `ListAPIs`.
10559+
properties:
10560+
data:
10561+
description: List of API items.
10562+
items:
10563+
$ref: '#/components/schemas/ListAPIsResponseData'
10564+
type: array
10565+
meta:
10566+
$ref: '#/components/schemas/ListAPIsResponseMeta'
10567+
type: object
10568+
ListAPIsResponseData:
10569+
description: Data envelope for `ListAPIsResponse`.
10570+
properties:
10571+
id:
10572+
$ref: '#/components/schemas/ApiID'
10573+
name:
10574+
description: API name.
10575+
example: Payments API
10576+
type: string
10577+
type: object
10578+
ListAPIsResponseMeta:
10579+
description: Metadata for `ListAPIsResponse`.
10580+
properties:
10581+
pagination:
10582+
$ref: '#/components/schemas/ListAPIsResponseMetaPagination'
10583+
type: object
10584+
ListAPIsResponseMetaPagination:
10585+
description: Pagination metadata information for `ListAPIsResponse`.
10586+
properties:
10587+
limit:
10588+
description: Number of items in the current page.
10589+
example: 20
10590+
format: int64
10591+
type: integer
10592+
offset:
10593+
description: Offset for pagination.
10594+
example: 0
10595+
format: int64
10596+
type: integer
10597+
total_count:
10598+
description: Total number of items.
10599+
example: 35
10600+
format: int64
10601+
type: integer
10602+
type: object
1055710603
ListApplicationKeysResponse:
1055810604
description: Response for a list of application keys.
1055910605
properties:
@@ -23350,6 +23396,63 @@ paths:
2335023396
tags:
2335123397
- Key Management
2335223398
x-codegen-request-body-name: body
23399+
/api/v2/apicatalog/api:
23400+
get:
23401+
description: List APIs and their IDs.
23402+
operationId: ListAPIs
23403+
parameters:
23404+
- description: Filter APIs by name
23405+
in: query
23406+
name: query
23407+
required: false
23408+
schema:
23409+
example: payments
23410+
type: string
23411+
- description: Number of items per page.
23412+
in: query
23413+
name: page[limit]
23414+
required: false
23415+
schema:
23416+
default: 20
23417+
format: int64
23418+
minimum: 1
23419+
type: integer
23420+
- description: Offset for pagination.
23421+
in: query
23422+
name: page[offset]
23423+
required: false
23424+
schema:
23425+
default: 0
23426+
format: int64
23427+
minimum: 0
23428+
type: integer
23429+
responses:
23430+
'200':
23431+
content:
23432+
application/json:
23433+
schema:
23434+
$ref: '#/components/schemas/ListAPIsResponse'
23435+
description: OK
23436+
'400':
23437+
content:
23438+
application/json:
23439+
schema:
23440+
$ref: '#/components/schemas/JSONAPIErrorResponse'
23441+
description: Bad request
23442+
'403':
23443+
content:
23444+
application/json:
23445+
schema:
23446+
$ref: '#/components/schemas/JSONAPIErrorResponse'
23447+
description: Forbidden
23448+
'429':
23449+
$ref: '#/components/responses/TooManyRequestsResponse'
23450+
summary: List APIs
23451+
tags:
23452+
- API Management
23453+
x-unstable: '**Note**: This endpoint is in public beta.
23454+
23455+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
2335323456
/api/v2/apicatalog/api/{id}:
2335423457
delete:
2335523458
description: Delete a specific API by ID.

docs/datadog_api_client.v2.model.rst

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4481,6 +4481,34 @@ jsonapi\_error\_response
44814481
:members:
44824482
:show-inheritance:
44834483

4484+
list\_ap\_is\_response
4485+
----------------------
4486+
4487+
.. automodule:: datadog_api_client.v2.model.list_ap_is_response
4488+
:members:
4489+
:show-inheritance:
4490+
4491+
list\_ap\_is\_response\_data
4492+
----------------------------
4493+
4494+
.. automodule:: datadog_api_client.v2.model.list_ap_is_response_data
4495+
:members:
4496+
:show-inheritance:
4497+
4498+
list\_ap\_is\_response\_meta
4499+
----------------------------
4500+
4501+
.. automodule:: datadog_api_client.v2.model.list_ap_is_response_meta
4502+
:members:
4503+
:show-inheritance:
4504+
4505+
list\_ap\_is\_response\_meta\_pagination
4506+
----------------------------------------
4507+
4508+
.. automodule:: datadog_api_client.v2.model.list_ap_is_response_meta_pagination
4509+
:members:
4510+
:show-inheritance:
4511+
44844512
list\_application\_keys\_response
44854513
---------------------------------
44864514

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
"""
2+
List APIs returns "OK" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.api_management_api import APIManagementApi
7+
8+
configuration = Configuration()
9+
configuration.unstable_operations["list_ap_is"] = True
10+
with ApiClient(configuration) as api_client:
11+
api_instance = APIManagementApi(api_client)
12+
response = api_instance.list_ap_is()
13+
14+
print(response)

src/datadog_api_client/configuration.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ def __init__(
239239
"v2.create_open_api": False,
240240
"v2.delete_open_api": False,
241241
"v2.get_open_api": False,
242+
"v2.list_ap_is": False,
242243
"v2.update_open_api": False,
243244
"v2.get_active_billing_dimensions": False,
244245
"v2.get_monthly_cost_attribution": False,

src/datadog_api_client/v2/api/api_management_api.py

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
unset,
1414
UUID,
1515
)
16+
from datadog_api_client.v2.model.list_ap_is_response import ListAPIsResponse
1617
from datadog_api_client.v2.model.update_open_api_response import UpdateOpenAPIResponse
1718
from datadog_api_client.v2.model.create_open_api_response import CreateOpenAPIResponse
1819

@@ -93,6 +94,44 @@ def __init__(self, api_client=None):
9394
api_client=api_client,
9495
)
9596

97+
self._list_ap_is_endpoint = _Endpoint(
98+
settings={
99+
"response_type": (ListAPIsResponse,),
100+
"auth": ["apiKeyAuth", "appKeyAuth"],
101+
"endpoint_path": "/api/v2/apicatalog/api",
102+
"operation_id": "list_ap_is",
103+
"http_method": "GET",
104+
"version": "v2",
105+
},
106+
params_map={
107+
"query": {
108+
"openapi_types": (str,),
109+
"attribute": "query",
110+
"location": "query",
111+
},
112+
"page_limit": {
113+
"validation": {
114+
"inclusive_minimum": 1,
115+
},
116+
"openapi_types": (int,),
117+
"attribute": "page[limit]",
118+
"location": "query",
119+
},
120+
"page_offset": {
121+
"validation": {
122+
"inclusive_minimum": 0,
123+
},
124+
"openapi_types": (int,),
125+
"attribute": "page[offset]",
126+
"location": "query",
127+
},
128+
},
129+
headers_map={
130+
"accept": ["application/json"],
131+
},
132+
api_client=api_client,
133+
)
134+
96135
self._update_open_api_endpoint = _Endpoint(
97136
settings={
98137
"response_type": (UpdateOpenAPIResponse,),
@@ -175,6 +214,37 @@ def get_open_api(
175214

176215
return self._get_open_api_endpoint.call_with_http_info(**kwargs)
177216

217+
def list_ap_is(
218+
self,
219+
*,
220+
query: Union[str, UnsetType] = unset,
221+
page_limit: Union[int, UnsetType] = unset,
222+
page_offset: Union[int, UnsetType] = unset,
223+
) -> ListAPIsResponse:
224+
"""List APIs.
225+
226+
List APIs and their IDs.
227+
228+
:param query: Filter APIs by name
229+
:type query: str, optional
230+
:param page_limit: Number of items per page.
231+
:type page_limit: int, optional
232+
:param page_offset: Offset for pagination.
233+
:type page_offset: int, optional
234+
:rtype: ListAPIsResponse
235+
"""
236+
kwargs: Dict[str, Any] = {}
237+
if query is not unset:
238+
kwargs["query"] = query
239+
240+
if page_limit is not unset:
241+
kwargs["page_limit"] = page_limit
242+
243+
if page_offset is not unset:
244+
kwargs["page_offset"] = page_offset
245+
246+
return self._list_ap_is_endpoint.call_with_http_info(**kwargs)
247+
178248
def update_open_api(
179249
self,
180250
id: UUID,
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
# This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
# Copyright 2019-Present Datadog, Inc.
4+
from __future__ import annotations
5+
6+
from typing import List, Union, TYPE_CHECKING
7+
8+
from datadog_api_client.model_utils import (
9+
ModelNormal,
10+
cached_property,
11+
unset,
12+
UnsetType,
13+
)
14+
15+
16+
if TYPE_CHECKING:
17+
from datadog_api_client.v2.model.list_ap_is_response_data import ListAPIsResponseData
18+
from datadog_api_client.v2.model.list_ap_is_response_meta import ListAPIsResponseMeta
19+
20+
21+
class ListAPIsResponse(ModelNormal):
22+
@cached_property
23+
def openapi_types(_):
24+
from datadog_api_client.v2.model.list_ap_is_response_data import ListAPIsResponseData
25+
from datadog_api_client.v2.model.list_ap_is_response_meta import ListAPIsResponseMeta
26+
27+
return {
28+
"data": ([ListAPIsResponseData],),
29+
"meta": (ListAPIsResponseMeta,),
30+
}
31+
32+
attribute_map = {
33+
"data": "data",
34+
"meta": "meta",
35+
}
36+
37+
def __init__(
38+
self_,
39+
data: Union[List[ListAPIsResponseData], UnsetType] = unset,
40+
meta: Union[ListAPIsResponseMeta, UnsetType] = unset,
41+
**kwargs,
42+
):
43+
"""
44+
Response for ``ListAPIs``.
45+
46+
:param data: List of API items.
47+
:type data: [ListAPIsResponseData], optional
48+
49+
:param meta: Metadata for ``ListAPIsResponse``.
50+
:type meta: ListAPIsResponseMeta, optional
51+
"""
52+
if data is not unset:
53+
kwargs["data"] = data
54+
if meta is not unset:
55+
kwargs["meta"] = meta
56+
super().__init__(kwargs)
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
# This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
# Copyright 2019-Present Datadog, Inc.
4+
from __future__ import annotations
5+
6+
from typing import Union
7+
8+
from datadog_api_client.model_utils import (
9+
ModelNormal,
10+
cached_property,
11+
unset,
12+
UnsetType,
13+
UUID,
14+
)
15+
16+
17+
class ListAPIsResponseData(ModelNormal):
18+
@cached_property
19+
def openapi_types(_):
20+
return {
21+
"id": (UUID,),
22+
"name": (str,),
23+
}
24+
25+
attribute_map = {
26+
"id": "id",
27+
"name": "name",
28+
}
29+
30+
def __init__(self_, id: Union[UUID, UnsetType] = unset, name: Union[str, UnsetType] = unset, **kwargs):
31+
"""
32+
Data envelope for ``ListAPIsResponse``.
33+
34+
:param id: API identifier.
35+
:type id: UUID, optional
36+
37+
:param name: API name.
38+
:type name: str, optional
39+
"""
40+
if id is not unset:
41+
kwargs["id"] = id
42+
if name is not unset:
43+
kwargs["name"] = name
44+
super().__init__(kwargs)

0 commit comments

Comments
 (0)