Skip to content

Add missing service definition fields #1578

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.5",
"regenerated": "2023-07-13 21:23:39.298296",
"spec_repo_commit": "70f8c389"
"regenerated": "2023-07-14 13:32:03.152627",
"spec_repo_commit": "2bd58701"
},
"v2": {
"apigentools_version": "1.6.5",
"regenerated": "2023-07-13 21:23:39.311523",
"spec_repo_commit": "70f8c389"
"regenerated": "2023-07-14 13:32:03.246638",
"spec_repo_commit": "2bd58701"
}
}
}
27 changes: 27 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14217,6 +14217,9 @@ components:
properties:
attributes:
$ref: '#/components/schemas/ServiceDefinitionDataAttributes'
id:
description: Service definition id.
type: string
type:
description: Service definition type.
type: string
Expand Down Expand Up @@ -14250,6 +14253,30 @@ components:
last-modified-time:
description: Last modified time of the service definition.
type: string
origin:
description: User defined origin of the service definition.
type: string
origin-detail:
description: User defined origin's detail of the service definition.
type: string
warnings:
description: A list of schema validation warnings.
items:
$ref: '#/components/schemas/ServiceDefinitionMetaWarnings'
type: array
type: object
ServiceDefinitionMetaWarnings:
description: Schema validation warnings.
properties:
instance-location:
description: The warning instance location.
type: string
keyword-location:
description: The warning keyword location.
type: string
message:
description: The warning message.
type: string
type: object
ServiceDefinitionRaw:
description: Service Definition in raw JSON/YAML representation.
Expand Down
7 changes: 7 additions & 0 deletions docs/datadog_api_client.v2.model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6413,6 +6413,13 @@ service\_definition\_meta
:members:
:show-inheritance:

service\_definition\_meta\_warnings
-----------------------------------

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

service\_definition\_schema
---------------------------

Expand Down
8 changes: 8 additions & 0 deletions src/datadog_api_client/v2/model/service_definition_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,20 @@ def openapi_types(_):

return {
"attributes": (ServiceDefinitionDataAttributes,),
"id": (str,),
"type": (str,),
}

attribute_map = {
"attributes": "attributes",
"id": "id",
"type": "type",
}

def __init__(
self_,
attributes: Union[ServiceDefinitionDataAttributes, UnsetType] = unset,
id: Union[str, UnsetType] = unset,
type: Union[str, UnsetType] = unset,
**kwargs,
):
Expand All @@ -44,11 +47,16 @@ def __init__(
:param attributes: Service definition attributes.
:type attributes: ServiceDefinitionDataAttributes, optional

:param id: Service definition id.
:type id: str, optional

:param type: Service definition type.
:type type: str, optional
"""
if attributes is not unset:
kwargs["attributes"] = attributes
if id is not unset:
kwargs["id"] = id
if type is not unset:
kwargs["type"] = type
super().__init__(kwargs)
32 changes: 31 additions & 1 deletion src/datadog_api_client/v2/model/service_definition_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Copyright 2019-Present Datadog, Inc.
from __future__ import annotations

from typing import Union
from typing import List, Union, TYPE_CHECKING

from datadog_api_client.model_utils import (
ModelNormal,
Expand All @@ -13,21 +13,33 @@
)


if TYPE_CHECKING:
from datadog_api_client.v2.model.service_definition_meta_warnings import ServiceDefinitionMetaWarnings


class ServiceDefinitionMeta(ModelNormal):
@cached_property
def openapi_types(_):
from datadog_api_client.v2.model.service_definition_meta_warnings import ServiceDefinitionMetaWarnings

return {
"github_html_url": (str,),
"ingested_schema_version": (str,),
"ingestion_source": (str,),
"last_modified_time": (str,),
"origin": (str,),
"origin_detail": (str,),
"warnings": ([ServiceDefinitionMetaWarnings],),
}

attribute_map = {
"github_html_url": "github-html-url",
"ingested_schema_version": "ingested-schema-version",
"ingestion_source": "ingestion-source",
"last_modified_time": "last-modified-time",
"origin": "origin",
"origin_detail": "origin-detail",
"warnings": "warnings",
}

def __init__(
Expand All @@ -36,6 +48,9 @@ def __init__(
ingested_schema_version: Union[str, UnsetType] = unset,
ingestion_source: Union[str, UnsetType] = unset,
last_modified_time: Union[str, UnsetType] = unset,
origin: Union[str, UnsetType] = unset,
origin_detail: Union[str, UnsetType] = unset,
warnings: Union[List[ServiceDefinitionMetaWarnings], UnsetType] = unset,
**kwargs,
):
"""
Expand All @@ -52,6 +67,15 @@ def __init__(

:param last_modified_time: Last modified time of the service definition.
:type last_modified_time: str, optional

:param origin: User defined origin of the service definition.
:type origin: str, optional

:param origin_detail: User defined origin's detail of the service definition.
:type origin_detail: str, optional

:param warnings: A list of schema validation warnings.
:type warnings: [ServiceDefinitionMetaWarnings], optional
"""
if github_html_url is not unset:
kwargs["github_html_url"] = github_html_url
Expand All @@ -61,4 +85,10 @@ def __init__(
kwargs["ingestion_source"] = ingestion_source
if last_modified_time is not unset:
kwargs["last_modified_time"] = last_modified_time
if origin is not unset:
kwargs["origin"] = origin
if origin_detail is not unset:
kwargs["origin_detail"] = origin_detail
if warnings is not unset:
kwargs["warnings"] = warnings
super().__init__(kwargs)
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# 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 ServiceDefinitionMetaWarnings(ModelNormal):
@cached_property
def openapi_types(_):
return {
"instance_location": (str,),
"keyword_location": (str,),
"message": (str,),
}

attribute_map = {
"instance_location": "instance-location",
"keyword_location": "keyword-location",
"message": "message",
}

def __init__(
self_,
instance_location: Union[str, UnsetType] = unset,
keyword_location: Union[str, UnsetType] = unset,
message: Union[str, UnsetType] = unset,
**kwargs,
):
"""
Schema validation warnings.

:param instance_location: The warning instance location.
:type instance_location: str, optional

:param keyword_location: The warning keyword location.
:type keyword_location: str, optional

:param message: The warning message.
:type message: str, optional
"""
if instance_location is not unset:
kwargs["instance_location"] = instance_location
if keyword_location is not unset:
kwargs["keyword_location"] = keyword_location
if message is not unset:
kwargs["message"] = message
super().__init__(kwargs)
2 changes: 2 additions & 0 deletions src/datadog_api_client/v2/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1136,6 +1136,7 @@
from datadog_api_client.v2.model.service_definition_data_attributes import ServiceDefinitionDataAttributes
from datadog_api_client.v2.model.service_definition_get_response import ServiceDefinitionGetResponse
from datadog_api_client.v2.model.service_definition_meta import ServiceDefinitionMeta
from datadog_api_client.v2.model.service_definition_meta_warnings import ServiceDefinitionMetaWarnings
from datadog_api_client.v2.model.service_definition_schema import ServiceDefinitionSchema
from datadog_api_client.v2.model.service_definition_schema_versions import ServiceDefinitionSchemaVersions
from datadog_api_client.v2.model.service_definition_v1 import ServiceDefinitionV1
Expand Down Expand Up @@ -2253,6 +2254,7 @@
"ServiceDefinitionDataAttributes",
"ServiceDefinitionGetResponse",
"ServiceDefinitionMeta",
"ServiceDefinitionMetaWarnings",
"ServiceDefinitionSchema",
"ServiceDefinitionSchemaVersions",
"ServiceDefinitionV1",
Expand Down