Skip to content

Add a new contact type in service catalog api for schema v2 and v2.1 #1398

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.4",
"regenerated": "2023-04-04 17:50:52.788705",
"spec_repo_commit": "9a7b22d0"
"regenerated": "2023-04-05 14:45:46.903755",
"spec_repo_commit": "627d5fdd"
},
"v2": {
"apigentools_version": "1.6.4",
"regenerated": "2023-04-04 17:50:52.800936",
"spec_repo_commit": "9a7b22d0"
"regenerated": "2023-04-05 14:45:46.915254",
"spec_repo_commit": "627d5fdd"
}
}
}
52 changes: 52 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12425,6 +12425,7 @@ components:
oneOf:
- $ref: '#/components/schemas/ServiceDefinitionV2Email'
- $ref: '#/components/schemas/ServiceDefinitionV2Slack'
- $ref: '#/components/schemas/ServiceDefinitionV2MSTeams'
ServiceDefinitionV2Doc:
description: Service documents.
properties:
Expand Down Expand Up @@ -12511,6 +12512,7 @@ components:
oneOf:
- $ref: '#/components/schemas/ServiceDefinitionV2Dot1Email'
- $ref: '#/components/schemas/ServiceDefinitionV2Dot1Slack'
- $ref: '#/components/schemas/ServiceDefinitionV2Dot1MSTeams'
ServiceDefinitionV2Dot1Email:
description: Service owner's email.
properties:
Expand Down Expand Up @@ -12583,6 +12585,31 @@ components:
- RUNBOOK
- DASHBOARD
- OTHER
ServiceDefinitionV2Dot1MSTeams:
description: Service owner's Microsoft Teams.
properties:
contact:
description: Contact value.
example: https://teams.microsoft.com/myteam
type: string
name:
description: Contact Microsoft Teams.
example: My team channel
type: string
type:
$ref: '#/components/schemas/ServiceDefinitionV2Dot1MSTeamsType'
required:
- type
- contact
type: object
ServiceDefinitionV2Dot1MSTeamsType:
description: Contact type.
enum:
- microsoft-teams
example: microsoft-teams
type: string
x-enum-varnames:
- MICROSOFT_TEAMS
ServiceDefinitionV2Dot1Opsgenie:
description: Opsgenie integration for the service.
properties:
Expand Down Expand Up @@ -12723,6 +12750,31 @@ components:
- ONCALL
- CODE
- LINK
ServiceDefinitionV2MSTeams:
description: Service owner's Microsoft Teams.
properties:
contact:
description: Contact value.
example: https://teams.microsoft.com/myteam
type: string
name:
description: Contact Microsoft Teams.
example: My team channel
type: string
type:
$ref: '#/components/schemas/ServiceDefinitionV2MSTeamsType'
required:
- type
- contact
type: object
ServiceDefinitionV2MSTeamsType:
description: Contact type.
enum:
- microsoft-teams
example: microsoft-teams
type: string
x-enum-varnames:
- MICROSOFT_TEAMS
ServiceDefinitionV2Opsgenie:
description: Opsgenie integration for the service.
properties:
Expand Down
28 changes: 28 additions & 0 deletions docs/datadog_api_client.v2.model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5783,6 +5783,20 @@ service\_definition\_v2\_dot1\_link\_type
:members:
:show-inheritance:

service\_definition\_v2\_dot1\_ms\_teams
----------------------------------------

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

service\_definition\_v2\_dot1\_ms\_teams\_type
----------------------------------------------

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

service\_definition\_v2\_dot1\_opsgenie
---------------------------------------

Expand Down Expand Up @@ -5853,6 +5867,20 @@ service\_definition\_v2\_link\_type
:members:
:show-inheritance:

service\_definition\_v2\_ms\_teams
----------------------------------

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

service\_definition\_v2\_ms\_teams\_type
----------------------------------------

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

service\_definition\_v2\_opsgenie
---------------------------------

Expand Down
11 changes: 10 additions & 1 deletion src/datadog_api_client/v2/model/service_definition_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from datadog_api_client.v2.model.service_definition_v2_version import ServiceDefinitionV2Version
from datadog_api_client.v2.model.service_definition_v2_email import ServiceDefinitionV2Email
from datadog_api_client.v2.model.service_definition_v2_slack import ServiceDefinitionV2Slack
from datadog_api_client.v2.model.service_definition_v2_ms_teams import ServiceDefinitionV2MSTeams


class ServiceDefinitionV2(ModelNormal):
Expand Down Expand Up @@ -84,7 +85,15 @@ def __init__(
dd_service: str,
schema_version: ServiceDefinitionV2Version,
contacts: Union[
List[Union[ServiceDefinitionV2Contact, ServiceDefinitionV2Email, ServiceDefinitionV2Slack]], UnsetType
List[
Union[
ServiceDefinitionV2Contact,
ServiceDefinitionV2Email,
ServiceDefinitionV2Slack,
ServiceDefinitionV2MSTeams,
]
],
UnsetType,
] = unset,
dd_team: Union[str, UnsetType] = unset,
docs: Union[List[ServiceDefinitionV2Doc], UnsetType] = unset,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,12 @@ def _composed_schemas(_):
# loading
from datadog_api_client.v2.model.service_definition_v2_email import ServiceDefinitionV2Email
from datadog_api_client.v2.model.service_definition_v2_slack import ServiceDefinitionV2Slack
from datadog_api_client.v2.model.service_definition_v2_ms_teams import ServiceDefinitionV2MSTeams

return {
"oneOf": [
ServiceDefinitionV2Email,
ServiceDefinitionV2Slack,
ServiceDefinitionV2MSTeams,
],
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from datadog_api_client.v2.model.service_definition_v2_dot1_version import ServiceDefinitionV2Dot1Version
from datadog_api_client.v2.model.service_definition_v2_dot1_email import ServiceDefinitionV2Dot1Email
from datadog_api_client.v2.model.service_definition_v2_dot1_slack import ServiceDefinitionV2Dot1Slack
from datadog_api_client.v2.model.service_definition_v2_dot1_ms_teams import ServiceDefinitionV2Dot1MSTeams


class ServiceDefinitionV2Dot1(ModelNormal):
Expand Down Expand Up @@ -85,7 +86,14 @@ def __init__(
schema_version: ServiceDefinitionV2Dot1Version,
application: Union[str, UnsetType] = unset,
contacts: Union[
List[Union[ServiceDefinitionV2Dot1Contact, ServiceDefinitionV2Dot1Email, ServiceDefinitionV2Dot1Slack]],
List[
Union[
ServiceDefinitionV2Dot1Contact,
ServiceDefinitionV2Dot1Email,
ServiceDefinitionV2Dot1Slack,
ServiceDefinitionV2Dot1MSTeams,
]
],
UnsetType,
] = unset,
description: Union[str, UnsetType] = unset,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,12 @@ def _composed_schemas(_):
# loading
from datadog_api_client.v2.model.service_definition_v2_dot1_email import ServiceDefinitionV2Dot1Email
from datadog_api_client.v2.model.service_definition_v2_dot1_slack import ServiceDefinitionV2Dot1Slack
from datadog_api_client.v2.model.service_definition_v2_dot1_ms_teams import ServiceDefinitionV2Dot1MSTeams

return {
"oneOf": [
ServiceDefinitionV2Dot1Email,
ServiceDefinitionV2Dot1Slack,
ServiceDefinitionV2Dot1MSTeams,
],
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# 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, TYPE_CHECKING

from datadog_api_client.model_utils import (
ModelNormal,
cached_property,
unset,
UnsetType,
)


if TYPE_CHECKING:
from datadog_api_client.v2.model.service_definition_v2_dot1_ms_teams_type import ServiceDefinitionV2Dot1MSTeamsType


class ServiceDefinitionV2Dot1MSTeams(ModelNormal):
@cached_property
def openapi_types(_):
from datadog_api_client.v2.model.service_definition_v2_dot1_ms_teams_type import (
ServiceDefinitionV2Dot1MSTeamsType,
)

return {
"contact": (str,),
"name": (str,),
"type": (ServiceDefinitionV2Dot1MSTeamsType,),
}

attribute_map = {
"contact": "contact",
"name": "name",
"type": "type",
}

def __init__(
self_, contact: str, type: ServiceDefinitionV2Dot1MSTeamsType, name: Union[str, UnsetType] = unset, **kwargs
):
"""
Service owner's Microsoft Teams.

:param contact: Contact value.
:type contact: str

:param name: Contact Microsoft Teams.
:type name: str, optional

:param type: Contact type.
:type type: ServiceDefinitionV2Dot1MSTeamsType
"""
if name is not unset:
kwargs["name"] = name
super().__init__(kwargs)

self_.contact = contact
self_.type = type
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# 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 datadog_api_client.model_utils import (
ModelSimple,
cached_property,
)

from typing import ClassVar


class ServiceDefinitionV2Dot1MSTeamsType(ModelSimple):
"""
Contact type.

:param value: If omitted defaults to "microsoft-teams". Must be one of ["microsoft-teams"].
:type value: str
"""

allowed_values = {
"microsoft-teams",
}
MICROSOFT_TEAMS: ClassVar["ServiceDefinitionV2Dot1MSTeamsType"]

@cached_property
def openapi_types(_):
return {
"value": (str,),
}


ServiceDefinitionV2Dot1MSTeamsType.MICROSOFT_TEAMS = ServiceDefinitionV2Dot1MSTeamsType("microsoft-teams")
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# 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, TYPE_CHECKING

from datadog_api_client.model_utils import (
ModelNormal,
cached_property,
unset,
UnsetType,
)


if TYPE_CHECKING:
from datadog_api_client.v2.model.service_definition_v2_ms_teams_type import ServiceDefinitionV2MSTeamsType


class ServiceDefinitionV2MSTeams(ModelNormal):
@cached_property
def openapi_types(_):
from datadog_api_client.v2.model.service_definition_v2_ms_teams_type import ServiceDefinitionV2MSTeamsType

return {
"contact": (str,),
"name": (str,),
"type": (ServiceDefinitionV2MSTeamsType,),
}

attribute_map = {
"contact": "contact",
"name": "name",
"type": "type",
}

def __init__(
self_, contact: str, type: ServiceDefinitionV2MSTeamsType, name: Union[str, UnsetType] = unset, **kwargs
):
"""
Service owner's Microsoft Teams.

:param contact: Contact value.
:type contact: str

:param name: Contact Microsoft Teams.
:type name: str, optional

:param type: Contact type.
:type type: ServiceDefinitionV2MSTeamsType
"""
if name is not unset:
kwargs["name"] = name
super().__init__(kwargs)

self_.contact = contact
self_.type = type
Loading