Skip to content

Commit e3f32bb

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit f9a13ca of spec repo
1 parent fd58c5a commit e3f32bb

14 files changed

Lines changed: 476 additions & 0 deletions

File tree

.generator/schemas/v2/openapi.yaml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71914,6 +71914,55 @@ components:
7191471914
$ref: "#/components/schemas/Trigger"
7191571915
type: array
7191671916
type: object
71917+
SpecAttributes:
71918+
description: Attributes of an API spec.
71919+
properties:
71920+
name:
71921+
description: The name of the spec.
71922+
example: pets-api
71923+
type: string
71924+
status:
71925+
$ref: "#/components/schemas/SpecAttributesStatus"
71926+
version:
71927+
description: The version of the spec.
71928+
example: "2.1.0"
71929+
type: string
71930+
type: object
71931+
SpecAttributesStatus:
71932+
description: The publication status of the spec.
71933+
enum:
71934+
- published
71935+
- draft
71936+
- deprecated
71937+
example: published
71938+
type: string
71939+
x-enum-varnames:
71940+
- PUBLISHED
71941+
- DRAFT
71942+
- DEPRECATED
71943+
SpecData:
71944+
description: A single API spec resource.
71945+
properties:
71946+
attributes:
71947+
$ref: "#/components/schemas/SpecAttributes"
71948+
id:
71949+
description: The unique identifier of the spec.
71950+
example: d5e5d5a0-1234-5678-9abc-def012345678
71951+
type: string
71952+
type:
71953+
$ref: "#/components/schemas/SpecType"
71954+
required:
71955+
- type
71956+
type: object
71957+
SpecType:
71958+
default: spec
71959+
description: Type of the spec resource.
71960+
enum:
71961+
- spec
71962+
example: spec
71963+
type: string
71964+
x-enum-varnames:
71965+
- SPEC
7191771966
SpecVersion:
7191871967
description: The version of the CycloneDX specification a BOM conforms to.
7191971968
enum:
@@ -71932,6 +71981,15 @@ components:
7193271981
- ONE_THREE
7193371982
- ONE_FOUR
7193471983
- ONE_FIVE
71984+
SpecsListResponse:
71985+
description: Response containing a list of specs.
71986+
properties:
71987+
data:
71988+
description: List of specs.
71989+
items:
71990+
$ref: "#/components/schemas/SpecData"
71991+
type: array
71992+
type: object
7193571993
SplitAPIKey:
7193671994
description: The definition of the `SplitAPIKey` object.
7193771995
properties:
@@ -137984,6 +138042,43 @@ paths:
137984138042
cursorPath: meta.page.after
137985138043
limitParam: body.data.attributes.page.limit
137986138044
resultsPath: data
138045+
/api/v2/specs:
138046+
get:
138047+
description: Returns a list of API specs stored in the system.
138048+
operationId: ListSpecs
138049+
responses:
138050+
"200":
138051+
content:
138052+
application/json:
138053+
examples:
138054+
default:
138055+
value:
138056+
data:
138057+
- attributes:
138058+
name: pets-api
138059+
status: published
138060+
version: "2.1.0"
138061+
id: d5e5d5a0-1234-5678-9abc-def012345678
138062+
type: spec
138063+
- attributes:
138064+
name: users-api
138065+
status: draft
138066+
version: "1.0.0"
138067+
id: a1b2c3d4-5678-9abc-def0-123456789abc
138068+
type: spec
138069+
schema:
138070+
$ref: "#/components/schemas/SpecsListResponse"
138071+
description: OK
138072+
"403":
138073+
$ref: "#/components/responses/ForbiddenResponse"
138074+
"429":
138075+
$ref: "#/components/responses/TooManyRequestsResponse"
138076+
security:
138077+
- apiKeyAuth: []
138078+
appKeyAuth: []
138079+
summary: List API specs
138080+
tags:
138081+
- Specs
137987138082
/api/v2/static-analysis-sca/dependencies:
137988138083
post:
137989138084
operationId: CreateSCAResult
@@ -148377,6 +148472,9 @@ tags:
148377148472
description: Find out more at
148378148473
url: https://docs.datadoghq.com/tracing/metrics/metrics_namespace/
148379148474
name: Spans Metrics
148475+
- description: |-
148476+
View API specs stored in the system.
148477+
name: Specs
148380148478
- description: API for static analysis
148381148479
name: Static Analysis
148382148480
- description: Manage your status pages and communicate service disruptions to stakeholders via Datadog's API. See the [Status Pages documentation](https://docs.datadoghq.com/incident_response/status_pages/) for more information.

docs/datadog_api_client.v2.api.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,13 @@ datadog\_api\_client.v2.api.spans\_metrics\_api module
697697
:members:
698698
:show-inheritance:
699699

700+
datadog\_api\_client.v2.api.specs\_api module
701+
---------------------------------------------
702+
703+
.. automodule:: datadog_api_client.v2.api.specs_api
704+
:members:
705+
:show-inheritance:
706+
700707
datadog\_api\_client.v2.api.static\_analysis\_api module
701708
--------------------------------------------------------
702709

docs/datadog_api_client.v2.model.rst

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31777,6 +31777,41 @@ datadog\_api\_client.v2.model.spec module
3177731777
:members:
3177831778
:show-inheritance:
3177931779

31780+
datadog\_api\_client.v2.model.spec\_attributes module
31781+
-----------------------------------------------------
31782+
31783+
.. automodule:: datadog_api_client.v2.model.spec_attributes
31784+
:members:
31785+
:show-inheritance:
31786+
31787+
datadog\_api\_client.v2.model.spec\_attributes\_status module
31788+
-------------------------------------------------------------
31789+
31790+
.. automodule:: datadog_api_client.v2.model.spec_attributes_status
31791+
:members:
31792+
:show-inheritance:
31793+
31794+
datadog\_api\_client.v2.model.spec\_data module
31795+
-----------------------------------------------
31796+
31797+
.. automodule:: datadog_api_client.v2.model.spec_data
31798+
:members:
31799+
:show-inheritance:
31800+
31801+
datadog\_api\_client.v2.model.spec\_type module
31802+
-----------------------------------------------
31803+
31804+
.. automodule:: datadog_api_client.v2.model.spec_type
31805+
:members:
31806+
:show-inheritance:
31807+
31808+
datadog\_api\_client.v2.model.specs\_list\_response module
31809+
----------------------------------------------------------
31810+
31811+
.. automodule:: datadog_api_client.v2.model.specs_list_response
31812+
:members:
31813+
:show-inheritance:
31814+
3178031815
datadog\_api\_client.v2.model.split\_api\_key module
3178131816
----------------------------------------------------
3178231817

examples/v2/specs/ListSpecs.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
"""
2+
List API specs returns "OK" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.specs_api import SpecsApi
7+
8+
configuration = Configuration()
9+
with ApiClient(configuration) as api_client:
10+
api_instance = SpecsApi(api_client)
11+
response = api_instance.list_specs()
12+
13+
print(response)
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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 Any, Dict
7+
8+
from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint
9+
from datadog_api_client.configuration import Configuration
10+
from datadog_api_client.v2.model.specs_list_response import SpecsListResponse
11+
12+
13+
class SpecsApi:
14+
"""
15+
View API specs stored in the system.
16+
"""
17+
18+
def __init__(self, api_client=None):
19+
if api_client is None:
20+
api_client = ApiClient(Configuration())
21+
self.api_client = api_client
22+
23+
self._list_specs_endpoint = _Endpoint(
24+
settings={
25+
"response_type": (SpecsListResponse,),
26+
"auth": ["apiKeyAuth", "appKeyAuth"],
27+
"endpoint_path": "/api/v2/specs",
28+
"operation_id": "list_specs",
29+
"http_method": "GET",
30+
"version": "v2",
31+
},
32+
params_map={},
33+
headers_map={
34+
"accept": ["application/json"],
35+
},
36+
api_client=api_client,
37+
)
38+
39+
def list_specs(
40+
self,
41+
) -> SpecsListResponse:
42+
"""List API specs.
43+
44+
Returns a list of API specs stored in the system.
45+
46+
:rtype: SpecsListResponse
47+
"""
48+
kwargs: Dict[str, Any] = {}
49+
return self._list_specs_endpoint.call_with_http_info(**kwargs)

src/datadog_api_client/v2/apis/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@
9797
from datadog_api_client.v2.api.spa_api import SpaApi
9898
from datadog_api_client.v2.api.spans_api import SpansApi
9999
from datadog_api_client.v2.api.spans_metrics_api import SpansMetricsApi
100+
from datadog_api_client.v2.api.specs_api import SpecsApi
100101
from datadog_api_client.v2.api.static_analysis_api import StaticAnalysisApi
101102
from datadog_api_client.v2.api.status_pages_api import StatusPagesApi
102103
from datadog_api_client.v2.api.storage_management_api import StorageManagementApi
@@ -210,6 +211,7 @@
210211
"SpaApi",
211212
"SpansApi",
212213
"SpansMetricsApi",
214+
"SpecsApi",
213215
"StaticAnalysisApi",
214216
"StatusPagesApi",
215217
"StorageManagementApi",
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
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, 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.spec_attributes_status import SpecAttributesStatus
18+
19+
20+
class SpecAttributes(ModelNormal):
21+
@cached_property
22+
def openapi_types(_):
23+
from datadog_api_client.v2.model.spec_attributes_status import SpecAttributesStatus
24+
25+
return {
26+
"name": (str,),
27+
"status": (SpecAttributesStatus,),
28+
"version": (str,),
29+
}
30+
31+
attribute_map = {
32+
"name": "name",
33+
"status": "status",
34+
"version": "version",
35+
}
36+
37+
def __init__(
38+
self_,
39+
name: Union[str, UnsetType] = unset,
40+
status: Union[SpecAttributesStatus, UnsetType] = unset,
41+
version: Union[str, UnsetType] = unset,
42+
**kwargs,
43+
):
44+
"""
45+
Attributes of an API spec.
46+
47+
:param name: The name of the spec.
48+
:type name: str, optional
49+
50+
:param status: The publication status of the spec.
51+
:type status: SpecAttributesStatus, optional
52+
53+
:param version: The version of the spec.
54+
:type version: str, optional
55+
"""
56+
if name is not unset:
57+
kwargs["name"] = name
58+
if status is not unset:
59+
kwargs["status"] = status
60+
if version is not unset:
61+
kwargs["version"] = version
62+
super().__init__(kwargs)
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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+
7+
from datadog_api_client.model_utils import (
8+
ModelSimple,
9+
cached_property,
10+
)
11+
12+
from typing import ClassVar
13+
14+
15+
class SpecAttributesStatus(ModelSimple):
16+
"""
17+
The publication status of the spec.
18+
19+
:param value: Must be one of ["published", "draft", "deprecated"].
20+
:type value: str
21+
"""
22+
23+
allowed_values = {
24+
"published",
25+
"draft",
26+
"deprecated",
27+
}
28+
PUBLISHED: ClassVar["SpecAttributesStatus"]
29+
DRAFT: ClassVar["SpecAttributesStatus"]
30+
DEPRECATED: ClassVar["SpecAttributesStatus"]
31+
32+
@cached_property
33+
def openapi_types(_):
34+
return {
35+
"value": (str,),
36+
}
37+
38+
39+
SpecAttributesStatus.PUBLISHED = SpecAttributesStatus("published")
40+
SpecAttributesStatus.DRAFT = SpecAttributesStatus("draft")
41+
SpecAttributesStatus.DEPRECATED = SpecAttributesStatus("deprecated")

0 commit comments

Comments
 (0)