Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(api): api update #2127

Merged
merged 1 commit into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 1397
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d7ac42a96dd2d1679005f853c1c4c29034e362c73f2d75ad004d948ad8abfb74.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-66874390672543889c6f739266ab0e815d7c6a65deb464a2c41c965b45d3e24a.yml
240 changes: 208 additions & 32 deletions src/cloudflare/resources/zero_trust/dlp/profiles/custom.py

Large diffs are not rendered by default.

153 changes: 130 additions & 23 deletions src/cloudflare/types/zero_trust/dlp/profiles/custom_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,82 +10,95 @@

__all__ = [
"CustomCreateParams",
"Profile",
"ProfileEntry",
"ProfileEntryDLPNewCustomEntry",
"ProfileEntryDLPNewWordListEntry",
"ProfileSharedEntry",
"ProfileSharedEntryCustom",
"ProfileSharedEntryPredefined",
"ProfileSharedEntryIntegration",
"ProfileSharedEntryExactData",
"Variant0",
"Variant0Profile",
"Variant0ProfileEntry",
"Variant0ProfileEntryDLPNewCustomEntry",
"Variant0ProfileEntryDLPNewWordListEntry",
"Variant0ProfileSharedEntry",
"Variant0ProfileSharedEntryCustom",
"Variant0ProfileSharedEntryPredefined",
"Variant0ProfileSharedEntryIntegration",
"Variant0ProfileSharedEntryExactData",
"DLPNewCustomProfile",
"DLPNewCustomProfileEntry",
"DLPNewCustomProfileEntryDLPNewCustomEntry",
"DLPNewCustomProfileEntryDLPNewWordListEntry",
"DLPNewCustomProfileSharedEntry",
"DLPNewCustomProfileSharedEntryCustom",
"DLPNewCustomProfileSharedEntryPredefined",
"DLPNewCustomProfileSharedEntryIntegration",
"DLPNewCustomProfileSharedEntryExactData",
]


class CustomCreateParams(TypedDict, total=False):
class Variant0(TypedDict, total=False):
account_id: Required[str]

profiles: Required[Iterable[Profile]]
profiles: Required[Iterable[Variant0Profile]]


class ProfileEntryDLPNewCustomEntry(TypedDict, total=False):
class Variant0ProfileEntryDLPNewCustomEntry(TypedDict, total=False):
enabled: Required[bool]

name: Required[str]

pattern: Required[PatternParam]


class ProfileEntryDLPNewWordListEntry(TypedDict, total=False):
class Variant0ProfileEntryDLPNewWordListEntry(TypedDict, total=False):
enabled: Required[bool]

name: Required[str]

words: Required[List[str]]


ProfileEntry: TypeAlias = Union[ProfileEntryDLPNewCustomEntry, ProfileEntryDLPNewWordListEntry]
Variant0ProfileEntry: TypeAlias = Union[Variant0ProfileEntryDLPNewCustomEntry, Variant0ProfileEntryDLPNewWordListEntry]


class ProfileSharedEntryCustom(TypedDict, total=False):
class Variant0ProfileSharedEntryCustom(TypedDict, total=False):
enabled: Required[bool]

entry_id: Required[str]

entry_type: Required[Literal["custom"]]


class ProfileSharedEntryPredefined(TypedDict, total=False):
class Variant0ProfileSharedEntryPredefined(TypedDict, total=False):
enabled: Required[bool]

entry_id: Required[str]

entry_type: Required[Literal["predefined"]]


class ProfileSharedEntryIntegration(TypedDict, total=False):
class Variant0ProfileSharedEntryIntegration(TypedDict, total=False):
enabled: Required[bool]

entry_id: Required[str]

entry_type: Required[Literal["integration"]]


class ProfileSharedEntryExactData(TypedDict, total=False):
class Variant0ProfileSharedEntryExactData(TypedDict, total=False):
enabled: Required[bool]

entry_id: Required[str]

entry_type: Required[Literal["exact_data"]]


ProfileSharedEntry: TypeAlias = Union[
ProfileSharedEntryCustom, ProfileSharedEntryPredefined, ProfileSharedEntryIntegration, ProfileSharedEntryExactData
Variant0ProfileSharedEntry: TypeAlias = Union[
Variant0ProfileSharedEntryCustom,
Variant0ProfileSharedEntryPredefined,
Variant0ProfileSharedEntryIntegration,
Variant0ProfileSharedEntryExactData,
]


class Profile(TypedDict, total=False):
entries: Required[Iterable[ProfileEntry]]
class Variant0Profile(TypedDict, total=False):
entries: Required[Iterable[Variant0ProfileEntry]]

name: Required[str]

Expand All @@ -105,9 +118,103 @@ class Profile(TypedDict, total=False):

ocr_enabled: bool

shared_entries: Iterable[ProfileSharedEntry]
shared_entries: Iterable[Variant0ProfileSharedEntry]
"""Entries from other profiles (e.g.

pre-defined Cloudflare profiles, or your Microsoft Information Protection
profiles).
"""


class DLPNewCustomProfile(TypedDict, total=False):
account_id: Required[str]

entries: Required[Iterable[DLPNewCustomProfileEntry]]

name: Required[str]

allowed_match_count: int
"""Related DLP policies will trigger when the match count exceeds the number set."""

confidence_threshold: Optional[str]

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

description: Optional[str]
"""The description of the profile"""

ocr_enabled: bool

shared_entries: Iterable[DLPNewCustomProfileSharedEntry]
"""Entries from other profiles (e.g.

pre-defined Cloudflare profiles, or your Microsoft Information Protection
profiles).
"""


class DLPNewCustomProfileEntryDLPNewCustomEntry(TypedDict, total=False):
enabled: Required[bool]

name: Required[str]

pattern: Required[PatternParam]


class DLPNewCustomProfileEntryDLPNewWordListEntry(TypedDict, total=False):
enabled: Required[bool]

name: Required[str]

words: Required[List[str]]


DLPNewCustomProfileEntry: TypeAlias = Union[
DLPNewCustomProfileEntryDLPNewCustomEntry, DLPNewCustomProfileEntryDLPNewWordListEntry
]


class DLPNewCustomProfileSharedEntryCustom(TypedDict, total=False):
enabled: Required[bool]

entry_id: Required[str]

entry_type: Required[Literal["custom"]]


class DLPNewCustomProfileSharedEntryPredefined(TypedDict, total=False):
enabled: Required[bool]

entry_id: Required[str]

entry_type: Required[Literal["predefined"]]


class DLPNewCustomProfileSharedEntryIntegration(TypedDict, total=False):
enabled: Required[bool]

entry_id: Required[str]

entry_type: Required[Literal["integration"]]


class DLPNewCustomProfileSharedEntryExactData(TypedDict, total=False):
enabled: Required[bool]

entry_id: Required[str]

entry_type: Required[Literal["exact_data"]]


DLPNewCustomProfileSharedEntry: TypeAlias = Union[
DLPNewCustomProfileSharedEntryCustom,
DLPNewCustomProfileSharedEntryPredefined,
DLPNewCustomProfileSharedEntryIntegration,
DLPNewCustomProfileSharedEntryExactData,
]

CustomCreateParams: TypeAlias = Union[Variant0, DLPNewCustomProfile]
Loading