Skip to content

Commit 614b85d

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 150ace98 of spec repo
1 parent 9d8bd29 commit 614b85d

File tree

27 files changed

+202
-64
lines changed

27 files changed

+202
-64
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-01-08 16:03:17.520602",
8-
"spec_repo_commit": "8b5aed97"
7+
"regenerated": "2024-01-08 19:23:25.412666",
8+
"spec_repo_commit": "150ace98"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-01-08 16:03:17.535558",
13-
"spec_repo_commit": "8b5aed97"
12+
"regenerated": "2024-01-08 19:23:25.429398",
13+
"spec_repo_commit": "150ace98"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3776,6 +3776,22 @@ components:
37763776
description: The name of the Cloudflare account.
37773777
example: test-name
37783778
type: string
3779+
resources:
3780+
description: An allowlist of resources to restrict pulling metrics for.
3781+
example:
3782+
- web
3783+
- dns
3784+
items:
3785+
type: string
3786+
type: array
3787+
zones:
3788+
description: An allowlist of zones to restrict pulling metrics for.
3789+
example:
3790+
- zone_id_1
3791+
- zone_id_2
3792+
items:
3793+
type: string
3794+
type: array
37793795
required:
37803796
- api_key
37813797
- name
@@ -3808,6 +3824,22 @@ components:
38083824
description: The name of the Cloudflare account.
38093825
example: test-name
38103826
type: string
3827+
resources:
3828+
description: An allowlist of resources to restrict pulling metrics for.
3829+
example:
3830+
- web
3831+
- dns
3832+
items:
3833+
type: string
3834+
type: array
3835+
zones:
3836+
description: An allowlist of zones to restrict pulling metrics for.
3837+
example:
3838+
- zone_id_1
3839+
- zone_id_2
3840+
items:
3841+
type: string
3842+
type: array
38113843
required:
38123844
- name
38133845
type: object
@@ -3856,6 +3888,22 @@ components:
38563888
key is provided (and not a token), this field is also required.
38573889
38583890
type: string
3891+
resources:
3892+
description: An allowlist of resources to restrict pulling metrics for.
3893+
example:
3894+
- web
3895+
- dns
3896+
items:
3897+
type: string
3898+
type: array
3899+
zones:
3900+
description: An allowlist of zones to restrict pulling metrics for.
3901+
example:
3902+
- zone_id_1
3903+
- zone_id_2
3904+
items:
3905+
type: string
3906+
type: array
38593907
required:
38603908
- api_key
38613909
type: object

examples/v2/cloudflare-integration/CreateCloudflareAccount.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
data=CloudflareAccountCreateRequestData(
1616
attributes=CloudflareAccountCreateRequestAttributes(
1717
api_key="fakekey",
18-
email="new@email",
18+
1919
name="examplecloudflareintegration",
2020
),
2121
type=CloudflareAccountType.CLOUDFLARE_ACCOUNTS,

examples/v2/cloudflare-integration/UpdateCloudflareAccount.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@
1919
data=CloudflareAccountUpdateRequestData(
2020
attributes=CloudflareAccountUpdateRequestAttributes(
2121
api_key="fakekey",
22-
email="new@email",
22+
23+
zones=[
24+
"zone-id-3",
25+
],
2326
),
2427
type=CloudflareAccountType.CLOUDFLARE_ACCOUNTS,
2528
),

src/datadog_api_client/v2/model/cloudflare_account_create_request_attributes.py

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Copyright 2019-Present Datadog, Inc.
44
from __future__ import annotations
55

6-
from typing import Union
6+
from typing import List, Union
77

88
from datadog_api_client.model_utils import (
99
ModelNormal,
@@ -20,15 +20,27 @@ def openapi_types(_):
2020
"api_key": (str,),
2121
"email": (str,),
2222
"name": (str,),
23+
"resources": ([str],),
24+
"zones": ([str],),
2325
}
2426

2527
attribute_map = {
2628
"api_key": "api_key",
2729
"email": "email",
2830
"name": "name",
31+
"resources": "resources",
32+
"zones": "zones",
2933
}
3034

31-
def __init__(self_, api_key: str, name: str, email: Union[str, UnsetType] = unset, **kwargs):
35+
def __init__(
36+
self_,
37+
api_key: str,
38+
name: str,
39+
email: Union[str, UnsetType] = unset,
40+
resources: Union[List[str], UnsetType] = unset,
41+
zones: Union[List[str], UnsetType] = unset,
42+
**kwargs,
43+
):
3244
"""
3345
Attributes object for creating a Cloudflare account.
3446
@@ -40,9 +52,19 @@ def __init__(self_, api_key: str, name: str, email: Union[str, UnsetType] = unse
4052
4153
:param name: The name of the Cloudflare account.
4254
:type name: str
55+
56+
:param resources: An allowlist of resources to restrict pulling metrics for.
57+
:type resources: [str], optional
58+
59+
:param zones: An allowlist of zones to restrict pulling metrics for.
60+
:type zones: [str], optional
4361
"""
4462
if email is not unset:
4563
kwargs["email"] = email
64+
if resources is not unset:
65+
kwargs["resources"] = resources
66+
if zones is not unset:
67+
kwargs["zones"] = zones
4668
super().__init__(kwargs)
4769

4870
self_.api_key = api_key

src/datadog_api_client/v2/model/cloudflare_account_response_attributes.py

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Copyright 2019-Present Datadog, Inc.
44
from __future__ import annotations
55

6-
from typing import Union
6+
from typing import List, Union
77

88
from datadog_api_client.model_utils import (
99
ModelNormal,
@@ -19,14 +19,25 @@ def openapi_types(_):
1919
return {
2020
"email": (str,),
2121
"name": (str,),
22+
"resources": ([str],),
23+
"zones": ([str],),
2224
}
2325

2426
attribute_map = {
2527
"email": "email",
2628
"name": "name",
29+
"resources": "resources",
30+
"zones": "zones",
2731
}
2832

29-
def __init__(self_, name: str, email: Union[str, UnsetType] = unset, **kwargs):
33+
def __init__(
34+
self_,
35+
name: str,
36+
email: Union[str, UnsetType] = unset,
37+
resources: Union[List[str], UnsetType] = unset,
38+
zones: Union[List[str], UnsetType] = unset,
39+
**kwargs,
40+
):
3041
"""
3142
Attributes object of a Cloudflare account.
3243
@@ -35,9 +46,19 @@ def __init__(self_, name: str, email: Union[str, UnsetType] = unset, **kwargs):
3546
3647
:param name: The name of the Cloudflare account.
3748
:type name: str
49+
50+
:param resources: An allowlist of resources to restrict pulling metrics for.
51+
:type resources: [str], optional
52+
53+
:param zones: An allowlist of zones to restrict pulling metrics for.
54+
:type zones: [str], optional
3855
"""
3956
if email is not unset:
4057
kwargs["email"] = email
58+
if resources is not unset:
59+
kwargs["resources"] = resources
60+
if zones is not unset:
61+
kwargs["zones"] = zones
4162
super().__init__(kwargs)
4263

4364
self_.name = name

src/datadog_api_client/v2/model/cloudflare_account_update_request_attributes.py

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Copyright 2019-Present Datadog, Inc.
44
from __future__ import annotations
55

6-
from typing import Union
6+
from typing import List, Union
77

88
from datadog_api_client.model_utils import (
99
ModelNormal,
@@ -19,14 +19,25 @@ def openapi_types(_):
1919
return {
2020
"api_key": (str,),
2121
"email": (str,),
22+
"resources": ([str],),
23+
"zones": ([str],),
2224
}
2325

2426
attribute_map = {
2527
"api_key": "api_key",
2628
"email": "email",
29+
"resources": "resources",
30+
"zones": "zones",
2731
}
2832

29-
def __init__(self_, api_key: str, email: Union[str, UnsetType] = unset, **kwargs):
33+
def __init__(
34+
self_,
35+
api_key: str,
36+
email: Union[str, UnsetType] = unset,
37+
resources: Union[List[str], UnsetType] = unset,
38+
zones: Union[List[str], UnsetType] = unset,
39+
**kwargs,
40+
):
3041
"""
3142
Attributes object for updating a Cloudflare account.
3243
@@ -35,9 +46,19 @@ def __init__(self_, api_key: str, email: Union[str, UnsetType] = unset, **kwargs
3546
3647
:param email: The email associated with the Cloudflare account. If an API key is provided (and not a token), this field is also required.
3748
:type email: str, optional
49+
50+
:param resources: An allowlist of resources to restrict pulling metrics for.
51+
:type resources: [str], optional
52+
53+
:param zones: An allowlist of zones to restrict pulling metrics for.
54+
:type zones: [str], optional
3855
"""
3956
if email is not unset:
4057
kwargs["email"] = email
58+
if resources is not unset:
59+
kwargs["resources"] = resources
60+
if zones is not unset:
61+
kwargs["zones"] = zones
4162
super().__init__(kwargs)
4263

4364
self_.api_key = api_key
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2023-01-26T10:55:04.225Z
1+
2024-01-04T18:40:40.939Z

tests/v2/cassettes/test_scenarios/test_add_cloudflare_account_returns_bad_request_response_due_to_missing_email.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
interactions:
22
- request:
3-
body: '{"data":{"attributes":{"api_key":"test-api-key","name":"testaddcloudflareaccountreturnsbadrequestresponseduetomissingemail1674730504"},"type":"cloudflare-accounts"}}'
3+
body: '{"data":{"attributes":{"api_key":"fakekey","name":"testaddcloudflareaccountreturnsbadrequestresponseduetomissingemail1704393640"},"type":"cloudflare-accounts"}}'
44
headers:
55
accept:
66
- application/json
@@ -10,7 +10,7 @@ interactions:
1010
uri: https://api.datadoghq.com/api/v2/integrations/cloudflare/accounts
1111
response:
1212
body:
13-
string: '{"errors":["{u''_schema'': [''Email address is required if providing
13+
string: '{"errors":["{''_schema'': [''Email address is required if providing
1414
an api key and not an api token.'']}"]}'
1515
headers:
1616
content-type:
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2023-01-26T10:54:47.296Z
1+
2024-01-04T18:40:41.099Z

tests/v2/cassettes/test_scenarios/test_add_cloudflare_account_returns_bad_request_response_using_invalid_auth_key.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
interactions:
22
- request:
3-
body: '{"data":{"attributes":{"api_key":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","name":"testaddcloudflareaccountreturnsbadrequestresponseusinginvalidauthkey1674730487"},"type":"cloudflare-accounts"}}'
3+
body: '{"data":{"attributes":{"api_key":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","name":"testaddcloudflareaccountreturnsbadrequestresponseusinginvalidauthkey1704393641"},"type":"cloudflare-accounts"}}'
44
headers:
55
accept:
66
- application/json
@@ -11,7 +11,7 @@ interactions:
1111
response:
1212
body:
1313
string: '{"errors":["Invalid account. Your Cloudflare configuration is invalid.
14-
Impossible to get zones for the account testaddcloudflareaccountreturnsbadrequestresponseusinginvalidauthkey1674730487:
14+
Impossible to get zones for the account testaddcloudflareaccountreturnsbadrequestresponseusinginvalidauthkey1704393641:
1515
API key or email is unknown."]}'
1616
headers:
1717
content-type:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2023-01-26T10:54:24.725Z
1+
2024-01-04T18:40:41.520Z

tests/v2/cassettes/test_scenarios/test_add_cloudflare_account_returns_created_response.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
interactions:
22
- request:
3-
body: '{"data":{"attributes":{"api_key":"fakekey","email":"new@email","name":"testaddcloudflareaccountreturnscreatedresponse1674730464"},"type":"cloudflare-accounts"}}'
3+
body: '{"data":{"attributes":{"api_key":"fakekey","email":"[email protected]","name":"testaddcloudflareaccountreturnscreatedresponse1704393641"},"type":"cloudflare-accounts"}}'
44
headers:
55
accept:
66
- application/json
@@ -10,7 +10,7 @@ interactions:
1010
uri: https://api.datadoghq.com/api/v2/integrations/cloudflare/accounts
1111
response:
1212
body:
13-
string: '{"data":{"attributes":{"email":"new@email","name":"testaddcloudflareaccountreturnscreatedresponse1674730464"},"type":"cloudflare-accounts","id":"328432a98957fd7bcba6f70daea72519"}}
13+
string: '{"data":{"type":"cloudflare-accounts","attributes":{"email":"[email protected]","name":"testaddcloudflareaccountreturnscreatedresponse1704393641","resources":[],"zones":[]},"id":"baa2079200095466b080d75adfdb32fa"}}
1414
1515
'
1616
headers:
@@ -25,7 +25,7 @@ interactions:
2525
accept:
2626
- '*/*'
2727
method: DELETE
28-
uri: https://api.datadoghq.com/api/v2/integrations/cloudflare/accounts/328432a98957fd7bcba6f70daea72519
28+
uri: https://api.datadoghq.com/api/v2/integrations/cloudflare/accounts/baa2079200095466b080d75adfdb32fa
2929
response:
3030
body:
3131
string: ''
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2024-01-03T19:17:37.850Z
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
interactions:
2+
- request:
3+
body: '{"data":{"attributes":{"api_key":"fakekey","email":"new@email","name":"testaddcloudflareaccountreturnscreatedresponsewithoptionalfilters1704309457","resources":["lb","dns"],"zones":["zone-id-1","zone-id-2"]},"type":"cloudflare-accounts"}}'
4+
headers:
5+
accept:
6+
- application/json
7+
content-type:
8+
- application/json
9+
method: POST
10+
uri: https://api.datadoghq.com/api/v2/integrations/cloudflare/accounts
11+
response:
12+
body:
13+
string: '{"errors":["Invalid account. Your Cloudflare configuration is invalid.
14+
Impossible to get zones for the account testaddcloudflareaccountreturnscreatedresponsewithoptionalfilters1704309457:
15+
API key or email is not in the correct format."]}'
16+
headers:
17+
content-type:
18+
- application/json
19+
status:
20+
code: 400
21+
message: Bad Request
22+
version: 1
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2023-01-27T09:00:21.006Z
1+
2024-01-04T18:40:42.323Z

0 commit comments

Comments
 (0)