-
Notifications
You must be signed in to change notification settings - Fork 48
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
api-clients-generation-pipeline
merged 1 commit into
master
from
datadog-api-spec/generated/3374
Feb 3, 2025
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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_, | ||
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 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔴 Code Quality Violation
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