Skip to content

Commit

Permalink
feat: OpenAPI spec update via Stainless API (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored Feb 27, 2024
1 parent 11e159c commit 8ed93bf
Show file tree
Hide file tree
Showing 14 changed files with 6 additions and 325 deletions.
10 changes: 0 additions & 10 deletions src/cloudflare/resources/dlp/profiles/customs.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ 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 @@ -110,9 +109,6 @@ 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 @@ -141,7 +137,6 @@ 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 @@ -305,7 +300,6 @@ 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 @@ -327,9 +321,6 @@ 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 @@ -358,7 +349,6 @@ 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: 0 additions & 10 deletions src/cloudflare/resources/dlp/profiles/predefineds.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ 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 @@ -60,9 +59,6 @@ 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 @@ -82,7 +78,6 @@ 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 @@ -153,7 +148,6 @@ 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 @@ -173,9 +167,6 @@ 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 @@ -195,7 +186,6 @@ 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: 0 additions & 48 deletions src/cloudflare/types/dlp/profile_get_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,35 +9,15 @@
__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 @@ -59,12 +39,6 @@ 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 @@ -75,22 +49,6 @@ 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 @@ -131,12 +89,6 @@ 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: 0 additions & 48 deletions src/cloudflare/types/dlp/profile_list_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,15 @@
"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 @@ -60,12 +40,6 @@ 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 @@ -76,22 +50,6 @@ 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 @@ -132,12 +90,6 @@ 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: 1 addition & 30 deletions src/cloudflare/types/dlp/profiles/custom_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,7 @@
from typing import Iterable
from typing_extensions import Literal, Required, TypedDict

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


class CustomCreateParams(TypedDict, total=False):
Expand All @@ -22,22 +15,6 @@ 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 @@ -65,12 +42,6 @@ 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: 0 additions & 24 deletions src/cloudflare/types/dlp/profiles/custom_create_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,11 @@
__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 @@ -72,12 +54,6 @@ 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 8ed93bf

Please sign in to comment.