Skip to content

Commit

Permalink
feat(api): OpenAPI spec update via Stainless API (#1164)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Jul 3, 2024
1 parent a5e205c commit 64ce67c
Show file tree
Hide file tree
Showing 2 changed files with 130 additions and 2 deletions.
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

0 comments on commit 64ce67c

Please sign in to comment.