Skip to content

Commit

Permalink
feat(api): update via SDK Studio (#291)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Apr 22, 2024
1 parent c6c81d4 commit 39eabf7
Show file tree
Hide file tree
Showing 51 changed files with 335 additions and 236 deletions.
136 changes: 68 additions & 68 deletions src/cloudflare/resources/intel/attack_surface_report/issues.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
make_request_options,
)
from ....types.intel.attack_surface_report import (
Product,
Subject,
IssueType,
IssueClass,
ProductParam,
SubjectParam,
IssueTypeParam,
IssueClassParam,
IssueListResponse,
IssueTypeResponse,
IssueClassResponse,
Expand Down Expand Up @@ -60,18 +60,18 @@ def list(
*,
account_id: str,
dismissed: bool | NotGiven = NOT_GIVEN,
issue_class: List[IssueClass] | NotGiven = NOT_GIVEN,
issue_class_neq: List[IssueClass] | NotGiven = NOT_GIVEN,
issue_type: List[IssueType] | NotGiven = NOT_GIVEN,
issue_type_neq: List[IssueType] | NotGiven = NOT_GIVEN,
issue_class: IssueClassParam | NotGiven = NOT_GIVEN,
issue_class_neq: IssueClassParam | NotGiven = NOT_GIVEN,
issue_type: IssueTypeParam | NotGiven = NOT_GIVEN,
issue_type_neq: IssueTypeParam | NotGiven = NOT_GIVEN,
page: int | NotGiven = NOT_GIVEN,
per_page: int | NotGiven = NOT_GIVEN,
product: List[Product] | NotGiven = NOT_GIVEN,
product_neq: List[Product] | NotGiven = NOT_GIVEN,
product: ProductParam | NotGiven = NOT_GIVEN,
product_neq: ProductParam | NotGiven = NOT_GIVEN,
severity: List[SeverityQueryParam] | NotGiven = NOT_GIVEN,
severity_neq: List[SeverityQueryParam] | NotGiven = NOT_GIVEN,
subject: List[Subject] | NotGiven = NOT_GIVEN,
subject_neq: List[Subject] | NotGiven = NOT_GIVEN,
subject: SubjectParam | NotGiven = NOT_GIVEN,
subject_neq: SubjectParam | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -134,16 +134,16 @@ def class_(
*,
account_id: str,
dismissed: bool | NotGiven = NOT_GIVEN,
issue_class: List[IssueClass] | NotGiven = NOT_GIVEN,
issue_class_neq: List[IssueClass] | NotGiven = NOT_GIVEN,
issue_type: List[IssueType] | NotGiven = NOT_GIVEN,
issue_type_neq: List[IssueType] | NotGiven = NOT_GIVEN,
product: List[Product] | NotGiven = NOT_GIVEN,
product_neq: List[Product] | NotGiven = NOT_GIVEN,
issue_class: IssueClassParam | NotGiven = NOT_GIVEN,
issue_class_neq: IssueClassParam | NotGiven = NOT_GIVEN,
issue_type: IssueTypeParam | NotGiven = NOT_GIVEN,
issue_type_neq: IssueTypeParam | NotGiven = NOT_GIVEN,
product: ProductParam | NotGiven = NOT_GIVEN,
product_neq: ProductParam | NotGiven = NOT_GIVEN,
severity: List[SeverityQueryParam] | NotGiven = NOT_GIVEN,
severity_neq: List[SeverityQueryParam] | NotGiven = NOT_GIVEN,
subject: List[Subject] | NotGiven = NOT_GIVEN,
subject_neq: List[Subject] | NotGiven = NOT_GIVEN,
subject: SubjectParam | NotGiven = NOT_GIVEN,
subject_neq: SubjectParam | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -249,16 +249,16 @@ def severity(
*,
account_id: str,
dismissed: bool | NotGiven = NOT_GIVEN,
issue_class: List[IssueClass] | NotGiven = NOT_GIVEN,
issue_class_neq: List[IssueClass] | NotGiven = NOT_GIVEN,
issue_type: List[IssueType] | NotGiven = NOT_GIVEN,
issue_type_neq: List[IssueType] | NotGiven = NOT_GIVEN,
product: List[Product] | NotGiven = NOT_GIVEN,
product_neq: List[Product] | NotGiven = NOT_GIVEN,
issue_class: IssueClassParam | NotGiven = NOT_GIVEN,
issue_class_neq: IssueClassParam | NotGiven = NOT_GIVEN,
issue_type: IssueTypeParam | NotGiven = NOT_GIVEN,
issue_type_neq: IssueTypeParam | NotGiven = NOT_GIVEN,
product: ProductParam | NotGiven = NOT_GIVEN,
product_neq: ProductParam | NotGiven = NOT_GIVEN,
severity: List[SeverityQueryParam] | NotGiven = NOT_GIVEN,
severity_neq: List[SeverityQueryParam] | NotGiven = NOT_GIVEN,
subject: List[Subject] | NotGiven = NOT_GIVEN,
subject_neq: List[Subject] | NotGiven = NOT_GIVEN,
subject: SubjectParam | NotGiven = NOT_GIVEN,
subject_neq: SubjectParam | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -315,16 +315,16 @@ def type(
*,
account_id: str,
dismissed: bool | NotGiven = NOT_GIVEN,
issue_class: List[IssueClass] | NotGiven = NOT_GIVEN,
issue_class_neq: List[IssueClass] | NotGiven = NOT_GIVEN,
issue_type: List[IssueType] | NotGiven = NOT_GIVEN,
issue_type_neq: List[IssueType] | NotGiven = NOT_GIVEN,
product: List[Product] | NotGiven = NOT_GIVEN,
product_neq: List[Product] | NotGiven = NOT_GIVEN,
issue_class: IssueClassParam | NotGiven = NOT_GIVEN,
issue_class_neq: IssueClassParam | NotGiven = NOT_GIVEN,
issue_type: IssueTypeParam | NotGiven = NOT_GIVEN,
issue_type_neq: IssueTypeParam | NotGiven = NOT_GIVEN,
product: ProductParam | NotGiven = NOT_GIVEN,
product_neq: ProductParam | NotGiven = NOT_GIVEN,
severity: List[SeverityQueryParam] | NotGiven = NOT_GIVEN,
severity_neq: List[SeverityQueryParam] | NotGiven = NOT_GIVEN,
subject: List[Subject] | NotGiven = NOT_GIVEN,
subject_neq: List[Subject] | NotGiven = NOT_GIVEN,
subject: SubjectParam | NotGiven = NOT_GIVEN,
subject_neq: SubjectParam | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -391,18 +391,18 @@ def list(
*,
account_id: str,
dismissed: bool | NotGiven = NOT_GIVEN,
issue_class: List[IssueClass] | NotGiven = NOT_GIVEN,
issue_class_neq: List[IssueClass] | NotGiven = NOT_GIVEN,
issue_type: List[IssueType] | NotGiven = NOT_GIVEN,
issue_type_neq: List[IssueType] | NotGiven = NOT_GIVEN,
issue_class: IssueClassParam | NotGiven = NOT_GIVEN,
issue_class_neq: IssueClassParam | NotGiven = NOT_GIVEN,
issue_type: IssueTypeParam | NotGiven = NOT_GIVEN,
issue_type_neq: IssueTypeParam | NotGiven = NOT_GIVEN,
page: int | NotGiven = NOT_GIVEN,
per_page: int | NotGiven = NOT_GIVEN,
product: List[Product] | NotGiven = NOT_GIVEN,
product_neq: List[Product] | NotGiven = NOT_GIVEN,
product: ProductParam | NotGiven = NOT_GIVEN,
product_neq: ProductParam | NotGiven = NOT_GIVEN,
severity: List[SeverityQueryParam] | NotGiven = NOT_GIVEN,
severity_neq: List[SeverityQueryParam] | NotGiven = NOT_GIVEN,
subject: List[Subject] | NotGiven = NOT_GIVEN,
subject_neq: List[Subject] | NotGiven = NOT_GIVEN,
subject: SubjectParam | NotGiven = NOT_GIVEN,
subject_neq: SubjectParam | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -465,16 +465,16 @@ async def class_(
*,
account_id: str,
dismissed: bool | NotGiven = NOT_GIVEN,
issue_class: List[IssueClass] | NotGiven = NOT_GIVEN,
issue_class_neq: List[IssueClass] | NotGiven = NOT_GIVEN,
issue_type: List[IssueType] | NotGiven = NOT_GIVEN,
issue_type_neq: List[IssueType] | NotGiven = NOT_GIVEN,
product: List[Product] | NotGiven = NOT_GIVEN,
product_neq: List[Product] | NotGiven = NOT_GIVEN,
issue_class: IssueClassParam | NotGiven = NOT_GIVEN,
issue_class_neq: IssueClassParam | NotGiven = NOT_GIVEN,
issue_type: IssueTypeParam | NotGiven = NOT_GIVEN,
issue_type_neq: IssueTypeParam | NotGiven = NOT_GIVEN,
product: ProductParam | NotGiven = NOT_GIVEN,
product_neq: ProductParam | NotGiven = NOT_GIVEN,
severity: List[SeverityQueryParam] | NotGiven = NOT_GIVEN,
severity_neq: List[SeverityQueryParam] | NotGiven = NOT_GIVEN,
subject: List[Subject] | NotGiven = NOT_GIVEN,
subject_neq: List[Subject] | NotGiven = NOT_GIVEN,
subject: SubjectParam | NotGiven = NOT_GIVEN,
subject_neq: SubjectParam | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -580,16 +580,16 @@ async def severity(
*,
account_id: str,
dismissed: bool | NotGiven = NOT_GIVEN,
issue_class: List[IssueClass] | NotGiven = NOT_GIVEN,
issue_class_neq: List[IssueClass] | NotGiven = NOT_GIVEN,
issue_type: List[IssueType] | NotGiven = NOT_GIVEN,
issue_type_neq: List[IssueType] | NotGiven = NOT_GIVEN,
product: List[Product] | NotGiven = NOT_GIVEN,
product_neq: List[Product] | NotGiven = NOT_GIVEN,
issue_class: IssueClassParam | NotGiven = NOT_GIVEN,
issue_class_neq: IssueClassParam | NotGiven = NOT_GIVEN,
issue_type: IssueTypeParam | NotGiven = NOT_GIVEN,
issue_type_neq: IssueTypeParam | NotGiven = NOT_GIVEN,
product: ProductParam | NotGiven = NOT_GIVEN,
product_neq: ProductParam | NotGiven = NOT_GIVEN,
severity: List[SeverityQueryParam] | NotGiven = NOT_GIVEN,
severity_neq: List[SeverityQueryParam] | NotGiven = NOT_GIVEN,
subject: List[Subject] | NotGiven = NOT_GIVEN,
subject_neq: List[Subject] | NotGiven = NOT_GIVEN,
subject: SubjectParam | NotGiven = NOT_GIVEN,
subject_neq: SubjectParam | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -646,16 +646,16 @@ async def type(
*,
account_id: str,
dismissed: bool | NotGiven = NOT_GIVEN,
issue_class: List[IssueClass] | NotGiven = NOT_GIVEN,
issue_class_neq: List[IssueClass] | NotGiven = NOT_GIVEN,
issue_type: List[IssueType] | NotGiven = NOT_GIVEN,
issue_type_neq: List[IssueType] | NotGiven = NOT_GIVEN,
product: List[Product] | NotGiven = NOT_GIVEN,
product_neq: List[Product] | NotGiven = NOT_GIVEN,
issue_class: IssueClassParam | NotGiven = NOT_GIVEN,
issue_class_neq: IssueClassParam | NotGiven = NOT_GIVEN,
issue_type: IssueTypeParam | NotGiven = NOT_GIVEN,
issue_type_neq: IssueTypeParam | NotGiven = NOT_GIVEN,
product: ProductParam | NotGiven = NOT_GIVEN,
product_neq: ProductParam | NotGiven = NOT_GIVEN,
severity: List[SeverityQueryParam] | NotGiven = NOT_GIVEN,
severity_neq: List[SeverityQueryParam] | NotGiven = NOT_GIVEN,
subject: List[Subject] | NotGiven = NOT_GIVEN,
subject_neq: List[Subject] | NotGiven = NOT_GIVEN,
subject: SubjectParam | NotGiven = NOT_GIVEN,
subject_neq: SubjectParam | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down
6 changes: 3 additions & 3 deletions src/cloudflare/resources/rulesets/phases/phases.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing import Type, Iterable, cast
from typing import Type, cast
from typing_extensions import Literal

import httpx
Expand Down Expand Up @@ -79,7 +79,7 @@ def update(
"magic_transit_managed",
],
*,
rules: Iterable[RequestRuleParam],
rules: RequestRuleParam,
account_id: str | NotGiven = NOT_GIVEN,
zone_id: str | NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -312,7 +312,7 @@ async def update(
"magic_transit_managed",
],
*,
rules: Iterable[RequestRuleParam],
rules: RequestRuleParam,
account_id: str | NotGiven = NOT_GIVEN,
zone_id: str | NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
Expand Down
10 changes: 5 additions & 5 deletions src/cloudflare/resources/rulesets/rulesets.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing import Type, Iterable, cast
from typing import Type, cast
from typing_extensions import Literal

import httpx
Expand Down Expand Up @@ -116,7 +116,7 @@ def create(
"magic_transit_ids_managed",
"magic_transit_managed",
],
rules: Iterable[RequestRuleParam],
rules: RequestRuleParam,
account_id: str | NotGiven = NOT_GIVEN,
zone_id: str | NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -194,7 +194,7 @@ def update(
self,
ruleset_id: str,
*,
rules: Iterable[RequestRuleParam],
rules: RequestRuleParam,
account_id: str | NotGiven = NOT_GIVEN,
zone_id: str | NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -521,7 +521,7 @@ async def create(
"magic_transit_ids_managed",
"magic_transit_managed",
],
rules: Iterable[RequestRuleParam],
rules: RequestRuleParam,
account_id: str | NotGiven = NOT_GIVEN,
zone_id: str | NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -599,7 +599,7 @@ async def update(
self,
ruleset_id: str,
*,
rules: Iterable[RequestRuleParam],
rules: RequestRuleParam,
account_id: str | NotGiven = NOT_GIVEN,
zone_id: str | NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
Expand Down
19 changes: 15 additions & 4 deletions src/cloudflare/types/configuration.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing_extensions import Literal

from .._models import BaseModel

__all__ = ["Configuration"]


class Configuration(BaseModel):
password: str
"""The password required to access your origin database.
database: str
"""The name of your origin database."""

host: str
"""The host (hostname or IP) of your origin database."""

port: int
"""The port (default: 5432 for Postgres) of your origin database."""

scheme: Literal["postgres", "postgresql", "mysql"]
"""Specifies the URL scheme used to connect to your origin database."""

This value is write-only and never returned by the API.
"""
user: str
"""The user of your origin database."""
19 changes: 14 additions & 5 deletions src/cloudflare/types/configuration_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,23 @@

from __future__ import annotations

from typing_extensions import Required, TypedDict
from typing_extensions import Literal, Required, TypedDict

__all__ = ["ConfigurationParam"]


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

This value is write-only and never returned by the API.
"""
host: Required[str]
"""The host (hostname or IP) of your origin database."""

port: Required[int]
"""The port (default: 5432 for Postgres) of your origin database."""

scheme: Required[Literal["postgres", "postgresql", "mysql"]]
"""Specifies the URL scheme used to connect to your origin database."""

user: Required[str]
"""The user of your origin database."""
28 changes: 25 additions & 3 deletions src/cloudflare/types/hyperdrive/hyperdrive.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,32 @@
from typing import Optional

from ..._models import BaseModel
from ..configuration import Configuration

__all__ = ["Hyperdrive"]
__all__ = ["Hyperdrive", "Caching"]


class Caching(BaseModel):
disabled: Optional[bool] = None
"""When set to true, disables the caching of SQL responses. (Default: false)"""

max_age: Optional[int] = None
"""When present, specifies max duration for which items should persist in the
cache.
(Default: 60)
"""

stale_while_revalidate: Optional[int] = None
"""
When present, indicates the number of seconds cache may serve the response after
it becomes stale. (Default: 15)
"""


class Hyperdrive(BaseModel):
id: Optional[str] = None
"""Identifier"""
caching: Optional[Caching] = None

name: Optional[str] = None

origin: Optional[Configuration] = None
8 changes: 4 additions & 4 deletions src/cloudflare/types/intel/attack_surface_report/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

from __future__ import annotations

from .product import Product as Product
from .subject import Subject as Subject
from .issue_type import IssueType as IssueType
from .issue_class import IssueClass as IssueClass
from .product_param import ProductParam as ProductParam
from .subject_param import SubjectParam as SubjectParam
from .issue_type_param import IssueTypeParam as IssueTypeParam
from .issue_class_param import IssueClassParam as IssueClassParam
from .issue_list_params import IssueListParams as IssueListParams
from .issue_type_params import IssueTypeParams as IssueTypeParams
from .issue_class_params import IssueClassParams as IssueClassParams
Expand Down
Loading

0 comments on commit 39eabf7

Please sign in to comment.