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): OpenAPI spec update via Stainless API #1164

Merged
merged 1 commit into from
Jul 3, 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: 1254
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-083ca113d337ffe49bfc03995fdd6be7a8046dee59daf74e91651bed68922019.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-12ed8fd7f6be01ee3453fc6da43e93e43e769473bd3ea73e2cda7794402b674d.yml
130 changes: 129 additions & 1 deletion src/cloudflare/types/api_gateway/api_shield.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,18 @@
"FeaturesAPIShieldOperationFeatureParameterSchemas",
"FeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemas",
"FeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemasParameterSchemas",
"FeaturesAPIShieldOperationFeatureAPIRouting",
"FeaturesAPIShieldOperationFeatureAPIRoutingAPIRouting",
"FeaturesAPIShieldOperationFeatureConfidenceIntervals",
"FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervals",
"FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThreshold",
"FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervals",
"FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP90",
"FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP95",
"FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP99",
"FeaturesAPIShieldOperationFeatureSchemaInfo",
"FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfo",
"FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema",
]


Expand Down Expand Up @@ -73,7 +85,123 @@ class FeaturesAPIShieldOperationFeatureParameterSchemas(BaseModel):
parameter_schemas: FeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemas


Features = Union[FeaturesAPIShieldOperationFeatureThresholds, FeaturesAPIShieldOperationFeatureParameterSchemas]
class FeaturesAPIShieldOperationFeatureAPIRoutingAPIRouting(BaseModel):
last_updated: Optional[datetime] = None

route: Optional[str] = None
"""Target route."""


class FeaturesAPIShieldOperationFeatureAPIRouting(BaseModel):
api_routing: Optional[FeaturesAPIShieldOperationFeatureAPIRoutingAPIRouting] = None
"""API Routing settings on endpoint."""


class FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP90(
BaseModel
):
lower: Optional[float] = None
"""Lower bound for percentile estimate"""

upper: Optional[float] = None
"""Upper bound for percentile estimate"""


class FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP95(
BaseModel
):
lower: Optional[float] = None
"""Lower bound for percentile estimate"""

upper: Optional[float] = None
"""Upper bound for percentile estimate"""


class FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP99(
BaseModel
):
lower: Optional[float] = None
"""Lower bound for percentile estimate"""

upper: Optional[float] = None
"""Upper bound for percentile estimate"""


class FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervals(
BaseModel
):
p90: Optional[
FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP90
] = None
"""Upper and lower bound for percentile estimate"""

p95: Optional[
FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP95
] = None
"""Upper and lower bound for percentile estimate"""

p99: Optional[
FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP99
] = None
"""Upper and lower bound for percentile estimate"""


class FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThreshold(BaseModel):
confidence_intervals: Optional[
FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervals
] = None

mean: Optional[float] = None
"""Suggested threshold."""


class FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervals(BaseModel):
last_updated: Optional[datetime] = None

suggested_threshold: Optional[
FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThreshold
] = None


class FeaturesAPIShieldOperationFeatureConfidenceIntervals(BaseModel):
confidence_intervals: Optional[FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervals] = None


class FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema(BaseModel):
id: Optional[str] = None
"""UUID identifier"""

created_at: Optional[datetime] = None

is_learned: Optional[bool] = None
"""True if schema is Cloudflare-provided."""

name: Optional[str] = None
"""Schema file name."""


class FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfo(BaseModel):
active_schema: Optional[FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema] = None
"""Schema active on endpoint."""

learned_available: Optional[bool] = None
"""True if a Cloudflare-provided learned schema is available for this endpoint."""

mitigation_action: Optional[Literal["none", "log", "block"]] = None
"""Action taken on requests failing validation."""


class FeaturesAPIShieldOperationFeatureSchemaInfo(BaseModel):
schema_info: Optional[FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfo] = None


Features = Union[
FeaturesAPIShieldOperationFeatureThresholds,
FeaturesAPIShieldOperationFeatureParameterSchemas,
FeaturesAPIShieldOperationFeatureAPIRouting,
FeaturesAPIShieldOperationFeatureConfidenceIntervals,
FeaturesAPIShieldOperationFeatureSchemaInfo,
]


class APIShield(BaseModel):
Expand Down