Skip to content

Add support for Entity kind API #2387

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
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
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": "2025-01-31 15:03:10.251959",
"spec_repo_commit": "b01f90f4"
"regenerated": "2025-02-03 15:48:00.738383",
"spec_repo_commit": "d6014add"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2025-01-31 15:03:10.267307",
"spec_repo_commit": "b01f90f4"
"regenerated": "2025-02-03 15:48:00.757943",
"spec_repo_commit": "d6014add"
}
}
}
93 changes: 93 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10524,6 +10524,99 @@ components:
- $ref: '#/components/schemas/EntityV3Datastore'
- $ref: '#/components/schemas/EntityV3Queue'
- $ref: '#/components/schemas/EntityV3System'
- $ref: '#/components/schemas/EntityV3API'
EntityV3API:
additionalProperties: false
description: Schema for API entities.
properties:
apiVersion:
$ref: '#/components/schemas/EntityV3APIVersion'
datadog:
$ref: '#/components/schemas/EntityV3APIDatadog'
extensions:
additionalProperties: {}
description: Custom extensions. This is the free-formed field to send client-side
metadata. No Datadog features are affected by this field.
type: object
integrations:
$ref: '#/components/schemas/EntityV3Integrations'
kind:
$ref: '#/components/schemas/EntityV3APIKind'
metadata:
$ref: '#/components/schemas/EntityV3Metadata'
spec:
$ref: '#/components/schemas/EntityV3APISpec'
required:
- apiVersion
- kind
- metadata
type: object
EntityV3APIDatadog:
additionalProperties: false
description: Datadog product integrations for the API entity.
properties:
codeLocations:
$ref: '#/components/schemas/EntityV3DatadogCodeLocations'
events:
$ref: '#/components/schemas/EntityV3DatadogEvents'
logs:
$ref: '#/components/schemas/EntityV3DatadogLogs'
performanceData:
$ref: '#/components/schemas/EntityV3DatadogPerformance'
pipelines:
$ref: '#/components/schemas/EntityV3DatadogPipelines'
type: object
EntityV3APIKind:
description: The definition of Entity V3 API Kind object.
enum:
- api
example: api
type: string
x-enum-varnames:
- API
EntityV3APISpec:
additionalProperties: false
description: The definition of Entity V3 API Spec object.
properties:
implementedBy:
description: Services which implemented the API.
items:
type: string
type: array
interface:
$ref: '#/components/schemas/EntityV3APISpecInterface'
lifecycle:
description: The lifecycle state of the component.
minLength: 1
type: string
tier:
description: The importance of the component.
minLength: 1
type: string
type:
description: The type of API.
type: string
type: object
EntityV3APISpecInterface:
additionalProperties: false
description: The API definition.
oneOf:
- $ref: '#/components/schemas/EntityV3APISpecInterfaceFileRef'
- $ref: '#/components/schemas/EntityV3APISpecInterfaceDefinition'
EntityV3APISpecInterfaceDefinition:
additionalProperties: false
description: The definition of `EntityV3APISpecInterfaceDefinition` object.
properties:
definition:
description: The API definition.
type: object
EntityV3APISpecInterfaceFileRef:
additionalProperties: false
description: The definition of `EntityV3APISpecInterfaceFileRef` object.
properties:
fileRef:
description: The reference to the API definition file.
type: string
EntityV3APIVersion:
description: The schema version of entity type. The field is known as schema-version
in the previous version.
Expand Down
49 changes: 49 additions & 0 deletions docs/datadog_api_client.v2.model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4260,6 +4260,55 @@ datadog\_api\_client.v2.model.entity\_v3 module
:members:
:show-inheritance:

datadog\_api\_client.v2.model.entity\_v3\_api module
----------------------------------------------------

.. automodule:: datadog_api_client.v2.model.entity_v3_api
:members:
:show-inheritance:

datadog\_api\_client.v2.model.entity\_v3\_api\_datadog module
-------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.entity_v3_api_datadog
:members:
:show-inheritance:

datadog\_api\_client.v2.model.entity\_v3\_api\_kind module
----------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.entity_v3_api_kind
:members:
:show-inheritance:

datadog\_api\_client.v2.model.entity\_v3\_api\_spec module
----------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.entity_v3_api_spec
:members:
:show-inheritance:

datadog\_api\_client.v2.model.entity\_v3\_api\_spec\_interface module
---------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.entity_v3_api_spec_interface
:members:
:show-inheritance:

datadog\_api\_client.v2.model.entity\_v3\_api\_spec\_interface\_definition module
---------------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.entity_v3_api_spec_interface_definition
:members:
:show-inheritance:

datadog\_api\_client.v2.model.entity\_v3\_api\_spec\_interface\_file\_ref module
--------------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.entity_v3_api_spec_interface_file_ref
:members:
:show-inheritance:

datadog\_api\_client.v2.model.entity\_v3\_datadog\_code\_location\_item module
------------------------------------------------------------------------------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from datadog_api_client.v2.model.entity_v3_datastore import EntityV3Datastore
from datadog_api_client.v2.model.entity_v3_queue import EntityV3Queue
from datadog_api_client.v2.model.entity_v3_system import EntityV3System
from datadog_api_client.v2.model.entity_v3_api import EntityV3API


class EntityResponseIncludedSchemaAttributes(ModelNormal):
Expand All @@ -36,7 +37,9 @@ def openapi_types(_):

def __init__(
self_,
schema: Union[EntityV3, EntityV3Service, EntityV3Datastore, EntityV3Queue, EntityV3System, UnsetType] = unset,
schema: Union[
EntityV3, EntityV3Service, EntityV3Datastore, EntityV3Queue, EntityV3System, EntityV3API, UnsetType
] = unset,
**kwargs,
):
"""
Expand Down
2 changes: 2 additions & 0 deletions src/datadog_api_client/v2/model/entity_v3.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,14 @@ def _composed_schemas(_):
from datadog_api_client.v2.model.entity_v3_datastore import EntityV3Datastore
from datadog_api_client.v2.model.entity_v3_queue import EntityV3Queue
from datadog_api_client.v2.model.entity_v3_system import EntityV3System
from datadog_api_client.v2.model.entity_v3_api import EntityV3API

return {
"oneOf": [
EntityV3Service,
EntityV3Datastore,
EntityV3Queue,
EntityV3System,
EntityV3API,
],
}
125 changes: 125 additions & 0 deletions src/datadog_api_client/v2/model/entity_v3_api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
# 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 Any, Dict, Union, TYPE_CHECKING

from datadog_api_client.model_utils import (
ModelNormal,
cached_property,
date,
datetime,
none_type,
unset,
UnsetType,
UUID,
)


if TYPE_CHECKING:
from datadog_api_client.v2.model.entity_v3_api_version import EntityV3APIVersion
from datadog_api_client.v2.model.entity_v3_api_datadog import EntityV3APIDatadog
from datadog_api_client.v2.model.entity_v3_integrations import EntityV3Integrations
from datadog_api_client.v2.model.entity_v3_api_kind import EntityV3APIKind
from datadog_api_client.v2.model.entity_v3_metadata import EntityV3Metadata
from datadog_api_client.v2.model.entity_v3_api_spec import EntityV3APISpec


class EntityV3API(ModelNormal):
@cached_property
def additional_properties_type(_):
return None

@cached_property
def openapi_types(_):
from datadog_api_client.v2.model.entity_v3_api_version import EntityV3APIVersion
from datadog_api_client.v2.model.entity_v3_api_datadog import EntityV3APIDatadog
from datadog_api_client.v2.model.entity_v3_integrations import EntityV3Integrations
from datadog_api_client.v2.model.entity_v3_api_kind import EntityV3APIKind
from datadog_api_client.v2.model.entity_v3_metadata import EntityV3Metadata
from datadog_api_client.v2.model.entity_v3_api_spec import EntityV3APISpec

return {
"api_version": (EntityV3APIVersion,),
"datadog": (EntityV3APIDatadog,),
"extensions": (
{
str: (
bool,
date,
datetime,
dict,
float,
int,
list,
str,
UUID,
none_type,
)
},
),
"integrations": (EntityV3Integrations,),
"kind": (EntityV3APIKind,),
"metadata": (EntityV3Metadata,),
"spec": (EntityV3APISpec,),
}

attribute_map = {
"api_version": "apiVersion",
"datadog": "datadog",
"extensions": "extensions",
"integrations": "integrations",
"kind": "kind",
"metadata": "metadata",
"spec": "spec",
}

def __init__(
self_,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Code Quality Violation

Suggested change
self_,
self,
first parameter of a class function should be self (...read more)

In a class method (that is not a class method nor a static method), the first argument must be self by convention.

Learn More

View in Datadog  Leave us feedback  Documentation

api_version: EntityV3APIVersion,
kind: EntityV3APIKind,
metadata: EntityV3Metadata,
datadog: Union[EntityV3APIDatadog, UnsetType] = unset,
extensions: Union[Dict[str, Any], UnsetType] = unset,
integrations: Union[EntityV3Integrations, UnsetType] = unset,
spec: Union[EntityV3APISpec, UnsetType] = unset,
**kwargs,
):
"""
Schema for API entities.

:param api_version: The schema version of entity type. The field is known as schema-version in the previous version.
:type api_version: EntityV3APIVersion

:param datadog: Datadog product integrations for the API entity.
:type datadog: EntityV3APIDatadog, optional

:param extensions: Custom extensions. This is the free-formed field to send client-side metadata. No Datadog features are affected by this field.
:type extensions: {str: (bool, date, datetime, dict, float, int, list, str, UUID, none_type,)}, optional

:param integrations: A base schema for defining third-party integrations.
:type integrations: EntityV3Integrations, optional

:param kind: The definition of Entity V3 API Kind object.
:type kind: EntityV3APIKind

:param metadata: The definition of Entity V3 Metadata object.
:type metadata: EntityV3Metadata

:param spec: The definition of Entity V3 API Spec object.
:type spec: EntityV3APISpec, optional
"""
if datadog is not unset:
kwargs["datadog"] = datadog
if extensions is not unset:
kwargs["extensions"] = extensions
if integrations is not unset:
kwargs["integrations"] = integrations
if spec is not unset:
kwargs["spec"] = spec
super().__init__(kwargs)

self_.api_version = api_version
self_.kind = kind
self_.metadata = metadata
Loading