Skip to content

Commit

Permalink
feat: OpenAPI spec update via Stainless API (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Mar 12, 2024
1 parent 944417f commit b28434f
Show file tree
Hide file tree
Showing 14 changed files with 325 additions and 6 deletions.
10 changes: 10 additions & 0 deletions src/cloudflare/resources/dlp/profiles/customs.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ def update(
*,
account_id: str,
allowed_match_count: float | NotGiven = NOT_GIVEN,
context_awareness: custom_update_params.ContextAwareness | NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
entries: Iterable[custom_update_params.Entry] | NotGiven = NOT_GIVEN,
name: str | NotGiven = NOT_GIVEN,
Expand All @@ -109,6 +110,9 @@ def update(
allowed_match_count: Related DLP policies will trigger when the match count exceeds the number set.
context_awareness: Scan the context of predefined entries to only return matches surrounded by
keywords.
description: The description of the profile.
entries: The custom entries for this profile. Array elements with IDs are modifying the
Expand Down Expand Up @@ -137,6 +141,7 @@ def update(
body=maybe_transform(
{
"allowed_match_count": allowed_match_count,
"context_awareness": context_awareness,
"description": description,
"entries": entries,
"name": name,
Expand Down Expand Up @@ -300,6 +305,7 @@ async def update(
*,
account_id: str,
allowed_match_count: float | NotGiven = NOT_GIVEN,
context_awareness: custom_update_params.ContextAwareness | NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
entries: Iterable[custom_update_params.Entry] | NotGiven = NOT_GIVEN,
name: str | NotGiven = NOT_GIVEN,
Expand All @@ -321,6 +327,9 @@ async def update(
allowed_match_count: Related DLP policies will trigger when the match count exceeds the number set.
context_awareness: Scan the context of predefined entries to only return matches surrounded by
keywords.
description: The description of the profile.
entries: The custom entries for this profile. Array elements with IDs are modifying the
Expand Down Expand Up @@ -349,6 +358,7 @@ async def update(
body=maybe_transform(
{
"allowed_match_count": allowed_match_count,
"context_awareness": context_awareness,
"description": description,
"entries": entries,
"name": name,
Expand Down
10 changes: 10 additions & 0 deletions src/cloudflare/resources/dlp/profiles/predefineds.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def update(
*,
account_id: str,
allowed_match_count: float | NotGiven = NOT_GIVEN,
context_awareness: predefined_update_params.ContextAwareness | NotGiven = NOT_GIVEN,
entries: Iterable[predefined_update_params.Entry] | 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.
Expand All @@ -59,6 +60,9 @@ def update(
allowed_match_count: Related DLP policies will trigger when the match count exceeds the number set.
context_awareness: Scan the context of predefined entries to only return matches surrounded by
keywords.
entries: The entries for this profile.
extra_headers: Send extra headers
Expand All @@ -78,6 +82,7 @@ def update(
body=maybe_transform(
{
"allowed_match_count": allowed_match_count,
"context_awareness": context_awareness,
"entries": entries,
},
predefined_update_params.PredefinedUpdateParams,
Expand Down Expand Up @@ -148,6 +153,7 @@ async def update(
*,
account_id: str,
allowed_match_count: float | NotGiven = NOT_GIVEN,
context_awareness: predefined_update_params.ContextAwareness | NotGiven = NOT_GIVEN,
entries: Iterable[predefined_update_params.Entry] | 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.
Expand All @@ -167,6 +173,9 @@ async def update(
allowed_match_count: Related DLP policies will trigger when the match count exceeds the number set.
context_awareness: Scan the context of predefined entries to only return matches surrounded by
keywords.
entries: The entries for this profile.
extra_headers: Send extra headers
Expand All @@ -186,6 +195,7 @@ async def update(
body=maybe_transform(
{
"allowed_match_count": allowed_match_count,
"context_awareness": context_awareness,
"entries": entries,
},
predefined_update_params.PredefinedUpdateParams,
Expand Down
48 changes: 48 additions & 0 deletions src/cloudflare/types/dlp/profile_get_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,35 @@
__all__ = [
"ProfileGetResponse",
"DLPPredefinedProfile",
"DLPPredefinedProfileContextAwareness",
"DLPPredefinedProfileContextAwarenessSkip",
"DLPPredefinedProfileEntry",
"DLPCustomProfile",
"DLPCustomProfileContextAwareness",
"DLPCustomProfileContextAwarenessSkip",
"DLPCustomProfileEntry",
"DLPCustomProfileEntryPattern",
"DLPIntegrationProfile",
"DLPIntegrationProfileEntry",
]


class DLPPredefinedProfileContextAwarenessSkip(BaseModel):
files: bool
"""If the content type is a file, skip context analysis and return all matches."""


class DLPPredefinedProfileContextAwareness(BaseModel):
enabled: bool
"""
If true, scan the context of predefined entries to only return matches
surrounded by keywords.
"""

skip: DLPPredefinedProfileContextAwarenessSkip
"""Content types to exclude from context analysis and return all matches."""


class DLPPredefinedProfileEntry(BaseModel):
id: Optional[str] = None
"""The ID for this entry"""
Expand All @@ -39,6 +59,12 @@ class DLPPredefinedProfile(BaseModel):
allowed_match_count: Optional[float] = None
"""Related DLP policies will trigger when the match count exceeds the number set."""

context_awareness: Optional[DLPPredefinedProfileContextAwareness] = None
"""
Scan the context of predefined entries to only return matches surrounded by
keywords.
"""

entries: Optional[List[DLPPredefinedProfileEntry]] = None
"""The entries for this profile."""

Expand All @@ -49,6 +75,22 @@ class DLPPredefinedProfile(BaseModel):
"""The type of the profile."""


class DLPCustomProfileContextAwarenessSkip(BaseModel):
files: bool
"""If the content type is a file, skip context analysis and return all matches."""


class DLPCustomProfileContextAwareness(BaseModel):
enabled: bool
"""
If true, scan the context of predefined entries to only return matches
surrounded by keywords.
"""

skip: DLPCustomProfileContextAwarenessSkip
"""Content types to exclude from context analysis and return all matches."""


class DLPCustomProfileEntryPattern(BaseModel):
regex: str
"""The regex pattern."""
Expand Down Expand Up @@ -89,6 +131,12 @@ class DLPCustomProfile(BaseModel):
allowed_match_count: Optional[float] = None
"""Related DLP policies will trigger when the match count exceeds the number set."""

context_awareness: Optional[DLPCustomProfileContextAwareness] = None
"""
Scan the context of predefined entries to only return matches surrounded by
keywords.
"""

created_at: Optional[datetime] = None

description: Optional[str] = None
Expand Down
48 changes: 48 additions & 0 deletions src/cloudflare/types/dlp/profile_list_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,35 @@
"ProfileListResponse",
"ProfileListResponseItem",
"ProfileListResponseItemDLPPredefinedProfile",
"ProfileListResponseItemDLPPredefinedProfileContextAwareness",
"ProfileListResponseItemDLPPredefinedProfileContextAwarenessSkip",
"ProfileListResponseItemDLPPredefinedProfileEntry",
"ProfileListResponseItemDLPCustomProfile",
"ProfileListResponseItemDLPCustomProfileContextAwareness",
"ProfileListResponseItemDLPCustomProfileContextAwarenessSkip",
"ProfileListResponseItemDLPCustomProfileEntry",
"ProfileListResponseItemDLPCustomProfileEntryPattern",
"ProfileListResponseItemDLPIntegrationProfile",
"ProfileListResponseItemDLPIntegrationProfileEntry",
]


class ProfileListResponseItemDLPPredefinedProfileContextAwarenessSkip(BaseModel):
files: bool
"""If the content type is a file, skip context analysis and return all matches."""


class ProfileListResponseItemDLPPredefinedProfileContextAwareness(BaseModel):
enabled: bool
"""
If true, scan the context of predefined entries to only return matches
surrounded by keywords.
"""

skip: ProfileListResponseItemDLPPredefinedProfileContextAwarenessSkip
"""Content types to exclude from context analysis and return all matches."""


class ProfileListResponseItemDLPPredefinedProfileEntry(BaseModel):
id: Optional[str] = None
"""The ID for this entry"""
Expand All @@ -40,6 +60,12 @@ class ProfileListResponseItemDLPPredefinedProfile(BaseModel):
allowed_match_count: Optional[float] = None
"""Related DLP policies will trigger when the match count exceeds the number set."""

context_awareness: Optional[ProfileListResponseItemDLPPredefinedProfileContextAwareness] = None
"""
Scan the context of predefined entries to only return matches surrounded by
keywords.
"""

entries: Optional[List[ProfileListResponseItemDLPPredefinedProfileEntry]] = None
"""The entries for this profile."""

Expand All @@ -50,6 +76,22 @@ class ProfileListResponseItemDLPPredefinedProfile(BaseModel):
"""The type of the profile."""


class ProfileListResponseItemDLPCustomProfileContextAwarenessSkip(BaseModel):
files: bool
"""If the content type is a file, skip context analysis and return all matches."""


class ProfileListResponseItemDLPCustomProfileContextAwareness(BaseModel):
enabled: bool
"""
If true, scan the context of predefined entries to only return matches
surrounded by keywords.
"""

skip: ProfileListResponseItemDLPCustomProfileContextAwarenessSkip
"""Content types to exclude from context analysis and return all matches."""


class ProfileListResponseItemDLPCustomProfileEntryPattern(BaseModel):
regex: str
"""The regex pattern."""
Expand Down Expand Up @@ -90,6 +132,12 @@ class ProfileListResponseItemDLPCustomProfile(BaseModel):
allowed_match_count: Optional[float] = None
"""Related DLP policies will trigger when the match count exceeds the number set."""

context_awareness: Optional[ProfileListResponseItemDLPCustomProfileContextAwareness] = None
"""
Scan the context of predefined entries to only return matches surrounded by
keywords.
"""

created_at: Optional[datetime] = None

description: Optional[str] = None
Expand Down
31 changes: 30 additions & 1 deletion src/cloudflare/types/dlp/profiles/custom_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@
from typing import Iterable
from typing_extensions import Literal, Required, TypedDict

__all__ = ["CustomCreateParams", "Profile", "ProfileEntry", "ProfileEntryPattern"]
__all__ = [
"CustomCreateParams",
"Profile",
"ProfileContextAwareness",
"ProfileContextAwarenessSkip",
"ProfileEntry",
"ProfileEntryPattern",
]


class CustomCreateParams(TypedDict, total=False):
Expand All @@ -15,6 +22,22 @@ class CustomCreateParams(TypedDict, total=False):
profiles: Required[Iterable[Profile]]


class ProfileContextAwarenessSkip(TypedDict, total=False):
files: Required[bool]
"""If the content type is a file, skip context analysis and return all matches."""


class ProfileContextAwareness(TypedDict, total=False):
enabled: Required[bool]
"""
If true, scan the context of predefined entries to only return matches
surrounded by keywords.
"""

skip: Required[ProfileContextAwarenessSkip]
"""Content types to exclude from context analysis and return all matches."""


class ProfileEntryPattern(TypedDict, total=False):
regex: Required[str]
"""The regex pattern."""
Expand Down Expand Up @@ -42,6 +65,12 @@ class Profile(TypedDict, total=False):
allowed_match_count: float
"""Related DLP policies will trigger when the match count exceeds the number set."""

context_awareness: ProfileContextAwareness
"""
Scan the context of predefined entries to only return matches surrounded by
keywords.
"""

description: str
"""The description of the profile."""

Expand Down
24 changes: 24 additions & 0 deletions src/cloudflare/types/dlp/profiles/custom_create_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,29 @@
__all__ = [
"CustomCreateResponse",
"CustomCreateResponseItem",
"CustomCreateResponseItemContextAwareness",
"CustomCreateResponseItemContextAwarenessSkip",
"CustomCreateResponseItemEntry",
"CustomCreateResponseItemEntryPattern",
]


class CustomCreateResponseItemContextAwarenessSkip(BaseModel):
files: bool
"""If the content type is a file, skip context analysis and return all matches."""


class CustomCreateResponseItemContextAwareness(BaseModel):
enabled: bool
"""
If true, scan the context of predefined entries to only return matches
surrounded by keywords.
"""

skip: CustomCreateResponseItemContextAwarenessSkip
"""Content types to exclude from context analysis and return all matches."""


class CustomCreateResponseItemEntryPattern(BaseModel):
regex: str
"""The regex pattern."""
Expand Down Expand Up @@ -54,6 +72,12 @@ class CustomCreateResponseItem(BaseModel):
allowed_match_count: Optional[float] = None
"""Related DLP policies will trigger when the match count exceeds the number set."""

context_awareness: Optional[CustomCreateResponseItemContextAwareness] = None
"""
Scan the context of predefined entries to only return matches surrounded by
keywords.
"""

created_at: Optional[datetime] = None

description: Optional[str] = None
Expand Down
Loading

0 comments on commit b28434f

Please sign in to comment.