diff --git a/api.md b/api.md
index 1c8e481b97a..e7abfab278b 100644
--- a/api.md
+++ b/api.md
@@ -2650,18 +2650,31 @@ Methods:
# Rulesets
+Params Types:
+
+- rulesets.BlockRuleParam
+- rulesets.ExecuteRuleParam
+- rulesets.LogRuleParam
+- rulesets.RequestRuleUnionParam
+- rulesets.SkipRuleParam
+
Response Types:
+- rulesets.BlockRule
+- rulesets.ExecuteRule
+- rulesets.LogRule
+- rulesets.RequestRule
+- rulesets.Ruleset
+- rulesets.SkipRule
- rulesets.RulesetNewResponse
- rulesets.RulesetUpdateResponse
-- rulesets.RulesetListResponse
- rulesets.RulesetGetResponse
Methods:
- client.Rulesets.New(ctx context.Context, params rulesets.RulesetNewParams) (rulesets.RulesetNewResponse, error)
- client.Rulesets.Update(ctx context.Context, rulesetID string, params rulesets.RulesetUpdateParams) (rulesets.RulesetUpdateResponse, error)
-- client.Rulesets.List(ctx context.Context, query rulesets.RulesetListParams) (pagination.SinglePage[rulesets.RulesetListResponse], error)
+- client.Rulesets.List(ctx context.Context, query rulesets.RulesetListParams) (pagination.SinglePage[rulesets.Ruleset], error)
- client.Rulesets.Delete(ctx context.Context, rulesetID string, body rulesets.RulesetDeleteParams) error
- client.Rulesets.Get(ctx context.Context, rulesetID string, query rulesets.RulesetGetParams) (rulesets.RulesetGetResponse, error)
@@ -2681,12 +2694,11 @@ Methods:
Response Types:
-- rulesets.PhaseVersionListResponse
- rulesets.PhaseVersionGetResponse
Methods:
-- client.Rulesets.Phases.Versions.List(ctx context.Context, rulesetPhase rulesets.PhaseVersionListParamsRulesetPhase, query rulesets.PhaseVersionListParams) (pagination.SinglePage[rulesets.PhaseVersionListResponse], error)
+- client.Rulesets.Phases.Versions.List(ctx context.Context, rulesetPhase rulesets.PhaseVersionListParamsRulesetPhase, query rulesets.PhaseVersionListParams) (pagination.SinglePage[rulesets.Ruleset], error)
- client.Rulesets.Phases.Versions.Get(ctx context.Context, rulesetPhase rulesets.PhaseVersionGetParamsRulesetPhase, rulesetVersion string, query rulesets.PhaseVersionGetParams) (rulesets.PhaseVersionGetResponse, error)
## Rules
@@ -2707,12 +2719,11 @@ Methods:
Response Types:
-- rulesets.VersionListResponse
- rulesets.VersionGetResponse
Methods:
-- client.Rulesets.Versions.List(ctx context.Context, rulesetID string, query rulesets.VersionListParams) (pagination.SinglePage[rulesets.VersionListResponse], error)
+- client.Rulesets.Versions.List(ctx context.Context, rulesetID string, query rulesets.VersionListParams) (pagination.SinglePage[rulesets.Ruleset], error)
- client.Rulesets.Versions.Delete(ctx context.Context, rulesetID string, rulesetVersion string, body rulesets.VersionDeleteParams) error
- client.Rulesets.Versions.Get(ctx context.Context, rulesetID string, rulesetVersion string, query rulesets.VersionGetParams) (rulesets.VersionGetResponse, error)
diff --git a/rulesets/phase.go b/rulesets/phase.go
index bf64affc8e7..b8cc4784207 100644
--- a/rulesets/phase.go
+++ b/rulesets/phase.go
@@ -6,15 +6,12 @@ import (
"context"
"fmt"
"net/http"
- "reflect"
"time"
"github.com/cloudflare/cloudflare-go/v2/internal/apijson"
"github.com/cloudflare/cloudflare-go/v2/internal/param"
"github.com/cloudflare/cloudflare-go/v2/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/v2/internal/shared"
"github.com/cloudflare/cloudflare-go/v2/option"
- "github.com/tidwall/gjson"
)
// PhaseService contains methods and other services that help with interacting with
@@ -94,7 +91,7 @@ type PhaseUpdateResponse struct {
// The phase of the ruleset.
Phase PhaseUpdateResponsePhase `json:"phase,required"`
// The list of rules in the ruleset.
- Rules []PhaseUpdateResponseRule `json:"rules,required"`
+ Rules []RequestRule `json:"rules,required"`
// The version of the ruleset.
Version string `json:"version,required"`
// An informative description of the ruleset.
@@ -180,780 +177,6 @@ func (r PhaseUpdateResponsePhase) IsKnown() bool {
return false
}
-type PhaseUpdateResponseRule struct {
- // The action to perform when the rule matches.
- Action PhaseUpdateResponseRulesAction `json:"action"`
- ActionParameters interface{} `json:"action_parameters,required"`
- Categories interface{} `json:"categories,required"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // An object configuring the rule's logging behavior.
- Logging shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- // The version of the rule.
- Version string `json:"version,required"`
- JSON phaseUpdateResponseRuleJSON `json:"-"`
- union PhaseUpdateResponseRulesUnion
-}
-
-// phaseUpdateResponseRuleJSON contains the JSON metadata for the struct
-// [PhaseUpdateResponseRule]
-type phaseUpdateResponseRuleJSON struct {
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- ID apijson.Field
- LastUpdated apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- Version apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r phaseUpdateResponseRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r *PhaseUpdateResponseRule) UnmarshalJSON(data []byte) (err error) {
- err = apijson.UnmarshalRoot(data, &r.union)
- if err != nil {
- return err
- }
- return apijson.Port(r.union, &r)
-}
-
-func (r PhaseUpdateResponseRule) AsUnion() PhaseUpdateResponseRulesUnion {
- return r.union
-}
-
-// Union satisfied by [rulesets.PhaseUpdateResponseRulesRulesetsBlockRule],
-// [rulesets.PhaseUpdateResponseRulesRulesetsExecuteRule],
-// [rulesets.PhaseUpdateResponseRulesRulesetsLogRule] or
-// [rulesets.PhaseUpdateResponseRulesRulesetsSkipRule].
-type PhaseUpdateResponseRulesUnion interface {
- implementsRulesetsPhaseUpdateResponseRule()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*PhaseUpdateResponseRulesUnion)(nil)).Elem(),
- "action",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(PhaseUpdateResponseRulesRulesetsBlockRule{}),
- DiscriminatorValue: "block",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(PhaseUpdateResponseRulesRulesetsExecuteRule{}),
- DiscriminatorValue: "execute",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(PhaseUpdateResponseRulesRulesetsLogRule{}),
- DiscriminatorValue: "log",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(PhaseUpdateResponseRulesRulesetsSkipRule{}),
- DiscriminatorValue: "skip",
- },
- )
-}
-
-type PhaseUpdateResponseRulesRulesetsBlockRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action PhaseUpdateResponseRulesRulesetsBlockRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters PhaseUpdateResponseRulesRulesetsBlockRuleActionParameters `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON phaseUpdateResponseRulesRulesetsBlockRuleJSON `json:"-"`
-}
-
-// phaseUpdateResponseRulesRulesetsBlockRuleJSON contains the JSON metadata for the
-// struct [PhaseUpdateResponseRulesRulesetsBlockRule]
-type phaseUpdateResponseRulesRulesetsBlockRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PhaseUpdateResponseRulesRulesetsBlockRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r phaseUpdateResponseRulesRulesetsBlockRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r PhaseUpdateResponseRulesRulesetsBlockRule) implementsRulesetsPhaseUpdateResponseRule() {}
-
-// The action to perform when the rule matches.
-type PhaseUpdateResponseRulesRulesetsBlockRuleAction string
-
-const (
- PhaseUpdateResponseRulesRulesetsBlockRuleActionBlock PhaseUpdateResponseRulesRulesetsBlockRuleAction = "block"
-)
-
-func (r PhaseUpdateResponseRulesRulesetsBlockRuleAction) IsKnown() bool {
- switch r {
- case PhaseUpdateResponseRulesRulesetsBlockRuleActionBlock:
- return true
- }
- return false
-}
-
-// The parameters configuring the rule's action.
-type PhaseUpdateResponseRulesRulesetsBlockRuleActionParameters struct {
- // The response to show when the block is applied.
- Response PhaseUpdateResponseRulesRulesetsBlockRuleActionParametersResponse `json:"response"`
- JSON phaseUpdateResponseRulesRulesetsBlockRuleActionParametersJSON `json:"-"`
-}
-
-// phaseUpdateResponseRulesRulesetsBlockRuleActionParametersJSON contains the JSON
-// metadata for the struct
-// [PhaseUpdateResponseRulesRulesetsBlockRuleActionParameters]
-type phaseUpdateResponseRulesRulesetsBlockRuleActionParametersJSON struct {
- Response apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PhaseUpdateResponseRulesRulesetsBlockRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r phaseUpdateResponseRulesRulesetsBlockRuleActionParametersJSON) RawJSON() string {
- return r.raw
-}
-
-// The response to show when the block is applied.
-type PhaseUpdateResponseRulesRulesetsBlockRuleActionParametersResponse struct {
- // The content to return.
- Content string `json:"content,required"`
- // The type of the content to return.
- ContentType string `json:"content_type,required"`
- // The status code to return.
- StatusCode int64 `json:"status_code,required"`
- JSON phaseUpdateResponseRulesRulesetsBlockRuleActionParametersResponseJSON `json:"-"`
-}
-
-// phaseUpdateResponseRulesRulesetsBlockRuleActionParametersResponseJSON contains
-// the JSON metadata for the struct
-// [PhaseUpdateResponseRulesRulesetsBlockRuleActionParametersResponse]
-type phaseUpdateResponseRulesRulesetsBlockRuleActionParametersResponseJSON struct {
- Content apijson.Field
- ContentType apijson.Field
- StatusCode apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PhaseUpdateResponseRulesRulesetsBlockRuleActionParametersResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r phaseUpdateResponseRulesRulesetsBlockRuleActionParametersResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type PhaseUpdateResponseRulesRulesetsExecuteRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action PhaseUpdateResponseRulesRulesetsExecuteRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters PhaseUpdateResponseRulesRulesetsExecuteRuleActionParameters `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON phaseUpdateResponseRulesRulesetsExecuteRuleJSON `json:"-"`
-}
-
-// phaseUpdateResponseRulesRulesetsExecuteRuleJSON contains the JSON metadata for
-// the struct [PhaseUpdateResponseRulesRulesetsExecuteRule]
-type phaseUpdateResponseRulesRulesetsExecuteRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PhaseUpdateResponseRulesRulesetsExecuteRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r phaseUpdateResponseRulesRulesetsExecuteRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r PhaseUpdateResponseRulesRulesetsExecuteRule) implementsRulesetsPhaseUpdateResponseRule() {}
-
-// The action to perform when the rule matches.
-type PhaseUpdateResponseRulesRulesetsExecuteRuleAction string
-
-const (
- PhaseUpdateResponseRulesRulesetsExecuteRuleActionExecute PhaseUpdateResponseRulesRulesetsExecuteRuleAction = "execute"
-)
-
-func (r PhaseUpdateResponseRulesRulesetsExecuteRuleAction) IsKnown() bool {
- switch r {
- case PhaseUpdateResponseRulesRulesetsExecuteRuleActionExecute:
- return true
- }
- return false
-}
-
-// The parameters configuring the rule's action.
-type PhaseUpdateResponseRulesRulesetsExecuteRuleActionParameters struct {
- // The ID of the ruleset to execute.
- ID string `json:"id,required"`
- // The configuration to use for matched data logging.
- MatchedData PhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersMatchedData `json:"matched_data"`
- // A set of overrides to apply to the target ruleset.
- Overrides PhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverrides `json:"overrides"`
- JSON phaseUpdateResponseRulesRulesetsExecuteRuleActionParametersJSON `json:"-"`
-}
-
-// phaseUpdateResponseRulesRulesetsExecuteRuleActionParametersJSON contains the
-// JSON metadata for the struct
-// [PhaseUpdateResponseRulesRulesetsExecuteRuleActionParameters]
-type phaseUpdateResponseRulesRulesetsExecuteRuleActionParametersJSON struct {
- ID apijson.Field
- MatchedData apijson.Field
- Overrides apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PhaseUpdateResponseRulesRulesetsExecuteRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r phaseUpdateResponseRulesRulesetsExecuteRuleActionParametersJSON) RawJSON() string {
- return r.raw
-}
-
-// The configuration to use for matched data logging.
-type PhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersMatchedData struct {
- // The public key to encrypt matched data logs with.
- PublicKey string `json:"public_key,required"`
- JSON phaseUpdateResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON `json:"-"`
-}
-
-// phaseUpdateResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON
-// contains the JSON metadata for the struct
-// [PhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersMatchedData]
-type phaseUpdateResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON struct {
- PublicKey apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersMatchedData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r phaseUpdateResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON) RawJSON() string {
- return r.raw
-}
-
-// A set of overrides to apply to the target ruleset.
-type PhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverrides struct {
- // An action to override all rules with. This option has lower precedence than rule
- // and category overrides.
- Action string `json:"action"`
- // A list of category-level overrides. This option has the second-highest
- // precedence after rule-level overrides.
- Categories []PhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory `json:"categories"`
- // Whether to enable execution of all rules. This option has lower precedence than
- // rule and category overrides.
- Enabled bool `json:"enabled"`
- // A list of rule-level overrides. This option has the highest precedence.
- Rules []PhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRule `json:"rules"`
- // A sensitivity level to set for all rules. This option has lower precedence than
- // rule and category overrides and is only applicable for DDoS phases.
- SensitivityLevel PhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel `json:"sensitivity_level"`
- JSON phaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON `json:"-"`
-}
-
-// phaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON
-// contains the JSON metadata for the struct
-// [PhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverrides]
-type phaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON struct {
- Action apijson.Field
- Categories apijson.Field
- Enabled apijson.Field
- Rules apijson.Field
- SensitivityLevel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverrides) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r phaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON) RawJSON() string {
- return r.raw
-}
-
-// A category-level override
-type PhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory struct {
- // The name of the category to override.
- Category string `json:"category,required"`
- // The action to override rules in the category with.
- Action string `json:"action"`
- // Whether to enable execution of rules in the category.
- Enabled bool `json:"enabled"`
- // The sensitivity level to use for rules in the category.
- SensitivityLevel PhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel `json:"sensitivity_level"`
- JSON phaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON `json:"-"`
-}
-
-// phaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON
-// contains the JSON metadata for the struct
-// [PhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory]
-type phaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON struct {
- Category apijson.Field
- Action apijson.Field
- Enabled apijson.Field
- SensitivityLevel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r phaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON) RawJSON() string {
- return r.raw
-}
-
-// The sensitivity level to use for rules in the category.
-type PhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel string
-
-const (
- PhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault PhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "default"
- PhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium PhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "medium"
- PhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow PhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "low"
- PhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff PhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "eoff"
-)
-
-func (r PhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel) IsKnown() bool {
- switch r {
- case PhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault, PhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium, PhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow, PhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff:
- return true
- }
- return false
-}
-
-// A rule-level override
-type PhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRule struct {
- // The ID of the rule to override.
- ID string `json:"id,required"`
- // The action to override the rule with.
- Action string `json:"action"`
- // Whether to enable execution of the rule.
- Enabled bool `json:"enabled"`
- // The score threshold to use for the rule.
- ScoreThreshold int64 `json:"score_threshold"`
- // The sensitivity level to use for the rule.
- SensitivityLevel PhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel `json:"sensitivity_level"`
- JSON phaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON `json:"-"`
-}
-
-// phaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON
-// contains the JSON metadata for the struct
-// [PhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRule]
-type phaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON struct {
- ID apijson.Field
- Action apijson.Field
- Enabled apijson.Field
- ScoreThreshold apijson.Field
- SensitivityLevel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r phaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON) RawJSON() string {
- return r.raw
-}
-
-// The sensitivity level to use for the rule.
-type PhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel string
-
-const (
- PhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault PhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "default"
- PhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium PhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "medium"
- PhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow PhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "low"
- PhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff PhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "eoff"
-)
-
-func (r PhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel) IsKnown() bool {
- switch r {
- case PhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault, PhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium, PhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow, PhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff:
- return true
- }
- return false
-}
-
-// A sensitivity level to set for all rules. This option has lower precedence than
-// rule and category overrides and is only applicable for DDoS phases.
-type PhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel string
-
-const (
- PhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault PhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "default"
- PhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium PhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "medium"
- PhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow PhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "low"
- PhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff PhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "eoff"
-)
-
-func (r PhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel) IsKnown() bool {
- switch r {
- case PhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault, PhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium, PhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow, PhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff:
- return true
- }
- return false
-}
-
-type PhaseUpdateResponseRulesRulesetsLogRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action PhaseUpdateResponseRulesRulesetsLogRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters interface{} `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON phaseUpdateResponseRulesRulesetsLogRuleJSON `json:"-"`
-}
-
-// phaseUpdateResponseRulesRulesetsLogRuleJSON contains the JSON metadata for the
-// struct [PhaseUpdateResponseRulesRulesetsLogRule]
-type phaseUpdateResponseRulesRulesetsLogRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PhaseUpdateResponseRulesRulesetsLogRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r phaseUpdateResponseRulesRulesetsLogRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r PhaseUpdateResponseRulesRulesetsLogRule) implementsRulesetsPhaseUpdateResponseRule() {}
-
-// The action to perform when the rule matches.
-type PhaseUpdateResponseRulesRulesetsLogRuleAction string
-
-const (
- PhaseUpdateResponseRulesRulesetsLogRuleActionLog PhaseUpdateResponseRulesRulesetsLogRuleAction = "log"
-)
-
-func (r PhaseUpdateResponseRulesRulesetsLogRuleAction) IsKnown() bool {
- switch r {
- case PhaseUpdateResponseRulesRulesetsLogRuleActionLog:
- return true
- }
- return false
-}
-
-type PhaseUpdateResponseRulesRulesetsSkipRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action PhaseUpdateResponseRulesRulesetsSkipRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters PhaseUpdateResponseRulesRulesetsSkipRuleActionParameters `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON phaseUpdateResponseRulesRulesetsSkipRuleJSON `json:"-"`
-}
-
-// phaseUpdateResponseRulesRulesetsSkipRuleJSON contains the JSON metadata for the
-// struct [PhaseUpdateResponseRulesRulesetsSkipRule]
-type phaseUpdateResponseRulesRulesetsSkipRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PhaseUpdateResponseRulesRulesetsSkipRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r phaseUpdateResponseRulesRulesetsSkipRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r PhaseUpdateResponseRulesRulesetsSkipRule) implementsRulesetsPhaseUpdateResponseRule() {}
-
-// The action to perform when the rule matches.
-type PhaseUpdateResponseRulesRulesetsSkipRuleAction string
-
-const (
- PhaseUpdateResponseRulesRulesetsSkipRuleActionSkip PhaseUpdateResponseRulesRulesetsSkipRuleAction = "skip"
-)
-
-func (r PhaseUpdateResponseRulesRulesetsSkipRuleAction) IsKnown() bool {
- switch r {
- case PhaseUpdateResponseRulesRulesetsSkipRuleActionSkip:
- return true
- }
- return false
-}
-
-// The parameters configuring the rule's action.
-type PhaseUpdateResponseRulesRulesetsSkipRuleActionParameters struct {
- // A list of phases to skip the execution of. This option is incompatible with the
- // ruleset and rulesets options.
- Phases []PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhase `json:"phases"`
- // A list of legacy security products to skip the execution of.
- Products []PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersProduct `json:"products"`
- // A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the
- // execution of. This option is incompatible with the ruleset option.
- Rules map[string][]string `json:"rules"`
- // A ruleset to skip the execution of. This option is incompatible with the
- // rulesets, rules and phases options.
- Ruleset PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersRuleset `json:"ruleset"`
- // A list of ruleset IDs to skip the execution of. This option is incompatible with
- // the ruleset and phases options.
- Rulesets []string `json:"rulesets"`
- JSON phaseUpdateResponseRulesRulesetsSkipRuleActionParametersJSON `json:"-"`
-}
-
-// phaseUpdateResponseRulesRulesetsSkipRuleActionParametersJSON contains the JSON
-// metadata for the struct
-// [PhaseUpdateResponseRulesRulesetsSkipRuleActionParameters]
-type phaseUpdateResponseRulesRulesetsSkipRuleActionParametersJSON struct {
- Phases apijson.Field
- Products apijson.Field
- Rules apijson.Field
- Ruleset apijson.Field
- Rulesets apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PhaseUpdateResponseRulesRulesetsSkipRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r phaseUpdateResponseRulesRulesetsSkipRuleActionParametersJSON) RawJSON() string {
- return r.raw
-}
-
-// A phase to skip the execution of.
-type PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhase string
-
-const (
- PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseDDoSL4 PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l4"
- PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseDDoSL7 PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l7"
- PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_config_settings"
- PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_custom_errors"
- PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_log_custom_fields"
- PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRatelimit PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_ratelimit"
- PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_cache_settings"
- PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_dynamic_redirect"
- PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_custom"
- PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_managed"
- PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_late_transform"
- PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_origin"
- PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_redirect"
- PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sanitize"
- PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sbfm"
- PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_select_configuration"
- PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_transform"
- PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_compression"
- PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_firewall_managed"
- PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_headers_transform"
- PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransit PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit"
- PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_ids_managed"
- PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitManaged PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_managed"
-)
-
-func (r PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhase) IsKnown() bool {
- switch r {
- case PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseDDoSL4, PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseDDoSL7, PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings, PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors, PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields, PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRatelimit, PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings, PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect, PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom, PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged, PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform, PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin, PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect, PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize, PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm, PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration, PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform, PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression, PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged, PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform, PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransit, PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged, PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitManaged:
- return true
- }
- return false
-}
-
-// The name of a legacy security product to skip the execution of.
-type PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersProduct string
-
-const (
- PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersProductBic PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersProduct = "bic"
- PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersProductHot PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersProduct = "hot"
- PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersProductRateLimit PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersProduct = "rateLimit"
- PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersProductSecurityLevel PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersProduct = "securityLevel"
- PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersProductUABlock PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersProduct = "uaBlock"
- PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersProductWAF PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersProduct = "waf"
- PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersProductZoneLockdown PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersProduct = "zoneLockdown"
-)
-
-func (r PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersProduct) IsKnown() bool {
- switch r {
- case PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersProductBic, PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersProductHot, PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersProductRateLimit, PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersProductSecurityLevel, PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersProductUABlock, PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersProductWAF, PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersProductZoneLockdown:
- return true
- }
- return false
-}
-
-// A ruleset to skip the execution of. This option is incompatible with the
-// rulesets, rules and phases options.
-type PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersRuleset string
-
-const (
- PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersRulesetCurrent PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersRuleset = "current"
-)
-
-func (r PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersRuleset) IsKnown() bool {
- switch r {
- case PhaseUpdateResponseRulesRulesetsSkipRuleActionParametersRulesetCurrent:
- return true
- }
- return false
-}
-
-// The action to perform when the rule matches.
-type PhaseUpdateResponseRulesAction string
-
-const (
- PhaseUpdateResponseRulesActionBlock PhaseUpdateResponseRulesAction = "block"
- PhaseUpdateResponseRulesActionExecute PhaseUpdateResponseRulesAction = "execute"
- PhaseUpdateResponseRulesActionLog PhaseUpdateResponseRulesAction = "log"
- PhaseUpdateResponseRulesActionSkip PhaseUpdateResponseRulesAction = "skip"
-)
-
-func (r PhaseUpdateResponseRulesAction) IsKnown() bool {
- switch r {
- case PhaseUpdateResponseRulesActionBlock, PhaseUpdateResponseRulesActionExecute, PhaseUpdateResponseRulesActionLog, PhaseUpdateResponseRulesActionSkip:
- return true
- }
- return false
-}
-
// A ruleset object.
type PhaseGetResponse struct {
// The unique ID of the ruleset.
@@ -967,7 +190,7 @@ type PhaseGetResponse struct {
// The phase of the ruleset.
Phase PhaseGetResponsePhase `json:"phase,required"`
// The list of rules in the ruleset.
- Rules []PhaseGetResponseRule `json:"rules,required"`
+ Rules []RequestRule `json:"rules,required"`
// The version of the ruleset.
Version string `json:"version,required"`
// An informative description of the ruleset.
@@ -1053,797 +276,25 @@ func (r PhaseGetResponsePhase) IsKnown() bool {
return false
}
-type PhaseGetResponseRule struct {
- // The action to perform when the rule matches.
- Action PhaseGetResponseRulesAction `json:"action"`
- ActionParameters interface{} `json:"action_parameters,required"`
- Categories interface{} `json:"categories,required"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // An object configuring the rule's logging behavior.
- Logging shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- // The version of the rule.
- Version string `json:"version,required"`
- JSON phaseGetResponseRuleJSON `json:"-"`
- union PhaseGetResponseRulesUnion
-}
-
-// phaseGetResponseRuleJSON contains the JSON metadata for the struct
-// [PhaseGetResponseRule]
-type phaseGetResponseRuleJSON struct {
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- ID apijson.Field
- LastUpdated apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- Version apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r phaseGetResponseRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r *PhaseGetResponseRule) UnmarshalJSON(data []byte) (err error) {
- err = apijson.UnmarshalRoot(data, &r.union)
- if err != nil {
- return err
- }
- return apijson.Port(r.union, &r)
-}
-
-func (r PhaseGetResponseRule) AsUnion() PhaseGetResponseRulesUnion {
- return r.union
-}
-
-// Union satisfied by [rulesets.PhaseGetResponseRulesRulesetsBlockRule],
-// [rulesets.PhaseGetResponseRulesRulesetsExecuteRule],
-// [rulesets.PhaseGetResponseRulesRulesetsLogRule] or
-// [rulesets.PhaseGetResponseRulesRulesetsSkipRule].
-type PhaseGetResponseRulesUnion interface {
- implementsRulesetsPhaseGetResponseRule()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*PhaseGetResponseRulesUnion)(nil)).Elem(),
- "action",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(PhaseGetResponseRulesRulesetsBlockRule{}),
- DiscriminatorValue: "block",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(PhaseGetResponseRulesRulesetsExecuteRule{}),
- DiscriminatorValue: "execute",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(PhaseGetResponseRulesRulesetsLogRule{}),
- DiscriminatorValue: "log",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(PhaseGetResponseRulesRulesetsSkipRule{}),
- DiscriminatorValue: "skip",
- },
- )
-}
-
-type PhaseGetResponseRulesRulesetsBlockRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action PhaseGetResponseRulesRulesetsBlockRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters PhaseGetResponseRulesRulesetsBlockRuleActionParameters `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON phaseGetResponseRulesRulesetsBlockRuleJSON `json:"-"`
-}
-
-// phaseGetResponseRulesRulesetsBlockRuleJSON contains the JSON metadata for the
-// struct [PhaseGetResponseRulesRulesetsBlockRule]
-type phaseGetResponseRulesRulesetsBlockRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PhaseGetResponseRulesRulesetsBlockRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
+type PhaseUpdateParams struct {
+ // The list of rules in the ruleset.
+ Rules param.Field[[]RequestRuleUnionParam] `json:"rules,required"`
+ // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+ AccountID param.Field[string] `path:"account_id"`
+ // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+ ZoneID param.Field[string] `path:"zone_id"`
+ // An informative description of the ruleset.
+ Description param.Field[string] `json:"description"`
+ // The kind of the ruleset.
+ Kind param.Field[PhaseUpdateParamsKind] `json:"kind"`
+ // The human-readable name of the ruleset.
+ Name param.Field[string] `json:"name"`
+ // The phase of the ruleset.
+ Phase param.Field[PhaseUpdateParamsPhase] `json:"phase"`
}
-func (r phaseGetResponseRulesRulesetsBlockRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r PhaseGetResponseRulesRulesetsBlockRule) implementsRulesetsPhaseGetResponseRule() {}
-
-// The action to perform when the rule matches.
-type PhaseGetResponseRulesRulesetsBlockRuleAction string
-
-const (
- PhaseGetResponseRulesRulesetsBlockRuleActionBlock PhaseGetResponseRulesRulesetsBlockRuleAction = "block"
-)
-
-func (r PhaseGetResponseRulesRulesetsBlockRuleAction) IsKnown() bool {
- switch r {
- case PhaseGetResponseRulesRulesetsBlockRuleActionBlock:
- return true
- }
- return false
-}
-
-// The parameters configuring the rule's action.
-type PhaseGetResponseRulesRulesetsBlockRuleActionParameters struct {
- // The response to show when the block is applied.
- Response PhaseGetResponseRulesRulesetsBlockRuleActionParametersResponse `json:"response"`
- JSON phaseGetResponseRulesRulesetsBlockRuleActionParametersJSON `json:"-"`
-}
-
-// phaseGetResponseRulesRulesetsBlockRuleActionParametersJSON contains the JSON
-// metadata for the struct [PhaseGetResponseRulesRulesetsBlockRuleActionParameters]
-type phaseGetResponseRulesRulesetsBlockRuleActionParametersJSON struct {
- Response apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PhaseGetResponseRulesRulesetsBlockRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r phaseGetResponseRulesRulesetsBlockRuleActionParametersJSON) RawJSON() string {
- return r.raw
-}
-
-// The response to show when the block is applied.
-type PhaseGetResponseRulesRulesetsBlockRuleActionParametersResponse struct {
- // The content to return.
- Content string `json:"content,required"`
- // The type of the content to return.
- ContentType string `json:"content_type,required"`
- // The status code to return.
- StatusCode int64 `json:"status_code,required"`
- JSON phaseGetResponseRulesRulesetsBlockRuleActionParametersResponseJSON `json:"-"`
-}
-
-// phaseGetResponseRulesRulesetsBlockRuleActionParametersResponseJSON contains the
-// JSON metadata for the struct
-// [PhaseGetResponseRulesRulesetsBlockRuleActionParametersResponse]
-type phaseGetResponseRulesRulesetsBlockRuleActionParametersResponseJSON struct {
- Content apijson.Field
- ContentType apijson.Field
- StatusCode apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PhaseGetResponseRulesRulesetsBlockRuleActionParametersResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r phaseGetResponseRulesRulesetsBlockRuleActionParametersResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type PhaseGetResponseRulesRulesetsExecuteRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action PhaseGetResponseRulesRulesetsExecuteRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters PhaseGetResponseRulesRulesetsExecuteRuleActionParameters `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON phaseGetResponseRulesRulesetsExecuteRuleJSON `json:"-"`
-}
-
-// phaseGetResponseRulesRulesetsExecuteRuleJSON contains the JSON metadata for the
-// struct [PhaseGetResponseRulesRulesetsExecuteRule]
-type phaseGetResponseRulesRulesetsExecuteRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PhaseGetResponseRulesRulesetsExecuteRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r phaseGetResponseRulesRulesetsExecuteRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r PhaseGetResponseRulesRulesetsExecuteRule) implementsRulesetsPhaseGetResponseRule() {}
-
-// The action to perform when the rule matches.
-type PhaseGetResponseRulesRulesetsExecuteRuleAction string
-
-const (
- PhaseGetResponseRulesRulesetsExecuteRuleActionExecute PhaseGetResponseRulesRulesetsExecuteRuleAction = "execute"
-)
-
-func (r PhaseGetResponseRulesRulesetsExecuteRuleAction) IsKnown() bool {
- switch r {
- case PhaseGetResponseRulesRulesetsExecuteRuleActionExecute:
- return true
- }
- return false
-}
-
-// The parameters configuring the rule's action.
-type PhaseGetResponseRulesRulesetsExecuteRuleActionParameters struct {
- // The ID of the ruleset to execute.
- ID string `json:"id,required"`
- // The configuration to use for matched data logging.
- MatchedData PhaseGetResponseRulesRulesetsExecuteRuleActionParametersMatchedData `json:"matched_data"`
- // A set of overrides to apply to the target ruleset.
- Overrides PhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverrides `json:"overrides"`
- JSON phaseGetResponseRulesRulesetsExecuteRuleActionParametersJSON `json:"-"`
-}
-
-// phaseGetResponseRulesRulesetsExecuteRuleActionParametersJSON contains the JSON
-// metadata for the struct
-// [PhaseGetResponseRulesRulesetsExecuteRuleActionParameters]
-type phaseGetResponseRulesRulesetsExecuteRuleActionParametersJSON struct {
- ID apijson.Field
- MatchedData apijson.Field
- Overrides apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PhaseGetResponseRulesRulesetsExecuteRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r phaseGetResponseRulesRulesetsExecuteRuleActionParametersJSON) RawJSON() string {
- return r.raw
-}
-
-// The configuration to use for matched data logging.
-type PhaseGetResponseRulesRulesetsExecuteRuleActionParametersMatchedData struct {
- // The public key to encrypt matched data logs with.
- PublicKey string `json:"public_key,required"`
- JSON phaseGetResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON `json:"-"`
-}
-
-// phaseGetResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON contains
-// the JSON metadata for the struct
-// [PhaseGetResponseRulesRulesetsExecuteRuleActionParametersMatchedData]
-type phaseGetResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON struct {
- PublicKey apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PhaseGetResponseRulesRulesetsExecuteRuleActionParametersMatchedData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r phaseGetResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON) RawJSON() string {
- return r.raw
-}
-
-// A set of overrides to apply to the target ruleset.
-type PhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverrides struct {
- // An action to override all rules with. This option has lower precedence than rule
- // and category overrides.
- Action string `json:"action"`
- // A list of category-level overrides. This option has the second-highest
- // precedence after rule-level overrides.
- Categories []PhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory `json:"categories"`
- // Whether to enable execution of all rules. This option has lower precedence than
- // rule and category overrides.
- Enabled bool `json:"enabled"`
- // A list of rule-level overrides. This option has the highest precedence.
- Rules []PhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRule `json:"rules"`
- // A sensitivity level to set for all rules. This option has lower precedence than
- // rule and category overrides and is only applicable for DDoS phases.
- SensitivityLevel PhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel `json:"sensitivity_level"`
- JSON phaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON `json:"-"`
-}
-
-// phaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON contains
-// the JSON metadata for the struct
-// [PhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverrides]
-type phaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON struct {
- Action apijson.Field
- Categories apijson.Field
- Enabled apijson.Field
- Rules apijson.Field
- SensitivityLevel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverrides) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r phaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON) RawJSON() string {
- return r.raw
-}
-
-// A category-level override
-type PhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory struct {
- // The name of the category to override.
- Category string `json:"category,required"`
- // The action to override rules in the category with.
- Action string `json:"action"`
- // Whether to enable execution of rules in the category.
- Enabled bool `json:"enabled"`
- // The sensitivity level to use for rules in the category.
- SensitivityLevel PhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel `json:"sensitivity_level"`
- JSON phaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON `json:"-"`
-}
-
-// phaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON
-// contains the JSON metadata for the struct
-// [PhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory]
-type phaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON struct {
- Category apijson.Field
- Action apijson.Field
- Enabled apijson.Field
- SensitivityLevel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r phaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON) RawJSON() string {
- return r.raw
-}
-
-// The sensitivity level to use for rules in the category.
-type PhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel string
-
-const (
- PhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault PhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "default"
- PhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium PhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "medium"
- PhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow PhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "low"
- PhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff PhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "eoff"
-)
-
-func (r PhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel) IsKnown() bool {
- switch r {
- case PhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault, PhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium, PhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow, PhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff:
- return true
- }
- return false
-}
-
-// A rule-level override
-type PhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRule struct {
- // The ID of the rule to override.
- ID string `json:"id,required"`
- // The action to override the rule with.
- Action string `json:"action"`
- // Whether to enable execution of the rule.
- Enabled bool `json:"enabled"`
- // The score threshold to use for the rule.
- ScoreThreshold int64 `json:"score_threshold"`
- // The sensitivity level to use for the rule.
- SensitivityLevel PhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel `json:"sensitivity_level"`
- JSON phaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON `json:"-"`
-}
-
-// phaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON
-// contains the JSON metadata for the struct
-// [PhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRule]
-type phaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON struct {
- ID apijson.Field
- Action apijson.Field
- Enabled apijson.Field
- ScoreThreshold apijson.Field
- SensitivityLevel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r phaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON) RawJSON() string {
- return r.raw
-}
-
-// The sensitivity level to use for the rule.
-type PhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel string
-
-const (
- PhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault PhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "default"
- PhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium PhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "medium"
- PhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow PhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "low"
- PhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff PhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "eoff"
-)
-
-func (r PhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel) IsKnown() bool {
- switch r {
- case PhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault, PhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium, PhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow, PhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff:
- return true
- }
- return false
-}
-
-// A sensitivity level to set for all rules. This option has lower precedence than
-// rule and category overrides and is only applicable for DDoS phases.
-type PhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel string
-
-const (
- PhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault PhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "default"
- PhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium PhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "medium"
- PhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow PhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "low"
- PhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff PhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "eoff"
-)
-
-func (r PhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel) IsKnown() bool {
- switch r {
- case PhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault, PhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium, PhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow, PhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff:
- return true
- }
- return false
-}
-
-type PhaseGetResponseRulesRulesetsLogRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action PhaseGetResponseRulesRulesetsLogRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters interface{} `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON phaseGetResponseRulesRulesetsLogRuleJSON `json:"-"`
-}
-
-// phaseGetResponseRulesRulesetsLogRuleJSON contains the JSON metadata for the
-// struct [PhaseGetResponseRulesRulesetsLogRule]
-type phaseGetResponseRulesRulesetsLogRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PhaseGetResponseRulesRulesetsLogRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r phaseGetResponseRulesRulesetsLogRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r PhaseGetResponseRulesRulesetsLogRule) implementsRulesetsPhaseGetResponseRule() {}
-
-// The action to perform when the rule matches.
-type PhaseGetResponseRulesRulesetsLogRuleAction string
-
-const (
- PhaseGetResponseRulesRulesetsLogRuleActionLog PhaseGetResponseRulesRulesetsLogRuleAction = "log"
-)
-
-func (r PhaseGetResponseRulesRulesetsLogRuleAction) IsKnown() bool {
- switch r {
- case PhaseGetResponseRulesRulesetsLogRuleActionLog:
- return true
- }
- return false
-}
-
-type PhaseGetResponseRulesRulesetsSkipRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action PhaseGetResponseRulesRulesetsSkipRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters PhaseGetResponseRulesRulesetsSkipRuleActionParameters `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON phaseGetResponseRulesRulesetsSkipRuleJSON `json:"-"`
-}
-
-// phaseGetResponseRulesRulesetsSkipRuleJSON contains the JSON metadata for the
-// struct [PhaseGetResponseRulesRulesetsSkipRule]
-type phaseGetResponseRulesRulesetsSkipRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PhaseGetResponseRulesRulesetsSkipRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r phaseGetResponseRulesRulesetsSkipRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r PhaseGetResponseRulesRulesetsSkipRule) implementsRulesetsPhaseGetResponseRule() {}
-
-// The action to perform when the rule matches.
-type PhaseGetResponseRulesRulesetsSkipRuleAction string
-
-const (
- PhaseGetResponseRulesRulesetsSkipRuleActionSkip PhaseGetResponseRulesRulesetsSkipRuleAction = "skip"
-)
-
-func (r PhaseGetResponseRulesRulesetsSkipRuleAction) IsKnown() bool {
- switch r {
- case PhaseGetResponseRulesRulesetsSkipRuleActionSkip:
- return true
- }
- return false
-}
-
-// The parameters configuring the rule's action.
-type PhaseGetResponseRulesRulesetsSkipRuleActionParameters struct {
- // A list of phases to skip the execution of. This option is incompatible with the
- // ruleset and rulesets options.
- Phases []PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhase `json:"phases"`
- // A list of legacy security products to skip the execution of.
- Products []PhaseGetResponseRulesRulesetsSkipRuleActionParametersProduct `json:"products"`
- // A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the
- // execution of. This option is incompatible with the ruleset option.
- Rules map[string][]string `json:"rules"`
- // A ruleset to skip the execution of. This option is incompatible with the
- // rulesets, rules and phases options.
- Ruleset PhaseGetResponseRulesRulesetsSkipRuleActionParametersRuleset `json:"ruleset"`
- // A list of ruleset IDs to skip the execution of. This option is incompatible with
- // the ruleset and phases options.
- Rulesets []string `json:"rulesets"`
- JSON phaseGetResponseRulesRulesetsSkipRuleActionParametersJSON `json:"-"`
-}
-
-// phaseGetResponseRulesRulesetsSkipRuleActionParametersJSON contains the JSON
-// metadata for the struct [PhaseGetResponseRulesRulesetsSkipRuleActionParameters]
-type phaseGetResponseRulesRulesetsSkipRuleActionParametersJSON struct {
- Phases apijson.Field
- Products apijson.Field
- Rules apijson.Field
- Ruleset apijson.Field
- Rulesets apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PhaseGetResponseRulesRulesetsSkipRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r phaseGetResponseRulesRulesetsSkipRuleActionParametersJSON) RawJSON() string {
- return r.raw
-}
-
-// A phase to skip the execution of.
-type PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhase string
-
-const (
- PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseDDoSL4 PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l4"
- PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseDDoSL7 PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l7"
- PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_config_settings"
- PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_custom_errors"
- PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_log_custom_fields"
- PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRatelimit PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_ratelimit"
- PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_cache_settings"
- PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_dynamic_redirect"
- PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_custom"
- PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_managed"
- PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_late_transform"
- PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_origin"
- PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_redirect"
- PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sanitize"
- PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sbfm"
- PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_select_configuration"
- PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_transform"
- PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_compression"
- PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_firewall_managed"
- PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_headers_transform"
- PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransit PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit"
- PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_ids_managed"
- PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitManaged PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_managed"
-)
-
-func (r PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhase) IsKnown() bool {
- switch r {
- case PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseDDoSL4, PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseDDoSL7, PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings, PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors, PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields, PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRatelimit, PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings, PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect, PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom, PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged, PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform, PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin, PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect, PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize, PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm, PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration, PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform, PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression, PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged, PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform, PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransit, PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged, PhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitManaged:
- return true
- }
- return false
-}
-
-// The name of a legacy security product to skip the execution of.
-type PhaseGetResponseRulesRulesetsSkipRuleActionParametersProduct string
-
-const (
- PhaseGetResponseRulesRulesetsSkipRuleActionParametersProductBic PhaseGetResponseRulesRulesetsSkipRuleActionParametersProduct = "bic"
- PhaseGetResponseRulesRulesetsSkipRuleActionParametersProductHot PhaseGetResponseRulesRulesetsSkipRuleActionParametersProduct = "hot"
- PhaseGetResponseRulesRulesetsSkipRuleActionParametersProductRateLimit PhaseGetResponseRulesRulesetsSkipRuleActionParametersProduct = "rateLimit"
- PhaseGetResponseRulesRulesetsSkipRuleActionParametersProductSecurityLevel PhaseGetResponseRulesRulesetsSkipRuleActionParametersProduct = "securityLevel"
- PhaseGetResponseRulesRulesetsSkipRuleActionParametersProductUABlock PhaseGetResponseRulesRulesetsSkipRuleActionParametersProduct = "uaBlock"
- PhaseGetResponseRulesRulesetsSkipRuleActionParametersProductWAF PhaseGetResponseRulesRulesetsSkipRuleActionParametersProduct = "waf"
- PhaseGetResponseRulesRulesetsSkipRuleActionParametersProductZoneLockdown PhaseGetResponseRulesRulesetsSkipRuleActionParametersProduct = "zoneLockdown"
-)
-
-func (r PhaseGetResponseRulesRulesetsSkipRuleActionParametersProduct) IsKnown() bool {
- switch r {
- case PhaseGetResponseRulesRulesetsSkipRuleActionParametersProductBic, PhaseGetResponseRulesRulesetsSkipRuleActionParametersProductHot, PhaseGetResponseRulesRulesetsSkipRuleActionParametersProductRateLimit, PhaseGetResponseRulesRulesetsSkipRuleActionParametersProductSecurityLevel, PhaseGetResponseRulesRulesetsSkipRuleActionParametersProductUABlock, PhaseGetResponseRulesRulesetsSkipRuleActionParametersProductWAF, PhaseGetResponseRulesRulesetsSkipRuleActionParametersProductZoneLockdown:
- return true
- }
- return false
-}
-
-// A ruleset to skip the execution of. This option is incompatible with the
-// rulesets, rules and phases options.
-type PhaseGetResponseRulesRulesetsSkipRuleActionParametersRuleset string
-
-const (
- PhaseGetResponseRulesRulesetsSkipRuleActionParametersRulesetCurrent PhaseGetResponseRulesRulesetsSkipRuleActionParametersRuleset = "current"
-)
-
-func (r PhaseGetResponseRulesRulesetsSkipRuleActionParametersRuleset) IsKnown() bool {
- switch r {
- case PhaseGetResponseRulesRulesetsSkipRuleActionParametersRulesetCurrent:
- return true
- }
- return false
-}
-
-// The action to perform when the rule matches.
-type PhaseGetResponseRulesAction string
-
-const (
- PhaseGetResponseRulesActionBlock PhaseGetResponseRulesAction = "block"
- PhaseGetResponseRulesActionExecute PhaseGetResponseRulesAction = "execute"
- PhaseGetResponseRulesActionLog PhaseGetResponseRulesAction = "log"
- PhaseGetResponseRulesActionSkip PhaseGetResponseRulesAction = "skip"
-)
-
-func (r PhaseGetResponseRulesAction) IsKnown() bool {
- switch r {
- case PhaseGetResponseRulesActionBlock, PhaseGetResponseRulesActionExecute, PhaseGetResponseRulesActionLog, PhaseGetResponseRulesActionSkip:
- return true
- }
- return false
-}
-
-type PhaseUpdateParams struct {
- // The list of rules in the ruleset.
- Rules param.Field[[]PhaseUpdateParamsRuleUnion] `json:"rules,required"`
- // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
- AccountID param.Field[string] `path:"account_id"`
- // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- ZoneID param.Field[string] `path:"zone_id"`
- // An informative description of the ruleset.
- Description param.Field[string] `json:"description"`
- // The kind of the ruleset.
- Kind param.Field[PhaseUpdateParamsKind] `json:"kind"`
- // The human-readable name of the ruleset.
- Name param.Field[string] `json:"name"`
- // The phase of the ruleset.
- Phase param.Field[PhaseUpdateParamsPhase] `json:"phase"`
-}
-
-func (r PhaseUpdateParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
+func (r PhaseUpdateParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
}
// The phase of the ruleset.
@@ -1883,472 +334,6 @@ func (r PhaseUpdateParamsRulesetPhase) IsKnown() bool {
return false
}
-type PhaseUpdateParamsRule struct {
- // The action to perform when the rule matches.
- Action param.Field[PhaseUpdateParamsRulesAction] `json:"action"`
- ActionParameters param.Field[interface{}] `json:"action_parameters,required"`
- Categories param.Field[interface{}] `json:"categories,required"`
- // An informative description of the rule.
- Description param.Field[string] `json:"description"`
- // Whether the rule should be executed.
- Enabled param.Field[bool] `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression param.Field[string] `json:"expression"`
- // The unique ID of the rule.
- ID param.Field[string] `json:"id"`
- // An object configuring the rule's logging behavior.
- Logging param.Field[shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751cParam] `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref param.Field[string] `json:"ref"`
-}
-
-func (r PhaseUpdateParamsRule) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-func (r PhaseUpdateParamsRule) implementsRulesetsPhaseUpdateParamsRuleUnion() {}
-
-// Satisfied by [rulesets.PhaseUpdateParamsRulesRulesetsBlockRule],
-// [rulesets.PhaseUpdateParamsRulesRulesetsExecuteRule],
-// [rulesets.PhaseUpdateParamsRulesRulesetsLogRule],
-// [rulesets.PhaseUpdateParamsRulesRulesetsSkipRule], [PhaseUpdateParamsRule].
-type PhaseUpdateParamsRuleUnion interface {
- implementsRulesetsPhaseUpdateParamsRuleUnion()
-}
-
-type PhaseUpdateParamsRulesRulesetsBlockRule struct {
- // The unique ID of the rule.
- ID param.Field[string] `json:"id"`
- // The action to perform when the rule matches.
- Action param.Field[PhaseUpdateParamsRulesRulesetsBlockRuleAction] `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters param.Field[PhaseUpdateParamsRulesRulesetsBlockRuleActionParameters] `json:"action_parameters"`
- // An informative description of the rule.
- Description param.Field[string] `json:"description"`
- // Whether the rule should be executed.
- Enabled param.Field[bool] `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression param.Field[string] `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging param.Field[shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751cParam] `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref param.Field[string] `json:"ref"`
-}
-
-func (r PhaseUpdateParamsRulesRulesetsBlockRule) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-func (r PhaseUpdateParamsRulesRulesetsBlockRule) implementsRulesetsPhaseUpdateParamsRuleUnion() {}
-
-// The action to perform when the rule matches.
-type PhaseUpdateParamsRulesRulesetsBlockRuleAction string
-
-const (
- PhaseUpdateParamsRulesRulesetsBlockRuleActionBlock PhaseUpdateParamsRulesRulesetsBlockRuleAction = "block"
-)
-
-func (r PhaseUpdateParamsRulesRulesetsBlockRuleAction) IsKnown() bool {
- switch r {
- case PhaseUpdateParamsRulesRulesetsBlockRuleActionBlock:
- return true
- }
- return false
-}
-
-// The parameters configuring the rule's action.
-type PhaseUpdateParamsRulesRulesetsBlockRuleActionParameters struct {
- // The response to show when the block is applied.
- Response param.Field[PhaseUpdateParamsRulesRulesetsBlockRuleActionParametersResponse] `json:"response"`
-}
-
-func (r PhaseUpdateParamsRulesRulesetsBlockRuleActionParameters) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The response to show when the block is applied.
-type PhaseUpdateParamsRulesRulesetsBlockRuleActionParametersResponse struct {
- // The content to return.
- Content param.Field[string] `json:"content,required"`
- // The type of the content to return.
- ContentType param.Field[string] `json:"content_type,required"`
- // The status code to return.
- StatusCode param.Field[int64] `json:"status_code,required"`
-}
-
-func (r PhaseUpdateParamsRulesRulesetsBlockRuleActionParametersResponse) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type PhaseUpdateParamsRulesRulesetsExecuteRule struct {
- // The unique ID of the rule.
- ID param.Field[string] `json:"id"`
- // The action to perform when the rule matches.
- Action param.Field[PhaseUpdateParamsRulesRulesetsExecuteRuleAction] `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters param.Field[PhaseUpdateParamsRulesRulesetsExecuteRuleActionParameters] `json:"action_parameters"`
- // An informative description of the rule.
- Description param.Field[string] `json:"description"`
- // Whether the rule should be executed.
- Enabled param.Field[bool] `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression param.Field[string] `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging param.Field[shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751cParam] `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref param.Field[string] `json:"ref"`
-}
-
-func (r PhaseUpdateParamsRulesRulesetsExecuteRule) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-func (r PhaseUpdateParamsRulesRulesetsExecuteRule) implementsRulesetsPhaseUpdateParamsRuleUnion() {}
-
-// The action to perform when the rule matches.
-type PhaseUpdateParamsRulesRulesetsExecuteRuleAction string
-
-const (
- PhaseUpdateParamsRulesRulesetsExecuteRuleActionExecute PhaseUpdateParamsRulesRulesetsExecuteRuleAction = "execute"
-)
-
-func (r PhaseUpdateParamsRulesRulesetsExecuteRuleAction) IsKnown() bool {
- switch r {
- case PhaseUpdateParamsRulesRulesetsExecuteRuleActionExecute:
- return true
- }
- return false
-}
-
-// The parameters configuring the rule's action.
-type PhaseUpdateParamsRulesRulesetsExecuteRuleActionParameters struct {
- // The ID of the ruleset to execute.
- ID param.Field[string] `json:"id,required"`
- // The configuration to use for matched data logging.
- MatchedData param.Field[PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersMatchedData] `json:"matched_data"`
- // A set of overrides to apply to the target ruleset.
- Overrides param.Field[PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverrides] `json:"overrides"`
-}
-
-func (r PhaseUpdateParamsRulesRulesetsExecuteRuleActionParameters) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The configuration to use for matched data logging.
-type PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersMatchedData struct {
- // The public key to encrypt matched data logs with.
- PublicKey param.Field[string] `json:"public_key,required"`
-}
-
-func (r PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersMatchedData) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// A set of overrides to apply to the target ruleset.
-type PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverrides struct {
- // An action to override all rules with. This option has lower precedence than rule
- // and category overrides.
- Action param.Field[string] `json:"action"`
- // A list of category-level overrides. This option has the second-highest
- // precedence after rule-level overrides.
- Categories param.Field[[]PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategory] `json:"categories"`
- // Whether to enable execution of all rules. This option has lower precedence than
- // rule and category overrides.
- Enabled param.Field[bool] `json:"enabled"`
- // A list of rule-level overrides. This option has the highest precedence.
- Rules param.Field[[]PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRule] `json:"rules"`
- // A sensitivity level to set for all rules. This option has lower precedence than
- // rule and category overrides and is only applicable for DDoS phases.
- SensitivityLevel param.Field[PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel] `json:"sensitivity_level"`
-}
-
-func (r PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverrides) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// A category-level override
-type PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategory struct {
- // The name of the category to override.
- Category param.Field[string] `json:"category,required"`
- // The action to override rules in the category with.
- Action param.Field[string] `json:"action"`
- // Whether to enable execution of rules in the category.
- Enabled param.Field[bool] `json:"enabled"`
- // The sensitivity level to use for rules in the category.
- SensitivityLevel param.Field[PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel] `json:"sensitivity_level"`
-}
-
-func (r PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategory) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The sensitivity level to use for rules in the category.
-type PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel string
-
-const (
- PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "default"
- PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "medium"
- PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "low"
- PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "eoff"
-)
-
-func (r PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel) IsKnown() bool {
- switch r {
- case PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault, PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium, PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow, PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff:
- return true
- }
- return false
-}
-
-// A rule-level override
-type PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRule struct {
- // The ID of the rule to override.
- ID param.Field[string] `json:"id,required"`
- // The action to override the rule with.
- Action param.Field[string] `json:"action"`
- // Whether to enable execution of the rule.
- Enabled param.Field[bool] `json:"enabled"`
- // The score threshold to use for the rule.
- ScoreThreshold param.Field[int64] `json:"score_threshold"`
- // The sensitivity level to use for the rule.
- SensitivityLevel param.Field[PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel] `json:"sensitivity_level"`
-}
-
-func (r PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRule) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The sensitivity level to use for the rule.
-type PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel string
-
-const (
- PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "default"
- PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "medium"
- PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "low"
- PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "eoff"
-)
-
-func (r PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel) IsKnown() bool {
- switch r {
- case PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault, PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium, PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow, PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff:
- return true
- }
- return false
-}
-
-// A sensitivity level to set for all rules. This option has lower precedence than
-// rule and category overrides and is only applicable for DDoS phases.
-type PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel string
-
-const (
- PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "default"
- PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "medium"
- PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "low"
- PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "eoff"
-)
-
-func (r PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel) IsKnown() bool {
- switch r {
- case PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault, PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium, PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow, PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff:
- return true
- }
- return false
-}
-
-type PhaseUpdateParamsRulesRulesetsLogRule struct {
- // The unique ID of the rule.
- ID param.Field[string] `json:"id"`
- // The action to perform when the rule matches.
- Action param.Field[PhaseUpdateParamsRulesRulesetsLogRuleAction] `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters param.Field[interface{}] `json:"action_parameters"`
- // An informative description of the rule.
- Description param.Field[string] `json:"description"`
- // Whether the rule should be executed.
- Enabled param.Field[bool] `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression param.Field[string] `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging param.Field[shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751cParam] `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref param.Field[string] `json:"ref"`
-}
-
-func (r PhaseUpdateParamsRulesRulesetsLogRule) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-func (r PhaseUpdateParamsRulesRulesetsLogRule) implementsRulesetsPhaseUpdateParamsRuleUnion() {}
-
-// The action to perform when the rule matches.
-type PhaseUpdateParamsRulesRulesetsLogRuleAction string
-
-const (
- PhaseUpdateParamsRulesRulesetsLogRuleActionLog PhaseUpdateParamsRulesRulesetsLogRuleAction = "log"
-)
-
-func (r PhaseUpdateParamsRulesRulesetsLogRuleAction) IsKnown() bool {
- switch r {
- case PhaseUpdateParamsRulesRulesetsLogRuleActionLog:
- return true
- }
- return false
-}
-
-type PhaseUpdateParamsRulesRulesetsSkipRule struct {
- // The unique ID of the rule.
- ID param.Field[string] `json:"id"`
- // The action to perform when the rule matches.
- Action param.Field[PhaseUpdateParamsRulesRulesetsSkipRuleAction] `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters param.Field[PhaseUpdateParamsRulesRulesetsSkipRuleActionParameters] `json:"action_parameters"`
- // An informative description of the rule.
- Description param.Field[string] `json:"description"`
- // Whether the rule should be executed.
- Enabled param.Field[bool] `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression param.Field[string] `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging param.Field[shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751cParam] `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref param.Field[string] `json:"ref"`
-}
-
-func (r PhaseUpdateParamsRulesRulesetsSkipRule) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-func (r PhaseUpdateParamsRulesRulesetsSkipRule) implementsRulesetsPhaseUpdateParamsRuleUnion() {}
-
-// The action to perform when the rule matches.
-type PhaseUpdateParamsRulesRulesetsSkipRuleAction string
-
-const (
- PhaseUpdateParamsRulesRulesetsSkipRuleActionSkip PhaseUpdateParamsRulesRulesetsSkipRuleAction = "skip"
-)
-
-func (r PhaseUpdateParamsRulesRulesetsSkipRuleAction) IsKnown() bool {
- switch r {
- case PhaseUpdateParamsRulesRulesetsSkipRuleActionSkip:
- return true
- }
- return false
-}
-
-// The parameters configuring the rule's action.
-type PhaseUpdateParamsRulesRulesetsSkipRuleActionParameters struct {
- // A list of phases to skip the execution of. This option is incompatible with the
- // ruleset and rulesets options.
- Phases param.Field[[]PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase] `json:"phases"`
- // A list of legacy security products to skip the execution of.
- Products param.Field[[]PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersProduct] `json:"products"`
- // A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the
- // execution of. This option is incompatible with the ruleset option.
- Rules param.Field[map[string][]string] `json:"rules"`
- // A ruleset to skip the execution of. This option is incompatible with the
- // rulesets, rules and phases options.
- Ruleset param.Field[PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersRuleset] `json:"ruleset"`
- // A list of ruleset IDs to skip the execution of. This option is incompatible with
- // the ruleset and phases options.
- Rulesets param.Field[[]string] `json:"rulesets"`
-}
-
-func (r PhaseUpdateParamsRulesRulesetsSkipRuleActionParameters) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// A phase to skip the execution of.
-type PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase string
-
-const (
- PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseDDoSL4 PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "ddos_l4"
- PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseDDoSL7 PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "ddos_l7"
- PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_config_settings"
- PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_custom_errors"
- PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_log_custom_fields"
- PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRatelimit PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_ratelimit"
- PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_cache_settings"
- PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_dynamic_redirect"
- PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_custom"
- PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_managed"
- PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_late_transform"
- PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_origin"
- PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_redirect"
- PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_sanitize"
- PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_sbfm"
- PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_select_configuration"
- PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_transform"
- PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_response_compression"
- PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_response_firewall_managed"
- PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_response_headers_transform"
- PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseMagicTransit PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "magic_transit"
- PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_ids_managed"
- PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseMagicTransitManaged PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_managed"
-)
-
-func (r PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase) IsKnown() bool {
- switch r {
- case PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseDDoSL4, PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseDDoSL7, PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings, PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors, PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields, PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRatelimit, PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings, PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect, PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom, PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged, PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform, PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin, PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect, PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize, PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm, PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration, PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform, PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression, PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged, PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform, PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseMagicTransit, PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged, PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseMagicTransitManaged:
- return true
- }
- return false
-}
-
-// The name of a legacy security product to skip the execution of.
-type PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersProduct string
-
-const (
- PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersProductBic PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersProduct = "bic"
- PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersProductHot PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersProduct = "hot"
- PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersProductRateLimit PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersProduct = "rateLimit"
- PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersProductSecurityLevel PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersProduct = "securityLevel"
- PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersProductUABlock PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersProduct = "uaBlock"
- PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersProductWAF PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersProduct = "waf"
- PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersProductZoneLockdown PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersProduct = "zoneLockdown"
-)
-
-func (r PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersProduct) IsKnown() bool {
- switch r {
- case PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersProductBic, PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersProductHot, PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersProductRateLimit, PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersProductSecurityLevel, PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersProductUABlock, PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersProductWAF, PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersProductZoneLockdown:
- return true
- }
- return false
-}
-
-// A ruleset to skip the execution of. This option is incompatible with the
-// rulesets, rules and phases options.
-type PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersRuleset string
-
-const (
- PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersRulesetCurrent PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersRuleset = "current"
-)
-
-func (r PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersRuleset) IsKnown() bool {
- switch r {
- case PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersRulesetCurrent:
- return true
- }
- return false
-}
-
-// The action to perform when the rule matches.
-type PhaseUpdateParamsRulesAction string
-
-const (
- PhaseUpdateParamsRulesActionBlock PhaseUpdateParamsRulesAction = "block"
- PhaseUpdateParamsRulesActionExecute PhaseUpdateParamsRulesAction = "execute"
- PhaseUpdateParamsRulesActionLog PhaseUpdateParamsRulesAction = "log"
- PhaseUpdateParamsRulesActionSkip PhaseUpdateParamsRulesAction = "skip"
-)
-
-func (r PhaseUpdateParamsRulesAction) IsKnown() bool {
- switch r {
- case PhaseUpdateParamsRulesActionBlock, PhaseUpdateParamsRulesActionExecute, PhaseUpdateParamsRulesActionLog, PhaseUpdateParamsRulesActionSkip:
- return true
- }
- return false
-}
-
// The kind of the ruleset.
type PhaseUpdateParamsKind string
diff --git a/rulesets/phase_test.go b/rulesets/phase_test.go
index ef20fd32aad..9059145e4a0 100644
--- a/rulesets/phase_test.go
+++ b/rulesets/phase_test.go
@@ -33,10 +33,10 @@ func TestPhaseUpdateWithOptionalParams(t *testing.T) {
context.TODO(),
rulesets.PhaseUpdateParamsRulesetPhaseHTTPRequestFirewallCustom,
rulesets.PhaseUpdateParams{
- Rules: cloudflare.F([]rulesets.PhaseUpdateParamsRuleUnion{rulesets.PhaseUpdateParamsRulesRulesetsBlockRule{
- Action: cloudflare.F(rulesets.PhaseUpdateParamsRulesRulesetsBlockRuleActionBlock),
- ActionParameters: cloudflare.F(rulesets.PhaseUpdateParamsRulesRulesetsBlockRuleActionParameters{
- Response: cloudflare.F(rulesets.PhaseUpdateParamsRulesRulesetsBlockRuleActionParametersResponse{
+ Rules: cloudflare.F([]rulesets.RequestRuleUnionParam{rulesets.BlockRuleParam{
+ Action: cloudflare.F(rulesets.BlockRuleActionBlock),
+ ActionParameters: cloudflare.F(rulesets.BlockRuleActionParametersParam{
+ Response: cloudflare.F(rulesets.BlockRuleActionParametersResponseParam{
Content: cloudflare.F("{\n \"success\": false,\n \"error\": \"you have been blocked\"\n}"),
ContentType: cloudflare.F("application/json"),
StatusCode: cloudflare.F(int64(400)),
@@ -50,10 +50,10 @@ func TestPhaseUpdateWithOptionalParams(t *testing.T) {
Enabled: cloudflare.F(true),
}),
Ref: cloudflare.F("my_ref"),
- }, rulesets.PhaseUpdateParamsRulesRulesetsBlockRule{
- Action: cloudflare.F(rulesets.PhaseUpdateParamsRulesRulesetsBlockRuleActionBlock),
- ActionParameters: cloudflare.F(rulesets.PhaseUpdateParamsRulesRulesetsBlockRuleActionParameters{
- Response: cloudflare.F(rulesets.PhaseUpdateParamsRulesRulesetsBlockRuleActionParametersResponse{
+ }, rulesets.BlockRuleParam{
+ Action: cloudflare.F(rulesets.BlockRuleActionBlock),
+ ActionParameters: cloudflare.F(rulesets.BlockRuleActionParametersParam{
+ Response: cloudflare.F(rulesets.BlockRuleActionParametersResponseParam{
Content: cloudflare.F("{\n \"success\": false,\n \"error\": \"you have been blocked\"\n}"),
ContentType: cloudflare.F("application/json"),
StatusCode: cloudflare.F(int64(400)),
@@ -67,10 +67,10 @@ func TestPhaseUpdateWithOptionalParams(t *testing.T) {
Enabled: cloudflare.F(true),
}),
Ref: cloudflare.F("my_ref"),
- }, rulesets.PhaseUpdateParamsRulesRulesetsBlockRule{
- Action: cloudflare.F(rulesets.PhaseUpdateParamsRulesRulesetsBlockRuleActionBlock),
- ActionParameters: cloudflare.F(rulesets.PhaseUpdateParamsRulesRulesetsBlockRuleActionParameters{
- Response: cloudflare.F(rulesets.PhaseUpdateParamsRulesRulesetsBlockRuleActionParametersResponse{
+ }, rulesets.BlockRuleParam{
+ Action: cloudflare.F(rulesets.BlockRuleActionBlock),
+ ActionParameters: cloudflare.F(rulesets.BlockRuleActionParametersParam{
+ Response: cloudflare.F(rulesets.BlockRuleActionParametersResponseParam{
Content: cloudflare.F("{\n \"success\": false,\n \"error\": \"you have been blocked\"\n}"),
ContentType: cloudflare.F("application/json"),
StatusCode: cloudflare.F(int64(400)),
diff --git a/rulesets/phaseversion.go b/rulesets/phaseversion.go
index cde709af597..19e649402fb 100644
--- a/rulesets/phaseversion.go
+++ b/rulesets/phaseversion.go
@@ -6,16 +6,13 @@ import (
"context"
"fmt"
"net/http"
- "reflect"
"time"
"github.com/cloudflare/cloudflare-go/v2/internal/apijson"
"github.com/cloudflare/cloudflare-go/v2/internal/pagination"
"github.com/cloudflare/cloudflare-go/v2/internal/param"
"github.com/cloudflare/cloudflare-go/v2/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/v2/internal/shared"
"github.com/cloudflare/cloudflare-go/v2/option"
- "github.com/tidwall/gjson"
)
// PhaseVersionService contains methods and other services that help with
@@ -37,7 +34,7 @@ func NewPhaseVersionService(opts ...option.RequestOption) (r *PhaseVersionServic
}
// Fetches the versions of an account or zone entry point ruleset.
-func (r *PhaseVersionService) List(ctx context.Context, rulesetPhase PhaseVersionListParamsRulesetPhase, query PhaseVersionListParams, opts ...option.RequestOption) (res *pagination.SinglePage[PhaseVersionListResponse], err error) {
+func (r *PhaseVersionService) List(ctx context.Context, rulesetPhase PhaseVersionListParamsRulesetPhase, query PhaseVersionListParams, opts ...option.RequestOption) (res *pagination.SinglePage[Ruleset], err error) {
var raw *http.Response
opts = append(r.Options, opts...)
opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
@@ -64,7 +61,7 @@ func (r *PhaseVersionService) List(ctx context.Context, rulesetPhase PhaseVersio
}
// Fetches the versions of an account or zone entry point ruleset.
-func (r *PhaseVersionService) ListAutoPaging(ctx context.Context, rulesetPhase PhaseVersionListParamsRulesetPhase, query PhaseVersionListParams, opts ...option.RequestOption) *pagination.SinglePageAutoPager[PhaseVersionListResponse] {
+func (r *PhaseVersionService) ListAutoPaging(ctx context.Context, rulesetPhase PhaseVersionListParamsRulesetPhase, query PhaseVersionListParams, opts ...option.RequestOption) *pagination.SinglePageAutoPager[Ruleset] {
return pagination.NewSinglePageAutoPager(r.List(ctx, rulesetPhase, query, opts...))
}
@@ -90,102 +87,6 @@ func (r *PhaseVersionService) Get(ctx context.Context, rulesetPhase PhaseVersion
return
}
-// A ruleset object.
-type PhaseVersionListResponse struct {
- // The kind of the ruleset.
- Kind PhaseVersionListResponseKind `json:"kind,required"`
- // The human-readable name of the ruleset.
- Name string `json:"name,required"`
- // The phase of the ruleset.
- Phase PhaseVersionListResponsePhase `json:"phase,required"`
- // The unique ID of the ruleset.
- ID string `json:"id"`
- // An informative description of the ruleset.
- Description string `json:"description"`
- // The timestamp of when the ruleset was last modified.
- LastUpdated time.Time `json:"last_updated" format:"date-time"`
- // The version of the ruleset.
- Version string `json:"version"`
- JSON phaseVersionListResponseJSON `json:"-"`
-}
-
-// phaseVersionListResponseJSON contains the JSON metadata for the struct
-// [PhaseVersionListResponse]
-type phaseVersionListResponseJSON struct {
- Kind apijson.Field
- Name apijson.Field
- Phase apijson.Field
- ID apijson.Field
- Description apijson.Field
- LastUpdated apijson.Field
- Version apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PhaseVersionListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r phaseVersionListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The kind of the ruleset.
-type PhaseVersionListResponseKind string
-
-const (
- PhaseVersionListResponseKindManaged PhaseVersionListResponseKind = "managed"
- PhaseVersionListResponseKindCustom PhaseVersionListResponseKind = "custom"
- PhaseVersionListResponseKindRoot PhaseVersionListResponseKind = "root"
- PhaseVersionListResponseKindZone PhaseVersionListResponseKind = "zone"
-)
-
-func (r PhaseVersionListResponseKind) IsKnown() bool {
- switch r {
- case PhaseVersionListResponseKindManaged, PhaseVersionListResponseKindCustom, PhaseVersionListResponseKindRoot, PhaseVersionListResponseKindZone:
- return true
- }
- return false
-}
-
-// The phase of the ruleset.
-type PhaseVersionListResponsePhase string
-
-const (
- PhaseVersionListResponsePhaseDDoSL4 PhaseVersionListResponsePhase = "ddos_l4"
- PhaseVersionListResponsePhaseDDoSL7 PhaseVersionListResponsePhase = "ddos_l7"
- PhaseVersionListResponsePhaseHTTPConfigSettings PhaseVersionListResponsePhase = "http_config_settings"
- PhaseVersionListResponsePhaseHTTPCustomErrors PhaseVersionListResponsePhase = "http_custom_errors"
- PhaseVersionListResponsePhaseHTTPLogCustomFields PhaseVersionListResponsePhase = "http_log_custom_fields"
- PhaseVersionListResponsePhaseHTTPRatelimit PhaseVersionListResponsePhase = "http_ratelimit"
- PhaseVersionListResponsePhaseHTTPRequestCacheSettings PhaseVersionListResponsePhase = "http_request_cache_settings"
- PhaseVersionListResponsePhaseHTTPRequestDynamicRedirect PhaseVersionListResponsePhase = "http_request_dynamic_redirect"
- PhaseVersionListResponsePhaseHTTPRequestFirewallCustom PhaseVersionListResponsePhase = "http_request_firewall_custom"
- PhaseVersionListResponsePhaseHTTPRequestFirewallManaged PhaseVersionListResponsePhase = "http_request_firewall_managed"
- PhaseVersionListResponsePhaseHTTPRequestLateTransform PhaseVersionListResponsePhase = "http_request_late_transform"
- PhaseVersionListResponsePhaseHTTPRequestOrigin PhaseVersionListResponsePhase = "http_request_origin"
- PhaseVersionListResponsePhaseHTTPRequestRedirect PhaseVersionListResponsePhase = "http_request_redirect"
- PhaseVersionListResponsePhaseHTTPRequestSanitize PhaseVersionListResponsePhase = "http_request_sanitize"
- PhaseVersionListResponsePhaseHTTPRequestSbfm PhaseVersionListResponsePhase = "http_request_sbfm"
- PhaseVersionListResponsePhaseHTTPRequestSelectConfiguration PhaseVersionListResponsePhase = "http_request_select_configuration"
- PhaseVersionListResponsePhaseHTTPRequestTransform PhaseVersionListResponsePhase = "http_request_transform"
- PhaseVersionListResponsePhaseHTTPResponseCompression PhaseVersionListResponsePhase = "http_response_compression"
- PhaseVersionListResponsePhaseHTTPResponseFirewallManaged PhaseVersionListResponsePhase = "http_response_firewall_managed"
- PhaseVersionListResponsePhaseHTTPResponseHeadersTransform PhaseVersionListResponsePhase = "http_response_headers_transform"
- PhaseVersionListResponsePhaseMagicTransit PhaseVersionListResponsePhase = "magic_transit"
- PhaseVersionListResponsePhaseMagicTransitIDsManaged PhaseVersionListResponsePhase = "magic_transit_ids_managed"
- PhaseVersionListResponsePhaseMagicTransitManaged PhaseVersionListResponsePhase = "magic_transit_managed"
-)
-
-func (r PhaseVersionListResponsePhase) IsKnown() bool {
- switch r {
- case PhaseVersionListResponsePhaseDDoSL4, PhaseVersionListResponsePhaseDDoSL7, PhaseVersionListResponsePhaseHTTPConfigSettings, PhaseVersionListResponsePhaseHTTPCustomErrors, PhaseVersionListResponsePhaseHTTPLogCustomFields, PhaseVersionListResponsePhaseHTTPRatelimit, PhaseVersionListResponsePhaseHTTPRequestCacheSettings, PhaseVersionListResponsePhaseHTTPRequestDynamicRedirect, PhaseVersionListResponsePhaseHTTPRequestFirewallCustom, PhaseVersionListResponsePhaseHTTPRequestFirewallManaged, PhaseVersionListResponsePhaseHTTPRequestLateTransform, PhaseVersionListResponsePhaseHTTPRequestOrigin, PhaseVersionListResponsePhaseHTTPRequestRedirect, PhaseVersionListResponsePhaseHTTPRequestSanitize, PhaseVersionListResponsePhaseHTTPRequestSbfm, PhaseVersionListResponsePhaseHTTPRequestSelectConfiguration, PhaseVersionListResponsePhaseHTTPRequestTransform, PhaseVersionListResponsePhaseHTTPResponseCompression, PhaseVersionListResponsePhaseHTTPResponseFirewallManaged, PhaseVersionListResponsePhaseHTTPResponseHeadersTransform, PhaseVersionListResponsePhaseMagicTransit, PhaseVersionListResponsePhaseMagicTransitIDsManaged, PhaseVersionListResponsePhaseMagicTransitManaged:
- return true
- }
- return false
-}
-
// A ruleset object.
type PhaseVersionGetResponse struct {
// The unique ID of the ruleset.
@@ -199,7 +100,7 @@ type PhaseVersionGetResponse struct {
// The phase of the ruleset.
Phase PhaseVersionGetResponsePhase `json:"phase,required"`
// The list of rules in the ruleset.
- Rules []PhaseVersionGetResponseRule `json:"rules,required"`
+ Rules []RequestRule `json:"rules,required"`
// The version of the ruleset.
Version string `json:"version,required"`
// An informative description of the ruleset.
@@ -285,784 +186,6 @@ func (r PhaseVersionGetResponsePhase) IsKnown() bool {
return false
}
-type PhaseVersionGetResponseRule struct {
- // The action to perform when the rule matches.
- Action PhaseVersionGetResponseRulesAction `json:"action"`
- ActionParameters interface{} `json:"action_parameters,required"`
- Categories interface{} `json:"categories,required"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // An object configuring the rule's logging behavior.
- Logging shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- // The version of the rule.
- Version string `json:"version,required"`
- JSON phaseVersionGetResponseRuleJSON `json:"-"`
- union PhaseVersionGetResponseRulesUnion
-}
-
-// phaseVersionGetResponseRuleJSON contains the JSON metadata for the struct
-// [PhaseVersionGetResponseRule]
-type phaseVersionGetResponseRuleJSON struct {
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- ID apijson.Field
- LastUpdated apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- Version apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r phaseVersionGetResponseRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r *PhaseVersionGetResponseRule) UnmarshalJSON(data []byte) (err error) {
- err = apijson.UnmarshalRoot(data, &r.union)
- if err != nil {
- return err
- }
- return apijson.Port(r.union, &r)
-}
-
-func (r PhaseVersionGetResponseRule) AsUnion() PhaseVersionGetResponseRulesUnion {
- return r.union
-}
-
-// Union satisfied by [rulesets.PhaseVersionGetResponseRulesRulesetsBlockRule],
-// [rulesets.PhaseVersionGetResponseRulesRulesetsExecuteRule],
-// [rulesets.PhaseVersionGetResponseRulesRulesetsLogRule] or
-// [rulesets.PhaseVersionGetResponseRulesRulesetsSkipRule].
-type PhaseVersionGetResponseRulesUnion interface {
- implementsRulesetsPhaseVersionGetResponseRule()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*PhaseVersionGetResponseRulesUnion)(nil)).Elem(),
- "action",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(PhaseVersionGetResponseRulesRulesetsBlockRule{}),
- DiscriminatorValue: "block",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(PhaseVersionGetResponseRulesRulesetsExecuteRule{}),
- DiscriminatorValue: "execute",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(PhaseVersionGetResponseRulesRulesetsLogRule{}),
- DiscriminatorValue: "log",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(PhaseVersionGetResponseRulesRulesetsSkipRule{}),
- DiscriminatorValue: "skip",
- },
- )
-}
-
-type PhaseVersionGetResponseRulesRulesetsBlockRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action PhaseVersionGetResponseRulesRulesetsBlockRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters PhaseVersionGetResponseRulesRulesetsBlockRuleActionParameters `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON phaseVersionGetResponseRulesRulesetsBlockRuleJSON `json:"-"`
-}
-
-// phaseVersionGetResponseRulesRulesetsBlockRuleJSON contains the JSON metadata for
-// the struct [PhaseVersionGetResponseRulesRulesetsBlockRule]
-type phaseVersionGetResponseRulesRulesetsBlockRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PhaseVersionGetResponseRulesRulesetsBlockRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r phaseVersionGetResponseRulesRulesetsBlockRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r PhaseVersionGetResponseRulesRulesetsBlockRule) implementsRulesetsPhaseVersionGetResponseRule() {
-}
-
-// The action to perform when the rule matches.
-type PhaseVersionGetResponseRulesRulesetsBlockRuleAction string
-
-const (
- PhaseVersionGetResponseRulesRulesetsBlockRuleActionBlock PhaseVersionGetResponseRulesRulesetsBlockRuleAction = "block"
-)
-
-func (r PhaseVersionGetResponseRulesRulesetsBlockRuleAction) IsKnown() bool {
- switch r {
- case PhaseVersionGetResponseRulesRulesetsBlockRuleActionBlock:
- return true
- }
- return false
-}
-
-// The parameters configuring the rule's action.
-type PhaseVersionGetResponseRulesRulesetsBlockRuleActionParameters struct {
- // The response to show when the block is applied.
- Response PhaseVersionGetResponseRulesRulesetsBlockRuleActionParametersResponse `json:"response"`
- JSON phaseVersionGetResponseRulesRulesetsBlockRuleActionParametersJSON `json:"-"`
-}
-
-// phaseVersionGetResponseRulesRulesetsBlockRuleActionParametersJSON contains the
-// JSON metadata for the struct
-// [PhaseVersionGetResponseRulesRulesetsBlockRuleActionParameters]
-type phaseVersionGetResponseRulesRulesetsBlockRuleActionParametersJSON struct {
- Response apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PhaseVersionGetResponseRulesRulesetsBlockRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r phaseVersionGetResponseRulesRulesetsBlockRuleActionParametersJSON) RawJSON() string {
- return r.raw
-}
-
-// The response to show when the block is applied.
-type PhaseVersionGetResponseRulesRulesetsBlockRuleActionParametersResponse struct {
- // The content to return.
- Content string `json:"content,required"`
- // The type of the content to return.
- ContentType string `json:"content_type,required"`
- // The status code to return.
- StatusCode int64 `json:"status_code,required"`
- JSON phaseVersionGetResponseRulesRulesetsBlockRuleActionParametersResponseJSON `json:"-"`
-}
-
-// phaseVersionGetResponseRulesRulesetsBlockRuleActionParametersResponseJSON
-// contains the JSON metadata for the struct
-// [PhaseVersionGetResponseRulesRulesetsBlockRuleActionParametersResponse]
-type phaseVersionGetResponseRulesRulesetsBlockRuleActionParametersResponseJSON struct {
- Content apijson.Field
- ContentType apijson.Field
- StatusCode apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PhaseVersionGetResponseRulesRulesetsBlockRuleActionParametersResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r phaseVersionGetResponseRulesRulesetsBlockRuleActionParametersResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type PhaseVersionGetResponseRulesRulesetsExecuteRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action PhaseVersionGetResponseRulesRulesetsExecuteRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParameters `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON phaseVersionGetResponseRulesRulesetsExecuteRuleJSON `json:"-"`
-}
-
-// phaseVersionGetResponseRulesRulesetsExecuteRuleJSON contains the JSON metadata
-// for the struct [PhaseVersionGetResponseRulesRulesetsExecuteRule]
-type phaseVersionGetResponseRulesRulesetsExecuteRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PhaseVersionGetResponseRulesRulesetsExecuteRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r phaseVersionGetResponseRulesRulesetsExecuteRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r PhaseVersionGetResponseRulesRulesetsExecuteRule) implementsRulesetsPhaseVersionGetResponseRule() {
-}
-
-// The action to perform when the rule matches.
-type PhaseVersionGetResponseRulesRulesetsExecuteRuleAction string
-
-const (
- PhaseVersionGetResponseRulesRulesetsExecuteRuleActionExecute PhaseVersionGetResponseRulesRulesetsExecuteRuleAction = "execute"
-)
-
-func (r PhaseVersionGetResponseRulesRulesetsExecuteRuleAction) IsKnown() bool {
- switch r {
- case PhaseVersionGetResponseRulesRulesetsExecuteRuleActionExecute:
- return true
- }
- return false
-}
-
-// The parameters configuring the rule's action.
-type PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParameters struct {
- // The ID of the ruleset to execute.
- ID string `json:"id,required"`
- // The configuration to use for matched data logging.
- MatchedData PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersMatchedData `json:"matched_data"`
- // A set of overrides to apply to the target ruleset.
- Overrides PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverrides `json:"overrides"`
- JSON phaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersJSON `json:"-"`
-}
-
-// phaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersJSON contains the
-// JSON metadata for the struct
-// [PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParameters]
-type phaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersJSON struct {
- ID apijson.Field
- MatchedData apijson.Field
- Overrides apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r phaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersJSON) RawJSON() string {
- return r.raw
-}
-
-// The configuration to use for matched data logging.
-type PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersMatchedData struct {
- // The public key to encrypt matched data logs with.
- PublicKey string `json:"public_key,required"`
- JSON phaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON `json:"-"`
-}
-
-// phaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON
-// contains the JSON metadata for the struct
-// [PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersMatchedData]
-type phaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON struct {
- PublicKey apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersMatchedData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r phaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON) RawJSON() string {
- return r.raw
-}
-
-// A set of overrides to apply to the target ruleset.
-type PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverrides struct {
- // An action to override all rules with. This option has lower precedence than rule
- // and category overrides.
- Action string `json:"action"`
- // A list of category-level overrides. This option has the second-highest
- // precedence after rule-level overrides.
- Categories []PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory `json:"categories"`
- // Whether to enable execution of all rules. This option has lower precedence than
- // rule and category overrides.
- Enabled bool `json:"enabled"`
- // A list of rule-level overrides. This option has the highest precedence.
- Rules []PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRule `json:"rules"`
- // A sensitivity level to set for all rules. This option has lower precedence than
- // rule and category overrides and is only applicable for DDoS phases.
- SensitivityLevel PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel `json:"sensitivity_level"`
- JSON phaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON `json:"-"`
-}
-
-// phaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON
-// contains the JSON metadata for the struct
-// [PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverrides]
-type phaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON struct {
- Action apijson.Field
- Categories apijson.Field
- Enabled apijson.Field
- Rules apijson.Field
- SensitivityLevel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverrides) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r phaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON) RawJSON() string {
- return r.raw
-}
-
-// A category-level override
-type PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory struct {
- // The name of the category to override.
- Category string `json:"category,required"`
- // The action to override rules in the category with.
- Action string `json:"action"`
- // Whether to enable execution of rules in the category.
- Enabled bool `json:"enabled"`
- // The sensitivity level to use for rules in the category.
- SensitivityLevel PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel `json:"sensitivity_level"`
- JSON phaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON `json:"-"`
-}
-
-// phaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON
-// contains the JSON metadata for the struct
-// [PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory]
-type phaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON struct {
- Category apijson.Field
- Action apijson.Field
- Enabled apijson.Field
- SensitivityLevel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r phaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON) RawJSON() string {
- return r.raw
-}
-
-// The sensitivity level to use for rules in the category.
-type PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel string
-
-const (
- PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "default"
- PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "medium"
- PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "low"
- PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "eoff"
-)
-
-func (r PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel) IsKnown() bool {
- switch r {
- case PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault, PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium, PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow, PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff:
- return true
- }
- return false
-}
-
-// A rule-level override
-type PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRule struct {
- // The ID of the rule to override.
- ID string `json:"id,required"`
- // The action to override the rule with.
- Action string `json:"action"`
- // Whether to enable execution of the rule.
- Enabled bool `json:"enabled"`
- // The score threshold to use for the rule.
- ScoreThreshold int64 `json:"score_threshold"`
- // The sensitivity level to use for the rule.
- SensitivityLevel PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel `json:"sensitivity_level"`
- JSON phaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON `json:"-"`
-}
-
-// phaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON
-// contains the JSON metadata for the struct
-// [PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRule]
-type phaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON struct {
- ID apijson.Field
- Action apijson.Field
- Enabled apijson.Field
- ScoreThreshold apijson.Field
- SensitivityLevel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r phaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON) RawJSON() string {
- return r.raw
-}
-
-// The sensitivity level to use for the rule.
-type PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel string
-
-const (
- PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "default"
- PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "medium"
- PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "low"
- PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "eoff"
-)
-
-func (r PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel) IsKnown() bool {
- switch r {
- case PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault, PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium, PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow, PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff:
- return true
- }
- return false
-}
-
-// A sensitivity level to set for all rules. This option has lower precedence than
-// rule and category overrides and is only applicable for DDoS phases.
-type PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel string
-
-const (
- PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "default"
- PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "medium"
- PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "low"
- PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "eoff"
-)
-
-func (r PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel) IsKnown() bool {
- switch r {
- case PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault, PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium, PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow, PhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff:
- return true
- }
- return false
-}
-
-type PhaseVersionGetResponseRulesRulesetsLogRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action PhaseVersionGetResponseRulesRulesetsLogRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters interface{} `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON phaseVersionGetResponseRulesRulesetsLogRuleJSON `json:"-"`
-}
-
-// phaseVersionGetResponseRulesRulesetsLogRuleJSON contains the JSON metadata for
-// the struct [PhaseVersionGetResponseRulesRulesetsLogRule]
-type phaseVersionGetResponseRulesRulesetsLogRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PhaseVersionGetResponseRulesRulesetsLogRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r phaseVersionGetResponseRulesRulesetsLogRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r PhaseVersionGetResponseRulesRulesetsLogRule) implementsRulesetsPhaseVersionGetResponseRule() {
-}
-
-// The action to perform when the rule matches.
-type PhaseVersionGetResponseRulesRulesetsLogRuleAction string
-
-const (
- PhaseVersionGetResponseRulesRulesetsLogRuleActionLog PhaseVersionGetResponseRulesRulesetsLogRuleAction = "log"
-)
-
-func (r PhaseVersionGetResponseRulesRulesetsLogRuleAction) IsKnown() bool {
- switch r {
- case PhaseVersionGetResponseRulesRulesetsLogRuleActionLog:
- return true
- }
- return false
-}
-
-type PhaseVersionGetResponseRulesRulesetsSkipRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action PhaseVersionGetResponseRulesRulesetsSkipRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters PhaseVersionGetResponseRulesRulesetsSkipRuleActionParameters `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON phaseVersionGetResponseRulesRulesetsSkipRuleJSON `json:"-"`
-}
-
-// phaseVersionGetResponseRulesRulesetsSkipRuleJSON contains the JSON metadata for
-// the struct [PhaseVersionGetResponseRulesRulesetsSkipRule]
-type phaseVersionGetResponseRulesRulesetsSkipRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PhaseVersionGetResponseRulesRulesetsSkipRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r phaseVersionGetResponseRulesRulesetsSkipRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r PhaseVersionGetResponseRulesRulesetsSkipRule) implementsRulesetsPhaseVersionGetResponseRule() {
-}
-
-// The action to perform when the rule matches.
-type PhaseVersionGetResponseRulesRulesetsSkipRuleAction string
-
-const (
- PhaseVersionGetResponseRulesRulesetsSkipRuleActionSkip PhaseVersionGetResponseRulesRulesetsSkipRuleAction = "skip"
-)
-
-func (r PhaseVersionGetResponseRulesRulesetsSkipRuleAction) IsKnown() bool {
- switch r {
- case PhaseVersionGetResponseRulesRulesetsSkipRuleActionSkip:
- return true
- }
- return false
-}
-
-// The parameters configuring the rule's action.
-type PhaseVersionGetResponseRulesRulesetsSkipRuleActionParameters struct {
- // A list of phases to skip the execution of. This option is incompatible with the
- // ruleset and rulesets options.
- Phases []PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase `json:"phases"`
- // A list of legacy security products to skip the execution of.
- Products []PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersProduct `json:"products"`
- // A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the
- // execution of. This option is incompatible with the ruleset option.
- Rules map[string][]string `json:"rules"`
- // A ruleset to skip the execution of. This option is incompatible with the
- // rulesets, rules and phases options.
- Ruleset PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersRuleset `json:"ruleset"`
- // A list of ruleset IDs to skip the execution of. This option is incompatible with
- // the ruleset and phases options.
- Rulesets []string `json:"rulesets"`
- JSON phaseVersionGetResponseRulesRulesetsSkipRuleActionParametersJSON `json:"-"`
-}
-
-// phaseVersionGetResponseRulesRulesetsSkipRuleActionParametersJSON contains the
-// JSON metadata for the struct
-// [PhaseVersionGetResponseRulesRulesetsSkipRuleActionParameters]
-type phaseVersionGetResponseRulesRulesetsSkipRuleActionParametersJSON struct {
- Phases apijson.Field
- Products apijson.Field
- Rules apijson.Field
- Ruleset apijson.Field
- Rulesets apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PhaseVersionGetResponseRulesRulesetsSkipRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r phaseVersionGetResponseRulesRulesetsSkipRuleActionParametersJSON) RawJSON() string {
- return r.raw
-}
-
-// A phase to skip the execution of.
-type PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase string
-
-const (
- PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseDDoSL4 PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l4"
- PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseDDoSL7 PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l7"
- PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_config_settings"
- PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_custom_errors"
- PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_log_custom_fields"
- PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRatelimit PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_ratelimit"
- PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_cache_settings"
- PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_dynamic_redirect"
- PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_custom"
- PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_managed"
- PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_late_transform"
- PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_origin"
- PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_redirect"
- PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sanitize"
- PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sbfm"
- PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_select_configuration"
- PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_transform"
- PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_compression"
- PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_firewall_managed"
- PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_headers_transform"
- PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransit PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit"
- PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_ids_managed"
- PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitManaged PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_managed"
-)
-
-func (r PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase) IsKnown() bool {
- switch r {
- case PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseDDoSL4, PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseDDoSL7, PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings, PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors, PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields, PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRatelimit, PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings, PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect, PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom, PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged, PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform, PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin, PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect, PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize, PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm, PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration, PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform, PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression, PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged, PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform, PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransit, PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged, PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitManaged:
- return true
- }
- return false
-}
-
-// The name of a legacy security product to skip the execution of.
-type PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersProduct string
-
-const (
- PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersProductBic PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersProduct = "bic"
- PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersProductHot PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersProduct = "hot"
- PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersProductRateLimit PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersProduct = "rateLimit"
- PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersProductSecurityLevel PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersProduct = "securityLevel"
- PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersProductUABlock PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersProduct = "uaBlock"
- PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersProductWAF PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersProduct = "waf"
- PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersProductZoneLockdown PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersProduct = "zoneLockdown"
-)
-
-func (r PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersProduct) IsKnown() bool {
- switch r {
- case PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersProductBic, PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersProductHot, PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersProductRateLimit, PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersProductSecurityLevel, PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersProductUABlock, PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersProductWAF, PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersProductZoneLockdown:
- return true
- }
- return false
-}
-
-// A ruleset to skip the execution of. This option is incompatible with the
-// rulesets, rules and phases options.
-type PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersRuleset string
-
-const (
- PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersRulesetCurrent PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersRuleset = "current"
-)
-
-func (r PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersRuleset) IsKnown() bool {
- switch r {
- case PhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersRulesetCurrent:
- return true
- }
- return false
-}
-
-// The action to perform when the rule matches.
-type PhaseVersionGetResponseRulesAction string
-
-const (
- PhaseVersionGetResponseRulesActionBlock PhaseVersionGetResponseRulesAction = "block"
- PhaseVersionGetResponseRulesActionExecute PhaseVersionGetResponseRulesAction = "execute"
- PhaseVersionGetResponseRulesActionLog PhaseVersionGetResponseRulesAction = "log"
- PhaseVersionGetResponseRulesActionSkip PhaseVersionGetResponseRulesAction = "skip"
-)
-
-func (r PhaseVersionGetResponseRulesAction) IsKnown() bool {
- switch r {
- case PhaseVersionGetResponseRulesActionBlock, PhaseVersionGetResponseRulesActionExecute, PhaseVersionGetResponseRulesActionLog, PhaseVersionGetResponseRulesActionSkip:
- return true
- }
- return false
-}
-
type PhaseVersionListParams struct {
// The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
AccountID param.Field[string] `path:"account_id"`
diff --git a/rulesets/rule.go b/rulesets/rule.go
index e57eab9a6c7..0b5da86fdc7 100644
--- a/rulesets/rule.go
+++ b/rulesets/rule.go
@@ -6,7 +6,6 @@ import (
"context"
"fmt"
"net/http"
- "reflect"
"time"
"github.com/cloudflare/cloudflare-go/v2/internal/apijson"
@@ -14,7 +13,6 @@ import (
"github.com/cloudflare/cloudflare-go/v2/internal/requestconfig"
"github.com/cloudflare/cloudflare-go/v2/internal/shared"
"github.com/cloudflare/cloudflare-go/v2/option"
- "github.com/tidwall/gjson"
)
// RuleService contains methods and other services that help with interacting with
@@ -114,7 +112,7 @@ type RuleNewResponse struct {
// The phase of the ruleset.
Phase RuleNewResponsePhase `json:"phase,required"`
// The list of rules in the ruleset.
- Rules []RuleNewResponseRule `json:"rules,required"`
+ Rules []RequestRule `json:"rules,required"`
// The version of the ruleset.
Version string `json:"version,required"`
// An informative description of the ruleset.
@@ -199,2525 +197,207 @@ func (r RuleNewResponsePhase) IsKnown() bool {
return false
}
-type RuleNewResponseRule struct {
- // The action to perform when the rule matches.
- Action RuleNewResponseRulesAction `json:"action"`
- ActionParameters interface{} `json:"action_parameters,required"`
- Categories interface{} `json:"categories,required"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // An object configuring the rule's logging behavior.
- Logging shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- // The version of the rule.
- Version string `json:"version,required"`
- JSON ruleNewResponseRuleJSON `json:"-"`
- union RuleNewResponseRulesUnion
-}
-
-// ruleNewResponseRuleJSON contains the JSON metadata for the struct
-// [RuleNewResponseRule]
-type ruleNewResponseRuleJSON struct {
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- ID apijson.Field
- LastUpdated apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- Version apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r ruleNewResponseRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r *RuleNewResponseRule) UnmarshalJSON(data []byte) (err error) {
- err = apijson.UnmarshalRoot(data, &r.union)
- if err != nil {
- return err
- }
- return apijson.Port(r.union, &r)
-}
-
-func (r RuleNewResponseRule) AsUnion() RuleNewResponseRulesUnion {
- return r.union
-}
-
-// Union satisfied by [rulesets.RuleNewResponseRulesRulesetsBlockRule],
-// [rulesets.RuleNewResponseRulesRulesetsExecuteRule],
-// [rulesets.RuleNewResponseRulesRulesetsLogRule] or
-// [rulesets.RuleNewResponseRulesRulesetsSkipRule].
-type RuleNewResponseRulesUnion interface {
- implementsRulesetsRuleNewResponseRule()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*RuleNewResponseRulesUnion)(nil)).Elem(),
- "action",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RuleNewResponseRulesRulesetsBlockRule{}),
- DiscriminatorValue: "block",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RuleNewResponseRulesRulesetsExecuteRule{}),
- DiscriminatorValue: "execute",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RuleNewResponseRulesRulesetsLogRule{}),
- DiscriminatorValue: "log",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RuleNewResponseRulesRulesetsSkipRule{}),
- DiscriminatorValue: "skip",
- },
- )
-}
-
-type RuleNewResponseRulesRulesetsBlockRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action RuleNewResponseRulesRulesetsBlockRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters RuleNewResponseRulesRulesetsBlockRuleActionParameters `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON ruleNewResponseRulesRulesetsBlockRuleJSON `json:"-"`
-}
-
-// ruleNewResponseRulesRulesetsBlockRuleJSON contains the JSON metadata for the
-// struct [RuleNewResponseRulesRulesetsBlockRule]
-type ruleNewResponseRulesRulesetsBlockRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleNewResponseRulesRulesetsBlockRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleNewResponseRulesRulesetsBlockRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r RuleNewResponseRulesRulesetsBlockRule) implementsRulesetsRuleNewResponseRule() {}
-
-// The action to perform when the rule matches.
-type RuleNewResponseRulesRulesetsBlockRuleAction string
-
-const (
- RuleNewResponseRulesRulesetsBlockRuleActionBlock RuleNewResponseRulesRulesetsBlockRuleAction = "block"
-)
-
-func (r RuleNewResponseRulesRulesetsBlockRuleAction) IsKnown() bool {
- switch r {
- case RuleNewResponseRulesRulesetsBlockRuleActionBlock:
- return true
- }
- return false
-}
-
-// The parameters configuring the rule's action.
-type RuleNewResponseRulesRulesetsBlockRuleActionParameters struct {
- // The response to show when the block is applied.
- Response RuleNewResponseRulesRulesetsBlockRuleActionParametersResponse `json:"response"`
- JSON ruleNewResponseRulesRulesetsBlockRuleActionParametersJSON `json:"-"`
-}
-
-// ruleNewResponseRulesRulesetsBlockRuleActionParametersJSON contains the JSON
-// metadata for the struct [RuleNewResponseRulesRulesetsBlockRuleActionParameters]
-type ruleNewResponseRulesRulesetsBlockRuleActionParametersJSON struct {
- Response apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleNewResponseRulesRulesetsBlockRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleNewResponseRulesRulesetsBlockRuleActionParametersJSON) RawJSON() string {
- return r.raw
-}
-
-// The response to show when the block is applied.
-type RuleNewResponseRulesRulesetsBlockRuleActionParametersResponse struct {
- // The content to return.
- Content string `json:"content,required"`
- // The type of the content to return.
- ContentType string `json:"content_type,required"`
- // The status code to return.
- StatusCode int64 `json:"status_code,required"`
- JSON ruleNewResponseRulesRulesetsBlockRuleActionParametersResponseJSON `json:"-"`
-}
-
-// ruleNewResponseRulesRulesetsBlockRuleActionParametersResponseJSON contains the
-// JSON metadata for the struct
-// [RuleNewResponseRulesRulesetsBlockRuleActionParametersResponse]
-type ruleNewResponseRulesRulesetsBlockRuleActionParametersResponseJSON struct {
- Content apijson.Field
- ContentType apijson.Field
- StatusCode apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleNewResponseRulesRulesetsBlockRuleActionParametersResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleNewResponseRulesRulesetsBlockRuleActionParametersResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RuleNewResponseRulesRulesetsExecuteRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action RuleNewResponseRulesRulesetsExecuteRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters RuleNewResponseRulesRulesetsExecuteRuleActionParameters `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON ruleNewResponseRulesRulesetsExecuteRuleJSON `json:"-"`
-}
-
-// ruleNewResponseRulesRulesetsExecuteRuleJSON contains the JSON metadata for the
-// struct [RuleNewResponseRulesRulesetsExecuteRule]
-type ruleNewResponseRulesRulesetsExecuteRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleNewResponseRulesRulesetsExecuteRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleNewResponseRulesRulesetsExecuteRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r RuleNewResponseRulesRulesetsExecuteRule) implementsRulesetsRuleNewResponseRule() {}
-
-// The action to perform when the rule matches.
-type RuleNewResponseRulesRulesetsExecuteRuleAction string
-
-const (
- RuleNewResponseRulesRulesetsExecuteRuleActionExecute RuleNewResponseRulesRulesetsExecuteRuleAction = "execute"
-)
-
-func (r RuleNewResponseRulesRulesetsExecuteRuleAction) IsKnown() bool {
- switch r {
- case RuleNewResponseRulesRulesetsExecuteRuleActionExecute:
- return true
- }
- return false
-}
-
-// The parameters configuring the rule's action.
-type RuleNewResponseRulesRulesetsExecuteRuleActionParameters struct {
- // The ID of the ruleset to execute.
- ID string `json:"id,required"`
- // The configuration to use for matched data logging.
- MatchedData RuleNewResponseRulesRulesetsExecuteRuleActionParametersMatchedData `json:"matched_data"`
- // A set of overrides to apply to the target ruleset.
- Overrides RuleNewResponseRulesRulesetsExecuteRuleActionParametersOverrides `json:"overrides"`
- JSON ruleNewResponseRulesRulesetsExecuteRuleActionParametersJSON `json:"-"`
-}
-
-// ruleNewResponseRulesRulesetsExecuteRuleActionParametersJSON contains the JSON
-// metadata for the struct
-// [RuleNewResponseRulesRulesetsExecuteRuleActionParameters]
-type ruleNewResponseRulesRulesetsExecuteRuleActionParametersJSON struct {
- ID apijson.Field
- MatchedData apijson.Field
- Overrides apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleNewResponseRulesRulesetsExecuteRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleNewResponseRulesRulesetsExecuteRuleActionParametersJSON) RawJSON() string {
- return r.raw
-}
-
-// The configuration to use for matched data logging.
-type RuleNewResponseRulesRulesetsExecuteRuleActionParametersMatchedData struct {
- // The public key to encrypt matched data logs with.
- PublicKey string `json:"public_key,required"`
- JSON ruleNewResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON `json:"-"`
-}
-
-// ruleNewResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON contains
-// the JSON metadata for the struct
-// [RuleNewResponseRulesRulesetsExecuteRuleActionParametersMatchedData]
-type ruleNewResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON struct {
- PublicKey apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleNewResponseRulesRulesetsExecuteRuleActionParametersMatchedData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleNewResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON) RawJSON() string {
- return r.raw
-}
-
-// A set of overrides to apply to the target ruleset.
-type RuleNewResponseRulesRulesetsExecuteRuleActionParametersOverrides struct {
- // An action to override all rules with. This option has lower precedence than rule
- // and category overrides.
- Action string `json:"action"`
- // A list of category-level overrides. This option has the second-highest
- // precedence after rule-level overrides.
- Categories []RuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory `json:"categories"`
- // Whether to enable execution of all rules. This option has lower precedence than
- // rule and category overrides.
- Enabled bool `json:"enabled"`
- // A list of rule-level overrides. This option has the highest precedence.
- Rules []RuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRule `json:"rules"`
- // A sensitivity level to set for all rules. This option has lower precedence than
- // rule and category overrides and is only applicable for DDoS phases.
- SensitivityLevel RuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel `json:"sensitivity_level"`
- JSON ruleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON `json:"-"`
-}
-
-// ruleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON contains
-// the JSON metadata for the struct
-// [RuleNewResponseRulesRulesetsExecuteRuleActionParametersOverrides]
-type ruleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON struct {
- Action apijson.Field
- Categories apijson.Field
- Enabled apijson.Field
- Rules apijson.Field
- SensitivityLevel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleNewResponseRulesRulesetsExecuteRuleActionParametersOverrides) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON) RawJSON() string {
- return r.raw
-}
-
-// A category-level override
-type RuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory struct {
- // The name of the category to override.
- Category string `json:"category,required"`
- // The action to override rules in the category with.
- Action string `json:"action"`
- // Whether to enable execution of rules in the category.
- Enabled bool `json:"enabled"`
- // The sensitivity level to use for rules in the category.
- SensitivityLevel RuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel `json:"sensitivity_level"`
- JSON ruleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON `json:"-"`
-}
-
-// ruleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON
-// contains the JSON metadata for the struct
-// [RuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory]
-type ruleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON struct {
- Category apijson.Field
- Action apijson.Field
- Enabled apijson.Field
- SensitivityLevel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON) RawJSON() string {
- return r.raw
-}
-
-// The sensitivity level to use for rules in the category.
-type RuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel string
-
-const (
- RuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault RuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "default"
- RuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium RuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "medium"
- RuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow RuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "low"
- RuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff RuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "eoff"
-)
-
-func (r RuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel) IsKnown() bool {
- switch r {
- case RuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault, RuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium, RuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow, RuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff:
- return true
- }
- return false
-}
-
-// A rule-level override
-type RuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRule struct {
- // The ID of the rule to override.
- ID string `json:"id,required"`
- // The action to override the rule with.
- Action string `json:"action"`
- // Whether to enable execution of the rule.
- Enabled bool `json:"enabled"`
- // The score threshold to use for the rule.
- ScoreThreshold int64 `json:"score_threshold"`
- // The sensitivity level to use for the rule.
- SensitivityLevel RuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel `json:"sensitivity_level"`
- JSON ruleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON `json:"-"`
-}
-
-// ruleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON
-// contains the JSON metadata for the struct
-// [RuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRule]
-type ruleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON struct {
- ID apijson.Field
- Action apijson.Field
- Enabled apijson.Field
- ScoreThreshold apijson.Field
- SensitivityLevel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON) RawJSON() string {
- return r.raw
-}
-
-// The sensitivity level to use for the rule.
-type RuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel string
-
-const (
- RuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault RuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "default"
- RuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium RuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "medium"
- RuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow RuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "low"
- RuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff RuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "eoff"
-)
-
-func (r RuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel) IsKnown() bool {
- switch r {
- case RuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault, RuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium, RuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow, RuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff:
- return true
- }
- return false
-}
-
-// A sensitivity level to set for all rules. This option has lower precedence than
-// rule and category overrides and is only applicable for DDoS phases.
-type RuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel string
-
-const (
- RuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault RuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "default"
- RuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium RuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "medium"
- RuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow RuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "low"
- RuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff RuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "eoff"
-)
-
-func (r RuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel) IsKnown() bool {
- switch r {
- case RuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault, RuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium, RuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow, RuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff:
- return true
- }
- return false
-}
-
-type RuleNewResponseRulesRulesetsLogRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action RuleNewResponseRulesRulesetsLogRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters interface{} `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON ruleNewResponseRulesRulesetsLogRuleJSON `json:"-"`
-}
-
-// ruleNewResponseRulesRulesetsLogRuleJSON contains the JSON metadata for the
-// struct [RuleNewResponseRulesRulesetsLogRule]
-type ruleNewResponseRulesRulesetsLogRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleNewResponseRulesRulesetsLogRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleNewResponseRulesRulesetsLogRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r RuleNewResponseRulesRulesetsLogRule) implementsRulesetsRuleNewResponseRule() {}
-
-// The action to perform when the rule matches.
-type RuleNewResponseRulesRulesetsLogRuleAction string
-
-const (
- RuleNewResponseRulesRulesetsLogRuleActionLog RuleNewResponseRulesRulesetsLogRuleAction = "log"
-)
-
-func (r RuleNewResponseRulesRulesetsLogRuleAction) IsKnown() bool {
- switch r {
- case RuleNewResponseRulesRulesetsLogRuleActionLog:
- return true
- }
- return false
-}
-
-type RuleNewResponseRulesRulesetsSkipRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action RuleNewResponseRulesRulesetsSkipRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters RuleNewResponseRulesRulesetsSkipRuleActionParameters `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON ruleNewResponseRulesRulesetsSkipRuleJSON `json:"-"`
-}
-
-// ruleNewResponseRulesRulesetsSkipRuleJSON contains the JSON metadata for the
-// struct [RuleNewResponseRulesRulesetsSkipRule]
-type ruleNewResponseRulesRulesetsSkipRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleNewResponseRulesRulesetsSkipRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleNewResponseRulesRulesetsSkipRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r RuleNewResponseRulesRulesetsSkipRule) implementsRulesetsRuleNewResponseRule() {}
-
-// The action to perform when the rule matches.
-type RuleNewResponseRulesRulesetsSkipRuleAction string
-
-const (
- RuleNewResponseRulesRulesetsSkipRuleActionSkip RuleNewResponseRulesRulesetsSkipRuleAction = "skip"
-)
-
-func (r RuleNewResponseRulesRulesetsSkipRuleAction) IsKnown() bool {
- switch r {
- case RuleNewResponseRulesRulesetsSkipRuleActionSkip:
- return true
- }
- return false
-}
-
-// The parameters configuring the rule's action.
-type RuleNewResponseRulesRulesetsSkipRuleActionParameters struct {
- // A list of phases to skip the execution of. This option is incompatible with the
- // ruleset and rulesets options.
- Phases []RuleNewResponseRulesRulesetsSkipRuleActionParametersPhase `json:"phases"`
- // A list of legacy security products to skip the execution of.
- Products []RuleNewResponseRulesRulesetsSkipRuleActionParametersProduct `json:"products"`
- // A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the
- // execution of. This option is incompatible with the ruleset option.
- Rules map[string][]string `json:"rules"`
- // A ruleset to skip the execution of. This option is incompatible with the
- // rulesets, rules and phases options.
- Ruleset RuleNewResponseRulesRulesetsSkipRuleActionParametersRuleset `json:"ruleset"`
- // A list of ruleset IDs to skip the execution of. This option is incompatible with
- // the ruleset and phases options.
- Rulesets []string `json:"rulesets"`
- JSON ruleNewResponseRulesRulesetsSkipRuleActionParametersJSON `json:"-"`
-}
-
-// ruleNewResponseRulesRulesetsSkipRuleActionParametersJSON contains the JSON
-// metadata for the struct [RuleNewResponseRulesRulesetsSkipRuleActionParameters]
-type ruleNewResponseRulesRulesetsSkipRuleActionParametersJSON struct {
- Phases apijson.Field
- Products apijson.Field
- Rules apijson.Field
- Ruleset apijson.Field
- Rulesets apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleNewResponseRulesRulesetsSkipRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleNewResponseRulesRulesetsSkipRuleActionParametersJSON) RawJSON() string {
- return r.raw
-}
-
-// A phase to skip the execution of.
-type RuleNewResponseRulesRulesetsSkipRuleActionParametersPhase string
-
-const (
- RuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseDDoSL4 RuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l4"
- RuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseDDoSL7 RuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l7"
- RuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings RuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_config_settings"
- RuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors RuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_custom_errors"
- RuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields RuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_log_custom_fields"
- RuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRatelimit RuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_ratelimit"
- RuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings RuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_cache_settings"
- RuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect RuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_dynamic_redirect"
- RuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom RuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_custom"
- RuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged RuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_managed"
- RuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform RuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_late_transform"
- RuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin RuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_origin"
- RuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect RuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_redirect"
- RuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize RuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sanitize"
- RuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm RuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sbfm"
- RuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration RuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_select_configuration"
- RuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform RuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_transform"
- RuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression RuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_compression"
- RuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged RuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_firewall_managed"
- RuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform RuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_headers_transform"
- RuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransit RuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit"
- RuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged RuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_ids_managed"
- RuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitManaged RuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_managed"
-)
-
-func (r RuleNewResponseRulesRulesetsSkipRuleActionParametersPhase) IsKnown() bool {
- switch r {
- case RuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseDDoSL4, RuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseDDoSL7, RuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings, RuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors, RuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields, RuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRatelimit, RuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings, RuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect, RuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom, RuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged, RuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform, RuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin, RuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect, RuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize, RuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm, RuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration, RuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform, RuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression, RuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged, RuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform, RuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransit, RuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged, RuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitManaged:
- return true
- }
- return false
-}
-
-// The name of a legacy security product to skip the execution of.
-type RuleNewResponseRulesRulesetsSkipRuleActionParametersProduct string
-
-const (
- RuleNewResponseRulesRulesetsSkipRuleActionParametersProductBic RuleNewResponseRulesRulesetsSkipRuleActionParametersProduct = "bic"
- RuleNewResponseRulesRulesetsSkipRuleActionParametersProductHot RuleNewResponseRulesRulesetsSkipRuleActionParametersProduct = "hot"
- RuleNewResponseRulesRulesetsSkipRuleActionParametersProductRateLimit RuleNewResponseRulesRulesetsSkipRuleActionParametersProduct = "rateLimit"
- RuleNewResponseRulesRulesetsSkipRuleActionParametersProductSecurityLevel RuleNewResponseRulesRulesetsSkipRuleActionParametersProduct = "securityLevel"
- RuleNewResponseRulesRulesetsSkipRuleActionParametersProductUABlock RuleNewResponseRulesRulesetsSkipRuleActionParametersProduct = "uaBlock"
- RuleNewResponseRulesRulesetsSkipRuleActionParametersProductWAF RuleNewResponseRulesRulesetsSkipRuleActionParametersProduct = "waf"
- RuleNewResponseRulesRulesetsSkipRuleActionParametersProductZoneLockdown RuleNewResponseRulesRulesetsSkipRuleActionParametersProduct = "zoneLockdown"
-)
-
-func (r RuleNewResponseRulesRulesetsSkipRuleActionParametersProduct) IsKnown() bool {
- switch r {
- case RuleNewResponseRulesRulesetsSkipRuleActionParametersProductBic, RuleNewResponseRulesRulesetsSkipRuleActionParametersProductHot, RuleNewResponseRulesRulesetsSkipRuleActionParametersProductRateLimit, RuleNewResponseRulesRulesetsSkipRuleActionParametersProductSecurityLevel, RuleNewResponseRulesRulesetsSkipRuleActionParametersProductUABlock, RuleNewResponseRulesRulesetsSkipRuleActionParametersProductWAF, RuleNewResponseRulesRulesetsSkipRuleActionParametersProductZoneLockdown:
- return true
- }
- return false
-}
-
-// A ruleset to skip the execution of. This option is incompatible with the
-// rulesets, rules and phases options.
-type RuleNewResponseRulesRulesetsSkipRuleActionParametersRuleset string
-
-const (
- RuleNewResponseRulesRulesetsSkipRuleActionParametersRulesetCurrent RuleNewResponseRulesRulesetsSkipRuleActionParametersRuleset = "current"
-)
-
-func (r RuleNewResponseRulesRulesetsSkipRuleActionParametersRuleset) IsKnown() bool {
- switch r {
- case RuleNewResponseRulesRulesetsSkipRuleActionParametersRulesetCurrent:
- return true
- }
- return false
-}
-
-// The action to perform when the rule matches.
-type RuleNewResponseRulesAction string
-
-const (
- RuleNewResponseRulesActionBlock RuleNewResponseRulesAction = "block"
- RuleNewResponseRulesActionExecute RuleNewResponseRulesAction = "execute"
- RuleNewResponseRulesActionLog RuleNewResponseRulesAction = "log"
- RuleNewResponseRulesActionSkip RuleNewResponseRulesAction = "skip"
-)
-
-func (r RuleNewResponseRulesAction) IsKnown() bool {
- switch r {
- case RuleNewResponseRulesActionBlock, RuleNewResponseRulesActionExecute, RuleNewResponseRulesActionLog, RuleNewResponseRulesActionSkip:
- return true
- }
- return false
-}
-
-// A ruleset object.
-type RuleDeleteResponse struct {
- // The unique ID of the ruleset.
- ID string `json:"id,required"`
- // The kind of the ruleset.
- Kind RuleDeleteResponseKind `json:"kind,required"`
- // The timestamp of when the ruleset was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The human-readable name of the ruleset.
- Name string `json:"name,required"`
- // The phase of the ruleset.
- Phase RuleDeleteResponsePhase `json:"phase,required"`
- // The list of rules in the ruleset.
- Rules []RuleDeleteResponseRule `json:"rules,required"`
- // The version of the ruleset.
- Version string `json:"version,required"`
- // An informative description of the ruleset.
- Description string `json:"description"`
- JSON ruleDeleteResponseJSON `json:"-"`
-}
-
-// ruleDeleteResponseJSON contains the JSON metadata for the struct
-// [RuleDeleteResponse]
-type ruleDeleteResponseJSON struct {
- ID apijson.Field
- Kind apijson.Field
- LastUpdated apijson.Field
- Name apijson.Field
- Phase apijson.Field
- Rules apijson.Field
- Version apijson.Field
- Description apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleDeleteResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleDeleteResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The kind of the ruleset.
-type RuleDeleteResponseKind string
-
-const (
- RuleDeleteResponseKindManaged RuleDeleteResponseKind = "managed"
- RuleDeleteResponseKindCustom RuleDeleteResponseKind = "custom"
- RuleDeleteResponseKindRoot RuleDeleteResponseKind = "root"
- RuleDeleteResponseKindZone RuleDeleteResponseKind = "zone"
-)
-
-func (r RuleDeleteResponseKind) IsKnown() bool {
- switch r {
- case RuleDeleteResponseKindManaged, RuleDeleteResponseKindCustom, RuleDeleteResponseKindRoot, RuleDeleteResponseKindZone:
- return true
- }
- return false
-}
-
-// The phase of the ruleset.
-type RuleDeleteResponsePhase string
-
-const (
- RuleDeleteResponsePhaseDDoSL4 RuleDeleteResponsePhase = "ddos_l4"
- RuleDeleteResponsePhaseDDoSL7 RuleDeleteResponsePhase = "ddos_l7"
- RuleDeleteResponsePhaseHTTPConfigSettings RuleDeleteResponsePhase = "http_config_settings"
- RuleDeleteResponsePhaseHTTPCustomErrors RuleDeleteResponsePhase = "http_custom_errors"
- RuleDeleteResponsePhaseHTTPLogCustomFields RuleDeleteResponsePhase = "http_log_custom_fields"
- RuleDeleteResponsePhaseHTTPRatelimit RuleDeleteResponsePhase = "http_ratelimit"
- RuleDeleteResponsePhaseHTTPRequestCacheSettings RuleDeleteResponsePhase = "http_request_cache_settings"
- RuleDeleteResponsePhaseHTTPRequestDynamicRedirect RuleDeleteResponsePhase = "http_request_dynamic_redirect"
- RuleDeleteResponsePhaseHTTPRequestFirewallCustom RuleDeleteResponsePhase = "http_request_firewall_custom"
- RuleDeleteResponsePhaseHTTPRequestFirewallManaged RuleDeleteResponsePhase = "http_request_firewall_managed"
- RuleDeleteResponsePhaseHTTPRequestLateTransform RuleDeleteResponsePhase = "http_request_late_transform"
- RuleDeleteResponsePhaseHTTPRequestOrigin RuleDeleteResponsePhase = "http_request_origin"
- RuleDeleteResponsePhaseHTTPRequestRedirect RuleDeleteResponsePhase = "http_request_redirect"
- RuleDeleteResponsePhaseHTTPRequestSanitize RuleDeleteResponsePhase = "http_request_sanitize"
- RuleDeleteResponsePhaseHTTPRequestSbfm RuleDeleteResponsePhase = "http_request_sbfm"
- RuleDeleteResponsePhaseHTTPRequestSelectConfiguration RuleDeleteResponsePhase = "http_request_select_configuration"
- RuleDeleteResponsePhaseHTTPRequestTransform RuleDeleteResponsePhase = "http_request_transform"
- RuleDeleteResponsePhaseHTTPResponseCompression RuleDeleteResponsePhase = "http_response_compression"
- RuleDeleteResponsePhaseHTTPResponseFirewallManaged RuleDeleteResponsePhase = "http_response_firewall_managed"
- RuleDeleteResponsePhaseHTTPResponseHeadersTransform RuleDeleteResponsePhase = "http_response_headers_transform"
- RuleDeleteResponsePhaseMagicTransit RuleDeleteResponsePhase = "magic_transit"
- RuleDeleteResponsePhaseMagicTransitIDsManaged RuleDeleteResponsePhase = "magic_transit_ids_managed"
- RuleDeleteResponsePhaseMagicTransitManaged RuleDeleteResponsePhase = "magic_transit_managed"
-)
-
-func (r RuleDeleteResponsePhase) IsKnown() bool {
- switch r {
- case RuleDeleteResponsePhaseDDoSL4, RuleDeleteResponsePhaseDDoSL7, RuleDeleteResponsePhaseHTTPConfigSettings, RuleDeleteResponsePhaseHTTPCustomErrors, RuleDeleteResponsePhaseHTTPLogCustomFields, RuleDeleteResponsePhaseHTTPRatelimit, RuleDeleteResponsePhaseHTTPRequestCacheSettings, RuleDeleteResponsePhaseHTTPRequestDynamicRedirect, RuleDeleteResponsePhaseHTTPRequestFirewallCustom, RuleDeleteResponsePhaseHTTPRequestFirewallManaged, RuleDeleteResponsePhaseHTTPRequestLateTransform, RuleDeleteResponsePhaseHTTPRequestOrigin, RuleDeleteResponsePhaseHTTPRequestRedirect, RuleDeleteResponsePhaseHTTPRequestSanitize, RuleDeleteResponsePhaseHTTPRequestSbfm, RuleDeleteResponsePhaseHTTPRequestSelectConfiguration, RuleDeleteResponsePhaseHTTPRequestTransform, RuleDeleteResponsePhaseHTTPResponseCompression, RuleDeleteResponsePhaseHTTPResponseFirewallManaged, RuleDeleteResponsePhaseHTTPResponseHeadersTransform, RuleDeleteResponsePhaseMagicTransit, RuleDeleteResponsePhaseMagicTransitIDsManaged, RuleDeleteResponsePhaseMagicTransitManaged:
- return true
- }
- return false
-}
-
-type RuleDeleteResponseRule struct {
- // The action to perform when the rule matches.
- Action RuleDeleteResponseRulesAction `json:"action"`
- ActionParameters interface{} `json:"action_parameters,required"`
- Categories interface{} `json:"categories,required"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // An object configuring the rule's logging behavior.
- Logging shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- // The version of the rule.
- Version string `json:"version,required"`
- JSON ruleDeleteResponseRuleJSON `json:"-"`
- union RuleDeleteResponseRulesUnion
-}
-
-// ruleDeleteResponseRuleJSON contains the JSON metadata for the struct
-// [RuleDeleteResponseRule]
-type ruleDeleteResponseRuleJSON struct {
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- ID apijson.Field
- LastUpdated apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- Version apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r ruleDeleteResponseRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r *RuleDeleteResponseRule) UnmarshalJSON(data []byte) (err error) {
- err = apijson.UnmarshalRoot(data, &r.union)
- if err != nil {
- return err
- }
- return apijson.Port(r.union, &r)
-}
-
-func (r RuleDeleteResponseRule) AsUnion() RuleDeleteResponseRulesUnion {
- return r.union
-}
-
-// Union satisfied by [rulesets.RuleDeleteResponseRulesRulesetsBlockRule],
-// [rulesets.RuleDeleteResponseRulesRulesetsExecuteRule],
-// [rulesets.RuleDeleteResponseRulesRulesetsLogRule] or
-// [rulesets.RuleDeleteResponseRulesRulesetsSkipRule].
-type RuleDeleteResponseRulesUnion interface {
- implementsRulesetsRuleDeleteResponseRule()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*RuleDeleteResponseRulesUnion)(nil)).Elem(),
- "action",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RuleDeleteResponseRulesRulesetsBlockRule{}),
- DiscriminatorValue: "block",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RuleDeleteResponseRulesRulesetsExecuteRule{}),
- DiscriminatorValue: "execute",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RuleDeleteResponseRulesRulesetsLogRule{}),
- DiscriminatorValue: "log",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RuleDeleteResponseRulesRulesetsSkipRule{}),
- DiscriminatorValue: "skip",
- },
- )
-}
-
-type RuleDeleteResponseRulesRulesetsBlockRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action RuleDeleteResponseRulesRulesetsBlockRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters RuleDeleteResponseRulesRulesetsBlockRuleActionParameters `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON ruleDeleteResponseRulesRulesetsBlockRuleJSON `json:"-"`
-}
-
-// ruleDeleteResponseRulesRulesetsBlockRuleJSON contains the JSON metadata for the
-// struct [RuleDeleteResponseRulesRulesetsBlockRule]
-type ruleDeleteResponseRulesRulesetsBlockRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleDeleteResponseRulesRulesetsBlockRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleDeleteResponseRulesRulesetsBlockRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r RuleDeleteResponseRulesRulesetsBlockRule) implementsRulesetsRuleDeleteResponseRule() {}
-
-// The action to perform when the rule matches.
-type RuleDeleteResponseRulesRulesetsBlockRuleAction string
-
-const (
- RuleDeleteResponseRulesRulesetsBlockRuleActionBlock RuleDeleteResponseRulesRulesetsBlockRuleAction = "block"
-)
-
-func (r RuleDeleteResponseRulesRulesetsBlockRuleAction) IsKnown() bool {
- switch r {
- case RuleDeleteResponseRulesRulesetsBlockRuleActionBlock:
- return true
- }
- return false
-}
-
-// The parameters configuring the rule's action.
-type RuleDeleteResponseRulesRulesetsBlockRuleActionParameters struct {
- // The response to show when the block is applied.
- Response RuleDeleteResponseRulesRulesetsBlockRuleActionParametersResponse `json:"response"`
- JSON ruleDeleteResponseRulesRulesetsBlockRuleActionParametersJSON `json:"-"`
-}
-
-// ruleDeleteResponseRulesRulesetsBlockRuleActionParametersJSON contains the JSON
-// metadata for the struct
-// [RuleDeleteResponseRulesRulesetsBlockRuleActionParameters]
-type ruleDeleteResponseRulesRulesetsBlockRuleActionParametersJSON struct {
- Response apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleDeleteResponseRulesRulesetsBlockRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleDeleteResponseRulesRulesetsBlockRuleActionParametersJSON) RawJSON() string {
- return r.raw
-}
-
-// The response to show when the block is applied.
-type RuleDeleteResponseRulesRulesetsBlockRuleActionParametersResponse struct {
- // The content to return.
- Content string `json:"content,required"`
- // The type of the content to return.
- ContentType string `json:"content_type,required"`
- // The status code to return.
- StatusCode int64 `json:"status_code,required"`
- JSON ruleDeleteResponseRulesRulesetsBlockRuleActionParametersResponseJSON `json:"-"`
-}
-
-// ruleDeleteResponseRulesRulesetsBlockRuleActionParametersResponseJSON contains
-// the JSON metadata for the struct
-// [RuleDeleteResponseRulesRulesetsBlockRuleActionParametersResponse]
-type ruleDeleteResponseRulesRulesetsBlockRuleActionParametersResponseJSON struct {
- Content apijson.Field
- ContentType apijson.Field
- StatusCode apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleDeleteResponseRulesRulesetsBlockRuleActionParametersResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleDeleteResponseRulesRulesetsBlockRuleActionParametersResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RuleDeleteResponseRulesRulesetsExecuteRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action RuleDeleteResponseRulesRulesetsExecuteRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters RuleDeleteResponseRulesRulesetsExecuteRuleActionParameters `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON ruleDeleteResponseRulesRulesetsExecuteRuleJSON `json:"-"`
-}
-
-// ruleDeleteResponseRulesRulesetsExecuteRuleJSON contains the JSON metadata for
-// the struct [RuleDeleteResponseRulesRulesetsExecuteRule]
-type ruleDeleteResponseRulesRulesetsExecuteRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleDeleteResponseRulesRulesetsExecuteRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleDeleteResponseRulesRulesetsExecuteRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r RuleDeleteResponseRulesRulesetsExecuteRule) implementsRulesetsRuleDeleteResponseRule() {}
-
-// The action to perform when the rule matches.
-type RuleDeleteResponseRulesRulesetsExecuteRuleAction string
-
-const (
- RuleDeleteResponseRulesRulesetsExecuteRuleActionExecute RuleDeleteResponseRulesRulesetsExecuteRuleAction = "execute"
-)
-
-func (r RuleDeleteResponseRulesRulesetsExecuteRuleAction) IsKnown() bool {
- switch r {
- case RuleDeleteResponseRulesRulesetsExecuteRuleActionExecute:
- return true
- }
- return false
-}
-
-// The parameters configuring the rule's action.
-type RuleDeleteResponseRulesRulesetsExecuteRuleActionParameters struct {
- // The ID of the ruleset to execute.
- ID string `json:"id,required"`
- // The configuration to use for matched data logging.
- MatchedData RuleDeleteResponseRulesRulesetsExecuteRuleActionParametersMatchedData `json:"matched_data"`
- // A set of overrides to apply to the target ruleset.
- Overrides RuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverrides `json:"overrides"`
- JSON ruleDeleteResponseRulesRulesetsExecuteRuleActionParametersJSON `json:"-"`
-}
-
-// ruleDeleteResponseRulesRulesetsExecuteRuleActionParametersJSON contains the JSON
-// metadata for the struct
-// [RuleDeleteResponseRulesRulesetsExecuteRuleActionParameters]
-type ruleDeleteResponseRulesRulesetsExecuteRuleActionParametersJSON struct {
- ID apijson.Field
- MatchedData apijson.Field
- Overrides apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleDeleteResponseRulesRulesetsExecuteRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleDeleteResponseRulesRulesetsExecuteRuleActionParametersJSON) RawJSON() string {
- return r.raw
-}
-
-// The configuration to use for matched data logging.
-type RuleDeleteResponseRulesRulesetsExecuteRuleActionParametersMatchedData struct {
- // The public key to encrypt matched data logs with.
- PublicKey string `json:"public_key,required"`
- JSON ruleDeleteResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON `json:"-"`
-}
-
-// ruleDeleteResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON
-// contains the JSON metadata for the struct
-// [RuleDeleteResponseRulesRulesetsExecuteRuleActionParametersMatchedData]
-type ruleDeleteResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON struct {
- PublicKey apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleDeleteResponseRulesRulesetsExecuteRuleActionParametersMatchedData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleDeleteResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON) RawJSON() string {
- return r.raw
-}
-
-// A set of overrides to apply to the target ruleset.
-type RuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverrides struct {
- // An action to override all rules with. This option has lower precedence than rule
- // and category overrides.
- Action string `json:"action"`
- // A list of category-level overrides. This option has the second-highest
- // precedence after rule-level overrides.
- Categories []RuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory `json:"categories"`
- // Whether to enable execution of all rules. This option has lower precedence than
- // rule and category overrides.
- Enabled bool `json:"enabled"`
- // A list of rule-level overrides. This option has the highest precedence.
- Rules []RuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRule `json:"rules"`
- // A sensitivity level to set for all rules. This option has lower precedence than
- // rule and category overrides and is only applicable for DDoS phases.
- SensitivityLevel RuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel `json:"sensitivity_level"`
- JSON ruleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON `json:"-"`
-}
-
-// ruleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON contains
-// the JSON metadata for the struct
-// [RuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverrides]
-type ruleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON struct {
- Action apijson.Field
- Categories apijson.Field
- Enabled apijson.Field
- Rules apijson.Field
- SensitivityLevel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverrides) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON) RawJSON() string {
- return r.raw
-}
-
-// A category-level override
-type RuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory struct {
- // The name of the category to override.
- Category string `json:"category,required"`
- // The action to override rules in the category with.
- Action string `json:"action"`
- // Whether to enable execution of rules in the category.
- Enabled bool `json:"enabled"`
- // The sensitivity level to use for rules in the category.
- SensitivityLevel RuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel `json:"sensitivity_level"`
- JSON ruleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON `json:"-"`
-}
-
-// ruleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON
-// contains the JSON metadata for the struct
-// [RuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory]
-type ruleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON struct {
- Category apijson.Field
- Action apijson.Field
- Enabled apijson.Field
- SensitivityLevel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON) RawJSON() string {
- return r.raw
-}
-
-// The sensitivity level to use for rules in the category.
-type RuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel string
-
-const (
- RuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault RuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "default"
- RuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium RuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "medium"
- RuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow RuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "low"
- RuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff RuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "eoff"
-)
-
-func (r RuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel) IsKnown() bool {
- switch r {
- case RuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault, RuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium, RuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow, RuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff:
- return true
- }
- return false
-}
-
-// A rule-level override
-type RuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRule struct {
- // The ID of the rule to override.
- ID string `json:"id,required"`
- // The action to override the rule with.
- Action string `json:"action"`
- // Whether to enable execution of the rule.
- Enabled bool `json:"enabled"`
- // The score threshold to use for the rule.
- ScoreThreshold int64 `json:"score_threshold"`
- // The sensitivity level to use for the rule.
- SensitivityLevel RuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel `json:"sensitivity_level"`
- JSON ruleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON `json:"-"`
-}
-
-// ruleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON
-// contains the JSON metadata for the struct
-// [RuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRule]
-type ruleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON struct {
- ID apijson.Field
- Action apijson.Field
- Enabled apijson.Field
- ScoreThreshold apijson.Field
- SensitivityLevel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON) RawJSON() string {
- return r.raw
-}
-
-// The sensitivity level to use for the rule.
-type RuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel string
-
-const (
- RuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault RuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "default"
- RuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium RuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "medium"
- RuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow RuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "low"
- RuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff RuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "eoff"
-)
-
-func (r RuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel) IsKnown() bool {
- switch r {
- case RuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault, RuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium, RuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow, RuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff:
- return true
- }
- return false
-}
-
-// A sensitivity level to set for all rules. This option has lower precedence than
-// rule and category overrides and is only applicable for DDoS phases.
-type RuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel string
-
-const (
- RuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault RuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "default"
- RuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium RuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "medium"
- RuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow RuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "low"
- RuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff RuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "eoff"
-)
-
-func (r RuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel) IsKnown() bool {
- switch r {
- case RuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault, RuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium, RuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow, RuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff:
- return true
- }
- return false
-}
-
-type RuleDeleteResponseRulesRulesetsLogRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action RuleDeleteResponseRulesRulesetsLogRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters interface{} `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON ruleDeleteResponseRulesRulesetsLogRuleJSON `json:"-"`
-}
-
-// ruleDeleteResponseRulesRulesetsLogRuleJSON contains the JSON metadata for the
-// struct [RuleDeleteResponseRulesRulesetsLogRule]
-type ruleDeleteResponseRulesRulesetsLogRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleDeleteResponseRulesRulesetsLogRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleDeleteResponseRulesRulesetsLogRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r RuleDeleteResponseRulesRulesetsLogRule) implementsRulesetsRuleDeleteResponseRule() {}
-
-// The action to perform when the rule matches.
-type RuleDeleteResponseRulesRulesetsLogRuleAction string
-
-const (
- RuleDeleteResponseRulesRulesetsLogRuleActionLog RuleDeleteResponseRulesRulesetsLogRuleAction = "log"
-)
-
-func (r RuleDeleteResponseRulesRulesetsLogRuleAction) IsKnown() bool {
- switch r {
- case RuleDeleteResponseRulesRulesetsLogRuleActionLog:
- return true
- }
- return false
-}
-
-type RuleDeleteResponseRulesRulesetsSkipRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action RuleDeleteResponseRulesRulesetsSkipRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters RuleDeleteResponseRulesRulesetsSkipRuleActionParameters `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON ruleDeleteResponseRulesRulesetsSkipRuleJSON `json:"-"`
-}
-
-// ruleDeleteResponseRulesRulesetsSkipRuleJSON contains the JSON metadata for the
-// struct [RuleDeleteResponseRulesRulesetsSkipRule]
-type ruleDeleteResponseRulesRulesetsSkipRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleDeleteResponseRulesRulesetsSkipRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleDeleteResponseRulesRulesetsSkipRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r RuleDeleteResponseRulesRulesetsSkipRule) implementsRulesetsRuleDeleteResponseRule() {}
-
-// The action to perform when the rule matches.
-type RuleDeleteResponseRulesRulesetsSkipRuleAction string
-
-const (
- RuleDeleteResponseRulesRulesetsSkipRuleActionSkip RuleDeleteResponseRulesRulesetsSkipRuleAction = "skip"
-)
-
-func (r RuleDeleteResponseRulesRulesetsSkipRuleAction) IsKnown() bool {
- switch r {
- case RuleDeleteResponseRulesRulesetsSkipRuleActionSkip:
- return true
- }
- return false
-}
-
-// The parameters configuring the rule's action.
-type RuleDeleteResponseRulesRulesetsSkipRuleActionParameters struct {
- // A list of phases to skip the execution of. This option is incompatible with the
- // ruleset and rulesets options.
- Phases []RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase `json:"phases"`
- // A list of legacy security products to skip the execution of.
- Products []RuleDeleteResponseRulesRulesetsSkipRuleActionParametersProduct `json:"products"`
- // A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the
- // execution of. This option is incompatible with the ruleset option.
- Rules map[string][]string `json:"rules"`
- // A ruleset to skip the execution of. This option is incompatible with the
- // rulesets, rules and phases options.
- Ruleset RuleDeleteResponseRulesRulesetsSkipRuleActionParametersRuleset `json:"ruleset"`
- // A list of ruleset IDs to skip the execution of. This option is incompatible with
- // the ruleset and phases options.
- Rulesets []string `json:"rulesets"`
- JSON ruleDeleteResponseRulesRulesetsSkipRuleActionParametersJSON `json:"-"`
-}
-
-// ruleDeleteResponseRulesRulesetsSkipRuleActionParametersJSON contains the JSON
-// metadata for the struct
-// [RuleDeleteResponseRulesRulesetsSkipRuleActionParameters]
-type ruleDeleteResponseRulesRulesetsSkipRuleActionParametersJSON struct {
- Phases apijson.Field
- Products apijson.Field
- Rules apijson.Field
- Ruleset apijson.Field
- Rulesets apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleDeleteResponseRulesRulesetsSkipRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleDeleteResponseRulesRulesetsSkipRuleActionParametersJSON) RawJSON() string {
- return r.raw
-}
-
-// A phase to skip the execution of.
-type RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase string
-
-const (
- RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseDDoSL4 RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l4"
- RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseDDoSL7 RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l7"
- RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_config_settings"
- RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_custom_errors"
- RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_log_custom_fields"
- RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRatelimit RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_ratelimit"
- RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_cache_settings"
- RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_dynamic_redirect"
- RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_custom"
- RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_managed"
- RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_late_transform"
- RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_origin"
- RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_redirect"
- RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sanitize"
- RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sbfm"
- RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_select_configuration"
- RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_transform"
- RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_compression"
- RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_firewall_managed"
- RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_headers_transform"
- RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransit RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit"
- RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_ids_managed"
- RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitManaged RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_managed"
-)
-
-func (r RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase) IsKnown() bool {
- switch r {
- case RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseDDoSL4, RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseDDoSL7, RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings, RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors, RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields, RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRatelimit, RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings, RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect, RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom, RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged, RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform, RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin, RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect, RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize, RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm, RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration, RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform, RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression, RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged, RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform, RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransit, RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged, RuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitManaged:
- return true
- }
- return false
-}
-
-// The name of a legacy security product to skip the execution of.
-type RuleDeleteResponseRulesRulesetsSkipRuleActionParametersProduct string
-
-const (
- RuleDeleteResponseRulesRulesetsSkipRuleActionParametersProductBic RuleDeleteResponseRulesRulesetsSkipRuleActionParametersProduct = "bic"
- RuleDeleteResponseRulesRulesetsSkipRuleActionParametersProductHot RuleDeleteResponseRulesRulesetsSkipRuleActionParametersProduct = "hot"
- RuleDeleteResponseRulesRulesetsSkipRuleActionParametersProductRateLimit RuleDeleteResponseRulesRulesetsSkipRuleActionParametersProduct = "rateLimit"
- RuleDeleteResponseRulesRulesetsSkipRuleActionParametersProductSecurityLevel RuleDeleteResponseRulesRulesetsSkipRuleActionParametersProduct = "securityLevel"
- RuleDeleteResponseRulesRulesetsSkipRuleActionParametersProductUABlock RuleDeleteResponseRulesRulesetsSkipRuleActionParametersProduct = "uaBlock"
- RuleDeleteResponseRulesRulesetsSkipRuleActionParametersProductWAF RuleDeleteResponseRulesRulesetsSkipRuleActionParametersProduct = "waf"
- RuleDeleteResponseRulesRulesetsSkipRuleActionParametersProductZoneLockdown RuleDeleteResponseRulesRulesetsSkipRuleActionParametersProduct = "zoneLockdown"
-)
-
-func (r RuleDeleteResponseRulesRulesetsSkipRuleActionParametersProduct) IsKnown() bool {
- switch r {
- case RuleDeleteResponseRulesRulesetsSkipRuleActionParametersProductBic, RuleDeleteResponseRulesRulesetsSkipRuleActionParametersProductHot, RuleDeleteResponseRulesRulesetsSkipRuleActionParametersProductRateLimit, RuleDeleteResponseRulesRulesetsSkipRuleActionParametersProductSecurityLevel, RuleDeleteResponseRulesRulesetsSkipRuleActionParametersProductUABlock, RuleDeleteResponseRulesRulesetsSkipRuleActionParametersProductWAF, RuleDeleteResponseRulesRulesetsSkipRuleActionParametersProductZoneLockdown:
- return true
- }
- return false
-}
-
-// A ruleset to skip the execution of. This option is incompatible with the
-// rulesets, rules and phases options.
-type RuleDeleteResponseRulesRulesetsSkipRuleActionParametersRuleset string
-
-const (
- RuleDeleteResponseRulesRulesetsSkipRuleActionParametersRulesetCurrent RuleDeleteResponseRulesRulesetsSkipRuleActionParametersRuleset = "current"
-)
-
-func (r RuleDeleteResponseRulesRulesetsSkipRuleActionParametersRuleset) IsKnown() bool {
- switch r {
- case RuleDeleteResponseRulesRulesetsSkipRuleActionParametersRulesetCurrent:
- return true
- }
- return false
-}
-
-// The action to perform when the rule matches.
-type RuleDeleteResponseRulesAction string
-
-const (
- RuleDeleteResponseRulesActionBlock RuleDeleteResponseRulesAction = "block"
- RuleDeleteResponseRulesActionExecute RuleDeleteResponseRulesAction = "execute"
- RuleDeleteResponseRulesActionLog RuleDeleteResponseRulesAction = "log"
- RuleDeleteResponseRulesActionSkip RuleDeleteResponseRulesAction = "skip"
-)
-
-func (r RuleDeleteResponseRulesAction) IsKnown() bool {
- switch r {
- case RuleDeleteResponseRulesActionBlock, RuleDeleteResponseRulesActionExecute, RuleDeleteResponseRulesActionLog, RuleDeleteResponseRulesActionSkip:
- return true
- }
- return false
-}
-
-// A ruleset object.
-type RuleEditResponse struct {
- // The unique ID of the ruleset.
- ID string `json:"id,required"`
- // The kind of the ruleset.
- Kind RuleEditResponseKind `json:"kind,required"`
- // The timestamp of when the ruleset was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The human-readable name of the ruleset.
- Name string `json:"name,required"`
- // The phase of the ruleset.
- Phase RuleEditResponsePhase `json:"phase,required"`
- // The list of rules in the ruleset.
- Rules []RuleEditResponseRule `json:"rules,required"`
- // The version of the ruleset.
- Version string `json:"version,required"`
- // An informative description of the ruleset.
- Description string `json:"description"`
- JSON ruleEditResponseJSON `json:"-"`
-}
-
-// ruleEditResponseJSON contains the JSON metadata for the struct
-// [RuleEditResponse]
-type ruleEditResponseJSON struct {
- ID apijson.Field
- Kind apijson.Field
- LastUpdated apijson.Field
- Name apijson.Field
- Phase apijson.Field
- Rules apijson.Field
- Version apijson.Field
- Description apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleEditResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleEditResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The kind of the ruleset.
-type RuleEditResponseKind string
-
-const (
- RuleEditResponseKindManaged RuleEditResponseKind = "managed"
- RuleEditResponseKindCustom RuleEditResponseKind = "custom"
- RuleEditResponseKindRoot RuleEditResponseKind = "root"
- RuleEditResponseKindZone RuleEditResponseKind = "zone"
-)
-
-func (r RuleEditResponseKind) IsKnown() bool {
- switch r {
- case RuleEditResponseKindManaged, RuleEditResponseKindCustom, RuleEditResponseKindRoot, RuleEditResponseKindZone:
- return true
- }
- return false
-}
-
-// The phase of the ruleset.
-type RuleEditResponsePhase string
-
-const (
- RuleEditResponsePhaseDDoSL4 RuleEditResponsePhase = "ddos_l4"
- RuleEditResponsePhaseDDoSL7 RuleEditResponsePhase = "ddos_l7"
- RuleEditResponsePhaseHTTPConfigSettings RuleEditResponsePhase = "http_config_settings"
- RuleEditResponsePhaseHTTPCustomErrors RuleEditResponsePhase = "http_custom_errors"
- RuleEditResponsePhaseHTTPLogCustomFields RuleEditResponsePhase = "http_log_custom_fields"
- RuleEditResponsePhaseHTTPRatelimit RuleEditResponsePhase = "http_ratelimit"
- RuleEditResponsePhaseHTTPRequestCacheSettings RuleEditResponsePhase = "http_request_cache_settings"
- RuleEditResponsePhaseHTTPRequestDynamicRedirect RuleEditResponsePhase = "http_request_dynamic_redirect"
- RuleEditResponsePhaseHTTPRequestFirewallCustom RuleEditResponsePhase = "http_request_firewall_custom"
- RuleEditResponsePhaseHTTPRequestFirewallManaged RuleEditResponsePhase = "http_request_firewall_managed"
- RuleEditResponsePhaseHTTPRequestLateTransform RuleEditResponsePhase = "http_request_late_transform"
- RuleEditResponsePhaseHTTPRequestOrigin RuleEditResponsePhase = "http_request_origin"
- RuleEditResponsePhaseHTTPRequestRedirect RuleEditResponsePhase = "http_request_redirect"
- RuleEditResponsePhaseHTTPRequestSanitize RuleEditResponsePhase = "http_request_sanitize"
- RuleEditResponsePhaseHTTPRequestSbfm RuleEditResponsePhase = "http_request_sbfm"
- RuleEditResponsePhaseHTTPRequestSelectConfiguration RuleEditResponsePhase = "http_request_select_configuration"
- RuleEditResponsePhaseHTTPRequestTransform RuleEditResponsePhase = "http_request_transform"
- RuleEditResponsePhaseHTTPResponseCompression RuleEditResponsePhase = "http_response_compression"
- RuleEditResponsePhaseHTTPResponseFirewallManaged RuleEditResponsePhase = "http_response_firewall_managed"
- RuleEditResponsePhaseHTTPResponseHeadersTransform RuleEditResponsePhase = "http_response_headers_transform"
- RuleEditResponsePhaseMagicTransit RuleEditResponsePhase = "magic_transit"
- RuleEditResponsePhaseMagicTransitIDsManaged RuleEditResponsePhase = "magic_transit_ids_managed"
- RuleEditResponsePhaseMagicTransitManaged RuleEditResponsePhase = "magic_transit_managed"
-)
-
-func (r RuleEditResponsePhase) IsKnown() bool {
- switch r {
- case RuleEditResponsePhaseDDoSL4, RuleEditResponsePhaseDDoSL7, RuleEditResponsePhaseHTTPConfigSettings, RuleEditResponsePhaseHTTPCustomErrors, RuleEditResponsePhaseHTTPLogCustomFields, RuleEditResponsePhaseHTTPRatelimit, RuleEditResponsePhaseHTTPRequestCacheSettings, RuleEditResponsePhaseHTTPRequestDynamicRedirect, RuleEditResponsePhaseHTTPRequestFirewallCustom, RuleEditResponsePhaseHTTPRequestFirewallManaged, RuleEditResponsePhaseHTTPRequestLateTransform, RuleEditResponsePhaseHTTPRequestOrigin, RuleEditResponsePhaseHTTPRequestRedirect, RuleEditResponsePhaseHTTPRequestSanitize, RuleEditResponsePhaseHTTPRequestSbfm, RuleEditResponsePhaseHTTPRequestSelectConfiguration, RuleEditResponsePhaseHTTPRequestTransform, RuleEditResponsePhaseHTTPResponseCompression, RuleEditResponsePhaseHTTPResponseFirewallManaged, RuleEditResponsePhaseHTTPResponseHeadersTransform, RuleEditResponsePhaseMagicTransit, RuleEditResponsePhaseMagicTransitIDsManaged, RuleEditResponsePhaseMagicTransitManaged:
- return true
- }
- return false
-}
-
-type RuleEditResponseRule struct {
- // The action to perform when the rule matches.
- Action RuleEditResponseRulesAction `json:"action"`
- ActionParameters interface{} `json:"action_parameters,required"`
- Categories interface{} `json:"categories,required"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // An object configuring the rule's logging behavior.
- Logging shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- // The version of the rule.
- Version string `json:"version,required"`
- JSON ruleEditResponseRuleJSON `json:"-"`
- union RuleEditResponseRulesUnion
-}
-
-// ruleEditResponseRuleJSON contains the JSON metadata for the struct
-// [RuleEditResponseRule]
-type ruleEditResponseRuleJSON struct {
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- ID apijson.Field
- LastUpdated apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- Version apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r ruleEditResponseRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r *RuleEditResponseRule) UnmarshalJSON(data []byte) (err error) {
- err = apijson.UnmarshalRoot(data, &r.union)
- if err != nil {
- return err
- }
- return apijson.Port(r.union, &r)
-}
-
-func (r RuleEditResponseRule) AsUnion() RuleEditResponseRulesUnion {
- return r.union
-}
-
-// Union satisfied by [rulesets.RuleEditResponseRulesRulesetsBlockRule],
-// [rulesets.RuleEditResponseRulesRulesetsExecuteRule],
-// [rulesets.RuleEditResponseRulesRulesetsLogRule] or
-// [rulesets.RuleEditResponseRulesRulesetsSkipRule].
-type RuleEditResponseRulesUnion interface {
- implementsRulesetsRuleEditResponseRule()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*RuleEditResponseRulesUnion)(nil)).Elem(),
- "action",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RuleEditResponseRulesRulesetsBlockRule{}),
- DiscriminatorValue: "block",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RuleEditResponseRulesRulesetsExecuteRule{}),
- DiscriminatorValue: "execute",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RuleEditResponseRulesRulesetsLogRule{}),
- DiscriminatorValue: "log",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RuleEditResponseRulesRulesetsSkipRule{}),
- DiscriminatorValue: "skip",
- },
- )
-}
-
-type RuleEditResponseRulesRulesetsBlockRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action RuleEditResponseRulesRulesetsBlockRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters RuleEditResponseRulesRulesetsBlockRuleActionParameters `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON ruleEditResponseRulesRulesetsBlockRuleJSON `json:"-"`
-}
-
-// ruleEditResponseRulesRulesetsBlockRuleJSON contains the JSON metadata for the
-// struct [RuleEditResponseRulesRulesetsBlockRule]
-type ruleEditResponseRulesRulesetsBlockRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleEditResponseRulesRulesetsBlockRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleEditResponseRulesRulesetsBlockRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r RuleEditResponseRulesRulesetsBlockRule) implementsRulesetsRuleEditResponseRule() {}
-
-// The action to perform when the rule matches.
-type RuleEditResponseRulesRulesetsBlockRuleAction string
-
-const (
- RuleEditResponseRulesRulesetsBlockRuleActionBlock RuleEditResponseRulesRulesetsBlockRuleAction = "block"
-)
-
-func (r RuleEditResponseRulesRulesetsBlockRuleAction) IsKnown() bool {
- switch r {
- case RuleEditResponseRulesRulesetsBlockRuleActionBlock:
- return true
- }
- return false
-}
-
-// The parameters configuring the rule's action.
-type RuleEditResponseRulesRulesetsBlockRuleActionParameters struct {
- // The response to show when the block is applied.
- Response RuleEditResponseRulesRulesetsBlockRuleActionParametersResponse `json:"response"`
- JSON ruleEditResponseRulesRulesetsBlockRuleActionParametersJSON `json:"-"`
-}
-
-// ruleEditResponseRulesRulesetsBlockRuleActionParametersJSON contains the JSON
-// metadata for the struct [RuleEditResponseRulesRulesetsBlockRuleActionParameters]
-type ruleEditResponseRulesRulesetsBlockRuleActionParametersJSON struct {
- Response apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleEditResponseRulesRulesetsBlockRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleEditResponseRulesRulesetsBlockRuleActionParametersJSON) RawJSON() string {
- return r.raw
-}
-
-// The response to show when the block is applied.
-type RuleEditResponseRulesRulesetsBlockRuleActionParametersResponse struct {
- // The content to return.
- Content string `json:"content,required"`
- // The type of the content to return.
- ContentType string `json:"content_type,required"`
- // The status code to return.
- StatusCode int64 `json:"status_code,required"`
- JSON ruleEditResponseRulesRulesetsBlockRuleActionParametersResponseJSON `json:"-"`
-}
-
-// ruleEditResponseRulesRulesetsBlockRuleActionParametersResponseJSON contains the
-// JSON metadata for the struct
-// [RuleEditResponseRulesRulesetsBlockRuleActionParametersResponse]
-type ruleEditResponseRulesRulesetsBlockRuleActionParametersResponseJSON struct {
- Content apijson.Field
- ContentType apijson.Field
- StatusCode apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleEditResponseRulesRulesetsBlockRuleActionParametersResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleEditResponseRulesRulesetsBlockRuleActionParametersResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RuleEditResponseRulesRulesetsExecuteRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action RuleEditResponseRulesRulesetsExecuteRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters RuleEditResponseRulesRulesetsExecuteRuleActionParameters `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON ruleEditResponseRulesRulesetsExecuteRuleJSON `json:"-"`
-}
-
-// ruleEditResponseRulesRulesetsExecuteRuleJSON contains the JSON metadata for the
-// struct [RuleEditResponseRulesRulesetsExecuteRule]
-type ruleEditResponseRulesRulesetsExecuteRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleEditResponseRulesRulesetsExecuteRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleEditResponseRulesRulesetsExecuteRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r RuleEditResponseRulesRulesetsExecuteRule) implementsRulesetsRuleEditResponseRule() {}
-
-// The action to perform when the rule matches.
-type RuleEditResponseRulesRulesetsExecuteRuleAction string
-
-const (
- RuleEditResponseRulesRulesetsExecuteRuleActionExecute RuleEditResponseRulesRulesetsExecuteRuleAction = "execute"
-)
-
-func (r RuleEditResponseRulesRulesetsExecuteRuleAction) IsKnown() bool {
- switch r {
- case RuleEditResponseRulesRulesetsExecuteRuleActionExecute:
- return true
- }
- return false
-}
-
-// The parameters configuring the rule's action.
-type RuleEditResponseRulesRulesetsExecuteRuleActionParameters struct {
- // The ID of the ruleset to execute.
- ID string `json:"id,required"`
- // The configuration to use for matched data logging.
- MatchedData RuleEditResponseRulesRulesetsExecuteRuleActionParametersMatchedData `json:"matched_data"`
- // A set of overrides to apply to the target ruleset.
- Overrides RuleEditResponseRulesRulesetsExecuteRuleActionParametersOverrides `json:"overrides"`
- JSON ruleEditResponseRulesRulesetsExecuteRuleActionParametersJSON `json:"-"`
-}
-
-// ruleEditResponseRulesRulesetsExecuteRuleActionParametersJSON contains the JSON
-// metadata for the struct
-// [RuleEditResponseRulesRulesetsExecuteRuleActionParameters]
-type ruleEditResponseRulesRulesetsExecuteRuleActionParametersJSON struct {
- ID apijson.Field
- MatchedData apijson.Field
- Overrides apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleEditResponseRulesRulesetsExecuteRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleEditResponseRulesRulesetsExecuteRuleActionParametersJSON) RawJSON() string {
- return r.raw
-}
-
-// The configuration to use for matched data logging.
-type RuleEditResponseRulesRulesetsExecuteRuleActionParametersMatchedData struct {
- // The public key to encrypt matched data logs with.
- PublicKey string `json:"public_key,required"`
- JSON ruleEditResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON `json:"-"`
-}
-
-// ruleEditResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON contains
-// the JSON metadata for the struct
-// [RuleEditResponseRulesRulesetsExecuteRuleActionParametersMatchedData]
-type ruleEditResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON struct {
- PublicKey apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleEditResponseRulesRulesetsExecuteRuleActionParametersMatchedData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleEditResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON) RawJSON() string {
- return r.raw
-}
-
-// A set of overrides to apply to the target ruleset.
-type RuleEditResponseRulesRulesetsExecuteRuleActionParametersOverrides struct {
- // An action to override all rules with. This option has lower precedence than rule
- // and category overrides.
- Action string `json:"action"`
- // A list of category-level overrides. This option has the second-highest
- // precedence after rule-level overrides.
- Categories []RuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory `json:"categories"`
- // Whether to enable execution of all rules. This option has lower precedence than
- // rule and category overrides.
- Enabled bool `json:"enabled"`
- // A list of rule-level overrides. This option has the highest precedence.
- Rules []RuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesRule `json:"rules"`
- // A sensitivity level to set for all rules. This option has lower precedence than
- // rule and category overrides and is only applicable for DDoS phases.
- SensitivityLevel RuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel `json:"sensitivity_level"`
- JSON ruleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON `json:"-"`
-}
-
-// ruleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON contains
-// the JSON metadata for the struct
-// [RuleEditResponseRulesRulesetsExecuteRuleActionParametersOverrides]
-type ruleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON struct {
- Action apijson.Field
- Categories apijson.Field
- Enabled apijson.Field
- Rules apijson.Field
- SensitivityLevel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleEditResponseRulesRulesetsExecuteRuleActionParametersOverrides) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON) RawJSON() string {
- return r.raw
-}
-
-// A category-level override
-type RuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory struct {
- // The name of the category to override.
- Category string `json:"category,required"`
- // The action to override rules in the category with.
- Action string `json:"action"`
- // Whether to enable execution of rules in the category.
- Enabled bool `json:"enabled"`
- // The sensitivity level to use for rules in the category.
- SensitivityLevel RuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel `json:"sensitivity_level"`
- JSON ruleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON `json:"-"`
-}
-
-// ruleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON
-// contains the JSON metadata for the struct
-// [RuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory]
-type ruleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON struct {
- Category apijson.Field
- Action apijson.Field
- Enabled apijson.Field
- SensitivityLevel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON) RawJSON() string {
- return r.raw
-}
-
-// The sensitivity level to use for rules in the category.
-type RuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel string
-
-const (
- RuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault RuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "default"
- RuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium RuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "medium"
- RuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow RuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "low"
- RuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff RuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "eoff"
-)
-
-func (r RuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel) IsKnown() bool {
- switch r {
- case RuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault, RuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium, RuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow, RuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff:
- return true
- }
- return false
-}
-
-// A rule-level override
-type RuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesRule struct {
- // The ID of the rule to override.
+// A ruleset object.
+type RuleDeleteResponse struct {
+ // The unique ID of the ruleset.
ID string `json:"id,required"`
- // The action to override the rule with.
- Action string `json:"action"`
- // Whether to enable execution of the rule.
- Enabled bool `json:"enabled"`
- // The score threshold to use for the rule.
- ScoreThreshold int64 `json:"score_threshold"`
- // The sensitivity level to use for the rule.
- SensitivityLevel RuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel `json:"sensitivity_level"`
- JSON ruleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON `json:"-"`
+ // The kind of the ruleset.
+ Kind RuleDeleteResponseKind `json:"kind,required"`
+ // The timestamp of when the ruleset was last modified.
+ LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
+ // The human-readable name of the ruleset.
+ Name string `json:"name,required"`
+ // The phase of the ruleset.
+ Phase RuleDeleteResponsePhase `json:"phase,required"`
+ // The list of rules in the ruleset.
+ Rules []RequestRule `json:"rules,required"`
+ // The version of the ruleset.
+ Version string `json:"version,required"`
+ // An informative description of the ruleset.
+ Description string `json:"description"`
+ JSON ruleDeleteResponseJSON `json:"-"`
}
-// ruleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON
-// contains the JSON metadata for the struct
-// [RuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesRule]
-type ruleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON struct {
- ID apijson.Field
- Action apijson.Field
- Enabled apijson.Field
- ScoreThreshold apijson.Field
- SensitivityLevel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
+// ruleDeleteResponseJSON contains the JSON metadata for the struct
+// [RuleDeleteResponse]
+type ruleDeleteResponseJSON struct {
+ ID apijson.Field
+ Kind apijson.Field
+ LastUpdated apijson.Field
+ Name apijson.Field
+ Phase apijson.Field
+ Rules apijson.Field
+ Version apijson.Field
+ Description apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
}
-func (r *RuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesRule) UnmarshalJSON(data []byte) (err error) {
+func (r *RuleDeleteResponse) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
-func (r ruleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON) RawJSON() string {
+func (r ruleDeleteResponseJSON) RawJSON() string {
return r.raw
}
-// The sensitivity level to use for the rule.
-type RuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel string
-
-const (
- RuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault RuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "default"
- RuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium RuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "medium"
- RuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow RuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "low"
- RuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff RuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "eoff"
-)
-
-func (r RuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel) IsKnown() bool {
- switch r {
- case RuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault, RuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium, RuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow, RuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff:
- return true
- }
- return false
-}
-
-// A sensitivity level to set for all rules. This option has lower precedence than
-// rule and category overrides and is only applicable for DDoS phases.
-type RuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel string
+// The kind of the ruleset.
+type RuleDeleteResponseKind string
const (
- RuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault RuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "default"
- RuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium RuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "medium"
- RuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow RuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "low"
- RuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff RuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "eoff"
+ RuleDeleteResponseKindManaged RuleDeleteResponseKind = "managed"
+ RuleDeleteResponseKindCustom RuleDeleteResponseKind = "custom"
+ RuleDeleteResponseKindRoot RuleDeleteResponseKind = "root"
+ RuleDeleteResponseKindZone RuleDeleteResponseKind = "zone"
)
-func (r RuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel) IsKnown() bool {
+func (r RuleDeleteResponseKind) IsKnown() bool {
switch r {
- case RuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault, RuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium, RuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow, RuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff:
+ case RuleDeleteResponseKindManaged, RuleDeleteResponseKindCustom, RuleDeleteResponseKindRoot, RuleDeleteResponseKindZone:
return true
}
return false
}
-type RuleEditResponseRulesRulesetsLogRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action RuleEditResponseRulesRulesetsLogRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters interface{} `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON ruleEditResponseRulesRulesetsLogRuleJSON `json:"-"`
-}
-
-// ruleEditResponseRulesRulesetsLogRuleJSON contains the JSON metadata for the
-// struct [RuleEditResponseRulesRulesetsLogRule]
-type ruleEditResponseRulesRulesetsLogRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleEditResponseRulesRulesetsLogRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleEditResponseRulesRulesetsLogRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r RuleEditResponseRulesRulesetsLogRule) implementsRulesetsRuleEditResponseRule() {}
-
-// The action to perform when the rule matches.
-type RuleEditResponseRulesRulesetsLogRuleAction string
+// The phase of the ruleset.
+type RuleDeleteResponsePhase string
const (
- RuleEditResponseRulesRulesetsLogRuleActionLog RuleEditResponseRulesRulesetsLogRuleAction = "log"
+ RuleDeleteResponsePhaseDDoSL4 RuleDeleteResponsePhase = "ddos_l4"
+ RuleDeleteResponsePhaseDDoSL7 RuleDeleteResponsePhase = "ddos_l7"
+ RuleDeleteResponsePhaseHTTPConfigSettings RuleDeleteResponsePhase = "http_config_settings"
+ RuleDeleteResponsePhaseHTTPCustomErrors RuleDeleteResponsePhase = "http_custom_errors"
+ RuleDeleteResponsePhaseHTTPLogCustomFields RuleDeleteResponsePhase = "http_log_custom_fields"
+ RuleDeleteResponsePhaseHTTPRatelimit RuleDeleteResponsePhase = "http_ratelimit"
+ RuleDeleteResponsePhaseHTTPRequestCacheSettings RuleDeleteResponsePhase = "http_request_cache_settings"
+ RuleDeleteResponsePhaseHTTPRequestDynamicRedirect RuleDeleteResponsePhase = "http_request_dynamic_redirect"
+ RuleDeleteResponsePhaseHTTPRequestFirewallCustom RuleDeleteResponsePhase = "http_request_firewall_custom"
+ RuleDeleteResponsePhaseHTTPRequestFirewallManaged RuleDeleteResponsePhase = "http_request_firewall_managed"
+ RuleDeleteResponsePhaseHTTPRequestLateTransform RuleDeleteResponsePhase = "http_request_late_transform"
+ RuleDeleteResponsePhaseHTTPRequestOrigin RuleDeleteResponsePhase = "http_request_origin"
+ RuleDeleteResponsePhaseHTTPRequestRedirect RuleDeleteResponsePhase = "http_request_redirect"
+ RuleDeleteResponsePhaseHTTPRequestSanitize RuleDeleteResponsePhase = "http_request_sanitize"
+ RuleDeleteResponsePhaseHTTPRequestSbfm RuleDeleteResponsePhase = "http_request_sbfm"
+ RuleDeleteResponsePhaseHTTPRequestSelectConfiguration RuleDeleteResponsePhase = "http_request_select_configuration"
+ RuleDeleteResponsePhaseHTTPRequestTransform RuleDeleteResponsePhase = "http_request_transform"
+ RuleDeleteResponsePhaseHTTPResponseCompression RuleDeleteResponsePhase = "http_response_compression"
+ RuleDeleteResponsePhaseHTTPResponseFirewallManaged RuleDeleteResponsePhase = "http_response_firewall_managed"
+ RuleDeleteResponsePhaseHTTPResponseHeadersTransform RuleDeleteResponsePhase = "http_response_headers_transform"
+ RuleDeleteResponsePhaseMagicTransit RuleDeleteResponsePhase = "magic_transit"
+ RuleDeleteResponsePhaseMagicTransitIDsManaged RuleDeleteResponsePhase = "magic_transit_ids_managed"
+ RuleDeleteResponsePhaseMagicTransitManaged RuleDeleteResponsePhase = "magic_transit_managed"
)
-func (r RuleEditResponseRulesRulesetsLogRuleAction) IsKnown() bool {
+func (r RuleDeleteResponsePhase) IsKnown() bool {
switch r {
- case RuleEditResponseRulesRulesetsLogRuleActionLog:
+ case RuleDeleteResponsePhaseDDoSL4, RuleDeleteResponsePhaseDDoSL7, RuleDeleteResponsePhaseHTTPConfigSettings, RuleDeleteResponsePhaseHTTPCustomErrors, RuleDeleteResponsePhaseHTTPLogCustomFields, RuleDeleteResponsePhaseHTTPRatelimit, RuleDeleteResponsePhaseHTTPRequestCacheSettings, RuleDeleteResponsePhaseHTTPRequestDynamicRedirect, RuleDeleteResponsePhaseHTTPRequestFirewallCustom, RuleDeleteResponsePhaseHTTPRequestFirewallManaged, RuleDeleteResponsePhaseHTTPRequestLateTransform, RuleDeleteResponsePhaseHTTPRequestOrigin, RuleDeleteResponsePhaseHTTPRequestRedirect, RuleDeleteResponsePhaseHTTPRequestSanitize, RuleDeleteResponsePhaseHTTPRequestSbfm, RuleDeleteResponsePhaseHTTPRequestSelectConfiguration, RuleDeleteResponsePhaseHTTPRequestTransform, RuleDeleteResponsePhaseHTTPResponseCompression, RuleDeleteResponsePhaseHTTPResponseFirewallManaged, RuleDeleteResponsePhaseHTTPResponseHeadersTransform, RuleDeleteResponsePhaseMagicTransit, RuleDeleteResponsePhaseMagicTransitIDsManaged, RuleDeleteResponsePhaseMagicTransitManaged:
return true
}
return false
}
-type RuleEditResponseRulesRulesetsSkipRule struct {
- // The timestamp of when the rule was last modified.
+// A ruleset object.
+type RuleEditResponse struct {
+ // The unique ID of the ruleset.
+ ID string `json:"id,required"`
+ // The kind of the ruleset.
+ Kind RuleEditResponseKind `json:"kind,required"`
+ // The timestamp of when the ruleset was last modified.
LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
+ // The human-readable name of the ruleset.
+ Name string `json:"name,required"`
+ // The phase of the ruleset.
+ Phase RuleEditResponsePhase `json:"phase,required"`
+ // The list of rules in the ruleset.
+ Rules []RequestRule `json:"rules,required"`
+ // The version of the ruleset.
Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action RuleEditResponseRulesRulesetsSkipRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters RuleEditResponseRulesRulesetsSkipRuleActionParameters `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON ruleEditResponseRulesRulesetsSkipRuleJSON `json:"-"`
-}
-
-// ruleEditResponseRulesRulesetsSkipRuleJSON contains the JSON metadata for the
-// struct [RuleEditResponseRulesRulesetsSkipRule]
-type ruleEditResponseRulesRulesetsSkipRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleEditResponseRulesRulesetsSkipRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleEditResponseRulesRulesetsSkipRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r RuleEditResponseRulesRulesetsSkipRule) implementsRulesetsRuleEditResponseRule() {}
-
-// The action to perform when the rule matches.
-type RuleEditResponseRulesRulesetsSkipRuleAction string
-
-const (
- RuleEditResponseRulesRulesetsSkipRuleActionSkip RuleEditResponseRulesRulesetsSkipRuleAction = "skip"
-)
-
-func (r RuleEditResponseRulesRulesetsSkipRuleAction) IsKnown() bool {
- switch r {
- case RuleEditResponseRulesRulesetsSkipRuleActionSkip:
- return true
- }
- return false
-}
-
-// The parameters configuring the rule's action.
-type RuleEditResponseRulesRulesetsSkipRuleActionParameters struct {
- // A list of phases to skip the execution of. This option is incompatible with the
- // ruleset and rulesets options.
- Phases []RuleEditResponseRulesRulesetsSkipRuleActionParametersPhase `json:"phases"`
- // A list of legacy security products to skip the execution of.
- Products []RuleEditResponseRulesRulesetsSkipRuleActionParametersProduct `json:"products"`
- // A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the
- // execution of. This option is incompatible with the ruleset option.
- Rules map[string][]string `json:"rules"`
- // A ruleset to skip the execution of. This option is incompatible with the
- // rulesets, rules and phases options.
- Ruleset RuleEditResponseRulesRulesetsSkipRuleActionParametersRuleset `json:"ruleset"`
- // A list of ruleset IDs to skip the execution of. This option is incompatible with
- // the ruleset and phases options.
- Rulesets []string `json:"rulesets"`
- JSON ruleEditResponseRulesRulesetsSkipRuleActionParametersJSON `json:"-"`
+ // An informative description of the ruleset.
+ Description string `json:"description"`
+ JSON ruleEditResponseJSON `json:"-"`
}
-// ruleEditResponseRulesRulesetsSkipRuleActionParametersJSON contains the JSON
-// metadata for the struct [RuleEditResponseRulesRulesetsSkipRuleActionParameters]
-type ruleEditResponseRulesRulesetsSkipRuleActionParametersJSON struct {
- Phases apijson.Field
- Products apijson.Field
+// ruleEditResponseJSON contains the JSON metadata for the struct
+// [RuleEditResponse]
+type ruleEditResponseJSON struct {
+ ID apijson.Field
+ Kind apijson.Field
+ LastUpdated apijson.Field
+ Name apijson.Field
+ Phase apijson.Field
Rules apijson.Field
- Ruleset apijson.Field
- Rulesets apijson.Field
+ Version apijson.Field
+ Description apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
-func (r *RuleEditResponseRulesRulesetsSkipRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
+func (r *RuleEditResponse) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
-func (r ruleEditResponseRulesRulesetsSkipRuleActionParametersJSON) RawJSON() string {
+func (r ruleEditResponseJSON) RawJSON() string {
return r.raw
}
-// A phase to skip the execution of.
-type RuleEditResponseRulesRulesetsSkipRuleActionParametersPhase string
-
-const (
- RuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseDDoSL4 RuleEditResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l4"
- RuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseDDoSL7 RuleEditResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l7"
- RuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings RuleEditResponseRulesRulesetsSkipRuleActionParametersPhase = "http_config_settings"
- RuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors RuleEditResponseRulesRulesetsSkipRuleActionParametersPhase = "http_custom_errors"
- RuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields RuleEditResponseRulesRulesetsSkipRuleActionParametersPhase = "http_log_custom_fields"
- RuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRatelimit RuleEditResponseRulesRulesetsSkipRuleActionParametersPhase = "http_ratelimit"
- RuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings RuleEditResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_cache_settings"
- RuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect RuleEditResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_dynamic_redirect"
- RuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom RuleEditResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_custom"
- RuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged RuleEditResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_managed"
- RuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform RuleEditResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_late_transform"
- RuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin RuleEditResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_origin"
- RuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect RuleEditResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_redirect"
- RuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize RuleEditResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sanitize"
- RuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm RuleEditResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sbfm"
- RuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration RuleEditResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_select_configuration"
- RuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform RuleEditResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_transform"
- RuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression RuleEditResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_compression"
- RuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged RuleEditResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_firewall_managed"
- RuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform RuleEditResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_headers_transform"
- RuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransit RuleEditResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit"
- RuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged RuleEditResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_ids_managed"
- RuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitManaged RuleEditResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_managed"
-)
-
-func (r RuleEditResponseRulesRulesetsSkipRuleActionParametersPhase) IsKnown() bool {
- switch r {
- case RuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseDDoSL4, RuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseDDoSL7, RuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings, RuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors, RuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields, RuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRatelimit, RuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings, RuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect, RuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom, RuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged, RuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform, RuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin, RuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect, RuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize, RuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm, RuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration, RuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform, RuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression, RuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged, RuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform, RuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransit, RuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged, RuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitManaged:
- return true
- }
- return false
-}
-
-// The name of a legacy security product to skip the execution of.
-type RuleEditResponseRulesRulesetsSkipRuleActionParametersProduct string
-
-const (
- RuleEditResponseRulesRulesetsSkipRuleActionParametersProductBic RuleEditResponseRulesRulesetsSkipRuleActionParametersProduct = "bic"
- RuleEditResponseRulesRulesetsSkipRuleActionParametersProductHot RuleEditResponseRulesRulesetsSkipRuleActionParametersProduct = "hot"
- RuleEditResponseRulesRulesetsSkipRuleActionParametersProductRateLimit RuleEditResponseRulesRulesetsSkipRuleActionParametersProduct = "rateLimit"
- RuleEditResponseRulesRulesetsSkipRuleActionParametersProductSecurityLevel RuleEditResponseRulesRulesetsSkipRuleActionParametersProduct = "securityLevel"
- RuleEditResponseRulesRulesetsSkipRuleActionParametersProductUABlock RuleEditResponseRulesRulesetsSkipRuleActionParametersProduct = "uaBlock"
- RuleEditResponseRulesRulesetsSkipRuleActionParametersProductWAF RuleEditResponseRulesRulesetsSkipRuleActionParametersProduct = "waf"
- RuleEditResponseRulesRulesetsSkipRuleActionParametersProductZoneLockdown RuleEditResponseRulesRulesetsSkipRuleActionParametersProduct = "zoneLockdown"
-)
-
-func (r RuleEditResponseRulesRulesetsSkipRuleActionParametersProduct) IsKnown() bool {
- switch r {
- case RuleEditResponseRulesRulesetsSkipRuleActionParametersProductBic, RuleEditResponseRulesRulesetsSkipRuleActionParametersProductHot, RuleEditResponseRulesRulesetsSkipRuleActionParametersProductRateLimit, RuleEditResponseRulesRulesetsSkipRuleActionParametersProductSecurityLevel, RuleEditResponseRulesRulesetsSkipRuleActionParametersProductUABlock, RuleEditResponseRulesRulesetsSkipRuleActionParametersProductWAF, RuleEditResponseRulesRulesetsSkipRuleActionParametersProductZoneLockdown:
- return true
- }
- return false
-}
-
-// A ruleset to skip the execution of. This option is incompatible with the
-// rulesets, rules and phases options.
-type RuleEditResponseRulesRulesetsSkipRuleActionParametersRuleset string
+// The kind of the ruleset.
+type RuleEditResponseKind string
const (
- RuleEditResponseRulesRulesetsSkipRuleActionParametersRulesetCurrent RuleEditResponseRulesRulesetsSkipRuleActionParametersRuleset = "current"
+ RuleEditResponseKindManaged RuleEditResponseKind = "managed"
+ RuleEditResponseKindCustom RuleEditResponseKind = "custom"
+ RuleEditResponseKindRoot RuleEditResponseKind = "root"
+ RuleEditResponseKindZone RuleEditResponseKind = "zone"
)
-func (r RuleEditResponseRulesRulesetsSkipRuleActionParametersRuleset) IsKnown() bool {
+func (r RuleEditResponseKind) IsKnown() bool {
switch r {
- case RuleEditResponseRulesRulesetsSkipRuleActionParametersRulesetCurrent:
+ case RuleEditResponseKindManaged, RuleEditResponseKindCustom, RuleEditResponseKindRoot, RuleEditResponseKindZone:
return true
}
return false
}
-// The action to perform when the rule matches.
-type RuleEditResponseRulesAction string
+// The phase of the ruleset.
+type RuleEditResponsePhase string
const (
- RuleEditResponseRulesActionBlock RuleEditResponseRulesAction = "block"
- RuleEditResponseRulesActionExecute RuleEditResponseRulesAction = "execute"
- RuleEditResponseRulesActionLog RuleEditResponseRulesAction = "log"
- RuleEditResponseRulesActionSkip RuleEditResponseRulesAction = "skip"
+ RuleEditResponsePhaseDDoSL4 RuleEditResponsePhase = "ddos_l4"
+ RuleEditResponsePhaseDDoSL7 RuleEditResponsePhase = "ddos_l7"
+ RuleEditResponsePhaseHTTPConfigSettings RuleEditResponsePhase = "http_config_settings"
+ RuleEditResponsePhaseHTTPCustomErrors RuleEditResponsePhase = "http_custom_errors"
+ RuleEditResponsePhaseHTTPLogCustomFields RuleEditResponsePhase = "http_log_custom_fields"
+ RuleEditResponsePhaseHTTPRatelimit RuleEditResponsePhase = "http_ratelimit"
+ RuleEditResponsePhaseHTTPRequestCacheSettings RuleEditResponsePhase = "http_request_cache_settings"
+ RuleEditResponsePhaseHTTPRequestDynamicRedirect RuleEditResponsePhase = "http_request_dynamic_redirect"
+ RuleEditResponsePhaseHTTPRequestFirewallCustom RuleEditResponsePhase = "http_request_firewall_custom"
+ RuleEditResponsePhaseHTTPRequestFirewallManaged RuleEditResponsePhase = "http_request_firewall_managed"
+ RuleEditResponsePhaseHTTPRequestLateTransform RuleEditResponsePhase = "http_request_late_transform"
+ RuleEditResponsePhaseHTTPRequestOrigin RuleEditResponsePhase = "http_request_origin"
+ RuleEditResponsePhaseHTTPRequestRedirect RuleEditResponsePhase = "http_request_redirect"
+ RuleEditResponsePhaseHTTPRequestSanitize RuleEditResponsePhase = "http_request_sanitize"
+ RuleEditResponsePhaseHTTPRequestSbfm RuleEditResponsePhase = "http_request_sbfm"
+ RuleEditResponsePhaseHTTPRequestSelectConfiguration RuleEditResponsePhase = "http_request_select_configuration"
+ RuleEditResponsePhaseHTTPRequestTransform RuleEditResponsePhase = "http_request_transform"
+ RuleEditResponsePhaseHTTPResponseCompression RuleEditResponsePhase = "http_response_compression"
+ RuleEditResponsePhaseHTTPResponseFirewallManaged RuleEditResponsePhase = "http_response_firewall_managed"
+ RuleEditResponsePhaseHTTPResponseHeadersTransform RuleEditResponsePhase = "http_response_headers_transform"
+ RuleEditResponsePhaseMagicTransit RuleEditResponsePhase = "magic_transit"
+ RuleEditResponsePhaseMagicTransitIDsManaged RuleEditResponsePhase = "magic_transit_ids_managed"
+ RuleEditResponsePhaseMagicTransitManaged RuleEditResponsePhase = "magic_transit_managed"
)
-func (r RuleEditResponseRulesAction) IsKnown() bool {
+func (r RuleEditResponsePhase) IsKnown() bool {
switch r {
- case RuleEditResponseRulesActionBlock, RuleEditResponseRulesActionExecute, RuleEditResponseRulesActionLog, RuleEditResponseRulesActionSkip:
+ case RuleEditResponsePhaseDDoSL4, RuleEditResponsePhaseDDoSL7, RuleEditResponsePhaseHTTPConfigSettings, RuleEditResponsePhaseHTTPCustomErrors, RuleEditResponsePhaseHTTPLogCustomFields, RuleEditResponsePhaseHTTPRatelimit, RuleEditResponsePhaseHTTPRequestCacheSettings, RuleEditResponsePhaseHTTPRequestDynamicRedirect, RuleEditResponsePhaseHTTPRequestFirewallCustom, RuleEditResponsePhaseHTTPRequestFirewallManaged, RuleEditResponsePhaseHTTPRequestLateTransform, RuleEditResponsePhaseHTTPRequestOrigin, RuleEditResponsePhaseHTTPRequestRedirect, RuleEditResponsePhaseHTTPRequestSanitize, RuleEditResponsePhaseHTTPRequestSbfm, RuleEditResponsePhaseHTTPRequestSelectConfiguration, RuleEditResponsePhaseHTTPRequestTransform, RuleEditResponsePhaseHTTPResponseCompression, RuleEditResponsePhaseHTTPResponseFirewallManaged, RuleEditResponsePhaseHTTPResponseHeadersTransform, RuleEditResponsePhaseMagicTransit, RuleEditResponsePhaseMagicTransitIDsManaged, RuleEditResponsePhaseMagicTransitManaged:
return true
}
return false
}
// This interface is a union satisfied by one of the following:
-// [RuleNewParamsRulesetsBlockRule], [RuleNewParamsRulesetsExecuteRule],
-// [RuleNewParamsRulesetsLogRule], [RuleNewParamsRulesetsSkipRule].
+// [RuleNewParamsBlockRule], [RuleNewParamsExecuteRule], [RuleNewParamsLogRule],
+// [RuleNewParamsSkipRule].
type RuleNewParams interface {
ImplementsRuleNewParams()
@@ -2726,7 +406,7 @@ type RuleNewParams interface {
getZoneID() param.Field[string]
}
-type RuleNewParamsRulesetsBlockRule struct {
+type RuleNewParamsBlockRule struct {
// The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
AccountID param.Field[string] `path:"account_id"`
// The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
@@ -2734,9 +414,9 @@ type RuleNewParamsRulesetsBlockRule struct {
// The unique ID of the rule.
ID param.Field[string] `json:"id"`
// The action to perform when the rule matches.
- Action param.Field[RuleNewParamsRulesetsBlockRuleAction] `json:"action"`
+ Action param.Field[RuleNewParamsBlockRuleAction] `json:"action"`
// The parameters configuring the rule's action.
- ActionParameters param.Field[RuleNewParamsRulesetsBlockRuleActionParameters] `json:"action_parameters"`
+ ActionParameters param.Field[RuleNewParamsBlockRuleActionParameters] `json:"action_parameters"`
// An informative description of the rule.
Description param.Field[string] `json:"description"`
// Whether the rule should be executed.
@@ -2749,49 +429,49 @@ type RuleNewParamsRulesetsBlockRule struct {
Ref param.Field[string] `json:"ref"`
}
-func (r RuleNewParamsRulesetsBlockRule) MarshalJSON() (data []byte, err error) {
+func (r RuleNewParamsBlockRule) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
-func (r RuleNewParamsRulesetsBlockRule) getAccountID() param.Field[string] {
+func (r RuleNewParamsBlockRule) getAccountID() param.Field[string] {
return r.AccountID
}
-func (r RuleNewParamsRulesetsBlockRule) getZoneID() param.Field[string] {
+func (r RuleNewParamsBlockRule) getZoneID() param.Field[string] {
return r.ZoneID
}
-func (RuleNewParamsRulesetsBlockRule) ImplementsRuleNewParams() {
+func (RuleNewParamsBlockRule) ImplementsRuleNewParams() {
}
// The action to perform when the rule matches.
-type RuleNewParamsRulesetsBlockRuleAction string
+type RuleNewParamsBlockRuleAction string
const (
- RuleNewParamsRulesetsBlockRuleActionBlock RuleNewParamsRulesetsBlockRuleAction = "block"
+ RuleNewParamsBlockRuleActionBlock RuleNewParamsBlockRuleAction = "block"
)
-func (r RuleNewParamsRulesetsBlockRuleAction) IsKnown() bool {
+func (r RuleNewParamsBlockRuleAction) IsKnown() bool {
switch r {
- case RuleNewParamsRulesetsBlockRuleActionBlock:
+ case RuleNewParamsBlockRuleActionBlock:
return true
}
return false
}
// The parameters configuring the rule's action.
-type RuleNewParamsRulesetsBlockRuleActionParameters struct {
+type RuleNewParamsBlockRuleActionParameters struct {
// The response to show when the block is applied.
- Response param.Field[RuleNewParamsRulesetsBlockRuleActionParametersResponse] `json:"response"`
+ Response param.Field[RuleNewParamsBlockRuleActionParametersResponse] `json:"response"`
}
-func (r RuleNewParamsRulesetsBlockRuleActionParameters) MarshalJSON() (data []byte, err error) {
+func (r RuleNewParamsBlockRuleActionParameters) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
// The response to show when the block is applied.
-type RuleNewParamsRulesetsBlockRuleActionParametersResponse struct {
+type RuleNewParamsBlockRuleActionParametersResponse struct {
// The content to return.
Content param.Field[string] `json:"content,required"`
// The type of the content to return.
@@ -2800,11 +480,11 @@ type RuleNewParamsRulesetsBlockRuleActionParametersResponse struct {
StatusCode param.Field[int64] `json:"status_code,required"`
}
-func (r RuleNewParamsRulesetsBlockRuleActionParametersResponse) MarshalJSON() (data []byte, err error) {
+func (r RuleNewParamsBlockRuleActionParametersResponse) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
-type RuleNewParamsRulesetsExecuteRule struct {
+type RuleNewParamsExecuteRule struct {
// The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
AccountID param.Field[string] `path:"account_id"`
// The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
@@ -2812,9 +492,9 @@ type RuleNewParamsRulesetsExecuteRule struct {
// The unique ID of the rule.
ID param.Field[string] `json:"id"`
// The action to perform when the rule matches.
- Action param.Field[RuleNewParamsRulesetsExecuteRuleAction] `json:"action"`
+ Action param.Field[RuleNewParamsExecuteRuleAction] `json:"action"`
// The parameters configuring the rule's action.
- ActionParameters param.Field[RuleNewParamsRulesetsExecuteRuleActionParameters] `json:"action_parameters"`
+ ActionParameters param.Field[RuleNewParamsExecuteRuleActionParameters] `json:"action_parameters"`
// An informative description of the rule.
Description param.Field[string] `json:"description"`
// Whether the rule should be executed.
@@ -2827,85 +507,85 @@ type RuleNewParamsRulesetsExecuteRule struct {
Ref param.Field[string] `json:"ref"`
}
-func (r RuleNewParamsRulesetsExecuteRule) MarshalJSON() (data []byte, err error) {
+func (r RuleNewParamsExecuteRule) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
-func (r RuleNewParamsRulesetsExecuteRule) getAccountID() param.Field[string] {
+func (r RuleNewParamsExecuteRule) getAccountID() param.Field[string] {
return r.AccountID
}
-func (r RuleNewParamsRulesetsExecuteRule) getZoneID() param.Field[string] {
+func (r RuleNewParamsExecuteRule) getZoneID() param.Field[string] {
return r.ZoneID
}
-func (RuleNewParamsRulesetsExecuteRule) ImplementsRuleNewParams() {
+func (RuleNewParamsExecuteRule) ImplementsRuleNewParams() {
}
// The action to perform when the rule matches.
-type RuleNewParamsRulesetsExecuteRuleAction string
+type RuleNewParamsExecuteRuleAction string
const (
- RuleNewParamsRulesetsExecuteRuleActionExecute RuleNewParamsRulesetsExecuteRuleAction = "execute"
+ RuleNewParamsExecuteRuleActionExecute RuleNewParamsExecuteRuleAction = "execute"
)
-func (r RuleNewParamsRulesetsExecuteRuleAction) IsKnown() bool {
+func (r RuleNewParamsExecuteRuleAction) IsKnown() bool {
switch r {
- case RuleNewParamsRulesetsExecuteRuleActionExecute:
+ case RuleNewParamsExecuteRuleActionExecute:
return true
}
return false
}
// The parameters configuring the rule's action.
-type RuleNewParamsRulesetsExecuteRuleActionParameters struct {
+type RuleNewParamsExecuteRuleActionParameters struct {
// The ID of the ruleset to execute.
ID param.Field[string] `json:"id,required"`
// The configuration to use for matched data logging.
- MatchedData param.Field[RuleNewParamsRulesetsExecuteRuleActionParametersMatchedData] `json:"matched_data"`
+ MatchedData param.Field[RuleNewParamsExecuteRuleActionParametersMatchedData] `json:"matched_data"`
// A set of overrides to apply to the target ruleset.
- Overrides param.Field[RuleNewParamsRulesetsExecuteRuleActionParametersOverrides] `json:"overrides"`
+ Overrides param.Field[RuleNewParamsExecuteRuleActionParametersOverrides] `json:"overrides"`
}
-func (r RuleNewParamsRulesetsExecuteRuleActionParameters) MarshalJSON() (data []byte, err error) {
+func (r RuleNewParamsExecuteRuleActionParameters) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
// The configuration to use for matched data logging.
-type RuleNewParamsRulesetsExecuteRuleActionParametersMatchedData struct {
+type RuleNewParamsExecuteRuleActionParametersMatchedData struct {
// The public key to encrypt matched data logs with.
PublicKey param.Field[string] `json:"public_key,required"`
}
-func (r RuleNewParamsRulesetsExecuteRuleActionParametersMatchedData) MarshalJSON() (data []byte, err error) {
+func (r RuleNewParamsExecuteRuleActionParametersMatchedData) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
// A set of overrides to apply to the target ruleset.
-type RuleNewParamsRulesetsExecuteRuleActionParametersOverrides struct {
+type RuleNewParamsExecuteRuleActionParametersOverrides struct {
// An action to override all rules with. This option has lower precedence than rule
// and category overrides.
Action param.Field[string] `json:"action"`
// A list of category-level overrides. This option has the second-highest
// precedence after rule-level overrides.
- Categories param.Field[[]RuleNewParamsRulesetsExecuteRuleActionParametersOverridesCategory] `json:"categories"`
+ Categories param.Field[[]RuleNewParamsExecuteRuleActionParametersOverridesCategory] `json:"categories"`
// Whether to enable execution of all rules. This option has lower precedence than
// rule and category overrides.
Enabled param.Field[bool] `json:"enabled"`
// A list of rule-level overrides. This option has the highest precedence.
- Rules param.Field[[]RuleNewParamsRulesetsExecuteRuleActionParametersOverridesRule] `json:"rules"`
+ Rules param.Field[[]RuleNewParamsExecuteRuleActionParametersOverridesRule] `json:"rules"`
// A sensitivity level to set for all rules. This option has lower precedence than
// rule and category overrides and is only applicable for DDoS phases.
- SensitivityLevel param.Field[RuleNewParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevel] `json:"sensitivity_level"`
+ SensitivityLevel param.Field[RuleNewParamsExecuteRuleActionParametersOverridesSensitivityLevel] `json:"sensitivity_level"`
}
-func (r RuleNewParamsRulesetsExecuteRuleActionParametersOverrides) MarshalJSON() (data []byte, err error) {
+func (r RuleNewParamsExecuteRuleActionParametersOverrides) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
// A category-level override
-type RuleNewParamsRulesetsExecuteRuleActionParametersOverridesCategory struct {
+type RuleNewParamsExecuteRuleActionParametersOverridesCategory struct {
// The name of the category to override.
Category param.Field[string] `json:"category,required"`
// The action to override rules in the category with.
@@ -2913,33 +593,33 @@ type RuleNewParamsRulesetsExecuteRuleActionParametersOverridesCategory struct {
// Whether to enable execution of rules in the category.
Enabled param.Field[bool] `json:"enabled"`
// The sensitivity level to use for rules in the category.
- SensitivityLevel param.Field[RuleNewParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel] `json:"sensitivity_level"`
+ SensitivityLevel param.Field[RuleNewParamsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel] `json:"sensitivity_level"`
}
-func (r RuleNewParamsRulesetsExecuteRuleActionParametersOverridesCategory) MarshalJSON() (data []byte, err error) {
+func (r RuleNewParamsExecuteRuleActionParametersOverridesCategory) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
// The sensitivity level to use for rules in the category.
-type RuleNewParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel string
+type RuleNewParamsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel string
const (
- RuleNewParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault RuleNewParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "default"
- RuleNewParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium RuleNewParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "medium"
- RuleNewParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow RuleNewParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "low"
- RuleNewParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff RuleNewParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "eoff"
+ RuleNewParamsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault RuleNewParamsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "default"
+ RuleNewParamsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium RuleNewParamsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "medium"
+ RuleNewParamsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow RuleNewParamsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "low"
+ RuleNewParamsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff RuleNewParamsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "eoff"
)
-func (r RuleNewParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel) IsKnown() bool {
+func (r RuleNewParamsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel) IsKnown() bool {
switch r {
- case RuleNewParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault, RuleNewParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium, RuleNewParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow, RuleNewParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff:
+ case RuleNewParamsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault, RuleNewParamsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium, RuleNewParamsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow, RuleNewParamsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff:
return true
}
return false
}
// A rule-level override
-type RuleNewParamsRulesetsExecuteRuleActionParametersOverridesRule struct {
+type RuleNewParamsExecuteRuleActionParametersOverridesRule struct {
// The ID of the rule to override.
ID param.Field[string] `json:"id,required"`
// The action to override the rule with.
@@ -2949,26 +629,26 @@ type RuleNewParamsRulesetsExecuteRuleActionParametersOverridesRule struct {
// The score threshold to use for the rule.
ScoreThreshold param.Field[int64] `json:"score_threshold"`
// The sensitivity level to use for the rule.
- SensitivityLevel param.Field[RuleNewParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel] `json:"sensitivity_level"`
+ SensitivityLevel param.Field[RuleNewParamsExecuteRuleActionParametersOverridesRulesSensitivityLevel] `json:"sensitivity_level"`
}
-func (r RuleNewParamsRulesetsExecuteRuleActionParametersOverridesRule) MarshalJSON() (data []byte, err error) {
+func (r RuleNewParamsExecuteRuleActionParametersOverridesRule) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
// The sensitivity level to use for the rule.
-type RuleNewParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel string
+type RuleNewParamsExecuteRuleActionParametersOverridesRulesSensitivityLevel string
const (
- RuleNewParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault RuleNewParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "default"
- RuleNewParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium RuleNewParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "medium"
- RuleNewParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow RuleNewParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "low"
- RuleNewParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff RuleNewParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "eoff"
+ RuleNewParamsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault RuleNewParamsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "default"
+ RuleNewParamsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium RuleNewParamsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "medium"
+ RuleNewParamsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow RuleNewParamsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "low"
+ RuleNewParamsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff RuleNewParamsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "eoff"
)
-func (r RuleNewParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel) IsKnown() bool {
+func (r RuleNewParamsExecuteRuleActionParametersOverridesRulesSensitivityLevel) IsKnown() bool {
switch r {
- case RuleNewParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault, RuleNewParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium, RuleNewParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow, RuleNewParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff:
+ case RuleNewParamsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault, RuleNewParamsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium, RuleNewParamsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow, RuleNewParamsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff:
return true
}
return false
@@ -2976,24 +656,24 @@ func (r RuleNewParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivit
// A sensitivity level to set for all rules. This option has lower precedence than
// rule and category overrides and is only applicable for DDoS phases.
-type RuleNewParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevel string
+type RuleNewParamsExecuteRuleActionParametersOverridesSensitivityLevel string
const (
- RuleNewParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault RuleNewParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "default"
- RuleNewParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium RuleNewParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "medium"
- RuleNewParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow RuleNewParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "low"
- RuleNewParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff RuleNewParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "eoff"
+ RuleNewParamsExecuteRuleActionParametersOverridesSensitivityLevelDefault RuleNewParamsExecuteRuleActionParametersOverridesSensitivityLevel = "default"
+ RuleNewParamsExecuteRuleActionParametersOverridesSensitivityLevelMedium RuleNewParamsExecuteRuleActionParametersOverridesSensitivityLevel = "medium"
+ RuleNewParamsExecuteRuleActionParametersOverridesSensitivityLevelLow RuleNewParamsExecuteRuleActionParametersOverridesSensitivityLevel = "low"
+ RuleNewParamsExecuteRuleActionParametersOverridesSensitivityLevelEoff RuleNewParamsExecuteRuleActionParametersOverridesSensitivityLevel = "eoff"
)
-func (r RuleNewParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevel) IsKnown() bool {
+func (r RuleNewParamsExecuteRuleActionParametersOverridesSensitivityLevel) IsKnown() bool {
switch r {
- case RuleNewParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault, RuleNewParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium, RuleNewParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow, RuleNewParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff:
+ case RuleNewParamsExecuteRuleActionParametersOverridesSensitivityLevelDefault, RuleNewParamsExecuteRuleActionParametersOverridesSensitivityLevelMedium, RuleNewParamsExecuteRuleActionParametersOverridesSensitivityLevelLow, RuleNewParamsExecuteRuleActionParametersOverridesSensitivityLevelEoff:
return true
}
return false
}
-type RuleNewParamsRulesetsLogRule struct {
+type RuleNewParamsLogRule struct {
// The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
AccountID param.Field[string] `path:"account_id"`
// The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
@@ -3001,7 +681,7 @@ type RuleNewParamsRulesetsLogRule struct {
// The unique ID of the rule.
ID param.Field[string] `json:"id"`
// The action to perform when the rule matches.
- Action param.Field[RuleNewParamsRulesetsLogRuleAction] `json:"action"`
+ Action param.Field[RuleNewParamsLogRuleAction] `json:"action"`
// The parameters configuring the rule's action.
ActionParameters param.Field[interface{}] `json:"action_parameters"`
// An informative description of the rule.
@@ -3016,38 +696,38 @@ type RuleNewParamsRulesetsLogRule struct {
Ref param.Field[string] `json:"ref"`
}
-func (r RuleNewParamsRulesetsLogRule) MarshalJSON() (data []byte, err error) {
+func (r RuleNewParamsLogRule) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
-func (r RuleNewParamsRulesetsLogRule) getAccountID() param.Field[string] {
+func (r RuleNewParamsLogRule) getAccountID() param.Field[string] {
return r.AccountID
}
-func (r RuleNewParamsRulesetsLogRule) getZoneID() param.Field[string] {
+func (r RuleNewParamsLogRule) getZoneID() param.Field[string] {
return r.ZoneID
}
-func (RuleNewParamsRulesetsLogRule) ImplementsRuleNewParams() {
+func (RuleNewParamsLogRule) ImplementsRuleNewParams() {
}
// The action to perform when the rule matches.
-type RuleNewParamsRulesetsLogRuleAction string
+type RuleNewParamsLogRuleAction string
const (
- RuleNewParamsRulesetsLogRuleActionLog RuleNewParamsRulesetsLogRuleAction = "log"
+ RuleNewParamsLogRuleActionLog RuleNewParamsLogRuleAction = "log"
)
-func (r RuleNewParamsRulesetsLogRuleAction) IsKnown() bool {
+func (r RuleNewParamsLogRuleAction) IsKnown() bool {
switch r {
- case RuleNewParamsRulesetsLogRuleActionLog:
+ case RuleNewParamsLogRuleActionLog:
return true
}
return false
}
-type RuleNewParamsRulesetsSkipRule struct {
+type RuleNewParamsSkipRule struct {
// The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
AccountID param.Field[string] `path:"account_id"`
// The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
@@ -3055,9 +735,9 @@ type RuleNewParamsRulesetsSkipRule struct {
// The unique ID of the rule.
ID param.Field[string] `json:"id"`
// The action to perform when the rule matches.
- Action param.Field[RuleNewParamsRulesetsSkipRuleAction] `json:"action"`
+ Action param.Field[RuleNewParamsSkipRuleAction] `json:"action"`
// The parameters configuring the rule's action.
- ActionParameters param.Field[RuleNewParamsRulesetsSkipRuleActionParameters] `json:"action_parameters"`
+ ActionParameters param.Field[RuleNewParamsSkipRuleActionParameters] `json:"action_parameters"`
// An informative description of the rule.
Description param.Field[string] `json:"description"`
// Whether the rule should be executed.
@@ -3070,112 +750,112 @@ type RuleNewParamsRulesetsSkipRule struct {
Ref param.Field[string] `json:"ref"`
}
-func (r RuleNewParamsRulesetsSkipRule) MarshalJSON() (data []byte, err error) {
+func (r RuleNewParamsSkipRule) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
-func (r RuleNewParamsRulesetsSkipRule) getAccountID() param.Field[string] {
+func (r RuleNewParamsSkipRule) getAccountID() param.Field[string] {
return r.AccountID
}
-func (r RuleNewParamsRulesetsSkipRule) getZoneID() param.Field[string] {
+func (r RuleNewParamsSkipRule) getZoneID() param.Field[string] {
return r.ZoneID
}
-func (RuleNewParamsRulesetsSkipRule) ImplementsRuleNewParams() {
+func (RuleNewParamsSkipRule) ImplementsRuleNewParams() {
}
// The action to perform when the rule matches.
-type RuleNewParamsRulesetsSkipRuleAction string
+type RuleNewParamsSkipRuleAction string
const (
- RuleNewParamsRulesetsSkipRuleActionSkip RuleNewParamsRulesetsSkipRuleAction = "skip"
+ RuleNewParamsSkipRuleActionSkip RuleNewParamsSkipRuleAction = "skip"
)
-func (r RuleNewParamsRulesetsSkipRuleAction) IsKnown() bool {
+func (r RuleNewParamsSkipRuleAction) IsKnown() bool {
switch r {
- case RuleNewParamsRulesetsSkipRuleActionSkip:
+ case RuleNewParamsSkipRuleActionSkip:
return true
}
return false
}
// The parameters configuring the rule's action.
-type RuleNewParamsRulesetsSkipRuleActionParameters struct {
+type RuleNewParamsSkipRuleActionParameters struct {
// A list of phases to skip the execution of. This option is incompatible with the
// ruleset and rulesets options.
- Phases param.Field[[]RuleNewParamsRulesetsSkipRuleActionParametersPhase] `json:"phases"`
+ Phases param.Field[[]RuleNewParamsSkipRuleActionParametersPhase] `json:"phases"`
// A list of legacy security products to skip the execution of.
- Products param.Field[[]RuleNewParamsRulesetsSkipRuleActionParametersProduct] `json:"products"`
+ Products param.Field[[]RuleNewParamsSkipRuleActionParametersProduct] `json:"products"`
// A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the
// execution of. This option is incompatible with the ruleset option.
Rules param.Field[map[string][]string] `json:"rules"`
// A ruleset to skip the execution of. This option is incompatible with the
// rulesets, rules and phases options.
- Ruleset param.Field[RuleNewParamsRulesetsSkipRuleActionParametersRuleset] `json:"ruleset"`
+ Ruleset param.Field[RuleNewParamsSkipRuleActionParametersRuleset] `json:"ruleset"`
// A list of ruleset IDs to skip the execution of. This option is incompatible with
// the ruleset and phases options.
Rulesets param.Field[[]string] `json:"rulesets"`
}
-func (r RuleNewParamsRulesetsSkipRuleActionParameters) MarshalJSON() (data []byte, err error) {
+func (r RuleNewParamsSkipRuleActionParameters) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
// A phase to skip the execution of.
-type RuleNewParamsRulesetsSkipRuleActionParametersPhase string
+type RuleNewParamsSkipRuleActionParametersPhase string
const (
- RuleNewParamsRulesetsSkipRuleActionParametersPhaseDDoSL4 RuleNewParamsRulesetsSkipRuleActionParametersPhase = "ddos_l4"
- RuleNewParamsRulesetsSkipRuleActionParametersPhaseDDoSL7 RuleNewParamsRulesetsSkipRuleActionParametersPhase = "ddos_l7"
- RuleNewParamsRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings RuleNewParamsRulesetsSkipRuleActionParametersPhase = "http_config_settings"
- RuleNewParamsRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors RuleNewParamsRulesetsSkipRuleActionParametersPhase = "http_custom_errors"
- RuleNewParamsRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields RuleNewParamsRulesetsSkipRuleActionParametersPhase = "http_log_custom_fields"
- RuleNewParamsRulesetsSkipRuleActionParametersPhaseHTTPRatelimit RuleNewParamsRulesetsSkipRuleActionParametersPhase = "http_ratelimit"
- RuleNewParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings RuleNewParamsRulesetsSkipRuleActionParametersPhase = "http_request_cache_settings"
- RuleNewParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect RuleNewParamsRulesetsSkipRuleActionParametersPhase = "http_request_dynamic_redirect"
- RuleNewParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom RuleNewParamsRulesetsSkipRuleActionParametersPhase = "http_request_firewall_custom"
- RuleNewParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged RuleNewParamsRulesetsSkipRuleActionParametersPhase = "http_request_firewall_managed"
- RuleNewParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform RuleNewParamsRulesetsSkipRuleActionParametersPhase = "http_request_late_transform"
- RuleNewParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin RuleNewParamsRulesetsSkipRuleActionParametersPhase = "http_request_origin"
- RuleNewParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect RuleNewParamsRulesetsSkipRuleActionParametersPhase = "http_request_redirect"
- RuleNewParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize RuleNewParamsRulesetsSkipRuleActionParametersPhase = "http_request_sanitize"
- RuleNewParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm RuleNewParamsRulesetsSkipRuleActionParametersPhase = "http_request_sbfm"
- RuleNewParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration RuleNewParamsRulesetsSkipRuleActionParametersPhase = "http_request_select_configuration"
- RuleNewParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform RuleNewParamsRulesetsSkipRuleActionParametersPhase = "http_request_transform"
- RuleNewParamsRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression RuleNewParamsRulesetsSkipRuleActionParametersPhase = "http_response_compression"
- RuleNewParamsRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged RuleNewParamsRulesetsSkipRuleActionParametersPhase = "http_response_firewall_managed"
- RuleNewParamsRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform RuleNewParamsRulesetsSkipRuleActionParametersPhase = "http_response_headers_transform"
- RuleNewParamsRulesetsSkipRuleActionParametersPhaseMagicTransit RuleNewParamsRulesetsSkipRuleActionParametersPhase = "magic_transit"
- RuleNewParamsRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged RuleNewParamsRulesetsSkipRuleActionParametersPhase = "magic_transit_ids_managed"
- RuleNewParamsRulesetsSkipRuleActionParametersPhaseMagicTransitManaged RuleNewParamsRulesetsSkipRuleActionParametersPhase = "magic_transit_managed"
+ RuleNewParamsSkipRuleActionParametersPhaseDDoSL4 RuleNewParamsSkipRuleActionParametersPhase = "ddos_l4"
+ RuleNewParamsSkipRuleActionParametersPhaseDDoSL7 RuleNewParamsSkipRuleActionParametersPhase = "ddos_l7"
+ RuleNewParamsSkipRuleActionParametersPhaseHTTPConfigSettings RuleNewParamsSkipRuleActionParametersPhase = "http_config_settings"
+ RuleNewParamsSkipRuleActionParametersPhaseHTTPCustomErrors RuleNewParamsSkipRuleActionParametersPhase = "http_custom_errors"
+ RuleNewParamsSkipRuleActionParametersPhaseHTTPLogCustomFields RuleNewParamsSkipRuleActionParametersPhase = "http_log_custom_fields"
+ RuleNewParamsSkipRuleActionParametersPhaseHTTPRatelimit RuleNewParamsSkipRuleActionParametersPhase = "http_ratelimit"
+ RuleNewParamsSkipRuleActionParametersPhaseHTTPRequestCacheSettings RuleNewParamsSkipRuleActionParametersPhase = "http_request_cache_settings"
+ RuleNewParamsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect RuleNewParamsSkipRuleActionParametersPhase = "http_request_dynamic_redirect"
+ RuleNewParamsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom RuleNewParamsSkipRuleActionParametersPhase = "http_request_firewall_custom"
+ RuleNewParamsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged RuleNewParamsSkipRuleActionParametersPhase = "http_request_firewall_managed"
+ RuleNewParamsSkipRuleActionParametersPhaseHTTPRequestLateTransform RuleNewParamsSkipRuleActionParametersPhase = "http_request_late_transform"
+ RuleNewParamsSkipRuleActionParametersPhaseHTTPRequestOrigin RuleNewParamsSkipRuleActionParametersPhase = "http_request_origin"
+ RuleNewParamsSkipRuleActionParametersPhaseHTTPRequestRedirect RuleNewParamsSkipRuleActionParametersPhase = "http_request_redirect"
+ RuleNewParamsSkipRuleActionParametersPhaseHTTPRequestSanitize RuleNewParamsSkipRuleActionParametersPhase = "http_request_sanitize"
+ RuleNewParamsSkipRuleActionParametersPhaseHTTPRequestSbfm RuleNewParamsSkipRuleActionParametersPhase = "http_request_sbfm"
+ RuleNewParamsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration RuleNewParamsSkipRuleActionParametersPhase = "http_request_select_configuration"
+ RuleNewParamsSkipRuleActionParametersPhaseHTTPRequestTransform RuleNewParamsSkipRuleActionParametersPhase = "http_request_transform"
+ RuleNewParamsSkipRuleActionParametersPhaseHTTPResponseCompression RuleNewParamsSkipRuleActionParametersPhase = "http_response_compression"
+ RuleNewParamsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged RuleNewParamsSkipRuleActionParametersPhase = "http_response_firewall_managed"
+ RuleNewParamsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform RuleNewParamsSkipRuleActionParametersPhase = "http_response_headers_transform"
+ RuleNewParamsSkipRuleActionParametersPhaseMagicTransit RuleNewParamsSkipRuleActionParametersPhase = "magic_transit"
+ RuleNewParamsSkipRuleActionParametersPhaseMagicTransitIDsManaged RuleNewParamsSkipRuleActionParametersPhase = "magic_transit_ids_managed"
+ RuleNewParamsSkipRuleActionParametersPhaseMagicTransitManaged RuleNewParamsSkipRuleActionParametersPhase = "magic_transit_managed"
)
-func (r RuleNewParamsRulesetsSkipRuleActionParametersPhase) IsKnown() bool {
+func (r RuleNewParamsSkipRuleActionParametersPhase) IsKnown() bool {
switch r {
- case RuleNewParamsRulesetsSkipRuleActionParametersPhaseDDoSL4, RuleNewParamsRulesetsSkipRuleActionParametersPhaseDDoSL7, RuleNewParamsRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings, RuleNewParamsRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors, RuleNewParamsRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields, RuleNewParamsRulesetsSkipRuleActionParametersPhaseHTTPRatelimit, RuleNewParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings, RuleNewParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect, RuleNewParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom, RuleNewParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged, RuleNewParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform, RuleNewParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin, RuleNewParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect, RuleNewParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize, RuleNewParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm, RuleNewParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration, RuleNewParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform, RuleNewParamsRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression, RuleNewParamsRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged, RuleNewParamsRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform, RuleNewParamsRulesetsSkipRuleActionParametersPhaseMagicTransit, RuleNewParamsRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged, RuleNewParamsRulesetsSkipRuleActionParametersPhaseMagicTransitManaged:
+ case RuleNewParamsSkipRuleActionParametersPhaseDDoSL4, RuleNewParamsSkipRuleActionParametersPhaseDDoSL7, RuleNewParamsSkipRuleActionParametersPhaseHTTPConfigSettings, RuleNewParamsSkipRuleActionParametersPhaseHTTPCustomErrors, RuleNewParamsSkipRuleActionParametersPhaseHTTPLogCustomFields, RuleNewParamsSkipRuleActionParametersPhaseHTTPRatelimit, RuleNewParamsSkipRuleActionParametersPhaseHTTPRequestCacheSettings, RuleNewParamsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect, RuleNewParamsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom, RuleNewParamsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged, RuleNewParamsSkipRuleActionParametersPhaseHTTPRequestLateTransform, RuleNewParamsSkipRuleActionParametersPhaseHTTPRequestOrigin, RuleNewParamsSkipRuleActionParametersPhaseHTTPRequestRedirect, RuleNewParamsSkipRuleActionParametersPhaseHTTPRequestSanitize, RuleNewParamsSkipRuleActionParametersPhaseHTTPRequestSbfm, RuleNewParamsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration, RuleNewParamsSkipRuleActionParametersPhaseHTTPRequestTransform, RuleNewParamsSkipRuleActionParametersPhaseHTTPResponseCompression, RuleNewParamsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged, RuleNewParamsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform, RuleNewParamsSkipRuleActionParametersPhaseMagicTransit, RuleNewParamsSkipRuleActionParametersPhaseMagicTransitIDsManaged, RuleNewParamsSkipRuleActionParametersPhaseMagicTransitManaged:
return true
}
return false
}
// The name of a legacy security product to skip the execution of.
-type RuleNewParamsRulesetsSkipRuleActionParametersProduct string
+type RuleNewParamsSkipRuleActionParametersProduct string
const (
- RuleNewParamsRulesetsSkipRuleActionParametersProductBic RuleNewParamsRulesetsSkipRuleActionParametersProduct = "bic"
- RuleNewParamsRulesetsSkipRuleActionParametersProductHot RuleNewParamsRulesetsSkipRuleActionParametersProduct = "hot"
- RuleNewParamsRulesetsSkipRuleActionParametersProductRateLimit RuleNewParamsRulesetsSkipRuleActionParametersProduct = "rateLimit"
- RuleNewParamsRulesetsSkipRuleActionParametersProductSecurityLevel RuleNewParamsRulesetsSkipRuleActionParametersProduct = "securityLevel"
- RuleNewParamsRulesetsSkipRuleActionParametersProductUABlock RuleNewParamsRulesetsSkipRuleActionParametersProduct = "uaBlock"
- RuleNewParamsRulesetsSkipRuleActionParametersProductWAF RuleNewParamsRulesetsSkipRuleActionParametersProduct = "waf"
- RuleNewParamsRulesetsSkipRuleActionParametersProductZoneLockdown RuleNewParamsRulesetsSkipRuleActionParametersProduct = "zoneLockdown"
+ RuleNewParamsSkipRuleActionParametersProductBic RuleNewParamsSkipRuleActionParametersProduct = "bic"
+ RuleNewParamsSkipRuleActionParametersProductHot RuleNewParamsSkipRuleActionParametersProduct = "hot"
+ RuleNewParamsSkipRuleActionParametersProductRateLimit RuleNewParamsSkipRuleActionParametersProduct = "rateLimit"
+ RuleNewParamsSkipRuleActionParametersProductSecurityLevel RuleNewParamsSkipRuleActionParametersProduct = "securityLevel"
+ RuleNewParamsSkipRuleActionParametersProductUABlock RuleNewParamsSkipRuleActionParametersProduct = "uaBlock"
+ RuleNewParamsSkipRuleActionParametersProductWAF RuleNewParamsSkipRuleActionParametersProduct = "waf"
+ RuleNewParamsSkipRuleActionParametersProductZoneLockdown RuleNewParamsSkipRuleActionParametersProduct = "zoneLockdown"
)
-func (r RuleNewParamsRulesetsSkipRuleActionParametersProduct) IsKnown() bool {
+func (r RuleNewParamsSkipRuleActionParametersProduct) IsKnown() bool {
switch r {
- case RuleNewParamsRulesetsSkipRuleActionParametersProductBic, RuleNewParamsRulesetsSkipRuleActionParametersProductHot, RuleNewParamsRulesetsSkipRuleActionParametersProductRateLimit, RuleNewParamsRulesetsSkipRuleActionParametersProductSecurityLevel, RuleNewParamsRulesetsSkipRuleActionParametersProductUABlock, RuleNewParamsRulesetsSkipRuleActionParametersProductWAF, RuleNewParamsRulesetsSkipRuleActionParametersProductZoneLockdown:
+ case RuleNewParamsSkipRuleActionParametersProductBic, RuleNewParamsSkipRuleActionParametersProductHot, RuleNewParamsSkipRuleActionParametersProductRateLimit, RuleNewParamsSkipRuleActionParametersProductSecurityLevel, RuleNewParamsSkipRuleActionParametersProductUABlock, RuleNewParamsSkipRuleActionParametersProductWAF, RuleNewParamsSkipRuleActionParametersProductZoneLockdown:
return true
}
return false
@@ -3183,15 +863,15 @@ func (r RuleNewParamsRulesetsSkipRuleActionParametersProduct) IsKnown() bool {
// A ruleset to skip the execution of. This option is incompatible with the
// rulesets, rules and phases options.
-type RuleNewParamsRulesetsSkipRuleActionParametersRuleset string
+type RuleNewParamsSkipRuleActionParametersRuleset string
const (
- RuleNewParamsRulesetsSkipRuleActionParametersRulesetCurrent RuleNewParamsRulesetsSkipRuleActionParametersRuleset = "current"
+ RuleNewParamsSkipRuleActionParametersRulesetCurrent RuleNewParamsSkipRuleActionParametersRuleset = "current"
)
-func (r RuleNewParamsRulesetsSkipRuleActionParametersRuleset) IsKnown() bool {
+func (r RuleNewParamsSkipRuleActionParametersRuleset) IsKnown() bool {
switch r {
- case RuleNewParamsRulesetsSkipRuleActionParametersRulesetCurrent:
+ case RuleNewParamsSkipRuleActionParametersRulesetCurrent:
return true
}
return false
@@ -3507,8 +1187,8 @@ func (r RuleDeleteResponseEnvelopeSuccess) IsKnown() bool {
}
// This interface is a union satisfied by one of the following:
-// [RuleEditParamsRulesetsBlockRule], [RuleEditParamsRulesetsExecuteRule],
-// [RuleEditParamsRulesetsLogRule], [RuleEditParamsRulesetsSkipRule].
+// [RuleEditParamsBlockRule], [RuleEditParamsExecuteRule], [RuleEditParamsLogRule],
+// [RuleEditParamsSkipRule].
type RuleEditParams interface {
ImplementsRuleEditParams()
@@ -3517,7 +1197,7 @@ type RuleEditParams interface {
getZoneID() param.Field[string]
}
-type RuleEditParamsRulesetsBlockRule struct {
+type RuleEditParamsBlockRule struct {
// The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
AccountID param.Field[string] `path:"account_id"`
// The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
@@ -3525,9 +1205,9 @@ type RuleEditParamsRulesetsBlockRule struct {
// The unique ID of the rule.
ID param.Field[string] `json:"id"`
// The action to perform when the rule matches.
- Action param.Field[RuleEditParamsRulesetsBlockRuleAction] `json:"action"`
+ Action param.Field[RuleEditParamsBlockRuleAction] `json:"action"`
// The parameters configuring the rule's action.
- ActionParameters param.Field[RuleEditParamsRulesetsBlockRuleActionParameters] `json:"action_parameters"`
+ ActionParameters param.Field[RuleEditParamsBlockRuleActionParameters] `json:"action_parameters"`
// An informative description of the rule.
Description param.Field[string] `json:"description"`
// Whether the rule should be executed.
@@ -3540,49 +1220,49 @@ type RuleEditParamsRulesetsBlockRule struct {
Ref param.Field[string] `json:"ref"`
}
-func (r RuleEditParamsRulesetsBlockRule) MarshalJSON() (data []byte, err error) {
+func (r RuleEditParamsBlockRule) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
-func (r RuleEditParamsRulesetsBlockRule) getAccountID() param.Field[string] {
+func (r RuleEditParamsBlockRule) getAccountID() param.Field[string] {
return r.AccountID
}
-func (r RuleEditParamsRulesetsBlockRule) getZoneID() param.Field[string] {
+func (r RuleEditParamsBlockRule) getZoneID() param.Field[string] {
return r.ZoneID
}
-func (RuleEditParamsRulesetsBlockRule) ImplementsRuleEditParams() {
+func (RuleEditParamsBlockRule) ImplementsRuleEditParams() {
}
// The action to perform when the rule matches.
-type RuleEditParamsRulesetsBlockRuleAction string
+type RuleEditParamsBlockRuleAction string
const (
- RuleEditParamsRulesetsBlockRuleActionBlock RuleEditParamsRulesetsBlockRuleAction = "block"
+ RuleEditParamsBlockRuleActionBlock RuleEditParamsBlockRuleAction = "block"
)
-func (r RuleEditParamsRulesetsBlockRuleAction) IsKnown() bool {
+func (r RuleEditParamsBlockRuleAction) IsKnown() bool {
switch r {
- case RuleEditParamsRulesetsBlockRuleActionBlock:
+ case RuleEditParamsBlockRuleActionBlock:
return true
}
return false
}
// The parameters configuring the rule's action.
-type RuleEditParamsRulesetsBlockRuleActionParameters struct {
+type RuleEditParamsBlockRuleActionParameters struct {
// The response to show when the block is applied.
- Response param.Field[RuleEditParamsRulesetsBlockRuleActionParametersResponse] `json:"response"`
+ Response param.Field[RuleEditParamsBlockRuleActionParametersResponse] `json:"response"`
}
-func (r RuleEditParamsRulesetsBlockRuleActionParameters) MarshalJSON() (data []byte, err error) {
+func (r RuleEditParamsBlockRuleActionParameters) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
// The response to show when the block is applied.
-type RuleEditParamsRulesetsBlockRuleActionParametersResponse struct {
+type RuleEditParamsBlockRuleActionParametersResponse struct {
// The content to return.
Content param.Field[string] `json:"content,required"`
// The type of the content to return.
@@ -3591,11 +1271,11 @@ type RuleEditParamsRulesetsBlockRuleActionParametersResponse struct {
StatusCode param.Field[int64] `json:"status_code,required"`
}
-func (r RuleEditParamsRulesetsBlockRuleActionParametersResponse) MarshalJSON() (data []byte, err error) {
+func (r RuleEditParamsBlockRuleActionParametersResponse) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
-type RuleEditParamsRulesetsExecuteRule struct {
+type RuleEditParamsExecuteRule struct {
// The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
AccountID param.Field[string] `path:"account_id"`
// The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
@@ -3603,9 +1283,9 @@ type RuleEditParamsRulesetsExecuteRule struct {
// The unique ID of the rule.
ID param.Field[string] `json:"id"`
// The action to perform when the rule matches.
- Action param.Field[RuleEditParamsRulesetsExecuteRuleAction] `json:"action"`
+ Action param.Field[RuleEditParamsExecuteRuleAction] `json:"action"`
// The parameters configuring the rule's action.
- ActionParameters param.Field[RuleEditParamsRulesetsExecuteRuleActionParameters] `json:"action_parameters"`
+ ActionParameters param.Field[RuleEditParamsExecuteRuleActionParameters] `json:"action_parameters"`
// An informative description of the rule.
Description param.Field[string] `json:"description"`
// Whether the rule should be executed.
@@ -3618,85 +1298,85 @@ type RuleEditParamsRulesetsExecuteRule struct {
Ref param.Field[string] `json:"ref"`
}
-func (r RuleEditParamsRulesetsExecuteRule) MarshalJSON() (data []byte, err error) {
+func (r RuleEditParamsExecuteRule) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
-func (r RuleEditParamsRulesetsExecuteRule) getAccountID() param.Field[string] {
+func (r RuleEditParamsExecuteRule) getAccountID() param.Field[string] {
return r.AccountID
}
-func (r RuleEditParamsRulesetsExecuteRule) getZoneID() param.Field[string] {
+func (r RuleEditParamsExecuteRule) getZoneID() param.Field[string] {
return r.ZoneID
}
-func (RuleEditParamsRulesetsExecuteRule) ImplementsRuleEditParams() {
+func (RuleEditParamsExecuteRule) ImplementsRuleEditParams() {
}
// The action to perform when the rule matches.
-type RuleEditParamsRulesetsExecuteRuleAction string
+type RuleEditParamsExecuteRuleAction string
const (
- RuleEditParamsRulesetsExecuteRuleActionExecute RuleEditParamsRulesetsExecuteRuleAction = "execute"
+ RuleEditParamsExecuteRuleActionExecute RuleEditParamsExecuteRuleAction = "execute"
)
-func (r RuleEditParamsRulesetsExecuteRuleAction) IsKnown() bool {
+func (r RuleEditParamsExecuteRuleAction) IsKnown() bool {
switch r {
- case RuleEditParamsRulesetsExecuteRuleActionExecute:
+ case RuleEditParamsExecuteRuleActionExecute:
return true
}
return false
}
// The parameters configuring the rule's action.
-type RuleEditParamsRulesetsExecuteRuleActionParameters struct {
+type RuleEditParamsExecuteRuleActionParameters struct {
// The ID of the ruleset to execute.
ID param.Field[string] `json:"id,required"`
// The configuration to use for matched data logging.
- MatchedData param.Field[RuleEditParamsRulesetsExecuteRuleActionParametersMatchedData] `json:"matched_data"`
+ MatchedData param.Field[RuleEditParamsExecuteRuleActionParametersMatchedData] `json:"matched_data"`
// A set of overrides to apply to the target ruleset.
- Overrides param.Field[RuleEditParamsRulesetsExecuteRuleActionParametersOverrides] `json:"overrides"`
+ Overrides param.Field[RuleEditParamsExecuteRuleActionParametersOverrides] `json:"overrides"`
}
-func (r RuleEditParamsRulesetsExecuteRuleActionParameters) MarshalJSON() (data []byte, err error) {
+func (r RuleEditParamsExecuteRuleActionParameters) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
// The configuration to use for matched data logging.
-type RuleEditParamsRulesetsExecuteRuleActionParametersMatchedData struct {
+type RuleEditParamsExecuteRuleActionParametersMatchedData struct {
// The public key to encrypt matched data logs with.
PublicKey param.Field[string] `json:"public_key,required"`
}
-func (r RuleEditParamsRulesetsExecuteRuleActionParametersMatchedData) MarshalJSON() (data []byte, err error) {
+func (r RuleEditParamsExecuteRuleActionParametersMatchedData) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
// A set of overrides to apply to the target ruleset.
-type RuleEditParamsRulesetsExecuteRuleActionParametersOverrides struct {
+type RuleEditParamsExecuteRuleActionParametersOverrides struct {
// An action to override all rules with. This option has lower precedence than rule
// and category overrides.
Action param.Field[string] `json:"action"`
// A list of category-level overrides. This option has the second-highest
// precedence after rule-level overrides.
- Categories param.Field[[]RuleEditParamsRulesetsExecuteRuleActionParametersOverridesCategory] `json:"categories"`
+ Categories param.Field[[]RuleEditParamsExecuteRuleActionParametersOverridesCategory] `json:"categories"`
// Whether to enable execution of all rules. This option has lower precedence than
// rule and category overrides.
Enabled param.Field[bool] `json:"enabled"`
// A list of rule-level overrides. This option has the highest precedence.
- Rules param.Field[[]RuleEditParamsRulesetsExecuteRuleActionParametersOverridesRule] `json:"rules"`
+ Rules param.Field[[]RuleEditParamsExecuteRuleActionParametersOverridesRule] `json:"rules"`
// A sensitivity level to set for all rules. This option has lower precedence than
// rule and category overrides and is only applicable for DDoS phases.
- SensitivityLevel param.Field[RuleEditParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevel] `json:"sensitivity_level"`
+ SensitivityLevel param.Field[RuleEditParamsExecuteRuleActionParametersOverridesSensitivityLevel] `json:"sensitivity_level"`
}
-func (r RuleEditParamsRulesetsExecuteRuleActionParametersOverrides) MarshalJSON() (data []byte, err error) {
+func (r RuleEditParamsExecuteRuleActionParametersOverrides) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
// A category-level override
-type RuleEditParamsRulesetsExecuteRuleActionParametersOverridesCategory struct {
+type RuleEditParamsExecuteRuleActionParametersOverridesCategory struct {
// The name of the category to override.
Category param.Field[string] `json:"category,required"`
// The action to override rules in the category with.
@@ -3704,33 +1384,33 @@ type RuleEditParamsRulesetsExecuteRuleActionParametersOverridesCategory struct {
// Whether to enable execution of rules in the category.
Enabled param.Field[bool] `json:"enabled"`
// The sensitivity level to use for rules in the category.
- SensitivityLevel param.Field[RuleEditParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel] `json:"sensitivity_level"`
+ SensitivityLevel param.Field[RuleEditParamsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel] `json:"sensitivity_level"`
}
-func (r RuleEditParamsRulesetsExecuteRuleActionParametersOverridesCategory) MarshalJSON() (data []byte, err error) {
+func (r RuleEditParamsExecuteRuleActionParametersOverridesCategory) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
// The sensitivity level to use for rules in the category.
-type RuleEditParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel string
+type RuleEditParamsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel string
const (
- RuleEditParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault RuleEditParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "default"
- RuleEditParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium RuleEditParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "medium"
- RuleEditParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow RuleEditParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "low"
- RuleEditParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff RuleEditParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "eoff"
+ RuleEditParamsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault RuleEditParamsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "default"
+ RuleEditParamsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium RuleEditParamsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "medium"
+ RuleEditParamsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow RuleEditParamsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "low"
+ RuleEditParamsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff RuleEditParamsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "eoff"
)
-func (r RuleEditParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel) IsKnown() bool {
+func (r RuleEditParamsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel) IsKnown() bool {
switch r {
- case RuleEditParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault, RuleEditParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium, RuleEditParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow, RuleEditParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff:
+ case RuleEditParamsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault, RuleEditParamsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium, RuleEditParamsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow, RuleEditParamsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff:
return true
}
return false
}
// A rule-level override
-type RuleEditParamsRulesetsExecuteRuleActionParametersOverridesRule struct {
+type RuleEditParamsExecuteRuleActionParametersOverridesRule struct {
// The ID of the rule to override.
ID param.Field[string] `json:"id,required"`
// The action to override the rule with.
@@ -3740,26 +1420,26 @@ type RuleEditParamsRulesetsExecuteRuleActionParametersOverridesRule struct {
// The score threshold to use for the rule.
ScoreThreshold param.Field[int64] `json:"score_threshold"`
// The sensitivity level to use for the rule.
- SensitivityLevel param.Field[RuleEditParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel] `json:"sensitivity_level"`
+ SensitivityLevel param.Field[RuleEditParamsExecuteRuleActionParametersOverridesRulesSensitivityLevel] `json:"sensitivity_level"`
}
-func (r RuleEditParamsRulesetsExecuteRuleActionParametersOverridesRule) MarshalJSON() (data []byte, err error) {
+func (r RuleEditParamsExecuteRuleActionParametersOverridesRule) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
// The sensitivity level to use for the rule.
-type RuleEditParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel string
+type RuleEditParamsExecuteRuleActionParametersOverridesRulesSensitivityLevel string
const (
- RuleEditParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault RuleEditParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "default"
- RuleEditParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium RuleEditParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "medium"
- RuleEditParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow RuleEditParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "low"
- RuleEditParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff RuleEditParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "eoff"
+ RuleEditParamsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault RuleEditParamsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "default"
+ RuleEditParamsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium RuleEditParamsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "medium"
+ RuleEditParamsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow RuleEditParamsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "low"
+ RuleEditParamsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff RuleEditParamsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "eoff"
)
-func (r RuleEditParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel) IsKnown() bool {
+func (r RuleEditParamsExecuteRuleActionParametersOverridesRulesSensitivityLevel) IsKnown() bool {
switch r {
- case RuleEditParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault, RuleEditParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium, RuleEditParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow, RuleEditParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff:
+ case RuleEditParamsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault, RuleEditParamsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium, RuleEditParamsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow, RuleEditParamsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff:
return true
}
return false
@@ -3767,24 +1447,24 @@ func (r RuleEditParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivi
// A sensitivity level to set for all rules. This option has lower precedence than
// rule and category overrides and is only applicable for DDoS phases.
-type RuleEditParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevel string
+type RuleEditParamsExecuteRuleActionParametersOverridesSensitivityLevel string
const (
- RuleEditParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault RuleEditParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "default"
- RuleEditParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium RuleEditParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "medium"
- RuleEditParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow RuleEditParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "low"
- RuleEditParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff RuleEditParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "eoff"
+ RuleEditParamsExecuteRuleActionParametersOverridesSensitivityLevelDefault RuleEditParamsExecuteRuleActionParametersOverridesSensitivityLevel = "default"
+ RuleEditParamsExecuteRuleActionParametersOverridesSensitivityLevelMedium RuleEditParamsExecuteRuleActionParametersOverridesSensitivityLevel = "medium"
+ RuleEditParamsExecuteRuleActionParametersOverridesSensitivityLevelLow RuleEditParamsExecuteRuleActionParametersOverridesSensitivityLevel = "low"
+ RuleEditParamsExecuteRuleActionParametersOverridesSensitivityLevelEoff RuleEditParamsExecuteRuleActionParametersOverridesSensitivityLevel = "eoff"
)
-func (r RuleEditParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevel) IsKnown() bool {
+func (r RuleEditParamsExecuteRuleActionParametersOverridesSensitivityLevel) IsKnown() bool {
switch r {
- case RuleEditParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault, RuleEditParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium, RuleEditParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow, RuleEditParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff:
+ case RuleEditParamsExecuteRuleActionParametersOverridesSensitivityLevelDefault, RuleEditParamsExecuteRuleActionParametersOverridesSensitivityLevelMedium, RuleEditParamsExecuteRuleActionParametersOverridesSensitivityLevelLow, RuleEditParamsExecuteRuleActionParametersOverridesSensitivityLevelEoff:
return true
}
return false
}
-type RuleEditParamsRulesetsLogRule struct {
+type RuleEditParamsLogRule struct {
// The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
AccountID param.Field[string] `path:"account_id"`
// The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
@@ -3792,7 +1472,7 @@ type RuleEditParamsRulesetsLogRule struct {
// The unique ID of the rule.
ID param.Field[string] `json:"id"`
// The action to perform when the rule matches.
- Action param.Field[RuleEditParamsRulesetsLogRuleAction] `json:"action"`
+ Action param.Field[RuleEditParamsLogRuleAction] `json:"action"`
// The parameters configuring the rule's action.
ActionParameters param.Field[interface{}] `json:"action_parameters"`
// An informative description of the rule.
@@ -3807,38 +1487,38 @@ type RuleEditParamsRulesetsLogRule struct {
Ref param.Field[string] `json:"ref"`
}
-func (r RuleEditParamsRulesetsLogRule) MarshalJSON() (data []byte, err error) {
+func (r RuleEditParamsLogRule) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
-func (r RuleEditParamsRulesetsLogRule) getAccountID() param.Field[string] {
+func (r RuleEditParamsLogRule) getAccountID() param.Field[string] {
return r.AccountID
}
-func (r RuleEditParamsRulesetsLogRule) getZoneID() param.Field[string] {
+func (r RuleEditParamsLogRule) getZoneID() param.Field[string] {
return r.ZoneID
}
-func (RuleEditParamsRulesetsLogRule) ImplementsRuleEditParams() {
+func (RuleEditParamsLogRule) ImplementsRuleEditParams() {
}
// The action to perform when the rule matches.
-type RuleEditParamsRulesetsLogRuleAction string
+type RuleEditParamsLogRuleAction string
const (
- RuleEditParamsRulesetsLogRuleActionLog RuleEditParamsRulesetsLogRuleAction = "log"
+ RuleEditParamsLogRuleActionLog RuleEditParamsLogRuleAction = "log"
)
-func (r RuleEditParamsRulesetsLogRuleAction) IsKnown() bool {
+func (r RuleEditParamsLogRuleAction) IsKnown() bool {
switch r {
- case RuleEditParamsRulesetsLogRuleActionLog:
+ case RuleEditParamsLogRuleActionLog:
return true
}
return false
}
-type RuleEditParamsRulesetsSkipRule struct {
+type RuleEditParamsSkipRule struct {
// The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
AccountID param.Field[string] `path:"account_id"`
// The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
@@ -3846,9 +1526,9 @@ type RuleEditParamsRulesetsSkipRule struct {
// The unique ID of the rule.
ID param.Field[string] `json:"id"`
// The action to perform when the rule matches.
- Action param.Field[RuleEditParamsRulesetsSkipRuleAction] `json:"action"`
+ Action param.Field[RuleEditParamsSkipRuleAction] `json:"action"`
// The parameters configuring the rule's action.
- ActionParameters param.Field[RuleEditParamsRulesetsSkipRuleActionParameters] `json:"action_parameters"`
+ ActionParameters param.Field[RuleEditParamsSkipRuleActionParameters] `json:"action_parameters"`
// An informative description of the rule.
Description param.Field[string] `json:"description"`
// Whether the rule should be executed.
@@ -3861,112 +1541,112 @@ type RuleEditParamsRulesetsSkipRule struct {
Ref param.Field[string] `json:"ref"`
}
-func (r RuleEditParamsRulesetsSkipRule) MarshalJSON() (data []byte, err error) {
+func (r RuleEditParamsSkipRule) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
-func (r RuleEditParamsRulesetsSkipRule) getAccountID() param.Field[string] {
+func (r RuleEditParamsSkipRule) getAccountID() param.Field[string] {
return r.AccountID
}
-func (r RuleEditParamsRulesetsSkipRule) getZoneID() param.Field[string] {
+func (r RuleEditParamsSkipRule) getZoneID() param.Field[string] {
return r.ZoneID
}
-func (RuleEditParamsRulesetsSkipRule) ImplementsRuleEditParams() {
+func (RuleEditParamsSkipRule) ImplementsRuleEditParams() {
}
// The action to perform when the rule matches.
-type RuleEditParamsRulesetsSkipRuleAction string
+type RuleEditParamsSkipRuleAction string
const (
- RuleEditParamsRulesetsSkipRuleActionSkip RuleEditParamsRulesetsSkipRuleAction = "skip"
+ RuleEditParamsSkipRuleActionSkip RuleEditParamsSkipRuleAction = "skip"
)
-func (r RuleEditParamsRulesetsSkipRuleAction) IsKnown() bool {
+func (r RuleEditParamsSkipRuleAction) IsKnown() bool {
switch r {
- case RuleEditParamsRulesetsSkipRuleActionSkip:
+ case RuleEditParamsSkipRuleActionSkip:
return true
}
return false
}
// The parameters configuring the rule's action.
-type RuleEditParamsRulesetsSkipRuleActionParameters struct {
+type RuleEditParamsSkipRuleActionParameters struct {
// A list of phases to skip the execution of. This option is incompatible with the
// ruleset and rulesets options.
- Phases param.Field[[]RuleEditParamsRulesetsSkipRuleActionParametersPhase] `json:"phases"`
+ Phases param.Field[[]RuleEditParamsSkipRuleActionParametersPhase] `json:"phases"`
// A list of legacy security products to skip the execution of.
- Products param.Field[[]RuleEditParamsRulesetsSkipRuleActionParametersProduct] `json:"products"`
+ Products param.Field[[]RuleEditParamsSkipRuleActionParametersProduct] `json:"products"`
// A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the
// execution of. This option is incompatible with the ruleset option.
Rules param.Field[map[string][]string] `json:"rules"`
// A ruleset to skip the execution of. This option is incompatible with the
// rulesets, rules and phases options.
- Ruleset param.Field[RuleEditParamsRulesetsSkipRuleActionParametersRuleset] `json:"ruleset"`
+ Ruleset param.Field[RuleEditParamsSkipRuleActionParametersRuleset] `json:"ruleset"`
// A list of ruleset IDs to skip the execution of. This option is incompatible with
// the ruleset and phases options.
Rulesets param.Field[[]string] `json:"rulesets"`
}
-func (r RuleEditParamsRulesetsSkipRuleActionParameters) MarshalJSON() (data []byte, err error) {
+func (r RuleEditParamsSkipRuleActionParameters) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
// A phase to skip the execution of.
-type RuleEditParamsRulesetsSkipRuleActionParametersPhase string
+type RuleEditParamsSkipRuleActionParametersPhase string
const (
- RuleEditParamsRulesetsSkipRuleActionParametersPhaseDDoSL4 RuleEditParamsRulesetsSkipRuleActionParametersPhase = "ddos_l4"
- RuleEditParamsRulesetsSkipRuleActionParametersPhaseDDoSL7 RuleEditParamsRulesetsSkipRuleActionParametersPhase = "ddos_l7"
- RuleEditParamsRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings RuleEditParamsRulesetsSkipRuleActionParametersPhase = "http_config_settings"
- RuleEditParamsRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors RuleEditParamsRulesetsSkipRuleActionParametersPhase = "http_custom_errors"
- RuleEditParamsRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields RuleEditParamsRulesetsSkipRuleActionParametersPhase = "http_log_custom_fields"
- RuleEditParamsRulesetsSkipRuleActionParametersPhaseHTTPRatelimit RuleEditParamsRulesetsSkipRuleActionParametersPhase = "http_ratelimit"
- RuleEditParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings RuleEditParamsRulesetsSkipRuleActionParametersPhase = "http_request_cache_settings"
- RuleEditParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect RuleEditParamsRulesetsSkipRuleActionParametersPhase = "http_request_dynamic_redirect"
- RuleEditParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom RuleEditParamsRulesetsSkipRuleActionParametersPhase = "http_request_firewall_custom"
- RuleEditParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged RuleEditParamsRulesetsSkipRuleActionParametersPhase = "http_request_firewall_managed"
- RuleEditParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform RuleEditParamsRulesetsSkipRuleActionParametersPhase = "http_request_late_transform"
- RuleEditParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin RuleEditParamsRulesetsSkipRuleActionParametersPhase = "http_request_origin"
- RuleEditParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect RuleEditParamsRulesetsSkipRuleActionParametersPhase = "http_request_redirect"
- RuleEditParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize RuleEditParamsRulesetsSkipRuleActionParametersPhase = "http_request_sanitize"
- RuleEditParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm RuleEditParamsRulesetsSkipRuleActionParametersPhase = "http_request_sbfm"
- RuleEditParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration RuleEditParamsRulesetsSkipRuleActionParametersPhase = "http_request_select_configuration"
- RuleEditParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform RuleEditParamsRulesetsSkipRuleActionParametersPhase = "http_request_transform"
- RuleEditParamsRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression RuleEditParamsRulesetsSkipRuleActionParametersPhase = "http_response_compression"
- RuleEditParamsRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged RuleEditParamsRulesetsSkipRuleActionParametersPhase = "http_response_firewall_managed"
- RuleEditParamsRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform RuleEditParamsRulesetsSkipRuleActionParametersPhase = "http_response_headers_transform"
- RuleEditParamsRulesetsSkipRuleActionParametersPhaseMagicTransit RuleEditParamsRulesetsSkipRuleActionParametersPhase = "magic_transit"
- RuleEditParamsRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged RuleEditParamsRulesetsSkipRuleActionParametersPhase = "magic_transit_ids_managed"
- RuleEditParamsRulesetsSkipRuleActionParametersPhaseMagicTransitManaged RuleEditParamsRulesetsSkipRuleActionParametersPhase = "magic_transit_managed"
+ RuleEditParamsSkipRuleActionParametersPhaseDDoSL4 RuleEditParamsSkipRuleActionParametersPhase = "ddos_l4"
+ RuleEditParamsSkipRuleActionParametersPhaseDDoSL7 RuleEditParamsSkipRuleActionParametersPhase = "ddos_l7"
+ RuleEditParamsSkipRuleActionParametersPhaseHTTPConfigSettings RuleEditParamsSkipRuleActionParametersPhase = "http_config_settings"
+ RuleEditParamsSkipRuleActionParametersPhaseHTTPCustomErrors RuleEditParamsSkipRuleActionParametersPhase = "http_custom_errors"
+ RuleEditParamsSkipRuleActionParametersPhaseHTTPLogCustomFields RuleEditParamsSkipRuleActionParametersPhase = "http_log_custom_fields"
+ RuleEditParamsSkipRuleActionParametersPhaseHTTPRatelimit RuleEditParamsSkipRuleActionParametersPhase = "http_ratelimit"
+ RuleEditParamsSkipRuleActionParametersPhaseHTTPRequestCacheSettings RuleEditParamsSkipRuleActionParametersPhase = "http_request_cache_settings"
+ RuleEditParamsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect RuleEditParamsSkipRuleActionParametersPhase = "http_request_dynamic_redirect"
+ RuleEditParamsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom RuleEditParamsSkipRuleActionParametersPhase = "http_request_firewall_custom"
+ RuleEditParamsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged RuleEditParamsSkipRuleActionParametersPhase = "http_request_firewall_managed"
+ RuleEditParamsSkipRuleActionParametersPhaseHTTPRequestLateTransform RuleEditParamsSkipRuleActionParametersPhase = "http_request_late_transform"
+ RuleEditParamsSkipRuleActionParametersPhaseHTTPRequestOrigin RuleEditParamsSkipRuleActionParametersPhase = "http_request_origin"
+ RuleEditParamsSkipRuleActionParametersPhaseHTTPRequestRedirect RuleEditParamsSkipRuleActionParametersPhase = "http_request_redirect"
+ RuleEditParamsSkipRuleActionParametersPhaseHTTPRequestSanitize RuleEditParamsSkipRuleActionParametersPhase = "http_request_sanitize"
+ RuleEditParamsSkipRuleActionParametersPhaseHTTPRequestSbfm RuleEditParamsSkipRuleActionParametersPhase = "http_request_sbfm"
+ RuleEditParamsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration RuleEditParamsSkipRuleActionParametersPhase = "http_request_select_configuration"
+ RuleEditParamsSkipRuleActionParametersPhaseHTTPRequestTransform RuleEditParamsSkipRuleActionParametersPhase = "http_request_transform"
+ RuleEditParamsSkipRuleActionParametersPhaseHTTPResponseCompression RuleEditParamsSkipRuleActionParametersPhase = "http_response_compression"
+ RuleEditParamsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged RuleEditParamsSkipRuleActionParametersPhase = "http_response_firewall_managed"
+ RuleEditParamsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform RuleEditParamsSkipRuleActionParametersPhase = "http_response_headers_transform"
+ RuleEditParamsSkipRuleActionParametersPhaseMagicTransit RuleEditParamsSkipRuleActionParametersPhase = "magic_transit"
+ RuleEditParamsSkipRuleActionParametersPhaseMagicTransitIDsManaged RuleEditParamsSkipRuleActionParametersPhase = "magic_transit_ids_managed"
+ RuleEditParamsSkipRuleActionParametersPhaseMagicTransitManaged RuleEditParamsSkipRuleActionParametersPhase = "magic_transit_managed"
)
-func (r RuleEditParamsRulesetsSkipRuleActionParametersPhase) IsKnown() bool {
+func (r RuleEditParamsSkipRuleActionParametersPhase) IsKnown() bool {
switch r {
- case RuleEditParamsRulesetsSkipRuleActionParametersPhaseDDoSL4, RuleEditParamsRulesetsSkipRuleActionParametersPhaseDDoSL7, RuleEditParamsRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings, RuleEditParamsRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors, RuleEditParamsRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields, RuleEditParamsRulesetsSkipRuleActionParametersPhaseHTTPRatelimit, RuleEditParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings, RuleEditParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect, RuleEditParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom, RuleEditParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged, RuleEditParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform, RuleEditParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin, RuleEditParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect, RuleEditParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize, RuleEditParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm, RuleEditParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration, RuleEditParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform, RuleEditParamsRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression, RuleEditParamsRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged, RuleEditParamsRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform, RuleEditParamsRulesetsSkipRuleActionParametersPhaseMagicTransit, RuleEditParamsRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged, RuleEditParamsRulesetsSkipRuleActionParametersPhaseMagicTransitManaged:
+ case RuleEditParamsSkipRuleActionParametersPhaseDDoSL4, RuleEditParamsSkipRuleActionParametersPhaseDDoSL7, RuleEditParamsSkipRuleActionParametersPhaseHTTPConfigSettings, RuleEditParamsSkipRuleActionParametersPhaseHTTPCustomErrors, RuleEditParamsSkipRuleActionParametersPhaseHTTPLogCustomFields, RuleEditParamsSkipRuleActionParametersPhaseHTTPRatelimit, RuleEditParamsSkipRuleActionParametersPhaseHTTPRequestCacheSettings, RuleEditParamsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect, RuleEditParamsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom, RuleEditParamsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged, RuleEditParamsSkipRuleActionParametersPhaseHTTPRequestLateTransform, RuleEditParamsSkipRuleActionParametersPhaseHTTPRequestOrigin, RuleEditParamsSkipRuleActionParametersPhaseHTTPRequestRedirect, RuleEditParamsSkipRuleActionParametersPhaseHTTPRequestSanitize, RuleEditParamsSkipRuleActionParametersPhaseHTTPRequestSbfm, RuleEditParamsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration, RuleEditParamsSkipRuleActionParametersPhaseHTTPRequestTransform, RuleEditParamsSkipRuleActionParametersPhaseHTTPResponseCompression, RuleEditParamsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged, RuleEditParamsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform, RuleEditParamsSkipRuleActionParametersPhaseMagicTransit, RuleEditParamsSkipRuleActionParametersPhaseMagicTransitIDsManaged, RuleEditParamsSkipRuleActionParametersPhaseMagicTransitManaged:
return true
}
return false
}
// The name of a legacy security product to skip the execution of.
-type RuleEditParamsRulesetsSkipRuleActionParametersProduct string
+type RuleEditParamsSkipRuleActionParametersProduct string
const (
- RuleEditParamsRulesetsSkipRuleActionParametersProductBic RuleEditParamsRulesetsSkipRuleActionParametersProduct = "bic"
- RuleEditParamsRulesetsSkipRuleActionParametersProductHot RuleEditParamsRulesetsSkipRuleActionParametersProduct = "hot"
- RuleEditParamsRulesetsSkipRuleActionParametersProductRateLimit RuleEditParamsRulesetsSkipRuleActionParametersProduct = "rateLimit"
- RuleEditParamsRulesetsSkipRuleActionParametersProductSecurityLevel RuleEditParamsRulesetsSkipRuleActionParametersProduct = "securityLevel"
- RuleEditParamsRulesetsSkipRuleActionParametersProductUABlock RuleEditParamsRulesetsSkipRuleActionParametersProduct = "uaBlock"
- RuleEditParamsRulesetsSkipRuleActionParametersProductWAF RuleEditParamsRulesetsSkipRuleActionParametersProduct = "waf"
- RuleEditParamsRulesetsSkipRuleActionParametersProductZoneLockdown RuleEditParamsRulesetsSkipRuleActionParametersProduct = "zoneLockdown"
+ RuleEditParamsSkipRuleActionParametersProductBic RuleEditParamsSkipRuleActionParametersProduct = "bic"
+ RuleEditParamsSkipRuleActionParametersProductHot RuleEditParamsSkipRuleActionParametersProduct = "hot"
+ RuleEditParamsSkipRuleActionParametersProductRateLimit RuleEditParamsSkipRuleActionParametersProduct = "rateLimit"
+ RuleEditParamsSkipRuleActionParametersProductSecurityLevel RuleEditParamsSkipRuleActionParametersProduct = "securityLevel"
+ RuleEditParamsSkipRuleActionParametersProductUABlock RuleEditParamsSkipRuleActionParametersProduct = "uaBlock"
+ RuleEditParamsSkipRuleActionParametersProductWAF RuleEditParamsSkipRuleActionParametersProduct = "waf"
+ RuleEditParamsSkipRuleActionParametersProductZoneLockdown RuleEditParamsSkipRuleActionParametersProduct = "zoneLockdown"
)
-func (r RuleEditParamsRulesetsSkipRuleActionParametersProduct) IsKnown() bool {
+func (r RuleEditParamsSkipRuleActionParametersProduct) IsKnown() bool {
switch r {
- case RuleEditParamsRulesetsSkipRuleActionParametersProductBic, RuleEditParamsRulesetsSkipRuleActionParametersProductHot, RuleEditParamsRulesetsSkipRuleActionParametersProductRateLimit, RuleEditParamsRulesetsSkipRuleActionParametersProductSecurityLevel, RuleEditParamsRulesetsSkipRuleActionParametersProductUABlock, RuleEditParamsRulesetsSkipRuleActionParametersProductWAF, RuleEditParamsRulesetsSkipRuleActionParametersProductZoneLockdown:
+ case RuleEditParamsSkipRuleActionParametersProductBic, RuleEditParamsSkipRuleActionParametersProductHot, RuleEditParamsSkipRuleActionParametersProductRateLimit, RuleEditParamsSkipRuleActionParametersProductSecurityLevel, RuleEditParamsSkipRuleActionParametersProductUABlock, RuleEditParamsSkipRuleActionParametersProductWAF, RuleEditParamsSkipRuleActionParametersProductZoneLockdown:
return true
}
return false
@@ -3974,15 +1654,15 @@ func (r RuleEditParamsRulesetsSkipRuleActionParametersProduct) IsKnown() bool {
// A ruleset to skip the execution of. This option is incompatible with the
// rulesets, rules and phases options.
-type RuleEditParamsRulesetsSkipRuleActionParametersRuleset string
+type RuleEditParamsSkipRuleActionParametersRuleset string
const (
- RuleEditParamsRulesetsSkipRuleActionParametersRulesetCurrent RuleEditParamsRulesetsSkipRuleActionParametersRuleset = "current"
+ RuleEditParamsSkipRuleActionParametersRulesetCurrent RuleEditParamsSkipRuleActionParametersRuleset = "current"
)
-func (r RuleEditParamsRulesetsSkipRuleActionParametersRuleset) IsKnown() bool {
+func (r RuleEditParamsSkipRuleActionParametersRuleset) IsKnown() bool {
switch r {
- case RuleEditParamsRulesetsSkipRuleActionParametersRulesetCurrent:
+ case RuleEditParamsSkipRuleActionParametersRulesetCurrent:
return true
}
return false
diff --git a/rulesets/rule_test.go b/rulesets/rule_test.go
index 3fa9974ea62..06e5ab56795 100644
--- a/rulesets/rule_test.go
+++ b/rulesets/rule_test.go
@@ -32,13 +32,13 @@ func TestRuleNewWithOptionalParams(t *testing.T) {
_, err := client.Rulesets.Rules.New(
context.TODO(),
"2f2feab2026849078ba485f918791bdc",
- rulesets.RuleNewParamsRulesetsBlockRule{
+ rulesets.RuleNewParamsBlockRule{
AccountID: cloudflare.F("string"),
ZoneID: cloudflare.F("string"),
ID: cloudflare.F("3a03d665bac047339bb530ecb439a90d"),
- Action: cloudflare.F(rulesets.RuleNewParamsRulesetsBlockRuleActionBlock),
- ActionParameters: cloudflare.F(rulesets.RuleNewParamsRulesetsBlockRuleActionParameters{
- Response: cloudflare.F(rulesets.RuleNewParamsRulesetsBlockRuleActionParametersResponse{
+ Action: cloudflare.F(rulesets.RuleNewParamsBlockRuleActionBlock),
+ ActionParameters: cloudflare.F(rulesets.RuleNewParamsBlockRuleActionParameters{
+ Response: cloudflare.F(rulesets.RuleNewParamsBlockRuleActionParametersResponse{
Content: cloudflare.F("{\n \"success\": false,\n \"error\": \"you have been blocked\"\n}"),
ContentType: cloudflare.F("application/json"),
StatusCode: cloudflare.F(int64(400)),
@@ -112,13 +112,13 @@ func TestRuleEditWithOptionalParams(t *testing.T) {
context.TODO(),
"2f2feab2026849078ba485f918791bdc",
"3a03d665bac047339bb530ecb439a90d",
- rulesets.RuleEditParamsRulesetsBlockRule{
+ rulesets.RuleEditParamsBlockRule{
AccountID: cloudflare.F("string"),
ZoneID: cloudflare.F("string"),
ID: cloudflare.F("3a03d665bac047339bb530ecb439a90d"),
- Action: cloudflare.F(rulesets.RuleEditParamsRulesetsBlockRuleActionBlock),
- ActionParameters: cloudflare.F(rulesets.RuleEditParamsRulesetsBlockRuleActionParameters{
- Response: cloudflare.F(rulesets.RuleEditParamsRulesetsBlockRuleActionParametersResponse{
+ Action: cloudflare.F(rulesets.RuleEditParamsBlockRuleActionBlock),
+ ActionParameters: cloudflare.F(rulesets.RuleEditParamsBlockRuleActionParameters{
+ Response: cloudflare.F(rulesets.RuleEditParamsBlockRuleActionParametersResponse{
Content: cloudflare.F("{\n \"success\": false,\n \"error\": \"you have been blocked\"\n}"),
ContentType: cloudflare.F("application/json"),
StatusCode: cloudflare.F(int64(400)),
diff --git a/rulesets/ruleset.go b/rulesets/ruleset.go
index 5748937718d..425bd84f2db 100644
--- a/rulesets/ruleset.go
+++ b/rulesets/ruleset.go
@@ -86,7 +86,7 @@ func (r *RulesetService) Update(ctx context.Context, rulesetID string, params Ru
}
// Fetches all rulesets.
-func (r *RulesetService) List(ctx context.Context, query RulesetListParams, opts ...option.RequestOption) (res *pagination.SinglePage[RulesetListResponse], err error) {
+func (r *RulesetService) List(ctx context.Context, query RulesetListParams, opts ...option.RequestOption) (res *pagination.SinglePage[Ruleset], err error) {
var raw *http.Response
opts = append(r.Options, opts...)
opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
@@ -113,7 +113,7 @@ func (r *RulesetService) List(ctx context.Context, query RulesetListParams, opts
}
// Fetches all rulesets.
-func (r *RulesetService) ListAutoPaging(ctx context.Context, query RulesetListParams, opts ...option.RequestOption) *pagination.SinglePageAutoPager[RulesetListResponse] {
+func (r *RulesetService) ListAutoPaging(ctx context.Context, query RulesetListParams, opts ...option.RequestOption) *pagination.SinglePageAutoPager[Ruleset] {
return pagination.NewSinglePageAutoPager(r.List(ctx, query, opts...))
}
@@ -157,200 +157,7 @@ func (r *RulesetService) Get(ctx context.Context, rulesetID string, query Rulese
return
}
-// A ruleset object.
-type RulesetNewResponse struct {
- // The unique ID of the ruleset.
- ID string `json:"id,required"`
- // The kind of the ruleset.
- Kind RulesetNewResponseKind `json:"kind,required"`
- // The timestamp of when the ruleset was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The human-readable name of the ruleset.
- Name string `json:"name,required"`
- // The phase of the ruleset.
- Phase RulesetNewResponsePhase `json:"phase,required"`
- // The list of rules in the ruleset.
- Rules []RulesetNewResponseRule `json:"rules,required"`
- // The version of the ruleset.
- Version string `json:"version,required"`
- // An informative description of the ruleset.
- Description string `json:"description"`
- JSON rulesetNewResponseJSON `json:"-"`
-}
-
-// rulesetNewResponseJSON contains the JSON metadata for the struct
-// [RulesetNewResponse]
-type rulesetNewResponseJSON struct {
- ID apijson.Field
- Kind apijson.Field
- LastUpdated apijson.Field
- Name apijson.Field
- Phase apijson.Field
- Rules apijson.Field
- Version apijson.Field
- Description apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The kind of the ruleset.
-type RulesetNewResponseKind string
-
-const (
- RulesetNewResponseKindManaged RulesetNewResponseKind = "managed"
- RulesetNewResponseKindCustom RulesetNewResponseKind = "custom"
- RulesetNewResponseKindRoot RulesetNewResponseKind = "root"
- RulesetNewResponseKindZone RulesetNewResponseKind = "zone"
-)
-
-func (r RulesetNewResponseKind) IsKnown() bool {
- switch r {
- case RulesetNewResponseKindManaged, RulesetNewResponseKindCustom, RulesetNewResponseKindRoot, RulesetNewResponseKindZone:
- return true
- }
- return false
-}
-
-// The phase of the ruleset.
-type RulesetNewResponsePhase string
-
-const (
- RulesetNewResponsePhaseDDoSL4 RulesetNewResponsePhase = "ddos_l4"
- RulesetNewResponsePhaseDDoSL7 RulesetNewResponsePhase = "ddos_l7"
- RulesetNewResponsePhaseHTTPConfigSettings RulesetNewResponsePhase = "http_config_settings"
- RulesetNewResponsePhaseHTTPCustomErrors RulesetNewResponsePhase = "http_custom_errors"
- RulesetNewResponsePhaseHTTPLogCustomFields RulesetNewResponsePhase = "http_log_custom_fields"
- RulesetNewResponsePhaseHTTPRatelimit RulesetNewResponsePhase = "http_ratelimit"
- RulesetNewResponsePhaseHTTPRequestCacheSettings RulesetNewResponsePhase = "http_request_cache_settings"
- RulesetNewResponsePhaseHTTPRequestDynamicRedirect RulesetNewResponsePhase = "http_request_dynamic_redirect"
- RulesetNewResponsePhaseHTTPRequestFirewallCustom RulesetNewResponsePhase = "http_request_firewall_custom"
- RulesetNewResponsePhaseHTTPRequestFirewallManaged RulesetNewResponsePhase = "http_request_firewall_managed"
- RulesetNewResponsePhaseHTTPRequestLateTransform RulesetNewResponsePhase = "http_request_late_transform"
- RulesetNewResponsePhaseHTTPRequestOrigin RulesetNewResponsePhase = "http_request_origin"
- RulesetNewResponsePhaseHTTPRequestRedirect RulesetNewResponsePhase = "http_request_redirect"
- RulesetNewResponsePhaseHTTPRequestSanitize RulesetNewResponsePhase = "http_request_sanitize"
- RulesetNewResponsePhaseHTTPRequestSbfm RulesetNewResponsePhase = "http_request_sbfm"
- RulesetNewResponsePhaseHTTPRequestSelectConfiguration RulesetNewResponsePhase = "http_request_select_configuration"
- RulesetNewResponsePhaseHTTPRequestTransform RulesetNewResponsePhase = "http_request_transform"
- RulesetNewResponsePhaseHTTPResponseCompression RulesetNewResponsePhase = "http_response_compression"
- RulesetNewResponsePhaseHTTPResponseFirewallManaged RulesetNewResponsePhase = "http_response_firewall_managed"
- RulesetNewResponsePhaseHTTPResponseHeadersTransform RulesetNewResponsePhase = "http_response_headers_transform"
- RulesetNewResponsePhaseMagicTransit RulesetNewResponsePhase = "magic_transit"
- RulesetNewResponsePhaseMagicTransitIDsManaged RulesetNewResponsePhase = "magic_transit_ids_managed"
- RulesetNewResponsePhaseMagicTransitManaged RulesetNewResponsePhase = "magic_transit_managed"
-)
-
-func (r RulesetNewResponsePhase) IsKnown() bool {
- switch r {
- case RulesetNewResponsePhaseDDoSL4, RulesetNewResponsePhaseDDoSL7, RulesetNewResponsePhaseHTTPConfigSettings, RulesetNewResponsePhaseHTTPCustomErrors, RulesetNewResponsePhaseHTTPLogCustomFields, RulesetNewResponsePhaseHTTPRatelimit, RulesetNewResponsePhaseHTTPRequestCacheSettings, RulesetNewResponsePhaseHTTPRequestDynamicRedirect, RulesetNewResponsePhaseHTTPRequestFirewallCustom, RulesetNewResponsePhaseHTTPRequestFirewallManaged, RulesetNewResponsePhaseHTTPRequestLateTransform, RulesetNewResponsePhaseHTTPRequestOrigin, RulesetNewResponsePhaseHTTPRequestRedirect, RulesetNewResponsePhaseHTTPRequestSanitize, RulesetNewResponsePhaseHTTPRequestSbfm, RulesetNewResponsePhaseHTTPRequestSelectConfiguration, RulesetNewResponsePhaseHTTPRequestTransform, RulesetNewResponsePhaseHTTPResponseCompression, RulesetNewResponsePhaseHTTPResponseFirewallManaged, RulesetNewResponsePhaseHTTPResponseHeadersTransform, RulesetNewResponsePhaseMagicTransit, RulesetNewResponsePhaseMagicTransitIDsManaged, RulesetNewResponsePhaseMagicTransitManaged:
- return true
- }
- return false
-}
-
-type RulesetNewResponseRule struct {
- // The action to perform when the rule matches.
- Action RulesetNewResponseRulesAction `json:"action"`
- ActionParameters interface{} `json:"action_parameters,required"`
- Categories interface{} `json:"categories,required"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // An object configuring the rule's logging behavior.
- Logging shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- // The version of the rule.
- Version string `json:"version,required"`
- JSON rulesetNewResponseRuleJSON `json:"-"`
- union RulesetNewResponseRulesUnion
-}
-
-// rulesetNewResponseRuleJSON contains the JSON metadata for the struct
-// [RulesetNewResponseRule]
-type rulesetNewResponseRuleJSON struct {
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- ID apijson.Field
- LastUpdated apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- Version apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r rulesetNewResponseRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r *RulesetNewResponseRule) UnmarshalJSON(data []byte) (err error) {
- err = apijson.UnmarshalRoot(data, &r.union)
- if err != nil {
- return err
- }
- return apijson.Port(r.union, &r)
-}
-
-func (r RulesetNewResponseRule) AsUnion() RulesetNewResponseRulesUnion {
- return r.union
-}
-
-// Union satisfied by [rulesets.RulesetNewResponseRulesRulesetsBlockRule],
-// [rulesets.RulesetNewResponseRulesRulesetsExecuteRule],
-// [rulesets.RulesetNewResponseRulesRulesetsLogRule] or
-// [rulesets.RulesetNewResponseRulesRulesetsSkipRule].
-type RulesetNewResponseRulesUnion interface {
- implementsRulesetsRulesetNewResponseRule()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*RulesetNewResponseRulesUnion)(nil)).Elem(),
- "action",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RulesetNewResponseRulesRulesetsBlockRule{}),
- DiscriminatorValue: "block",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RulesetNewResponseRulesRulesetsExecuteRule{}),
- DiscriminatorValue: "execute",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RulesetNewResponseRulesRulesetsLogRule{}),
- DiscriminatorValue: "log",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RulesetNewResponseRulesRulesetsSkipRule{}),
- DiscriminatorValue: "skip",
- },
- )
-}
-
-type RulesetNewResponseRulesRulesetsBlockRule struct {
+type BlockRule struct {
// The timestamp of when the rule was last modified.
LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
// The version of the rule.
@@ -358,9 +165,9 @@ type RulesetNewResponseRulesRulesetsBlockRule struct {
// The unique ID of the rule.
ID string `json:"id"`
// The action to perform when the rule matches.
- Action RulesetNewResponseRulesRulesetsBlockRuleAction `json:"action"`
+ Action BlockRuleAction `json:"action"`
// The parameters configuring the rule's action.
- ActionParameters RulesetNewResponseRulesRulesetsBlockRuleActionParameters `json:"action_parameters"`
+ ActionParameters BlockRuleActionParameters `json:"action_parameters"`
// The categories of the rule.
Categories []string `json:"categories"`
// An informative description of the rule.
@@ -372,13 +179,12 @@ type RulesetNewResponseRulesRulesetsBlockRule struct {
// An object configuring the rule's logging behavior.
Logging shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c `json:"logging"`
// The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON rulesetNewResponseRulesRulesetsBlockRuleJSON `json:"-"`
+ Ref string `json:"ref"`
+ JSON blockRuleJSON `json:"-"`
}
-// rulesetNewResponseRulesRulesetsBlockRuleJSON contains the JSON metadata for the
-// struct [RulesetNewResponseRulesRulesetsBlockRule]
-type rulesetNewResponseRulesRulesetsBlockRuleJSON struct {
+// blockRuleJSON contains the JSON metadata for the struct [BlockRule]
+type blockRuleJSON struct {
LastUpdated apijson.Field
Version apijson.Field
ID apijson.Field
@@ -394,70 +200,68 @@ type rulesetNewResponseRulesRulesetsBlockRuleJSON struct {
ExtraFields map[string]apijson.Field
}
-func (r *RulesetNewResponseRulesRulesetsBlockRule) UnmarshalJSON(data []byte) (err error) {
+func (r *BlockRule) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
-func (r rulesetNewResponseRulesRulesetsBlockRuleJSON) RawJSON() string {
+func (r blockRuleJSON) RawJSON() string {
return r.raw
}
-func (r RulesetNewResponseRulesRulesetsBlockRule) implementsRulesetsRulesetNewResponseRule() {}
+func (r BlockRule) implementsRulesetsRequestRule() {}
// The action to perform when the rule matches.
-type RulesetNewResponseRulesRulesetsBlockRuleAction string
+type BlockRuleAction string
const (
- RulesetNewResponseRulesRulesetsBlockRuleActionBlock RulesetNewResponseRulesRulesetsBlockRuleAction = "block"
+ BlockRuleActionBlock BlockRuleAction = "block"
)
-func (r RulesetNewResponseRulesRulesetsBlockRuleAction) IsKnown() bool {
+func (r BlockRuleAction) IsKnown() bool {
switch r {
- case RulesetNewResponseRulesRulesetsBlockRuleActionBlock:
+ case BlockRuleActionBlock:
return true
}
return false
}
// The parameters configuring the rule's action.
-type RulesetNewResponseRulesRulesetsBlockRuleActionParameters struct {
+type BlockRuleActionParameters struct {
// The response to show when the block is applied.
- Response RulesetNewResponseRulesRulesetsBlockRuleActionParametersResponse `json:"response"`
- JSON rulesetNewResponseRulesRulesetsBlockRuleActionParametersJSON `json:"-"`
+ Response BlockRuleActionParametersResponse `json:"response"`
+ JSON blockRuleActionParametersJSON `json:"-"`
}
-// rulesetNewResponseRulesRulesetsBlockRuleActionParametersJSON contains the JSON
-// metadata for the struct
-// [RulesetNewResponseRulesRulesetsBlockRuleActionParameters]
-type rulesetNewResponseRulesRulesetsBlockRuleActionParametersJSON struct {
+// blockRuleActionParametersJSON contains the JSON metadata for the struct
+// [BlockRuleActionParameters]
+type blockRuleActionParametersJSON struct {
Response apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
-func (r *RulesetNewResponseRulesRulesetsBlockRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
+func (r *BlockRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
-func (r rulesetNewResponseRulesRulesetsBlockRuleActionParametersJSON) RawJSON() string {
+func (r blockRuleActionParametersJSON) RawJSON() string {
return r.raw
}
// The response to show when the block is applied.
-type RulesetNewResponseRulesRulesetsBlockRuleActionParametersResponse struct {
+type BlockRuleActionParametersResponse struct {
// The content to return.
Content string `json:"content,required"`
// The type of the content to return.
ContentType string `json:"content_type,required"`
// The status code to return.
- StatusCode int64 `json:"status_code,required"`
- JSON rulesetNewResponseRulesRulesetsBlockRuleActionParametersResponseJSON `json:"-"`
+ StatusCode int64 `json:"status_code,required"`
+ JSON blockRuleActionParametersResponseJSON `json:"-"`
}
-// rulesetNewResponseRulesRulesetsBlockRuleActionParametersResponseJSON contains
-// the JSON metadata for the struct
-// [RulesetNewResponseRulesRulesetsBlockRuleActionParametersResponse]
-type rulesetNewResponseRulesRulesetsBlockRuleActionParametersResponseJSON struct {
+// blockRuleActionParametersResponseJSON contains the JSON metadata for the struct
+// [BlockRuleActionParametersResponse]
+type blockRuleActionParametersResponseJSON struct {
Content apijson.Field
ContentType apijson.Field
StatusCode apijson.Field
@@ -465,15 +269,114 @@ type rulesetNewResponseRulesRulesetsBlockRuleActionParametersResponseJSON struct
ExtraFields map[string]apijson.Field
}
-func (r *RulesetNewResponseRulesRulesetsBlockRuleActionParametersResponse) UnmarshalJSON(data []byte) (err error) {
+func (r *BlockRuleActionParametersResponse) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
-func (r rulesetNewResponseRulesRulesetsBlockRuleActionParametersResponseJSON) RawJSON() string {
+func (r blockRuleActionParametersResponseJSON) RawJSON() string {
return r.raw
}
-type RulesetNewResponseRulesRulesetsExecuteRule struct {
+type BlockRuleParam struct {
+ // The unique ID of the rule.
+ ID param.Field[string] `json:"id"`
+ // The action to perform when the rule matches.
+ Action param.Field[BlockRuleAction] `json:"action"`
+ // The parameters configuring the rule's action.
+ ActionParameters param.Field[BlockRuleActionParametersParam] `json:"action_parameters"`
+ // An informative description of the rule.
+ Description param.Field[string] `json:"description"`
+ // Whether the rule should be executed.
+ Enabled param.Field[bool] `json:"enabled"`
+ // The expression defining which traffic will match the rule.
+ Expression param.Field[string] `json:"expression"`
+ // An object configuring the rule's logging behavior.
+ Logging param.Field[shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751cParam] `json:"logging"`
+ // The reference of the rule (the rule ID by default).
+ Ref param.Field[string] `json:"ref"`
+}
+
+func (r BlockRuleParam) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+func (r BlockRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r BlockRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r BlockRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r BlockRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r BlockRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r BlockRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r BlockRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r BlockRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r BlockRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r BlockRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r BlockRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r BlockRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r BlockRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r BlockRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r BlockRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r BlockRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r BlockRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r BlockRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r BlockRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r BlockRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r BlockRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r BlockRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r BlockRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r BlockRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r BlockRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r BlockRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+// The parameters configuring the rule's action.
+type BlockRuleActionParametersParam struct {
+ // The response to show when the block is applied.
+ Response param.Field[BlockRuleActionParametersResponseParam] `json:"response"`
+}
+
+func (r BlockRuleActionParametersParam) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The response to show when the block is applied.
+type BlockRuleActionParametersResponseParam struct {
+ // The content to return.
+ Content param.Field[string] `json:"content,required"`
+ // The type of the content to return.
+ ContentType param.Field[string] `json:"content_type,required"`
+ // The status code to return.
+ StatusCode param.Field[int64] `json:"status_code,required"`
+}
+
+func (r BlockRuleActionParametersResponseParam) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type ExecuteRule struct {
// The timestamp of when the rule was last modified.
LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
// The version of the rule.
@@ -481,9 +384,9 @@ type RulesetNewResponseRulesRulesetsExecuteRule struct {
// The unique ID of the rule.
ID string `json:"id"`
// The action to perform when the rule matches.
- Action RulesetNewResponseRulesRulesetsExecuteRuleAction `json:"action"`
+ Action ExecuteRuleAction `json:"action"`
// The parameters configuring the rule's action.
- ActionParameters RulesetNewResponseRulesRulesetsExecuteRuleActionParameters `json:"action_parameters"`
+ ActionParameters ExecuteRuleActionParameters `json:"action_parameters"`
// The categories of the rule.
Categories []string `json:"categories"`
// An informative description of the rule.
@@ -495,13 +398,12 @@ type RulesetNewResponseRulesRulesetsExecuteRule struct {
// An object configuring the rule's logging behavior.
Logging shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c `json:"logging"`
// The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON rulesetNewResponseRulesRulesetsExecuteRuleJSON `json:"-"`
+ Ref string `json:"ref"`
+ JSON executeRuleJSON `json:"-"`
}
-// rulesetNewResponseRulesRulesetsExecuteRuleJSON contains the JSON metadata for
-// the struct [RulesetNewResponseRulesRulesetsExecuteRule]
-type rulesetNewResponseRulesRulesetsExecuteRuleJSON struct {
+// executeRuleJSON contains the JSON metadata for the struct [ExecuteRule]
+type executeRuleJSON struct {
LastUpdated apijson.Field
Version apijson.Field
ID apijson.Field
@@ -517,46 +419,45 @@ type rulesetNewResponseRulesRulesetsExecuteRuleJSON struct {
ExtraFields map[string]apijson.Field
}
-func (r *RulesetNewResponseRulesRulesetsExecuteRule) UnmarshalJSON(data []byte) (err error) {
+func (r *ExecuteRule) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
-func (r rulesetNewResponseRulesRulesetsExecuteRuleJSON) RawJSON() string {
+func (r executeRuleJSON) RawJSON() string {
return r.raw
}
-func (r RulesetNewResponseRulesRulesetsExecuteRule) implementsRulesetsRulesetNewResponseRule() {}
+func (r ExecuteRule) implementsRulesetsRequestRule() {}
// The action to perform when the rule matches.
-type RulesetNewResponseRulesRulesetsExecuteRuleAction string
+type ExecuteRuleAction string
const (
- RulesetNewResponseRulesRulesetsExecuteRuleActionExecute RulesetNewResponseRulesRulesetsExecuteRuleAction = "execute"
+ ExecuteRuleActionExecute ExecuteRuleAction = "execute"
)
-func (r RulesetNewResponseRulesRulesetsExecuteRuleAction) IsKnown() bool {
+func (r ExecuteRuleAction) IsKnown() bool {
switch r {
- case RulesetNewResponseRulesRulesetsExecuteRuleActionExecute:
+ case ExecuteRuleActionExecute:
return true
}
return false
}
// The parameters configuring the rule's action.
-type RulesetNewResponseRulesRulesetsExecuteRuleActionParameters struct {
+type ExecuteRuleActionParameters struct {
// The ID of the ruleset to execute.
ID string `json:"id,required"`
// The configuration to use for matched data logging.
- MatchedData RulesetNewResponseRulesRulesetsExecuteRuleActionParametersMatchedData `json:"matched_data"`
+ MatchedData ExecuteRuleActionParametersMatchedData `json:"matched_data"`
// A set of overrides to apply to the target ruleset.
- Overrides RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverrides `json:"overrides"`
- JSON rulesetNewResponseRulesRulesetsExecuteRuleActionParametersJSON `json:"-"`
+ Overrides ExecuteRuleActionParametersOverrides `json:"overrides"`
+ JSON executeRuleActionParametersJSON `json:"-"`
}
-// rulesetNewResponseRulesRulesetsExecuteRuleActionParametersJSON contains the JSON
-// metadata for the struct
-// [RulesetNewResponseRulesRulesetsExecuteRuleActionParameters]
-type rulesetNewResponseRulesRulesetsExecuteRuleActionParametersJSON struct {
+// executeRuleActionParametersJSON contains the JSON metadata for the struct
+// [ExecuteRuleActionParameters]
+type executeRuleActionParametersJSON struct {
ID apijson.Field
MatchedData apijson.Field
Overrides apijson.Field
@@ -564,61 +465,59 @@ type rulesetNewResponseRulesRulesetsExecuteRuleActionParametersJSON struct {
ExtraFields map[string]apijson.Field
}
-func (r *RulesetNewResponseRulesRulesetsExecuteRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
+func (r *ExecuteRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
-func (r rulesetNewResponseRulesRulesetsExecuteRuleActionParametersJSON) RawJSON() string {
+func (r executeRuleActionParametersJSON) RawJSON() string {
return r.raw
}
// The configuration to use for matched data logging.
-type RulesetNewResponseRulesRulesetsExecuteRuleActionParametersMatchedData struct {
+type ExecuteRuleActionParametersMatchedData struct {
// The public key to encrypt matched data logs with.
- PublicKey string `json:"public_key,required"`
- JSON rulesetNewResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON `json:"-"`
+ PublicKey string `json:"public_key,required"`
+ JSON executeRuleActionParametersMatchedDataJSON `json:"-"`
}
-// rulesetNewResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON
-// contains the JSON metadata for the struct
-// [RulesetNewResponseRulesRulesetsExecuteRuleActionParametersMatchedData]
-type rulesetNewResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON struct {
+// executeRuleActionParametersMatchedDataJSON contains the JSON metadata for the
+// struct [ExecuteRuleActionParametersMatchedData]
+type executeRuleActionParametersMatchedDataJSON struct {
PublicKey apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
-func (r *RulesetNewResponseRulesRulesetsExecuteRuleActionParametersMatchedData) UnmarshalJSON(data []byte) (err error) {
+func (r *ExecuteRuleActionParametersMatchedData) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
-func (r rulesetNewResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON) RawJSON() string {
+func (r executeRuleActionParametersMatchedDataJSON) RawJSON() string {
return r.raw
}
// A set of overrides to apply to the target ruleset.
-type RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverrides struct {
+type ExecuteRuleActionParametersOverrides struct {
// An action to override all rules with. This option has lower precedence than rule
// and category overrides.
Action string `json:"action"`
// A list of category-level overrides. This option has the second-highest
// precedence after rule-level overrides.
- Categories []RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory `json:"categories"`
+ Categories []ExecuteRuleActionParametersOverridesCategory `json:"categories"`
// Whether to enable execution of all rules. This option has lower precedence than
// rule and category overrides.
Enabled bool `json:"enabled"`
// A list of rule-level overrides. This option has the highest precedence.
- Rules []RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRule `json:"rules"`
+ Rules []ExecuteRuleActionParametersOverridesRule `json:"rules"`
// A sensitivity level to set for all rules. This option has lower precedence than
// rule and category overrides and is only applicable for DDoS phases.
- SensitivityLevel RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel `json:"sensitivity_level"`
- JSON rulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON `json:"-"`
+ SensitivityLevel ExecuteRuleActionParametersOverridesSensitivityLevel `json:"sensitivity_level"`
+ JSON executeRuleActionParametersOverridesJSON `json:"-"`
}
-// rulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON contains
-// the JSON metadata for the struct
-// [RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverrides]
-type rulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON struct {
+// executeRuleActionParametersOverridesJSON contains the JSON metadata for the
+// struct [ExecuteRuleActionParametersOverrides]
+type executeRuleActionParametersOverridesJSON struct {
Action apijson.Field
Categories apijson.Field
Enabled apijson.Field
@@ -628,16 +527,16 @@ type rulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON str
ExtraFields map[string]apijson.Field
}
-func (r *RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverrides) UnmarshalJSON(data []byte) (err error) {
+func (r *ExecuteRuleActionParametersOverrides) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
-func (r rulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON) RawJSON() string {
+func (r executeRuleActionParametersOverridesJSON) RawJSON() string {
return r.raw
}
// A category-level override
-type RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory struct {
+type ExecuteRuleActionParametersOverridesCategory struct {
// The name of the category to override.
Category string `json:"category,required"`
// The action to override rules in the category with.
@@ -645,14 +544,13 @@ type RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory
// Whether to enable execution of rules in the category.
Enabled bool `json:"enabled"`
// The sensitivity level to use for rules in the category.
- SensitivityLevel RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel `json:"sensitivity_level"`
- JSON rulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON `json:"-"`
+ SensitivityLevel ExecuteRuleActionParametersOverridesCategoriesSensitivityLevel `json:"sensitivity_level"`
+ JSON executeRuleActionParametersOverridesCategoryJSON `json:"-"`
}
-// rulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON
-// contains the JSON metadata for the struct
-// [RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory]
-type rulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON struct {
+// executeRuleActionParametersOverridesCategoryJSON contains the JSON metadata for
+// the struct [ExecuteRuleActionParametersOverridesCategory]
+type executeRuleActionParametersOverridesCategoryJSON struct {
Category apijson.Field
Action apijson.Field
Enabled apijson.Field
@@ -661,34 +559,34 @@ type rulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory
ExtraFields map[string]apijson.Field
}
-func (r *RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory) UnmarshalJSON(data []byte) (err error) {
+func (r *ExecuteRuleActionParametersOverridesCategory) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
-func (r rulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON) RawJSON() string {
+func (r executeRuleActionParametersOverridesCategoryJSON) RawJSON() string {
return r.raw
}
// The sensitivity level to use for rules in the category.
-type RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel string
+type ExecuteRuleActionParametersOverridesCategoriesSensitivityLevel string
const (
- RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "default"
- RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "medium"
- RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "low"
- RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "eoff"
+ ExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault ExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "default"
+ ExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium ExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "medium"
+ ExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow ExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "low"
+ ExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff ExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "eoff"
)
-func (r RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel) IsKnown() bool {
+func (r ExecuteRuleActionParametersOverridesCategoriesSensitivityLevel) IsKnown() bool {
switch r {
- case RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault, RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium, RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow, RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff:
+ case ExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault, ExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium, ExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow, ExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff:
return true
}
return false
}
// A rule-level override
-type RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRule struct {
+type ExecuteRuleActionParametersOverridesRule struct {
// The ID of the rule to override.
ID string `json:"id,required"`
// The action to override the rule with.
@@ -698,14 +596,13 @@ type RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRule str
// The score threshold to use for the rule.
ScoreThreshold int64 `json:"score_threshold"`
// The sensitivity level to use for the rule.
- SensitivityLevel RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel `json:"sensitivity_level"`
- JSON rulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON `json:"-"`
+ SensitivityLevel ExecuteRuleActionParametersOverridesRulesSensitivityLevel `json:"sensitivity_level"`
+ JSON executeRuleActionParametersOverridesRuleJSON `json:"-"`
}
-// rulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON
-// contains the JSON metadata for the struct
-// [RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRule]
-type rulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON struct {
+// executeRuleActionParametersOverridesRuleJSON contains the JSON metadata for the
+// struct [ExecuteRuleActionParametersOverridesRule]
+type executeRuleActionParametersOverridesRuleJSON struct {
ID apijson.Field
Action apijson.Field
Enabled apijson.Field
@@ -715,27 +612,27 @@ type rulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON
ExtraFields map[string]apijson.Field
}
-func (r *RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRule) UnmarshalJSON(data []byte) (err error) {
+func (r *ExecuteRuleActionParametersOverridesRule) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
-func (r rulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON) RawJSON() string {
+func (r executeRuleActionParametersOverridesRuleJSON) RawJSON() string {
return r.raw
}
// The sensitivity level to use for the rule.
-type RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel string
+type ExecuteRuleActionParametersOverridesRulesSensitivityLevel string
const (
- RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "default"
- RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "medium"
- RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "low"
- RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "eoff"
+ ExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault ExecuteRuleActionParametersOverridesRulesSensitivityLevel = "default"
+ ExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium ExecuteRuleActionParametersOverridesRulesSensitivityLevel = "medium"
+ ExecuteRuleActionParametersOverridesRulesSensitivityLevelLow ExecuteRuleActionParametersOverridesRulesSensitivityLevel = "low"
+ ExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff ExecuteRuleActionParametersOverridesRulesSensitivityLevel = "eoff"
)
-func (r RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel) IsKnown() bool {
+func (r ExecuteRuleActionParametersOverridesRulesSensitivityLevel) IsKnown() bool {
switch r {
- case RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault, RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium, RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow, RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff:
+ case ExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault, ExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium, ExecuteRuleActionParametersOverridesRulesSensitivityLevelLow, ExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff:
return true
}
return false
@@ -743,93 +640,179 @@ func (r RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRules
// A sensitivity level to set for all rules. This option has lower precedence than
// rule and category overrides and is only applicable for DDoS phases.
-type RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel string
+type ExecuteRuleActionParametersOverridesSensitivityLevel string
const (
- RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "default"
- RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "medium"
- RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "low"
- RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "eoff"
+ ExecuteRuleActionParametersOverridesSensitivityLevelDefault ExecuteRuleActionParametersOverridesSensitivityLevel = "default"
+ ExecuteRuleActionParametersOverridesSensitivityLevelMedium ExecuteRuleActionParametersOverridesSensitivityLevel = "medium"
+ ExecuteRuleActionParametersOverridesSensitivityLevelLow ExecuteRuleActionParametersOverridesSensitivityLevel = "low"
+ ExecuteRuleActionParametersOverridesSensitivityLevelEoff ExecuteRuleActionParametersOverridesSensitivityLevel = "eoff"
)
-func (r RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel) IsKnown() bool {
+func (r ExecuteRuleActionParametersOverridesSensitivityLevel) IsKnown() bool {
switch r {
- case RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault, RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium, RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow, RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff:
+ case ExecuteRuleActionParametersOverridesSensitivityLevelDefault, ExecuteRuleActionParametersOverridesSensitivityLevelMedium, ExecuteRuleActionParametersOverridesSensitivityLevelLow, ExecuteRuleActionParametersOverridesSensitivityLevelEoff:
return true
}
return false
}
-type RulesetNewResponseRulesRulesetsLogRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
+type ExecuteRuleParam struct {
// The unique ID of the rule.
- ID string `json:"id"`
+ ID param.Field[string] `json:"id"`
// The action to perform when the rule matches.
- Action RulesetNewResponseRulesRulesetsLogRuleAction `json:"action"`
+ Action param.Field[ExecuteRuleAction] `json:"action"`
// The parameters configuring the rule's action.
- ActionParameters interface{} `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
+ ActionParameters param.Field[ExecuteRuleActionParametersParam] `json:"action_parameters"`
// An informative description of the rule.
- Description string `json:"description"`
+ Description param.Field[string] `json:"description"`
// Whether the rule should be executed.
- Enabled bool `json:"enabled"`
+ Enabled param.Field[bool] `json:"enabled"`
// The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
+ Expression param.Field[string] `json:"expression"`
// An object configuring the rule's logging behavior.
- Logging shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c `json:"logging"`
+ Logging param.Field[shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751cParam] `json:"logging"`
// The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON rulesetNewResponseRulesRulesetsLogRuleJSON `json:"-"`
+ Ref param.Field[string] `json:"ref"`
}
-// rulesetNewResponseRulesRulesetsLogRuleJSON contains the JSON metadata for the
-// struct [RulesetNewResponseRulesRulesetsLogRule]
-type rulesetNewResponseRulesRulesetsLogRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
+func (r ExecuteRuleParam) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
}
-func (r *RulesetNewResponseRulesRulesetsLogRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
+func (r ExecuteRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r ExecuteRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r ExecuteRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r ExecuteRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r ExecuteRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r ExecuteRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r ExecuteRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r ExecuteRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r ExecuteRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r ExecuteRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r ExecuteRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r ExecuteRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r ExecuteRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r ExecuteRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r ExecuteRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r ExecuteRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r ExecuteRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r ExecuteRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r ExecuteRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r ExecuteRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r ExecuteRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r ExecuteRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r ExecuteRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r ExecuteRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r ExecuteRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r ExecuteRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+// The parameters configuring the rule's action.
+type ExecuteRuleActionParametersParam struct {
+ // The ID of the ruleset to execute.
+ ID param.Field[string] `json:"id,required"`
+ // The configuration to use for matched data logging.
+ MatchedData param.Field[ExecuteRuleActionParametersMatchedDataParam] `json:"matched_data"`
+ // A set of overrides to apply to the target ruleset.
+ Overrides param.Field[ExecuteRuleActionParametersOverridesParam] `json:"overrides"`
}
-func (r rulesetNewResponseRulesRulesetsLogRuleJSON) RawJSON() string {
- return r.raw
+func (r ExecuteRuleActionParametersParam) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
}
-func (r RulesetNewResponseRulesRulesetsLogRule) implementsRulesetsRulesetNewResponseRule() {}
+// The configuration to use for matched data logging.
+type ExecuteRuleActionParametersMatchedDataParam struct {
+ // The public key to encrypt matched data logs with.
+ PublicKey param.Field[string] `json:"public_key,required"`
+}
-// The action to perform when the rule matches.
-type RulesetNewResponseRulesRulesetsLogRuleAction string
+func (r ExecuteRuleActionParametersMatchedDataParam) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
-const (
- RulesetNewResponseRulesRulesetsLogRuleActionLog RulesetNewResponseRulesRulesetsLogRuleAction = "log"
-)
+// A set of overrides to apply to the target ruleset.
+type ExecuteRuleActionParametersOverridesParam struct {
+ // An action to override all rules with. This option has lower precedence than rule
+ // and category overrides.
+ Action param.Field[string] `json:"action"`
+ // A list of category-level overrides. This option has the second-highest
+ // precedence after rule-level overrides.
+ Categories param.Field[[]ExecuteRuleActionParametersOverridesCategoryParam] `json:"categories"`
+ // Whether to enable execution of all rules. This option has lower precedence than
+ // rule and category overrides.
+ Enabled param.Field[bool] `json:"enabled"`
+ // A list of rule-level overrides. This option has the highest precedence.
+ Rules param.Field[[]ExecuteRuleActionParametersOverridesRuleParam] `json:"rules"`
+ // A sensitivity level to set for all rules. This option has lower precedence than
+ // rule and category overrides and is only applicable for DDoS phases.
+ SensitivityLevel param.Field[ExecuteRuleActionParametersOverridesSensitivityLevel] `json:"sensitivity_level"`
+}
-func (r RulesetNewResponseRulesRulesetsLogRuleAction) IsKnown() bool {
- switch r {
- case RulesetNewResponseRulesRulesetsLogRuleActionLog:
- return true
- }
- return false
+func (r ExecuteRuleActionParametersOverridesParam) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// A category-level override
+type ExecuteRuleActionParametersOverridesCategoryParam struct {
+ // The name of the category to override.
+ Category param.Field[string] `json:"category,required"`
+ // The action to override rules in the category with.
+ Action param.Field[string] `json:"action"`
+ // Whether to enable execution of rules in the category.
+ Enabled param.Field[bool] `json:"enabled"`
+ // The sensitivity level to use for rules in the category.
+ SensitivityLevel param.Field[ExecuteRuleActionParametersOverridesCategoriesSensitivityLevel] `json:"sensitivity_level"`
+}
+
+func (r ExecuteRuleActionParametersOverridesCategoryParam) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// A rule-level override
+type ExecuteRuleActionParametersOverridesRuleParam struct {
+ // The ID of the rule to override.
+ ID param.Field[string] `json:"id,required"`
+ // The action to override the rule with.
+ Action param.Field[string] `json:"action"`
+ // Whether to enable execution of the rule.
+ Enabled param.Field[bool] `json:"enabled"`
+ // The score threshold to use for the rule.
+ ScoreThreshold param.Field[int64] `json:"score_threshold"`
+ // The sensitivity level to use for the rule.
+ SensitivityLevel param.Field[ExecuteRuleActionParametersOverridesRulesSensitivityLevel] `json:"sensitivity_level"`
+}
+
+func (r ExecuteRuleActionParametersOverridesRuleParam) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
}
-type RulesetNewResponseRulesRulesetsSkipRule struct {
+type LogRule struct {
// The timestamp of when the rule was last modified.
LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
// The version of the rule.
@@ -837,9 +820,9 @@ type RulesetNewResponseRulesRulesetsSkipRule struct {
// The unique ID of the rule.
ID string `json:"id"`
// The action to perform when the rule matches.
- Action RulesetNewResponseRulesRulesetsSkipRuleAction `json:"action"`
+ Action LogRuleAction `json:"action"`
// The parameters configuring the rule's action.
- ActionParameters RulesetNewResponseRulesRulesetsSkipRuleActionParameters `json:"action_parameters"`
+ ActionParameters interface{} `json:"action_parameters"`
// The categories of the rule.
Categories []string `json:"categories"`
// An informative description of the rule.
@@ -851,13 +834,12 @@ type RulesetNewResponseRulesRulesetsSkipRule struct {
// An object configuring the rule's logging behavior.
Logging shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c `json:"logging"`
// The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON rulesetNewResponseRulesRulesetsSkipRuleJSON `json:"-"`
+ Ref string `json:"ref"`
+ JSON logRuleJSON `json:"-"`
}
-// rulesetNewResponseRulesRulesetsSkipRuleJSON contains the JSON metadata for the
-// struct [RulesetNewResponseRulesRulesetsSkipRule]
-type rulesetNewResponseRulesRulesetsSkipRuleJSON struct {
+// logRuleJSON contains the JSON metadata for the struct [LogRule]
+type logRuleJSON struct {
LastUpdated apijson.Field
Version apijson.Field
ID apijson.Field
@@ -873,357 +855,342 @@ type rulesetNewResponseRulesRulesetsSkipRuleJSON struct {
ExtraFields map[string]apijson.Field
}
-func (r *RulesetNewResponseRulesRulesetsSkipRule) UnmarshalJSON(data []byte) (err error) {
+func (r *LogRule) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
-func (r rulesetNewResponseRulesRulesetsSkipRuleJSON) RawJSON() string {
+func (r logRuleJSON) RawJSON() string {
return r.raw
}
-func (r RulesetNewResponseRulesRulesetsSkipRule) implementsRulesetsRulesetNewResponseRule() {}
+func (r LogRule) implementsRulesetsRequestRule() {}
// The action to perform when the rule matches.
-type RulesetNewResponseRulesRulesetsSkipRuleAction string
+type LogRuleAction string
const (
- RulesetNewResponseRulesRulesetsSkipRuleActionSkip RulesetNewResponseRulesRulesetsSkipRuleAction = "skip"
+ LogRuleActionLog LogRuleAction = "log"
)
-func (r RulesetNewResponseRulesRulesetsSkipRuleAction) IsKnown() bool {
+func (r LogRuleAction) IsKnown() bool {
switch r {
- case RulesetNewResponseRulesRulesetsSkipRuleActionSkip:
+ case LogRuleActionLog:
return true
}
return false
}
-// The parameters configuring the rule's action.
-type RulesetNewResponseRulesRulesetsSkipRuleActionParameters struct {
- // A list of phases to skip the execution of. This option is incompatible with the
- // ruleset and rulesets options.
- Phases []RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhase `json:"phases"`
- // A list of legacy security products to skip the execution of.
- Products []RulesetNewResponseRulesRulesetsSkipRuleActionParametersProduct `json:"products"`
- // A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the
- // execution of. This option is incompatible with the ruleset option.
- Rules map[string][]string `json:"rules"`
- // A ruleset to skip the execution of. This option is incompatible with the
- // rulesets, rules and phases options.
- Ruleset RulesetNewResponseRulesRulesetsSkipRuleActionParametersRuleset `json:"ruleset"`
- // A list of ruleset IDs to skip the execution of. This option is incompatible with
- // the ruleset and phases options.
- Rulesets []string `json:"rulesets"`
- JSON rulesetNewResponseRulesRulesetsSkipRuleActionParametersJSON `json:"-"`
+type LogRuleParam struct {
+ // The unique ID of the rule.
+ ID param.Field[string] `json:"id"`
+ // The action to perform when the rule matches.
+ Action param.Field[LogRuleAction] `json:"action"`
+ // The parameters configuring the rule's action.
+ ActionParameters param.Field[interface{}] `json:"action_parameters"`
+ // An informative description of the rule.
+ Description param.Field[string] `json:"description"`
+ // Whether the rule should be executed.
+ Enabled param.Field[bool] `json:"enabled"`
+ // The expression defining which traffic will match the rule.
+ Expression param.Field[string] `json:"expression"`
+ // An object configuring the rule's logging behavior.
+ Logging param.Field[shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751cParam] `json:"logging"`
+ // The reference of the rule (the rule ID by default).
+ Ref param.Field[string] `json:"ref"`
}
-// rulesetNewResponseRulesRulesetsSkipRuleActionParametersJSON contains the JSON
-// metadata for the struct
-// [RulesetNewResponseRulesRulesetsSkipRuleActionParameters]
-type rulesetNewResponseRulesRulesetsSkipRuleActionParametersJSON struct {
- Phases apijson.Field
- Products apijson.Field
- Rules apijson.Field
- Ruleset apijson.Field
- Rulesets apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
+func (r LogRuleParam) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
}
-func (r *RulesetNewResponseRulesRulesetsSkipRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
+func (r LogRuleParam) implementsRulesetsRequestRuleUnionParam() {}
-func (r rulesetNewResponseRulesRulesetsSkipRuleActionParametersJSON) RawJSON() string {
- return r.raw
-}
+func (r LogRuleParam) implementsRulesetsRequestRuleUnionParam() {}
-// A phase to skip the execution of.
-type RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhase string
+func (r LogRuleParam) implementsRulesetsRequestRuleUnionParam() {}
-const (
- RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseDDoSL4 RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l4"
- RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseDDoSL7 RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l7"
- RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_config_settings"
- RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_custom_errors"
- RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_log_custom_fields"
- RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRatelimit RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_ratelimit"
- RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_cache_settings"
- RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_dynamic_redirect"
- RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_custom"
- RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_managed"
- RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_late_transform"
- RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_origin"
- RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_redirect"
- RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sanitize"
- RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sbfm"
- RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_select_configuration"
- RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_transform"
- RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_compression"
- RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_firewall_managed"
- RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_headers_transform"
- RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransit RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit"
- RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_ids_managed"
- RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitManaged RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_managed"
-)
+func (r LogRuleParam) implementsRulesetsRequestRuleUnionParam() {}
-func (r RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhase) IsKnown() bool {
- switch r {
- case RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseDDoSL4, RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseDDoSL7, RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings, RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors, RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields, RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRatelimit, RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings, RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect, RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom, RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged, RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform, RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin, RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect, RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize, RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm, RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration, RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform, RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression, RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged, RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform, RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransit, RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged, RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitManaged:
- return true
- }
- return false
+func (r LogRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r LogRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r LogRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r LogRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r LogRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r LogRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r LogRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r LogRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r LogRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r LogRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r LogRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r LogRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r LogRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r LogRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r LogRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r LogRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r LogRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r LogRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r LogRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r LogRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r LogRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r LogRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+type RequestRule struct {
+ // The action to perform when the rule matches.
+ Action RequestRuleAction `json:"action"`
+ ActionParameters interface{} `json:"action_parameters,required"`
+ Categories interface{} `json:"categories,required"`
+ // An informative description of the rule.
+ Description string `json:"description"`
+ // Whether the rule should be executed.
+ Enabled bool `json:"enabled"`
+ // The expression defining which traffic will match the rule.
+ Expression string `json:"expression"`
+ // The unique ID of the rule.
+ ID string `json:"id"`
+ // The timestamp of when the rule was last modified.
+ LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
+ // An object configuring the rule's logging behavior.
+ Logging shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c `json:"logging"`
+ // The reference of the rule (the rule ID by default).
+ Ref string `json:"ref"`
+ // The version of the rule.
+ Version string `json:"version,required"`
+ JSON requestRuleJSON `json:"-"`
+ union RequestRuleUnion
}
-// The name of a legacy security product to skip the execution of.
-type RulesetNewResponseRulesRulesetsSkipRuleActionParametersProduct string
+// requestRuleJSON contains the JSON metadata for the struct [RequestRule]
+type requestRuleJSON struct {
+ Action apijson.Field
+ ActionParameters apijson.Field
+ Categories apijson.Field
+ Description apijson.Field
+ Enabled apijson.Field
+ Expression apijson.Field
+ ID apijson.Field
+ LastUpdated apijson.Field
+ Logging apijson.Field
+ Ref apijson.Field
+ Version apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
-const (
- RulesetNewResponseRulesRulesetsSkipRuleActionParametersProductBic RulesetNewResponseRulesRulesetsSkipRuleActionParametersProduct = "bic"
- RulesetNewResponseRulesRulesetsSkipRuleActionParametersProductHot RulesetNewResponseRulesRulesetsSkipRuleActionParametersProduct = "hot"
- RulesetNewResponseRulesRulesetsSkipRuleActionParametersProductRateLimit RulesetNewResponseRulesRulesetsSkipRuleActionParametersProduct = "rateLimit"
- RulesetNewResponseRulesRulesetsSkipRuleActionParametersProductSecurityLevel RulesetNewResponseRulesRulesetsSkipRuleActionParametersProduct = "securityLevel"
- RulesetNewResponseRulesRulesetsSkipRuleActionParametersProductUABlock RulesetNewResponseRulesRulesetsSkipRuleActionParametersProduct = "uaBlock"
- RulesetNewResponseRulesRulesetsSkipRuleActionParametersProductWAF RulesetNewResponseRulesRulesetsSkipRuleActionParametersProduct = "waf"
- RulesetNewResponseRulesRulesetsSkipRuleActionParametersProductZoneLockdown RulesetNewResponseRulesRulesetsSkipRuleActionParametersProduct = "zoneLockdown"
-)
+func (r requestRuleJSON) RawJSON() string {
+ return r.raw
+}
-func (r RulesetNewResponseRulesRulesetsSkipRuleActionParametersProduct) IsKnown() bool {
- switch r {
- case RulesetNewResponseRulesRulesetsSkipRuleActionParametersProductBic, RulesetNewResponseRulesRulesetsSkipRuleActionParametersProductHot, RulesetNewResponseRulesRulesetsSkipRuleActionParametersProductRateLimit, RulesetNewResponseRulesRulesetsSkipRuleActionParametersProductSecurityLevel, RulesetNewResponseRulesRulesetsSkipRuleActionParametersProductUABlock, RulesetNewResponseRulesRulesetsSkipRuleActionParametersProductWAF, RulesetNewResponseRulesRulesetsSkipRuleActionParametersProductZoneLockdown:
- return true
+func (r *RequestRule) UnmarshalJSON(data []byte) (err error) {
+ err = apijson.UnmarshalRoot(data, &r.union)
+ if err != nil {
+ return err
}
- return false
+ return apijson.Port(r.union, &r)
}
-// A ruleset to skip the execution of. This option is incompatible with the
-// rulesets, rules and phases options.
-type RulesetNewResponseRulesRulesetsSkipRuleActionParametersRuleset string
+func (r RequestRule) AsUnion() RequestRuleUnion {
+ return r.union
+}
-const (
- RulesetNewResponseRulesRulesetsSkipRuleActionParametersRulesetCurrent RulesetNewResponseRulesRulesetsSkipRuleActionParametersRuleset = "current"
-)
+// Union satisfied by [rulesets.BlockRule], [rulesets.ExecuteRule],
+// [rulesets.LogRule] or [rulesets.SkipRule].
+type RequestRuleUnion interface {
+ implementsRulesetsRequestRule()
+}
-func (r RulesetNewResponseRulesRulesetsSkipRuleActionParametersRuleset) IsKnown() bool {
- switch r {
- case RulesetNewResponseRulesRulesetsSkipRuleActionParametersRulesetCurrent:
- return true
- }
- return false
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RequestRuleUnion)(nil)).Elem(),
+ "action",
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(BlockRule{}),
+ DiscriminatorValue: "block",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(ExecuteRule{}),
+ DiscriminatorValue: "execute",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(LogRule{}),
+ DiscriminatorValue: "log",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(SkipRule{}),
+ DiscriminatorValue: "skip",
+ },
+ )
}
// The action to perform when the rule matches.
-type RulesetNewResponseRulesAction string
+type RequestRuleAction string
const (
- RulesetNewResponseRulesActionBlock RulesetNewResponseRulesAction = "block"
- RulesetNewResponseRulesActionExecute RulesetNewResponseRulesAction = "execute"
- RulesetNewResponseRulesActionLog RulesetNewResponseRulesAction = "log"
- RulesetNewResponseRulesActionSkip RulesetNewResponseRulesAction = "skip"
+ RequestRuleActionBlock RequestRuleAction = "block"
+ RequestRuleActionExecute RequestRuleAction = "execute"
+ RequestRuleActionLog RequestRuleAction = "log"
+ RequestRuleActionSkip RequestRuleAction = "skip"
)
-func (r RulesetNewResponseRulesAction) IsKnown() bool {
+func (r RequestRuleAction) IsKnown() bool {
switch r {
- case RulesetNewResponseRulesActionBlock, RulesetNewResponseRulesActionExecute, RulesetNewResponseRulesActionLog, RulesetNewResponseRulesActionSkip:
+ case RequestRuleActionBlock, RequestRuleActionExecute, RequestRuleActionLog, RequestRuleActionSkip:
return true
}
return false
}
-// A ruleset object.
-type RulesetUpdateResponse struct {
- // The unique ID of the ruleset.
- ID string `json:"id,required"`
- // The kind of the ruleset.
- Kind RulesetUpdateResponseKind `json:"kind,required"`
- // The timestamp of when the ruleset was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The human-readable name of the ruleset.
- Name string `json:"name,required"`
- // The phase of the ruleset.
- Phase RulesetUpdateResponsePhase `json:"phase,required"`
- // The list of rules in the ruleset.
- Rules []RulesetUpdateResponseRule `json:"rules,required"`
- // The version of the ruleset.
- Version string `json:"version,required"`
- // An informative description of the ruleset.
- Description string `json:"description"`
- JSON rulesetUpdateResponseJSON `json:"-"`
+type RequestRuleParam struct {
+ // The action to perform when the rule matches.
+ Action param.Field[RequestRuleAction] `json:"action"`
+ ActionParameters param.Field[interface{}] `json:"action_parameters,required"`
+ Categories param.Field[interface{}] `json:"categories,required"`
+ // An informative description of the rule.
+ Description param.Field[string] `json:"description"`
+ // Whether the rule should be executed.
+ Enabled param.Field[bool] `json:"enabled"`
+ // The expression defining which traffic will match the rule.
+ Expression param.Field[string] `json:"expression"`
+ // The unique ID of the rule.
+ ID param.Field[string] `json:"id"`
+ // An object configuring the rule's logging behavior.
+ Logging param.Field[shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751cParam] `json:"logging"`
+ // The reference of the rule (the rule ID by default).
+ Ref param.Field[string] `json:"ref"`
}
-// rulesetUpdateResponseJSON contains the JSON metadata for the struct
-// [RulesetUpdateResponse]
-type rulesetUpdateResponseJSON struct {
+func (r RequestRuleParam) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+func (r RequestRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+// Satisfied by [rulesets.BlockRuleParam], [rulesets.ExecuteRuleParam],
+// [rulesets.LogRuleParam], [rulesets.SkipRuleParam], [RequestRuleParam].
+type RequestRuleUnionParam interface {
+ implementsRulesetsRequestRuleUnionParam()
+}
+
+// A ruleset object.
+type Ruleset struct {
+ // The unique ID of the ruleset.
+ ID string `json:"id,required"`
+ // The timestamp of when the ruleset was last modified.
+ LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
+ // The version of the ruleset.
+ Version string `json:"version,required"`
+ // An informative description of the ruleset.
+ Description string `json:"description"`
+ // The kind of the ruleset.
+ Kind RulesetKind `json:"kind"`
+ // The human-readable name of the ruleset.
+ Name string `json:"name"`
+ // The phase of the ruleset.
+ Phase RulesetPhase `json:"phase"`
+ JSON rulesetJSON `json:"-"`
+}
+
+// rulesetJSON contains the JSON metadata for the struct [Ruleset]
+type rulesetJSON struct {
ID apijson.Field
- Kind apijson.Field
LastUpdated apijson.Field
- Name apijson.Field
- Phase apijson.Field
- Rules apijson.Field
Version apijson.Field
Description apijson.Field
+ Kind apijson.Field
+ Name apijson.Field
+ Phase apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
-func (r *RulesetUpdateResponse) UnmarshalJSON(data []byte) (err error) {
+func (r *Ruleset) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
-func (r rulesetUpdateResponseJSON) RawJSON() string {
+func (r rulesetJSON) RawJSON() string {
return r.raw
}
// The kind of the ruleset.
-type RulesetUpdateResponseKind string
+type RulesetKind string
const (
- RulesetUpdateResponseKindManaged RulesetUpdateResponseKind = "managed"
- RulesetUpdateResponseKindCustom RulesetUpdateResponseKind = "custom"
- RulesetUpdateResponseKindRoot RulesetUpdateResponseKind = "root"
- RulesetUpdateResponseKindZone RulesetUpdateResponseKind = "zone"
+ RulesetKindManaged RulesetKind = "managed"
+ RulesetKindCustom RulesetKind = "custom"
+ RulesetKindRoot RulesetKind = "root"
+ RulesetKindZone RulesetKind = "zone"
)
-func (r RulesetUpdateResponseKind) IsKnown() bool {
+func (r RulesetKind) IsKnown() bool {
switch r {
- case RulesetUpdateResponseKindManaged, RulesetUpdateResponseKindCustom, RulesetUpdateResponseKindRoot, RulesetUpdateResponseKindZone:
+ case RulesetKindManaged, RulesetKindCustom, RulesetKindRoot, RulesetKindZone:
return true
}
return false
}
// The phase of the ruleset.
-type RulesetUpdateResponsePhase string
+type RulesetPhase string
const (
- RulesetUpdateResponsePhaseDDoSL4 RulesetUpdateResponsePhase = "ddos_l4"
- RulesetUpdateResponsePhaseDDoSL7 RulesetUpdateResponsePhase = "ddos_l7"
- RulesetUpdateResponsePhaseHTTPConfigSettings RulesetUpdateResponsePhase = "http_config_settings"
- RulesetUpdateResponsePhaseHTTPCustomErrors RulesetUpdateResponsePhase = "http_custom_errors"
- RulesetUpdateResponsePhaseHTTPLogCustomFields RulesetUpdateResponsePhase = "http_log_custom_fields"
- RulesetUpdateResponsePhaseHTTPRatelimit RulesetUpdateResponsePhase = "http_ratelimit"
- RulesetUpdateResponsePhaseHTTPRequestCacheSettings RulesetUpdateResponsePhase = "http_request_cache_settings"
- RulesetUpdateResponsePhaseHTTPRequestDynamicRedirect RulesetUpdateResponsePhase = "http_request_dynamic_redirect"
- RulesetUpdateResponsePhaseHTTPRequestFirewallCustom RulesetUpdateResponsePhase = "http_request_firewall_custom"
- RulesetUpdateResponsePhaseHTTPRequestFirewallManaged RulesetUpdateResponsePhase = "http_request_firewall_managed"
- RulesetUpdateResponsePhaseHTTPRequestLateTransform RulesetUpdateResponsePhase = "http_request_late_transform"
- RulesetUpdateResponsePhaseHTTPRequestOrigin RulesetUpdateResponsePhase = "http_request_origin"
- RulesetUpdateResponsePhaseHTTPRequestRedirect RulesetUpdateResponsePhase = "http_request_redirect"
- RulesetUpdateResponsePhaseHTTPRequestSanitize RulesetUpdateResponsePhase = "http_request_sanitize"
- RulesetUpdateResponsePhaseHTTPRequestSbfm RulesetUpdateResponsePhase = "http_request_sbfm"
- RulesetUpdateResponsePhaseHTTPRequestSelectConfiguration RulesetUpdateResponsePhase = "http_request_select_configuration"
- RulesetUpdateResponsePhaseHTTPRequestTransform RulesetUpdateResponsePhase = "http_request_transform"
- RulesetUpdateResponsePhaseHTTPResponseCompression RulesetUpdateResponsePhase = "http_response_compression"
- RulesetUpdateResponsePhaseHTTPResponseFirewallManaged RulesetUpdateResponsePhase = "http_response_firewall_managed"
- RulesetUpdateResponsePhaseHTTPResponseHeadersTransform RulesetUpdateResponsePhase = "http_response_headers_transform"
- RulesetUpdateResponsePhaseMagicTransit RulesetUpdateResponsePhase = "magic_transit"
- RulesetUpdateResponsePhaseMagicTransitIDsManaged RulesetUpdateResponsePhase = "magic_transit_ids_managed"
- RulesetUpdateResponsePhaseMagicTransitManaged RulesetUpdateResponsePhase = "magic_transit_managed"
+ RulesetPhaseDDoSL4 RulesetPhase = "ddos_l4"
+ RulesetPhaseDDoSL7 RulesetPhase = "ddos_l7"
+ RulesetPhaseHTTPConfigSettings RulesetPhase = "http_config_settings"
+ RulesetPhaseHTTPCustomErrors RulesetPhase = "http_custom_errors"
+ RulesetPhaseHTTPLogCustomFields RulesetPhase = "http_log_custom_fields"
+ RulesetPhaseHTTPRatelimit RulesetPhase = "http_ratelimit"
+ RulesetPhaseHTTPRequestCacheSettings RulesetPhase = "http_request_cache_settings"
+ RulesetPhaseHTTPRequestDynamicRedirect RulesetPhase = "http_request_dynamic_redirect"
+ RulesetPhaseHTTPRequestFirewallCustom RulesetPhase = "http_request_firewall_custom"
+ RulesetPhaseHTTPRequestFirewallManaged RulesetPhase = "http_request_firewall_managed"
+ RulesetPhaseHTTPRequestLateTransform RulesetPhase = "http_request_late_transform"
+ RulesetPhaseHTTPRequestOrigin RulesetPhase = "http_request_origin"
+ RulesetPhaseHTTPRequestRedirect RulesetPhase = "http_request_redirect"
+ RulesetPhaseHTTPRequestSanitize RulesetPhase = "http_request_sanitize"
+ RulesetPhaseHTTPRequestSbfm RulesetPhase = "http_request_sbfm"
+ RulesetPhaseHTTPRequestSelectConfiguration RulesetPhase = "http_request_select_configuration"
+ RulesetPhaseHTTPRequestTransform RulesetPhase = "http_request_transform"
+ RulesetPhaseHTTPResponseCompression RulesetPhase = "http_response_compression"
+ RulesetPhaseHTTPResponseFirewallManaged RulesetPhase = "http_response_firewall_managed"
+ RulesetPhaseHTTPResponseHeadersTransform RulesetPhase = "http_response_headers_transform"
+ RulesetPhaseMagicTransit RulesetPhase = "magic_transit"
+ RulesetPhaseMagicTransitIDsManaged RulesetPhase = "magic_transit_ids_managed"
+ RulesetPhaseMagicTransitManaged RulesetPhase = "magic_transit_managed"
)
-func (r RulesetUpdateResponsePhase) IsKnown() bool {
+func (r RulesetPhase) IsKnown() bool {
switch r {
- case RulesetUpdateResponsePhaseDDoSL4, RulesetUpdateResponsePhaseDDoSL7, RulesetUpdateResponsePhaseHTTPConfigSettings, RulesetUpdateResponsePhaseHTTPCustomErrors, RulesetUpdateResponsePhaseHTTPLogCustomFields, RulesetUpdateResponsePhaseHTTPRatelimit, RulesetUpdateResponsePhaseHTTPRequestCacheSettings, RulesetUpdateResponsePhaseHTTPRequestDynamicRedirect, RulesetUpdateResponsePhaseHTTPRequestFirewallCustom, RulesetUpdateResponsePhaseHTTPRequestFirewallManaged, RulesetUpdateResponsePhaseHTTPRequestLateTransform, RulesetUpdateResponsePhaseHTTPRequestOrigin, RulesetUpdateResponsePhaseHTTPRequestRedirect, RulesetUpdateResponsePhaseHTTPRequestSanitize, RulesetUpdateResponsePhaseHTTPRequestSbfm, RulesetUpdateResponsePhaseHTTPRequestSelectConfiguration, RulesetUpdateResponsePhaseHTTPRequestTransform, RulesetUpdateResponsePhaseHTTPResponseCompression, RulesetUpdateResponsePhaseHTTPResponseFirewallManaged, RulesetUpdateResponsePhaseHTTPResponseHeadersTransform, RulesetUpdateResponsePhaseMagicTransit, RulesetUpdateResponsePhaseMagicTransitIDsManaged, RulesetUpdateResponsePhaseMagicTransitManaged:
+ case RulesetPhaseDDoSL4, RulesetPhaseDDoSL7, RulesetPhaseHTTPConfigSettings, RulesetPhaseHTTPCustomErrors, RulesetPhaseHTTPLogCustomFields, RulesetPhaseHTTPRatelimit, RulesetPhaseHTTPRequestCacheSettings, RulesetPhaseHTTPRequestDynamicRedirect, RulesetPhaseHTTPRequestFirewallCustom, RulesetPhaseHTTPRequestFirewallManaged, RulesetPhaseHTTPRequestLateTransform, RulesetPhaseHTTPRequestOrigin, RulesetPhaseHTTPRequestRedirect, RulesetPhaseHTTPRequestSanitize, RulesetPhaseHTTPRequestSbfm, RulesetPhaseHTTPRequestSelectConfiguration, RulesetPhaseHTTPRequestTransform, RulesetPhaseHTTPResponseCompression, RulesetPhaseHTTPResponseFirewallManaged, RulesetPhaseHTTPResponseHeadersTransform, RulesetPhaseMagicTransit, RulesetPhaseMagicTransitIDsManaged, RulesetPhaseMagicTransitManaged:
return true
}
return false
}
-type RulesetUpdateResponseRule struct {
- // The action to perform when the rule matches.
- Action RulesetUpdateResponseRulesAction `json:"action"`
- ActionParameters interface{} `json:"action_parameters,required"`
- Categories interface{} `json:"categories,required"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // An object configuring the rule's logging behavior.
- Logging shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- // The version of the rule.
- Version string `json:"version,required"`
- JSON rulesetUpdateResponseRuleJSON `json:"-"`
- union RulesetUpdateResponseRulesUnion
-}
-
-// rulesetUpdateResponseRuleJSON contains the JSON metadata for the struct
-// [RulesetUpdateResponseRule]
-type rulesetUpdateResponseRuleJSON struct {
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- ID apijson.Field
- LastUpdated apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- Version apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r rulesetUpdateResponseRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r *RulesetUpdateResponseRule) UnmarshalJSON(data []byte) (err error) {
- err = apijson.UnmarshalRoot(data, &r.union)
- if err != nil {
- return err
- }
- return apijson.Port(r.union, &r)
-}
-
-func (r RulesetUpdateResponseRule) AsUnion() RulesetUpdateResponseRulesUnion {
- return r.union
-}
-
-// Union satisfied by [rulesets.RulesetUpdateResponseRulesRulesetsBlockRule],
-// [rulesets.RulesetUpdateResponseRulesRulesetsExecuteRule],
-// [rulesets.RulesetUpdateResponseRulesRulesetsLogRule] or
-// [rulesets.RulesetUpdateResponseRulesRulesetsSkipRule].
-type RulesetUpdateResponseRulesUnion interface {
- implementsRulesetsRulesetUpdateResponseRule()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*RulesetUpdateResponseRulesUnion)(nil)).Elem(),
- "action",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RulesetUpdateResponseRulesRulesetsBlockRule{}),
- DiscriminatorValue: "block",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RulesetUpdateResponseRulesRulesetsExecuteRule{}),
- DiscriminatorValue: "execute",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RulesetUpdateResponseRulesRulesetsLogRule{}),
- DiscriminatorValue: "log",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RulesetUpdateResponseRulesRulesetsSkipRule{}),
- DiscriminatorValue: "skip",
- },
- )
-}
-
-type RulesetUpdateResponseRulesRulesetsBlockRule struct {
+type SkipRule struct {
// The timestamp of when the rule was last modified.
LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
// The version of the rule.
@@ -1231,9 +1198,9 @@ type RulesetUpdateResponseRulesRulesetsBlockRule struct {
// The unique ID of the rule.
ID string `json:"id"`
// The action to perform when the rule matches.
- Action RulesetUpdateResponseRulesRulesetsBlockRuleAction `json:"action"`
+ Action SkipRuleAction `json:"action"`
// The parameters configuring the rule's action.
- ActionParameters RulesetUpdateResponseRulesRulesetsBlockRuleActionParameters `json:"action_parameters"`
+ ActionParameters SkipRuleActionParameters `json:"action_parameters"`
// The categories of the rule.
Categories []string `json:"categories"`
// An informative description of the rule.
@@ -1245,13 +1212,12 @@ type RulesetUpdateResponseRulesRulesetsBlockRule struct {
// An object configuring the rule's logging behavior.
Logging shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c `json:"logging"`
// The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON rulesetUpdateResponseRulesRulesetsBlockRuleJSON `json:"-"`
+ Ref string `json:"ref"`
+ JSON skipRuleJSON `json:"-"`
}
-// rulesetUpdateResponseRulesRulesetsBlockRuleJSON contains the JSON metadata for
-// the struct [RulesetUpdateResponseRulesRulesetsBlockRule]
-type rulesetUpdateResponseRulesRulesetsBlockRuleJSON struct {
+// skipRuleJSON contains the JSON metadata for the struct [SkipRule]
+type skipRuleJSON struct {
LastUpdated apijson.Field
Version apijson.Field
ID apijson.Field
@@ -1267,734 +1233,434 @@ type rulesetUpdateResponseRulesRulesetsBlockRuleJSON struct {
ExtraFields map[string]apijson.Field
}
-func (r *RulesetUpdateResponseRulesRulesetsBlockRule) UnmarshalJSON(data []byte) (err error) {
+func (r *SkipRule) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
-func (r rulesetUpdateResponseRulesRulesetsBlockRuleJSON) RawJSON() string {
+func (r skipRuleJSON) RawJSON() string {
return r.raw
}
-func (r RulesetUpdateResponseRulesRulesetsBlockRule) implementsRulesetsRulesetUpdateResponseRule() {}
+func (r SkipRule) implementsRulesetsRequestRule() {}
// The action to perform when the rule matches.
-type RulesetUpdateResponseRulesRulesetsBlockRuleAction string
+type SkipRuleAction string
const (
- RulesetUpdateResponseRulesRulesetsBlockRuleActionBlock RulesetUpdateResponseRulesRulesetsBlockRuleAction = "block"
+ SkipRuleActionSkip SkipRuleAction = "skip"
)
-func (r RulesetUpdateResponseRulesRulesetsBlockRuleAction) IsKnown() bool {
+func (r SkipRuleAction) IsKnown() bool {
switch r {
- case RulesetUpdateResponseRulesRulesetsBlockRuleActionBlock:
+ case SkipRuleActionSkip:
return true
}
return false
}
// The parameters configuring the rule's action.
-type RulesetUpdateResponseRulesRulesetsBlockRuleActionParameters struct {
- // The response to show when the block is applied.
- Response RulesetUpdateResponseRulesRulesetsBlockRuleActionParametersResponse `json:"response"`
- JSON rulesetUpdateResponseRulesRulesetsBlockRuleActionParametersJSON `json:"-"`
+type SkipRuleActionParameters struct {
+ // A list of phases to skip the execution of. This option is incompatible with the
+ // ruleset and rulesets options.
+ Phases []SkipRuleActionParametersPhase `json:"phases"`
+ // A list of legacy security products to skip the execution of.
+ Products []SkipRuleActionParametersProduct `json:"products"`
+ // A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the
+ // execution of. This option is incompatible with the ruleset option.
+ Rules map[string][]string `json:"rules"`
+ // A ruleset to skip the execution of. This option is incompatible with the
+ // rulesets, rules and phases options.
+ Ruleset SkipRuleActionParametersRuleset `json:"ruleset"`
+ // A list of ruleset IDs to skip the execution of. This option is incompatible with
+ // the ruleset and phases options.
+ Rulesets []string `json:"rulesets"`
+ JSON skipRuleActionParametersJSON `json:"-"`
}
-// rulesetUpdateResponseRulesRulesetsBlockRuleActionParametersJSON contains the
-// JSON metadata for the struct
-// [RulesetUpdateResponseRulesRulesetsBlockRuleActionParameters]
-type rulesetUpdateResponseRulesRulesetsBlockRuleActionParametersJSON struct {
- Response apijson.Field
+// skipRuleActionParametersJSON contains the JSON metadata for the struct
+// [SkipRuleActionParameters]
+type skipRuleActionParametersJSON struct {
+ Phases apijson.Field
+ Products apijson.Field
+ Rules apijson.Field
+ Ruleset apijson.Field
+ Rulesets apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
-func (r *RulesetUpdateResponseRulesRulesetsBlockRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
+func (r *SkipRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
-func (r rulesetUpdateResponseRulesRulesetsBlockRuleActionParametersJSON) RawJSON() string {
+func (r skipRuleActionParametersJSON) RawJSON() string {
return r.raw
}
-// The response to show when the block is applied.
-type RulesetUpdateResponseRulesRulesetsBlockRuleActionParametersResponse struct {
- // The content to return.
- Content string `json:"content,required"`
- // The type of the content to return.
- ContentType string `json:"content_type,required"`
- // The status code to return.
- StatusCode int64 `json:"status_code,required"`
- JSON rulesetUpdateResponseRulesRulesetsBlockRuleActionParametersResponseJSON `json:"-"`
-}
+// A phase to skip the execution of.
+type SkipRuleActionParametersPhase string
-// rulesetUpdateResponseRulesRulesetsBlockRuleActionParametersResponseJSON contains
-// the JSON metadata for the struct
-// [RulesetUpdateResponseRulesRulesetsBlockRuleActionParametersResponse]
-type rulesetUpdateResponseRulesRulesetsBlockRuleActionParametersResponseJSON struct {
- Content apijson.Field
- ContentType apijson.Field
- StatusCode apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
+const (
+ SkipRuleActionParametersPhaseDDoSL4 SkipRuleActionParametersPhase = "ddos_l4"
+ SkipRuleActionParametersPhaseDDoSL7 SkipRuleActionParametersPhase = "ddos_l7"
+ SkipRuleActionParametersPhaseHTTPConfigSettings SkipRuleActionParametersPhase = "http_config_settings"
+ SkipRuleActionParametersPhaseHTTPCustomErrors SkipRuleActionParametersPhase = "http_custom_errors"
+ SkipRuleActionParametersPhaseHTTPLogCustomFields SkipRuleActionParametersPhase = "http_log_custom_fields"
+ SkipRuleActionParametersPhaseHTTPRatelimit SkipRuleActionParametersPhase = "http_ratelimit"
+ SkipRuleActionParametersPhaseHTTPRequestCacheSettings SkipRuleActionParametersPhase = "http_request_cache_settings"
+ SkipRuleActionParametersPhaseHTTPRequestDynamicRedirect SkipRuleActionParametersPhase = "http_request_dynamic_redirect"
+ SkipRuleActionParametersPhaseHTTPRequestFirewallCustom SkipRuleActionParametersPhase = "http_request_firewall_custom"
+ SkipRuleActionParametersPhaseHTTPRequestFirewallManaged SkipRuleActionParametersPhase = "http_request_firewall_managed"
+ SkipRuleActionParametersPhaseHTTPRequestLateTransform SkipRuleActionParametersPhase = "http_request_late_transform"
+ SkipRuleActionParametersPhaseHTTPRequestOrigin SkipRuleActionParametersPhase = "http_request_origin"
+ SkipRuleActionParametersPhaseHTTPRequestRedirect SkipRuleActionParametersPhase = "http_request_redirect"
+ SkipRuleActionParametersPhaseHTTPRequestSanitize SkipRuleActionParametersPhase = "http_request_sanitize"
+ SkipRuleActionParametersPhaseHTTPRequestSbfm SkipRuleActionParametersPhase = "http_request_sbfm"
+ SkipRuleActionParametersPhaseHTTPRequestSelectConfiguration SkipRuleActionParametersPhase = "http_request_select_configuration"
+ SkipRuleActionParametersPhaseHTTPRequestTransform SkipRuleActionParametersPhase = "http_request_transform"
+ SkipRuleActionParametersPhaseHTTPResponseCompression SkipRuleActionParametersPhase = "http_response_compression"
+ SkipRuleActionParametersPhaseHTTPResponseFirewallManaged SkipRuleActionParametersPhase = "http_response_firewall_managed"
+ SkipRuleActionParametersPhaseHTTPResponseHeadersTransform SkipRuleActionParametersPhase = "http_response_headers_transform"
+ SkipRuleActionParametersPhaseMagicTransit SkipRuleActionParametersPhase = "magic_transit"
+ SkipRuleActionParametersPhaseMagicTransitIDsManaged SkipRuleActionParametersPhase = "magic_transit_ids_managed"
+ SkipRuleActionParametersPhaseMagicTransitManaged SkipRuleActionParametersPhase = "magic_transit_managed"
+)
+
+func (r SkipRuleActionParametersPhase) IsKnown() bool {
+ switch r {
+ case SkipRuleActionParametersPhaseDDoSL4, SkipRuleActionParametersPhaseDDoSL7, SkipRuleActionParametersPhaseHTTPConfigSettings, SkipRuleActionParametersPhaseHTTPCustomErrors, SkipRuleActionParametersPhaseHTTPLogCustomFields, SkipRuleActionParametersPhaseHTTPRatelimit, SkipRuleActionParametersPhaseHTTPRequestCacheSettings, SkipRuleActionParametersPhaseHTTPRequestDynamicRedirect, SkipRuleActionParametersPhaseHTTPRequestFirewallCustom, SkipRuleActionParametersPhaseHTTPRequestFirewallManaged, SkipRuleActionParametersPhaseHTTPRequestLateTransform, SkipRuleActionParametersPhaseHTTPRequestOrigin, SkipRuleActionParametersPhaseHTTPRequestRedirect, SkipRuleActionParametersPhaseHTTPRequestSanitize, SkipRuleActionParametersPhaseHTTPRequestSbfm, SkipRuleActionParametersPhaseHTTPRequestSelectConfiguration, SkipRuleActionParametersPhaseHTTPRequestTransform, SkipRuleActionParametersPhaseHTTPResponseCompression, SkipRuleActionParametersPhaseHTTPResponseFirewallManaged, SkipRuleActionParametersPhaseHTTPResponseHeadersTransform, SkipRuleActionParametersPhaseMagicTransit, SkipRuleActionParametersPhaseMagicTransitIDsManaged, SkipRuleActionParametersPhaseMagicTransitManaged:
+ return true
+ }
+ return false
}
-func (r *RulesetUpdateResponseRulesRulesetsBlockRuleActionParametersResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
+// The name of a legacy security product to skip the execution of.
+type SkipRuleActionParametersProduct string
+
+const (
+ SkipRuleActionParametersProductBic SkipRuleActionParametersProduct = "bic"
+ SkipRuleActionParametersProductHot SkipRuleActionParametersProduct = "hot"
+ SkipRuleActionParametersProductRateLimit SkipRuleActionParametersProduct = "rateLimit"
+ SkipRuleActionParametersProductSecurityLevel SkipRuleActionParametersProduct = "securityLevel"
+ SkipRuleActionParametersProductUABlock SkipRuleActionParametersProduct = "uaBlock"
+ SkipRuleActionParametersProductWAF SkipRuleActionParametersProduct = "waf"
+ SkipRuleActionParametersProductZoneLockdown SkipRuleActionParametersProduct = "zoneLockdown"
+)
+
+func (r SkipRuleActionParametersProduct) IsKnown() bool {
+ switch r {
+ case SkipRuleActionParametersProductBic, SkipRuleActionParametersProductHot, SkipRuleActionParametersProductRateLimit, SkipRuleActionParametersProductSecurityLevel, SkipRuleActionParametersProductUABlock, SkipRuleActionParametersProductWAF, SkipRuleActionParametersProductZoneLockdown:
+ return true
+ }
+ return false
}
-func (r rulesetUpdateResponseRulesRulesetsBlockRuleActionParametersResponseJSON) RawJSON() string {
- return r.raw
+// A ruleset to skip the execution of. This option is incompatible with the
+// rulesets, rules and phases options.
+type SkipRuleActionParametersRuleset string
+
+const (
+ SkipRuleActionParametersRulesetCurrent SkipRuleActionParametersRuleset = "current"
+)
+
+func (r SkipRuleActionParametersRuleset) IsKnown() bool {
+ switch r {
+ case SkipRuleActionParametersRulesetCurrent:
+ return true
+ }
+ return false
}
-type RulesetUpdateResponseRulesRulesetsExecuteRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
+type SkipRuleParam struct {
// The unique ID of the rule.
- ID string `json:"id"`
+ ID param.Field[string] `json:"id"`
// The action to perform when the rule matches.
- Action RulesetUpdateResponseRulesRulesetsExecuteRuleAction `json:"action"`
+ Action param.Field[SkipRuleAction] `json:"action"`
// The parameters configuring the rule's action.
- ActionParameters RulesetUpdateResponseRulesRulesetsExecuteRuleActionParameters `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
+ ActionParameters param.Field[SkipRuleActionParametersParam] `json:"action_parameters"`
// An informative description of the rule.
- Description string `json:"description"`
+ Description param.Field[string] `json:"description"`
// Whether the rule should be executed.
- Enabled bool `json:"enabled"`
+ Enabled param.Field[bool] `json:"enabled"`
// The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
+ Expression param.Field[string] `json:"expression"`
// An object configuring the rule's logging behavior.
- Logging shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c `json:"logging"`
+ Logging param.Field[shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751cParam] `json:"logging"`
// The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON rulesetUpdateResponseRulesRulesetsExecuteRuleJSON `json:"-"`
+ Ref param.Field[string] `json:"ref"`
}
-// rulesetUpdateResponseRulesRulesetsExecuteRuleJSON contains the JSON metadata for
-// the struct [RulesetUpdateResponseRulesRulesetsExecuteRule]
-type rulesetUpdateResponseRulesRulesetsExecuteRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
+func (r SkipRuleParam) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
}
-func (r *RulesetUpdateResponseRulesRulesetsExecuteRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
+func (r SkipRuleParam) implementsRulesetsRequestRuleUnionParam() {}
-func (r rulesetUpdateResponseRulesRulesetsExecuteRuleJSON) RawJSON() string {
- return r.raw
-}
+func (r SkipRuleParam) implementsRulesetsRequestRuleUnionParam() {}
-func (r RulesetUpdateResponseRulesRulesetsExecuteRule) implementsRulesetsRulesetUpdateResponseRule() {
-}
+func (r SkipRuleParam) implementsRulesetsRequestRuleUnionParam() {}
-// The action to perform when the rule matches.
-type RulesetUpdateResponseRulesRulesetsExecuteRuleAction string
+func (r SkipRuleParam) implementsRulesetsRequestRuleUnionParam() {}
-const (
- RulesetUpdateResponseRulesRulesetsExecuteRuleActionExecute RulesetUpdateResponseRulesRulesetsExecuteRuleAction = "execute"
-)
+func (r SkipRuleParam) implementsRulesetsRequestRuleUnionParam() {}
-func (r RulesetUpdateResponseRulesRulesetsExecuteRuleAction) IsKnown() bool {
- switch r {
- case RulesetUpdateResponseRulesRulesetsExecuteRuleActionExecute:
- return true
- }
- return false
-}
+func (r SkipRuleParam) implementsRulesetsRequestRuleUnionParam() {}
-// The parameters configuring the rule's action.
-type RulesetUpdateResponseRulesRulesetsExecuteRuleActionParameters struct {
- // The ID of the ruleset to execute.
- ID string `json:"id,required"`
- // The configuration to use for matched data logging.
- MatchedData RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersMatchedData `json:"matched_data"`
- // A set of overrides to apply to the target ruleset.
- Overrides RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverrides `json:"overrides"`
- JSON rulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersJSON `json:"-"`
-}
+func (r SkipRuleParam) implementsRulesetsRequestRuleUnionParam() {}
-// rulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersJSON contains the
-// JSON metadata for the struct
-// [RulesetUpdateResponseRulesRulesetsExecuteRuleActionParameters]
-type rulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersJSON struct {
- ID apijson.Field
- MatchedData apijson.Field
- Overrides apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
+func (r SkipRuleParam) implementsRulesetsRequestRuleUnionParam() {}
-func (r *RulesetUpdateResponseRulesRulesetsExecuteRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
+func (r SkipRuleParam) implementsRulesetsRequestRuleUnionParam() {}
-func (r rulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersJSON) RawJSON() string {
- return r.raw
-}
+func (r SkipRuleParam) implementsRulesetsRequestRuleUnionParam() {}
-// The configuration to use for matched data logging.
-type RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersMatchedData struct {
- // The public key to encrypt matched data logs with.
- PublicKey string `json:"public_key,required"`
- JSON rulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON `json:"-"`
-}
+func (r SkipRuleParam) implementsRulesetsRequestRuleUnionParam() {}
-// rulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON
-// contains the JSON metadata for the struct
-// [RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersMatchedData]
-type rulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON struct {
- PublicKey apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
+func (r SkipRuleParam) implementsRulesetsRequestRuleUnionParam() {}
-func (r *RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersMatchedData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
+func (r SkipRuleParam) implementsRulesetsRequestRuleUnionParam() {}
-func (r rulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON) RawJSON() string {
- return r.raw
-}
+func (r SkipRuleParam) implementsRulesetsRequestRuleUnionParam() {}
-// A set of overrides to apply to the target ruleset.
-type RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverrides struct {
- // An action to override all rules with. This option has lower precedence than rule
- // and category overrides.
- Action string `json:"action"`
- // A list of category-level overrides. This option has the second-highest
- // precedence after rule-level overrides.
- Categories []RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory `json:"categories"`
- // Whether to enable execution of all rules. This option has lower precedence than
- // rule and category overrides.
- Enabled bool `json:"enabled"`
- // A list of rule-level overrides. This option has the highest precedence.
- Rules []RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRule `json:"rules"`
- // A sensitivity level to set for all rules. This option has lower precedence than
- // rule and category overrides and is only applicable for DDoS phases.
- SensitivityLevel RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel `json:"sensitivity_level"`
- JSON rulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON `json:"-"`
-}
+func (r SkipRuleParam) implementsRulesetsRequestRuleUnionParam() {}
-// rulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON
-// contains the JSON metadata for the struct
-// [RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverrides]
-type rulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON struct {
- Action apijson.Field
- Categories apijson.Field
- Enabled apijson.Field
- Rules apijson.Field
- SensitivityLevel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
+func (r SkipRuleParam) implementsRulesetsRequestRuleUnionParam() {}
-func (r *RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverrides) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
+func (r SkipRuleParam) implementsRulesetsRequestRuleUnionParam() {}
-func (r rulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON) RawJSON() string {
- return r.raw
-}
+func (r SkipRuleParam) implementsRulesetsRequestRuleUnionParam() {}
-// A category-level override
-type RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory struct {
- // The name of the category to override.
- Category string `json:"category,required"`
- // The action to override rules in the category with.
- Action string `json:"action"`
- // Whether to enable execution of rules in the category.
- Enabled bool `json:"enabled"`
- // The sensitivity level to use for rules in the category.
- SensitivityLevel RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel `json:"sensitivity_level"`
- JSON rulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON `json:"-"`
-}
+func (r SkipRuleParam) implementsRulesetsRequestRuleUnionParam() {}
-// rulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON
-// contains the JSON metadata for the struct
-// [RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory]
-type rulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON struct {
- Category apijson.Field
- Action apijson.Field
- Enabled apijson.Field
- SensitivityLevel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
+func (r SkipRuleParam) implementsRulesetsRequestRuleUnionParam() {}
-func (r *RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
+func (r SkipRuleParam) implementsRulesetsRequestRuleUnionParam() {}
-func (r rulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON) RawJSON() string {
- return r.raw
-}
+func (r SkipRuleParam) implementsRulesetsRequestRuleUnionParam() {}
-// The sensitivity level to use for rules in the category.
-type RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel string
+func (r SkipRuleParam) implementsRulesetsRequestRuleUnionParam() {}
-const (
- RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "default"
- RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "medium"
- RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "low"
- RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "eoff"
-)
+func (r SkipRuleParam) implementsRulesetsRequestRuleUnionParam() {}
-func (r RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel) IsKnown() bool {
- switch r {
- case RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault, RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium, RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow, RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff:
- return true
- }
- return false
+func (r SkipRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+func (r SkipRuleParam) implementsRulesetsRequestRuleUnionParam() {}
+
+// The parameters configuring the rule's action.
+type SkipRuleActionParametersParam struct {
+ // A list of phases to skip the execution of. This option is incompatible with the
+ // ruleset and rulesets options.
+ Phases param.Field[[]SkipRuleActionParametersPhase] `json:"phases"`
+ // A list of legacy security products to skip the execution of.
+ Products param.Field[[]SkipRuleActionParametersProduct] `json:"products"`
+ // A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the
+ // execution of. This option is incompatible with the ruleset option.
+ Rules param.Field[map[string][]string] `json:"rules"`
+ // A ruleset to skip the execution of. This option is incompatible with the
+ // rulesets, rules and phases options.
+ Ruleset param.Field[SkipRuleActionParametersRuleset] `json:"ruleset"`
+ // A list of ruleset IDs to skip the execution of. This option is incompatible with
+ // the ruleset and phases options.
+ Rulesets param.Field[[]string] `json:"rulesets"`
}
-// A rule-level override
-type RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRule struct {
- // The ID of the rule to override.
+func (r SkipRuleActionParametersParam) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// A ruleset object.
+type RulesetNewResponse struct {
+ // The unique ID of the ruleset.
ID string `json:"id,required"`
- // The action to override the rule with.
- Action string `json:"action"`
- // Whether to enable execution of the rule.
- Enabled bool `json:"enabled"`
- // The score threshold to use for the rule.
- ScoreThreshold int64 `json:"score_threshold"`
- // The sensitivity level to use for the rule.
- SensitivityLevel RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel `json:"sensitivity_level"`
- JSON rulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON `json:"-"`
+ // The kind of the ruleset.
+ Kind RulesetNewResponseKind `json:"kind,required"`
+ // The timestamp of when the ruleset was last modified.
+ LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
+ // The human-readable name of the ruleset.
+ Name string `json:"name,required"`
+ // The phase of the ruleset.
+ Phase RulesetNewResponsePhase `json:"phase,required"`
+ // The list of rules in the ruleset.
+ Rules []RequestRule `json:"rules,required"`
+ // The version of the ruleset.
+ Version string `json:"version,required"`
+ // An informative description of the ruleset.
+ Description string `json:"description"`
+ JSON rulesetNewResponseJSON `json:"-"`
}
-// rulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON
-// contains the JSON metadata for the struct
-// [RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRule]
-type rulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON struct {
- ID apijson.Field
- Action apijson.Field
- Enabled apijson.Field
- ScoreThreshold apijson.Field
- SensitivityLevel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
+// rulesetNewResponseJSON contains the JSON metadata for the struct
+// [RulesetNewResponse]
+type rulesetNewResponseJSON struct {
+ ID apijson.Field
+ Kind apijson.Field
+ LastUpdated apijson.Field
+ Name apijson.Field
+ Phase apijson.Field
+ Rules apijson.Field
+ Version apijson.Field
+ Description apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
}
-func (r *RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRule) UnmarshalJSON(data []byte) (err error) {
+func (r *RulesetNewResponse) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
-func (r rulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON) RawJSON() string {
+func (r rulesetNewResponseJSON) RawJSON() string {
return r.raw
}
-// The sensitivity level to use for the rule.
-type RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel string
+// The kind of the ruleset.
+type RulesetNewResponseKind string
const (
- RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "default"
- RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "medium"
- RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "low"
- RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "eoff"
+ RulesetNewResponseKindManaged RulesetNewResponseKind = "managed"
+ RulesetNewResponseKindCustom RulesetNewResponseKind = "custom"
+ RulesetNewResponseKindRoot RulesetNewResponseKind = "root"
+ RulesetNewResponseKindZone RulesetNewResponseKind = "zone"
)
-func (r RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel) IsKnown() bool {
+func (r RulesetNewResponseKind) IsKnown() bool {
switch r {
- case RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault, RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium, RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow, RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff:
+ case RulesetNewResponseKindManaged, RulesetNewResponseKindCustom, RulesetNewResponseKindRoot, RulesetNewResponseKindZone:
return true
}
return false
}
-// A sensitivity level to set for all rules. This option has lower precedence than
-// rule and category overrides and is only applicable for DDoS phases.
-type RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel string
+// The phase of the ruleset.
+type RulesetNewResponsePhase string
const (
- RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "default"
- RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "medium"
- RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "low"
- RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "eoff"
+ RulesetNewResponsePhaseDDoSL4 RulesetNewResponsePhase = "ddos_l4"
+ RulesetNewResponsePhaseDDoSL7 RulesetNewResponsePhase = "ddos_l7"
+ RulesetNewResponsePhaseHTTPConfigSettings RulesetNewResponsePhase = "http_config_settings"
+ RulesetNewResponsePhaseHTTPCustomErrors RulesetNewResponsePhase = "http_custom_errors"
+ RulesetNewResponsePhaseHTTPLogCustomFields RulesetNewResponsePhase = "http_log_custom_fields"
+ RulesetNewResponsePhaseHTTPRatelimit RulesetNewResponsePhase = "http_ratelimit"
+ RulesetNewResponsePhaseHTTPRequestCacheSettings RulesetNewResponsePhase = "http_request_cache_settings"
+ RulesetNewResponsePhaseHTTPRequestDynamicRedirect RulesetNewResponsePhase = "http_request_dynamic_redirect"
+ RulesetNewResponsePhaseHTTPRequestFirewallCustom RulesetNewResponsePhase = "http_request_firewall_custom"
+ RulesetNewResponsePhaseHTTPRequestFirewallManaged RulesetNewResponsePhase = "http_request_firewall_managed"
+ RulesetNewResponsePhaseHTTPRequestLateTransform RulesetNewResponsePhase = "http_request_late_transform"
+ RulesetNewResponsePhaseHTTPRequestOrigin RulesetNewResponsePhase = "http_request_origin"
+ RulesetNewResponsePhaseHTTPRequestRedirect RulesetNewResponsePhase = "http_request_redirect"
+ RulesetNewResponsePhaseHTTPRequestSanitize RulesetNewResponsePhase = "http_request_sanitize"
+ RulesetNewResponsePhaseHTTPRequestSbfm RulesetNewResponsePhase = "http_request_sbfm"
+ RulesetNewResponsePhaseHTTPRequestSelectConfiguration RulesetNewResponsePhase = "http_request_select_configuration"
+ RulesetNewResponsePhaseHTTPRequestTransform RulesetNewResponsePhase = "http_request_transform"
+ RulesetNewResponsePhaseHTTPResponseCompression RulesetNewResponsePhase = "http_response_compression"
+ RulesetNewResponsePhaseHTTPResponseFirewallManaged RulesetNewResponsePhase = "http_response_firewall_managed"
+ RulesetNewResponsePhaseHTTPResponseHeadersTransform RulesetNewResponsePhase = "http_response_headers_transform"
+ RulesetNewResponsePhaseMagicTransit RulesetNewResponsePhase = "magic_transit"
+ RulesetNewResponsePhaseMagicTransitIDsManaged RulesetNewResponsePhase = "magic_transit_ids_managed"
+ RulesetNewResponsePhaseMagicTransitManaged RulesetNewResponsePhase = "magic_transit_managed"
)
-func (r RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel) IsKnown() bool {
+func (r RulesetNewResponsePhase) IsKnown() bool {
switch r {
- case RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault, RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium, RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow, RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff:
+ case RulesetNewResponsePhaseDDoSL4, RulesetNewResponsePhaseDDoSL7, RulesetNewResponsePhaseHTTPConfigSettings, RulesetNewResponsePhaseHTTPCustomErrors, RulesetNewResponsePhaseHTTPLogCustomFields, RulesetNewResponsePhaseHTTPRatelimit, RulesetNewResponsePhaseHTTPRequestCacheSettings, RulesetNewResponsePhaseHTTPRequestDynamicRedirect, RulesetNewResponsePhaseHTTPRequestFirewallCustom, RulesetNewResponsePhaseHTTPRequestFirewallManaged, RulesetNewResponsePhaseHTTPRequestLateTransform, RulesetNewResponsePhaseHTTPRequestOrigin, RulesetNewResponsePhaseHTTPRequestRedirect, RulesetNewResponsePhaseHTTPRequestSanitize, RulesetNewResponsePhaseHTTPRequestSbfm, RulesetNewResponsePhaseHTTPRequestSelectConfiguration, RulesetNewResponsePhaseHTTPRequestTransform, RulesetNewResponsePhaseHTTPResponseCompression, RulesetNewResponsePhaseHTTPResponseFirewallManaged, RulesetNewResponsePhaseHTTPResponseHeadersTransform, RulesetNewResponsePhaseMagicTransit, RulesetNewResponsePhaseMagicTransitIDsManaged, RulesetNewResponsePhaseMagicTransitManaged:
return true
}
return false
}
-type RulesetUpdateResponseRulesRulesetsLogRule struct {
- // The timestamp of when the rule was last modified.
+// A ruleset object.
+type RulesetUpdateResponse struct {
+ // The unique ID of the ruleset.
+ ID string `json:"id,required"`
+ // The kind of the ruleset.
+ Kind RulesetUpdateResponseKind `json:"kind,required"`
+ // The timestamp of when the ruleset was last modified.
LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
+ // The human-readable name of the ruleset.
+ Name string `json:"name,required"`
+ // The phase of the ruleset.
+ Phase RulesetUpdateResponsePhase `json:"phase,required"`
+ // The list of rules in the ruleset.
+ Rules []RequestRule `json:"rules,required"`
+ // The version of the ruleset.
Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action RulesetUpdateResponseRulesRulesetsLogRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters interface{} `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON rulesetUpdateResponseRulesRulesetsLogRuleJSON `json:"-"`
+ // An informative description of the ruleset.
+ Description string `json:"description"`
+ JSON rulesetUpdateResponseJSON `json:"-"`
}
-// rulesetUpdateResponseRulesRulesetsLogRuleJSON contains the JSON metadata for the
-// struct [RulesetUpdateResponseRulesRulesetsLogRule]
-type rulesetUpdateResponseRulesRulesetsLogRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
+// rulesetUpdateResponseJSON contains the JSON metadata for the struct
+// [RulesetUpdateResponse]
+type rulesetUpdateResponseJSON struct {
+ ID apijson.Field
+ Kind apijson.Field
+ LastUpdated apijson.Field
+ Name apijson.Field
+ Phase apijson.Field
+ Rules apijson.Field
+ Version apijson.Field
+ Description apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
}
-func (r *RulesetUpdateResponseRulesRulesetsLogRule) UnmarshalJSON(data []byte) (err error) {
+func (r *RulesetUpdateResponse) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
-func (r rulesetUpdateResponseRulesRulesetsLogRuleJSON) RawJSON() string {
+func (r rulesetUpdateResponseJSON) RawJSON() string {
return r.raw
}
-func (r RulesetUpdateResponseRulesRulesetsLogRule) implementsRulesetsRulesetUpdateResponseRule() {}
-
-// The action to perform when the rule matches.
-type RulesetUpdateResponseRulesRulesetsLogRuleAction string
+// The kind of the ruleset.
+type RulesetUpdateResponseKind string
const (
- RulesetUpdateResponseRulesRulesetsLogRuleActionLog RulesetUpdateResponseRulesRulesetsLogRuleAction = "log"
+ RulesetUpdateResponseKindManaged RulesetUpdateResponseKind = "managed"
+ RulesetUpdateResponseKindCustom RulesetUpdateResponseKind = "custom"
+ RulesetUpdateResponseKindRoot RulesetUpdateResponseKind = "root"
+ RulesetUpdateResponseKindZone RulesetUpdateResponseKind = "zone"
)
-func (r RulesetUpdateResponseRulesRulesetsLogRuleAction) IsKnown() bool {
+func (r RulesetUpdateResponseKind) IsKnown() bool {
switch r {
- case RulesetUpdateResponseRulesRulesetsLogRuleActionLog:
- return true
- }
- return false
-}
-
-type RulesetUpdateResponseRulesRulesetsSkipRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action RulesetUpdateResponseRulesRulesetsSkipRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters RulesetUpdateResponseRulesRulesetsSkipRuleActionParameters `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON rulesetUpdateResponseRulesRulesetsSkipRuleJSON `json:"-"`
-}
-
-// rulesetUpdateResponseRulesRulesetsSkipRuleJSON contains the JSON metadata for
-// the struct [RulesetUpdateResponseRulesRulesetsSkipRule]
-type rulesetUpdateResponseRulesRulesetsSkipRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetUpdateResponseRulesRulesetsSkipRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetUpdateResponseRulesRulesetsSkipRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r RulesetUpdateResponseRulesRulesetsSkipRule) implementsRulesetsRulesetUpdateResponseRule() {}
-
-// The action to perform when the rule matches.
-type RulesetUpdateResponseRulesRulesetsSkipRuleAction string
-
-const (
- RulesetUpdateResponseRulesRulesetsSkipRuleActionSkip RulesetUpdateResponseRulesRulesetsSkipRuleAction = "skip"
-)
-
-func (r RulesetUpdateResponseRulesRulesetsSkipRuleAction) IsKnown() bool {
- switch r {
- case RulesetUpdateResponseRulesRulesetsSkipRuleActionSkip:
- return true
- }
- return false
-}
-
-// The parameters configuring the rule's action.
-type RulesetUpdateResponseRulesRulesetsSkipRuleActionParameters struct {
- // A list of phases to skip the execution of. This option is incompatible with the
- // ruleset and rulesets options.
- Phases []RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase `json:"phases"`
- // A list of legacy security products to skip the execution of.
- Products []RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersProduct `json:"products"`
- // A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the
- // execution of. This option is incompatible with the ruleset option.
- Rules map[string][]string `json:"rules"`
- // A ruleset to skip the execution of. This option is incompatible with the
- // rulesets, rules and phases options.
- Ruleset RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersRuleset `json:"ruleset"`
- // A list of ruleset IDs to skip the execution of. This option is incompatible with
- // the ruleset and phases options.
- Rulesets []string `json:"rulesets"`
- JSON rulesetUpdateResponseRulesRulesetsSkipRuleActionParametersJSON `json:"-"`
-}
-
-// rulesetUpdateResponseRulesRulesetsSkipRuleActionParametersJSON contains the JSON
-// metadata for the struct
-// [RulesetUpdateResponseRulesRulesetsSkipRuleActionParameters]
-type rulesetUpdateResponseRulesRulesetsSkipRuleActionParametersJSON struct {
- Phases apijson.Field
- Products apijson.Field
- Rules apijson.Field
- Ruleset apijson.Field
- Rulesets apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetUpdateResponseRulesRulesetsSkipRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetUpdateResponseRulesRulesetsSkipRuleActionParametersJSON) RawJSON() string {
- return r.raw
-}
-
-// A phase to skip the execution of.
-type RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase string
-
-const (
- RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseDDoSL4 RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l4"
- RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseDDoSL7 RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l7"
- RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_config_settings"
- RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_custom_errors"
- RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_log_custom_fields"
- RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRatelimit RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_ratelimit"
- RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_cache_settings"
- RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_dynamic_redirect"
- RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_custom"
- RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_managed"
- RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_late_transform"
- RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_origin"
- RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_redirect"
- RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sanitize"
- RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sbfm"
- RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_select_configuration"
- RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_transform"
- RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_compression"
- RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_firewall_managed"
- RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_headers_transform"
- RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransit RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit"
- RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_ids_managed"
- RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitManaged RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_managed"
-)
-
-func (r RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase) IsKnown() bool {
- switch r {
- case RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseDDoSL4, RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseDDoSL7, RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings, RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors, RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields, RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRatelimit, RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings, RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect, RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom, RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged, RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform, RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin, RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect, RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize, RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm, RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration, RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform, RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression, RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged, RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform, RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransit, RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged, RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitManaged:
- return true
- }
- return false
-}
-
-// The name of a legacy security product to skip the execution of.
-type RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersProduct string
-
-const (
- RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersProductBic RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersProduct = "bic"
- RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersProductHot RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersProduct = "hot"
- RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersProductRateLimit RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersProduct = "rateLimit"
- RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersProductSecurityLevel RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersProduct = "securityLevel"
- RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersProductUABlock RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersProduct = "uaBlock"
- RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersProductWAF RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersProduct = "waf"
- RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersProductZoneLockdown RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersProduct = "zoneLockdown"
-)
-
-func (r RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersProduct) IsKnown() bool {
- switch r {
- case RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersProductBic, RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersProductHot, RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersProductRateLimit, RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersProductSecurityLevel, RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersProductUABlock, RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersProductWAF, RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersProductZoneLockdown:
- return true
- }
- return false
-}
-
-// A ruleset to skip the execution of. This option is incompatible with the
-// rulesets, rules and phases options.
-type RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersRuleset string
-
-const (
- RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersRulesetCurrent RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersRuleset = "current"
-)
-
-func (r RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersRuleset) IsKnown() bool {
- switch r {
- case RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersRulesetCurrent:
- return true
- }
- return false
-}
-
-// The action to perform when the rule matches.
-type RulesetUpdateResponseRulesAction string
-
-const (
- RulesetUpdateResponseRulesActionBlock RulesetUpdateResponseRulesAction = "block"
- RulesetUpdateResponseRulesActionExecute RulesetUpdateResponseRulesAction = "execute"
- RulesetUpdateResponseRulesActionLog RulesetUpdateResponseRulesAction = "log"
- RulesetUpdateResponseRulesActionSkip RulesetUpdateResponseRulesAction = "skip"
-)
-
-func (r RulesetUpdateResponseRulesAction) IsKnown() bool {
- switch r {
- case RulesetUpdateResponseRulesActionBlock, RulesetUpdateResponseRulesActionExecute, RulesetUpdateResponseRulesActionLog, RulesetUpdateResponseRulesActionSkip:
- return true
- }
- return false
-}
-
-// A ruleset object.
-type RulesetListResponse struct {
- // The kind of the ruleset.
- Kind RulesetListResponseKind `json:"kind,required"`
- // The human-readable name of the ruleset.
- Name string `json:"name,required"`
- // The phase of the ruleset.
- Phase RulesetListResponsePhase `json:"phase,required"`
- // The unique ID of the ruleset.
- ID string `json:"id"`
- // An informative description of the ruleset.
- Description string `json:"description"`
- // The timestamp of when the ruleset was last modified.
- LastUpdated time.Time `json:"last_updated" format:"date-time"`
- // The version of the ruleset.
- Version string `json:"version"`
- JSON rulesetListResponseJSON `json:"-"`
-}
-
-// rulesetListResponseJSON contains the JSON metadata for the struct
-// [RulesetListResponse]
-type rulesetListResponseJSON struct {
- Kind apijson.Field
- Name apijson.Field
- Phase apijson.Field
- ID apijson.Field
- Description apijson.Field
- LastUpdated apijson.Field
- Version apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The kind of the ruleset.
-type RulesetListResponseKind string
-
-const (
- RulesetListResponseKindManaged RulesetListResponseKind = "managed"
- RulesetListResponseKindCustom RulesetListResponseKind = "custom"
- RulesetListResponseKindRoot RulesetListResponseKind = "root"
- RulesetListResponseKindZone RulesetListResponseKind = "zone"
-)
-
-func (r RulesetListResponseKind) IsKnown() bool {
- switch r {
- case RulesetListResponseKindManaged, RulesetListResponseKindCustom, RulesetListResponseKindRoot, RulesetListResponseKindZone:
+ case RulesetUpdateResponseKindManaged, RulesetUpdateResponseKindCustom, RulesetUpdateResponseKindRoot, RulesetUpdateResponseKindZone:
return true
}
return false
}
// The phase of the ruleset.
-type RulesetListResponsePhase string
+type RulesetUpdateResponsePhase string
const (
- RulesetListResponsePhaseDDoSL4 RulesetListResponsePhase = "ddos_l4"
- RulesetListResponsePhaseDDoSL7 RulesetListResponsePhase = "ddos_l7"
- RulesetListResponsePhaseHTTPConfigSettings RulesetListResponsePhase = "http_config_settings"
- RulesetListResponsePhaseHTTPCustomErrors RulesetListResponsePhase = "http_custom_errors"
- RulesetListResponsePhaseHTTPLogCustomFields RulesetListResponsePhase = "http_log_custom_fields"
- RulesetListResponsePhaseHTTPRatelimit RulesetListResponsePhase = "http_ratelimit"
- RulesetListResponsePhaseHTTPRequestCacheSettings RulesetListResponsePhase = "http_request_cache_settings"
- RulesetListResponsePhaseHTTPRequestDynamicRedirect RulesetListResponsePhase = "http_request_dynamic_redirect"
- RulesetListResponsePhaseHTTPRequestFirewallCustom RulesetListResponsePhase = "http_request_firewall_custom"
- RulesetListResponsePhaseHTTPRequestFirewallManaged RulesetListResponsePhase = "http_request_firewall_managed"
- RulesetListResponsePhaseHTTPRequestLateTransform RulesetListResponsePhase = "http_request_late_transform"
- RulesetListResponsePhaseHTTPRequestOrigin RulesetListResponsePhase = "http_request_origin"
- RulesetListResponsePhaseHTTPRequestRedirect RulesetListResponsePhase = "http_request_redirect"
- RulesetListResponsePhaseHTTPRequestSanitize RulesetListResponsePhase = "http_request_sanitize"
- RulesetListResponsePhaseHTTPRequestSbfm RulesetListResponsePhase = "http_request_sbfm"
- RulesetListResponsePhaseHTTPRequestSelectConfiguration RulesetListResponsePhase = "http_request_select_configuration"
- RulesetListResponsePhaseHTTPRequestTransform RulesetListResponsePhase = "http_request_transform"
- RulesetListResponsePhaseHTTPResponseCompression RulesetListResponsePhase = "http_response_compression"
- RulesetListResponsePhaseHTTPResponseFirewallManaged RulesetListResponsePhase = "http_response_firewall_managed"
- RulesetListResponsePhaseHTTPResponseHeadersTransform RulesetListResponsePhase = "http_response_headers_transform"
- RulesetListResponsePhaseMagicTransit RulesetListResponsePhase = "magic_transit"
- RulesetListResponsePhaseMagicTransitIDsManaged RulesetListResponsePhase = "magic_transit_ids_managed"
- RulesetListResponsePhaseMagicTransitManaged RulesetListResponsePhase = "magic_transit_managed"
+ RulesetUpdateResponsePhaseDDoSL4 RulesetUpdateResponsePhase = "ddos_l4"
+ RulesetUpdateResponsePhaseDDoSL7 RulesetUpdateResponsePhase = "ddos_l7"
+ RulesetUpdateResponsePhaseHTTPConfigSettings RulesetUpdateResponsePhase = "http_config_settings"
+ RulesetUpdateResponsePhaseHTTPCustomErrors RulesetUpdateResponsePhase = "http_custom_errors"
+ RulesetUpdateResponsePhaseHTTPLogCustomFields RulesetUpdateResponsePhase = "http_log_custom_fields"
+ RulesetUpdateResponsePhaseHTTPRatelimit RulesetUpdateResponsePhase = "http_ratelimit"
+ RulesetUpdateResponsePhaseHTTPRequestCacheSettings RulesetUpdateResponsePhase = "http_request_cache_settings"
+ RulesetUpdateResponsePhaseHTTPRequestDynamicRedirect RulesetUpdateResponsePhase = "http_request_dynamic_redirect"
+ RulesetUpdateResponsePhaseHTTPRequestFirewallCustom RulesetUpdateResponsePhase = "http_request_firewall_custom"
+ RulesetUpdateResponsePhaseHTTPRequestFirewallManaged RulesetUpdateResponsePhase = "http_request_firewall_managed"
+ RulesetUpdateResponsePhaseHTTPRequestLateTransform RulesetUpdateResponsePhase = "http_request_late_transform"
+ RulesetUpdateResponsePhaseHTTPRequestOrigin RulesetUpdateResponsePhase = "http_request_origin"
+ RulesetUpdateResponsePhaseHTTPRequestRedirect RulesetUpdateResponsePhase = "http_request_redirect"
+ RulesetUpdateResponsePhaseHTTPRequestSanitize RulesetUpdateResponsePhase = "http_request_sanitize"
+ RulesetUpdateResponsePhaseHTTPRequestSbfm RulesetUpdateResponsePhase = "http_request_sbfm"
+ RulesetUpdateResponsePhaseHTTPRequestSelectConfiguration RulesetUpdateResponsePhase = "http_request_select_configuration"
+ RulesetUpdateResponsePhaseHTTPRequestTransform RulesetUpdateResponsePhase = "http_request_transform"
+ RulesetUpdateResponsePhaseHTTPResponseCompression RulesetUpdateResponsePhase = "http_response_compression"
+ RulesetUpdateResponsePhaseHTTPResponseFirewallManaged RulesetUpdateResponsePhase = "http_response_firewall_managed"
+ RulesetUpdateResponsePhaseHTTPResponseHeadersTransform RulesetUpdateResponsePhase = "http_response_headers_transform"
+ RulesetUpdateResponsePhaseMagicTransit RulesetUpdateResponsePhase = "magic_transit"
+ RulesetUpdateResponsePhaseMagicTransitIDsManaged RulesetUpdateResponsePhase = "magic_transit_ids_managed"
+ RulesetUpdateResponsePhaseMagicTransitManaged RulesetUpdateResponsePhase = "magic_transit_managed"
)
-func (r RulesetListResponsePhase) IsKnown() bool {
+func (r RulesetUpdateResponsePhase) IsKnown() bool {
switch r {
- case RulesetListResponsePhaseDDoSL4, RulesetListResponsePhaseDDoSL7, RulesetListResponsePhaseHTTPConfigSettings, RulesetListResponsePhaseHTTPCustomErrors, RulesetListResponsePhaseHTTPLogCustomFields, RulesetListResponsePhaseHTTPRatelimit, RulesetListResponsePhaseHTTPRequestCacheSettings, RulesetListResponsePhaseHTTPRequestDynamicRedirect, RulesetListResponsePhaseHTTPRequestFirewallCustom, RulesetListResponsePhaseHTTPRequestFirewallManaged, RulesetListResponsePhaseHTTPRequestLateTransform, RulesetListResponsePhaseHTTPRequestOrigin, RulesetListResponsePhaseHTTPRequestRedirect, RulesetListResponsePhaseHTTPRequestSanitize, RulesetListResponsePhaseHTTPRequestSbfm, RulesetListResponsePhaseHTTPRequestSelectConfiguration, RulesetListResponsePhaseHTTPRequestTransform, RulesetListResponsePhaseHTTPResponseCompression, RulesetListResponsePhaseHTTPResponseFirewallManaged, RulesetListResponsePhaseHTTPResponseHeadersTransform, RulesetListResponsePhaseMagicTransit, RulesetListResponsePhaseMagicTransitIDsManaged, RulesetListResponsePhaseMagicTransitManaged:
+ case RulesetUpdateResponsePhaseDDoSL4, RulesetUpdateResponsePhaseDDoSL7, RulesetUpdateResponsePhaseHTTPConfigSettings, RulesetUpdateResponsePhaseHTTPCustomErrors, RulesetUpdateResponsePhaseHTTPLogCustomFields, RulesetUpdateResponsePhaseHTTPRatelimit, RulesetUpdateResponsePhaseHTTPRequestCacheSettings, RulesetUpdateResponsePhaseHTTPRequestDynamicRedirect, RulesetUpdateResponsePhaseHTTPRequestFirewallCustom, RulesetUpdateResponsePhaseHTTPRequestFirewallManaged, RulesetUpdateResponsePhaseHTTPRequestLateTransform, RulesetUpdateResponsePhaseHTTPRequestOrigin, RulesetUpdateResponsePhaseHTTPRequestRedirect, RulesetUpdateResponsePhaseHTTPRequestSanitize, RulesetUpdateResponsePhaseHTTPRequestSbfm, RulesetUpdateResponsePhaseHTTPRequestSelectConfiguration, RulesetUpdateResponsePhaseHTTPRequestTransform, RulesetUpdateResponsePhaseHTTPResponseCompression, RulesetUpdateResponsePhaseHTTPResponseFirewallManaged, RulesetUpdateResponsePhaseHTTPResponseHeadersTransform, RulesetUpdateResponsePhaseMagicTransit, RulesetUpdateResponsePhaseMagicTransitIDsManaged, RulesetUpdateResponsePhaseMagicTransitManaged:
return true
}
return false
@@ -2013,7 +1679,7 @@ type RulesetGetResponse struct {
// The phase of the ruleset.
Phase RulesetGetResponsePhase `json:"phase,required"`
// The list of rules in the ruleset.
- Rules []RulesetGetResponseRule `json:"rules,required"`
+ Rules []RequestRule `json:"rules,required"`
// The version of the ruleset.
Version string `json:"version,required"`
// An informative description of the ruleset.
@@ -2099,1961 +1765,254 @@ func (r RulesetGetResponsePhase) IsKnown() bool {
return false
}
-type RulesetGetResponseRule struct {
- // The action to perform when the rule matches.
- Action RulesetGetResponseRulesAction `json:"action"`
- ActionParameters interface{} `json:"action_parameters,required"`
- Categories interface{} `json:"categories,required"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // An object configuring the rule's logging behavior.
- Logging shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- // The version of the rule.
- Version string `json:"version,required"`
- JSON rulesetGetResponseRuleJSON `json:"-"`
- union RulesetGetResponseRulesUnion
+type RulesetNewParams struct {
+ // The kind of the ruleset.
+ Kind param.Field[RulesetNewParamsKind] `json:"kind,required"`
+ // The human-readable name of the ruleset.
+ Name param.Field[string] `json:"name,required"`
+ // The phase of the ruleset.
+ Phase param.Field[RulesetNewParamsPhase] `json:"phase,required"`
+ // The list of rules in the ruleset.
+ Rules param.Field[[]RequestRuleUnionParam] `json:"rules,required"`
+ // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+ AccountID param.Field[string] `path:"account_id"`
+ // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+ ZoneID param.Field[string] `path:"zone_id"`
+ // An informative description of the ruleset.
+ Description param.Field[string] `json:"description"`
}
-// rulesetGetResponseRuleJSON contains the JSON metadata for the struct
-// [RulesetGetResponseRule]
-type rulesetGetResponseRuleJSON struct {
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- ID apijson.Field
- LastUpdated apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- Version apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
+func (r RulesetNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
}
-func (r rulesetGetResponseRuleJSON) RawJSON() string {
- return r.raw
-}
+// The kind of the ruleset.
+type RulesetNewParamsKind string
-func (r *RulesetGetResponseRule) UnmarshalJSON(data []byte) (err error) {
- err = apijson.UnmarshalRoot(data, &r.union)
- if err != nil {
- return err
+const (
+ RulesetNewParamsKindManaged RulesetNewParamsKind = "managed"
+ RulesetNewParamsKindCustom RulesetNewParamsKind = "custom"
+ RulesetNewParamsKindRoot RulesetNewParamsKind = "root"
+ RulesetNewParamsKindZone RulesetNewParamsKind = "zone"
+)
+
+func (r RulesetNewParamsKind) IsKnown() bool {
+ switch r {
+ case RulesetNewParamsKindManaged, RulesetNewParamsKindCustom, RulesetNewParamsKindRoot, RulesetNewParamsKindZone:
+ return true
}
- return apijson.Port(r.union, &r)
+ return false
}
-func (r RulesetGetResponseRule) AsUnion() RulesetGetResponseRulesUnion {
- return r.union
-}
-
-// Union satisfied by [rulesets.RulesetGetResponseRulesRulesetsBlockRule],
-// [rulesets.RulesetGetResponseRulesRulesetsExecuteRule],
-// [rulesets.RulesetGetResponseRulesRulesetsLogRule] or
-// [rulesets.RulesetGetResponseRulesRulesetsSkipRule].
-type RulesetGetResponseRulesUnion interface {
- implementsRulesetsRulesetGetResponseRule()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*RulesetGetResponseRulesUnion)(nil)).Elem(),
- "action",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RulesetGetResponseRulesRulesetsBlockRule{}),
- DiscriminatorValue: "block",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RulesetGetResponseRulesRulesetsExecuteRule{}),
- DiscriminatorValue: "execute",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RulesetGetResponseRulesRulesetsLogRule{}),
- DiscriminatorValue: "log",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RulesetGetResponseRulesRulesetsSkipRule{}),
- DiscriminatorValue: "skip",
- },
- )
-}
-
-type RulesetGetResponseRulesRulesetsBlockRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action RulesetGetResponseRulesRulesetsBlockRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters RulesetGetResponseRulesRulesetsBlockRuleActionParameters `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON rulesetGetResponseRulesRulesetsBlockRuleJSON `json:"-"`
-}
-
-// rulesetGetResponseRulesRulesetsBlockRuleJSON contains the JSON metadata for the
-// struct [RulesetGetResponseRulesRulesetsBlockRule]
-type rulesetGetResponseRulesRulesetsBlockRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetGetResponseRulesRulesetsBlockRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetGetResponseRulesRulesetsBlockRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r RulesetGetResponseRulesRulesetsBlockRule) implementsRulesetsRulesetGetResponseRule() {}
-
-// The action to perform when the rule matches.
-type RulesetGetResponseRulesRulesetsBlockRuleAction string
+// The phase of the ruleset.
+type RulesetNewParamsPhase string
const (
- RulesetGetResponseRulesRulesetsBlockRuleActionBlock RulesetGetResponseRulesRulesetsBlockRuleAction = "block"
+ RulesetNewParamsPhaseDDoSL4 RulesetNewParamsPhase = "ddos_l4"
+ RulesetNewParamsPhaseDDoSL7 RulesetNewParamsPhase = "ddos_l7"
+ RulesetNewParamsPhaseHTTPConfigSettings RulesetNewParamsPhase = "http_config_settings"
+ RulesetNewParamsPhaseHTTPCustomErrors RulesetNewParamsPhase = "http_custom_errors"
+ RulesetNewParamsPhaseHTTPLogCustomFields RulesetNewParamsPhase = "http_log_custom_fields"
+ RulesetNewParamsPhaseHTTPRatelimit RulesetNewParamsPhase = "http_ratelimit"
+ RulesetNewParamsPhaseHTTPRequestCacheSettings RulesetNewParamsPhase = "http_request_cache_settings"
+ RulesetNewParamsPhaseHTTPRequestDynamicRedirect RulesetNewParamsPhase = "http_request_dynamic_redirect"
+ RulesetNewParamsPhaseHTTPRequestFirewallCustom RulesetNewParamsPhase = "http_request_firewall_custom"
+ RulesetNewParamsPhaseHTTPRequestFirewallManaged RulesetNewParamsPhase = "http_request_firewall_managed"
+ RulesetNewParamsPhaseHTTPRequestLateTransform RulesetNewParamsPhase = "http_request_late_transform"
+ RulesetNewParamsPhaseHTTPRequestOrigin RulesetNewParamsPhase = "http_request_origin"
+ RulesetNewParamsPhaseHTTPRequestRedirect RulesetNewParamsPhase = "http_request_redirect"
+ RulesetNewParamsPhaseHTTPRequestSanitize RulesetNewParamsPhase = "http_request_sanitize"
+ RulesetNewParamsPhaseHTTPRequestSbfm RulesetNewParamsPhase = "http_request_sbfm"
+ RulesetNewParamsPhaseHTTPRequestSelectConfiguration RulesetNewParamsPhase = "http_request_select_configuration"
+ RulesetNewParamsPhaseHTTPRequestTransform RulesetNewParamsPhase = "http_request_transform"
+ RulesetNewParamsPhaseHTTPResponseCompression RulesetNewParamsPhase = "http_response_compression"
+ RulesetNewParamsPhaseHTTPResponseFirewallManaged RulesetNewParamsPhase = "http_response_firewall_managed"
+ RulesetNewParamsPhaseHTTPResponseHeadersTransform RulesetNewParamsPhase = "http_response_headers_transform"
+ RulesetNewParamsPhaseMagicTransit RulesetNewParamsPhase = "magic_transit"
+ RulesetNewParamsPhaseMagicTransitIDsManaged RulesetNewParamsPhase = "magic_transit_ids_managed"
+ RulesetNewParamsPhaseMagicTransitManaged RulesetNewParamsPhase = "magic_transit_managed"
)
-func (r RulesetGetResponseRulesRulesetsBlockRuleAction) IsKnown() bool {
+func (r RulesetNewParamsPhase) IsKnown() bool {
switch r {
- case RulesetGetResponseRulesRulesetsBlockRuleActionBlock:
+ case RulesetNewParamsPhaseDDoSL4, RulesetNewParamsPhaseDDoSL7, RulesetNewParamsPhaseHTTPConfigSettings, RulesetNewParamsPhaseHTTPCustomErrors, RulesetNewParamsPhaseHTTPLogCustomFields, RulesetNewParamsPhaseHTTPRatelimit, RulesetNewParamsPhaseHTTPRequestCacheSettings, RulesetNewParamsPhaseHTTPRequestDynamicRedirect, RulesetNewParamsPhaseHTTPRequestFirewallCustom, RulesetNewParamsPhaseHTTPRequestFirewallManaged, RulesetNewParamsPhaseHTTPRequestLateTransform, RulesetNewParamsPhaseHTTPRequestOrigin, RulesetNewParamsPhaseHTTPRequestRedirect, RulesetNewParamsPhaseHTTPRequestSanitize, RulesetNewParamsPhaseHTTPRequestSbfm, RulesetNewParamsPhaseHTTPRequestSelectConfiguration, RulesetNewParamsPhaseHTTPRequestTransform, RulesetNewParamsPhaseHTTPResponseCompression, RulesetNewParamsPhaseHTTPResponseFirewallManaged, RulesetNewParamsPhaseHTTPResponseHeadersTransform, RulesetNewParamsPhaseMagicTransit, RulesetNewParamsPhaseMagicTransitIDsManaged, RulesetNewParamsPhaseMagicTransitManaged:
return true
}
return false
}
-// The parameters configuring the rule's action.
-type RulesetGetResponseRulesRulesetsBlockRuleActionParameters struct {
- // The response to show when the block is applied.
- Response RulesetGetResponseRulesRulesetsBlockRuleActionParametersResponse `json:"response"`
- JSON rulesetGetResponseRulesRulesetsBlockRuleActionParametersJSON `json:"-"`
+// A response object.
+type RulesetNewResponseEnvelope struct {
+ // A list of error messages.
+ Errors []RulesetNewResponseEnvelopeErrors `json:"errors,required"`
+ // A list of warning messages.
+ Messages []RulesetNewResponseEnvelopeMessages `json:"messages,required"`
+ // A ruleset object.
+ Result RulesetNewResponse `json:"result,required"`
+ // Whether the API call was successful.
+ Success RulesetNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON rulesetNewResponseEnvelopeJSON `json:"-"`
}
-// rulesetGetResponseRulesRulesetsBlockRuleActionParametersJSON contains the JSON
-// metadata for the struct
-// [RulesetGetResponseRulesRulesetsBlockRuleActionParameters]
-type rulesetGetResponseRulesRulesetsBlockRuleActionParametersJSON struct {
- Response apijson.Field
+// rulesetNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RulesetNewResponseEnvelope]
+type rulesetNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
-func (r *RulesetGetResponseRulesRulesetsBlockRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
+func (r *RulesetNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
-func (r rulesetGetResponseRulesRulesetsBlockRuleActionParametersJSON) RawJSON() string {
+func (r rulesetNewResponseEnvelopeJSON) RawJSON() string {
return r.raw
}
-// The response to show when the block is applied.
-type RulesetGetResponseRulesRulesetsBlockRuleActionParametersResponse struct {
- // The content to return.
- Content string `json:"content,required"`
- // The type of the content to return.
- ContentType string `json:"content_type,required"`
- // The status code to return.
- StatusCode int64 `json:"status_code,required"`
- JSON rulesetGetResponseRulesRulesetsBlockRuleActionParametersResponseJSON `json:"-"`
+// A message.
+type RulesetNewResponseEnvelopeErrors struct {
+ // A text description of this message.
+ Message string `json:"message,required"`
+ // A unique code for this message.
+ Code int64 `json:"code"`
+ // The source of this message.
+ Source RulesetNewResponseEnvelopeErrorsSource `json:"source"`
+ JSON rulesetNewResponseEnvelopeErrorsJSON `json:"-"`
}
-// rulesetGetResponseRulesRulesetsBlockRuleActionParametersResponseJSON contains
-// the JSON metadata for the struct
-// [RulesetGetResponseRulesRulesetsBlockRuleActionParametersResponse]
-type rulesetGetResponseRulesRulesetsBlockRuleActionParametersResponseJSON struct {
- Content apijson.Field
- ContentType apijson.Field
- StatusCode apijson.Field
+// rulesetNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [RulesetNewResponseEnvelopeErrors]
+type rulesetNewResponseEnvelopeErrorsJSON struct {
+ Message apijson.Field
+ Code apijson.Field
+ Source apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
-func (r *RulesetGetResponseRulesRulesetsBlockRuleActionParametersResponse) UnmarshalJSON(data []byte) (err error) {
+func (r *RulesetNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
-func (r rulesetGetResponseRulesRulesetsBlockRuleActionParametersResponseJSON) RawJSON() string {
+func (r rulesetNewResponseEnvelopeErrorsJSON) RawJSON() string {
return r.raw
}
-type RulesetGetResponseRulesRulesetsExecuteRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action RulesetGetResponseRulesRulesetsExecuteRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters RulesetGetResponseRulesRulesetsExecuteRuleActionParameters `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON rulesetGetResponseRulesRulesetsExecuteRuleJSON `json:"-"`
+// The source of this message.
+type RulesetNewResponseEnvelopeErrorsSource struct {
+ // A JSON pointer to the field that is the source of the message.
+ Pointer string `json:"pointer,required"`
+ JSON rulesetNewResponseEnvelopeErrorsSourceJSON `json:"-"`
}
-// rulesetGetResponseRulesRulesetsExecuteRuleJSON contains the JSON metadata for
-// the struct [RulesetGetResponseRulesRulesetsExecuteRule]
-type rulesetGetResponseRulesRulesetsExecuteRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
+// rulesetNewResponseEnvelopeErrorsSourceJSON contains the JSON metadata for the
+// struct [RulesetNewResponseEnvelopeErrorsSource]
+type rulesetNewResponseEnvelopeErrorsSourceJSON struct {
+ Pointer apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
}
-func (r *RulesetGetResponseRulesRulesetsExecuteRule) UnmarshalJSON(data []byte) (err error) {
+func (r *RulesetNewResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
-func (r rulesetGetResponseRulesRulesetsExecuteRuleJSON) RawJSON() string {
+func (r rulesetNewResponseEnvelopeErrorsSourceJSON) RawJSON() string {
return r.raw
}
-func (r RulesetGetResponseRulesRulesetsExecuteRule) implementsRulesetsRulesetGetResponseRule() {}
-
-// The action to perform when the rule matches.
-type RulesetGetResponseRulesRulesetsExecuteRuleAction string
-
-const (
- RulesetGetResponseRulesRulesetsExecuteRuleActionExecute RulesetGetResponseRulesRulesetsExecuteRuleAction = "execute"
-)
-
-func (r RulesetGetResponseRulesRulesetsExecuteRuleAction) IsKnown() bool {
- switch r {
- case RulesetGetResponseRulesRulesetsExecuteRuleActionExecute:
- return true
- }
- return false
-}
-
-// The parameters configuring the rule's action.
-type RulesetGetResponseRulesRulesetsExecuteRuleActionParameters struct {
- // The ID of the ruleset to execute.
- ID string `json:"id,required"`
- // The configuration to use for matched data logging.
- MatchedData RulesetGetResponseRulesRulesetsExecuteRuleActionParametersMatchedData `json:"matched_data"`
- // A set of overrides to apply to the target ruleset.
- Overrides RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverrides `json:"overrides"`
- JSON rulesetGetResponseRulesRulesetsExecuteRuleActionParametersJSON `json:"-"`
+// A message.
+type RulesetNewResponseEnvelopeMessages struct {
+ // A text description of this message.
+ Message string `json:"message,required"`
+ // A unique code for this message.
+ Code int64 `json:"code"`
+ // The source of this message.
+ Source RulesetNewResponseEnvelopeMessagesSource `json:"source"`
+ JSON rulesetNewResponseEnvelopeMessagesJSON `json:"-"`
}
-// rulesetGetResponseRulesRulesetsExecuteRuleActionParametersJSON contains the JSON
-// metadata for the struct
-// [RulesetGetResponseRulesRulesetsExecuteRuleActionParameters]
-type rulesetGetResponseRulesRulesetsExecuteRuleActionParametersJSON struct {
- ID apijson.Field
- MatchedData apijson.Field
- Overrides apijson.Field
+// rulesetNewResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [RulesetNewResponseEnvelopeMessages]
+type rulesetNewResponseEnvelopeMessagesJSON struct {
+ Message apijson.Field
+ Code apijson.Field
+ Source apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
-func (r *RulesetGetResponseRulesRulesetsExecuteRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
+func (r *RulesetNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
-func (r rulesetGetResponseRulesRulesetsExecuteRuleActionParametersJSON) RawJSON() string {
+func (r rulesetNewResponseEnvelopeMessagesJSON) RawJSON() string {
return r.raw
}
-// The configuration to use for matched data logging.
-type RulesetGetResponseRulesRulesetsExecuteRuleActionParametersMatchedData struct {
- // The public key to encrypt matched data logs with.
- PublicKey string `json:"public_key,required"`
- JSON rulesetGetResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON `json:"-"`
+// The source of this message.
+type RulesetNewResponseEnvelopeMessagesSource struct {
+ // A JSON pointer to the field that is the source of the message.
+ Pointer string `json:"pointer,required"`
+ JSON rulesetNewResponseEnvelopeMessagesSourceJSON `json:"-"`
}
-// rulesetGetResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON
-// contains the JSON metadata for the struct
-// [RulesetGetResponseRulesRulesetsExecuteRuleActionParametersMatchedData]
-type rulesetGetResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON struct {
- PublicKey apijson.Field
+// rulesetNewResponseEnvelopeMessagesSourceJSON contains the JSON metadata for the
+// struct [RulesetNewResponseEnvelopeMessagesSource]
+type rulesetNewResponseEnvelopeMessagesSourceJSON struct {
+ Pointer apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
-func (r *RulesetGetResponseRulesRulesetsExecuteRuleActionParametersMatchedData) UnmarshalJSON(data []byte) (err error) {
+func (r *RulesetNewResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
-func (r rulesetGetResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON) RawJSON() string {
+func (r rulesetNewResponseEnvelopeMessagesSourceJSON) RawJSON() string {
return r.raw
}
-// A set of overrides to apply to the target ruleset.
-type RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverrides struct {
- // An action to override all rules with. This option has lower precedence than rule
- // and category overrides.
- Action string `json:"action"`
- // A list of category-level overrides. This option has the second-highest
- // precedence after rule-level overrides.
- Categories []RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory `json:"categories"`
- // Whether to enable execution of all rules. This option has lower precedence than
- // rule and category overrides.
- Enabled bool `json:"enabled"`
- // A list of rule-level overrides. This option has the highest precedence.
- Rules []RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRule `json:"rules"`
- // A sensitivity level to set for all rules. This option has lower precedence than
- // rule and category overrides and is only applicable for DDoS phases.
- SensitivityLevel RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel `json:"sensitivity_level"`
- JSON rulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON `json:"-"`
-}
-
-// rulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON contains
-// the JSON metadata for the struct
-// [RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverrides]
-type rulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON struct {
- Action apijson.Field
- Categories apijson.Field
- Enabled apijson.Field
- Rules apijson.Field
- SensitivityLevel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverrides) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON) RawJSON() string {
- return r.raw
-}
-
-// A category-level override
-type RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory struct {
- // The name of the category to override.
- Category string `json:"category,required"`
- // The action to override rules in the category with.
- Action string `json:"action"`
- // Whether to enable execution of rules in the category.
- Enabled bool `json:"enabled"`
- // The sensitivity level to use for rules in the category.
- SensitivityLevel RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel `json:"sensitivity_level"`
- JSON rulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON `json:"-"`
-}
-
-// rulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON
-// contains the JSON metadata for the struct
-// [RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory]
-type rulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON struct {
- Category apijson.Field
- Action apijson.Field
- Enabled apijson.Field
- SensitivityLevel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON) RawJSON() string {
- return r.raw
-}
-
-// The sensitivity level to use for rules in the category.
-type RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel string
-
-const (
- RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "default"
- RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "medium"
- RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "low"
- RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "eoff"
-)
-
-func (r RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel) IsKnown() bool {
- switch r {
- case RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault, RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium, RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow, RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff:
- return true
- }
- return false
-}
-
-// A rule-level override
-type RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRule struct {
- // The ID of the rule to override.
- ID string `json:"id,required"`
- // The action to override the rule with.
- Action string `json:"action"`
- // Whether to enable execution of the rule.
- Enabled bool `json:"enabled"`
- // The score threshold to use for the rule.
- ScoreThreshold int64 `json:"score_threshold"`
- // The sensitivity level to use for the rule.
- SensitivityLevel RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel `json:"sensitivity_level"`
- JSON rulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON `json:"-"`
-}
-
-// rulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON
-// contains the JSON metadata for the struct
-// [RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRule]
-type rulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON struct {
- ID apijson.Field
- Action apijson.Field
- Enabled apijson.Field
- ScoreThreshold apijson.Field
- SensitivityLevel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON) RawJSON() string {
- return r.raw
-}
-
-// The sensitivity level to use for the rule.
-type RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel string
-
-const (
- RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "default"
- RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "medium"
- RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "low"
- RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "eoff"
-)
-
-func (r RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel) IsKnown() bool {
- switch r {
- case RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault, RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium, RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow, RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff:
- return true
- }
- return false
-}
-
-// A sensitivity level to set for all rules. This option has lower precedence than
-// rule and category overrides and is only applicable for DDoS phases.
-type RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel string
-
-const (
- RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "default"
- RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "medium"
- RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "low"
- RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "eoff"
-)
-
-func (r RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel) IsKnown() bool {
- switch r {
- case RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault, RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium, RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow, RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff:
- return true
- }
- return false
-}
-
-type RulesetGetResponseRulesRulesetsLogRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action RulesetGetResponseRulesRulesetsLogRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters interface{} `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON rulesetGetResponseRulesRulesetsLogRuleJSON `json:"-"`
-}
-
-// rulesetGetResponseRulesRulesetsLogRuleJSON contains the JSON metadata for the
-// struct [RulesetGetResponseRulesRulesetsLogRule]
-type rulesetGetResponseRulesRulesetsLogRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetGetResponseRulesRulesetsLogRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetGetResponseRulesRulesetsLogRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r RulesetGetResponseRulesRulesetsLogRule) implementsRulesetsRulesetGetResponseRule() {}
-
-// The action to perform when the rule matches.
-type RulesetGetResponseRulesRulesetsLogRuleAction string
-
-const (
- RulesetGetResponseRulesRulesetsLogRuleActionLog RulesetGetResponseRulesRulesetsLogRuleAction = "log"
-)
-
-func (r RulesetGetResponseRulesRulesetsLogRuleAction) IsKnown() bool {
- switch r {
- case RulesetGetResponseRulesRulesetsLogRuleActionLog:
- return true
- }
- return false
-}
-
-type RulesetGetResponseRulesRulesetsSkipRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action RulesetGetResponseRulesRulesetsSkipRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters RulesetGetResponseRulesRulesetsSkipRuleActionParameters `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON rulesetGetResponseRulesRulesetsSkipRuleJSON `json:"-"`
-}
-
-// rulesetGetResponseRulesRulesetsSkipRuleJSON contains the JSON metadata for the
-// struct [RulesetGetResponseRulesRulesetsSkipRule]
-type rulesetGetResponseRulesRulesetsSkipRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetGetResponseRulesRulesetsSkipRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetGetResponseRulesRulesetsSkipRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r RulesetGetResponseRulesRulesetsSkipRule) implementsRulesetsRulesetGetResponseRule() {}
-
-// The action to perform when the rule matches.
-type RulesetGetResponseRulesRulesetsSkipRuleAction string
-
-const (
- RulesetGetResponseRulesRulesetsSkipRuleActionSkip RulesetGetResponseRulesRulesetsSkipRuleAction = "skip"
-)
-
-func (r RulesetGetResponseRulesRulesetsSkipRuleAction) IsKnown() bool {
- switch r {
- case RulesetGetResponseRulesRulesetsSkipRuleActionSkip:
- return true
- }
- return false
-}
-
-// The parameters configuring the rule's action.
-type RulesetGetResponseRulesRulesetsSkipRuleActionParameters struct {
- // A list of phases to skip the execution of. This option is incompatible with the
- // ruleset and rulesets options.
- Phases []RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase `json:"phases"`
- // A list of legacy security products to skip the execution of.
- Products []RulesetGetResponseRulesRulesetsSkipRuleActionParametersProduct `json:"products"`
- // A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the
- // execution of. This option is incompatible with the ruleset option.
- Rules map[string][]string `json:"rules"`
- // A ruleset to skip the execution of. This option is incompatible with the
- // rulesets, rules and phases options.
- Ruleset RulesetGetResponseRulesRulesetsSkipRuleActionParametersRuleset `json:"ruleset"`
- // A list of ruleset IDs to skip the execution of. This option is incompatible with
- // the ruleset and phases options.
- Rulesets []string `json:"rulesets"`
- JSON rulesetGetResponseRulesRulesetsSkipRuleActionParametersJSON `json:"-"`
-}
-
-// rulesetGetResponseRulesRulesetsSkipRuleActionParametersJSON contains the JSON
-// metadata for the struct
-// [RulesetGetResponseRulesRulesetsSkipRuleActionParameters]
-type rulesetGetResponseRulesRulesetsSkipRuleActionParametersJSON struct {
- Phases apijson.Field
- Products apijson.Field
- Rules apijson.Field
- Ruleset apijson.Field
- Rulesets apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetGetResponseRulesRulesetsSkipRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetGetResponseRulesRulesetsSkipRuleActionParametersJSON) RawJSON() string {
- return r.raw
-}
-
-// A phase to skip the execution of.
-type RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase string
-
-const (
- RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseDDoSL4 RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l4"
- RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseDDoSL7 RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l7"
- RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_config_settings"
- RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_custom_errors"
- RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_log_custom_fields"
- RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRatelimit RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_ratelimit"
- RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_cache_settings"
- RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_dynamic_redirect"
- RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_custom"
- RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_managed"
- RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_late_transform"
- RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_origin"
- RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_redirect"
- RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sanitize"
- RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sbfm"
- RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_select_configuration"
- RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_transform"
- RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_compression"
- RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_firewall_managed"
- RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_headers_transform"
- RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransit RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit"
- RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_ids_managed"
- RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitManaged RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_managed"
-)
-
-func (r RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase) IsKnown() bool {
- switch r {
- case RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseDDoSL4, RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseDDoSL7, RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings, RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors, RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields, RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRatelimit, RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings, RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect, RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom, RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged, RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform, RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin, RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect, RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize, RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm, RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration, RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform, RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression, RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged, RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform, RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransit, RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged, RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitManaged:
- return true
- }
- return false
-}
-
-// The name of a legacy security product to skip the execution of.
-type RulesetGetResponseRulesRulesetsSkipRuleActionParametersProduct string
-
-const (
- RulesetGetResponseRulesRulesetsSkipRuleActionParametersProductBic RulesetGetResponseRulesRulesetsSkipRuleActionParametersProduct = "bic"
- RulesetGetResponseRulesRulesetsSkipRuleActionParametersProductHot RulesetGetResponseRulesRulesetsSkipRuleActionParametersProduct = "hot"
- RulesetGetResponseRulesRulesetsSkipRuleActionParametersProductRateLimit RulesetGetResponseRulesRulesetsSkipRuleActionParametersProduct = "rateLimit"
- RulesetGetResponseRulesRulesetsSkipRuleActionParametersProductSecurityLevel RulesetGetResponseRulesRulesetsSkipRuleActionParametersProduct = "securityLevel"
- RulesetGetResponseRulesRulesetsSkipRuleActionParametersProductUABlock RulesetGetResponseRulesRulesetsSkipRuleActionParametersProduct = "uaBlock"
- RulesetGetResponseRulesRulesetsSkipRuleActionParametersProductWAF RulesetGetResponseRulesRulesetsSkipRuleActionParametersProduct = "waf"
- RulesetGetResponseRulesRulesetsSkipRuleActionParametersProductZoneLockdown RulesetGetResponseRulesRulesetsSkipRuleActionParametersProduct = "zoneLockdown"
-)
-
-func (r RulesetGetResponseRulesRulesetsSkipRuleActionParametersProduct) IsKnown() bool {
- switch r {
- case RulesetGetResponseRulesRulesetsSkipRuleActionParametersProductBic, RulesetGetResponseRulesRulesetsSkipRuleActionParametersProductHot, RulesetGetResponseRulesRulesetsSkipRuleActionParametersProductRateLimit, RulesetGetResponseRulesRulesetsSkipRuleActionParametersProductSecurityLevel, RulesetGetResponseRulesRulesetsSkipRuleActionParametersProductUABlock, RulesetGetResponseRulesRulesetsSkipRuleActionParametersProductWAF, RulesetGetResponseRulesRulesetsSkipRuleActionParametersProductZoneLockdown:
- return true
- }
- return false
-}
-
-// A ruleset to skip the execution of. This option is incompatible with the
-// rulesets, rules and phases options.
-type RulesetGetResponseRulesRulesetsSkipRuleActionParametersRuleset string
-
-const (
- RulesetGetResponseRulesRulesetsSkipRuleActionParametersRulesetCurrent RulesetGetResponseRulesRulesetsSkipRuleActionParametersRuleset = "current"
-)
-
-func (r RulesetGetResponseRulesRulesetsSkipRuleActionParametersRuleset) IsKnown() bool {
- switch r {
- case RulesetGetResponseRulesRulesetsSkipRuleActionParametersRulesetCurrent:
- return true
- }
- return false
-}
-
-// The action to perform when the rule matches.
-type RulesetGetResponseRulesAction string
-
-const (
- RulesetGetResponseRulesActionBlock RulesetGetResponseRulesAction = "block"
- RulesetGetResponseRulesActionExecute RulesetGetResponseRulesAction = "execute"
- RulesetGetResponseRulesActionLog RulesetGetResponseRulesAction = "log"
- RulesetGetResponseRulesActionSkip RulesetGetResponseRulesAction = "skip"
-)
-
-func (r RulesetGetResponseRulesAction) IsKnown() bool {
- switch r {
- case RulesetGetResponseRulesActionBlock, RulesetGetResponseRulesActionExecute, RulesetGetResponseRulesActionLog, RulesetGetResponseRulesActionSkip:
- return true
- }
- return false
-}
-
-type RulesetNewParams struct {
- // The kind of the ruleset.
- Kind param.Field[RulesetNewParamsKind] `json:"kind,required"`
- // The human-readable name of the ruleset.
- Name param.Field[string] `json:"name,required"`
- // The phase of the ruleset.
- Phase param.Field[RulesetNewParamsPhase] `json:"phase,required"`
- // The list of rules in the ruleset.
- Rules param.Field[[]RulesetNewParamsRuleUnion] `json:"rules,required"`
- // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
- AccountID param.Field[string] `path:"account_id"`
- // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- ZoneID param.Field[string] `path:"zone_id"`
- // An informative description of the ruleset.
- Description param.Field[string] `json:"description"`
-}
-
-func (r RulesetNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The kind of the ruleset.
-type RulesetNewParamsKind string
-
-const (
- RulesetNewParamsKindManaged RulesetNewParamsKind = "managed"
- RulesetNewParamsKindCustom RulesetNewParamsKind = "custom"
- RulesetNewParamsKindRoot RulesetNewParamsKind = "root"
- RulesetNewParamsKindZone RulesetNewParamsKind = "zone"
-)
-
-func (r RulesetNewParamsKind) IsKnown() bool {
- switch r {
- case RulesetNewParamsKindManaged, RulesetNewParamsKindCustom, RulesetNewParamsKindRoot, RulesetNewParamsKindZone:
- return true
- }
- return false
-}
-
-// The phase of the ruleset.
-type RulesetNewParamsPhase string
-
-const (
- RulesetNewParamsPhaseDDoSL4 RulesetNewParamsPhase = "ddos_l4"
- RulesetNewParamsPhaseDDoSL7 RulesetNewParamsPhase = "ddos_l7"
- RulesetNewParamsPhaseHTTPConfigSettings RulesetNewParamsPhase = "http_config_settings"
- RulesetNewParamsPhaseHTTPCustomErrors RulesetNewParamsPhase = "http_custom_errors"
- RulesetNewParamsPhaseHTTPLogCustomFields RulesetNewParamsPhase = "http_log_custom_fields"
- RulesetNewParamsPhaseHTTPRatelimit RulesetNewParamsPhase = "http_ratelimit"
- RulesetNewParamsPhaseHTTPRequestCacheSettings RulesetNewParamsPhase = "http_request_cache_settings"
- RulesetNewParamsPhaseHTTPRequestDynamicRedirect RulesetNewParamsPhase = "http_request_dynamic_redirect"
- RulesetNewParamsPhaseHTTPRequestFirewallCustom RulesetNewParamsPhase = "http_request_firewall_custom"
- RulesetNewParamsPhaseHTTPRequestFirewallManaged RulesetNewParamsPhase = "http_request_firewall_managed"
- RulesetNewParamsPhaseHTTPRequestLateTransform RulesetNewParamsPhase = "http_request_late_transform"
- RulesetNewParamsPhaseHTTPRequestOrigin RulesetNewParamsPhase = "http_request_origin"
- RulesetNewParamsPhaseHTTPRequestRedirect RulesetNewParamsPhase = "http_request_redirect"
- RulesetNewParamsPhaseHTTPRequestSanitize RulesetNewParamsPhase = "http_request_sanitize"
- RulesetNewParamsPhaseHTTPRequestSbfm RulesetNewParamsPhase = "http_request_sbfm"
- RulesetNewParamsPhaseHTTPRequestSelectConfiguration RulesetNewParamsPhase = "http_request_select_configuration"
- RulesetNewParamsPhaseHTTPRequestTransform RulesetNewParamsPhase = "http_request_transform"
- RulesetNewParamsPhaseHTTPResponseCompression RulesetNewParamsPhase = "http_response_compression"
- RulesetNewParamsPhaseHTTPResponseFirewallManaged RulesetNewParamsPhase = "http_response_firewall_managed"
- RulesetNewParamsPhaseHTTPResponseHeadersTransform RulesetNewParamsPhase = "http_response_headers_transform"
- RulesetNewParamsPhaseMagicTransit RulesetNewParamsPhase = "magic_transit"
- RulesetNewParamsPhaseMagicTransitIDsManaged RulesetNewParamsPhase = "magic_transit_ids_managed"
- RulesetNewParamsPhaseMagicTransitManaged RulesetNewParamsPhase = "magic_transit_managed"
-)
-
-func (r RulesetNewParamsPhase) IsKnown() bool {
- switch r {
- case RulesetNewParamsPhaseDDoSL4, RulesetNewParamsPhaseDDoSL7, RulesetNewParamsPhaseHTTPConfigSettings, RulesetNewParamsPhaseHTTPCustomErrors, RulesetNewParamsPhaseHTTPLogCustomFields, RulesetNewParamsPhaseHTTPRatelimit, RulesetNewParamsPhaseHTTPRequestCacheSettings, RulesetNewParamsPhaseHTTPRequestDynamicRedirect, RulesetNewParamsPhaseHTTPRequestFirewallCustom, RulesetNewParamsPhaseHTTPRequestFirewallManaged, RulesetNewParamsPhaseHTTPRequestLateTransform, RulesetNewParamsPhaseHTTPRequestOrigin, RulesetNewParamsPhaseHTTPRequestRedirect, RulesetNewParamsPhaseHTTPRequestSanitize, RulesetNewParamsPhaseHTTPRequestSbfm, RulesetNewParamsPhaseHTTPRequestSelectConfiguration, RulesetNewParamsPhaseHTTPRequestTransform, RulesetNewParamsPhaseHTTPResponseCompression, RulesetNewParamsPhaseHTTPResponseFirewallManaged, RulesetNewParamsPhaseHTTPResponseHeadersTransform, RulesetNewParamsPhaseMagicTransit, RulesetNewParamsPhaseMagicTransitIDsManaged, RulesetNewParamsPhaseMagicTransitManaged:
- return true
- }
- return false
-}
-
-type RulesetNewParamsRule struct {
- // The action to perform when the rule matches.
- Action param.Field[RulesetNewParamsRulesAction] `json:"action"`
- ActionParameters param.Field[interface{}] `json:"action_parameters,required"`
- Categories param.Field[interface{}] `json:"categories,required"`
- // An informative description of the rule.
- Description param.Field[string] `json:"description"`
- // Whether the rule should be executed.
- Enabled param.Field[bool] `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression param.Field[string] `json:"expression"`
- // The unique ID of the rule.
- ID param.Field[string] `json:"id"`
- // An object configuring the rule's logging behavior.
- Logging param.Field[shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751cParam] `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref param.Field[string] `json:"ref"`
-}
-
-func (r RulesetNewParamsRule) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-func (r RulesetNewParamsRule) implementsRulesetsRulesetNewParamsRuleUnion() {}
-
-// Satisfied by [rulesets.RulesetNewParamsRulesRulesetsBlockRule],
-// [rulesets.RulesetNewParamsRulesRulesetsExecuteRule],
-// [rulesets.RulesetNewParamsRulesRulesetsLogRule],
-// [rulesets.RulesetNewParamsRulesRulesetsSkipRule], [RulesetNewParamsRule].
-type RulesetNewParamsRuleUnion interface {
- implementsRulesetsRulesetNewParamsRuleUnion()
-}
-
-type RulesetNewParamsRulesRulesetsBlockRule struct {
- // The unique ID of the rule.
- ID param.Field[string] `json:"id"`
- // The action to perform when the rule matches.
- Action param.Field[RulesetNewParamsRulesRulesetsBlockRuleAction] `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters param.Field[RulesetNewParamsRulesRulesetsBlockRuleActionParameters] `json:"action_parameters"`
- // An informative description of the rule.
- Description param.Field[string] `json:"description"`
- // Whether the rule should be executed.
- Enabled param.Field[bool] `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression param.Field[string] `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging param.Field[shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751cParam] `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref param.Field[string] `json:"ref"`
-}
-
-func (r RulesetNewParamsRulesRulesetsBlockRule) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-func (r RulesetNewParamsRulesRulesetsBlockRule) implementsRulesetsRulesetNewParamsRuleUnion() {}
-
-// The action to perform when the rule matches.
-type RulesetNewParamsRulesRulesetsBlockRuleAction string
-
-const (
- RulesetNewParamsRulesRulesetsBlockRuleActionBlock RulesetNewParamsRulesRulesetsBlockRuleAction = "block"
-)
-
-func (r RulesetNewParamsRulesRulesetsBlockRuleAction) IsKnown() bool {
- switch r {
- case RulesetNewParamsRulesRulesetsBlockRuleActionBlock:
- return true
- }
- return false
-}
-
-// The parameters configuring the rule's action.
-type RulesetNewParamsRulesRulesetsBlockRuleActionParameters struct {
- // The response to show when the block is applied.
- Response param.Field[RulesetNewParamsRulesRulesetsBlockRuleActionParametersResponse] `json:"response"`
-}
-
-func (r RulesetNewParamsRulesRulesetsBlockRuleActionParameters) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The response to show when the block is applied.
-type RulesetNewParamsRulesRulesetsBlockRuleActionParametersResponse struct {
- // The content to return.
- Content param.Field[string] `json:"content,required"`
- // The type of the content to return.
- ContentType param.Field[string] `json:"content_type,required"`
- // The status code to return.
- StatusCode param.Field[int64] `json:"status_code,required"`
-}
-
-func (r RulesetNewParamsRulesRulesetsBlockRuleActionParametersResponse) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type RulesetNewParamsRulesRulesetsExecuteRule struct {
- // The unique ID of the rule.
- ID param.Field[string] `json:"id"`
- // The action to perform when the rule matches.
- Action param.Field[RulesetNewParamsRulesRulesetsExecuteRuleAction] `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters param.Field[RulesetNewParamsRulesRulesetsExecuteRuleActionParameters] `json:"action_parameters"`
- // An informative description of the rule.
- Description param.Field[string] `json:"description"`
- // Whether the rule should be executed.
- Enabled param.Field[bool] `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression param.Field[string] `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging param.Field[shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751cParam] `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref param.Field[string] `json:"ref"`
-}
-
-func (r RulesetNewParamsRulesRulesetsExecuteRule) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-func (r RulesetNewParamsRulesRulesetsExecuteRule) implementsRulesetsRulesetNewParamsRuleUnion() {}
-
-// The action to perform when the rule matches.
-type RulesetNewParamsRulesRulesetsExecuteRuleAction string
-
-const (
- RulesetNewParamsRulesRulesetsExecuteRuleActionExecute RulesetNewParamsRulesRulesetsExecuteRuleAction = "execute"
-)
-
-func (r RulesetNewParamsRulesRulesetsExecuteRuleAction) IsKnown() bool {
- switch r {
- case RulesetNewParamsRulesRulesetsExecuteRuleActionExecute:
- return true
- }
- return false
-}
-
-// The parameters configuring the rule's action.
-type RulesetNewParamsRulesRulesetsExecuteRuleActionParameters struct {
- // The ID of the ruleset to execute.
- ID param.Field[string] `json:"id,required"`
- // The configuration to use for matched data logging.
- MatchedData param.Field[RulesetNewParamsRulesRulesetsExecuteRuleActionParametersMatchedData] `json:"matched_data"`
- // A set of overrides to apply to the target ruleset.
- Overrides param.Field[RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverrides] `json:"overrides"`
-}
-
-func (r RulesetNewParamsRulesRulesetsExecuteRuleActionParameters) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The configuration to use for matched data logging.
-type RulesetNewParamsRulesRulesetsExecuteRuleActionParametersMatchedData struct {
- // The public key to encrypt matched data logs with.
- PublicKey param.Field[string] `json:"public_key,required"`
-}
-
-func (r RulesetNewParamsRulesRulesetsExecuteRuleActionParametersMatchedData) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// A set of overrides to apply to the target ruleset.
-type RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverrides struct {
- // An action to override all rules with. This option has lower precedence than rule
- // and category overrides.
- Action param.Field[string] `json:"action"`
- // A list of category-level overrides. This option has the second-highest
- // precedence after rule-level overrides.
- Categories param.Field[[]RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesCategory] `json:"categories"`
- // Whether to enable execution of all rules. This option has lower precedence than
- // rule and category overrides.
- Enabled param.Field[bool] `json:"enabled"`
- // A list of rule-level overrides. This option has the highest precedence.
- Rules param.Field[[]RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesRule] `json:"rules"`
- // A sensitivity level to set for all rules. This option has lower precedence than
- // rule and category overrides and is only applicable for DDoS phases.
- SensitivityLevel param.Field[RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel] `json:"sensitivity_level"`
-}
-
-func (r RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverrides) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// A category-level override
-type RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesCategory struct {
- // The name of the category to override.
- Category param.Field[string] `json:"category,required"`
- // The action to override rules in the category with.
- Action param.Field[string] `json:"action"`
- // Whether to enable execution of rules in the category.
- Enabled param.Field[bool] `json:"enabled"`
- // The sensitivity level to use for rules in the category.
- SensitivityLevel param.Field[RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel] `json:"sensitivity_level"`
-}
-
-func (r RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesCategory) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The sensitivity level to use for rules in the category.
-type RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel string
-
-const (
- RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "default"
- RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "medium"
- RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "low"
- RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "eoff"
-)
-
-func (r RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel) IsKnown() bool {
- switch r {
- case RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault, RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium, RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow, RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff:
- return true
- }
- return false
-}
-
-// A rule-level override
-type RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesRule struct {
- // The ID of the rule to override.
- ID param.Field[string] `json:"id,required"`
- // The action to override the rule with.
- Action param.Field[string] `json:"action"`
- // Whether to enable execution of the rule.
- Enabled param.Field[bool] `json:"enabled"`
- // The score threshold to use for the rule.
- ScoreThreshold param.Field[int64] `json:"score_threshold"`
- // The sensitivity level to use for the rule.
- SensitivityLevel param.Field[RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel] `json:"sensitivity_level"`
-}
-
-func (r RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesRule) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The sensitivity level to use for the rule.
-type RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel string
-
-const (
- RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "default"
- RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "medium"
- RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "low"
- RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "eoff"
-)
-
-func (r RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel) IsKnown() bool {
- switch r {
- case RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault, RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium, RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow, RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff:
- return true
- }
- return false
-}
-
-// A sensitivity level to set for all rules. This option has lower precedence than
-// rule and category overrides and is only applicable for DDoS phases.
-type RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel string
-
-const (
- RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "default"
- RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "medium"
- RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "low"
- RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "eoff"
-)
-
-func (r RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel) IsKnown() bool {
- switch r {
- case RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault, RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium, RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow, RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff:
- return true
- }
- return false
-}
-
-type RulesetNewParamsRulesRulesetsLogRule struct {
- // The unique ID of the rule.
- ID param.Field[string] `json:"id"`
- // The action to perform when the rule matches.
- Action param.Field[RulesetNewParamsRulesRulesetsLogRuleAction] `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters param.Field[interface{}] `json:"action_parameters"`
- // An informative description of the rule.
- Description param.Field[string] `json:"description"`
- // Whether the rule should be executed.
- Enabled param.Field[bool] `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression param.Field[string] `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging param.Field[shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751cParam] `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref param.Field[string] `json:"ref"`
-}
-
-func (r RulesetNewParamsRulesRulesetsLogRule) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-func (r RulesetNewParamsRulesRulesetsLogRule) implementsRulesetsRulesetNewParamsRuleUnion() {}
-
-// The action to perform when the rule matches.
-type RulesetNewParamsRulesRulesetsLogRuleAction string
-
-const (
- RulesetNewParamsRulesRulesetsLogRuleActionLog RulesetNewParamsRulesRulesetsLogRuleAction = "log"
-)
-
-func (r RulesetNewParamsRulesRulesetsLogRuleAction) IsKnown() bool {
- switch r {
- case RulesetNewParamsRulesRulesetsLogRuleActionLog:
- return true
- }
- return false
-}
-
-type RulesetNewParamsRulesRulesetsSkipRule struct {
- // The unique ID of the rule.
- ID param.Field[string] `json:"id"`
- // The action to perform when the rule matches.
- Action param.Field[RulesetNewParamsRulesRulesetsSkipRuleAction] `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters param.Field[RulesetNewParamsRulesRulesetsSkipRuleActionParameters] `json:"action_parameters"`
- // An informative description of the rule.
- Description param.Field[string] `json:"description"`
- // Whether the rule should be executed.
- Enabled param.Field[bool] `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression param.Field[string] `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging param.Field[shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751cParam] `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref param.Field[string] `json:"ref"`
-}
-
-func (r RulesetNewParamsRulesRulesetsSkipRule) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-func (r RulesetNewParamsRulesRulesetsSkipRule) implementsRulesetsRulesetNewParamsRuleUnion() {}
-
-// The action to perform when the rule matches.
-type RulesetNewParamsRulesRulesetsSkipRuleAction string
-
-const (
- RulesetNewParamsRulesRulesetsSkipRuleActionSkip RulesetNewParamsRulesRulesetsSkipRuleAction = "skip"
-)
-
-func (r RulesetNewParamsRulesRulesetsSkipRuleAction) IsKnown() bool {
- switch r {
- case RulesetNewParamsRulesRulesetsSkipRuleActionSkip:
- return true
- }
- return false
-}
-
-// The parameters configuring the rule's action.
-type RulesetNewParamsRulesRulesetsSkipRuleActionParameters struct {
- // A list of phases to skip the execution of. This option is incompatible with the
- // ruleset and rulesets options.
- Phases param.Field[[]RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase] `json:"phases"`
- // A list of legacy security products to skip the execution of.
- Products param.Field[[]RulesetNewParamsRulesRulesetsSkipRuleActionParametersProduct] `json:"products"`
- // A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the
- // execution of. This option is incompatible with the ruleset option.
- Rules param.Field[map[string][]string] `json:"rules"`
- // A ruleset to skip the execution of. This option is incompatible with the
- // rulesets, rules and phases options.
- Ruleset param.Field[RulesetNewParamsRulesRulesetsSkipRuleActionParametersRuleset] `json:"ruleset"`
- // A list of ruleset IDs to skip the execution of. This option is incompatible with
- // the ruleset and phases options.
- Rulesets param.Field[[]string] `json:"rulesets"`
-}
-
-func (r RulesetNewParamsRulesRulesetsSkipRuleActionParameters) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// A phase to skip the execution of.
-type RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase string
-
-const (
- RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseDDoSL4 RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "ddos_l4"
- RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseDDoSL7 RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "ddos_l7"
- RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "http_config_settings"
- RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "http_custom_errors"
- RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "http_log_custom_fields"
- RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRatelimit RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "http_ratelimit"
- RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_cache_settings"
- RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_dynamic_redirect"
- RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_custom"
- RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_managed"
- RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_late_transform"
- RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_origin"
- RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_redirect"
- RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_sanitize"
- RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_sbfm"
- RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_select_configuration"
- RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_transform"
- RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "http_response_compression"
- RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "http_response_firewall_managed"
- RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "http_response_headers_transform"
- RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseMagicTransit RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "magic_transit"
- RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_ids_managed"
- RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseMagicTransitManaged RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_managed"
-)
-
-func (r RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase) IsKnown() bool {
- switch r {
- case RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseDDoSL4, RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseDDoSL7, RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings, RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors, RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields, RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRatelimit, RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings, RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect, RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom, RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged, RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform, RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin, RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect, RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize, RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm, RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration, RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform, RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression, RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged, RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform, RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseMagicTransit, RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged, RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseMagicTransitManaged:
- return true
- }
- return false
-}
-
-// The name of a legacy security product to skip the execution of.
-type RulesetNewParamsRulesRulesetsSkipRuleActionParametersProduct string
-
-const (
- RulesetNewParamsRulesRulesetsSkipRuleActionParametersProductBic RulesetNewParamsRulesRulesetsSkipRuleActionParametersProduct = "bic"
- RulesetNewParamsRulesRulesetsSkipRuleActionParametersProductHot RulesetNewParamsRulesRulesetsSkipRuleActionParametersProduct = "hot"
- RulesetNewParamsRulesRulesetsSkipRuleActionParametersProductRateLimit RulesetNewParamsRulesRulesetsSkipRuleActionParametersProduct = "rateLimit"
- RulesetNewParamsRulesRulesetsSkipRuleActionParametersProductSecurityLevel RulesetNewParamsRulesRulesetsSkipRuleActionParametersProduct = "securityLevel"
- RulesetNewParamsRulesRulesetsSkipRuleActionParametersProductUABlock RulesetNewParamsRulesRulesetsSkipRuleActionParametersProduct = "uaBlock"
- RulesetNewParamsRulesRulesetsSkipRuleActionParametersProductWAF RulesetNewParamsRulesRulesetsSkipRuleActionParametersProduct = "waf"
- RulesetNewParamsRulesRulesetsSkipRuleActionParametersProductZoneLockdown RulesetNewParamsRulesRulesetsSkipRuleActionParametersProduct = "zoneLockdown"
-)
-
-func (r RulesetNewParamsRulesRulesetsSkipRuleActionParametersProduct) IsKnown() bool {
- switch r {
- case RulesetNewParamsRulesRulesetsSkipRuleActionParametersProductBic, RulesetNewParamsRulesRulesetsSkipRuleActionParametersProductHot, RulesetNewParamsRulesRulesetsSkipRuleActionParametersProductRateLimit, RulesetNewParamsRulesRulesetsSkipRuleActionParametersProductSecurityLevel, RulesetNewParamsRulesRulesetsSkipRuleActionParametersProductUABlock, RulesetNewParamsRulesRulesetsSkipRuleActionParametersProductWAF, RulesetNewParamsRulesRulesetsSkipRuleActionParametersProductZoneLockdown:
- return true
- }
- return false
-}
-
-// A ruleset to skip the execution of. This option is incompatible with the
-// rulesets, rules and phases options.
-type RulesetNewParamsRulesRulesetsSkipRuleActionParametersRuleset string
-
-const (
- RulesetNewParamsRulesRulesetsSkipRuleActionParametersRulesetCurrent RulesetNewParamsRulesRulesetsSkipRuleActionParametersRuleset = "current"
-)
-
-func (r RulesetNewParamsRulesRulesetsSkipRuleActionParametersRuleset) IsKnown() bool {
- switch r {
- case RulesetNewParamsRulesRulesetsSkipRuleActionParametersRulesetCurrent:
- return true
- }
- return false
-}
-
-// The action to perform when the rule matches.
-type RulesetNewParamsRulesAction string
-
-const (
- RulesetNewParamsRulesActionBlock RulesetNewParamsRulesAction = "block"
- RulesetNewParamsRulesActionExecute RulesetNewParamsRulesAction = "execute"
- RulesetNewParamsRulesActionLog RulesetNewParamsRulesAction = "log"
- RulesetNewParamsRulesActionSkip RulesetNewParamsRulesAction = "skip"
-)
-
-func (r RulesetNewParamsRulesAction) IsKnown() bool {
- switch r {
- case RulesetNewParamsRulesActionBlock, RulesetNewParamsRulesActionExecute, RulesetNewParamsRulesActionLog, RulesetNewParamsRulesActionSkip:
- return true
- }
- return false
-}
-
-// A response object.
-type RulesetNewResponseEnvelope struct {
- // A list of error messages.
- Errors []RulesetNewResponseEnvelopeErrors `json:"errors,required"`
- // A list of warning messages.
- Messages []RulesetNewResponseEnvelopeMessages `json:"messages,required"`
- // A ruleset object.
- Result RulesetNewResponse `json:"result,required"`
- // Whether the API call was successful.
- Success RulesetNewResponseEnvelopeSuccess `json:"success,required"`
- JSON rulesetNewResponseEnvelopeJSON `json:"-"`
-}
-
-// rulesetNewResponseEnvelopeJSON contains the JSON metadata for the struct
-// [RulesetNewResponseEnvelope]
-type rulesetNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-// A message.
-type RulesetNewResponseEnvelopeErrors struct {
- // A text description of this message.
- Message string `json:"message,required"`
- // A unique code for this message.
- Code int64 `json:"code"`
- // The source of this message.
- Source RulesetNewResponseEnvelopeErrorsSource `json:"source"`
- JSON rulesetNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// rulesetNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
-// [RulesetNewResponseEnvelopeErrors]
-type rulesetNewResponseEnvelopeErrorsJSON struct {
- Message apijson.Field
- Code apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-// The source of this message.
-type RulesetNewResponseEnvelopeErrorsSource struct {
- // A JSON pointer to the field that is the source of the message.
- Pointer string `json:"pointer,required"`
- JSON rulesetNewResponseEnvelopeErrorsSourceJSON `json:"-"`
-}
-
-// rulesetNewResponseEnvelopeErrorsSourceJSON contains the JSON metadata for the
-// struct [RulesetNewResponseEnvelopeErrorsSource]
-type rulesetNewResponseEnvelopeErrorsSourceJSON struct {
- Pointer apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetNewResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetNewResponseEnvelopeErrorsSourceJSON) RawJSON() string {
- return r.raw
-}
-
-// A message.
-type RulesetNewResponseEnvelopeMessages struct {
- // A text description of this message.
- Message string `json:"message,required"`
- // A unique code for this message.
- Code int64 `json:"code"`
- // The source of this message.
- Source RulesetNewResponseEnvelopeMessagesSource `json:"source"`
- JSON rulesetNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// rulesetNewResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
-// [RulesetNewResponseEnvelopeMessages]
-type rulesetNewResponseEnvelopeMessagesJSON struct {
- Message apijson.Field
- Code apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// The source of this message.
-type RulesetNewResponseEnvelopeMessagesSource struct {
- // A JSON pointer to the field that is the source of the message.
- Pointer string `json:"pointer,required"`
- JSON rulesetNewResponseEnvelopeMessagesSourceJSON `json:"-"`
-}
-
-// rulesetNewResponseEnvelopeMessagesSourceJSON contains the JSON metadata for the
-// struct [RulesetNewResponseEnvelopeMessagesSource]
-type rulesetNewResponseEnvelopeMessagesSourceJSON struct {
- Pointer apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetNewResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetNewResponseEnvelopeMessagesSourceJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful.
-type RulesetNewResponseEnvelopeSuccess bool
-
-const (
- RulesetNewResponseEnvelopeSuccessTrue RulesetNewResponseEnvelopeSuccess = true
-)
-
-func (r RulesetNewResponseEnvelopeSuccess) IsKnown() bool {
- switch r {
- case RulesetNewResponseEnvelopeSuccessTrue:
- return true
- }
- return false
-}
-
-type RulesetUpdateParams struct {
- // The list of rules in the ruleset.
- Rules param.Field[[]RulesetUpdateParamsRuleUnion] `json:"rules,required"`
- // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
- AccountID param.Field[string] `path:"account_id"`
- // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- ZoneID param.Field[string] `path:"zone_id"`
- // An informative description of the ruleset.
- Description param.Field[string] `json:"description"`
- // The kind of the ruleset.
- Kind param.Field[RulesetUpdateParamsKind] `json:"kind"`
- // The human-readable name of the ruleset.
- Name param.Field[string] `json:"name"`
- // The phase of the ruleset.
- Phase param.Field[RulesetUpdateParamsPhase] `json:"phase"`
-}
-
-func (r RulesetUpdateParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type RulesetUpdateParamsRule struct {
- // The action to perform when the rule matches.
- Action param.Field[RulesetUpdateParamsRulesAction] `json:"action"`
- ActionParameters param.Field[interface{}] `json:"action_parameters,required"`
- Categories param.Field[interface{}] `json:"categories,required"`
- // An informative description of the rule.
- Description param.Field[string] `json:"description"`
- // Whether the rule should be executed.
- Enabled param.Field[bool] `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression param.Field[string] `json:"expression"`
- // The unique ID of the rule.
- ID param.Field[string] `json:"id"`
- // An object configuring the rule's logging behavior.
- Logging param.Field[shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751cParam] `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref param.Field[string] `json:"ref"`
-}
-
-func (r RulesetUpdateParamsRule) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-func (r RulesetUpdateParamsRule) implementsRulesetsRulesetUpdateParamsRuleUnion() {}
-
-// Satisfied by [rulesets.RulesetUpdateParamsRulesRulesetsBlockRule],
-// [rulesets.RulesetUpdateParamsRulesRulesetsExecuteRule],
-// [rulesets.RulesetUpdateParamsRulesRulesetsLogRule],
-// [rulesets.RulesetUpdateParamsRulesRulesetsSkipRule], [RulesetUpdateParamsRule].
-type RulesetUpdateParamsRuleUnion interface {
- implementsRulesetsRulesetUpdateParamsRuleUnion()
-}
-
-type RulesetUpdateParamsRulesRulesetsBlockRule struct {
- // The unique ID of the rule.
- ID param.Field[string] `json:"id"`
- // The action to perform when the rule matches.
- Action param.Field[RulesetUpdateParamsRulesRulesetsBlockRuleAction] `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters param.Field[RulesetUpdateParamsRulesRulesetsBlockRuleActionParameters] `json:"action_parameters"`
- // An informative description of the rule.
- Description param.Field[string] `json:"description"`
- // Whether the rule should be executed.
- Enabled param.Field[bool] `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression param.Field[string] `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging param.Field[shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751cParam] `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref param.Field[string] `json:"ref"`
-}
-
-func (r RulesetUpdateParamsRulesRulesetsBlockRule) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-func (r RulesetUpdateParamsRulesRulesetsBlockRule) implementsRulesetsRulesetUpdateParamsRuleUnion() {}
-
-// The action to perform when the rule matches.
-type RulesetUpdateParamsRulesRulesetsBlockRuleAction string
-
-const (
- RulesetUpdateParamsRulesRulesetsBlockRuleActionBlock RulesetUpdateParamsRulesRulesetsBlockRuleAction = "block"
-)
-
-func (r RulesetUpdateParamsRulesRulesetsBlockRuleAction) IsKnown() bool {
- switch r {
- case RulesetUpdateParamsRulesRulesetsBlockRuleActionBlock:
- return true
- }
- return false
-}
-
-// The parameters configuring the rule's action.
-type RulesetUpdateParamsRulesRulesetsBlockRuleActionParameters struct {
- // The response to show when the block is applied.
- Response param.Field[RulesetUpdateParamsRulesRulesetsBlockRuleActionParametersResponse] `json:"response"`
-}
-
-func (r RulesetUpdateParamsRulesRulesetsBlockRuleActionParameters) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The response to show when the block is applied.
-type RulesetUpdateParamsRulesRulesetsBlockRuleActionParametersResponse struct {
- // The content to return.
- Content param.Field[string] `json:"content,required"`
- // The type of the content to return.
- ContentType param.Field[string] `json:"content_type,required"`
- // The status code to return.
- StatusCode param.Field[int64] `json:"status_code,required"`
-}
-
-func (r RulesetUpdateParamsRulesRulesetsBlockRuleActionParametersResponse) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type RulesetUpdateParamsRulesRulesetsExecuteRule struct {
- // The unique ID of the rule.
- ID param.Field[string] `json:"id"`
- // The action to perform when the rule matches.
- Action param.Field[RulesetUpdateParamsRulesRulesetsExecuteRuleAction] `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters param.Field[RulesetUpdateParamsRulesRulesetsExecuteRuleActionParameters] `json:"action_parameters"`
- // An informative description of the rule.
- Description param.Field[string] `json:"description"`
- // Whether the rule should be executed.
- Enabled param.Field[bool] `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression param.Field[string] `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging param.Field[shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751cParam] `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref param.Field[string] `json:"ref"`
-}
-
-func (r RulesetUpdateParamsRulesRulesetsExecuteRule) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-func (r RulesetUpdateParamsRulesRulesetsExecuteRule) implementsRulesetsRulesetUpdateParamsRuleUnion() {
-}
-
-// The action to perform when the rule matches.
-type RulesetUpdateParamsRulesRulesetsExecuteRuleAction string
-
-const (
- RulesetUpdateParamsRulesRulesetsExecuteRuleActionExecute RulesetUpdateParamsRulesRulesetsExecuteRuleAction = "execute"
-)
-
-func (r RulesetUpdateParamsRulesRulesetsExecuteRuleAction) IsKnown() bool {
- switch r {
- case RulesetUpdateParamsRulesRulesetsExecuteRuleActionExecute:
- return true
- }
- return false
-}
-
-// The parameters configuring the rule's action.
-type RulesetUpdateParamsRulesRulesetsExecuteRuleActionParameters struct {
- // The ID of the ruleset to execute.
- ID param.Field[string] `json:"id,required"`
- // The configuration to use for matched data logging.
- MatchedData param.Field[RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersMatchedData] `json:"matched_data"`
- // A set of overrides to apply to the target ruleset.
- Overrides param.Field[RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverrides] `json:"overrides"`
-}
-
-func (r RulesetUpdateParamsRulesRulesetsExecuteRuleActionParameters) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The configuration to use for matched data logging.
-type RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersMatchedData struct {
- // The public key to encrypt matched data logs with.
- PublicKey param.Field[string] `json:"public_key,required"`
-}
-
-func (r RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersMatchedData) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// A set of overrides to apply to the target ruleset.
-type RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverrides struct {
- // An action to override all rules with. This option has lower precedence than rule
- // and category overrides.
- Action param.Field[string] `json:"action"`
- // A list of category-level overrides. This option has the second-highest
- // precedence after rule-level overrides.
- Categories param.Field[[]RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategory] `json:"categories"`
- // Whether to enable execution of all rules. This option has lower precedence than
- // rule and category overrides.
- Enabled param.Field[bool] `json:"enabled"`
- // A list of rule-level overrides. This option has the highest precedence.
- Rules param.Field[[]RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRule] `json:"rules"`
- // A sensitivity level to set for all rules. This option has lower precedence than
- // rule and category overrides and is only applicable for DDoS phases.
- SensitivityLevel param.Field[RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel] `json:"sensitivity_level"`
-}
-
-func (r RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverrides) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// A category-level override
-type RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategory struct {
- // The name of the category to override.
- Category param.Field[string] `json:"category,required"`
- // The action to override rules in the category with.
- Action param.Field[string] `json:"action"`
- // Whether to enable execution of rules in the category.
- Enabled param.Field[bool] `json:"enabled"`
- // The sensitivity level to use for rules in the category.
- SensitivityLevel param.Field[RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel] `json:"sensitivity_level"`
-}
-
-func (r RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategory) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The sensitivity level to use for rules in the category.
-type RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel string
-
-const (
- RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "default"
- RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "medium"
- RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "low"
- RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "eoff"
-)
-
-func (r RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel) IsKnown() bool {
- switch r {
- case RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault, RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium, RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow, RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff:
- return true
- }
- return false
-}
-
-// A rule-level override
-type RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRule struct {
- // The ID of the rule to override.
- ID param.Field[string] `json:"id,required"`
- // The action to override the rule with.
- Action param.Field[string] `json:"action"`
- // Whether to enable execution of the rule.
- Enabled param.Field[bool] `json:"enabled"`
- // The score threshold to use for the rule.
- ScoreThreshold param.Field[int64] `json:"score_threshold"`
- // The sensitivity level to use for the rule.
- SensitivityLevel param.Field[RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel] `json:"sensitivity_level"`
-}
-
-func (r RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRule) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The sensitivity level to use for the rule.
-type RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel string
-
-const (
- RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "default"
- RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "medium"
- RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "low"
- RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "eoff"
-)
-
-func (r RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel) IsKnown() bool {
- switch r {
- case RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault, RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium, RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow, RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff:
- return true
- }
- return false
-}
-
-// A sensitivity level to set for all rules. This option has lower precedence than
-// rule and category overrides and is only applicable for DDoS phases.
-type RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel string
-
-const (
- RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "default"
- RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "medium"
- RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "low"
- RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "eoff"
-)
-
-func (r RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel) IsKnown() bool {
- switch r {
- case RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault, RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium, RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow, RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff:
- return true
- }
- return false
-}
-
-type RulesetUpdateParamsRulesRulesetsLogRule struct {
- // The unique ID of the rule.
- ID param.Field[string] `json:"id"`
- // The action to perform when the rule matches.
- Action param.Field[RulesetUpdateParamsRulesRulesetsLogRuleAction] `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters param.Field[interface{}] `json:"action_parameters"`
- // An informative description of the rule.
- Description param.Field[string] `json:"description"`
- // Whether the rule should be executed.
- Enabled param.Field[bool] `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression param.Field[string] `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging param.Field[shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751cParam] `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref param.Field[string] `json:"ref"`
-}
-
-func (r RulesetUpdateParamsRulesRulesetsLogRule) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-func (r RulesetUpdateParamsRulesRulesetsLogRule) implementsRulesetsRulesetUpdateParamsRuleUnion() {}
-
-// The action to perform when the rule matches.
-type RulesetUpdateParamsRulesRulesetsLogRuleAction string
+// Whether the API call was successful.
+type RulesetNewResponseEnvelopeSuccess bool
const (
- RulesetUpdateParamsRulesRulesetsLogRuleActionLog RulesetUpdateParamsRulesRulesetsLogRuleAction = "log"
+ RulesetNewResponseEnvelopeSuccessTrue RulesetNewResponseEnvelopeSuccess = true
)
-func (r RulesetUpdateParamsRulesRulesetsLogRuleAction) IsKnown() bool {
+func (r RulesetNewResponseEnvelopeSuccess) IsKnown() bool {
switch r {
- case RulesetUpdateParamsRulesRulesetsLogRuleActionLog:
+ case RulesetNewResponseEnvelopeSuccessTrue:
return true
}
return false
}
-type RulesetUpdateParamsRulesRulesetsSkipRule struct {
- // The unique ID of the rule.
- ID param.Field[string] `json:"id"`
- // The action to perform when the rule matches.
- Action param.Field[RulesetUpdateParamsRulesRulesetsSkipRuleAction] `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters param.Field[RulesetUpdateParamsRulesRulesetsSkipRuleActionParameters] `json:"action_parameters"`
- // An informative description of the rule.
+type RulesetUpdateParams struct {
+ // The list of rules in the ruleset.
+ Rules param.Field[[]RequestRuleUnionParam] `json:"rules,required"`
+ // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+ AccountID param.Field[string] `path:"account_id"`
+ // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+ ZoneID param.Field[string] `path:"zone_id"`
+ // An informative description of the ruleset.
Description param.Field[string] `json:"description"`
- // Whether the rule should be executed.
- Enabled param.Field[bool] `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression param.Field[string] `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging param.Field[shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751cParam] `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref param.Field[string] `json:"ref"`
-}
-
-func (r RulesetUpdateParamsRulesRulesetsSkipRule) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-func (r RulesetUpdateParamsRulesRulesetsSkipRule) implementsRulesetsRulesetUpdateParamsRuleUnion() {}
-
-// The action to perform when the rule matches.
-type RulesetUpdateParamsRulesRulesetsSkipRuleAction string
-
-const (
- RulesetUpdateParamsRulesRulesetsSkipRuleActionSkip RulesetUpdateParamsRulesRulesetsSkipRuleAction = "skip"
-)
-
-func (r RulesetUpdateParamsRulesRulesetsSkipRuleAction) IsKnown() bool {
- switch r {
- case RulesetUpdateParamsRulesRulesetsSkipRuleActionSkip:
- return true
- }
- return false
-}
-
-// The parameters configuring the rule's action.
-type RulesetUpdateParamsRulesRulesetsSkipRuleActionParameters struct {
- // A list of phases to skip the execution of. This option is incompatible with the
- // ruleset and rulesets options.
- Phases param.Field[[]RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase] `json:"phases"`
- // A list of legacy security products to skip the execution of.
- Products param.Field[[]RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProduct] `json:"products"`
- // A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the
- // execution of. This option is incompatible with the ruleset option.
- Rules param.Field[map[string][]string] `json:"rules"`
- // A ruleset to skip the execution of. This option is incompatible with the
- // rulesets, rules and phases options.
- Ruleset param.Field[RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersRuleset] `json:"ruleset"`
- // A list of ruleset IDs to skip the execution of. This option is incompatible with
- // the ruleset and phases options.
- Rulesets param.Field[[]string] `json:"rulesets"`
+ // The kind of the ruleset.
+ Kind param.Field[RulesetUpdateParamsKind] `json:"kind"`
+ // The human-readable name of the ruleset.
+ Name param.Field[string] `json:"name"`
+ // The phase of the ruleset.
+ Phase param.Field[RulesetUpdateParamsPhase] `json:"phase"`
}
-func (r RulesetUpdateParamsRulesRulesetsSkipRuleActionParameters) MarshalJSON() (data []byte, err error) {
+func (r RulesetUpdateParams) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
-// A phase to skip the execution of.
-type RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase string
-
-const (
- RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseDDoSL4 RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "ddos_l4"
- RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseDDoSL7 RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "ddos_l7"
- RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_config_settings"
- RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_custom_errors"
- RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_log_custom_fields"
- RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRatelimit RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_ratelimit"
- RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_cache_settings"
- RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_dynamic_redirect"
- RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_custom"
- RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_managed"
- RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_late_transform"
- RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_origin"
- RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_redirect"
- RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_sanitize"
- RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_sbfm"
- RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_select_configuration"
- RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_transform"
- RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_response_compression"
- RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_response_firewall_managed"
- RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_response_headers_transform"
- RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseMagicTransit RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "magic_transit"
- RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_ids_managed"
- RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseMagicTransitManaged RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_managed"
-)
-
-func (r RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase) IsKnown() bool {
- switch r {
- case RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseDDoSL4, RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseDDoSL7, RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings, RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors, RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields, RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRatelimit, RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings, RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect, RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom, RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged, RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform, RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin, RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect, RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize, RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm, RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration, RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform, RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression, RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged, RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform, RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseMagicTransit, RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged, RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseMagicTransitManaged:
- return true
- }
- return false
-}
-
-// The name of a legacy security product to skip the execution of.
-type RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProduct string
-
-const (
- RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProductBic RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProduct = "bic"
- RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProductHot RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProduct = "hot"
- RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProductRateLimit RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProduct = "rateLimit"
- RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProductSecurityLevel RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProduct = "securityLevel"
- RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProductUABlock RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProduct = "uaBlock"
- RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProductWAF RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProduct = "waf"
- RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProductZoneLockdown RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProduct = "zoneLockdown"
-)
-
-func (r RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProduct) IsKnown() bool {
- switch r {
- case RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProductBic, RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProductHot, RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProductRateLimit, RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProductSecurityLevel, RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProductUABlock, RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProductWAF, RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProductZoneLockdown:
- return true
- }
- return false
-}
-
-// A ruleset to skip the execution of. This option is incompatible with the
-// rulesets, rules and phases options.
-type RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersRuleset string
-
-const (
- RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersRulesetCurrent RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersRuleset = "current"
-)
-
-func (r RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersRuleset) IsKnown() bool {
- switch r {
- case RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersRulesetCurrent:
- return true
- }
- return false
-}
-
-// The action to perform when the rule matches.
-type RulesetUpdateParamsRulesAction string
-
-const (
- RulesetUpdateParamsRulesActionBlock RulesetUpdateParamsRulesAction = "block"
- RulesetUpdateParamsRulesActionExecute RulesetUpdateParamsRulesAction = "execute"
- RulesetUpdateParamsRulesActionLog RulesetUpdateParamsRulesAction = "log"
- RulesetUpdateParamsRulesActionSkip RulesetUpdateParamsRulesAction = "skip"
-)
-
-func (r RulesetUpdateParamsRulesAction) IsKnown() bool {
- switch r {
- case RulesetUpdateParamsRulesActionBlock, RulesetUpdateParamsRulesActionExecute, RulesetUpdateParamsRulesActionLog, RulesetUpdateParamsRulesActionSkip:
- return true
- }
- return false
-}
-
// The kind of the ruleset.
type RulesetUpdateParamsKind string
diff --git a/rulesets/ruleset_test.go b/rulesets/ruleset_test.go
index c69c2579454..a03f2ba4167 100644
--- a/rulesets/ruleset_test.go
+++ b/rulesets/ruleset_test.go
@@ -33,10 +33,10 @@ func TestRulesetNewWithOptionalParams(t *testing.T) {
Kind: cloudflare.F(rulesets.RulesetNewParamsKindRoot),
Name: cloudflare.F("My ruleset"),
Phase: cloudflare.F(rulesets.RulesetNewParamsPhaseHTTPRequestFirewallCustom),
- Rules: cloudflare.F([]rulesets.RulesetNewParamsRuleUnion{rulesets.RulesetNewParamsRulesRulesetsBlockRule{
- Action: cloudflare.F(rulesets.RulesetNewParamsRulesRulesetsBlockRuleActionBlock),
- ActionParameters: cloudflare.F(rulesets.RulesetNewParamsRulesRulesetsBlockRuleActionParameters{
- Response: cloudflare.F(rulesets.RulesetNewParamsRulesRulesetsBlockRuleActionParametersResponse{
+ Rules: cloudflare.F([]rulesets.RequestRuleUnionParam{rulesets.BlockRuleParam{
+ Action: cloudflare.F(rulesets.BlockRuleActionBlock),
+ ActionParameters: cloudflare.F(rulesets.BlockRuleActionParametersParam{
+ Response: cloudflare.F(rulesets.BlockRuleActionParametersResponseParam{
Content: cloudflare.F("{\n \"success\": false,\n \"error\": \"you have been blocked\"\n}"),
ContentType: cloudflare.F("application/json"),
StatusCode: cloudflare.F(int64(400)),
@@ -50,10 +50,10 @@ func TestRulesetNewWithOptionalParams(t *testing.T) {
Enabled: cloudflare.F(true),
}),
Ref: cloudflare.F("my_ref"),
- }, rulesets.RulesetNewParamsRulesRulesetsBlockRule{
- Action: cloudflare.F(rulesets.RulesetNewParamsRulesRulesetsBlockRuleActionBlock),
- ActionParameters: cloudflare.F(rulesets.RulesetNewParamsRulesRulesetsBlockRuleActionParameters{
- Response: cloudflare.F(rulesets.RulesetNewParamsRulesRulesetsBlockRuleActionParametersResponse{
+ }, rulesets.BlockRuleParam{
+ Action: cloudflare.F(rulesets.BlockRuleActionBlock),
+ ActionParameters: cloudflare.F(rulesets.BlockRuleActionParametersParam{
+ Response: cloudflare.F(rulesets.BlockRuleActionParametersResponseParam{
Content: cloudflare.F("{\n \"success\": false,\n \"error\": \"you have been blocked\"\n}"),
ContentType: cloudflare.F("application/json"),
StatusCode: cloudflare.F(int64(400)),
@@ -67,10 +67,10 @@ func TestRulesetNewWithOptionalParams(t *testing.T) {
Enabled: cloudflare.F(true),
}),
Ref: cloudflare.F("my_ref"),
- }, rulesets.RulesetNewParamsRulesRulesetsBlockRule{
- Action: cloudflare.F(rulesets.RulesetNewParamsRulesRulesetsBlockRuleActionBlock),
- ActionParameters: cloudflare.F(rulesets.RulesetNewParamsRulesRulesetsBlockRuleActionParameters{
- Response: cloudflare.F(rulesets.RulesetNewParamsRulesRulesetsBlockRuleActionParametersResponse{
+ }, rulesets.BlockRuleParam{
+ Action: cloudflare.F(rulesets.BlockRuleActionBlock),
+ ActionParameters: cloudflare.F(rulesets.BlockRuleActionParametersParam{
+ Response: cloudflare.F(rulesets.BlockRuleActionParametersResponseParam{
Content: cloudflare.F("{\n \"success\": false,\n \"error\": \"you have been blocked\"\n}"),
ContentType: cloudflare.F("application/json"),
StatusCode: cloudflare.F(int64(400)),
@@ -116,10 +116,10 @@ func TestRulesetUpdateWithOptionalParams(t *testing.T) {
context.TODO(),
"2f2feab2026849078ba485f918791bdc",
rulesets.RulesetUpdateParams{
- Rules: cloudflare.F([]rulesets.RulesetUpdateParamsRuleUnion{rulesets.RulesetUpdateParamsRulesRulesetsBlockRule{
- Action: cloudflare.F(rulesets.RulesetUpdateParamsRulesRulesetsBlockRuleActionBlock),
- ActionParameters: cloudflare.F(rulesets.RulesetUpdateParamsRulesRulesetsBlockRuleActionParameters{
- Response: cloudflare.F(rulesets.RulesetUpdateParamsRulesRulesetsBlockRuleActionParametersResponse{
+ Rules: cloudflare.F([]rulesets.RequestRuleUnionParam{rulesets.BlockRuleParam{
+ Action: cloudflare.F(rulesets.BlockRuleActionBlock),
+ ActionParameters: cloudflare.F(rulesets.BlockRuleActionParametersParam{
+ Response: cloudflare.F(rulesets.BlockRuleActionParametersResponseParam{
Content: cloudflare.F("{\n \"success\": false,\n \"error\": \"you have been blocked\"\n}"),
ContentType: cloudflare.F("application/json"),
StatusCode: cloudflare.F(int64(400)),
@@ -133,10 +133,10 @@ func TestRulesetUpdateWithOptionalParams(t *testing.T) {
Enabled: cloudflare.F(true),
}),
Ref: cloudflare.F("my_ref"),
- }, rulesets.RulesetUpdateParamsRulesRulesetsBlockRule{
- Action: cloudflare.F(rulesets.RulesetUpdateParamsRulesRulesetsBlockRuleActionBlock),
- ActionParameters: cloudflare.F(rulesets.RulesetUpdateParamsRulesRulesetsBlockRuleActionParameters{
- Response: cloudflare.F(rulesets.RulesetUpdateParamsRulesRulesetsBlockRuleActionParametersResponse{
+ }, rulesets.BlockRuleParam{
+ Action: cloudflare.F(rulesets.BlockRuleActionBlock),
+ ActionParameters: cloudflare.F(rulesets.BlockRuleActionParametersParam{
+ Response: cloudflare.F(rulesets.BlockRuleActionParametersResponseParam{
Content: cloudflare.F("{\n \"success\": false,\n \"error\": \"you have been blocked\"\n}"),
ContentType: cloudflare.F("application/json"),
StatusCode: cloudflare.F(int64(400)),
@@ -150,10 +150,10 @@ func TestRulesetUpdateWithOptionalParams(t *testing.T) {
Enabled: cloudflare.F(true),
}),
Ref: cloudflare.F("my_ref"),
- }, rulesets.RulesetUpdateParamsRulesRulesetsBlockRule{
- Action: cloudflare.F(rulesets.RulesetUpdateParamsRulesRulesetsBlockRuleActionBlock),
- ActionParameters: cloudflare.F(rulesets.RulesetUpdateParamsRulesRulesetsBlockRuleActionParameters{
- Response: cloudflare.F(rulesets.RulesetUpdateParamsRulesRulesetsBlockRuleActionParametersResponse{
+ }, rulesets.BlockRuleParam{
+ Action: cloudflare.F(rulesets.BlockRuleActionBlock),
+ ActionParameters: cloudflare.F(rulesets.BlockRuleActionParametersParam{
+ Response: cloudflare.F(rulesets.BlockRuleActionParametersResponseParam{
Content: cloudflare.F("{\n \"success\": false,\n \"error\": \"you have been blocked\"\n}"),
ContentType: cloudflare.F("application/json"),
StatusCode: cloudflare.F(int64(400)),
diff --git a/rulesets/version.go b/rulesets/version.go
index ae833f5700c..0399cd3af11 100644
--- a/rulesets/version.go
+++ b/rulesets/version.go
@@ -6,16 +6,13 @@ import (
"context"
"fmt"
"net/http"
- "reflect"
"time"
"github.com/cloudflare/cloudflare-go/v2/internal/apijson"
"github.com/cloudflare/cloudflare-go/v2/internal/pagination"
"github.com/cloudflare/cloudflare-go/v2/internal/param"
"github.com/cloudflare/cloudflare-go/v2/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/v2/internal/shared"
"github.com/cloudflare/cloudflare-go/v2/option"
- "github.com/tidwall/gjson"
)
// VersionService contains methods and other services that help with interacting
@@ -38,7 +35,7 @@ func NewVersionService(opts ...option.RequestOption) (r *VersionService) {
}
// Fetches the versions of an account or zone ruleset.
-func (r *VersionService) List(ctx context.Context, rulesetID string, query VersionListParams, opts ...option.RequestOption) (res *pagination.SinglePage[VersionListResponse], err error) {
+func (r *VersionService) List(ctx context.Context, rulesetID string, query VersionListParams, opts ...option.RequestOption) (res *pagination.SinglePage[Ruleset], err error) {
var raw *http.Response
opts = append(r.Options, opts...)
opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
@@ -65,7 +62,7 @@ func (r *VersionService) List(ctx context.Context, rulesetID string, query Versi
}
// Fetches the versions of an account or zone ruleset.
-func (r *VersionService) ListAutoPaging(ctx context.Context, rulesetID string, query VersionListParams, opts ...option.RequestOption) *pagination.SinglePageAutoPager[VersionListResponse] {
+func (r *VersionService) ListAutoPaging(ctx context.Context, rulesetID string, query VersionListParams, opts ...option.RequestOption) *pagination.SinglePageAutoPager[Ruleset] {
return pagination.NewSinglePageAutoPager(r.List(ctx, rulesetID, query, opts...))
}
@@ -109,102 +106,6 @@ func (r *VersionService) Get(ctx context.Context, rulesetID string, rulesetVersi
return
}
-// A ruleset object.
-type VersionListResponse struct {
- // The kind of the ruleset.
- Kind VersionListResponseKind `json:"kind,required"`
- // The human-readable name of the ruleset.
- Name string `json:"name,required"`
- // The phase of the ruleset.
- Phase VersionListResponsePhase `json:"phase,required"`
- // The unique ID of the ruleset.
- ID string `json:"id"`
- // An informative description of the ruleset.
- Description string `json:"description"`
- // The timestamp of when the ruleset was last modified.
- LastUpdated time.Time `json:"last_updated" format:"date-time"`
- // The version of the ruleset.
- Version string `json:"version"`
- JSON versionListResponseJSON `json:"-"`
-}
-
-// versionListResponseJSON contains the JSON metadata for the struct
-// [VersionListResponse]
-type versionListResponseJSON struct {
- Kind apijson.Field
- Name apijson.Field
- Phase apijson.Field
- ID apijson.Field
- Description apijson.Field
- LastUpdated apijson.Field
- Version apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *VersionListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r versionListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The kind of the ruleset.
-type VersionListResponseKind string
-
-const (
- VersionListResponseKindManaged VersionListResponseKind = "managed"
- VersionListResponseKindCustom VersionListResponseKind = "custom"
- VersionListResponseKindRoot VersionListResponseKind = "root"
- VersionListResponseKindZone VersionListResponseKind = "zone"
-)
-
-func (r VersionListResponseKind) IsKnown() bool {
- switch r {
- case VersionListResponseKindManaged, VersionListResponseKindCustom, VersionListResponseKindRoot, VersionListResponseKindZone:
- return true
- }
- return false
-}
-
-// The phase of the ruleset.
-type VersionListResponsePhase string
-
-const (
- VersionListResponsePhaseDDoSL4 VersionListResponsePhase = "ddos_l4"
- VersionListResponsePhaseDDoSL7 VersionListResponsePhase = "ddos_l7"
- VersionListResponsePhaseHTTPConfigSettings VersionListResponsePhase = "http_config_settings"
- VersionListResponsePhaseHTTPCustomErrors VersionListResponsePhase = "http_custom_errors"
- VersionListResponsePhaseHTTPLogCustomFields VersionListResponsePhase = "http_log_custom_fields"
- VersionListResponsePhaseHTTPRatelimit VersionListResponsePhase = "http_ratelimit"
- VersionListResponsePhaseHTTPRequestCacheSettings VersionListResponsePhase = "http_request_cache_settings"
- VersionListResponsePhaseHTTPRequestDynamicRedirect VersionListResponsePhase = "http_request_dynamic_redirect"
- VersionListResponsePhaseHTTPRequestFirewallCustom VersionListResponsePhase = "http_request_firewall_custom"
- VersionListResponsePhaseHTTPRequestFirewallManaged VersionListResponsePhase = "http_request_firewall_managed"
- VersionListResponsePhaseHTTPRequestLateTransform VersionListResponsePhase = "http_request_late_transform"
- VersionListResponsePhaseHTTPRequestOrigin VersionListResponsePhase = "http_request_origin"
- VersionListResponsePhaseHTTPRequestRedirect VersionListResponsePhase = "http_request_redirect"
- VersionListResponsePhaseHTTPRequestSanitize VersionListResponsePhase = "http_request_sanitize"
- VersionListResponsePhaseHTTPRequestSbfm VersionListResponsePhase = "http_request_sbfm"
- VersionListResponsePhaseHTTPRequestSelectConfiguration VersionListResponsePhase = "http_request_select_configuration"
- VersionListResponsePhaseHTTPRequestTransform VersionListResponsePhase = "http_request_transform"
- VersionListResponsePhaseHTTPResponseCompression VersionListResponsePhase = "http_response_compression"
- VersionListResponsePhaseHTTPResponseFirewallManaged VersionListResponsePhase = "http_response_firewall_managed"
- VersionListResponsePhaseHTTPResponseHeadersTransform VersionListResponsePhase = "http_response_headers_transform"
- VersionListResponsePhaseMagicTransit VersionListResponsePhase = "magic_transit"
- VersionListResponsePhaseMagicTransitIDsManaged VersionListResponsePhase = "magic_transit_ids_managed"
- VersionListResponsePhaseMagicTransitManaged VersionListResponsePhase = "magic_transit_managed"
-)
-
-func (r VersionListResponsePhase) IsKnown() bool {
- switch r {
- case VersionListResponsePhaseDDoSL4, VersionListResponsePhaseDDoSL7, VersionListResponsePhaseHTTPConfigSettings, VersionListResponsePhaseHTTPCustomErrors, VersionListResponsePhaseHTTPLogCustomFields, VersionListResponsePhaseHTTPRatelimit, VersionListResponsePhaseHTTPRequestCacheSettings, VersionListResponsePhaseHTTPRequestDynamicRedirect, VersionListResponsePhaseHTTPRequestFirewallCustom, VersionListResponsePhaseHTTPRequestFirewallManaged, VersionListResponsePhaseHTTPRequestLateTransform, VersionListResponsePhaseHTTPRequestOrigin, VersionListResponsePhaseHTTPRequestRedirect, VersionListResponsePhaseHTTPRequestSanitize, VersionListResponsePhaseHTTPRequestSbfm, VersionListResponsePhaseHTTPRequestSelectConfiguration, VersionListResponsePhaseHTTPRequestTransform, VersionListResponsePhaseHTTPResponseCompression, VersionListResponsePhaseHTTPResponseFirewallManaged, VersionListResponsePhaseHTTPResponseHeadersTransform, VersionListResponsePhaseMagicTransit, VersionListResponsePhaseMagicTransitIDsManaged, VersionListResponsePhaseMagicTransitManaged:
- return true
- }
- return false
-}
-
// A ruleset object.
type VersionGetResponse struct {
// The unique ID of the ruleset.
@@ -218,7 +119,7 @@ type VersionGetResponse struct {
// The phase of the ruleset.
Phase VersionGetResponsePhase `json:"phase,required"`
// The list of rules in the ruleset.
- Rules []VersionGetResponseRule `json:"rules,required"`
+ Rules []RequestRule `json:"rules,required"`
// The version of the ruleset.
Version string `json:"version,required"`
// An informative description of the ruleset.
@@ -304,780 +205,6 @@ func (r VersionGetResponsePhase) IsKnown() bool {
return false
}
-type VersionGetResponseRule struct {
- // The action to perform when the rule matches.
- Action VersionGetResponseRulesAction `json:"action"`
- ActionParameters interface{} `json:"action_parameters,required"`
- Categories interface{} `json:"categories,required"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // An object configuring the rule's logging behavior.
- Logging shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- // The version of the rule.
- Version string `json:"version,required"`
- JSON versionGetResponseRuleJSON `json:"-"`
- union VersionGetResponseRulesUnion
-}
-
-// versionGetResponseRuleJSON contains the JSON metadata for the struct
-// [VersionGetResponseRule]
-type versionGetResponseRuleJSON struct {
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- ID apijson.Field
- LastUpdated apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- Version apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r versionGetResponseRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r *VersionGetResponseRule) UnmarshalJSON(data []byte) (err error) {
- err = apijson.UnmarshalRoot(data, &r.union)
- if err != nil {
- return err
- }
- return apijson.Port(r.union, &r)
-}
-
-func (r VersionGetResponseRule) AsUnion() VersionGetResponseRulesUnion {
- return r.union
-}
-
-// Union satisfied by [rulesets.VersionGetResponseRulesRulesetsBlockRule],
-// [rulesets.VersionGetResponseRulesRulesetsExecuteRule],
-// [rulesets.VersionGetResponseRulesRulesetsLogRule] or
-// [rulesets.VersionGetResponseRulesRulesetsSkipRule].
-type VersionGetResponseRulesUnion interface {
- implementsRulesetsVersionGetResponseRule()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*VersionGetResponseRulesUnion)(nil)).Elem(),
- "action",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(VersionGetResponseRulesRulesetsBlockRule{}),
- DiscriminatorValue: "block",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(VersionGetResponseRulesRulesetsExecuteRule{}),
- DiscriminatorValue: "execute",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(VersionGetResponseRulesRulesetsLogRule{}),
- DiscriminatorValue: "log",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(VersionGetResponseRulesRulesetsSkipRule{}),
- DiscriminatorValue: "skip",
- },
- )
-}
-
-type VersionGetResponseRulesRulesetsBlockRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action VersionGetResponseRulesRulesetsBlockRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters VersionGetResponseRulesRulesetsBlockRuleActionParameters `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON versionGetResponseRulesRulesetsBlockRuleJSON `json:"-"`
-}
-
-// versionGetResponseRulesRulesetsBlockRuleJSON contains the JSON metadata for the
-// struct [VersionGetResponseRulesRulesetsBlockRule]
-type versionGetResponseRulesRulesetsBlockRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *VersionGetResponseRulesRulesetsBlockRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r versionGetResponseRulesRulesetsBlockRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r VersionGetResponseRulesRulesetsBlockRule) implementsRulesetsVersionGetResponseRule() {}
-
-// The action to perform when the rule matches.
-type VersionGetResponseRulesRulesetsBlockRuleAction string
-
-const (
- VersionGetResponseRulesRulesetsBlockRuleActionBlock VersionGetResponseRulesRulesetsBlockRuleAction = "block"
-)
-
-func (r VersionGetResponseRulesRulesetsBlockRuleAction) IsKnown() bool {
- switch r {
- case VersionGetResponseRulesRulesetsBlockRuleActionBlock:
- return true
- }
- return false
-}
-
-// The parameters configuring the rule's action.
-type VersionGetResponseRulesRulesetsBlockRuleActionParameters struct {
- // The response to show when the block is applied.
- Response VersionGetResponseRulesRulesetsBlockRuleActionParametersResponse `json:"response"`
- JSON versionGetResponseRulesRulesetsBlockRuleActionParametersJSON `json:"-"`
-}
-
-// versionGetResponseRulesRulesetsBlockRuleActionParametersJSON contains the JSON
-// metadata for the struct
-// [VersionGetResponseRulesRulesetsBlockRuleActionParameters]
-type versionGetResponseRulesRulesetsBlockRuleActionParametersJSON struct {
- Response apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *VersionGetResponseRulesRulesetsBlockRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r versionGetResponseRulesRulesetsBlockRuleActionParametersJSON) RawJSON() string {
- return r.raw
-}
-
-// The response to show when the block is applied.
-type VersionGetResponseRulesRulesetsBlockRuleActionParametersResponse struct {
- // The content to return.
- Content string `json:"content,required"`
- // The type of the content to return.
- ContentType string `json:"content_type,required"`
- // The status code to return.
- StatusCode int64 `json:"status_code,required"`
- JSON versionGetResponseRulesRulesetsBlockRuleActionParametersResponseJSON `json:"-"`
-}
-
-// versionGetResponseRulesRulesetsBlockRuleActionParametersResponseJSON contains
-// the JSON metadata for the struct
-// [VersionGetResponseRulesRulesetsBlockRuleActionParametersResponse]
-type versionGetResponseRulesRulesetsBlockRuleActionParametersResponseJSON struct {
- Content apijson.Field
- ContentType apijson.Field
- StatusCode apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *VersionGetResponseRulesRulesetsBlockRuleActionParametersResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r versionGetResponseRulesRulesetsBlockRuleActionParametersResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type VersionGetResponseRulesRulesetsExecuteRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action VersionGetResponseRulesRulesetsExecuteRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters VersionGetResponseRulesRulesetsExecuteRuleActionParameters `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON versionGetResponseRulesRulesetsExecuteRuleJSON `json:"-"`
-}
-
-// versionGetResponseRulesRulesetsExecuteRuleJSON contains the JSON metadata for
-// the struct [VersionGetResponseRulesRulesetsExecuteRule]
-type versionGetResponseRulesRulesetsExecuteRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *VersionGetResponseRulesRulesetsExecuteRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r versionGetResponseRulesRulesetsExecuteRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r VersionGetResponseRulesRulesetsExecuteRule) implementsRulesetsVersionGetResponseRule() {}
-
-// The action to perform when the rule matches.
-type VersionGetResponseRulesRulesetsExecuteRuleAction string
-
-const (
- VersionGetResponseRulesRulesetsExecuteRuleActionExecute VersionGetResponseRulesRulesetsExecuteRuleAction = "execute"
-)
-
-func (r VersionGetResponseRulesRulesetsExecuteRuleAction) IsKnown() bool {
- switch r {
- case VersionGetResponseRulesRulesetsExecuteRuleActionExecute:
- return true
- }
- return false
-}
-
-// The parameters configuring the rule's action.
-type VersionGetResponseRulesRulesetsExecuteRuleActionParameters struct {
- // The ID of the ruleset to execute.
- ID string `json:"id,required"`
- // The configuration to use for matched data logging.
- MatchedData VersionGetResponseRulesRulesetsExecuteRuleActionParametersMatchedData `json:"matched_data"`
- // A set of overrides to apply to the target ruleset.
- Overrides VersionGetResponseRulesRulesetsExecuteRuleActionParametersOverrides `json:"overrides"`
- JSON versionGetResponseRulesRulesetsExecuteRuleActionParametersJSON `json:"-"`
-}
-
-// versionGetResponseRulesRulesetsExecuteRuleActionParametersJSON contains the JSON
-// metadata for the struct
-// [VersionGetResponseRulesRulesetsExecuteRuleActionParameters]
-type versionGetResponseRulesRulesetsExecuteRuleActionParametersJSON struct {
- ID apijson.Field
- MatchedData apijson.Field
- Overrides apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *VersionGetResponseRulesRulesetsExecuteRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r versionGetResponseRulesRulesetsExecuteRuleActionParametersJSON) RawJSON() string {
- return r.raw
-}
-
-// The configuration to use for matched data logging.
-type VersionGetResponseRulesRulesetsExecuteRuleActionParametersMatchedData struct {
- // The public key to encrypt matched data logs with.
- PublicKey string `json:"public_key,required"`
- JSON versionGetResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON `json:"-"`
-}
-
-// versionGetResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON
-// contains the JSON metadata for the struct
-// [VersionGetResponseRulesRulesetsExecuteRuleActionParametersMatchedData]
-type versionGetResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON struct {
- PublicKey apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *VersionGetResponseRulesRulesetsExecuteRuleActionParametersMatchedData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r versionGetResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON) RawJSON() string {
- return r.raw
-}
-
-// A set of overrides to apply to the target ruleset.
-type VersionGetResponseRulesRulesetsExecuteRuleActionParametersOverrides struct {
- // An action to override all rules with. This option has lower precedence than rule
- // and category overrides.
- Action string `json:"action"`
- // A list of category-level overrides. This option has the second-highest
- // precedence after rule-level overrides.
- Categories []VersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory `json:"categories"`
- // Whether to enable execution of all rules. This option has lower precedence than
- // rule and category overrides.
- Enabled bool `json:"enabled"`
- // A list of rule-level overrides. This option has the highest precedence.
- Rules []VersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRule `json:"rules"`
- // A sensitivity level to set for all rules. This option has lower precedence than
- // rule and category overrides and is only applicable for DDoS phases.
- SensitivityLevel VersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel `json:"sensitivity_level"`
- JSON versionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON `json:"-"`
-}
-
-// versionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON contains
-// the JSON metadata for the struct
-// [VersionGetResponseRulesRulesetsExecuteRuleActionParametersOverrides]
-type versionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON struct {
- Action apijson.Field
- Categories apijson.Field
- Enabled apijson.Field
- Rules apijson.Field
- SensitivityLevel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *VersionGetResponseRulesRulesetsExecuteRuleActionParametersOverrides) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r versionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON) RawJSON() string {
- return r.raw
-}
-
-// A category-level override
-type VersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory struct {
- // The name of the category to override.
- Category string `json:"category,required"`
- // The action to override rules in the category with.
- Action string `json:"action"`
- // Whether to enable execution of rules in the category.
- Enabled bool `json:"enabled"`
- // The sensitivity level to use for rules in the category.
- SensitivityLevel VersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel `json:"sensitivity_level"`
- JSON versionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON `json:"-"`
-}
-
-// versionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON
-// contains the JSON metadata for the struct
-// [VersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory]
-type versionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON struct {
- Category apijson.Field
- Action apijson.Field
- Enabled apijson.Field
- SensitivityLevel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *VersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r versionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON) RawJSON() string {
- return r.raw
-}
-
-// The sensitivity level to use for rules in the category.
-type VersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel string
-
-const (
- VersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault VersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "default"
- VersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium VersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "medium"
- VersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow VersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "low"
- VersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff VersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "eoff"
-)
-
-func (r VersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel) IsKnown() bool {
- switch r {
- case VersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault, VersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium, VersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow, VersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff:
- return true
- }
- return false
-}
-
-// A rule-level override
-type VersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRule struct {
- // The ID of the rule to override.
- ID string `json:"id,required"`
- // The action to override the rule with.
- Action string `json:"action"`
- // Whether to enable execution of the rule.
- Enabled bool `json:"enabled"`
- // The score threshold to use for the rule.
- ScoreThreshold int64 `json:"score_threshold"`
- // The sensitivity level to use for the rule.
- SensitivityLevel VersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel `json:"sensitivity_level"`
- JSON versionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON `json:"-"`
-}
-
-// versionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON
-// contains the JSON metadata for the struct
-// [VersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRule]
-type versionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON struct {
- ID apijson.Field
- Action apijson.Field
- Enabled apijson.Field
- ScoreThreshold apijson.Field
- SensitivityLevel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *VersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r versionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON) RawJSON() string {
- return r.raw
-}
-
-// The sensitivity level to use for the rule.
-type VersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel string
-
-const (
- VersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault VersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "default"
- VersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium VersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "medium"
- VersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow VersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "low"
- VersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff VersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "eoff"
-)
-
-func (r VersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel) IsKnown() bool {
- switch r {
- case VersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault, VersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium, VersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow, VersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff:
- return true
- }
- return false
-}
-
-// A sensitivity level to set for all rules. This option has lower precedence than
-// rule and category overrides and is only applicable for DDoS phases.
-type VersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel string
-
-const (
- VersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault VersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "default"
- VersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium VersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "medium"
- VersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow VersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "low"
- VersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff VersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "eoff"
-)
-
-func (r VersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel) IsKnown() bool {
- switch r {
- case VersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault, VersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium, VersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow, VersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff:
- return true
- }
- return false
-}
-
-type VersionGetResponseRulesRulesetsLogRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action VersionGetResponseRulesRulesetsLogRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters interface{} `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON versionGetResponseRulesRulesetsLogRuleJSON `json:"-"`
-}
-
-// versionGetResponseRulesRulesetsLogRuleJSON contains the JSON metadata for the
-// struct [VersionGetResponseRulesRulesetsLogRule]
-type versionGetResponseRulesRulesetsLogRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *VersionGetResponseRulesRulesetsLogRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r versionGetResponseRulesRulesetsLogRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r VersionGetResponseRulesRulesetsLogRule) implementsRulesetsVersionGetResponseRule() {}
-
-// The action to perform when the rule matches.
-type VersionGetResponseRulesRulesetsLogRuleAction string
-
-const (
- VersionGetResponseRulesRulesetsLogRuleActionLog VersionGetResponseRulesRulesetsLogRuleAction = "log"
-)
-
-func (r VersionGetResponseRulesRulesetsLogRuleAction) IsKnown() bool {
- switch r {
- case VersionGetResponseRulesRulesetsLogRuleActionLog:
- return true
- }
- return false
-}
-
-type VersionGetResponseRulesRulesetsSkipRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action VersionGetResponseRulesRulesetsSkipRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters VersionGetResponseRulesRulesetsSkipRuleActionParameters `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON versionGetResponseRulesRulesetsSkipRuleJSON `json:"-"`
-}
-
-// versionGetResponseRulesRulesetsSkipRuleJSON contains the JSON metadata for the
-// struct [VersionGetResponseRulesRulesetsSkipRule]
-type versionGetResponseRulesRulesetsSkipRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *VersionGetResponseRulesRulesetsSkipRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r versionGetResponseRulesRulesetsSkipRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r VersionGetResponseRulesRulesetsSkipRule) implementsRulesetsVersionGetResponseRule() {}
-
-// The action to perform when the rule matches.
-type VersionGetResponseRulesRulesetsSkipRuleAction string
-
-const (
- VersionGetResponseRulesRulesetsSkipRuleActionSkip VersionGetResponseRulesRulesetsSkipRuleAction = "skip"
-)
-
-func (r VersionGetResponseRulesRulesetsSkipRuleAction) IsKnown() bool {
- switch r {
- case VersionGetResponseRulesRulesetsSkipRuleActionSkip:
- return true
- }
- return false
-}
-
-// The parameters configuring the rule's action.
-type VersionGetResponseRulesRulesetsSkipRuleActionParameters struct {
- // A list of phases to skip the execution of. This option is incompatible with the
- // ruleset and rulesets options.
- Phases []VersionGetResponseRulesRulesetsSkipRuleActionParametersPhase `json:"phases"`
- // A list of legacy security products to skip the execution of.
- Products []VersionGetResponseRulesRulesetsSkipRuleActionParametersProduct `json:"products"`
- // A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the
- // execution of. This option is incompatible with the ruleset option.
- Rules map[string][]string `json:"rules"`
- // A ruleset to skip the execution of. This option is incompatible with the
- // rulesets, rules and phases options.
- Ruleset VersionGetResponseRulesRulesetsSkipRuleActionParametersRuleset `json:"ruleset"`
- // A list of ruleset IDs to skip the execution of. This option is incompatible with
- // the ruleset and phases options.
- Rulesets []string `json:"rulesets"`
- JSON versionGetResponseRulesRulesetsSkipRuleActionParametersJSON `json:"-"`
-}
-
-// versionGetResponseRulesRulesetsSkipRuleActionParametersJSON contains the JSON
-// metadata for the struct
-// [VersionGetResponseRulesRulesetsSkipRuleActionParameters]
-type versionGetResponseRulesRulesetsSkipRuleActionParametersJSON struct {
- Phases apijson.Field
- Products apijson.Field
- Rules apijson.Field
- Ruleset apijson.Field
- Rulesets apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *VersionGetResponseRulesRulesetsSkipRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r versionGetResponseRulesRulesetsSkipRuleActionParametersJSON) RawJSON() string {
- return r.raw
-}
-
-// A phase to skip the execution of.
-type VersionGetResponseRulesRulesetsSkipRuleActionParametersPhase string
-
-const (
- VersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseDDoSL4 VersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l4"
- VersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseDDoSL7 VersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l7"
- VersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings VersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_config_settings"
- VersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors VersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_custom_errors"
- VersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields VersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_log_custom_fields"
- VersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRatelimit VersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_ratelimit"
- VersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings VersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_cache_settings"
- VersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect VersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_dynamic_redirect"
- VersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom VersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_custom"
- VersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged VersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_managed"
- VersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform VersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_late_transform"
- VersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin VersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_origin"
- VersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect VersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_redirect"
- VersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize VersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sanitize"
- VersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm VersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sbfm"
- VersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration VersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_select_configuration"
- VersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform VersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_transform"
- VersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression VersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_compression"
- VersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged VersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_firewall_managed"
- VersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform VersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_headers_transform"
- VersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransit VersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit"
- VersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged VersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_ids_managed"
- VersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitManaged VersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_managed"
-)
-
-func (r VersionGetResponseRulesRulesetsSkipRuleActionParametersPhase) IsKnown() bool {
- switch r {
- case VersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseDDoSL4, VersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseDDoSL7, VersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings, VersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors, VersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields, VersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRatelimit, VersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings, VersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect, VersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom, VersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged, VersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform, VersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin, VersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect, VersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize, VersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm, VersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration, VersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform, VersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression, VersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged, VersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform, VersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransit, VersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged, VersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitManaged:
- return true
- }
- return false
-}
-
-// The name of a legacy security product to skip the execution of.
-type VersionGetResponseRulesRulesetsSkipRuleActionParametersProduct string
-
-const (
- VersionGetResponseRulesRulesetsSkipRuleActionParametersProductBic VersionGetResponseRulesRulesetsSkipRuleActionParametersProduct = "bic"
- VersionGetResponseRulesRulesetsSkipRuleActionParametersProductHot VersionGetResponseRulesRulesetsSkipRuleActionParametersProduct = "hot"
- VersionGetResponseRulesRulesetsSkipRuleActionParametersProductRateLimit VersionGetResponseRulesRulesetsSkipRuleActionParametersProduct = "rateLimit"
- VersionGetResponseRulesRulesetsSkipRuleActionParametersProductSecurityLevel VersionGetResponseRulesRulesetsSkipRuleActionParametersProduct = "securityLevel"
- VersionGetResponseRulesRulesetsSkipRuleActionParametersProductUABlock VersionGetResponseRulesRulesetsSkipRuleActionParametersProduct = "uaBlock"
- VersionGetResponseRulesRulesetsSkipRuleActionParametersProductWAF VersionGetResponseRulesRulesetsSkipRuleActionParametersProduct = "waf"
- VersionGetResponseRulesRulesetsSkipRuleActionParametersProductZoneLockdown VersionGetResponseRulesRulesetsSkipRuleActionParametersProduct = "zoneLockdown"
-)
-
-func (r VersionGetResponseRulesRulesetsSkipRuleActionParametersProduct) IsKnown() bool {
- switch r {
- case VersionGetResponseRulesRulesetsSkipRuleActionParametersProductBic, VersionGetResponseRulesRulesetsSkipRuleActionParametersProductHot, VersionGetResponseRulesRulesetsSkipRuleActionParametersProductRateLimit, VersionGetResponseRulesRulesetsSkipRuleActionParametersProductSecurityLevel, VersionGetResponseRulesRulesetsSkipRuleActionParametersProductUABlock, VersionGetResponseRulesRulesetsSkipRuleActionParametersProductWAF, VersionGetResponseRulesRulesetsSkipRuleActionParametersProductZoneLockdown:
- return true
- }
- return false
-}
-
-// A ruleset to skip the execution of. This option is incompatible with the
-// rulesets, rules and phases options.
-type VersionGetResponseRulesRulesetsSkipRuleActionParametersRuleset string
-
-const (
- VersionGetResponseRulesRulesetsSkipRuleActionParametersRulesetCurrent VersionGetResponseRulesRulesetsSkipRuleActionParametersRuleset = "current"
-)
-
-func (r VersionGetResponseRulesRulesetsSkipRuleActionParametersRuleset) IsKnown() bool {
- switch r {
- case VersionGetResponseRulesRulesetsSkipRuleActionParametersRulesetCurrent:
- return true
- }
- return false
-}
-
-// The action to perform when the rule matches.
-type VersionGetResponseRulesAction string
-
-const (
- VersionGetResponseRulesActionBlock VersionGetResponseRulesAction = "block"
- VersionGetResponseRulesActionExecute VersionGetResponseRulesAction = "execute"
- VersionGetResponseRulesActionLog VersionGetResponseRulesAction = "log"
- VersionGetResponseRulesActionSkip VersionGetResponseRulesAction = "skip"
-)
-
-func (r VersionGetResponseRulesAction) IsKnown() bool {
- switch r {
- case VersionGetResponseRulesActionBlock, VersionGetResponseRulesActionExecute, VersionGetResponseRulesActionLog, VersionGetResponseRulesActionSkip:
- return true
- }
- return false
-}
-
type VersionListParams struct {
// The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
AccountID param.Field[string] `path:"account_id"`
diff --git a/rulesets/versionbytag.go b/rulesets/versionbytag.go
index b871e137a54..777c49d89b3 100644
--- a/rulesets/versionbytag.go
+++ b/rulesets/versionbytag.go
@@ -6,15 +6,12 @@ import (
"context"
"fmt"
"net/http"
- "reflect"
"time"
"github.com/cloudflare/cloudflare-go/v2/internal/apijson"
"github.com/cloudflare/cloudflare-go/v2/internal/param"
"github.com/cloudflare/cloudflare-go/v2/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/v2/internal/shared"
"github.com/cloudflare/cloudflare-go/v2/option"
- "github.com/tidwall/gjson"
)
// VersionByTagService contains methods and other services that help with
@@ -61,7 +58,7 @@ type VersionByTagGetResponse struct {
// The phase of the ruleset.
Phase VersionByTagGetResponsePhase `json:"phase,required"`
// The list of rules in the ruleset.
- Rules []VersionByTagGetResponseRule `json:"rules,required"`
+ Rules []RequestRule `json:"rules,required"`
// The version of the ruleset.
Version string `json:"version,required"`
// An informative description of the ruleset.
@@ -147,784 +144,6 @@ func (r VersionByTagGetResponsePhase) IsKnown() bool {
return false
}
-type VersionByTagGetResponseRule struct {
- // The action to perform when the rule matches.
- Action VersionByTagGetResponseRulesAction `json:"action"`
- ActionParameters interface{} `json:"action_parameters,required"`
- Categories interface{} `json:"categories,required"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // An object configuring the rule's logging behavior.
- Logging shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- // The version of the rule.
- Version string `json:"version,required"`
- JSON versionByTagGetResponseRuleJSON `json:"-"`
- union VersionByTagGetResponseRulesUnion
-}
-
-// versionByTagGetResponseRuleJSON contains the JSON metadata for the struct
-// [VersionByTagGetResponseRule]
-type versionByTagGetResponseRuleJSON struct {
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- ID apijson.Field
- LastUpdated apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- Version apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r versionByTagGetResponseRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r *VersionByTagGetResponseRule) UnmarshalJSON(data []byte) (err error) {
- err = apijson.UnmarshalRoot(data, &r.union)
- if err != nil {
- return err
- }
- return apijson.Port(r.union, &r)
-}
-
-func (r VersionByTagGetResponseRule) AsUnion() VersionByTagGetResponseRulesUnion {
- return r.union
-}
-
-// Union satisfied by [rulesets.VersionByTagGetResponseRulesRulesetsBlockRule],
-// [rulesets.VersionByTagGetResponseRulesRulesetsExecuteRule],
-// [rulesets.VersionByTagGetResponseRulesRulesetsLogRule] or
-// [rulesets.VersionByTagGetResponseRulesRulesetsSkipRule].
-type VersionByTagGetResponseRulesUnion interface {
- implementsRulesetsVersionByTagGetResponseRule()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*VersionByTagGetResponseRulesUnion)(nil)).Elem(),
- "action",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(VersionByTagGetResponseRulesRulesetsBlockRule{}),
- DiscriminatorValue: "block",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(VersionByTagGetResponseRulesRulesetsExecuteRule{}),
- DiscriminatorValue: "execute",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(VersionByTagGetResponseRulesRulesetsLogRule{}),
- DiscriminatorValue: "log",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(VersionByTagGetResponseRulesRulesetsSkipRule{}),
- DiscriminatorValue: "skip",
- },
- )
-}
-
-type VersionByTagGetResponseRulesRulesetsBlockRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action VersionByTagGetResponseRulesRulesetsBlockRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters VersionByTagGetResponseRulesRulesetsBlockRuleActionParameters `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON versionByTagGetResponseRulesRulesetsBlockRuleJSON `json:"-"`
-}
-
-// versionByTagGetResponseRulesRulesetsBlockRuleJSON contains the JSON metadata for
-// the struct [VersionByTagGetResponseRulesRulesetsBlockRule]
-type versionByTagGetResponseRulesRulesetsBlockRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *VersionByTagGetResponseRulesRulesetsBlockRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r versionByTagGetResponseRulesRulesetsBlockRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r VersionByTagGetResponseRulesRulesetsBlockRule) implementsRulesetsVersionByTagGetResponseRule() {
-}
-
-// The action to perform when the rule matches.
-type VersionByTagGetResponseRulesRulesetsBlockRuleAction string
-
-const (
- VersionByTagGetResponseRulesRulesetsBlockRuleActionBlock VersionByTagGetResponseRulesRulesetsBlockRuleAction = "block"
-)
-
-func (r VersionByTagGetResponseRulesRulesetsBlockRuleAction) IsKnown() bool {
- switch r {
- case VersionByTagGetResponseRulesRulesetsBlockRuleActionBlock:
- return true
- }
- return false
-}
-
-// The parameters configuring the rule's action.
-type VersionByTagGetResponseRulesRulesetsBlockRuleActionParameters struct {
- // The response to show when the block is applied.
- Response VersionByTagGetResponseRulesRulesetsBlockRuleActionParametersResponse `json:"response"`
- JSON versionByTagGetResponseRulesRulesetsBlockRuleActionParametersJSON `json:"-"`
-}
-
-// versionByTagGetResponseRulesRulesetsBlockRuleActionParametersJSON contains the
-// JSON metadata for the struct
-// [VersionByTagGetResponseRulesRulesetsBlockRuleActionParameters]
-type versionByTagGetResponseRulesRulesetsBlockRuleActionParametersJSON struct {
- Response apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *VersionByTagGetResponseRulesRulesetsBlockRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r versionByTagGetResponseRulesRulesetsBlockRuleActionParametersJSON) RawJSON() string {
- return r.raw
-}
-
-// The response to show when the block is applied.
-type VersionByTagGetResponseRulesRulesetsBlockRuleActionParametersResponse struct {
- // The content to return.
- Content string `json:"content,required"`
- // The type of the content to return.
- ContentType string `json:"content_type,required"`
- // The status code to return.
- StatusCode int64 `json:"status_code,required"`
- JSON versionByTagGetResponseRulesRulesetsBlockRuleActionParametersResponseJSON `json:"-"`
-}
-
-// versionByTagGetResponseRulesRulesetsBlockRuleActionParametersResponseJSON
-// contains the JSON metadata for the struct
-// [VersionByTagGetResponseRulesRulesetsBlockRuleActionParametersResponse]
-type versionByTagGetResponseRulesRulesetsBlockRuleActionParametersResponseJSON struct {
- Content apijson.Field
- ContentType apijson.Field
- StatusCode apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *VersionByTagGetResponseRulesRulesetsBlockRuleActionParametersResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r versionByTagGetResponseRulesRulesetsBlockRuleActionParametersResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type VersionByTagGetResponseRulesRulesetsExecuteRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action VersionByTagGetResponseRulesRulesetsExecuteRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters VersionByTagGetResponseRulesRulesetsExecuteRuleActionParameters `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON versionByTagGetResponseRulesRulesetsExecuteRuleJSON `json:"-"`
-}
-
-// versionByTagGetResponseRulesRulesetsExecuteRuleJSON contains the JSON metadata
-// for the struct [VersionByTagGetResponseRulesRulesetsExecuteRule]
-type versionByTagGetResponseRulesRulesetsExecuteRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *VersionByTagGetResponseRulesRulesetsExecuteRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r versionByTagGetResponseRulesRulesetsExecuteRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r VersionByTagGetResponseRulesRulesetsExecuteRule) implementsRulesetsVersionByTagGetResponseRule() {
-}
-
-// The action to perform when the rule matches.
-type VersionByTagGetResponseRulesRulesetsExecuteRuleAction string
-
-const (
- VersionByTagGetResponseRulesRulesetsExecuteRuleActionExecute VersionByTagGetResponseRulesRulesetsExecuteRuleAction = "execute"
-)
-
-func (r VersionByTagGetResponseRulesRulesetsExecuteRuleAction) IsKnown() bool {
- switch r {
- case VersionByTagGetResponseRulesRulesetsExecuteRuleActionExecute:
- return true
- }
- return false
-}
-
-// The parameters configuring the rule's action.
-type VersionByTagGetResponseRulesRulesetsExecuteRuleActionParameters struct {
- // The ID of the ruleset to execute.
- ID string `json:"id,required"`
- // The configuration to use for matched data logging.
- MatchedData VersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersMatchedData `json:"matched_data"`
- // A set of overrides to apply to the target ruleset.
- Overrides VersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverrides `json:"overrides"`
- JSON versionByTagGetResponseRulesRulesetsExecuteRuleActionParametersJSON `json:"-"`
-}
-
-// versionByTagGetResponseRulesRulesetsExecuteRuleActionParametersJSON contains the
-// JSON metadata for the struct
-// [VersionByTagGetResponseRulesRulesetsExecuteRuleActionParameters]
-type versionByTagGetResponseRulesRulesetsExecuteRuleActionParametersJSON struct {
- ID apijson.Field
- MatchedData apijson.Field
- Overrides apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *VersionByTagGetResponseRulesRulesetsExecuteRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r versionByTagGetResponseRulesRulesetsExecuteRuleActionParametersJSON) RawJSON() string {
- return r.raw
-}
-
-// The configuration to use for matched data logging.
-type VersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersMatchedData struct {
- // The public key to encrypt matched data logs with.
- PublicKey string `json:"public_key,required"`
- JSON versionByTagGetResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON `json:"-"`
-}
-
-// versionByTagGetResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON
-// contains the JSON metadata for the struct
-// [VersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersMatchedData]
-type versionByTagGetResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON struct {
- PublicKey apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *VersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersMatchedData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r versionByTagGetResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON) RawJSON() string {
- return r.raw
-}
-
-// A set of overrides to apply to the target ruleset.
-type VersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverrides struct {
- // An action to override all rules with. This option has lower precedence than rule
- // and category overrides.
- Action string `json:"action"`
- // A list of category-level overrides. This option has the second-highest
- // precedence after rule-level overrides.
- Categories []VersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory `json:"categories"`
- // Whether to enable execution of all rules. This option has lower precedence than
- // rule and category overrides.
- Enabled bool `json:"enabled"`
- // A list of rule-level overrides. This option has the highest precedence.
- Rules []VersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRule `json:"rules"`
- // A sensitivity level to set for all rules. This option has lower precedence than
- // rule and category overrides and is only applicable for DDoS phases.
- SensitivityLevel VersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel `json:"sensitivity_level"`
- JSON versionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON `json:"-"`
-}
-
-// versionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON
-// contains the JSON metadata for the struct
-// [VersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverrides]
-type versionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON struct {
- Action apijson.Field
- Categories apijson.Field
- Enabled apijson.Field
- Rules apijson.Field
- SensitivityLevel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *VersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverrides) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r versionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON) RawJSON() string {
- return r.raw
-}
-
-// A category-level override
-type VersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory struct {
- // The name of the category to override.
- Category string `json:"category,required"`
- // The action to override rules in the category with.
- Action string `json:"action"`
- // Whether to enable execution of rules in the category.
- Enabled bool `json:"enabled"`
- // The sensitivity level to use for rules in the category.
- SensitivityLevel VersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel `json:"sensitivity_level"`
- JSON versionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON `json:"-"`
-}
-
-// versionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON
-// contains the JSON metadata for the struct
-// [VersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory]
-type versionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON struct {
- Category apijson.Field
- Action apijson.Field
- Enabled apijson.Field
- SensitivityLevel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *VersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r versionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON) RawJSON() string {
- return r.raw
-}
-
-// The sensitivity level to use for rules in the category.
-type VersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel string
-
-const (
- VersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault VersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "default"
- VersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium VersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "medium"
- VersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow VersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "low"
- VersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff VersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "eoff"
-)
-
-func (r VersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel) IsKnown() bool {
- switch r {
- case VersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault, VersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium, VersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow, VersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff:
- return true
- }
- return false
-}
-
-// A rule-level override
-type VersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRule struct {
- // The ID of the rule to override.
- ID string `json:"id,required"`
- // The action to override the rule with.
- Action string `json:"action"`
- // Whether to enable execution of the rule.
- Enabled bool `json:"enabled"`
- // The score threshold to use for the rule.
- ScoreThreshold int64 `json:"score_threshold"`
- // The sensitivity level to use for the rule.
- SensitivityLevel VersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel `json:"sensitivity_level"`
- JSON versionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON `json:"-"`
-}
-
-// versionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON
-// contains the JSON metadata for the struct
-// [VersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRule]
-type versionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON struct {
- ID apijson.Field
- Action apijson.Field
- Enabled apijson.Field
- ScoreThreshold apijson.Field
- SensitivityLevel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *VersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r versionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON) RawJSON() string {
- return r.raw
-}
-
-// The sensitivity level to use for the rule.
-type VersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel string
-
-const (
- VersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault VersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "default"
- VersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium VersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "medium"
- VersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow VersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "low"
- VersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff VersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "eoff"
-)
-
-func (r VersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel) IsKnown() bool {
- switch r {
- case VersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault, VersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium, VersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow, VersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff:
- return true
- }
- return false
-}
-
-// A sensitivity level to set for all rules. This option has lower precedence than
-// rule and category overrides and is only applicable for DDoS phases.
-type VersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel string
-
-const (
- VersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault VersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "default"
- VersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium VersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "medium"
- VersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow VersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "low"
- VersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff VersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "eoff"
-)
-
-func (r VersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel) IsKnown() bool {
- switch r {
- case VersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault, VersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium, VersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow, VersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff:
- return true
- }
- return false
-}
-
-type VersionByTagGetResponseRulesRulesetsLogRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action VersionByTagGetResponseRulesRulesetsLogRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters interface{} `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON versionByTagGetResponseRulesRulesetsLogRuleJSON `json:"-"`
-}
-
-// versionByTagGetResponseRulesRulesetsLogRuleJSON contains the JSON metadata for
-// the struct [VersionByTagGetResponseRulesRulesetsLogRule]
-type versionByTagGetResponseRulesRulesetsLogRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *VersionByTagGetResponseRulesRulesetsLogRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r versionByTagGetResponseRulesRulesetsLogRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r VersionByTagGetResponseRulesRulesetsLogRule) implementsRulesetsVersionByTagGetResponseRule() {
-}
-
-// The action to perform when the rule matches.
-type VersionByTagGetResponseRulesRulesetsLogRuleAction string
-
-const (
- VersionByTagGetResponseRulesRulesetsLogRuleActionLog VersionByTagGetResponseRulesRulesetsLogRuleAction = "log"
-)
-
-func (r VersionByTagGetResponseRulesRulesetsLogRuleAction) IsKnown() bool {
- switch r {
- case VersionByTagGetResponseRulesRulesetsLogRuleActionLog:
- return true
- }
- return false
-}
-
-type VersionByTagGetResponseRulesRulesetsSkipRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action VersionByTagGetResponseRulesRulesetsSkipRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters VersionByTagGetResponseRulesRulesetsSkipRuleActionParameters `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging shared.UnnamedSchemaRef70f2c6ccd8a405358ac7ef8fc3d6751c `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON versionByTagGetResponseRulesRulesetsSkipRuleJSON `json:"-"`
-}
-
-// versionByTagGetResponseRulesRulesetsSkipRuleJSON contains the JSON metadata for
-// the struct [VersionByTagGetResponseRulesRulesetsSkipRule]
-type versionByTagGetResponseRulesRulesetsSkipRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *VersionByTagGetResponseRulesRulesetsSkipRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r versionByTagGetResponseRulesRulesetsSkipRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r VersionByTagGetResponseRulesRulesetsSkipRule) implementsRulesetsVersionByTagGetResponseRule() {
-}
-
-// The action to perform when the rule matches.
-type VersionByTagGetResponseRulesRulesetsSkipRuleAction string
-
-const (
- VersionByTagGetResponseRulesRulesetsSkipRuleActionSkip VersionByTagGetResponseRulesRulesetsSkipRuleAction = "skip"
-)
-
-func (r VersionByTagGetResponseRulesRulesetsSkipRuleAction) IsKnown() bool {
- switch r {
- case VersionByTagGetResponseRulesRulesetsSkipRuleActionSkip:
- return true
- }
- return false
-}
-
-// The parameters configuring the rule's action.
-type VersionByTagGetResponseRulesRulesetsSkipRuleActionParameters struct {
- // A list of phases to skip the execution of. This option is incompatible with the
- // ruleset and rulesets options.
- Phases []VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhase `json:"phases"`
- // A list of legacy security products to skip the execution of.
- Products []VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersProduct `json:"products"`
- // A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the
- // execution of. This option is incompatible with the ruleset option.
- Rules map[string][]string `json:"rules"`
- // A ruleset to skip the execution of. This option is incompatible with the
- // rulesets, rules and phases options.
- Ruleset VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersRuleset `json:"ruleset"`
- // A list of ruleset IDs to skip the execution of. This option is incompatible with
- // the ruleset and phases options.
- Rulesets []string `json:"rulesets"`
- JSON versionByTagGetResponseRulesRulesetsSkipRuleActionParametersJSON `json:"-"`
-}
-
-// versionByTagGetResponseRulesRulesetsSkipRuleActionParametersJSON contains the
-// JSON metadata for the struct
-// [VersionByTagGetResponseRulesRulesetsSkipRuleActionParameters]
-type versionByTagGetResponseRulesRulesetsSkipRuleActionParametersJSON struct {
- Phases apijson.Field
- Products apijson.Field
- Rules apijson.Field
- Ruleset apijson.Field
- Rulesets apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *VersionByTagGetResponseRulesRulesetsSkipRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r versionByTagGetResponseRulesRulesetsSkipRuleActionParametersJSON) RawJSON() string {
- return r.raw
-}
-
-// A phase to skip the execution of.
-type VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhase string
-
-const (
- VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseDDoSL4 VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l4"
- VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseDDoSL7 VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l7"
- VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_config_settings"
- VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_custom_errors"
- VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_log_custom_fields"
- VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRatelimit VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_ratelimit"
- VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_cache_settings"
- VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_dynamic_redirect"
- VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_custom"
- VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_managed"
- VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_late_transform"
- VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_origin"
- VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_redirect"
- VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sanitize"
- VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sbfm"
- VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_select_configuration"
- VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_transform"
- VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_compression"
- VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_firewall_managed"
- VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_headers_transform"
- VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransit VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit"
- VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_ids_managed"
- VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitManaged VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_managed"
-)
-
-func (r VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhase) IsKnown() bool {
- switch r {
- case VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseDDoSL4, VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseDDoSL7, VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings, VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors, VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields, VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRatelimit, VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings, VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect, VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom, VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged, VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform, VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin, VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect, VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize, VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm, VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration, VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform, VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression, VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged, VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform, VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransit, VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged, VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitManaged:
- return true
- }
- return false
-}
-
-// The name of a legacy security product to skip the execution of.
-type VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersProduct string
-
-const (
- VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersProductBic VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersProduct = "bic"
- VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersProductHot VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersProduct = "hot"
- VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersProductRateLimit VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersProduct = "rateLimit"
- VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersProductSecurityLevel VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersProduct = "securityLevel"
- VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersProductUABlock VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersProduct = "uaBlock"
- VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersProductWAF VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersProduct = "waf"
- VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersProductZoneLockdown VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersProduct = "zoneLockdown"
-)
-
-func (r VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersProduct) IsKnown() bool {
- switch r {
- case VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersProductBic, VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersProductHot, VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersProductRateLimit, VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersProductSecurityLevel, VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersProductUABlock, VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersProductWAF, VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersProductZoneLockdown:
- return true
- }
- return false
-}
-
-// A ruleset to skip the execution of. This option is incompatible with the
-// rulesets, rules and phases options.
-type VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersRuleset string
-
-const (
- VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersRulesetCurrent VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersRuleset = "current"
-)
-
-func (r VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersRuleset) IsKnown() bool {
- switch r {
- case VersionByTagGetResponseRulesRulesetsSkipRuleActionParametersRulesetCurrent:
- return true
- }
- return false
-}
-
-// The action to perform when the rule matches.
-type VersionByTagGetResponseRulesAction string
-
-const (
- VersionByTagGetResponseRulesActionBlock VersionByTagGetResponseRulesAction = "block"
- VersionByTagGetResponseRulesActionExecute VersionByTagGetResponseRulesAction = "execute"
- VersionByTagGetResponseRulesActionLog VersionByTagGetResponseRulesAction = "log"
- VersionByTagGetResponseRulesActionSkip VersionByTagGetResponseRulesAction = "skip"
-)
-
-func (r VersionByTagGetResponseRulesAction) IsKnown() bool {
- switch r {
- case VersionByTagGetResponseRulesActionBlock, VersionByTagGetResponseRulesActionExecute, VersionByTagGetResponseRulesActionLog, VersionByTagGetResponseRulesActionSkip:
- return true
- }
- return false
-}
-
type VersionByTagGetParams struct {
// The unique ID of the account.
AccountID param.Field[string] `path:"account_id,required"`