Skip to content

Commit f13f3ed

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit fc1fa35 of spec repo (#3670)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 19a51df commit f13f3ed

12 files changed

Lines changed: 348 additions & 0 deletions

File tree

.generator/schemas/v2/openapi.yaml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1780,6 +1780,14 @@ components:
17801780
required: false
17811781
schema:
17821782
type: boolean
1783+
SlackUserUuidQueryParameter:
1784+
description: The UUID of the Datadog user to list Slack bindings for.
1785+
in: query
1786+
name: user_uuid
1787+
required: true
1788+
schema:
1789+
format: uuid
1790+
type: string
17831791
SloID:
17841792
description: The ID of the SLO.
17851793
in: path
@@ -89039,6 +89047,37 @@ components:
8903989047
required:
8904089048
- slackTrigger
8904189049
type: object
89050+
SlackUserBindingData:
89051+
description: Slack team ID data from a response.
89052+
properties:
89053+
id:
89054+
description: The Slack team ID.
89055+
example: "T01234567"
89056+
type: string
89057+
type:
89058+
$ref: "#/components/schemas/SlackUserBindingType"
89059+
type: object
89060+
SlackUserBindingType:
89061+
default: team_id
89062+
description: Slack user binding resource type.
89063+
enum:
89064+
- team_id
89065+
example: team_id
89066+
type: string
89067+
x-enum-varnames:
89068+
- TEAM_ID
89069+
SlackUserBindingsResponse:
89070+
description: Response with a list of Slack user bindings.
89071+
properties:
89072+
data:
89073+
description: An array of Slack user bindings.
89074+
example: [{"id": "T01234567", "type": "team_id"}, {"id": "T09876543", "type": "team_id"}]
89075+
items:
89076+
$ref: "#/components/schemas/SlackUserBindingData"
89077+
type: array
89078+
required:
89079+
- data
89080+
type: object
8904289081
SloDataSource:
8904389082
default: slo
8904489083
description: A data source for SLO queries.
@@ -136401,6 +136440,36 @@ paths:
136401136440
summary: List ServiceNow users
136402136441
tags:
136403136442
- ServiceNow Integration
136443+
/api/v2/integration/slack/user-bindings:
136444+
get:
136445+
description: List all Slack user bindings for a given Datadog user from the Datadog Slack integration.
136446+
operationId: ListSlackUserBindings
136447+
parameters:
136448+
- $ref: "#/components/parameters/SlackUserUuidQueryParameter"
136449+
responses:
136450+
"200":
136451+
content:
136452+
application/json:
136453+
examples:
136454+
default:
136455+
value:
136456+
data:
136457+
- id: T01234567
136458+
type: team_id
136459+
- id: T09876543
136460+
type: team_id
136461+
schema:
136462+
$ref: "#/components/schemas/SlackUserBindingsResponse"
136463+
description: OK
136464+
"400":
136465+
$ref: "#/components/responses/BadRequestResponse"
136466+
"403":
136467+
$ref: "#/components/responses/ForbiddenResponse"
136468+
"429":
136469+
$ref: "#/components/responses/TooManyRequestsResponse"
136470+
summary: List Slack user bindings
136471+
tags:
136472+
- Slack Integration
136404136473
/api/v2/integration/statuspage/account:
136405136474
delete:
136406136475
description: Delete the Statuspage account configured for your organization.
@@ -186271,6 +186340,13 @@ tags:
186271186340
name: Service Level Objectives
186272186341
- description: Manage your ServiceNow Integration. ServiceNow is a cloud-based platform that helps organizations manage digital workflows for enterprise operations.
186273186342
name: ServiceNow Integration
186343+
- description: |-
186344+
Configure your [Datadog Slack integration](https://docs.datadoghq.com/integrations/slack/)
186345+
directly through the Datadog API.
186346+
externalDocs:
186347+
description: For more information about the Datadog Slack integration, see the integration page.
186348+
url: https://docs.datadoghq.com/integrations/slack/
186349+
name: Slack Integration
186274186350
- description: |-
186275186351
API to create, update, retrieve, and delete Software Catalog entities.
186276186352
externalDocs:

docs/datadog_api_client.v2.api.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -788,6 +788,13 @@ datadog\_api\_client.v2.api.service\_now\_integration\_api module
788788
:members:
789789
:show-inheritance:
790790

791+
datadog\_api\_client.v2.api.slack\_integration\_api module
792+
----------------------------------------------------------
793+
794+
.. automodule:: datadog_api_client.v2.api.slack_integration_api
795+
:members:
796+
:show-inheritance:
797+
791798
datadog\_api\_client.v2.api.software\_catalog\_api module
792799
---------------------------------------------------------
793800

docs/datadog_api_client.v2.model.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38287,6 +38287,27 @@ datadog\_api\_client.v2.model.slack\_trigger\_wrapper module
3828738287
:members:
3828838288
:show-inheritance:
3828938289

38290+
datadog\_api\_client.v2.model.slack\_user\_binding\_data module
38291+
---------------------------------------------------------------
38292+
38293+
.. automodule:: datadog_api_client.v2.model.slack_user_binding_data
38294+
:members:
38295+
:show-inheritance:
38296+
38297+
datadog\_api\_client.v2.model.slack\_user\_binding\_type module
38298+
---------------------------------------------------------------
38299+
38300+
.. automodule:: datadog_api_client.v2.model.slack_user_binding_type
38301+
:members:
38302+
:show-inheritance:
38303+
38304+
datadog\_api\_client.v2.model.slack\_user\_bindings\_response module
38305+
--------------------------------------------------------------------
38306+
38307+
.. automodule:: datadog_api_client.v2.model.slack_user_bindings_response
38308+
:members:
38309+
:show-inheritance:
38310+
3829038311
datadog\_api\_client.v2.model.slo\_data\_source module
3829138312
------------------------------------------------------
3829238313

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""
2+
List Slack user bindings returns "OK" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.slack_integration_api import SlackIntegrationApi
7+
from uuid import UUID
8+
9+
configuration = Configuration()
10+
with ApiClient(configuration) as api_client:
11+
api_instance = SlackIntegrationApi(api_client)
12+
response = api_instance.list_slack_user_bindings(
13+
user_uuid=UUID("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"),
14+
)
15+
16+
print(response)
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
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.model_utils import (
11+
UUID,
12+
)
13+
from datadog_api_client.v2.model.slack_user_bindings_response import SlackUserBindingsResponse
14+
15+
16+
class SlackIntegrationApi:
17+
"""
18+
Configure your `Datadog Slack integration <https://docs.datadoghq.com/integrations/slack/>`_
19+
directly through the Datadog API.
20+
"""
21+
22+
def __init__(self, api_client=None):
23+
if api_client is None:
24+
api_client = ApiClient(Configuration())
25+
self.api_client = api_client
26+
27+
self._list_slack_user_bindings_endpoint = _Endpoint(
28+
settings={
29+
"response_type": (SlackUserBindingsResponse,),
30+
"auth": ["apiKeyAuth", "appKeyAuth"],
31+
"endpoint_path": "/api/v2/integration/slack/user-bindings",
32+
"operation_id": "list_slack_user_bindings",
33+
"http_method": "GET",
34+
"version": "v2",
35+
},
36+
params_map={
37+
"user_uuid": {
38+
"required": True,
39+
"openapi_types": (UUID,),
40+
"attribute": "user_uuid",
41+
"location": "query",
42+
},
43+
},
44+
headers_map={
45+
"accept": ["application/json"],
46+
},
47+
api_client=api_client,
48+
)
49+
50+
def list_slack_user_bindings(
51+
self,
52+
user_uuid: UUID,
53+
) -> SlackUserBindingsResponse:
54+
"""List Slack user bindings.
55+
56+
List all Slack user bindings for a given Datadog user from the Datadog Slack integration.
57+
58+
:param user_uuid: The UUID of the Datadog user to list Slack bindings for.
59+
:type user_uuid: UUID
60+
:rtype: SlackUserBindingsResponse
61+
"""
62+
kwargs: Dict[str, Any] = {}
63+
kwargs["user_uuid"] = user_uuid
64+
65+
return self._list_slack_user_bindings_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
@@ -110,6 +110,7 @@
110110
from datadog_api_client.v2.api.service_definition_api import ServiceDefinitionApi
111111
from datadog_api_client.v2.api.service_level_objectives_api import ServiceLevelObjectivesApi
112112
from datadog_api_client.v2.api.service_now_integration_api import ServiceNowIntegrationApi
113+
from datadog_api_client.v2.api.slack_integration_api import SlackIntegrationApi
113114
from datadog_api_client.v2.api.software_catalog_api import SoftwareCatalogApi
114115
from datadog_api_client.v2.api.spa_api import SpaApi
115116
from datadog_api_client.v2.api.spans_api import SpansApi
@@ -243,6 +244,7 @@
243244
"ServiceDefinitionApi",
244245
"ServiceLevelObjectivesApi",
245246
"ServiceNowIntegrationApi",
247+
"SlackIntegrationApi",
246248
"SoftwareCatalogApi",
247249
"SpaApi",
248250
"SpansApi",
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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.slack_user_binding_type import SlackUserBindingType
18+
19+
20+
class SlackUserBindingData(ModelNormal):
21+
@cached_property
22+
def openapi_types(_):
23+
from datadog_api_client.v2.model.slack_user_binding_type import SlackUserBindingType
24+
25+
return {
26+
"id": (str,),
27+
"type": (SlackUserBindingType,),
28+
}
29+
30+
attribute_map = {
31+
"id": "id",
32+
"type": "type",
33+
}
34+
35+
def __init__(
36+
self_, id: Union[str, UnsetType] = unset, type: Union[SlackUserBindingType, UnsetType] = unset, **kwargs
37+
):
38+
"""
39+
Slack team ID data from a response.
40+
41+
:param id: The Slack team ID.
42+
:type id: str, optional
43+
44+
:param type: Slack user binding resource type.
45+
:type type: SlackUserBindingType, optional
46+
"""
47+
if id is not unset:
48+
kwargs["id"] = id
49+
if type is not unset:
50+
kwargs["type"] = type
51+
super().__init__(kwargs)
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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 SlackUserBindingType(ModelSimple):
16+
"""
17+
Slack user binding resource type.
18+
19+
:param value: If omitted defaults to "team_id". Must be one of ["team_id"].
20+
:type value: str
21+
"""
22+
23+
allowed_values = {
24+
"team_id",
25+
}
26+
TEAM_ID: ClassVar["SlackUserBindingType"]
27+
28+
@cached_property
29+
def openapi_types(_):
30+
return {
31+
"value": (str,),
32+
}
33+
34+
35+
SlackUserBindingType.TEAM_ID = SlackUserBindingType("team_id")
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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 List, TYPE_CHECKING
7+
8+
from datadog_api_client.model_utils import (
9+
ModelNormal,
10+
cached_property,
11+
)
12+
13+
14+
if TYPE_CHECKING:
15+
from datadog_api_client.v2.model.slack_user_binding_data import SlackUserBindingData
16+
17+
18+
class SlackUserBindingsResponse(ModelNormal):
19+
@cached_property
20+
def openapi_types(_):
21+
from datadog_api_client.v2.model.slack_user_binding_data import SlackUserBindingData
22+
23+
return {
24+
"data": ([SlackUserBindingData],),
25+
}
26+
27+
attribute_map = {
28+
"data": "data",
29+
}
30+
31+
def __init__(self_, data: List[SlackUserBindingData], **kwargs):
32+
"""
33+
Response with a list of Slack user bindings.
34+
35+
:param data: An array of Slack user bindings.
36+
:type data: [SlackUserBindingData]
37+
"""
38+
super().__init__(kwargs)
39+
40+
self_.data = data

src/datadog_api_client/v2/models/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7743,6 +7743,9 @@
77437743
from datadog_api_client.v2.model.slack_integration_metadata import SlackIntegrationMetadata
77447744
from datadog_api_client.v2.model.slack_integration_metadata_channel_item import SlackIntegrationMetadataChannelItem
77457745
from datadog_api_client.v2.model.slack_trigger_wrapper import SlackTriggerWrapper
7746+
from datadog_api_client.v2.model.slack_user_binding_data import SlackUserBindingData
7747+
from datadog_api_client.v2.model.slack_user_binding_type import SlackUserBindingType
7748+
from datadog_api_client.v2.model.slack_user_bindings_response import SlackUserBindingsResponse
77467749
from datadog_api_client.v2.model.slo_data_source import SloDataSource
77477750
from datadog_api_client.v2.model.slo_query import SloQuery
77487751
from datadog_api_client.v2.model.slo_report_create_request import SloReportCreateRequest
@@ -14600,6 +14603,9 @@
1460014603
"SlackIntegrationMetadata",
1460114604
"SlackIntegrationMetadataChannelItem",
1460214605
"SlackTriggerWrapper",
14606+
"SlackUserBindingData",
14607+
"SlackUserBindingType",
14608+
"SlackUserBindingsResponse",
1460314609
"SloDataSource",
1460414610
"SloQuery",
1460514611
"SloReportCreateRequest",

0 commit comments

Comments
 (0)