Skip to content

Commit 39eabf7

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): update via SDK Studio (#291)
1 parent c6c81d4 commit 39eabf7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+335
-236
lines changed

src/cloudflare/resources/intel/attack_surface_report/issues.py

+68-68
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@
2626
make_request_options,
2727
)
2828
from ....types.intel.attack_surface_report import (
29-
Product,
30-
Subject,
31-
IssueType,
32-
IssueClass,
29+
ProductParam,
30+
SubjectParam,
31+
IssueTypeParam,
32+
IssueClassParam,
3333
IssueListResponse,
3434
IssueTypeResponse,
3535
IssueClassResponse,
@@ -60,18 +60,18 @@ def list(
6060
*,
6161
account_id: str,
6262
dismissed: bool | NotGiven = NOT_GIVEN,
63-
issue_class: List[IssueClass] | NotGiven = NOT_GIVEN,
64-
issue_class_neq: List[IssueClass] | NotGiven = NOT_GIVEN,
65-
issue_type: List[IssueType] | NotGiven = NOT_GIVEN,
66-
issue_type_neq: List[IssueType] | NotGiven = NOT_GIVEN,
63+
issue_class: IssueClassParam | NotGiven = NOT_GIVEN,
64+
issue_class_neq: IssueClassParam | NotGiven = NOT_GIVEN,
65+
issue_type: IssueTypeParam | NotGiven = NOT_GIVEN,
66+
issue_type_neq: IssueTypeParam | NotGiven = NOT_GIVEN,
6767
page: int | NotGiven = NOT_GIVEN,
6868
per_page: int | NotGiven = NOT_GIVEN,
69-
product: List[Product] | NotGiven = NOT_GIVEN,
70-
product_neq: List[Product] | NotGiven = NOT_GIVEN,
69+
product: ProductParam | NotGiven = NOT_GIVEN,
70+
product_neq: ProductParam | NotGiven = NOT_GIVEN,
7171
severity: List[SeverityQueryParam] | NotGiven = NOT_GIVEN,
7272
severity_neq: List[SeverityQueryParam] | NotGiven = NOT_GIVEN,
73-
subject: List[Subject] | NotGiven = NOT_GIVEN,
74-
subject_neq: List[Subject] | NotGiven = NOT_GIVEN,
73+
subject: SubjectParam | NotGiven = NOT_GIVEN,
74+
subject_neq: SubjectParam | NotGiven = NOT_GIVEN,
7575
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
7676
# The extra values given here take precedence over values defined on the client or passed to this method.
7777
extra_headers: Headers | None = None,
@@ -134,16 +134,16 @@ def class_(
134134
*,
135135
account_id: str,
136136
dismissed: bool | NotGiven = NOT_GIVEN,
137-
issue_class: List[IssueClass] | NotGiven = NOT_GIVEN,
138-
issue_class_neq: List[IssueClass] | NotGiven = NOT_GIVEN,
139-
issue_type: List[IssueType] | NotGiven = NOT_GIVEN,
140-
issue_type_neq: List[IssueType] | NotGiven = NOT_GIVEN,
141-
product: List[Product] | NotGiven = NOT_GIVEN,
142-
product_neq: List[Product] | NotGiven = NOT_GIVEN,
137+
issue_class: IssueClassParam | NotGiven = NOT_GIVEN,
138+
issue_class_neq: IssueClassParam | NotGiven = NOT_GIVEN,
139+
issue_type: IssueTypeParam | NotGiven = NOT_GIVEN,
140+
issue_type_neq: IssueTypeParam | NotGiven = NOT_GIVEN,
141+
product: ProductParam | NotGiven = NOT_GIVEN,
142+
product_neq: ProductParam | NotGiven = NOT_GIVEN,
143143
severity: List[SeverityQueryParam] | NotGiven = NOT_GIVEN,
144144
severity_neq: List[SeverityQueryParam] | NotGiven = NOT_GIVEN,
145-
subject: List[Subject] | NotGiven = NOT_GIVEN,
146-
subject_neq: List[Subject] | NotGiven = NOT_GIVEN,
145+
subject: SubjectParam | NotGiven = NOT_GIVEN,
146+
subject_neq: SubjectParam | NotGiven = NOT_GIVEN,
147147
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
148148
# The extra values given here take precedence over values defined on the client or passed to this method.
149149
extra_headers: Headers | None = None,
@@ -249,16 +249,16 @@ def severity(
249249
*,
250250
account_id: str,
251251
dismissed: bool | NotGiven = NOT_GIVEN,
252-
issue_class: List[IssueClass] | NotGiven = NOT_GIVEN,
253-
issue_class_neq: List[IssueClass] | NotGiven = NOT_GIVEN,
254-
issue_type: List[IssueType] | NotGiven = NOT_GIVEN,
255-
issue_type_neq: List[IssueType] | NotGiven = NOT_GIVEN,
256-
product: List[Product] | NotGiven = NOT_GIVEN,
257-
product_neq: List[Product] | NotGiven = NOT_GIVEN,
252+
issue_class: IssueClassParam | NotGiven = NOT_GIVEN,
253+
issue_class_neq: IssueClassParam | NotGiven = NOT_GIVEN,
254+
issue_type: IssueTypeParam | NotGiven = NOT_GIVEN,
255+
issue_type_neq: IssueTypeParam | NotGiven = NOT_GIVEN,
256+
product: ProductParam | NotGiven = NOT_GIVEN,
257+
product_neq: ProductParam | NotGiven = NOT_GIVEN,
258258
severity: List[SeverityQueryParam] | NotGiven = NOT_GIVEN,
259259
severity_neq: List[SeverityQueryParam] | NotGiven = NOT_GIVEN,
260-
subject: List[Subject] | NotGiven = NOT_GIVEN,
261-
subject_neq: List[Subject] | NotGiven = NOT_GIVEN,
260+
subject: SubjectParam | NotGiven = NOT_GIVEN,
261+
subject_neq: SubjectParam | NotGiven = NOT_GIVEN,
262262
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
263263
# The extra values given here take precedence over values defined on the client or passed to this method.
264264
extra_headers: Headers | None = None,
@@ -315,16 +315,16 @@ def type(
315315
*,
316316
account_id: str,
317317
dismissed: bool | NotGiven = NOT_GIVEN,
318-
issue_class: List[IssueClass] | NotGiven = NOT_GIVEN,
319-
issue_class_neq: List[IssueClass] | NotGiven = NOT_GIVEN,
320-
issue_type: List[IssueType] | NotGiven = NOT_GIVEN,
321-
issue_type_neq: List[IssueType] | NotGiven = NOT_GIVEN,
322-
product: List[Product] | NotGiven = NOT_GIVEN,
323-
product_neq: List[Product] | NotGiven = NOT_GIVEN,
318+
issue_class: IssueClassParam | NotGiven = NOT_GIVEN,
319+
issue_class_neq: IssueClassParam | NotGiven = NOT_GIVEN,
320+
issue_type: IssueTypeParam | NotGiven = NOT_GIVEN,
321+
issue_type_neq: IssueTypeParam | NotGiven = NOT_GIVEN,
322+
product: ProductParam | NotGiven = NOT_GIVEN,
323+
product_neq: ProductParam | NotGiven = NOT_GIVEN,
324324
severity: List[SeverityQueryParam] | NotGiven = NOT_GIVEN,
325325
severity_neq: List[SeverityQueryParam] | NotGiven = NOT_GIVEN,
326-
subject: List[Subject] | NotGiven = NOT_GIVEN,
327-
subject_neq: List[Subject] | NotGiven = NOT_GIVEN,
326+
subject: SubjectParam | NotGiven = NOT_GIVEN,
327+
subject_neq: SubjectParam | NotGiven = NOT_GIVEN,
328328
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
329329
# The extra values given here take precedence over values defined on the client or passed to this method.
330330
extra_headers: Headers | None = None,
@@ -391,18 +391,18 @@ def list(
391391
*,
392392
account_id: str,
393393
dismissed: bool | NotGiven = NOT_GIVEN,
394-
issue_class: List[IssueClass] | NotGiven = NOT_GIVEN,
395-
issue_class_neq: List[IssueClass] | NotGiven = NOT_GIVEN,
396-
issue_type: List[IssueType] | NotGiven = NOT_GIVEN,
397-
issue_type_neq: List[IssueType] | NotGiven = NOT_GIVEN,
394+
issue_class: IssueClassParam | NotGiven = NOT_GIVEN,
395+
issue_class_neq: IssueClassParam | NotGiven = NOT_GIVEN,
396+
issue_type: IssueTypeParam | NotGiven = NOT_GIVEN,
397+
issue_type_neq: IssueTypeParam | NotGiven = NOT_GIVEN,
398398
page: int | NotGiven = NOT_GIVEN,
399399
per_page: int | NotGiven = NOT_GIVEN,
400-
product: List[Product] | NotGiven = NOT_GIVEN,
401-
product_neq: List[Product] | NotGiven = NOT_GIVEN,
400+
product: ProductParam | NotGiven = NOT_GIVEN,
401+
product_neq: ProductParam | NotGiven = NOT_GIVEN,
402402
severity: List[SeverityQueryParam] | NotGiven = NOT_GIVEN,
403403
severity_neq: List[SeverityQueryParam] | NotGiven = NOT_GIVEN,
404-
subject: List[Subject] | NotGiven = NOT_GIVEN,
405-
subject_neq: List[Subject] | NotGiven = NOT_GIVEN,
404+
subject: SubjectParam | NotGiven = NOT_GIVEN,
405+
subject_neq: SubjectParam | NotGiven = NOT_GIVEN,
406406
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
407407
# The extra values given here take precedence over values defined on the client or passed to this method.
408408
extra_headers: Headers | None = None,
@@ -465,16 +465,16 @@ async def class_(
465465
*,
466466
account_id: str,
467467
dismissed: bool | NotGiven = NOT_GIVEN,
468-
issue_class: List[IssueClass] | NotGiven = NOT_GIVEN,
469-
issue_class_neq: List[IssueClass] | NotGiven = NOT_GIVEN,
470-
issue_type: List[IssueType] | NotGiven = NOT_GIVEN,
471-
issue_type_neq: List[IssueType] | NotGiven = NOT_GIVEN,
472-
product: List[Product] | NotGiven = NOT_GIVEN,
473-
product_neq: List[Product] | NotGiven = NOT_GIVEN,
468+
issue_class: IssueClassParam | NotGiven = NOT_GIVEN,
469+
issue_class_neq: IssueClassParam | NotGiven = NOT_GIVEN,
470+
issue_type: IssueTypeParam | NotGiven = NOT_GIVEN,
471+
issue_type_neq: IssueTypeParam | NotGiven = NOT_GIVEN,
472+
product: ProductParam | NotGiven = NOT_GIVEN,
473+
product_neq: ProductParam | NotGiven = NOT_GIVEN,
474474
severity: List[SeverityQueryParam] | NotGiven = NOT_GIVEN,
475475
severity_neq: List[SeverityQueryParam] | NotGiven = NOT_GIVEN,
476-
subject: List[Subject] | NotGiven = NOT_GIVEN,
477-
subject_neq: List[Subject] | NotGiven = NOT_GIVEN,
476+
subject: SubjectParam | NotGiven = NOT_GIVEN,
477+
subject_neq: SubjectParam | NotGiven = NOT_GIVEN,
478478
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
479479
# The extra values given here take precedence over values defined on the client or passed to this method.
480480
extra_headers: Headers | None = None,
@@ -580,16 +580,16 @@ async def severity(
580580
*,
581581
account_id: str,
582582
dismissed: bool | NotGiven = NOT_GIVEN,
583-
issue_class: List[IssueClass] | NotGiven = NOT_GIVEN,
584-
issue_class_neq: List[IssueClass] | NotGiven = NOT_GIVEN,
585-
issue_type: List[IssueType] | NotGiven = NOT_GIVEN,
586-
issue_type_neq: List[IssueType] | NotGiven = NOT_GIVEN,
587-
product: List[Product] | NotGiven = NOT_GIVEN,
588-
product_neq: List[Product] | NotGiven = NOT_GIVEN,
583+
issue_class: IssueClassParam | NotGiven = NOT_GIVEN,
584+
issue_class_neq: IssueClassParam | NotGiven = NOT_GIVEN,
585+
issue_type: IssueTypeParam | NotGiven = NOT_GIVEN,
586+
issue_type_neq: IssueTypeParam | NotGiven = NOT_GIVEN,
587+
product: ProductParam | NotGiven = NOT_GIVEN,
588+
product_neq: ProductParam | NotGiven = NOT_GIVEN,
589589
severity: List[SeverityQueryParam] | NotGiven = NOT_GIVEN,
590590
severity_neq: List[SeverityQueryParam] | NotGiven = NOT_GIVEN,
591-
subject: List[Subject] | NotGiven = NOT_GIVEN,
592-
subject_neq: List[Subject] | NotGiven = NOT_GIVEN,
591+
subject: SubjectParam | NotGiven = NOT_GIVEN,
592+
subject_neq: SubjectParam | NotGiven = NOT_GIVEN,
593593
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
594594
# The extra values given here take precedence over values defined on the client or passed to this method.
595595
extra_headers: Headers | None = None,
@@ -646,16 +646,16 @@ async def type(
646646
*,
647647
account_id: str,
648648
dismissed: bool | NotGiven = NOT_GIVEN,
649-
issue_class: List[IssueClass] | NotGiven = NOT_GIVEN,
650-
issue_class_neq: List[IssueClass] | NotGiven = NOT_GIVEN,
651-
issue_type: List[IssueType] | NotGiven = NOT_GIVEN,
652-
issue_type_neq: List[IssueType] | NotGiven = NOT_GIVEN,
653-
product: List[Product] | NotGiven = NOT_GIVEN,
654-
product_neq: List[Product] | NotGiven = NOT_GIVEN,
649+
issue_class: IssueClassParam | NotGiven = NOT_GIVEN,
650+
issue_class_neq: IssueClassParam | NotGiven = NOT_GIVEN,
651+
issue_type: IssueTypeParam | NotGiven = NOT_GIVEN,
652+
issue_type_neq: IssueTypeParam | NotGiven = NOT_GIVEN,
653+
product: ProductParam | NotGiven = NOT_GIVEN,
654+
product_neq: ProductParam | NotGiven = NOT_GIVEN,
655655
severity: List[SeverityQueryParam] | NotGiven = NOT_GIVEN,
656656
severity_neq: List[SeverityQueryParam] | NotGiven = NOT_GIVEN,
657-
subject: List[Subject] | NotGiven = NOT_GIVEN,
658-
subject_neq: List[Subject] | NotGiven = NOT_GIVEN,
657+
subject: SubjectParam | NotGiven = NOT_GIVEN,
658+
subject_neq: SubjectParam | NotGiven = NOT_GIVEN,
659659
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
660660
# The extra values given here take precedence over values defined on the client or passed to this method.
661661
extra_headers: Headers | None = None,

src/cloudflare/resources/rulesets/phases/phases.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import Type, Iterable, cast
5+
from typing import Type, cast
66
from typing_extensions import Literal
77

88
import httpx
@@ -79,7 +79,7 @@ def update(
7979
"magic_transit_managed",
8080
],
8181
*,
82-
rules: Iterable[RequestRuleParam],
82+
rules: RequestRuleParam,
8383
account_id: str | NotGiven = NOT_GIVEN,
8484
zone_id: str | NotGiven = NOT_GIVEN,
8585
description: str | NotGiven = NOT_GIVEN,
@@ -312,7 +312,7 @@ async def update(
312312
"magic_transit_managed",
313313
],
314314
*,
315-
rules: Iterable[RequestRuleParam],
315+
rules: RequestRuleParam,
316316
account_id: str | NotGiven = NOT_GIVEN,
317317
zone_id: str | NotGiven = NOT_GIVEN,
318318
description: str | NotGiven = NOT_GIVEN,

src/cloudflare/resources/rulesets/rulesets.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import Type, Iterable, cast
5+
from typing import Type, cast
66
from typing_extensions import Literal
77

88
import httpx
@@ -116,7 +116,7 @@ def create(
116116
"magic_transit_ids_managed",
117117
"magic_transit_managed",
118118
],
119-
rules: Iterable[RequestRuleParam],
119+
rules: RequestRuleParam,
120120
account_id: str | NotGiven = NOT_GIVEN,
121121
zone_id: str | NotGiven = NOT_GIVEN,
122122
description: str | NotGiven = NOT_GIVEN,
@@ -194,7 +194,7 @@ def update(
194194
self,
195195
ruleset_id: str,
196196
*,
197-
rules: Iterable[RequestRuleParam],
197+
rules: RequestRuleParam,
198198
account_id: str | NotGiven = NOT_GIVEN,
199199
zone_id: str | NotGiven = NOT_GIVEN,
200200
description: str | NotGiven = NOT_GIVEN,
@@ -521,7 +521,7 @@ async def create(
521521
"magic_transit_ids_managed",
522522
"magic_transit_managed",
523523
],
524-
rules: Iterable[RequestRuleParam],
524+
rules: RequestRuleParam,
525525
account_id: str | NotGiven = NOT_GIVEN,
526526
zone_id: str | NotGiven = NOT_GIVEN,
527527
description: str | NotGiven = NOT_GIVEN,
@@ -599,7 +599,7 @@ async def update(
599599
self,
600600
ruleset_id: str,
601601
*,
602-
rules: Iterable[RequestRuleParam],
602+
rules: RequestRuleParam,
603603
account_id: str | NotGiven = NOT_GIVEN,
604604
zone_id: str | NotGiven = NOT_GIVEN,
605605
description: str | NotGiven = NOT_GIVEN,

src/cloudflare/types/configuration.py

+15-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,24 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3+
from typing_extensions import Literal
4+
35
from .._models import BaseModel
46

57
__all__ = ["Configuration"]
68

79

810
class Configuration(BaseModel):
9-
password: str
10-
"""The password required to access your origin database.
11+
database: str
12+
"""The name of your origin database."""
13+
14+
host: str
15+
"""The host (hostname or IP) of your origin database."""
16+
17+
port: int
18+
"""The port (default: 5432 for Postgres) of your origin database."""
19+
20+
scheme: Literal["postgres", "postgresql", "mysql"]
21+
"""Specifies the URL scheme used to connect to your origin database."""
1122

12-
This value is write-only and never returned by the API.
13-
"""
23+
user: str
24+
"""The user of your origin database."""

src/cloudflare/types/configuration_param.py

+14-5
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,23 @@
22

33
from __future__ import annotations
44

5-
from typing_extensions import Required, TypedDict
5+
from typing_extensions import Literal, Required, TypedDict
66

77
__all__ = ["ConfigurationParam"]
88

99

1010
class ConfigurationParam(TypedDict, total=False):
11-
password: Required[str]
12-
"""The password required to access your origin database.
11+
database: Required[str]
12+
"""The name of your origin database."""
1313

14-
This value is write-only and never returned by the API.
15-
"""
14+
host: Required[str]
15+
"""The host (hostname or IP) of your origin database."""
16+
17+
port: Required[int]
18+
"""The port (default: 5432 for Postgres) of your origin database."""
19+
20+
scheme: Required[Literal["postgres", "postgresql", "mysql"]]
21+
"""Specifies the URL scheme used to connect to your origin database."""
22+
23+
user: Required[str]
24+
"""The user of your origin database."""

src/cloudflare/types/hyperdrive/hyperdrive.py

+25-3
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,32 @@
33
from typing import Optional
44

55
from ..._models import BaseModel
6+
from ..configuration import Configuration
67

7-
__all__ = ["Hyperdrive"]
8+
__all__ = ["Hyperdrive", "Caching"]
9+
10+
11+
class Caching(BaseModel):
12+
disabled: Optional[bool] = None
13+
"""When set to true, disables the caching of SQL responses. (Default: false)"""
14+
15+
max_age: Optional[int] = None
16+
"""When present, specifies max duration for which items should persist in the
17+
cache.
18+
19+
(Default: 60)
20+
"""
21+
22+
stale_while_revalidate: Optional[int] = None
23+
"""
24+
When present, indicates the number of seconds cache may serve the response after
25+
it becomes stale. (Default: 15)
26+
"""
827

928

1029
class Hyperdrive(BaseModel):
11-
id: Optional[str] = None
12-
"""Identifier"""
30+
caching: Optional[Caching] = None
31+
32+
name: Optional[str] = None
33+
34+
origin: Optional[Configuration] = None

src/cloudflare/types/intel/attack_surface_report/__init__.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
from __future__ import annotations
44

5-
from .product import Product as Product
6-
from .subject import Subject as Subject
7-
from .issue_type import IssueType as IssueType
8-
from .issue_class import IssueClass as IssueClass
5+
from .product_param import ProductParam as ProductParam
6+
from .subject_param import SubjectParam as SubjectParam
7+
from .issue_type_param import IssueTypeParam as IssueTypeParam
8+
from .issue_class_param import IssueClassParam as IssueClassParam
99
from .issue_list_params import IssueListParams as IssueListParams
1010
from .issue_type_params import IssueTypeParams as IssueTypeParams
1111
from .issue_class_params import IssueClassParams as IssueClassParams

0 commit comments

Comments
 (0)