Skip to content

Commit 390616f

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add domain allowlist endpoints (#2224)
* Regenerate client from commit 755120dd of spec repo * pre-commit fixes --------- Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 2373179 commit 390616f

22 files changed

+773
-4
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2024-10-29 20:46:31.911807",
8-
"spec_repo_commit": "c0b9551e"
7+
"regenerated": "2024-10-30 18:58:09.364885",
8+
"spec_repo_commit": "755120dd"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-10-29 20:46:31.929951",
13-
"spec_repo_commit": "c0b9551e"
12+
"regenerated": "2024-10-30 18:58:09.383086",
13+
"spec_repo_commit": "755120dd"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7115,6 +7115,81 @@ components:
71157115
description: The type of the resource. The value should always be device.
71167116
type: string
71177117
type: object
7118+
DomainAllowlist:
7119+
description: The email domain allowlist for an org.
7120+
properties:
7121+
attributes:
7122+
$ref: '#/components/schemas/DomainAllowlistAttributes'
7123+
id:
7124+
description: The unique identifier of the org.
7125+
nullable: true
7126+
type: string
7127+
type:
7128+
$ref: '#/components/schemas/DomainAllowlistType'
7129+
required:
7130+
- type
7131+
type: object
7132+
DomainAllowlistAttributes:
7133+
description: The details of the email domain allowlist.
7134+
properties:
7135+
domains:
7136+
description: The list of domains in the email domain allowlist.
7137+
items:
7138+
type: string
7139+
type: array
7140+
enabled:
7141+
description: Whether the email domain allowlist is enabled for the org.
7142+
type: boolean
7143+
type: object
7144+
DomainAllowlistRequest:
7145+
description: Request containing the desired email domain allowlist configuration.
7146+
properties:
7147+
data:
7148+
$ref: '#/components/schemas/DomainAllowlist'
7149+
required:
7150+
- data
7151+
type: object
7152+
DomainAllowlistResponse:
7153+
description: Response containing information about the email domain allowlist.
7154+
properties:
7155+
data:
7156+
$ref: '#/components/schemas/DomainAllowlistResponseData'
7157+
type: object
7158+
DomainAllowlistResponseData:
7159+
description: The email domain allowlist response for an org.
7160+
properties:
7161+
attributes:
7162+
$ref: '#/components/schemas/DomainAllowlistResponseDataAttributes'
7163+
id:
7164+
description: The unique identifier of the org.
7165+
nullable: true
7166+
type: string
7167+
type:
7168+
$ref: '#/components/schemas/DomainAllowlistType'
7169+
required:
7170+
- type
7171+
type: object
7172+
DomainAllowlistResponseDataAttributes:
7173+
description: The details of the email domain allowlist.
7174+
properties:
7175+
domains:
7176+
description: The list of domains in the email domain allowlist.
7177+
items:
7178+
type: string
7179+
type: array
7180+
enabled:
7181+
description: Whether the email domain allowlist is enabled for the org.
7182+
type: boolean
7183+
type: object
7184+
DomainAllowlistType:
7185+
default: domain_allowlist
7186+
description: Email domain allowlist allowlist type.
7187+
enum:
7188+
- domain_allowlist
7189+
example: domain_allowlist
7190+
type: string
7191+
x-enum-varnames:
7192+
- DOMAIN_ALLOWLIST
71187193
DowntimeCreateRequest:
71197194
description: Request for creating a downtime.
71207195
properties:
@@ -29433,6 +29508,61 @@ paths:
2943329508
tags:
2943429509
- Dashboard Lists
2943529510
x-codegen-request-body-name: body
29511+
/api/v2/domain_allowlist:
29512+
get:
29513+
description: Get the domain allowlist for an organization.
29514+
operationId: GetDomainAllowlist
29515+
responses:
29516+
'200':
29517+
content:
29518+
application/json:
29519+
schema:
29520+
$ref: '#/components/schemas/DomainAllowlistResponse'
29521+
description: OK
29522+
'429':
29523+
$ref: '#/components/responses/TooManyRequestsResponse'
29524+
security:
29525+
- apiKeyAuth: []
29526+
appKeyAuth: []
29527+
- AuthZ:
29528+
- org_management
29529+
summary: Get Domain Allowlist
29530+
tags:
29531+
- Domain Allowlist
29532+
x-permission:
29533+
operator: OR
29534+
permissions:
29535+
- org_management
29536+
patch:
29537+
description: Update the domain allowlist for an organization.
29538+
operationId: PatchDomainAllowlist
29539+
requestBody:
29540+
content:
29541+
application/json:
29542+
schema:
29543+
$ref: '#/components/schemas/DomainAllowlistRequest'
29544+
required: true
29545+
responses:
29546+
'200':
29547+
content:
29548+
application/json:
29549+
schema:
29550+
$ref: '#/components/schemas/DomainAllowlistResponse'
29551+
description: OK
29552+
'429':
29553+
$ref: '#/components/responses/TooManyRequestsResponse'
29554+
security:
29555+
- apiKeyAuth: []
29556+
appKeyAuth: []
29557+
- AuthZ:
29558+
- org_management
29559+
summary: Sets Domain Allowlist
29560+
tags:
29561+
- Domain Allowlist
29562+
x-permission:
29563+
operator: OR
29564+
permissions:
29565+
- org_management
2943629566
/api/v2/dora/deployment:
2943729567
post:
2943829568
description: 'Use this API endpoint to provide data about deployments for DORA
@@ -41786,6 +41916,14 @@ tags:
4178641916

4178741917
organization.'
4178841918
name: Dashboard Lists
41919+
- description: 'Configure your Datadog Email Domain Allowlist directly through the
41920+
Datadog API.
41921+
41922+
The Email Domain Allowlist controls the domains that certain datadog emails can
41923+
be sent to.
41924+
41925+
For more information, see the [Domain Allowlist docs page](https://docs.datadoghq.com/account_management/org_settings/domain_allowlist)'
41926+
name: Domain Allowlist
4178941927
- description: '**Note**: Downtime V2 is currently in private beta. To request access,
4179041928
contact [Datadog support](https://docs.datadoghq.com/help/).
4179141929

docs/datadog_api_client.v2.api.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,13 @@ datadog\_api\_client.v2.api.dashboard\_lists\_api module
102102
:members:
103103
:show-inheritance:
104104

105+
datadog\_api\_client.v2.api.domain\_allowlist\_api module
106+
---------------------------------------------------------
107+
108+
.. automodule:: datadog_api_client.v2.api.domain_allowlist_api
109+
:members:
110+
:show-inheritance:
111+
105112
datadog\_api\_client.v2.api.dora\_metrics\_api module
106113
-----------------------------------------------------
107114

docs/datadog_api_client.v2.model.rst

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2678,6 +2678,55 @@ datadog\_api\_client.v2.model.devices\_list\_data module
26782678
:members:
26792679
:show-inheritance:
26802680

2681+
datadog\_api\_client.v2.model.domain\_allowlist module
2682+
------------------------------------------------------
2683+
2684+
.. automodule:: datadog_api_client.v2.model.domain_allowlist
2685+
:members:
2686+
:show-inheritance:
2687+
2688+
datadog\_api\_client.v2.model.domain\_allowlist\_attributes module
2689+
------------------------------------------------------------------
2690+
2691+
.. automodule:: datadog_api_client.v2.model.domain_allowlist_attributes
2692+
:members:
2693+
:show-inheritance:
2694+
2695+
datadog\_api\_client.v2.model.domain\_allowlist\_request module
2696+
---------------------------------------------------------------
2697+
2698+
.. automodule:: datadog_api_client.v2.model.domain_allowlist_request
2699+
:members:
2700+
:show-inheritance:
2701+
2702+
datadog\_api\_client.v2.model.domain\_allowlist\_response module
2703+
----------------------------------------------------------------
2704+
2705+
.. automodule:: datadog_api_client.v2.model.domain_allowlist_response
2706+
:members:
2707+
:show-inheritance:
2708+
2709+
datadog\_api\_client.v2.model.domain\_allowlist\_response\_data module
2710+
----------------------------------------------------------------------
2711+
2712+
.. automodule:: datadog_api_client.v2.model.domain_allowlist_response_data
2713+
:members:
2714+
:show-inheritance:
2715+
2716+
datadog\_api\_client.v2.model.domain\_allowlist\_response\_data\_attributes module
2717+
----------------------------------------------------------------------------------
2718+
2719+
.. automodule:: datadog_api_client.v2.model.domain_allowlist_response_data_attributes
2720+
:members:
2721+
:show-inheritance:
2722+
2723+
datadog\_api\_client.v2.model.domain\_allowlist\_type module
2724+
------------------------------------------------------------
2725+
2726+
.. automodule:: datadog_api_client.v2.model.domain_allowlist_type
2727+
:members:
2728+
:show-inheritance:
2729+
26812730
datadog\_api\_client.v2.model.dora\_deployment\_request module
26822731
--------------------------------------------------------------
26832732

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
"""
2+
Get Domain Allowlist returns "OK" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.domain_allowlist_api import DomainAllowlistApi
7+
8+
configuration = Configuration()
9+
with ApiClient(configuration) as api_client:
10+
api_instance = DomainAllowlistApi(api_client)
11+
response = api_instance.get_domain_allowlist()
12+
13+
print(response)
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
"""
2+
Sets Domain Allowlist returns "OK" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.domain_allowlist_api import DomainAllowlistApi
7+
from datadog_api_client.v2.model.domain_allowlist import DomainAllowlist
8+
from datadog_api_client.v2.model.domain_allowlist_attributes import DomainAllowlistAttributes
9+
from datadog_api_client.v2.model.domain_allowlist_request import DomainAllowlistRequest
10+
from datadog_api_client.v2.model.domain_allowlist_type import DomainAllowlistType
11+
12+
body = DomainAllowlistRequest(
13+
data=DomainAllowlist(
14+
attributes=DomainAllowlistAttributes(
15+
domains=[
16+
"@static-test-domain.test",
17+
],
18+
enabled=False,
19+
),
20+
type=DomainAllowlistType.DOMAIN_ALLOWLIST,
21+
),
22+
)
23+
24+
configuration = Configuration()
25+
with ApiClient(configuration) as api_client:
26+
api_instance = DomainAllowlistApi(api_client)
27+
response = api_instance.patch_domain_allowlist(body=body)
28+
29+
print(response)
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
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.v2.model.domain_allowlist_response import DomainAllowlistResponse
11+
from datadog_api_client.v2.model.domain_allowlist_request import DomainAllowlistRequest
12+
13+
14+
class DomainAllowlistApi:
15+
"""
16+
Configure your Datadog Email Domain Allowlist directly through the Datadog API.
17+
The Email Domain Allowlist controls the domains that certain datadog emails can be sent to.
18+
For more information, see the `Domain Allowlist docs page <https://docs.datadoghq.com/account_management/org_settings/domain_allowlist>`_
19+
"""
20+
21+
def __init__(self, api_client=None):
22+
if api_client is None:
23+
api_client = ApiClient(Configuration())
24+
self.api_client = api_client
25+
26+
self._get_domain_allowlist_endpoint = _Endpoint(
27+
settings={
28+
"response_type": (DomainAllowlistResponse,),
29+
"auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"],
30+
"endpoint_path": "/api/v2/domain_allowlist",
31+
"operation_id": "get_domain_allowlist",
32+
"http_method": "GET",
33+
"version": "v2",
34+
},
35+
params_map={},
36+
headers_map={
37+
"accept": ["application/json"],
38+
},
39+
api_client=api_client,
40+
)
41+
42+
self._patch_domain_allowlist_endpoint = _Endpoint(
43+
settings={
44+
"response_type": (DomainAllowlistResponse,),
45+
"auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"],
46+
"endpoint_path": "/api/v2/domain_allowlist",
47+
"operation_id": "patch_domain_allowlist",
48+
"http_method": "PATCH",
49+
"version": "v2",
50+
},
51+
params_map={
52+
"body": {
53+
"required": True,
54+
"openapi_types": (DomainAllowlistRequest,),
55+
"location": "body",
56+
},
57+
},
58+
headers_map={"accept": ["application/json"], "content_type": ["application/json"]},
59+
api_client=api_client,
60+
)
61+
62+
def get_domain_allowlist(
63+
self,
64+
) -> DomainAllowlistResponse:
65+
"""Get Domain Allowlist.
66+
67+
Get the domain allowlist for an organization.
68+
69+
:rtype: DomainAllowlistResponse
70+
"""
71+
kwargs: Dict[str, Any] = {}
72+
return self._get_domain_allowlist_endpoint.call_with_http_info(**kwargs)
73+
74+
def patch_domain_allowlist(
75+
self,
76+
body: DomainAllowlistRequest,
77+
) -> DomainAllowlistResponse:
78+
"""Sets Domain Allowlist.
79+
80+
Update the domain allowlist for an organization.
81+
82+
:type body: DomainAllowlistRequest
83+
:rtype: DomainAllowlistResponse
84+
"""
85+
kwargs: Dict[str, Any] = {}
86+
kwargs["body"] = body
87+
88+
return self._patch_domain_allowlist_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
@@ -13,6 +13,7 @@
1313
from datadog_api_client.v2.api.containers_api import ContainersApi
1414
from datadog_api_client.v2.api.dora_metrics_api import DORAMetricsApi
1515
from datadog_api_client.v2.api.dashboard_lists_api import DashboardListsApi
16+
from datadog_api_client.v2.api.domain_allowlist_api import DomainAllowlistApi
1617
from datadog_api_client.v2.api.downtimes_api import DowntimesApi
1718
from datadog_api_client.v2.api.events_api import EventsApi
1819
from datadog_api_client.v2.api.fastly_integration_api import FastlyIntegrationApi
@@ -70,6 +71,7 @@
7071
"ContainersApi",
7172
"DORAMetricsApi",
7273
"DashboardListsApi",
74+
"DomainAllowlistApi",
7375
"DowntimesApi",
7476
"EventsApi",
7577
"FastlyIntegrationApi",

0 commit comments

Comments
 (0)