rulesets

package
v2.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 16, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const AuditLogActorTypeAdmin = shared.AuditLogActorTypeAdmin

This is an alias to an internal value.

View Source
const AuditLogActorTypeCloudflare = shared.AuditLogActorTypeCloudflare

This is an alias to an internal value.

View Source
const AuditLogActorTypeUser = shared.AuditLogActorTypeUser

This is an alias to an internal value.

View Source
const CertificateCADigicert = shared.CertificateCADigicert

This is an alias to an internal value.

View Source
const CertificateCAGoogle = shared.CertificateCAGoogle

This is an alias to an internal value.

View Source
const CertificateCALetsEncrypt = shared.CertificateCALetsEncrypt

This is an alias to an internal value.

View Source
const CertificateRequestTypeKeylessCertificate = shared.CertificateRequestTypeKeylessCertificate

This is an alias to an internal value.

View Source
const CertificateRequestTypeOriginECC = shared.CertificateRequestTypeOriginECC

This is an alias to an internal value.

View Source
const CertificateRequestTypeOriginRSA = shared.CertificateRequestTypeOriginRSA

This is an alias to an internal value.

View Source
const CloudflareTunnelStatusDegraded = shared.CloudflareTunnelStatusDegraded

This is an alias to an internal value.

View Source
const CloudflareTunnelStatusDown = shared.CloudflareTunnelStatusDown

This is an alias to an internal value.

View Source
const CloudflareTunnelStatusHealthy = shared.CloudflareTunnelStatusHealthy

This is an alias to an internal value.

View Source
const CloudflareTunnelStatusInactive = shared.CloudflareTunnelStatusInactive

This is an alias to an internal value.

View Source
const CloudflareTunnelTunTypeCNI = shared.CloudflareTunnelTunTypeCNI

This is an alias to an internal value.

View Source
const CloudflareTunnelTunTypeCfdTunnel = shared.CloudflareTunnelTunTypeCfdTunnel

This is an alias to an internal value.

View Source
const CloudflareTunnelTunTypeGRE = shared.CloudflareTunnelTunTypeGRE

This is an alias to an internal value.

View Source
const CloudflareTunnelTunTypeIPSec = shared.CloudflareTunnelTunTypeIPSec

This is an alias to an internal value.

View Source
const CloudflareTunnelTunTypeWARPConnector = shared.CloudflareTunnelTunTypeWARPConnector

This is an alias to an internal value.

View Source
const MemberStatusAccepted = shared.MemberStatusAccepted

This is an alias to an internal value.

View Source
const MemberStatusPending = shared.MemberStatusPending

This is an alias to an internal value.

View Source
const SortDirectionAsc = shared.SortDirectionAsc

This is an alias to an internal value.

View Source
const SortDirectionDesc = shared.SortDirectionDesc

This is an alias to an internal value.

Variables

This section is empty.

Functions

This section is empty.

Types

type ASN added in v2.1.0

type ASN = shared.ASN

This is an alias to an internal type.

type ASNParam added in v2.1.0

type ASNParam = shared.ASNParam

This is an alias to an internal type.

type AuditLog

type AuditLog = shared.AuditLog

This is an alias to an internal type.

type AuditLogAction

type AuditLogAction = shared.AuditLogAction

This is an alias to an internal type.

type AuditLogActor

type AuditLogActor = shared.AuditLogActor

This is an alias to an internal type.

type AuditLogActorType

type AuditLogActorType = shared.AuditLogActorType

The type of actor, whether a User, Cloudflare Admin, or an Automated System.

This is an alias to an internal type.

type AuditLogOwner

type AuditLogOwner = shared.AuditLogOwner

This is an alias to an internal type.

type AuditLogResource

type AuditLogResource = shared.AuditLogResource

This is an alias to an internal type.

type BlockRule

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.
	Version string `json:"version,required"`
	// The unique ID of the rule.
	ID string `json:"id"`
	// The action to perform when the rule matches.
	Action BlockRuleAction `json:"action"`
	// The parameters configuring the rule's action.
	ActionParameters BlockRuleActionParameters `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 Logging `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref  string        `json:"ref"`
	JSON blockRuleJSON `json:"-"`
}

func (*BlockRule) UnmarshalJSON

func (r *BlockRule) UnmarshalJSON(data []byte) (err error)

type BlockRuleAction

type BlockRuleAction string

The action to perform when the rule matches.

const (
	BlockRuleActionBlock BlockRuleAction = "block"
)

func (BlockRuleAction) IsKnown

func (r BlockRuleAction) IsKnown() bool

type BlockRuleActionParameters

type BlockRuleActionParameters struct {
	// The response to show when the block is applied.
	Response BlockRuleActionParametersResponse `json:"response"`
	JSON     blockRuleActionParametersJSON     `json:"-"`
}

The parameters configuring the rule's action.

func (*BlockRuleActionParameters) UnmarshalJSON

func (r *BlockRuleActionParameters) UnmarshalJSON(data []byte) (err error)

type BlockRuleActionParametersParam

type BlockRuleActionParametersParam struct {
	// The response to show when the block is applied.
	Response param.Field[BlockRuleActionParametersResponseParam] `json:"response"`
}

The parameters configuring the rule's action.

func (BlockRuleActionParametersParam) MarshalJSON

func (r BlockRuleActionParametersParam) MarshalJSON() (data []byte, err error)

type BlockRuleActionParametersResponse

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       blockRuleActionParametersResponseJSON `json:"-"`
}

The response to show when the block is applied.

func (*BlockRuleActionParametersResponse) UnmarshalJSON

func (r *BlockRuleActionParametersResponse) UnmarshalJSON(data []byte) (err error)

type BlockRuleActionParametersResponseParam

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"`
}

The response to show when the block is applied.

func (BlockRuleActionParametersResponseParam) MarshalJSON

func (r BlockRuleActionParametersResponseParam) MarshalJSON() (data []byte, err error)

type BlockRuleParam

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[LoggingParam] `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref param.Field[string] `json:"ref"`
}

func (BlockRuleParam) MarshalJSON

func (r BlockRuleParam) MarshalJSON() (data []byte, err error)

type CertificateCA added in v2.2.0

type CertificateCA = shared.CertificateCA

The Certificate Authority that will issue the certificate

This is an alias to an internal type.

type CertificateRequestType added in v2.2.0

type CertificateRequestType = shared.CertificateRequestType

Signature type desired on certificate ("origin-rsa" (rsa), "origin-ecc" (ecdsa), or "keyless-certificate" (for Keyless SSL servers).

This is an alias to an internal type.

type ChallengeRule

type ChallengeRule 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 ChallengeRuleAction `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 Logging `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref  string            `json:"ref"`
	JSON challengeRuleJSON `json:"-"`
}

func (*ChallengeRule) UnmarshalJSON

func (r *ChallengeRule) UnmarshalJSON(data []byte) (err error)

type ChallengeRuleAction

type ChallengeRuleAction string

The action to perform when the rule matches.

const (
	ChallengeRuleActionChallenge ChallengeRuleAction = "challenge"
)

func (ChallengeRuleAction) IsKnown

func (r ChallengeRuleAction) IsKnown() bool

type ChallengeRuleParam

type ChallengeRuleParam struct {
	// The unique ID of the rule.
	ID param.Field[string] `json:"id"`
	// The action to perform when the rule matches.
	Action param.Field[ChallengeRuleAction] `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[LoggingParam] `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref param.Field[string] `json:"ref"`
}

func (ChallengeRuleParam) MarshalJSON

func (r ChallengeRuleParam) MarshalJSON() (data []byte, err error)

type CloudflareTunnel

type CloudflareTunnel = shared.CloudflareTunnel

A Cloudflare Tunnel that connects your origin to Cloudflare's edge.

This is an alias to an internal type.

type CloudflareTunnelConnection

type CloudflareTunnelConnection = shared.CloudflareTunnelConnection

This is an alias to an internal type.

type CloudflareTunnelStatus added in v2.3.0

type CloudflareTunnelStatus = shared.CloudflareTunnelStatus

The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge).

This is an alias to an internal type.

type CloudflareTunnelTunType

type CloudflareTunnelTunType = shared.CloudflareTunnelTunType

The type of tunnel.

This is an alias to an internal type.

type CompressResponseRule

type CompressResponseRule 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 CompressResponseRuleAction `json:"action"`
	// The parameters configuring the rule's action.
	ActionParameters CompressResponseRuleActionParameters `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 Logging `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref  string                   `json:"ref"`
	JSON compressResponseRuleJSON `json:"-"`
}

func (*CompressResponseRule) UnmarshalJSON

func (r *CompressResponseRule) UnmarshalJSON(data []byte) (err error)

type CompressResponseRuleAction

type CompressResponseRuleAction string

The action to perform when the rule matches.

const (
	CompressResponseRuleActionCompressResponse CompressResponseRuleAction = "compress_response"
)

func (CompressResponseRuleAction) IsKnown

func (r CompressResponseRuleAction) IsKnown() bool

type CompressResponseRuleActionParameters

type CompressResponseRuleActionParameters struct {
	// Custom order for compression algorithms.
	Algorithms []CompressResponseRuleActionParametersAlgorithm `json:"algorithms"`
	JSON       compressResponseRuleActionParametersJSON        `json:"-"`
}

The parameters configuring the rule's action.

func (*CompressResponseRuleActionParameters) UnmarshalJSON

func (r *CompressResponseRuleActionParameters) UnmarshalJSON(data []byte) (err error)

type CompressResponseRuleActionParametersAlgorithm

type CompressResponseRuleActionParametersAlgorithm struct {
	// Name of compression algorithm to enable.
	Name CompressResponseRuleActionParametersAlgorithmsName `json:"name"`
	JSON compressResponseRuleActionParametersAlgorithmJSON  `json:"-"`
}

Compression algorithm to enable.

func (*CompressResponseRuleActionParametersAlgorithm) UnmarshalJSON

func (r *CompressResponseRuleActionParametersAlgorithm) UnmarshalJSON(data []byte) (err error)

type CompressResponseRuleActionParametersAlgorithmParam

type CompressResponseRuleActionParametersAlgorithmParam struct {
	// Name of compression algorithm to enable.
	Name param.Field[CompressResponseRuleActionParametersAlgorithmsName] `json:"name"`
}

Compression algorithm to enable.

func (CompressResponseRuleActionParametersAlgorithmParam) MarshalJSON

func (r CompressResponseRuleActionParametersAlgorithmParam) MarshalJSON() (data []byte, err error)

type CompressResponseRuleActionParametersAlgorithmsName

type CompressResponseRuleActionParametersAlgorithmsName string

Name of compression algorithm to enable.

const (
	CompressResponseRuleActionParametersAlgorithmsNameNone    CompressResponseRuleActionParametersAlgorithmsName = "none"
	CompressResponseRuleActionParametersAlgorithmsNameAuto    CompressResponseRuleActionParametersAlgorithmsName = "auto"
	CompressResponseRuleActionParametersAlgorithmsNameDefault CompressResponseRuleActionParametersAlgorithmsName = "default"
	CompressResponseRuleActionParametersAlgorithmsNameGzip    CompressResponseRuleActionParametersAlgorithmsName = "gzip"
	CompressResponseRuleActionParametersAlgorithmsNameBrotli  CompressResponseRuleActionParametersAlgorithmsName = "brotli"
)

func (CompressResponseRuleActionParametersAlgorithmsName) IsKnown

type CompressResponseRuleActionParametersParam

type CompressResponseRuleActionParametersParam struct {
	// Custom order for compression algorithms.
	Algorithms param.Field[[]CompressResponseRuleActionParametersAlgorithmParam] `json:"algorithms"`
}

The parameters configuring the rule's action.

func (CompressResponseRuleActionParametersParam) MarshalJSON

func (r CompressResponseRuleActionParametersParam) MarshalJSON() (data []byte, err error)

type CompressResponseRuleParam

type CompressResponseRuleParam struct {
	// The unique ID of the rule.
	ID param.Field[string] `json:"id"`
	// The action to perform when the rule matches.
	Action param.Field[CompressResponseRuleAction] `json:"action"`
	// The parameters configuring the rule's action.
	ActionParameters param.Field[CompressResponseRuleActionParametersParam] `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[LoggingParam] `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref param.Field[string] `json:"ref"`
}

func (CompressResponseRuleParam) MarshalJSON

func (r CompressResponseRuleParam) MarshalJSON() (data []byte, err error)

type Error

type Error = apierror.Error

type ErrorData

type ErrorData = shared.ErrorData

This is an alias to an internal type.

type ExecuteRule

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.
	Version string `json:"version,required"`
	// The unique ID of the rule.
	ID string `json:"id"`
	// The action to perform when the rule matches.
	Action ExecuteRuleAction `json:"action"`
	// The parameters configuring the rule's action.
	ActionParameters ExecuteRuleActionParameters `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 Logging `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref  string          `json:"ref"`
	JSON executeRuleJSON `json:"-"`
}

func (*ExecuteRule) UnmarshalJSON

func (r *ExecuteRule) UnmarshalJSON(data []byte) (err error)

type ExecuteRuleAction

type ExecuteRuleAction string

The action to perform when the rule matches.

const (
	ExecuteRuleActionExecute ExecuteRuleAction = "execute"
)

func (ExecuteRuleAction) IsKnown

func (r ExecuteRuleAction) IsKnown() bool

type ExecuteRuleActionParameters

type ExecuteRuleActionParameters struct {
	// The ID of the ruleset to execute.
	ID string `json:"id,required"`
	// The configuration to use for matched data logging.
	MatchedData ExecuteRuleActionParametersMatchedData `json:"matched_data"`
	// A set of overrides to apply to the target ruleset.
	Overrides ExecuteRuleActionParametersOverrides `json:"overrides"`
	JSON      executeRuleActionParametersJSON      `json:"-"`
}

The parameters configuring the rule's action.

func (*ExecuteRuleActionParameters) UnmarshalJSON

func (r *ExecuteRuleActionParameters) UnmarshalJSON(data []byte) (err error)

type ExecuteRuleActionParametersMatchedData

type ExecuteRuleActionParametersMatchedData struct {
	// The public key to encrypt matched data logs with.
	PublicKey string                                     `json:"public_key,required"`
	JSON      executeRuleActionParametersMatchedDataJSON `json:"-"`
}

The configuration to use for matched data logging.

func (*ExecuteRuleActionParametersMatchedData) UnmarshalJSON

func (r *ExecuteRuleActionParametersMatchedData) UnmarshalJSON(data []byte) (err error)

type ExecuteRuleActionParametersMatchedDataParam

type ExecuteRuleActionParametersMatchedDataParam struct {
	// The public key to encrypt matched data logs with.
	PublicKey param.Field[string] `json:"public_key,required"`
}

The configuration to use for matched data logging.

func (ExecuteRuleActionParametersMatchedDataParam) MarshalJSON

func (r ExecuteRuleActionParametersMatchedDataParam) MarshalJSON() (data []byte, err error)

type ExecuteRuleActionParametersOverrides

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 []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 []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 ExecuteRuleActionParametersOverridesSensitivityLevel `json:"sensitivity_level"`
	JSON             executeRuleActionParametersOverridesJSON             `json:"-"`
}

A set of overrides to apply to the target ruleset.

func (*ExecuteRuleActionParametersOverrides) UnmarshalJSON

func (r *ExecuteRuleActionParametersOverrides) UnmarshalJSON(data []byte) (err error)

type ExecuteRuleActionParametersOverridesCategoriesSensitivityLevel

type ExecuteRuleActionParametersOverridesCategoriesSensitivityLevel string

The sensitivity level to use for rules in the category.

const (
	ExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault ExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "default"
	ExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium  ExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "medium"
	ExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow     ExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "low"
	ExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff    ExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "eoff"
)

func (ExecuteRuleActionParametersOverridesCategoriesSensitivityLevel) IsKnown

type ExecuteRuleActionParametersOverridesCategory

type ExecuteRuleActionParametersOverridesCategory 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 ExecuteRuleActionParametersOverridesCategoriesSensitivityLevel `json:"sensitivity_level"`
	JSON             executeRuleActionParametersOverridesCategoryJSON               `json:"-"`
}

A category-level override

func (*ExecuteRuleActionParametersOverridesCategory) UnmarshalJSON

func (r *ExecuteRuleActionParametersOverridesCategory) UnmarshalJSON(data []byte) (err error)

type ExecuteRuleActionParametersOverridesCategoryParam

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"`
}

A category-level override

func (ExecuteRuleActionParametersOverridesCategoryParam) MarshalJSON

func (r ExecuteRuleActionParametersOverridesCategoryParam) MarshalJSON() (data []byte, err error)

type ExecuteRuleActionParametersOverridesParam

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"`
}

A set of overrides to apply to the target ruleset.

func (ExecuteRuleActionParametersOverridesParam) MarshalJSON

func (r ExecuteRuleActionParametersOverridesParam) MarshalJSON() (data []byte, err error)

type ExecuteRuleActionParametersOverridesRule

type ExecuteRuleActionParametersOverridesRule 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 ExecuteRuleActionParametersOverridesRulesSensitivityLevel `json:"sensitivity_level"`
	JSON             executeRuleActionParametersOverridesRuleJSON              `json:"-"`
}

A rule-level override

func (*ExecuteRuleActionParametersOverridesRule) UnmarshalJSON

func (r *ExecuteRuleActionParametersOverridesRule) UnmarshalJSON(data []byte) (err error)

type ExecuteRuleActionParametersOverridesRuleParam

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"`
}

A rule-level override

func (ExecuteRuleActionParametersOverridesRuleParam) MarshalJSON

func (r ExecuteRuleActionParametersOverridesRuleParam) MarshalJSON() (data []byte, err error)

type ExecuteRuleActionParametersOverridesRulesSensitivityLevel

type ExecuteRuleActionParametersOverridesRulesSensitivityLevel string

The sensitivity level to use for the rule.

const (
	ExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault ExecuteRuleActionParametersOverridesRulesSensitivityLevel = "default"
	ExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium  ExecuteRuleActionParametersOverridesRulesSensitivityLevel = "medium"
	ExecuteRuleActionParametersOverridesRulesSensitivityLevelLow     ExecuteRuleActionParametersOverridesRulesSensitivityLevel = "low"
	ExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff    ExecuteRuleActionParametersOverridesRulesSensitivityLevel = "eoff"
)

func (ExecuteRuleActionParametersOverridesRulesSensitivityLevel) IsKnown

type ExecuteRuleActionParametersOverridesSensitivityLevel

type ExecuteRuleActionParametersOverridesSensitivityLevel string

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.

const (
	ExecuteRuleActionParametersOverridesSensitivityLevelDefault ExecuteRuleActionParametersOverridesSensitivityLevel = "default"
	ExecuteRuleActionParametersOverridesSensitivityLevelMedium  ExecuteRuleActionParametersOverridesSensitivityLevel = "medium"
	ExecuteRuleActionParametersOverridesSensitivityLevelLow     ExecuteRuleActionParametersOverridesSensitivityLevel = "low"
	ExecuteRuleActionParametersOverridesSensitivityLevelEoff    ExecuteRuleActionParametersOverridesSensitivityLevel = "eoff"
)

func (ExecuteRuleActionParametersOverridesSensitivityLevel) IsKnown

type ExecuteRuleActionParametersParam

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"`
}

The parameters configuring the rule's action.

func (ExecuteRuleActionParametersParam) MarshalJSON

func (r ExecuteRuleActionParametersParam) MarshalJSON() (data []byte, err error)

type ExecuteRuleParam

type ExecuteRuleParam struct {
	// The unique ID of the rule.
	ID param.Field[string] `json:"id"`
	// The action to perform when the rule matches.
	Action param.Field[ExecuteRuleAction] `json:"action"`
	// The parameters configuring the rule's action.
	ActionParameters param.Field[ExecuteRuleActionParametersParam] `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[LoggingParam] `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref param.Field[string] `json:"ref"`
}

func (ExecuteRuleParam) MarshalJSON

func (r ExecuteRuleParam) MarshalJSON() (data []byte, err error)

type JSChallengeRule

type JSChallengeRule 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 JSChallengeRuleAction `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 Logging `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref  string              `json:"ref"`
	JSON jsChallengeRuleJSON `json:"-"`
}

func (*JSChallengeRule) UnmarshalJSON

func (r *JSChallengeRule) UnmarshalJSON(data []byte) (err error)

type JSChallengeRuleAction

type JSChallengeRuleAction string

The action to perform when the rule matches.

const (
	JSChallengeRuleActionJSChallenge JSChallengeRuleAction = "js_challenge"
)

func (JSChallengeRuleAction) IsKnown

func (r JSChallengeRuleAction) IsKnown() bool

type JSChallengeRuleParam

type JSChallengeRuleParam struct {
	// The unique ID of the rule.
	ID param.Field[string] `json:"id"`
	// The action to perform when the rule matches.
	Action param.Field[JSChallengeRuleAction] `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[LoggingParam] `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref param.Field[string] `json:"ref"`
}

func (JSChallengeRuleParam) MarshalJSON

func (r JSChallengeRuleParam) MarshalJSON() (data []byte, err error)

type Kind added in v2.2.0

type Kind string

The kind of the ruleset.

const (
	KindManaged Kind = "managed"
	KindCustom  Kind = "custom"
	KindRoot    Kind = "root"
	KindZone    Kind = "zone"
)

func (Kind) IsKnown added in v2.2.0

func (r Kind) IsKnown() bool

type LogRule

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.
	Version string `json:"version,required"`
	// The unique ID of the rule.
	ID string `json:"id"`
	// The action to perform when the rule matches.
	Action LogRuleAction `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 Logging `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref  string      `json:"ref"`
	JSON logRuleJSON `json:"-"`
}

func (*LogRule) UnmarshalJSON

func (r *LogRule) UnmarshalJSON(data []byte) (err error)

type LogRuleAction

type LogRuleAction string

The action to perform when the rule matches.

const (
	LogRuleActionLog LogRuleAction = "log"
)

func (LogRuleAction) IsKnown

func (r LogRuleAction) IsKnown() bool

type LogRuleParam

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[LoggingParam] `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref param.Field[string] `json:"ref"`
}

func (LogRuleParam) MarshalJSON

func (r LogRuleParam) MarshalJSON() (data []byte, err error)

type Logging

type Logging struct {
	// Whether to generate a log when the rule matches.
	Enabled bool        `json:"enabled,required"`
	JSON    loggingJSON `json:"-"`
}

An object configuring the rule's logging behavior.

func (*Logging) UnmarshalJSON

func (r *Logging) UnmarshalJSON(data []byte) (err error)

type LoggingParam

type LoggingParam struct {
	// Whether to generate a log when the rule matches.
	Enabled param.Field[bool] `json:"enabled,required"`
}

An object configuring the rule's logging behavior.

func (LoggingParam) MarshalJSON

func (r LoggingParam) MarshalJSON() (data []byte, err error)

type ManagedChallengeRule

type ManagedChallengeRule 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 ManagedChallengeRuleAction `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 Logging `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref  string                   `json:"ref"`
	JSON managedChallengeRuleJSON `json:"-"`
}

func (*ManagedChallengeRule) UnmarshalJSON

func (r *ManagedChallengeRule) UnmarshalJSON(data []byte) (err error)

type ManagedChallengeRuleAction

type ManagedChallengeRuleAction string

The action to perform when the rule matches.

const (
	ManagedChallengeRuleActionManagedChallenge ManagedChallengeRuleAction = "managed_challenge"
)

func (ManagedChallengeRuleAction) IsKnown

func (r ManagedChallengeRuleAction) IsKnown() bool

type ManagedChallengeRuleParam

type ManagedChallengeRuleParam struct {
	// The unique ID of the rule.
	ID param.Field[string] `json:"id"`
	// The action to perform when the rule matches.
	Action param.Field[ManagedChallengeRuleAction] `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[LoggingParam] `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref param.Field[string] `json:"ref"`
}

func (ManagedChallengeRuleParam) MarshalJSON

func (r ManagedChallengeRuleParam) MarshalJSON() (data []byte, err error)

type MemberParam added in v2.1.0

type MemberParam = shared.MemberParam

This is an alias to an internal type.

type MemberRoleParam added in v2.1.0

type MemberRoleParam = shared.MemberRoleParam

This is an alias to an internal type.

type MemberRolesPermissionsParam added in v2.1.0

type MemberRolesPermissionsParam = shared.MemberRolesPermissionsParam

This is an alias to an internal type.

type MemberStatus added in v2.3.0

type MemberStatus = shared.MemberStatus

A member's status in the account.

This is an alias to an internal type.

type MemberUserParam added in v2.1.0

type MemberUserParam = shared.MemberUserParam

Details of the user associated to the membership.

This is an alias to an internal type.

type Permission

type Permission = shared.Permission

This is an alias to an internal type.

type PermissionGrant

type PermissionGrant = shared.PermissionGrant

This is an alias to an internal type.

type PermissionGrantParam

type PermissionGrantParam = shared.PermissionGrantParam

This is an alias to an internal type.

type Phase added in v2.2.0

type Phase string

The phase of the ruleset.

const (
	PhaseDDoSL4                         Phase = "ddos_l4"
	PhaseDDoSL7                         Phase = "ddos_l7"
	PhaseHTTPConfigSettings             Phase = "http_config_settings"
	PhaseHTTPCustomErrors               Phase = "http_custom_errors"
	PhaseHTTPLogCustomFields            Phase = "http_log_custom_fields"
	PhaseHTTPRatelimit                  Phase = "http_ratelimit"
	PhaseHTTPRequestCacheSettings       Phase = "http_request_cache_settings"
	PhaseHTTPRequestDynamicRedirect     Phase = "http_request_dynamic_redirect"
	PhaseHTTPRequestFirewallCustom      Phase = "http_request_firewall_custom"
	PhaseHTTPRequestFirewallManaged     Phase = "http_request_firewall_managed"
	PhaseHTTPRequestLateTransform       Phase = "http_request_late_transform"
	PhaseHTTPRequestOrigin              Phase = "http_request_origin"
	PhaseHTTPRequestRedirect            Phase = "http_request_redirect"
	PhaseHTTPRequestSanitize            Phase = "http_request_sanitize"
	PhaseHTTPRequestSBFM                Phase = "http_request_sbfm"
	PhaseHTTPRequestSelectConfiguration Phase = "http_request_select_configuration"
	PhaseHTTPRequestTransform           Phase = "http_request_transform"
	PhaseHTTPResponseCompression        Phase = "http_response_compression"
	PhaseHTTPResponseFirewallManaged    Phase = "http_response_firewall_managed"
	PhaseHTTPResponseHeadersTransform   Phase = "http_response_headers_transform"
	PhaseMagicTransit                   Phase = "magic_transit"
	PhaseMagicTransitIDsManaged         Phase = "magic_transit_ids_managed"
	PhaseMagicTransitManaged            Phase = "magic_transit_managed"
)

func (Phase) IsKnown added in v2.2.0

func (r Phase) IsKnown() bool

type PhaseGetParams

type PhaseGetParams 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.
	ZoneID param.Field[string] `path:"zone_id"`
}

type PhaseGetResponse

type PhaseGetResponse struct {
	// The unique ID of the ruleset.
	ID string `json:"id,required"`
	// The kind of the ruleset.
	Kind Kind `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 Phase `json:"phase,required"`
	// The list of rules in the ruleset.
	Rules []PhaseGetResponseRule `json:"rules,required"`
	// The version of the ruleset.
	Version string `json:"version,required"`
	// An informative description of the ruleset.
	Description string               `json:"description"`
	JSON        phaseGetResponseJSON `json:"-"`
}

A ruleset object.

func (*PhaseGetResponse) UnmarshalJSON

func (r *PhaseGetResponse) UnmarshalJSON(data []byte) (err error)

type PhaseGetResponseEnvelope

type PhaseGetResponseEnvelope struct {
	// A list of error messages.
	Errors []PhaseGetResponseEnvelopeErrors `json:"errors,required"`
	// A list of warning messages.
	Messages []PhaseGetResponseEnvelopeMessages `json:"messages,required"`
	// A ruleset object.
	Result PhaseGetResponse `json:"result,required"`
	// Whether the API call was successful.
	Success PhaseGetResponseEnvelopeSuccess `json:"success,required"`
	JSON    phaseGetResponseEnvelopeJSON    `json:"-"`
}

A response object.

func (*PhaseGetResponseEnvelope) UnmarshalJSON

func (r *PhaseGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type PhaseGetResponseEnvelopeErrors

type PhaseGetResponseEnvelopeErrors 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 PhaseGetResponseEnvelopeErrorsSource `json:"source"`
	JSON   phaseGetResponseEnvelopeErrorsJSON   `json:"-"`
}

A message.

func (*PhaseGetResponseEnvelopeErrors) UnmarshalJSON

func (r *PhaseGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type PhaseGetResponseEnvelopeErrorsSource

type PhaseGetResponseEnvelopeErrorsSource struct {
	// A JSON pointer to the field that is the source of the message.
	Pointer string                                   `json:"pointer,required"`
	JSON    phaseGetResponseEnvelopeErrorsSourceJSON `json:"-"`
}

The source of this message.

func (*PhaseGetResponseEnvelopeErrorsSource) UnmarshalJSON

func (r *PhaseGetResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error)

type PhaseGetResponseEnvelopeMessages

type PhaseGetResponseEnvelopeMessages 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 PhaseGetResponseEnvelopeMessagesSource `json:"source"`
	JSON   phaseGetResponseEnvelopeMessagesJSON   `json:"-"`
}

A message.

func (*PhaseGetResponseEnvelopeMessages) UnmarshalJSON

func (r *PhaseGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type PhaseGetResponseEnvelopeMessagesSource

type PhaseGetResponseEnvelopeMessagesSource struct {
	// A JSON pointer to the field that is the source of the message.
	Pointer string                                     `json:"pointer,required"`
	JSON    phaseGetResponseEnvelopeMessagesSourceJSON `json:"-"`
}

The source of this message.

func (*PhaseGetResponseEnvelopeMessagesSource) UnmarshalJSON

func (r *PhaseGetResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error)

type PhaseGetResponseEnvelopeSuccess

type PhaseGetResponseEnvelopeSuccess bool

Whether the API call was successful.

const (
	PhaseGetResponseEnvelopeSuccessTrue PhaseGetResponseEnvelopeSuccess = true
)

func (PhaseGetResponseEnvelopeSuccess) IsKnown

type PhaseGetResponseRule

type PhaseGetResponseRule struct {
	// The action to perform when the rule matches.
	Action PhaseGetResponseRulesAction `json:"action"`
	// This field can have the runtime type of [BlockRuleActionParameters],
	// [interface{}], [CompressResponseRuleActionParameters],
	// [ExecuteRuleActionParameters], [RedirectRuleActionParameters],
	// [RewriteRuleActionParameters], [RouteRuleActionParameters],
	// [ScoreRuleActionParameters], [ServeErrorRuleActionParameters],
	// [SetConfigRuleActionParameters], [SkipRuleActionParameters],
	// [SetCacheSettingsRuleActionParameters],
	// [PhaseGetResponseRulesRulesetsLogCustomFieldRuleActionParameters].
	ActionParameters interface{} `json:"action_parameters,required"`
	// This field can have the runtime type of [[]string].
	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 Logging `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:"-"`
	// contains filtered or unexported fields
}

func (*PhaseGetResponseRule) UnmarshalJSON

func (r *PhaseGetResponseRule) UnmarshalJSON(data []byte) (err error)

type PhaseGetResponseRulesAction

type PhaseGetResponseRulesAction string

The action to perform when the rule matches.

const (
	PhaseGetResponseRulesActionBlock                PhaseGetResponseRulesAction = "block"
	PhaseGetResponseRulesActionChallenge            PhaseGetResponseRulesAction = "challenge"
	PhaseGetResponseRulesActionCompressResponse     PhaseGetResponseRulesAction = "compress_response"
	PhaseGetResponseRulesActionExecute              PhaseGetResponseRulesAction = "execute"
	PhaseGetResponseRulesActionJSChallenge          PhaseGetResponseRulesAction = "js_challenge"
	PhaseGetResponseRulesActionLog                  PhaseGetResponseRulesAction = "log"
	PhaseGetResponseRulesActionManagedChallenge     PhaseGetResponseRulesAction = "managed_challenge"
	PhaseGetResponseRulesActionRedirect             PhaseGetResponseRulesAction = "redirect"
	PhaseGetResponseRulesActionRewrite              PhaseGetResponseRulesAction = "rewrite"
	PhaseGetResponseRulesActionRoute                PhaseGetResponseRulesAction = "route"
	PhaseGetResponseRulesActionScore                PhaseGetResponseRulesAction = "score"
	PhaseGetResponseRulesActionServeError           PhaseGetResponseRulesAction = "serve_error"
	PhaseGetResponseRulesActionSetConfig            PhaseGetResponseRulesAction = "set_config"
	PhaseGetResponseRulesActionSkip                 PhaseGetResponseRulesAction = "skip"
	PhaseGetResponseRulesActionSetCacheSettings     PhaseGetResponseRulesAction = "set_cache_settings"
	PhaseGetResponseRulesActionLogCustomField       PhaseGetResponseRulesAction = "log_custom_field"
	PhaseGetResponseRulesActionDDoSDynamic          PhaseGetResponseRulesAction = "ddos_dynamic"
	PhaseGetResponseRulesActionForceConnectionClose PhaseGetResponseRulesAction = "force_connection_close"
)

func (PhaseGetResponseRulesAction) IsKnown

func (r PhaseGetResponseRulesAction) IsKnown() bool

type PhaseGetResponseRulesRulesetsDDoSDynamicRule added in v2.3.0

type PhaseGetResponseRulesRulesetsDDoSDynamicRule 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 PhaseGetResponseRulesRulesetsDDoSDynamicRuleAction `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 Logging `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref  string                                           `json:"ref"`
	JSON phaseGetResponseRulesRulesetsDDoSDynamicRuleJSON `json:"-"`
}

func (*PhaseGetResponseRulesRulesetsDDoSDynamicRule) UnmarshalJSON added in v2.3.0

func (r *PhaseGetResponseRulesRulesetsDDoSDynamicRule) UnmarshalJSON(data []byte) (err error)

type PhaseGetResponseRulesRulesetsDDoSDynamicRuleAction added in v2.3.0

type PhaseGetResponseRulesRulesetsDDoSDynamicRuleAction string

The action to perform when the rule matches.

const (
	PhaseGetResponseRulesRulesetsDDoSDynamicRuleActionDDoSDynamic PhaseGetResponseRulesRulesetsDDoSDynamicRuleAction = "ddos_dynamic"
)

func (PhaseGetResponseRulesRulesetsDDoSDynamicRuleAction) IsKnown added in v2.3.0

type PhaseGetResponseRulesRulesetsForceConnectionCloseRule added in v2.3.0

type PhaseGetResponseRulesRulesetsForceConnectionCloseRule 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 PhaseGetResponseRulesRulesetsForceConnectionCloseRuleAction `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 Logging `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref  string                                                    `json:"ref"`
	JSON phaseGetResponseRulesRulesetsForceConnectionCloseRuleJSON `json:"-"`
}

func (*PhaseGetResponseRulesRulesetsForceConnectionCloseRule) UnmarshalJSON added in v2.3.0

func (r *PhaseGetResponseRulesRulesetsForceConnectionCloseRule) UnmarshalJSON(data []byte) (err error)

type PhaseGetResponseRulesRulesetsForceConnectionCloseRuleAction added in v2.3.0

type PhaseGetResponseRulesRulesetsForceConnectionCloseRuleAction string

The action to perform when the rule matches.

const (
	PhaseGetResponseRulesRulesetsForceConnectionCloseRuleActionForceConnectionClose PhaseGetResponseRulesRulesetsForceConnectionCloseRuleAction = "force_connection_close"
)

func (PhaseGetResponseRulesRulesetsForceConnectionCloseRuleAction) IsKnown added in v2.3.0

type PhaseGetResponseRulesRulesetsLogCustomFieldRule added in v2.3.0

type PhaseGetResponseRulesRulesetsLogCustomFieldRule 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 PhaseGetResponseRulesRulesetsLogCustomFieldRuleAction `json:"action"`
	// The parameters configuring the rule's action.
	ActionParameters PhaseGetResponseRulesRulesetsLogCustomFieldRuleActionParameters `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 Logging `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref  string                                              `json:"ref"`
	JSON phaseGetResponseRulesRulesetsLogCustomFieldRuleJSON `json:"-"`
}

func (*PhaseGetResponseRulesRulesetsLogCustomFieldRule) UnmarshalJSON added in v2.3.0

func (r *PhaseGetResponseRulesRulesetsLogCustomFieldRule) UnmarshalJSON(data []byte) (err error)

type PhaseGetResponseRulesRulesetsLogCustomFieldRuleAction added in v2.3.0

type PhaseGetResponseRulesRulesetsLogCustomFieldRuleAction string

The action to perform when the rule matches.

const (
	PhaseGetResponseRulesRulesetsLogCustomFieldRuleActionLogCustomField PhaseGetResponseRulesRulesetsLogCustomFieldRuleAction = "log_custom_field"
)

func (PhaseGetResponseRulesRulesetsLogCustomFieldRuleAction) IsKnown added in v2.3.0

type PhaseGetResponseRulesRulesetsLogCustomFieldRuleActionParameters added in v2.3.0

type PhaseGetResponseRulesRulesetsLogCustomFieldRuleActionParameters struct {
	// The cookie fields to log.
	CookieFields []PhaseGetResponseRulesRulesetsLogCustomFieldRuleActionParametersCookieField `json:"cookie_fields"`
	// The request fields to log.
	RequestFields []PhaseGetResponseRulesRulesetsLogCustomFieldRuleActionParametersRequestField `json:"request_fields"`
	// The response fields to log.
	ResponseFields []PhaseGetResponseRulesRulesetsLogCustomFieldRuleActionParametersResponseField `json:"response_fields"`
	JSON           phaseGetResponseRulesRulesetsLogCustomFieldRuleActionParametersJSON            `json:"-"`
}

The parameters configuring the rule's action.

func (*PhaseGetResponseRulesRulesetsLogCustomFieldRuleActionParameters) UnmarshalJSON added in v2.3.0

type PhaseGetResponseRulesRulesetsLogCustomFieldRuleActionParametersCookieField added in v2.3.0

type PhaseGetResponseRulesRulesetsLogCustomFieldRuleActionParametersCookieField struct {
	// The name of the field.
	Name string                                                                         `json:"name,required"`
	JSON phaseGetResponseRulesRulesetsLogCustomFieldRuleActionParametersCookieFieldJSON `json:"-"`
}

The cookie field to log.

func (*PhaseGetResponseRulesRulesetsLogCustomFieldRuleActionParametersCookieField) UnmarshalJSON added in v2.3.0

type PhaseGetResponseRulesRulesetsLogCustomFieldRuleActionParametersRequestField added in v2.3.0

type PhaseGetResponseRulesRulesetsLogCustomFieldRuleActionParametersRequestField struct {
	// The name of the field.
	Name string                                                                          `json:"name,required"`
	JSON phaseGetResponseRulesRulesetsLogCustomFieldRuleActionParametersRequestFieldJSON `json:"-"`
}

The request field to log.

func (*PhaseGetResponseRulesRulesetsLogCustomFieldRuleActionParametersRequestField) UnmarshalJSON added in v2.3.0

type PhaseGetResponseRulesRulesetsLogCustomFieldRuleActionParametersResponseField added in v2.3.0

type PhaseGetResponseRulesRulesetsLogCustomFieldRuleActionParametersResponseField struct {
	// The name of the field.
	Name string                                                                           `json:"name,required"`
	JSON phaseGetResponseRulesRulesetsLogCustomFieldRuleActionParametersResponseFieldJSON `json:"-"`
}

The response field to log.

func (*PhaseGetResponseRulesRulesetsLogCustomFieldRuleActionParametersResponseField) UnmarshalJSON added in v2.3.0

type PhaseService

type PhaseService struct {
	Options  []option.RequestOption
	Versions *PhaseVersionService
}

PhaseService contains methods and other services that help with interacting with the cloudflare API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewPhaseService method instead.

func NewPhaseService

func NewPhaseService(opts ...option.RequestOption) (r *PhaseService)

NewPhaseService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*PhaseService) Get

func (r *PhaseService) Get(ctx context.Context, rulesetPhase Phase, query PhaseGetParams, opts ...option.RequestOption) (res *PhaseGetResponse, err error)

Fetches the latest version of the account or zone entry point ruleset for a given phase.

func (*PhaseService) Update

func (r *PhaseService) Update(ctx context.Context, rulesetPhase Phase, params PhaseUpdateParams, opts ...option.RequestOption) (res *PhaseUpdateResponse, err error)

Updates an account or zone entry point ruleset, creating a new version.

type PhaseUpdateParams

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 human-readable name of the ruleset.
	Name param.Field[string] `json:"name"`
}

func (PhaseUpdateParams) MarshalJSON

func (r PhaseUpdateParams) MarshalJSON() (data []byte, err error)

type PhaseUpdateParamsRule

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[LoggingParam] `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref param.Field[string] `json:"ref"`
}

func (PhaseUpdateParamsRule) MarshalJSON

func (r PhaseUpdateParamsRule) MarshalJSON() (data []byte, err error)

type PhaseUpdateParamsRulesAction

type PhaseUpdateParamsRulesAction string

The action to perform when the rule matches.

const (
	PhaseUpdateParamsRulesActionBlock                PhaseUpdateParamsRulesAction = "block"
	PhaseUpdateParamsRulesActionChallenge            PhaseUpdateParamsRulesAction = "challenge"
	PhaseUpdateParamsRulesActionCompressResponse     PhaseUpdateParamsRulesAction = "compress_response"
	PhaseUpdateParamsRulesActionExecute              PhaseUpdateParamsRulesAction = "execute"
	PhaseUpdateParamsRulesActionJSChallenge          PhaseUpdateParamsRulesAction = "js_challenge"
	PhaseUpdateParamsRulesActionLog                  PhaseUpdateParamsRulesAction = "log"
	PhaseUpdateParamsRulesActionManagedChallenge     PhaseUpdateParamsRulesAction = "managed_challenge"
	PhaseUpdateParamsRulesActionRedirect             PhaseUpdateParamsRulesAction = "redirect"
	PhaseUpdateParamsRulesActionRewrite              PhaseUpdateParamsRulesAction = "rewrite"
	PhaseUpdateParamsRulesActionRoute                PhaseUpdateParamsRulesAction = "route"
	PhaseUpdateParamsRulesActionScore                PhaseUpdateParamsRulesAction = "score"
	PhaseUpdateParamsRulesActionServeError           PhaseUpdateParamsRulesAction = "serve_error"
	PhaseUpdateParamsRulesActionSetConfig            PhaseUpdateParamsRulesAction = "set_config"
	PhaseUpdateParamsRulesActionSkip                 PhaseUpdateParamsRulesAction = "skip"
	PhaseUpdateParamsRulesActionSetCacheSettings     PhaseUpdateParamsRulesAction = "set_cache_settings"
	PhaseUpdateParamsRulesActionLogCustomField       PhaseUpdateParamsRulesAction = "log_custom_field"
	PhaseUpdateParamsRulesActionDDoSDynamic          PhaseUpdateParamsRulesAction = "ddos_dynamic"
	PhaseUpdateParamsRulesActionForceConnectionClose PhaseUpdateParamsRulesAction = "force_connection_close"
)

func (PhaseUpdateParamsRulesAction) IsKnown

func (r PhaseUpdateParamsRulesAction) IsKnown() bool

type PhaseUpdateParamsRulesRulesetsDDoSDynamicRule added in v2.3.0

type PhaseUpdateParamsRulesRulesetsDDoSDynamicRule struct {
	// The unique ID of the rule.
	ID param.Field[string] `json:"id"`
	// The action to perform when the rule matches.
	Action param.Field[PhaseUpdateParamsRulesRulesetsDDoSDynamicRuleAction] `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[LoggingParam] `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref param.Field[string] `json:"ref"`
}

func (PhaseUpdateParamsRulesRulesetsDDoSDynamicRule) MarshalJSON added in v2.3.0

func (r PhaseUpdateParamsRulesRulesetsDDoSDynamicRule) MarshalJSON() (data []byte, err error)

type PhaseUpdateParamsRulesRulesetsDDoSDynamicRuleAction added in v2.3.0

type PhaseUpdateParamsRulesRulesetsDDoSDynamicRuleAction string

The action to perform when the rule matches.

const (
	PhaseUpdateParamsRulesRulesetsDDoSDynamicRuleActionDDoSDynamic PhaseUpdateParamsRulesRulesetsDDoSDynamicRuleAction = "ddos_dynamic"
)

func (PhaseUpdateParamsRulesRulesetsDDoSDynamicRuleAction) IsKnown added in v2.3.0

type PhaseUpdateParamsRulesRulesetsForceConnectionCloseRule added in v2.3.0

type PhaseUpdateParamsRulesRulesetsForceConnectionCloseRule struct {
	// The unique ID of the rule.
	ID param.Field[string] `json:"id"`
	// The action to perform when the rule matches.
	Action param.Field[PhaseUpdateParamsRulesRulesetsForceConnectionCloseRuleAction] `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[LoggingParam] `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref param.Field[string] `json:"ref"`
}

func (PhaseUpdateParamsRulesRulesetsForceConnectionCloseRule) MarshalJSON added in v2.3.0

type PhaseUpdateParamsRulesRulesetsForceConnectionCloseRuleAction added in v2.3.0

type PhaseUpdateParamsRulesRulesetsForceConnectionCloseRuleAction string

The action to perform when the rule matches.

const (
	PhaseUpdateParamsRulesRulesetsForceConnectionCloseRuleActionForceConnectionClose PhaseUpdateParamsRulesRulesetsForceConnectionCloseRuleAction = "force_connection_close"
)

func (PhaseUpdateParamsRulesRulesetsForceConnectionCloseRuleAction) IsKnown added in v2.3.0

type PhaseUpdateParamsRulesRulesetsLogCustomFieldRule added in v2.3.0

type PhaseUpdateParamsRulesRulesetsLogCustomFieldRule struct {
	// The unique ID of the rule.
	ID param.Field[string] `json:"id"`
	// The action to perform when the rule matches.
	Action param.Field[PhaseUpdateParamsRulesRulesetsLogCustomFieldRuleAction] `json:"action"`
	// The parameters configuring the rule's action.
	ActionParameters param.Field[PhaseUpdateParamsRulesRulesetsLogCustomFieldRuleActionParameters] `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[LoggingParam] `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref param.Field[string] `json:"ref"`
}

func (PhaseUpdateParamsRulesRulesetsLogCustomFieldRule) MarshalJSON added in v2.3.0

func (r PhaseUpdateParamsRulesRulesetsLogCustomFieldRule) MarshalJSON() (data []byte, err error)

type PhaseUpdateParamsRulesRulesetsLogCustomFieldRuleAction added in v2.3.0

type PhaseUpdateParamsRulesRulesetsLogCustomFieldRuleAction string

The action to perform when the rule matches.

const (
	PhaseUpdateParamsRulesRulesetsLogCustomFieldRuleActionLogCustomField PhaseUpdateParamsRulesRulesetsLogCustomFieldRuleAction = "log_custom_field"
)

func (PhaseUpdateParamsRulesRulesetsLogCustomFieldRuleAction) IsKnown added in v2.3.0

type PhaseUpdateParamsRulesRulesetsLogCustomFieldRuleActionParameters added in v2.3.0

type PhaseUpdateParamsRulesRulesetsLogCustomFieldRuleActionParameters struct {
	// The cookie fields to log.
	CookieFields param.Field[[]PhaseUpdateParamsRulesRulesetsLogCustomFieldRuleActionParametersCookieField] `json:"cookie_fields"`
	// The request fields to log.
	RequestFields param.Field[[]PhaseUpdateParamsRulesRulesetsLogCustomFieldRuleActionParametersRequestField] `json:"request_fields"`
	// The response fields to log.
	ResponseFields param.Field[[]PhaseUpdateParamsRulesRulesetsLogCustomFieldRuleActionParametersResponseField] `json:"response_fields"`
}

The parameters configuring the rule's action.

func (PhaseUpdateParamsRulesRulesetsLogCustomFieldRuleActionParameters) MarshalJSON added in v2.3.0

type PhaseUpdateParamsRulesRulesetsLogCustomFieldRuleActionParametersCookieField added in v2.3.0

type PhaseUpdateParamsRulesRulesetsLogCustomFieldRuleActionParametersCookieField struct {
	// The name of the field.
	Name param.Field[string] `json:"name,required"`
}

The cookie field to log.

func (PhaseUpdateParamsRulesRulesetsLogCustomFieldRuleActionParametersCookieField) MarshalJSON added in v2.3.0

type PhaseUpdateParamsRulesRulesetsLogCustomFieldRuleActionParametersRequestField added in v2.3.0

type PhaseUpdateParamsRulesRulesetsLogCustomFieldRuleActionParametersRequestField struct {
	// The name of the field.
	Name param.Field[string] `json:"name,required"`
}

The request field to log.

func (PhaseUpdateParamsRulesRulesetsLogCustomFieldRuleActionParametersRequestField) MarshalJSON added in v2.3.0

type PhaseUpdateParamsRulesRulesetsLogCustomFieldRuleActionParametersResponseField added in v2.3.0

type PhaseUpdateParamsRulesRulesetsLogCustomFieldRuleActionParametersResponseField struct {
	// The name of the field.
	Name param.Field[string] `json:"name,required"`
}

The response field to log.

func (PhaseUpdateParamsRulesRulesetsLogCustomFieldRuleActionParametersResponseField) MarshalJSON added in v2.3.0

type PhaseUpdateResponse

type PhaseUpdateResponse struct {
	// The unique ID of the ruleset.
	ID string `json:"id,required"`
	// The kind of the ruleset.
	Kind Kind `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 Phase `json:"phase,required"`
	// The list of rules in the ruleset.
	Rules []PhaseUpdateResponseRule `json:"rules,required"`
	// The version of the ruleset.
	Version string `json:"version,required"`
	// An informative description of the ruleset.
	Description string                  `json:"description"`
	JSON        phaseUpdateResponseJSON `json:"-"`
}

A ruleset object.

func (*PhaseUpdateResponse) UnmarshalJSON

func (r *PhaseUpdateResponse) UnmarshalJSON(data []byte) (err error)

type PhaseUpdateResponseEnvelope

type PhaseUpdateResponseEnvelope struct {
	// A list of error messages.
	Errors []PhaseUpdateResponseEnvelopeErrors `json:"errors,required"`
	// A list of warning messages.
	Messages []PhaseUpdateResponseEnvelopeMessages `json:"messages,required"`
	// A ruleset object.
	Result PhaseUpdateResponse `json:"result,required"`
	// Whether the API call was successful.
	Success PhaseUpdateResponseEnvelopeSuccess `json:"success,required"`
	JSON    phaseUpdateResponseEnvelopeJSON    `json:"-"`
}

A response object.

func (*PhaseUpdateResponseEnvelope) UnmarshalJSON

func (r *PhaseUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type PhaseUpdateResponseEnvelopeErrors

type PhaseUpdateResponseEnvelopeErrors 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 PhaseUpdateResponseEnvelopeErrorsSource `json:"source"`
	JSON   phaseUpdateResponseEnvelopeErrorsJSON   `json:"-"`
}

A message.

func (*PhaseUpdateResponseEnvelopeErrors) UnmarshalJSON

func (r *PhaseUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type PhaseUpdateResponseEnvelopeErrorsSource

type PhaseUpdateResponseEnvelopeErrorsSource struct {
	// A JSON pointer to the field that is the source of the message.
	Pointer string                                      `json:"pointer,required"`
	JSON    phaseUpdateResponseEnvelopeErrorsSourceJSON `json:"-"`
}

The source of this message.

func (*PhaseUpdateResponseEnvelopeErrorsSource) UnmarshalJSON

func (r *PhaseUpdateResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error)

type PhaseUpdateResponseEnvelopeMessages

type PhaseUpdateResponseEnvelopeMessages 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 PhaseUpdateResponseEnvelopeMessagesSource `json:"source"`
	JSON   phaseUpdateResponseEnvelopeMessagesJSON   `json:"-"`
}

A message.

func (*PhaseUpdateResponseEnvelopeMessages) UnmarshalJSON

func (r *PhaseUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type PhaseUpdateResponseEnvelopeMessagesSource

type PhaseUpdateResponseEnvelopeMessagesSource struct {
	// A JSON pointer to the field that is the source of the message.
	Pointer string                                        `json:"pointer,required"`
	JSON    phaseUpdateResponseEnvelopeMessagesSourceJSON `json:"-"`
}

The source of this message.

func (*PhaseUpdateResponseEnvelopeMessagesSource) UnmarshalJSON

func (r *PhaseUpdateResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error)

type PhaseUpdateResponseEnvelopeSuccess

type PhaseUpdateResponseEnvelopeSuccess bool

Whether the API call was successful.

const (
	PhaseUpdateResponseEnvelopeSuccessTrue PhaseUpdateResponseEnvelopeSuccess = true
)

func (PhaseUpdateResponseEnvelopeSuccess) IsKnown

type PhaseUpdateResponseRule

type PhaseUpdateResponseRule struct {
	// The action to perform when the rule matches.
	Action PhaseUpdateResponseRulesAction `json:"action"`
	// This field can have the runtime type of [BlockRuleActionParameters],
	// [interface{}], [CompressResponseRuleActionParameters],
	// [ExecuteRuleActionParameters], [RedirectRuleActionParameters],
	// [RewriteRuleActionParameters], [RouteRuleActionParameters],
	// [ScoreRuleActionParameters], [ServeErrorRuleActionParameters],
	// [SetConfigRuleActionParameters], [SkipRuleActionParameters],
	// [SetCacheSettingsRuleActionParameters],
	// [PhaseUpdateResponseRulesRulesetsLogCustomFieldRuleActionParameters].
	ActionParameters interface{} `json:"action_parameters,required"`
	// This field can have the runtime type of [[]string].
	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 Logging `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:"-"`
	// contains filtered or unexported fields
}

func (*PhaseUpdateResponseRule) UnmarshalJSON

func (r *PhaseUpdateResponseRule) UnmarshalJSON(data []byte) (err error)

type PhaseUpdateResponseRulesAction

type PhaseUpdateResponseRulesAction string

The action to perform when the rule matches.

const (
	PhaseUpdateResponseRulesActionBlock                PhaseUpdateResponseRulesAction = "block"
	PhaseUpdateResponseRulesActionChallenge            PhaseUpdateResponseRulesAction = "challenge"
	PhaseUpdateResponseRulesActionCompressResponse     PhaseUpdateResponseRulesAction = "compress_response"
	PhaseUpdateResponseRulesActionExecute              PhaseUpdateResponseRulesAction = "execute"
	PhaseUpdateResponseRulesActionJSChallenge          PhaseUpdateResponseRulesAction = "js_challenge"
	PhaseUpdateResponseRulesActionLog                  PhaseUpdateResponseRulesAction = "log"
	PhaseUpdateResponseRulesActionManagedChallenge     PhaseUpdateResponseRulesAction = "managed_challenge"
	PhaseUpdateResponseRulesActionRedirect             PhaseUpdateResponseRulesAction = "redirect"
	PhaseUpdateResponseRulesActionRewrite              PhaseUpdateResponseRulesAction = "rewrite"
	PhaseUpdateResponseRulesActionRoute                PhaseUpdateResponseRulesAction = "route"
	PhaseUpdateResponseRulesActionScore                PhaseUpdateResponseRulesAction = "score"
	PhaseUpdateResponseRulesActionServeError           PhaseUpdateResponseRulesAction = "serve_error"
	PhaseUpdateResponseRulesActionSetConfig            PhaseUpdateResponseRulesAction = "set_config"
	PhaseUpdateResponseRulesActionSkip                 PhaseUpdateResponseRulesAction = "skip"
	PhaseUpdateResponseRulesActionSetCacheSettings     PhaseUpdateResponseRulesAction = "set_cache_settings"
	PhaseUpdateResponseRulesActionLogCustomField       PhaseUpdateResponseRulesAction = "log_custom_field"
	PhaseUpdateResponseRulesActionDDoSDynamic          PhaseUpdateResponseRulesAction = "ddos_dynamic"
	PhaseUpdateResponseRulesActionForceConnectionClose PhaseUpdateResponseRulesAction = "force_connection_close"
)

func (PhaseUpdateResponseRulesAction) IsKnown

type PhaseUpdateResponseRulesRulesetsDDoSDynamicRule added in v2.3.0

type PhaseUpdateResponseRulesRulesetsDDoSDynamicRule 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 PhaseUpdateResponseRulesRulesetsDDoSDynamicRuleAction `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 Logging `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref  string                                              `json:"ref"`
	JSON phaseUpdateResponseRulesRulesetsDDoSDynamicRuleJSON `json:"-"`
}

func (*PhaseUpdateResponseRulesRulesetsDDoSDynamicRule) UnmarshalJSON added in v2.3.0

func (r *PhaseUpdateResponseRulesRulesetsDDoSDynamicRule) UnmarshalJSON(data []byte) (err error)

type PhaseUpdateResponseRulesRulesetsDDoSDynamicRuleAction added in v2.3.0

type PhaseUpdateResponseRulesRulesetsDDoSDynamicRuleAction string

The action to perform when the rule matches.

const (
	PhaseUpdateResponseRulesRulesetsDDoSDynamicRuleActionDDoSDynamic PhaseUpdateResponseRulesRulesetsDDoSDynamicRuleAction = "ddos_dynamic"
)

func (PhaseUpdateResponseRulesRulesetsDDoSDynamicRuleAction) IsKnown added in v2.3.0

type PhaseUpdateResponseRulesRulesetsForceConnectionCloseRule added in v2.3.0

type PhaseUpdateResponseRulesRulesetsForceConnectionCloseRule 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 PhaseUpdateResponseRulesRulesetsForceConnectionCloseRuleAction `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 Logging `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref  string                                                       `json:"ref"`
	JSON phaseUpdateResponseRulesRulesetsForceConnectionCloseRuleJSON `json:"-"`
}

func (*PhaseUpdateResponseRulesRulesetsForceConnectionCloseRule) UnmarshalJSON added in v2.3.0

type PhaseUpdateResponseRulesRulesetsForceConnectionCloseRuleAction added in v2.3.0

type PhaseUpdateResponseRulesRulesetsForceConnectionCloseRuleAction string

The action to perform when the rule matches.

const (
	PhaseUpdateResponseRulesRulesetsForceConnectionCloseRuleActionForceConnectionClose PhaseUpdateResponseRulesRulesetsForceConnectionCloseRuleAction = "force_connection_close"
)

func (PhaseUpdateResponseRulesRulesetsForceConnectionCloseRuleAction) IsKnown added in v2.3.0

type PhaseUpdateResponseRulesRulesetsLogCustomFieldRule added in v2.3.0

type PhaseUpdateResponseRulesRulesetsLogCustomFieldRule 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 PhaseUpdateResponseRulesRulesetsLogCustomFieldRuleAction `json:"action"`
	// The parameters configuring the rule's action.
	ActionParameters PhaseUpdateResponseRulesRulesetsLogCustomFieldRuleActionParameters `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 Logging `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref  string                                                 `json:"ref"`
	JSON phaseUpdateResponseRulesRulesetsLogCustomFieldRuleJSON `json:"-"`
}

func (*PhaseUpdateResponseRulesRulesetsLogCustomFieldRule) UnmarshalJSON added in v2.3.0

func (r *PhaseUpdateResponseRulesRulesetsLogCustomFieldRule) UnmarshalJSON(data []byte) (err error)

type PhaseUpdateResponseRulesRulesetsLogCustomFieldRuleAction added in v2.3.0

type PhaseUpdateResponseRulesRulesetsLogCustomFieldRuleAction string

The action to perform when the rule matches.

const (
	PhaseUpdateResponseRulesRulesetsLogCustomFieldRuleActionLogCustomField PhaseUpdateResponseRulesRulesetsLogCustomFieldRuleAction = "log_custom_field"
)

func (PhaseUpdateResponseRulesRulesetsLogCustomFieldRuleAction) IsKnown added in v2.3.0

type PhaseUpdateResponseRulesRulesetsLogCustomFieldRuleActionParameters added in v2.3.0

type PhaseUpdateResponseRulesRulesetsLogCustomFieldRuleActionParameters struct {
	// The cookie fields to log.
	CookieFields []PhaseUpdateResponseRulesRulesetsLogCustomFieldRuleActionParametersCookieField `json:"cookie_fields"`
	// The request fields to log.
	RequestFields []PhaseUpdateResponseRulesRulesetsLogCustomFieldRuleActionParametersRequestField `json:"request_fields"`
	// The response fields to log.
	ResponseFields []PhaseUpdateResponseRulesRulesetsLogCustomFieldRuleActionParametersResponseField `json:"response_fields"`
	JSON           phaseUpdateResponseRulesRulesetsLogCustomFieldRuleActionParametersJSON            `json:"-"`
}

The parameters configuring the rule's action.

func (*PhaseUpdateResponseRulesRulesetsLogCustomFieldRuleActionParameters) UnmarshalJSON added in v2.3.0

type PhaseUpdateResponseRulesRulesetsLogCustomFieldRuleActionParametersCookieField added in v2.3.0

type PhaseUpdateResponseRulesRulesetsLogCustomFieldRuleActionParametersCookieField struct {
	// The name of the field.
	Name string                                                                            `json:"name,required"`
	JSON phaseUpdateResponseRulesRulesetsLogCustomFieldRuleActionParametersCookieFieldJSON `json:"-"`
}

The cookie field to log.

func (*PhaseUpdateResponseRulesRulesetsLogCustomFieldRuleActionParametersCookieField) UnmarshalJSON added in v2.3.0

type PhaseUpdateResponseRulesRulesetsLogCustomFieldRuleActionParametersRequestField added in v2.3.0

type PhaseUpdateResponseRulesRulesetsLogCustomFieldRuleActionParametersRequestField struct {
	// The name of the field.
	Name string                                                                             `json:"name,required"`
	JSON phaseUpdateResponseRulesRulesetsLogCustomFieldRuleActionParametersRequestFieldJSON `json:"-"`
}

The request field to log.

func (*PhaseUpdateResponseRulesRulesetsLogCustomFieldRuleActionParametersRequestField) UnmarshalJSON added in v2.3.0

type PhaseUpdateResponseRulesRulesetsLogCustomFieldRuleActionParametersResponseField added in v2.3.0

type PhaseUpdateResponseRulesRulesetsLogCustomFieldRuleActionParametersResponseField struct {
	// The name of the field.
	Name string                                                                              `json:"name,required"`
	JSON phaseUpdateResponseRulesRulesetsLogCustomFieldRuleActionParametersResponseFieldJSON `json:"-"`
}

The response field to log.

func (*PhaseUpdateResponseRulesRulesetsLogCustomFieldRuleActionParametersResponseField) UnmarshalJSON added in v2.3.0

type PhaseVersionGetParams

type PhaseVersionGetParams 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.
	ZoneID param.Field[string] `path:"zone_id"`
}

type PhaseVersionGetResponse

type PhaseVersionGetResponse struct {
	// The unique ID of the ruleset.
	ID string `json:"id,required"`
	// The kind of the ruleset.
	Kind Kind `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 Phase `json:"phase,required"`
	// The list of rules in the ruleset.
	Rules []PhaseVersionGetResponseRule `json:"rules,required"`
	// The version of the ruleset.
	Version string `json:"version,required"`
	// An informative description of the ruleset.
	Description string                      `json:"description"`
	JSON        phaseVersionGetResponseJSON `json:"-"`
}

A ruleset object.

func (*PhaseVersionGetResponse) UnmarshalJSON

func (r *PhaseVersionGetResponse) UnmarshalJSON(data []byte) (err error)

type PhaseVersionGetResponseEnvelope

type PhaseVersionGetResponseEnvelope struct {
	// A list of error messages.
	Errors []PhaseVersionGetResponseEnvelopeErrors `json:"errors,required"`
	// A list of warning messages.
	Messages []PhaseVersionGetResponseEnvelopeMessages `json:"messages,required"`
	// A ruleset object.
	Result PhaseVersionGetResponse `json:"result,required"`
	// Whether the API call was successful.
	Success PhaseVersionGetResponseEnvelopeSuccess `json:"success,required"`
	JSON    phaseVersionGetResponseEnvelopeJSON    `json:"-"`
}

A response object.

func (*PhaseVersionGetResponseEnvelope) UnmarshalJSON

func (r *PhaseVersionGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type PhaseVersionGetResponseEnvelopeErrors

type PhaseVersionGetResponseEnvelopeErrors 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 PhaseVersionGetResponseEnvelopeErrorsSource `json:"source"`
	JSON   phaseVersionGetResponseEnvelopeErrorsJSON   `json:"-"`
}

A message.

func (*PhaseVersionGetResponseEnvelopeErrors) UnmarshalJSON

func (r *PhaseVersionGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type PhaseVersionGetResponseEnvelopeErrorsSource

type PhaseVersionGetResponseEnvelopeErrorsSource struct {
	// A JSON pointer to the field that is the source of the message.
	Pointer string                                          `json:"pointer,required"`
	JSON    phaseVersionGetResponseEnvelopeErrorsSourceJSON `json:"-"`
}

The source of this message.

func (*PhaseVersionGetResponseEnvelopeErrorsSource) UnmarshalJSON

func (r *PhaseVersionGetResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error)

type PhaseVersionGetResponseEnvelopeMessages

type PhaseVersionGetResponseEnvelopeMessages 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 PhaseVersionGetResponseEnvelopeMessagesSource `json:"source"`
	JSON   phaseVersionGetResponseEnvelopeMessagesJSON   `json:"-"`
}

A message.

func (*PhaseVersionGetResponseEnvelopeMessages) UnmarshalJSON

func (r *PhaseVersionGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type PhaseVersionGetResponseEnvelopeMessagesSource

type PhaseVersionGetResponseEnvelopeMessagesSource struct {
	// A JSON pointer to the field that is the source of the message.
	Pointer string                                            `json:"pointer,required"`
	JSON    phaseVersionGetResponseEnvelopeMessagesSourceJSON `json:"-"`
}

The source of this message.

func (*PhaseVersionGetResponseEnvelopeMessagesSource) UnmarshalJSON

func (r *PhaseVersionGetResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error)

type PhaseVersionGetResponseEnvelopeSuccess

type PhaseVersionGetResponseEnvelopeSuccess bool

Whether the API call was successful.

const (
	PhaseVersionGetResponseEnvelopeSuccessTrue PhaseVersionGetResponseEnvelopeSuccess = true
)

func (PhaseVersionGetResponseEnvelopeSuccess) IsKnown

type PhaseVersionGetResponseRule

type PhaseVersionGetResponseRule struct {
	// The action to perform when the rule matches.
	Action PhaseVersionGetResponseRulesAction `json:"action"`
	// This field can have the runtime type of [BlockRuleActionParameters],
	// [interface{}], [CompressResponseRuleActionParameters],
	// [ExecuteRuleActionParameters], [RedirectRuleActionParameters],
	// [RewriteRuleActionParameters], [RouteRuleActionParameters],
	// [ScoreRuleActionParameters], [ServeErrorRuleActionParameters],
	// [SetConfigRuleActionParameters], [SkipRuleActionParameters],
	// [SetCacheSettingsRuleActionParameters],
	// [PhaseVersionGetResponseRulesRulesetsLogCustomFieldRuleActionParameters].
	ActionParameters interface{} `json:"action_parameters,required"`
	// This field can have the runtime type of [[]string].
	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 Logging `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:"-"`
	// contains filtered or unexported fields
}

func (*PhaseVersionGetResponseRule) UnmarshalJSON

func (r *PhaseVersionGetResponseRule) UnmarshalJSON(data []byte) (err error)

type PhaseVersionGetResponseRulesAction

type PhaseVersionGetResponseRulesAction string

The action to perform when the rule matches.

const (
	PhaseVersionGetResponseRulesActionBlock                PhaseVersionGetResponseRulesAction = "block"
	PhaseVersionGetResponseRulesActionChallenge            PhaseVersionGetResponseRulesAction = "challenge"
	PhaseVersionGetResponseRulesActionCompressResponse     PhaseVersionGetResponseRulesAction = "compress_response"
	PhaseVersionGetResponseRulesActionExecute              PhaseVersionGetResponseRulesAction = "execute"
	PhaseVersionGetResponseRulesActionJSChallenge          PhaseVersionGetResponseRulesAction = "js_challenge"
	PhaseVersionGetResponseRulesActionLog                  PhaseVersionGetResponseRulesAction = "log"
	PhaseVersionGetResponseRulesActionManagedChallenge     PhaseVersionGetResponseRulesAction = "managed_challenge"
	PhaseVersionGetResponseRulesActionRedirect             PhaseVersionGetResponseRulesAction = "redirect"
	PhaseVersionGetResponseRulesActionRewrite              PhaseVersionGetResponseRulesAction = "rewrite"
	PhaseVersionGetResponseRulesActionRoute                PhaseVersionGetResponseRulesAction = "route"
	PhaseVersionGetResponseRulesActionScore                PhaseVersionGetResponseRulesAction = "score"
	PhaseVersionGetResponseRulesActionServeError           PhaseVersionGetResponseRulesAction = "serve_error"
	PhaseVersionGetResponseRulesActionSetConfig            PhaseVersionGetResponseRulesAction = "set_config"
	PhaseVersionGetResponseRulesActionSkip                 PhaseVersionGetResponseRulesAction = "skip"
	PhaseVersionGetResponseRulesActionSetCacheSettings     PhaseVersionGetResponseRulesAction = "set_cache_settings"
	PhaseVersionGetResponseRulesActionLogCustomField       PhaseVersionGetResponseRulesAction = "log_custom_field"
	PhaseVersionGetResponseRulesActionDDoSDynamic          PhaseVersionGetResponseRulesAction = "ddos_dynamic"
	PhaseVersionGetResponseRulesActionForceConnectionClose PhaseVersionGetResponseRulesAction = "force_connection_close"
)

func (PhaseVersionGetResponseRulesAction) IsKnown

type PhaseVersionGetResponseRulesRulesetsDDoSDynamicRule added in v2.3.0

type PhaseVersionGetResponseRulesRulesetsDDoSDynamicRule 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 PhaseVersionGetResponseRulesRulesetsDDoSDynamicRuleAction `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 Logging `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref  string                                                  `json:"ref"`
	JSON phaseVersionGetResponseRulesRulesetsDDoSDynamicRuleJSON `json:"-"`
}

func (*PhaseVersionGetResponseRulesRulesetsDDoSDynamicRule) UnmarshalJSON added in v2.3.0

func (r *PhaseVersionGetResponseRulesRulesetsDDoSDynamicRule) UnmarshalJSON(data []byte) (err error)

type PhaseVersionGetResponseRulesRulesetsDDoSDynamicRuleAction added in v2.3.0

type PhaseVersionGetResponseRulesRulesetsDDoSDynamicRuleAction string

The action to perform when the rule matches.

const (
	PhaseVersionGetResponseRulesRulesetsDDoSDynamicRuleActionDDoSDynamic PhaseVersionGetResponseRulesRulesetsDDoSDynamicRuleAction = "ddos_dynamic"
)

func (PhaseVersionGetResponseRulesRulesetsDDoSDynamicRuleAction) IsKnown added in v2.3.0

type PhaseVersionGetResponseRulesRulesetsForceConnectionCloseRule added in v2.3.0

type PhaseVersionGetResponseRulesRulesetsForceConnectionCloseRule 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 PhaseVersionGetResponseRulesRulesetsForceConnectionCloseRuleAction `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 Logging `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref  string                                                           `json:"ref"`
	JSON phaseVersionGetResponseRulesRulesetsForceConnectionCloseRuleJSON `json:"-"`
}

func (*PhaseVersionGetResponseRulesRulesetsForceConnectionCloseRule) UnmarshalJSON added in v2.3.0

type PhaseVersionGetResponseRulesRulesetsForceConnectionCloseRuleAction added in v2.3.0

type PhaseVersionGetResponseRulesRulesetsForceConnectionCloseRuleAction string

The action to perform when the rule matches.

const (
	PhaseVersionGetResponseRulesRulesetsForceConnectionCloseRuleActionForceConnectionClose PhaseVersionGetResponseRulesRulesetsForceConnectionCloseRuleAction = "force_connection_close"
)

func (PhaseVersionGetResponseRulesRulesetsForceConnectionCloseRuleAction) IsKnown added in v2.3.0

type PhaseVersionGetResponseRulesRulesetsLogCustomFieldRule added in v2.3.0

type PhaseVersionGetResponseRulesRulesetsLogCustomFieldRule 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 PhaseVersionGetResponseRulesRulesetsLogCustomFieldRuleAction `json:"action"`
	// The parameters configuring the rule's action.
	ActionParameters PhaseVersionGetResponseRulesRulesetsLogCustomFieldRuleActionParameters `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 Logging `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref  string                                                     `json:"ref"`
	JSON phaseVersionGetResponseRulesRulesetsLogCustomFieldRuleJSON `json:"-"`
}

func (*PhaseVersionGetResponseRulesRulesetsLogCustomFieldRule) UnmarshalJSON added in v2.3.0

func (r *PhaseVersionGetResponseRulesRulesetsLogCustomFieldRule) UnmarshalJSON(data []byte) (err error)

type PhaseVersionGetResponseRulesRulesetsLogCustomFieldRuleAction added in v2.3.0

type PhaseVersionGetResponseRulesRulesetsLogCustomFieldRuleAction string

The action to perform when the rule matches.

const (
	PhaseVersionGetResponseRulesRulesetsLogCustomFieldRuleActionLogCustomField PhaseVersionGetResponseRulesRulesetsLogCustomFieldRuleAction = "log_custom_field"
)

func (PhaseVersionGetResponseRulesRulesetsLogCustomFieldRuleAction) IsKnown added in v2.3.0

type PhaseVersionGetResponseRulesRulesetsLogCustomFieldRuleActionParameters added in v2.3.0

type PhaseVersionGetResponseRulesRulesetsLogCustomFieldRuleActionParameters struct {
	// The cookie fields to log.
	CookieFields []PhaseVersionGetResponseRulesRulesetsLogCustomFieldRuleActionParametersCookieField `json:"cookie_fields"`
	// The request fields to log.
	RequestFields []PhaseVersionGetResponseRulesRulesetsLogCustomFieldRuleActionParametersRequestField `json:"request_fields"`
	// The response fields to log.
	ResponseFields []PhaseVersionGetResponseRulesRulesetsLogCustomFieldRuleActionParametersResponseField `json:"response_fields"`
	JSON           phaseVersionGetResponseRulesRulesetsLogCustomFieldRuleActionParametersJSON            `json:"-"`
}

The parameters configuring the rule's action.

func (*PhaseVersionGetResponseRulesRulesetsLogCustomFieldRuleActionParameters) UnmarshalJSON added in v2.3.0

type PhaseVersionGetResponseRulesRulesetsLogCustomFieldRuleActionParametersCookieField added in v2.3.0

type PhaseVersionGetResponseRulesRulesetsLogCustomFieldRuleActionParametersCookieField struct {
	// The name of the field.
	Name string                                                                                `json:"name,required"`
	JSON phaseVersionGetResponseRulesRulesetsLogCustomFieldRuleActionParametersCookieFieldJSON `json:"-"`
}

The cookie field to log.

func (*PhaseVersionGetResponseRulesRulesetsLogCustomFieldRuleActionParametersCookieField) UnmarshalJSON added in v2.3.0

type PhaseVersionGetResponseRulesRulesetsLogCustomFieldRuleActionParametersRequestField added in v2.3.0

type PhaseVersionGetResponseRulesRulesetsLogCustomFieldRuleActionParametersRequestField struct {
	// The name of the field.
	Name string                                                                                 `json:"name,required"`
	JSON phaseVersionGetResponseRulesRulesetsLogCustomFieldRuleActionParametersRequestFieldJSON `json:"-"`
}

The request field to log.

func (*PhaseVersionGetResponseRulesRulesetsLogCustomFieldRuleActionParametersRequestField) UnmarshalJSON added in v2.3.0

type PhaseVersionGetResponseRulesRulesetsLogCustomFieldRuleActionParametersResponseField added in v2.3.0

type PhaseVersionGetResponseRulesRulesetsLogCustomFieldRuleActionParametersResponseField struct {
	// The name of the field.
	Name string                                                                                  `json:"name,required"`
	JSON phaseVersionGetResponseRulesRulesetsLogCustomFieldRuleActionParametersResponseFieldJSON `json:"-"`
}

The response field to log.

func (*PhaseVersionGetResponseRulesRulesetsLogCustomFieldRuleActionParametersResponseField) UnmarshalJSON added in v2.3.0

type PhaseVersionListParams

type PhaseVersionListParams 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.
	ZoneID param.Field[string] `path:"zone_id"`
}

type PhaseVersionListResponse added in v2.3.0

type PhaseVersionListResponse struct {
	// The unique ID of the ruleset.
	ID string `json:"id,required"`
	// The kind of the ruleset.
	Kind Kind `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 Phase `json:"phase,required"`
	// The version of the ruleset.
	Version string `json:"version,required"`
	// An informative description of the ruleset.
	Description string                       `json:"description"`
	JSON        phaseVersionListResponseJSON `json:"-"`
}

A ruleset object.

func (*PhaseVersionListResponse) UnmarshalJSON added in v2.3.0

func (r *PhaseVersionListResponse) UnmarshalJSON(data []byte) (err error)

type PhaseVersionService

type PhaseVersionService struct {
	Options []option.RequestOption
}

PhaseVersionService contains methods and other services that help with interacting with the cloudflare API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewPhaseVersionService method instead.

func NewPhaseVersionService

func NewPhaseVersionService(opts ...option.RequestOption) (r *PhaseVersionService)

NewPhaseVersionService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*PhaseVersionService) Get

func (r *PhaseVersionService) Get(ctx context.Context, rulesetPhase Phase, rulesetVersion string, query PhaseVersionGetParams, opts ...option.RequestOption) (res *PhaseVersionGetResponse, err error)

Fetches a specific version of an account or zone entry point ruleset.

func (*PhaseVersionService) List

Fetches the versions of an account or zone entry point ruleset.

func (*PhaseVersionService) ListAutoPaging

Fetches the versions of an account or zone entry point ruleset.

type RedirectRule

type RedirectRule 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 RedirectRuleAction `json:"action"`
	// The parameters configuring the rule's action.
	ActionParameters RedirectRuleActionParameters `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 Logging `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref  string           `json:"ref"`
	JSON redirectRuleJSON `json:"-"`
}

func (*RedirectRule) UnmarshalJSON

func (r *RedirectRule) UnmarshalJSON(data []byte) (err error)

type RedirectRuleAction

type RedirectRuleAction string

The action to perform when the rule matches.

const (
	RedirectRuleActionRedirect RedirectRuleAction = "redirect"
)

func (RedirectRuleAction) IsKnown

func (r RedirectRuleAction) IsKnown() bool

type RedirectRuleActionParameters

type RedirectRuleActionParameters struct {
	// Serve a redirect based on a bulk list lookup.
	FromList RedirectRuleActionParametersFromList `json:"from_list"`
	// Serve a redirect based on the request properties.
	FromValue RedirectRuleActionParametersFromValue `json:"from_value"`
	JSON      redirectRuleActionParametersJSON      `json:"-"`
}

The parameters configuring the rule's action.

func (*RedirectRuleActionParameters) UnmarshalJSON

func (r *RedirectRuleActionParameters) UnmarshalJSON(data []byte) (err error)

type RedirectRuleActionParametersFromList

type RedirectRuleActionParametersFromList struct {
	// Expression that evaluates to the list lookup key.
	Key string `json:"key"`
	// The name of the list to match against.
	Name string                                   `json:"name"`
	JSON redirectRuleActionParametersFromListJSON `json:"-"`
}

Serve a redirect based on a bulk list lookup.

func (*RedirectRuleActionParametersFromList) UnmarshalJSON

func (r *RedirectRuleActionParametersFromList) UnmarshalJSON(data []byte) (err error)

type RedirectRuleActionParametersFromListParam

type RedirectRuleActionParametersFromListParam struct {
	// Expression that evaluates to the list lookup key.
	Key param.Field[string] `json:"key"`
	// The name of the list to match against.
	Name param.Field[string] `json:"name"`
}

Serve a redirect based on a bulk list lookup.

func (RedirectRuleActionParametersFromListParam) MarshalJSON

func (r RedirectRuleActionParametersFromListParam) MarshalJSON() (data []byte, err error)

type RedirectRuleActionParametersFromValue

type RedirectRuleActionParametersFromValue struct {
	// Keep the query string of the original request.
	PreserveQueryString bool `json:"preserve_query_string"`
	// The status code to be used for the redirect.
	StatusCode RedirectRuleActionParametersFromValueStatusCode `json:"status_code"`
	// The URL to redirect the request to.
	TargetURL RedirectRuleActionParametersFromValueTargetURL `json:"target_url"`
	JSON      redirectRuleActionParametersFromValueJSON      `json:"-"`
}

Serve a redirect based on the request properties.

func (*RedirectRuleActionParametersFromValue) UnmarshalJSON

func (r *RedirectRuleActionParametersFromValue) UnmarshalJSON(data []byte) (err error)

type RedirectRuleActionParametersFromValueParam

type RedirectRuleActionParametersFromValueParam struct {
	// Keep the query string of the original request.
	PreserveQueryString param.Field[bool] `json:"preserve_query_string"`
	// The status code to be used for the redirect.
	StatusCode param.Field[RedirectRuleActionParametersFromValueStatusCode] `json:"status_code"`
	// The URL to redirect the request to.
	TargetURL param.Field[RedirectRuleActionParametersFromValueTargetURLUnionParam] `json:"target_url"`
}

Serve a redirect based on the request properties.

func (RedirectRuleActionParametersFromValueParam) MarshalJSON

func (r RedirectRuleActionParametersFromValueParam) MarshalJSON() (data []byte, err error)

type RedirectRuleActionParametersFromValueStatusCode

type RedirectRuleActionParametersFromValueStatusCode float64

The status code to be used for the redirect.

const (
	RedirectRuleActionParametersFromValueStatusCode301 RedirectRuleActionParametersFromValueStatusCode = 301
	RedirectRuleActionParametersFromValueStatusCode302 RedirectRuleActionParametersFromValueStatusCode = 302
	RedirectRuleActionParametersFromValueStatusCode303 RedirectRuleActionParametersFromValueStatusCode = 303
	RedirectRuleActionParametersFromValueStatusCode307 RedirectRuleActionParametersFromValueStatusCode = 307
	RedirectRuleActionParametersFromValueStatusCode308 RedirectRuleActionParametersFromValueStatusCode = 308
)

func (RedirectRuleActionParametersFromValueStatusCode) IsKnown

type RedirectRuleActionParametersFromValueTargetURL

type RedirectRuleActionParametersFromValueTargetURL struct {
	// The URL to redirect the request to.
	Value string `json:"value"`
	// An expression to evaluate to get the URL to redirect the request to.
	Expression string                                             `json:"expression"`
	JSON       redirectRuleActionParametersFromValueTargetURLJSON `json:"-"`
	// contains filtered or unexported fields
}

The URL to redirect the request to.

func (RedirectRuleActionParametersFromValueTargetURL) AsUnion

AsUnion returns a RedirectRuleActionParametersFromValueTargetURLUnion interface which you can cast to the specific types for more type safety.

Possible runtime types of the union are rulesets.RedirectRuleActionParametersFromValueTargetURLStaticURLRedirect, rulesets.RedirectRuleActionParametersFromValueTargetURLDynamicURLRedirect.

func (*RedirectRuleActionParametersFromValueTargetURL) UnmarshalJSON

func (r *RedirectRuleActionParametersFromValueTargetURL) UnmarshalJSON(data []byte) (err error)

type RedirectRuleActionParametersFromValueTargetURLDynamicURLRedirect

type RedirectRuleActionParametersFromValueTargetURLDynamicURLRedirect struct {
	// An expression to evaluate to get the URL to redirect the request to.
	Expression string                                                               `json:"expression"`
	JSON       redirectRuleActionParametersFromValueTargetURLDynamicURLRedirectJSON `json:"-"`
}

func (*RedirectRuleActionParametersFromValueTargetURLDynamicURLRedirect) UnmarshalJSON

type RedirectRuleActionParametersFromValueTargetURLDynamicURLRedirectParam

type RedirectRuleActionParametersFromValueTargetURLDynamicURLRedirectParam struct {
	// An expression to evaluate to get the URL to redirect the request to.
	Expression param.Field[string] `json:"expression"`
}

func (RedirectRuleActionParametersFromValueTargetURLDynamicURLRedirectParam) MarshalJSON

type RedirectRuleActionParametersFromValueTargetURLParam

type RedirectRuleActionParametersFromValueTargetURLParam struct {
	// The URL to redirect the request to.
	Value param.Field[string] `json:"value"`
	// An expression to evaluate to get the URL to redirect the request to.
	Expression param.Field[string] `json:"expression"`
}

The URL to redirect the request to.

func (RedirectRuleActionParametersFromValueTargetURLParam) MarshalJSON

func (r RedirectRuleActionParametersFromValueTargetURLParam) MarshalJSON() (data []byte, err error)

type RedirectRuleActionParametersFromValueTargetURLStaticURLRedirect

type RedirectRuleActionParametersFromValueTargetURLStaticURLRedirect struct {
	// The URL to redirect the request to.
	Value string                                                              `json:"value"`
	JSON  redirectRuleActionParametersFromValueTargetURLStaticURLRedirectJSON `json:"-"`
}

func (*RedirectRuleActionParametersFromValueTargetURLStaticURLRedirect) UnmarshalJSON

type RedirectRuleActionParametersFromValueTargetURLStaticURLRedirectParam

type RedirectRuleActionParametersFromValueTargetURLStaticURLRedirectParam struct {
	// The URL to redirect the request to.
	Value param.Field[string] `json:"value"`
}

func (RedirectRuleActionParametersFromValueTargetURLStaticURLRedirectParam) MarshalJSON

type RedirectRuleActionParametersFromValueTargetURLUnion

type RedirectRuleActionParametersFromValueTargetURLUnion interface {
	// contains filtered or unexported methods
}

The URL to redirect the request to.

Union satisfied by rulesets.RedirectRuleActionParametersFromValueTargetURLStaticURLRedirect or rulesets.RedirectRuleActionParametersFromValueTargetURLDynamicURLRedirect.

type RedirectRuleActionParametersFromValueTargetURLUnionParam

type RedirectRuleActionParametersFromValueTargetURLUnionParam interface {
	// contains filtered or unexported methods
}

The URL to redirect the request to.

Satisfied by rulesets.RedirectRuleActionParametersFromValueTargetURLStaticURLRedirectParam, rulesets.RedirectRuleActionParametersFromValueTargetURLDynamicURLRedirectParam, RedirectRuleActionParametersFromValueTargetURLParam.

type RedirectRuleActionParametersParam

type RedirectRuleActionParametersParam struct {
	// Serve a redirect based on a bulk list lookup.
	FromList param.Field[RedirectRuleActionParametersFromListParam] `json:"from_list"`
	// Serve a redirect based on the request properties.
	FromValue param.Field[RedirectRuleActionParametersFromValueParam] `json:"from_value"`
}

The parameters configuring the rule's action.

func (RedirectRuleActionParametersParam) MarshalJSON

func (r RedirectRuleActionParametersParam) MarshalJSON() (data []byte, err error)

type RedirectRuleParam

type RedirectRuleParam struct {
	// The unique ID of the rule.
	ID param.Field[string] `json:"id"`
	// The action to perform when the rule matches.
	Action param.Field[RedirectRuleAction] `json:"action"`
	// The parameters configuring the rule's action.
	ActionParameters param.Field[RedirectRuleActionParametersParam] `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[LoggingParam] `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref param.Field[string] `json:"ref"`
}

func (RedirectRuleParam) MarshalJSON

func (r RedirectRuleParam) MarshalJSON() (data []byte, err error)

type ResponseInfo

type ResponseInfo = shared.ResponseInfo

This is an alias to an internal type.

type RewriteRule

type RewriteRule 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 RewriteRuleAction `json:"action"`
	// The parameters configuring the rule's action.
	ActionParameters RewriteRuleActionParameters `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 Logging `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref  string          `json:"ref"`
	JSON rewriteRuleJSON `json:"-"`
}

func (*RewriteRule) UnmarshalJSON

func (r *RewriteRule) UnmarshalJSON(data []byte) (err error)

type RewriteRuleAction

type RewriteRuleAction string

The action to perform when the rule matches.

const (
	RewriteRuleActionRewrite RewriteRuleAction = "rewrite"
)

func (RewriteRuleAction) IsKnown

func (r RewriteRuleAction) IsKnown() bool

type RewriteRuleActionParameters

type RewriteRuleActionParameters struct {
	// Map of request headers to modify.
	Headers map[string]RewriteRuleActionParametersHeader `json:"headers"`
	// URI to rewrite the request to.
	URI  RewriteRuleActionParametersURI  `json:"uri"`
	JSON rewriteRuleActionParametersJSON `json:"-"`
}

The parameters configuring the rule's action.

func (*RewriteRuleActionParameters) UnmarshalJSON

func (r *RewriteRuleActionParameters) UnmarshalJSON(data []byte) (err error)

type RewriteRuleActionParametersHeader

type RewriteRuleActionParametersHeader struct {
	Operation RewriteRuleActionParametersHeadersOperation `json:"operation,required"`
	// Static value for the header.
	Value string `json:"value"`
	// Expression for the header value.
	Expression string                                `json:"expression"`
	JSON       rewriteRuleActionParametersHeaderJSON `json:"-"`
	// contains filtered or unexported fields
}

Remove the header from the request.

func (RewriteRuleActionParametersHeader) AsUnion

AsUnion returns a RewriteRuleActionParametersHeadersUnion interface which you can cast to the specific types for more type safety.

Possible runtime types of the union are rulesets.RewriteRuleActionParametersHeadersRemoveHeader, rulesets.RewriteRuleActionParametersHeadersStaticHeader, rulesets.RewriteRuleActionParametersHeadersDynamicHeader.

func (*RewriteRuleActionParametersHeader) UnmarshalJSON

func (r *RewriteRuleActionParametersHeader) UnmarshalJSON(data []byte) (err error)

type RewriteRuleActionParametersHeaderParam

type RewriteRuleActionParametersHeaderParam struct {
	Operation param.Field[RewriteRuleActionParametersHeadersOperation] `json:"operation,required"`
	// Static value for the header.
	Value param.Field[string] `json:"value"`
	// Expression for the header value.
	Expression param.Field[string] `json:"expression"`
}

Remove the header from the request.

func (RewriteRuleActionParametersHeaderParam) MarshalJSON

func (r RewriteRuleActionParametersHeaderParam) MarshalJSON() (data []byte, err error)

type RewriteRuleActionParametersHeadersDynamicHeader

type RewriteRuleActionParametersHeadersDynamicHeader struct {
	// Expression for the header value.
	Expression string                                                   `json:"expression,required"`
	Operation  RewriteRuleActionParametersHeadersDynamicHeaderOperation `json:"operation,required"`
	JSON       rewriteRuleActionParametersHeadersDynamicHeaderJSON      `json:"-"`
}

Set a request header with a dynamic value.

func (*RewriteRuleActionParametersHeadersDynamicHeader) UnmarshalJSON

func (r *RewriteRuleActionParametersHeadersDynamicHeader) UnmarshalJSON(data []byte) (err error)

type RewriteRuleActionParametersHeadersDynamicHeaderOperation

type RewriteRuleActionParametersHeadersDynamicHeaderOperation string
const (
	RewriteRuleActionParametersHeadersDynamicHeaderOperationSet RewriteRuleActionParametersHeadersDynamicHeaderOperation = "set"
)

func (RewriteRuleActionParametersHeadersDynamicHeaderOperation) IsKnown

type RewriteRuleActionParametersHeadersDynamicHeaderParam

type RewriteRuleActionParametersHeadersDynamicHeaderParam struct {
	// Expression for the header value.
	Expression param.Field[string]                                                   `json:"expression,required"`
	Operation  param.Field[RewriteRuleActionParametersHeadersDynamicHeaderOperation] `json:"operation,required"`
}

Set a request header with a dynamic value.

func (RewriteRuleActionParametersHeadersDynamicHeaderParam) MarshalJSON

func (r RewriteRuleActionParametersHeadersDynamicHeaderParam) MarshalJSON() (data []byte, err error)

type RewriteRuleActionParametersHeadersOperation

type RewriteRuleActionParametersHeadersOperation string
const (
	RewriteRuleActionParametersHeadersOperationRemove RewriteRuleActionParametersHeadersOperation = "remove"
	RewriteRuleActionParametersHeadersOperationSet    RewriteRuleActionParametersHeadersOperation = "set"
)

func (RewriteRuleActionParametersHeadersOperation) IsKnown

type RewriteRuleActionParametersHeadersRemoveHeader

type RewriteRuleActionParametersHeadersRemoveHeader struct {
	Operation RewriteRuleActionParametersHeadersRemoveHeaderOperation `json:"operation,required"`
	JSON      rewriteRuleActionParametersHeadersRemoveHeaderJSON      `json:"-"`
}

Remove the header from the request.

func (*RewriteRuleActionParametersHeadersRemoveHeader) UnmarshalJSON

func (r *RewriteRuleActionParametersHeadersRemoveHeader) UnmarshalJSON(data []byte) (err error)

type RewriteRuleActionParametersHeadersRemoveHeaderOperation

type RewriteRuleActionParametersHeadersRemoveHeaderOperation string
const (
	RewriteRuleActionParametersHeadersRemoveHeaderOperationRemove RewriteRuleActionParametersHeadersRemoveHeaderOperation = "remove"
)

func (RewriteRuleActionParametersHeadersRemoveHeaderOperation) IsKnown

type RewriteRuleActionParametersHeadersRemoveHeaderParam

type RewriteRuleActionParametersHeadersRemoveHeaderParam struct {
	Operation param.Field[RewriteRuleActionParametersHeadersRemoveHeaderOperation] `json:"operation,required"`
}

Remove the header from the request.

func (RewriteRuleActionParametersHeadersRemoveHeaderParam) MarshalJSON

func (r RewriteRuleActionParametersHeadersRemoveHeaderParam) MarshalJSON() (data []byte, err error)

type RewriteRuleActionParametersHeadersStaticHeader

type RewriteRuleActionParametersHeadersStaticHeader struct {
	Operation RewriteRuleActionParametersHeadersStaticHeaderOperation `json:"operation,required"`
	// Static value for the header.
	Value string                                             `json:"value,required"`
	JSON  rewriteRuleActionParametersHeadersStaticHeaderJSON `json:"-"`
}

Set a request header with a static value.

func (*RewriteRuleActionParametersHeadersStaticHeader) UnmarshalJSON

func (r *RewriteRuleActionParametersHeadersStaticHeader) UnmarshalJSON(data []byte) (err error)

type RewriteRuleActionParametersHeadersStaticHeaderOperation

type RewriteRuleActionParametersHeadersStaticHeaderOperation string
const (
	RewriteRuleActionParametersHeadersStaticHeaderOperationSet RewriteRuleActionParametersHeadersStaticHeaderOperation = "set"
)

func (RewriteRuleActionParametersHeadersStaticHeaderOperation) IsKnown

type RewriteRuleActionParametersHeadersStaticHeaderParam

type RewriteRuleActionParametersHeadersStaticHeaderParam struct {
	Operation param.Field[RewriteRuleActionParametersHeadersStaticHeaderOperation] `json:"operation,required"`
	// Static value for the header.
	Value param.Field[string] `json:"value,required"`
}

Set a request header with a static value.

func (RewriteRuleActionParametersHeadersStaticHeaderParam) MarshalJSON

func (r RewriteRuleActionParametersHeadersStaticHeaderParam) MarshalJSON() (data []byte, err error)

type RewriteRuleActionParametersHeadersUnion

type RewriteRuleActionParametersHeadersUnion interface {
	// contains filtered or unexported methods
}

Remove the header from the request.

Union satisfied by rulesets.RewriteRuleActionParametersHeadersRemoveHeader, rulesets.RewriteRuleActionParametersHeadersStaticHeader or rulesets.RewriteRuleActionParametersHeadersDynamicHeader.

type RewriteRuleActionParametersParam

type RewriteRuleActionParametersParam struct {
	// Map of request headers to modify.
	Headers param.Field[map[string]RewriteRuleActionParametersHeadersUnionParam] `json:"headers"`
	// URI to rewrite the request to.
	URI param.Field[RewriteRuleActionParametersURIParam] `json:"uri"`
}

The parameters configuring the rule's action.

func (RewriteRuleActionParametersParam) MarshalJSON

func (r RewriteRuleActionParametersParam) MarshalJSON() (data []byte, err error)

type RewriteRuleActionParametersURI

type RewriteRuleActionParametersURI struct {
	// Path portion rewrite.
	Path RewriteURIPart `json:"path"`
	// Query portion rewrite.
	Query RewriteURIPart                     `json:"query"`
	JSON  rewriteRuleActionParametersURIJSON `json:"-"`
}

URI to rewrite the request to.

func (*RewriteRuleActionParametersURI) UnmarshalJSON

func (r *RewriteRuleActionParametersURI) UnmarshalJSON(data []byte) (err error)

type RewriteRuleActionParametersURIParam

type RewriteRuleActionParametersURIParam struct {
	// Path portion rewrite.
	Path param.Field[RewriteURIPartUnionParam] `json:"path"`
	// Query portion rewrite.
	Query param.Field[RewriteURIPartUnionParam] `json:"query"`
}

URI to rewrite the request to.

func (RewriteRuleActionParametersURIParam) MarshalJSON

func (r RewriteRuleActionParametersURIParam) MarshalJSON() (data []byte, err error)

type RewriteRuleParam

type RewriteRuleParam struct {
	// The unique ID of the rule.
	ID param.Field[string] `json:"id"`
	// The action to perform when the rule matches.
	Action param.Field[RewriteRuleAction] `json:"action"`
	// The parameters configuring the rule's action.
	ActionParameters param.Field[RewriteRuleActionParametersParam] `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[LoggingParam] `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref param.Field[string] `json:"ref"`
}

func (RewriteRuleParam) MarshalJSON

func (r RewriteRuleParam) MarshalJSON() (data []byte, err error)

type RewriteURIPart

type RewriteURIPart struct {
	// Predefined replacement value.
	Value string `json:"value"`
	// Expression to evaluate for the replacement value.
	Expression string             `json:"expression"`
	JSON       rewriteURIPartJSON `json:"-"`
	// contains filtered or unexported fields
}

func (RewriteURIPart) AsUnion

func (r RewriteURIPart) AsUnion() RewriteURIPartUnion

AsUnion returns a RewriteURIPartUnion interface which you can cast to the specific types for more type safety.

Possible runtime types of the union are rulesets.RewriteURIPartStaticValue, rulesets.RewriteURIPartDynamicValue.

func (*RewriteURIPart) UnmarshalJSON

func (r *RewriteURIPart) UnmarshalJSON(data []byte) (err error)

type RewriteURIPartDynamicValue

type RewriteURIPartDynamicValue struct {
	// Expression to evaluate for the replacement value.
	Expression string                         `json:"expression,required"`
	JSON       rewriteURIPartDynamicValueJSON `json:"-"`
}

func (*RewriteURIPartDynamicValue) UnmarshalJSON

func (r *RewriteURIPartDynamicValue) UnmarshalJSON(data []byte) (err error)

type RewriteURIPartDynamicValueParam

type RewriteURIPartDynamicValueParam struct {
	// Expression to evaluate for the replacement value.
	Expression param.Field[string] `json:"expression,required"`
}

func (RewriteURIPartDynamicValueParam) MarshalJSON

func (r RewriteURIPartDynamicValueParam) MarshalJSON() (data []byte, err error)

type RewriteURIPartParam

type RewriteURIPartParam struct {
	// Predefined replacement value.
	Value param.Field[string] `json:"value"`
	// Expression to evaluate for the replacement value.
	Expression param.Field[string] `json:"expression"`
}

func (RewriteURIPartParam) MarshalJSON

func (r RewriteURIPartParam) MarshalJSON() (data []byte, err error)

type RewriteURIPartStaticValue

type RewriteURIPartStaticValue struct {
	// Predefined replacement value.
	Value string                        `json:"value,required"`
	JSON  rewriteURIPartStaticValueJSON `json:"-"`
}

func (*RewriteURIPartStaticValue) UnmarshalJSON

func (r *RewriteURIPartStaticValue) UnmarshalJSON(data []byte) (err error)

type RewriteURIPartStaticValueParam

type RewriteURIPartStaticValueParam struct {
	// Predefined replacement value.
	Value param.Field[string] `json:"value,required"`
}

func (RewriteURIPartStaticValueParam) MarshalJSON

func (r RewriteURIPartStaticValueParam) MarshalJSON() (data []byte, err error)

type RewriteURIPartUnion

type RewriteURIPartUnion interface {
	// contains filtered or unexported methods
}

Union satisfied by rulesets.RewriteURIPartStaticValue or rulesets.RewriteURIPartDynamicValue.

type RewriteURIPartUnionParam

type RewriteURIPartUnionParam interface {
	// contains filtered or unexported methods
}

Satisfied by rulesets.RewriteURIPartStaticValueParam, rulesets.RewriteURIPartDynamicValueParam, RewriteURIPartParam.

type Role

type Role = shared.Role

This is an alias to an internal type.

type RouteRule

type RouteRule 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 RouteRuleAction `json:"action"`
	// The parameters configuring the rule's action.
	ActionParameters RouteRuleActionParameters `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 Logging `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref  string        `json:"ref"`
	JSON routeRuleJSON `json:"-"`
}

func (*RouteRule) UnmarshalJSON

func (r *RouteRule) UnmarshalJSON(data []byte) (err error)

type RouteRuleAction

type RouteRuleAction string

The action to perform when the rule matches.

const (
	RouteRuleActionRoute RouteRuleAction = "route"
)

func (RouteRuleAction) IsKnown

func (r RouteRuleAction) IsKnown() bool

type RouteRuleActionParameters

type RouteRuleActionParameters struct {
	// Rewrite the HTTP Host header.
	HostHeader string `json:"host_header"`
	// Override the IP/TCP destination.
	Origin RouteRuleActionParametersOrigin `json:"origin"`
	// Override the Server Name Indication (SNI).
	SNI  RouteRuleActionParametersSNI  `json:"sni"`
	JSON routeRuleActionParametersJSON `json:"-"`
}

The parameters configuring the rule's action.

func (*RouteRuleActionParameters) UnmarshalJSON

func (r *RouteRuleActionParameters) UnmarshalJSON(data []byte) (err error)

type RouteRuleActionParametersOrigin

type RouteRuleActionParametersOrigin struct {
	// Override the resolved hostname.
	Host string `json:"host"`
	// Override the destination port.
	Port float64                             `json:"port"`
	JSON routeRuleActionParametersOriginJSON `json:"-"`
}

Override the IP/TCP destination.

func (*RouteRuleActionParametersOrigin) UnmarshalJSON

func (r *RouteRuleActionParametersOrigin) UnmarshalJSON(data []byte) (err error)

type RouteRuleActionParametersOriginParam

type RouteRuleActionParametersOriginParam struct {
	// Override the resolved hostname.
	Host param.Field[string] `json:"host"`
	// Override the destination port.
	Port param.Field[float64] `json:"port"`
}

Override the IP/TCP destination.

func (RouteRuleActionParametersOriginParam) MarshalJSON

func (r RouteRuleActionParametersOriginParam) MarshalJSON() (data []byte, err error)

type RouteRuleActionParametersParam

type RouteRuleActionParametersParam struct {
	// Rewrite the HTTP Host header.
	HostHeader param.Field[string] `json:"host_header"`
	// Override the IP/TCP destination.
	Origin param.Field[RouteRuleActionParametersOriginParam] `json:"origin"`
	// Override the Server Name Indication (SNI).
	SNI param.Field[RouteRuleActionParametersSNIParam] `json:"sni"`
}

The parameters configuring the rule's action.

func (RouteRuleActionParametersParam) MarshalJSON

func (r RouteRuleActionParametersParam) MarshalJSON() (data []byte, err error)

type RouteRuleActionParametersSNI added in v2.2.0

type RouteRuleActionParametersSNI struct {
	// The SNI override.
	Value string                           `json:"value,required"`
	JSON  routeRuleActionParametersSNIJSON `json:"-"`
}

Override the Server Name Indication (SNI).

func (*RouteRuleActionParametersSNI) UnmarshalJSON added in v2.2.0

func (r *RouteRuleActionParametersSNI) UnmarshalJSON(data []byte) (err error)

type RouteRuleActionParametersSNIParam added in v2.2.0

type RouteRuleActionParametersSNIParam struct {
	// The SNI override.
	Value param.Field[string] `json:"value,required"`
}

Override the Server Name Indication (SNI).

func (RouteRuleActionParametersSNIParam) MarshalJSON added in v2.2.0

func (r RouteRuleActionParametersSNIParam) MarshalJSON() (data []byte, err error)

type RouteRuleParam

type RouteRuleParam struct {
	// The unique ID of the rule.
	ID param.Field[string] `json:"id"`
	// The action to perform when the rule matches.
	Action param.Field[RouteRuleAction] `json:"action"`
	// The parameters configuring the rule's action.
	ActionParameters param.Field[RouteRuleActionParametersParam] `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[LoggingParam] `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref param.Field[string] `json:"ref"`
}

func (RouteRuleParam) MarshalJSON

func (r RouteRuleParam) MarshalJSON() (data []byte, err error)

type RuleDeleteParams

type RuleDeleteParams 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.
	ZoneID param.Field[string] `path:"zone_id"`
}

type RuleDeleteResponse

type RuleDeleteResponse struct {
	// The unique ID of the ruleset.
	ID string `json:"id,required"`
	// The kind of the ruleset.
	Kind Kind `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 Phase `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:"-"`
}

A ruleset object.

func (*RuleDeleteResponse) UnmarshalJSON

func (r *RuleDeleteResponse) UnmarshalJSON(data []byte) (err error)

type RuleDeleteResponseEnvelope

type RuleDeleteResponseEnvelope struct {
	// A list of error messages.
	Errors []RuleDeleteResponseEnvelopeErrors `json:"errors,required"`
	// A list of warning messages.
	Messages []RuleDeleteResponseEnvelopeMessages `json:"messages,required"`
	// A ruleset object.
	Result RuleDeleteResponse `json:"result,required"`
	// Whether the API call was successful.
	Success RuleDeleteResponseEnvelopeSuccess `json:"success,required"`
	JSON    ruleDeleteResponseEnvelopeJSON    `json:"-"`
}

A response object.

func (*RuleDeleteResponseEnvelope) UnmarshalJSON

func (r *RuleDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type RuleDeleteResponseEnvelopeErrors

type RuleDeleteResponseEnvelopeErrors 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 RuleDeleteResponseEnvelopeErrorsSource `json:"source"`
	JSON   ruleDeleteResponseEnvelopeErrorsJSON   `json:"-"`
}

A message.

func (*RuleDeleteResponseEnvelopeErrors) UnmarshalJSON

func (r *RuleDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type RuleDeleteResponseEnvelopeErrorsSource

type RuleDeleteResponseEnvelopeErrorsSource struct {
	// A JSON pointer to the field that is the source of the message.
	Pointer string                                     `json:"pointer,required"`
	JSON    ruleDeleteResponseEnvelopeErrorsSourceJSON `json:"-"`
}

The source of this message.

func (*RuleDeleteResponseEnvelopeErrorsSource) UnmarshalJSON

func (r *RuleDeleteResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error)

type RuleDeleteResponseEnvelopeMessages

type RuleDeleteResponseEnvelopeMessages 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 RuleDeleteResponseEnvelopeMessagesSource `json:"source"`
	JSON   ruleDeleteResponseEnvelopeMessagesJSON   `json:"-"`
}

A message.

func (*RuleDeleteResponseEnvelopeMessages) UnmarshalJSON

func (r *RuleDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type RuleDeleteResponseEnvelopeMessagesSource

type RuleDeleteResponseEnvelopeMessagesSource struct {
	// A JSON pointer to the field that is the source of the message.
	Pointer string                                       `json:"pointer,required"`
	JSON    ruleDeleteResponseEnvelopeMessagesSourceJSON `json:"-"`
}

The source of this message.

func (*RuleDeleteResponseEnvelopeMessagesSource) UnmarshalJSON

func (r *RuleDeleteResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error)

type RuleDeleteResponseEnvelopeSuccess

type RuleDeleteResponseEnvelopeSuccess bool

Whether the API call was successful.

const (
	RuleDeleteResponseEnvelopeSuccessTrue RuleDeleteResponseEnvelopeSuccess = true
)

func (RuleDeleteResponseEnvelopeSuccess) IsKnown

type RuleDeleteResponseRule

type RuleDeleteResponseRule struct {
	// The action to perform when the rule matches.
	Action RuleDeleteResponseRulesAction `json:"action"`
	// This field can have the runtime type of [BlockRuleActionParameters],
	// [interface{}], [CompressResponseRuleActionParameters],
	// [ExecuteRuleActionParameters], [RedirectRuleActionParameters],
	// [RewriteRuleActionParameters], [RouteRuleActionParameters],
	// [ScoreRuleActionParameters], [ServeErrorRuleActionParameters],
	// [SetConfigRuleActionParameters], [SkipRuleActionParameters],
	// [SetCacheSettingsRuleActionParameters],
	// [RuleDeleteResponseRulesRulesetsLogCustomFieldRuleActionParameters].
	ActionParameters interface{} `json:"action_parameters,required"`
	// This field can have the runtime type of [[]string].
	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 Logging `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:"-"`
	// contains filtered or unexported fields
}

func (*RuleDeleteResponseRule) UnmarshalJSON

func (r *RuleDeleteResponseRule) UnmarshalJSON(data []byte) (err error)

type RuleDeleteResponseRulesAction

type RuleDeleteResponseRulesAction string

The action to perform when the rule matches.

const (
	RuleDeleteResponseRulesActionBlock                RuleDeleteResponseRulesAction = "block"
	RuleDeleteResponseRulesActionChallenge            RuleDeleteResponseRulesAction = "challenge"
	RuleDeleteResponseRulesActionCompressResponse     RuleDeleteResponseRulesAction = "compress_response"
	RuleDeleteResponseRulesActionExecute              RuleDeleteResponseRulesAction = "execute"
	RuleDeleteResponseRulesActionJSChallenge          RuleDeleteResponseRulesAction = "js_challenge"
	RuleDeleteResponseRulesActionLog                  RuleDeleteResponseRulesAction = "log"
	RuleDeleteResponseRulesActionManagedChallenge     RuleDeleteResponseRulesAction = "managed_challenge"
	RuleDeleteResponseRulesActionRedirect             RuleDeleteResponseRulesAction = "redirect"
	RuleDeleteResponseRulesActionRewrite              RuleDeleteResponseRulesAction = "rewrite"
	RuleDeleteResponseRulesActionRoute                RuleDeleteResponseRulesAction = "route"
	RuleDeleteResponseRulesActionScore                RuleDeleteResponseRulesAction = "score"
	RuleDeleteResponseRulesActionServeError           RuleDeleteResponseRulesAction = "serve_error"
	RuleDeleteResponseRulesActionSetConfig            RuleDeleteResponseRulesAction = "set_config"
	RuleDeleteResponseRulesActionSkip                 RuleDeleteResponseRulesAction = "skip"
	RuleDeleteResponseRulesActionSetCacheSettings     RuleDeleteResponseRulesAction = "set_cache_settings"
	RuleDeleteResponseRulesActionLogCustomField       RuleDeleteResponseRulesAction = "log_custom_field"
	RuleDeleteResponseRulesActionDDoSDynamic          RuleDeleteResponseRulesAction = "ddos_dynamic"
	RuleDeleteResponseRulesActionForceConnectionClose RuleDeleteResponseRulesAction = "force_connection_close"
)

func (RuleDeleteResponseRulesAction) IsKnown

func (r RuleDeleteResponseRulesAction) IsKnown() bool

type RuleDeleteResponseRulesRulesetsDDoSDynamicRule added in v2.3.0

type RuleDeleteResponseRulesRulesetsDDoSDynamicRule 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 RuleDeleteResponseRulesRulesetsDDoSDynamicRuleAction `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 Logging `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref  string                                             `json:"ref"`
	JSON ruleDeleteResponseRulesRulesetsDDoSDynamicRuleJSON `json:"-"`
}

func (*RuleDeleteResponseRulesRulesetsDDoSDynamicRule) UnmarshalJSON added in v2.3.0

func (r *RuleDeleteResponseRulesRulesetsDDoSDynamicRule) UnmarshalJSON(data []byte) (err error)

type RuleDeleteResponseRulesRulesetsDDoSDynamicRuleAction added in v2.3.0

type RuleDeleteResponseRulesRulesetsDDoSDynamicRuleAction string

The action to perform when the rule matches.

const (
	RuleDeleteResponseRulesRulesetsDDoSDynamicRuleActionDDoSDynamic RuleDeleteResponseRulesRulesetsDDoSDynamicRuleAction = "ddos_dynamic"
)

func (RuleDeleteResponseRulesRulesetsDDoSDynamicRuleAction) IsKnown added in v2.3.0

type RuleDeleteResponseRulesRulesetsForceConnectionCloseRule added in v2.3.0

type RuleDeleteResponseRulesRulesetsForceConnectionCloseRule 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 RuleDeleteResponseRulesRulesetsForceConnectionCloseRuleAction `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 Logging `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref  string                                                      `json:"ref"`
	JSON ruleDeleteResponseRulesRulesetsForceConnectionCloseRuleJSON `json:"-"`
}

func (*RuleDeleteResponseRulesRulesetsForceConnectionCloseRule) UnmarshalJSON added in v2.3.0

type RuleDeleteResponseRulesRulesetsForceConnectionCloseRuleAction added in v2.3.0

type RuleDeleteResponseRulesRulesetsForceConnectionCloseRuleAction string

The action to perform when the rule matches.

const (
	RuleDeleteResponseRulesRulesetsForceConnectionCloseRuleActionForceConnectionClose RuleDeleteResponseRulesRulesetsForceConnectionCloseRuleAction = "force_connection_close"
)

func (RuleDeleteResponseRulesRulesetsForceConnectionCloseRuleAction) IsKnown added in v2.3.0

type RuleDeleteResponseRulesRulesetsLogCustomFieldRule added in v2.3.0

type RuleDeleteResponseRulesRulesetsLogCustomFieldRule 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 RuleDeleteResponseRulesRulesetsLogCustomFieldRuleAction `json:"action"`
	// The parameters configuring the rule's action.
	ActionParameters RuleDeleteResponseRulesRulesetsLogCustomFieldRuleActionParameters `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 Logging `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref  string                                                `json:"ref"`
	JSON ruleDeleteResponseRulesRulesetsLogCustomFieldRuleJSON `json:"-"`
}

func (*RuleDeleteResponseRulesRulesetsLogCustomFieldRule) UnmarshalJSON added in v2.3.0

func (r *RuleDeleteResponseRulesRulesetsLogCustomFieldRule) UnmarshalJSON(data []byte) (err error)

type RuleDeleteResponseRulesRulesetsLogCustomFieldRuleAction added in v2.3.0

type RuleDeleteResponseRulesRulesetsLogCustomFieldRuleAction string

The action to perform when the rule matches.

const (
	RuleDeleteResponseRulesRulesetsLogCustomFieldRuleActionLogCustomField RuleDeleteResponseRulesRulesetsLogCustomFieldRuleAction = "log_custom_field"
)

func (RuleDeleteResponseRulesRulesetsLogCustomFieldRuleAction) IsKnown added in v2.3.0

type RuleDeleteResponseRulesRulesetsLogCustomFieldRuleActionParameters added in v2.3.0

type RuleDeleteResponseRulesRulesetsLogCustomFieldRuleActionParameters struct {
	// The cookie fields to log.
	CookieFields []RuleDeleteResponseRulesRulesetsLogCustomFieldRuleActionParametersCookieField `json:"cookie_fields"`
	// The request fields to log.
	RequestFields []RuleDeleteResponseRulesRulesetsLogCustomFieldRuleActionParametersRequestField `json:"request_fields"`
	// The response fields to log.
	ResponseFields []RuleDeleteResponseRulesRulesetsLogCustomFieldRuleActionParametersResponseField `json:"response_fields"`
	JSON           ruleDeleteResponseRulesRulesetsLogCustomFieldRuleActionParametersJSON            `json:"-"`
}

The parameters configuring the rule's action.

func (*RuleDeleteResponseRulesRulesetsLogCustomFieldRuleActionParameters) UnmarshalJSON added in v2.3.0

type RuleDeleteResponseRulesRulesetsLogCustomFieldRuleActionParametersCookieField added in v2.3.0

type RuleDeleteResponseRulesRulesetsLogCustomFieldRuleActionParametersCookieField struct {
	// The name of the field.
	Name string                                                                           `json:"name,required"`
	JSON ruleDeleteResponseRulesRulesetsLogCustomFieldRuleActionParametersCookieFieldJSON `json:"-"`
}

The cookie field to log.

func (*RuleDeleteResponseRulesRulesetsLogCustomFieldRuleActionParametersCookieField) UnmarshalJSON added in v2.3.0

type RuleDeleteResponseRulesRulesetsLogCustomFieldRuleActionParametersRequestField added in v2.3.0

type RuleDeleteResponseRulesRulesetsLogCustomFieldRuleActionParametersRequestField struct {
	// The name of the field.
	Name string                                                                            `json:"name,required"`
	JSON ruleDeleteResponseRulesRulesetsLogCustomFieldRuleActionParametersRequestFieldJSON `json:"-"`
}

The request field to log.

func (*RuleDeleteResponseRulesRulesetsLogCustomFieldRuleActionParametersRequestField) UnmarshalJSON added in v2.3.0

type RuleDeleteResponseRulesRulesetsLogCustomFieldRuleActionParametersResponseField added in v2.3.0

type RuleDeleteResponseRulesRulesetsLogCustomFieldRuleActionParametersResponseField struct {
	// The name of the field.
	Name string                                                                             `json:"name,required"`
	JSON ruleDeleteResponseRulesRulesetsLogCustomFieldRuleActionParametersResponseFieldJSON `json:"-"`
}

The response field to log.

func (*RuleDeleteResponseRulesRulesetsLogCustomFieldRuleActionParametersResponseField) UnmarshalJSON added in v2.3.0

type RuleEditParams

type RuleEditParams 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.
	ZoneID param.Field[string] `path:"zone_id"`
	// An object configuring where the rule will be placed.
	Position param.Field[RuleEditParamsPositionUnion] `json:"position"`
}

func (RuleEditParams) MarshalJSON

func (r RuleEditParams) MarshalJSON() (data []byte, err error)

type RuleEditParamsPosition

type RuleEditParamsPosition struct {
	// The ID of another rule to place the rule before. An empty value causes the rule
	// to be placed at the top.
	Before param.Field[string] `json:"before"`
	// The ID of another rule to place the rule after. An empty value causes the rule
	// to be placed at the bottom.
	After param.Field[string] `json:"after"`
	// An index at which to place the rule, where index 1 is the first rule.
	Index param.Field[float64] `json:"index"`
}

An object configuring where the rule will be placed.

func (RuleEditParamsPosition) MarshalJSON

func (r RuleEditParamsPosition) MarshalJSON() (data []byte, err error)

type RuleEditParamsPositionAfterPosition

type RuleEditParamsPositionAfterPosition struct {
	// The ID of another rule to place the rule after. An empty value causes the rule
	// to be placed at the bottom.
	After param.Field[string] `json:"after"`
}

An object configuring where the rule will be placed.

func (RuleEditParamsPositionAfterPosition) MarshalJSON

func (r RuleEditParamsPositionAfterPosition) MarshalJSON() (data []byte, err error)

type RuleEditParamsPositionBeforePosition

type RuleEditParamsPositionBeforePosition struct {
	// The ID of another rule to place the rule before. An empty value causes the rule
	// to be placed at the top.
	Before param.Field[string] `json:"before"`
}

An object configuring where the rule will be placed.

func (RuleEditParamsPositionBeforePosition) MarshalJSON

func (r RuleEditParamsPositionBeforePosition) MarshalJSON() (data []byte, err error)

type RuleEditParamsPositionIndexPosition

type RuleEditParamsPositionIndexPosition struct {
	// An index at which to place the rule, where index 1 is the first rule.
	Index param.Field[float64] `json:"index"`
}

An object configuring where the rule will be placed.

func (RuleEditParamsPositionIndexPosition) MarshalJSON

func (r RuleEditParamsPositionIndexPosition) MarshalJSON() (data []byte, err error)

type RuleEditParamsPositionUnion

type RuleEditParamsPositionUnion interface {
	// contains filtered or unexported methods
}

An object configuring where the rule will be placed.

Satisfied by rulesets.RuleEditParamsPositionBeforePosition, rulesets.RuleEditParamsPositionAfterPosition, rulesets.RuleEditParamsPositionIndexPosition, RuleEditParamsPosition.

type RuleEditResponse

type RuleEditResponse struct {
	// The unique ID of the ruleset.
	ID string `json:"id,required"`
	// The kind of the ruleset.
	Kind Kind `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 Phase `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:"-"`
}

A ruleset object.

func (*RuleEditResponse) UnmarshalJSON

func (r *RuleEditResponse) UnmarshalJSON(data []byte) (err error)

type RuleEditResponseEnvelope

type RuleEditResponseEnvelope struct {
	// A list of error messages.
	Errors []RuleEditResponseEnvelopeErrors `json:"errors,required"`
	// A list of warning messages.
	Messages []RuleEditResponseEnvelopeMessages `json:"messages,required"`
	// A ruleset object.
	Result RuleEditResponse `json:"result,required"`
	// Whether the API call was successful.
	Success RuleEditResponseEnvelopeSuccess `json:"success,required"`
	JSON    ruleEditResponseEnvelopeJSON    `json:"-"`
}

A response object.

func (*RuleEditResponseEnvelope) UnmarshalJSON

func (r *RuleEditResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type RuleEditResponseEnvelopeErrors

type RuleEditResponseEnvelopeErrors 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 RuleEditResponseEnvelopeErrorsSource `json:"source"`
	JSON   ruleEditResponseEnvelopeErrorsJSON   `json:"-"`
}

A message.

func (*RuleEditResponseEnvelopeErrors) UnmarshalJSON

func (r *RuleEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type RuleEditResponseEnvelopeErrorsSource

type RuleEditResponseEnvelopeErrorsSource struct {
	// A JSON pointer to the field that is the source of the message.
	Pointer string                                   `json:"pointer,required"`
	JSON    ruleEditResponseEnvelopeErrorsSourceJSON `json:"-"`
}

The source of this message.

func (*RuleEditResponseEnvelopeErrorsSource) UnmarshalJSON

func (r *RuleEditResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error)

type RuleEditResponseEnvelopeMessages

type RuleEditResponseEnvelopeMessages 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 RuleEditResponseEnvelopeMessagesSource `json:"source"`
	JSON   ruleEditResponseEnvelopeMessagesJSON   `json:"-"`
}

A message.

func (*RuleEditResponseEnvelopeMessages) UnmarshalJSON

func (r *RuleEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type RuleEditResponseEnvelopeMessagesSource

type RuleEditResponseEnvelopeMessagesSource struct {
	// A JSON pointer to the field that is the source of the message.
	Pointer string                                     `json:"pointer,required"`
	JSON    ruleEditResponseEnvelopeMessagesSourceJSON `json:"-"`
}

The source of this message.

func (*RuleEditResponseEnvelopeMessagesSource) UnmarshalJSON

func (r *RuleEditResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error)

type RuleEditResponseEnvelopeSuccess

type RuleEditResponseEnvelopeSuccess bool

Whether the API call was successful.

const (
	RuleEditResponseEnvelopeSuccessTrue RuleEditResponseEnvelopeSuccess = true
)

func (RuleEditResponseEnvelopeSuccess) IsKnown

type RuleEditResponseRule

type RuleEditResponseRule struct {
	// The action to perform when the rule matches.
	Action RuleEditResponseRulesAction `json:"action"`
	// This field can have the runtime type of [BlockRuleActionParameters],
	// [interface{}], [CompressResponseRuleActionParameters],
	// [ExecuteRuleActionParameters], [RedirectRuleActionParameters],
	// [RewriteRuleActionParameters], [RouteRuleActionParameters],
	// [ScoreRuleActionParameters], [ServeErrorRuleActionParameters],
	// [SetConfigRuleActionParameters], [SkipRuleActionParameters],
	// [SetCacheSettingsRuleActionParameters],
	// [RuleEditResponseRulesRulesetsLogCustomFieldRuleActionParameters].
	ActionParameters interface{} `json:"action_parameters,required"`
	// This field can have the runtime type of [[]string].
	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 Logging `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:"-"`
	// contains filtered or unexported fields
}

func (*RuleEditResponseRule) UnmarshalJSON

func (r *RuleEditResponseRule) UnmarshalJSON(data []byte) (err error)

type RuleEditResponseRulesAction

type RuleEditResponseRulesAction string

The action to perform when the rule matches.

const (
	RuleEditResponseRulesActionBlock                RuleEditResponseRulesAction = "block"
	RuleEditResponseRulesActionChallenge            RuleEditResponseRulesAction = "challenge"
	RuleEditResponseRulesActionCompressResponse     RuleEditResponseRulesAction = "compress_response"
	RuleEditResponseRulesActionExecute              RuleEditResponseRulesAction = "execute"
	RuleEditResponseRulesActionJSChallenge          RuleEditResponseRulesAction = "js_challenge"
	RuleEditResponseRulesActionLog                  RuleEditResponseRulesAction = "log"
	RuleEditResponseRulesActionManagedChallenge     RuleEditResponseRulesAction = "managed_challenge"
	RuleEditResponseRulesActionRedirect             RuleEditResponseRulesAction = "redirect"
	RuleEditResponseRulesActionRewrite              RuleEditResponseRulesAction = "rewrite"
	RuleEditResponseRulesActionRoute                RuleEditResponseRulesAction = "route"
	RuleEditResponseRulesActionScore                RuleEditResponseRulesAction = "score"
	RuleEditResponseRulesActionServeError           RuleEditResponseRulesAction = "serve_error"
	RuleEditResponseRulesActionSetConfig            RuleEditResponseRulesAction = "set_config"
	RuleEditResponseRulesActionSkip                 RuleEditResponseRulesAction = "skip"
	RuleEditResponseRulesActionSetCacheSettings     RuleEditResponseRulesAction = "set_cache_settings"
	RuleEditResponseRulesActionLogCustomField       RuleEditResponseRulesAction = "log_custom_field"
	RuleEditResponseRulesActionDDoSDynamic          RuleEditResponseRulesAction = "ddos_dynamic"
	RuleEditResponseRulesActionForceConnectionClose RuleEditResponseRulesAction = "force_connection_close"
)

func (RuleEditResponseRulesAction) IsKnown

func (r RuleEditResponseRulesAction) IsKnown() bool

type RuleEditResponseRulesRulesetsDDoSDynamicRule added in v2.3.0

type RuleEditResponseRulesRulesetsDDoSDynamicRule 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 RuleEditResponseRulesRulesetsDDoSDynamicRuleAction `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 Logging `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref  string                                           `json:"ref"`
	JSON ruleEditResponseRulesRulesetsDDoSDynamicRuleJSON `json:"-"`
}

func (*RuleEditResponseRulesRulesetsDDoSDynamicRule) UnmarshalJSON added in v2.3.0

func (r *RuleEditResponseRulesRulesetsDDoSDynamicRule) UnmarshalJSON(data []byte) (err error)

type RuleEditResponseRulesRulesetsDDoSDynamicRuleAction added in v2.3.0

type RuleEditResponseRulesRulesetsDDoSDynamicRuleAction string

The action to perform when the rule matches.

const (
	RuleEditResponseRulesRulesetsDDoSDynamicRuleActionDDoSDynamic RuleEditResponseRulesRulesetsDDoSDynamicRuleAction = "ddos_dynamic"
)

func (RuleEditResponseRulesRulesetsDDoSDynamicRuleAction) IsKnown added in v2.3.0

type RuleEditResponseRulesRulesetsForceConnectionCloseRule added in v2.3.0

type RuleEditResponseRulesRulesetsForceConnectionCloseRule 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 RuleEditResponseRulesRulesetsForceConnectionCloseRuleAction `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 Logging `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref  string                                                    `json:"ref"`
	JSON ruleEditResponseRulesRulesetsForceConnectionCloseRuleJSON `json:"-"`
}

func (*RuleEditResponseRulesRulesetsForceConnectionCloseRule) UnmarshalJSON added in v2.3.0

func (r *RuleEditResponseRulesRulesetsForceConnectionCloseRule) UnmarshalJSON(data []byte) (err error)

type RuleEditResponseRulesRulesetsForceConnectionCloseRuleAction added in v2.3.0

type RuleEditResponseRulesRulesetsForceConnectionCloseRuleAction string

The action to perform when the rule matches.

const (
	RuleEditResponseRulesRulesetsForceConnectionCloseRuleActionForceConnectionClose RuleEditResponseRulesRulesetsForceConnectionCloseRuleAction = "force_connection_close"
)

func (RuleEditResponseRulesRulesetsForceConnectionCloseRuleAction) IsKnown added in v2.3.0

type RuleEditResponseRulesRulesetsLogCustomFieldRule added in v2.3.0

type RuleEditResponseRulesRulesetsLogCustomFieldRule 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 RuleEditResponseRulesRulesetsLogCustomFieldRuleAction `json:"action"`
	// The parameters configuring the rule's action.
	ActionParameters RuleEditResponseRulesRulesetsLogCustomFieldRuleActionParameters `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 Logging `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref  string                                              `json:"ref"`
	JSON ruleEditResponseRulesRulesetsLogCustomFieldRuleJSON `json:"-"`
}

func (*RuleEditResponseRulesRulesetsLogCustomFieldRule) UnmarshalJSON added in v2.3.0

func (r *RuleEditResponseRulesRulesetsLogCustomFieldRule) UnmarshalJSON(data []byte) (err error)

type RuleEditResponseRulesRulesetsLogCustomFieldRuleAction added in v2.3.0

type RuleEditResponseRulesRulesetsLogCustomFieldRuleAction string

The action to perform when the rule matches.

const (
	RuleEditResponseRulesRulesetsLogCustomFieldRuleActionLogCustomField RuleEditResponseRulesRulesetsLogCustomFieldRuleAction = "log_custom_field"
)

func (RuleEditResponseRulesRulesetsLogCustomFieldRuleAction) IsKnown added in v2.3.0

type RuleEditResponseRulesRulesetsLogCustomFieldRuleActionParameters added in v2.3.0

type RuleEditResponseRulesRulesetsLogCustomFieldRuleActionParameters struct {
	// The cookie fields to log.
	CookieFields []RuleEditResponseRulesRulesetsLogCustomFieldRuleActionParametersCookieField `json:"cookie_fields"`
	// The request fields to log.
	RequestFields []RuleEditResponseRulesRulesetsLogCustomFieldRuleActionParametersRequestField `json:"request_fields"`
	// The response fields to log.
	ResponseFields []RuleEditResponseRulesRulesetsLogCustomFieldRuleActionParametersResponseField `json:"response_fields"`
	JSON           ruleEditResponseRulesRulesetsLogCustomFieldRuleActionParametersJSON            `json:"-"`
}

The parameters configuring the rule's action.

func (*RuleEditResponseRulesRulesetsLogCustomFieldRuleActionParameters) UnmarshalJSON added in v2.3.0

type RuleEditResponseRulesRulesetsLogCustomFieldRuleActionParametersCookieField added in v2.3.0

type RuleEditResponseRulesRulesetsLogCustomFieldRuleActionParametersCookieField struct {
	// The name of the field.
	Name string                                                                         `json:"name,required"`
	JSON ruleEditResponseRulesRulesetsLogCustomFieldRuleActionParametersCookieFieldJSON `json:"-"`
}

The cookie field to log.

func (*RuleEditResponseRulesRulesetsLogCustomFieldRuleActionParametersCookieField) UnmarshalJSON added in v2.3.0

type RuleEditResponseRulesRulesetsLogCustomFieldRuleActionParametersRequestField added in v2.3.0

type RuleEditResponseRulesRulesetsLogCustomFieldRuleActionParametersRequestField struct {
	// The name of the field.
	Name string                                                                          `json:"name,required"`
	JSON ruleEditResponseRulesRulesetsLogCustomFieldRuleActionParametersRequestFieldJSON `json:"-"`
}

The request field to log.

func (*RuleEditResponseRulesRulesetsLogCustomFieldRuleActionParametersRequestField) UnmarshalJSON added in v2.3.0

type RuleEditResponseRulesRulesetsLogCustomFieldRuleActionParametersResponseField added in v2.3.0

type RuleEditResponseRulesRulesetsLogCustomFieldRuleActionParametersResponseField struct {
	// The name of the field.
	Name string                                                                           `json:"name,required"`
	JSON ruleEditResponseRulesRulesetsLogCustomFieldRuleActionParametersResponseFieldJSON `json:"-"`
}

The response field to log.

func (*RuleEditResponseRulesRulesetsLogCustomFieldRuleActionParametersResponseField) UnmarshalJSON added in v2.3.0

type RuleNewParams

type RuleNewParams 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.
	ZoneID param.Field[string] `path:"zone_id"`
	// An object configuring where the rule will be placed.
	Position param.Field[RuleNewParamsPositionUnion] `json:"position"`
}

func (RuleNewParams) MarshalJSON

func (r RuleNewParams) MarshalJSON() (data []byte, err error)

type RuleNewParamsPosition

type RuleNewParamsPosition struct {
	// The ID of another rule to place the rule before. An empty value causes the rule
	// to be placed at the top.
	Before param.Field[string] `json:"before"`
	// The ID of another rule to place the rule after. An empty value causes the rule
	// to be placed at the bottom.
	After param.Field[string] `json:"after"`
	// An index at which to place the rule, where index 1 is the first rule.
	Index param.Field[float64] `json:"index"`
}

An object configuring where the rule will be placed.

func (RuleNewParamsPosition) MarshalJSON

func (r RuleNewParamsPosition) MarshalJSON() (data []byte, err error)

type RuleNewParamsPositionAfterPosition

type RuleNewParamsPositionAfterPosition struct {
	// The ID of another rule to place the rule after. An empty value causes the rule
	// to be placed at the bottom.
	After param.Field[string] `json:"after"`
}

An object configuring where the rule will be placed.

func (RuleNewParamsPositionAfterPosition) MarshalJSON

func (r RuleNewParamsPositionAfterPosition) MarshalJSON() (data []byte, err error)

type RuleNewParamsPositionBeforePosition

type RuleNewParamsPositionBeforePosition struct {
	// The ID of another rule to place the rule before. An empty value causes the rule
	// to be placed at the top.
	Before param.Field[string] `json:"before"`
}

An object configuring where the rule will be placed.

func (RuleNewParamsPositionBeforePosition) MarshalJSON

func (r RuleNewParamsPositionBeforePosition) MarshalJSON() (data []byte, err error)

type RuleNewParamsPositionIndexPosition

type RuleNewParamsPositionIndexPosition struct {
	// An index at which to place the rule, where index 1 is the first rule.
	Index param.Field[float64] `json:"index"`
}

An object configuring where the rule will be placed.

func (RuleNewParamsPositionIndexPosition) MarshalJSON

func (r RuleNewParamsPositionIndexPosition) MarshalJSON() (data []byte, err error)

type RuleNewParamsPositionUnion

type RuleNewParamsPositionUnion interface {
	// contains filtered or unexported methods
}

An object configuring where the rule will be placed.

Satisfied by rulesets.RuleNewParamsPositionBeforePosition, rulesets.RuleNewParamsPositionAfterPosition, rulesets.RuleNewParamsPositionIndexPosition, RuleNewParamsPosition.

type RuleNewResponse

type RuleNewResponse struct {
	// The unique ID of the ruleset.
	ID string `json:"id,required"`
	// The kind of the ruleset.
	Kind Kind `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 Phase `json:"phase,required"`
	// The list of rules in the ruleset.
	Rules []RuleNewResponseRule `json:"rules,required"`
	// The version of the ruleset.
	Version string `json:"version,required"`
	// An informative description of the ruleset.
	Description string              `json:"description"`
	JSON        ruleNewResponseJSON `json:"-"`
}

A ruleset object.

func (*RuleNewResponse) UnmarshalJSON

func (r *RuleNewResponse) UnmarshalJSON(data []byte) (err error)

type RuleNewResponseEnvelope

type RuleNewResponseEnvelope struct {
	// A list of error messages.
	Errors []RuleNewResponseEnvelopeErrors `json:"errors,required"`
	// A list of warning messages.
	Messages []RuleNewResponseEnvelopeMessages `json:"messages,required"`
	// A ruleset object.
	Result RuleNewResponse `json:"result,required"`
	// Whether the API call was successful.
	Success RuleNewResponseEnvelopeSuccess `json:"success,required"`
	JSON    ruleNewResponseEnvelopeJSON    `json:"-"`
}

A response object.

func (*RuleNewResponseEnvelope) UnmarshalJSON

func (r *RuleNewResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type RuleNewResponseEnvelopeErrors

type RuleNewResponseEnvelopeErrors 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 RuleNewResponseEnvelopeErrorsSource `json:"source"`
	JSON   ruleNewResponseEnvelopeErrorsJSON   `json:"-"`
}

A message.

func (*RuleNewResponseEnvelopeErrors) UnmarshalJSON

func (r *RuleNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type RuleNewResponseEnvelopeErrorsSource

type RuleNewResponseEnvelopeErrorsSource struct {
	// A JSON pointer to the field that is the source of the message.
	Pointer string                                  `json:"pointer,required"`
	JSON    ruleNewResponseEnvelopeErrorsSourceJSON `json:"-"`
}

The source of this message.

func (*RuleNewResponseEnvelopeErrorsSource) UnmarshalJSON

func (r *RuleNewResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error)

type RuleNewResponseEnvelopeMessages

type RuleNewResponseEnvelopeMessages 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 RuleNewResponseEnvelopeMessagesSource `json:"source"`
	JSON   ruleNewResponseEnvelopeMessagesJSON   `json:"-"`
}

A message.

func (*RuleNewResponseEnvelopeMessages) UnmarshalJSON

func (r *RuleNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type RuleNewResponseEnvelopeMessagesSource

type RuleNewResponseEnvelopeMessagesSource struct {
	// A JSON pointer to the field that is the source of the message.
	Pointer string                                    `json:"pointer,required"`
	JSON    ruleNewResponseEnvelopeMessagesSourceJSON `json:"-"`
}

The source of this message.

func (*RuleNewResponseEnvelopeMessagesSource) UnmarshalJSON

func (r *RuleNewResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error)

type RuleNewResponseEnvelopeSuccess

type RuleNewResponseEnvelopeSuccess bool

Whether the API call was successful.

const (
	RuleNewResponseEnvelopeSuccessTrue RuleNewResponseEnvelopeSuccess = true
)

func (RuleNewResponseEnvelopeSuccess) IsKnown

type RuleNewResponseRule

type RuleNewResponseRule struct {
	// The action to perform when the rule matches.
	Action RuleNewResponseRulesAction `json:"action"`
	// This field can have the runtime type of [BlockRuleActionParameters],
	// [interface{}], [CompressResponseRuleActionParameters],
	// [ExecuteRuleActionParameters], [RedirectRuleActionParameters],
	// [RewriteRuleActionParameters], [RouteRuleActionParameters],
	// [ScoreRuleActionParameters], [ServeErrorRuleActionParameters],
	// [SetConfigRuleActionParameters], [SkipRuleActionParameters],
	// [SetCacheSettingsRuleActionParameters],
	// [RuleNewResponseRulesRulesetsLogCustomFieldRuleActionParameters].
	ActionParameters interface{} `json:"action_parameters,required"`
	// This field can have the runtime type of [[]string].
	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 Logging `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:"-"`
	// contains filtered or unexported fields
}

func (*RuleNewResponseRule) UnmarshalJSON

func (r *RuleNewResponseRule) UnmarshalJSON(data []byte) (err error)

type RuleNewResponseRulesAction

type RuleNewResponseRulesAction string

The action to perform when the rule matches.

const (
	RuleNewResponseRulesActionBlock                RuleNewResponseRulesAction = "block"
	RuleNewResponseRulesActionChallenge            RuleNewResponseRulesAction = "challenge"
	RuleNewResponseRulesActionCompressResponse     RuleNewResponseRulesAction = "compress_response"
	RuleNewResponseRulesActionExecute              RuleNewResponseRulesAction = "execute"
	RuleNewResponseRulesActionJSChallenge          RuleNewResponseRulesAction = "js_challenge"
	RuleNewResponseRulesActionLog                  RuleNewResponseRulesAction = "log"
	RuleNewResponseRulesActionManagedChallenge     RuleNewResponseRulesAction = "managed_challenge"
	RuleNewResponseRulesActionRedirect             RuleNewResponseRulesAction = "redirect"
	RuleNewResponseRulesActionRewrite              RuleNewResponseRulesAction = "rewrite"
	RuleNewResponseRulesActionRoute                RuleNewResponseRulesAction = "route"
	RuleNewResponseRulesActionScore                RuleNewResponseRulesAction = "score"
	RuleNewResponseRulesActionServeError           RuleNewResponseRulesAction = "serve_error"
	RuleNewResponseRulesActionSetConfig            RuleNewResponseRulesAction = "set_config"
	RuleNewResponseRulesActionSkip                 RuleNewResponseRulesAction = "skip"
	RuleNewResponseRulesActionSetCacheSettings     RuleNewResponseRulesAction = "set_cache_settings"
	RuleNewResponseRulesActionLogCustomField       RuleNewResponseRulesAction = "log_custom_field"
	RuleNewResponseRulesActionDDoSDynamic          RuleNewResponseRulesAction = "ddos_dynamic"
	RuleNewResponseRulesActionForceConnectionClose RuleNewResponseRulesAction = "force_connection_close"
)

func (RuleNewResponseRulesAction) IsKnown

func (r RuleNewResponseRulesAction) IsKnown() bool

type RuleNewResponseRulesRulesetsDDoSDynamicRule added in v2.3.0

type RuleNewResponseRulesRulesetsDDoSDynamicRule 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 RuleNewResponseRulesRulesetsDDoSDynamicRuleAction `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 Logging `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref  string                                          `json:"ref"`
	JSON ruleNewResponseRulesRulesetsDDoSDynamicRuleJSON `json:"-"`
}

func (*RuleNewResponseRulesRulesetsDDoSDynamicRule) UnmarshalJSON added in v2.3.0

func (r *RuleNewResponseRulesRulesetsDDoSDynamicRule) UnmarshalJSON(data []byte) (err error)

type RuleNewResponseRulesRulesetsDDoSDynamicRuleAction added in v2.3.0

type RuleNewResponseRulesRulesetsDDoSDynamicRuleAction string

The action to perform when the rule matches.

const (
	RuleNewResponseRulesRulesetsDDoSDynamicRuleActionDDoSDynamic RuleNewResponseRulesRulesetsDDoSDynamicRuleAction = "ddos_dynamic"
)

func (RuleNewResponseRulesRulesetsDDoSDynamicRuleAction) IsKnown added in v2.3.0

type RuleNewResponseRulesRulesetsForceConnectionCloseRule added in v2.3.0

type RuleNewResponseRulesRulesetsForceConnectionCloseRule 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 RuleNewResponseRulesRulesetsForceConnectionCloseRuleAction `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 Logging `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref  string                                                   `json:"ref"`
	JSON ruleNewResponseRulesRulesetsForceConnectionCloseRuleJSON `json:"-"`
}

func (*RuleNewResponseRulesRulesetsForceConnectionCloseRule) UnmarshalJSON added in v2.3.0

func (r *RuleNewResponseRulesRulesetsForceConnectionCloseRule) UnmarshalJSON(data []byte) (err error)

type RuleNewResponseRulesRulesetsForceConnectionCloseRuleAction added in v2.3.0

type RuleNewResponseRulesRulesetsForceConnectionCloseRuleAction string

The action to perform when the rule matches.

const (
	RuleNewResponseRulesRulesetsForceConnectionCloseRuleActionForceConnectionClose RuleNewResponseRulesRulesetsForceConnectionCloseRuleAction = "force_connection_close"
)

func (RuleNewResponseRulesRulesetsForceConnectionCloseRuleAction) IsKnown added in v2.3.0

type RuleNewResponseRulesRulesetsLogCustomFieldRule added in v2.3.0

type RuleNewResponseRulesRulesetsLogCustomFieldRule 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 RuleNewResponseRulesRulesetsLogCustomFieldRuleAction `json:"action"`
	// The parameters configuring the rule's action.
	ActionParameters RuleNewResponseRulesRulesetsLogCustomFieldRuleActionParameters `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 Logging `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref  string                                             `json:"ref"`
	JSON ruleNewResponseRulesRulesetsLogCustomFieldRuleJSON `json:"-"`
}

func (*RuleNewResponseRulesRulesetsLogCustomFieldRule) UnmarshalJSON added in v2.3.0

func (r *RuleNewResponseRulesRulesetsLogCustomFieldRule) UnmarshalJSON(data []byte) (err error)

type RuleNewResponseRulesRulesetsLogCustomFieldRuleAction added in v2.3.0

type RuleNewResponseRulesRulesetsLogCustomFieldRuleAction string

The action to perform when the rule matches.

const (
	RuleNewResponseRulesRulesetsLogCustomFieldRuleActionLogCustomField RuleNewResponseRulesRulesetsLogCustomFieldRuleAction = "log_custom_field"
)

func (RuleNewResponseRulesRulesetsLogCustomFieldRuleAction) IsKnown added in v2.3.0

type RuleNewResponseRulesRulesetsLogCustomFieldRuleActionParameters added in v2.3.0

type RuleNewResponseRulesRulesetsLogCustomFieldRuleActionParameters struct {
	// The cookie fields to log.
	CookieFields []RuleNewResponseRulesRulesetsLogCustomFieldRuleActionParametersCookieField `json:"cookie_fields"`
	// The request fields to log.
	RequestFields []RuleNewResponseRulesRulesetsLogCustomFieldRuleActionParametersRequestField `json:"request_fields"`
	// The response fields to log.
	ResponseFields []RuleNewResponseRulesRulesetsLogCustomFieldRuleActionParametersResponseField `json:"response_fields"`
	JSON           ruleNewResponseRulesRulesetsLogCustomFieldRuleActionParametersJSON            `json:"-"`
}

The parameters configuring the rule's action.

func (*RuleNewResponseRulesRulesetsLogCustomFieldRuleActionParameters) UnmarshalJSON added in v2.3.0

type RuleNewResponseRulesRulesetsLogCustomFieldRuleActionParametersCookieField added in v2.3.0

type RuleNewResponseRulesRulesetsLogCustomFieldRuleActionParametersCookieField struct {
	// The name of the field.
	Name string                                                                        `json:"name,required"`
	JSON ruleNewResponseRulesRulesetsLogCustomFieldRuleActionParametersCookieFieldJSON `json:"-"`
}

The cookie field to log.

func (*RuleNewResponseRulesRulesetsLogCustomFieldRuleActionParametersCookieField) UnmarshalJSON added in v2.3.0

type RuleNewResponseRulesRulesetsLogCustomFieldRuleActionParametersRequestField added in v2.3.0

type RuleNewResponseRulesRulesetsLogCustomFieldRuleActionParametersRequestField struct {
	// The name of the field.
	Name string                                                                         `json:"name,required"`
	JSON ruleNewResponseRulesRulesetsLogCustomFieldRuleActionParametersRequestFieldJSON `json:"-"`
}

The request field to log.

func (*RuleNewResponseRulesRulesetsLogCustomFieldRuleActionParametersRequestField) UnmarshalJSON added in v2.3.0

type RuleNewResponseRulesRulesetsLogCustomFieldRuleActionParametersResponseField added in v2.3.0

type RuleNewResponseRulesRulesetsLogCustomFieldRuleActionParametersResponseField struct {
	// The name of the field.
	Name string                                                                          `json:"name,required"`
	JSON ruleNewResponseRulesRulesetsLogCustomFieldRuleActionParametersResponseFieldJSON `json:"-"`
}

The response field to log.

func (*RuleNewResponseRulesRulesetsLogCustomFieldRuleActionParametersResponseField) UnmarshalJSON added in v2.3.0

type RuleService

type RuleService struct {
	Options []option.RequestOption
}

RuleService contains methods and other services that help with interacting with the cloudflare API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewRuleService method instead.

func NewRuleService

func NewRuleService(opts ...option.RequestOption) (r *RuleService)

NewRuleService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*RuleService) Delete

func (r *RuleService) Delete(ctx context.Context, rulesetID string, ruleID string, body RuleDeleteParams, opts ...option.RequestOption) (res *RuleDeleteResponse, err error)

Deletes an existing rule from an account or zone ruleset.

func (*RuleService) Edit

func (r *RuleService) Edit(ctx context.Context, rulesetID string, ruleID string, params RuleEditParams, opts ...option.RequestOption) (res *RuleEditResponse, err error)

Updates an existing rule in an account or zone ruleset.

func (*RuleService) New

func (r *RuleService) New(ctx context.Context, rulesetID string, params RuleNewParams, opts ...option.RequestOption) (res *RuleNewResponse, err error)

Adds a new rule to an account or zone ruleset. The rule will be added to the end of the existing list of rules in the ruleset by default.

type RulesetDeleteParams

type RulesetDeleteParams 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.
	ZoneID param.Field[string] `path:"zone_id"`
}

type RulesetGetParams

type RulesetGetParams 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.
	ZoneID param.Field[string] `path:"zone_id"`
}

type RulesetGetResponse

type RulesetGetResponse struct {
	// The unique ID of the ruleset.
	ID string `json:"id,required"`
	// The kind of the ruleset.
	Kind Kind `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 Phase `json:"phase,required"`
	// The list of rules in the ruleset.
	Rules []RulesetGetResponseRule `json:"rules,required"`
	// The version of the ruleset.
	Version string `json:"version,required"`
	// An informative description of the ruleset.
	Description string                 `json:"description"`
	JSON        rulesetGetResponseJSON `json:"-"`
}

A ruleset object.

func (*RulesetGetResponse) UnmarshalJSON

func (r *RulesetGetResponse) UnmarshalJSON(data []byte) (err error)

type RulesetGetResponseEnvelope

type RulesetGetResponseEnvelope struct {
	// A list of error messages.
	Errors []RulesetGetResponseEnvelopeErrors `json:"errors,required"`
	// A list of warning messages.
	Messages []RulesetGetResponseEnvelopeMessages `json:"messages,required"`
	// A ruleset object.
	Result RulesetGetResponse `json:"result,required"`
	// Whether the API call was successful.
	Success RulesetGetResponseEnvelopeSuccess `json:"success,required"`
	JSON    rulesetGetResponseEnvelopeJSON    `json:"-"`
}

A response object.

func (*RulesetGetResponseEnvelope) UnmarshalJSON

func (r *RulesetGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type RulesetGetResponseEnvelopeErrors

type RulesetGetResponseEnvelopeErrors 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 RulesetGetResponseEnvelopeErrorsSource `json:"source"`
	JSON   rulesetGetResponseEnvelopeErrorsJSON   `json:"-"`
}

A message.

func (*RulesetGetResponseEnvelopeErrors) UnmarshalJSON

func (r *RulesetGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type RulesetGetResponseEnvelopeErrorsSource

type RulesetGetResponseEnvelopeErrorsSource struct {
	// A JSON pointer to the field that is the source of the message.
	Pointer string                                     `json:"pointer,required"`
	JSON    rulesetGetResponseEnvelopeErrorsSourceJSON `json:"-"`
}

The source of this message.

func (*RulesetGetResponseEnvelopeErrorsSource) UnmarshalJSON

func (r *RulesetGetResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error)

type RulesetGetResponseEnvelopeMessages

type RulesetGetResponseEnvelopeMessages 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 RulesetGetResponseEnvelopeMessagesSource `json:"source"`
	JSON   rulesetGetResponseEnvelopeMessagesJSON   `json:"-"`
}

A message.

func (*RulesetGetResponseEnvelopeMessages) UnmarshalJSON

func (r *RulesetGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type RulesetGetResponseEnvelopeMessagesSource

type RulesetGetResponseEnvelopeMessagesSource struct {
	// A JSON pointer to the field that is the source of the message.
	Pointer string                                       `json:"pointer,required"`
	JSON    rulesetGetResponseEnvelopeMessagesSourceJSON `json:"-"`
}

The source of this message.

func (*RulesetGetResponseEnvelopeMessagesSource) UnmarshalJSON

func (r *RulesetGetResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error)

type RulesetGetResponseEnvelopeSuccess

type RulesetGetResponseEnvelopeSuccess bool

Whether the API call was successful.

const (
	RulesetGetResponseEnvelopeSuccessTrue RulesetGetResponseEnvelopeSuccess = true
)

func (RulesetGetResponseEnvelopeSuccess) IsKnown

type RulesetGetResponseRule

type RulesetGetResponseRule struct {
	// The action to perform when the rule matches.
	Action RulesetGetResponseRulesAction `json:"action"`
	// This field can have the runtime type of [BlockRuleActionParameters],
	// [interface{}], [CompressResponseRuleActionParameters],
	// [ExecuteRuleActionParameters], [RedirectRuleActionParameters],
	// [RewriteRuleActionParameters], [RouteRuleActionParameters],
	// [ScoreRuleActionParameters], [ServeErrorRuleActionParameters],
	// [SetConfigRuleActionParameters], [SkipRuleActionParameters],
	// [SetCacheSettingsRuleActionParameters],
	// [RulesetGetResponseRulesRulesetsLogCustomFieldRuleActionParameters].
	ActionParameters interface{} `json:"action_parameters,required"`
	// This field can have the runtime type of [[]string].
	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 Logging `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:"-"`
	// contains filtered or unexported fields
}

func (*RulesetGetResponseRule) UnmarshalJSON

func (r *RulesetGetResponseRule) UnmarshalJSON(data []byte) (err error)

type RulesetGetResponseRulesAction

type RulesetGetResponseRulesAction string

The action to perform when the rule matches.

const (
	RulesetGetResponseRulesActionBlock                RulesetGetResponseRulesAction = "block"
	RulesetGetResponseRulesActionChallenge            RulesetGetResponseRulesAction = "challenge"
	RulesetGetResponseRulesActionCompressResponse     RulesetGetResponseRulesAction = "compress_response"
	RulesetGetResponseRulesActionExecute              RulesetGetResponseRulesAction = "execute"
	RulesetGetResponseRulesActionJSChallenge          RulesetGetResponseRulesAction = "js_challenge"
	RulesetGetResponseRulesActionLog                  RulesetGetResponseRulesAction = "log"
	RulesetGetResponseRulesActionManagedChallenge     RulesetGetResponseRulesAction = "managed_challenge"
	RulesetGetResponseRulesActionRedirect             RulesetGetResponseRulesAction = "redirect"
	RulesetGetResponseRulesActionRewrite              RulesetGetResponseRulesAction = "rewrite"
	RulesetGetResponseRulesActionRoute                RulesetGetResponseRulesAction = "route"
	RulesetGetResponseRulesActionScore                RulesetGetResponseRulesAction = "score"
	RulesetGetResponseRulesActionServeError           RulesetGetResponseRulesAction = "serve_error"
	RulesetGetResponseRulesActionSetConfig            RulesetGetResponseRulesAction = "set_config"
	RulesetGetResponseRulesActionSkip                 RulesetGetResponseRulesAction = "skip"
	RulesetGetResponseRulesActionSetCacheSettings     RulesetGetResponseRulesAction = "set_cache_settings"
	RulesetGetResponseRulesActionLogCustomField       RulesetGetResponseRulesAction = "log_custom_field"
	RulesetGetResponseRulesActionDDoSDynamic          RulesetGetResponseRulesAction = "ddos_dynamic"
	RulesetGetResponseRulesActionForceConnectionClose RulesetGetResponseRulesAction = "force_connection_close"
)

func (RulesetGetResponseRulesAction) IsKnown

func (r RulesetGetResponseRulesAction) IsKnown() bool

type RulesetGetResponseRulesRulesetsDDoSDynamicRule added in v2.3.0

type RulesetGetResponseRulesRulesetsDDoSDynamicRule 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 RulesetGetResponseRulesRulesetsDDoSDynamicRuleAction `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 Logging `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref  string                                             `json:"ref"`
	JSON rulesetGetResponseRulesRulesetsDDoSDynamicRuleJSON `json:"-"`
}

func (*RulesetGetResponseRulesRulesetsDDoSDynamicRule) UnmarshalJSON added in v2.3.0

func (r *RulesetGetResponseRulesRulesetsDDoSDynamicRule) UnmarshalJSON(data []byte) (err error)

type RulesetGetResponseRulesRulesetsDDoSDynamicRuleAction added in v2.3.0

type RulesetGetResponseRulesRulesetsDDoSDynamicRuleAction string

The action to perform when the rule matches.

const (
	RulesetGetResponseRulesRulesetsDDoSDynamicRuleActionDDoSDynamic RulesetGetResponseRulesRulesetsDDoSDynamicRuleAction = "ddos_dynamic"
)

func (RulesetGetResponseRulesRulesetsDDoSDynamicRuleAction) IsKnown added in v2.3.0

type RulesetGetResponseRulesRulesetsForceConnectionCloseRule added in v2.3.0

type RulesetGetResponseRulesRulesetsForceConnectionCloseRule 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 RulesetGetResponseRulesRulesetsForceConnectionCloseRuleAction `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 Logging `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref  string                                                      `json:"ref"`
	JSON rulesetGetResponseRulesRulesetsForceConnectionCloseRuleJSON `json:"-"`
}

func (*RulesetGetResponseRulesRulesetsForceConnectionCloseRule) UnmarshalJSON added in v2.3.0

type RulesetGetResponseRulesRulesetsForceConnectionCloseRuleAction added in v2.3.0

type RulesetGetResponseRulesRulesetsForceConnectionCloseRuleAction string

The action to perform when the rule matches.

const (
	RulesetGetResponseRulesRulesetsForceConnectionCloseRuleActionForceConnectionClose RulesetGetResponseRulesRulesetsForceConnectionCloseRuleAction = "force_connection_close"
)

func (RulesetGetResponseRulesRulesetsForceConnectionCloseRuleAction) IsKnown added in v2.3.0

type RulesetGetResponseRulesRulesetsLogCustomFieldRule added in v2.3.0

type RulesetGetResponseRulesRulesetsLogCustomFieldRule 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 RulesetGetResponseRulesRulesetsLogCustomFieldRuleAction `json:"action"`
	// The parameters configuring the rule's action.
	ActionParameters RulesetGetResponseRulesRulesetsLogCustomFieldRuleActionParameters `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 Logging `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref  string                                                `json:"ref"`
	JSON rulesetGetResponseRulesRulesetsLogCustomFieldRuleJSON `json:"-"`
}

func (*RulesetGetResponseRulesRulesetsLogCustomFieldRule) UnmarshalJSON added in v2.3.0

func (r *RulesetGetResponseRulesRulesetsLogCustomFieldRule) UnmarshalJSON(data []byte) (err error)

type RulesetGetResponseRulesRulesetsLogCustomFieldRuleAction added in v2.3.0

type RulesetGetResponseRulesRulesetsLogCustomFieldRuleAction string

The action to perform when the rule matches.

const (
	RulesetGetResponseRulesRulesetsLogCustomFieldRuleActionLogCustomField RulesetGetResponseRulesRulesetsLogCustomFieldRuleAction = "log_custom_field"
)

func (RulesetGetResponseRulesRulesetsLogCustomFieldRuleAction) IsKnown added in v2.3.0

type RulesetGetResponseRulesRulesetsLogCustomFieldRuleActionParameters added in v2.3.0

type RulesetGetResponseRulesRulesetsLogCustomFieldRuleActionParameters struct {
	// The cookie fields to log.
	CookieFields []RulesetGetResponseRulesRulesetsLogCustomFieldRuleActionParametersCookieField `json:"cookie_fields"`
	// The request fields to log.
	RequestFields []RulesetGetResponseRulesRulesetsLogCustomFieldRuleActionParametersRequestField `json:"request_fields"`
	// The response fields to log.
	ResponseFields []RulesetGetResponseRulesRulesetsLogCustomFieldRuleActionParametersResponseField `json:"response_fields"`
	JSON           rulesetGetResponseRulesRulesetsLogCustomFieldRuleActionParametersJSON            `json:"-"`
}

The parameters configuring the rule's action.

func (*RulesetGetResponseRulesRulesetsLogCustomFieldRuleActionParameters) UnmarshalJSON added in v2.3.0

type RulesetGetResponseRulesRulesetsLogCustomFieldRuleActionParametersCookieField added in v2.3.0

type RulesetGetResponseRulesRulesetsLogCustomFieldRuleActionParametersCookieField struct {
	// The name of the field.
	Name string                                                                           `json:"name,required"`
	JSON rulesetGetResponseRulesRulesetsLogCustomFieldRuleActionParametersCookieFieldJSON `json:"-"`
}

The cookie field to log.

func (*RulesetGetResponseRulesRulesetsLogCustomFieldRuleActionParametersCookieField) UnmarshalJSON added in v2.3.0

type RulesetGetResponseRulesRulesetsLogCustomFieldRuleActionParametersRequestField added in v2.3.0

type RulesetGetResponseRulesRulesetsLogCustomFieldRuleActionParametersRequestField struct {
	// The name of the field.
	Name string                                                                            `json:"name,required"`
	JSON rulesetGetResponseRulesRulesetsLogCustomFieldRuleActionParametersRequestFieldJSON `json:"-"`
}

The request field to log.

func (*RulesetGetResponseRulesRulesetsLogCustomFieldRuleActionParametersRequestField) UnmarshalJSON added in v2.3.0

type RulesetGetResponseRulesRulesetsLogCustomFieldRuleActionParametersResponseField added in v2.3.0

type RulesetGetResponseRulesRulesetsLogCustomFieldRuleActionParametersResponseField struct {
	// The name of the field.
	Name string                                                                             `json:"name,required"`
	JSON rulesetGetResponseRulesRulesetsLogCustomFieldRuleActionParametersResponseFieldJSON `json:"-"`
}

The response field to log.

func (*RulesetGetResponseRulesRulesetsLogCustomFieldRuleActionParametersResponseField) UnmarshalJSON added in v2.3.0

type RulesetListParams

type RulesetListParams 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.
	ZoneID param.Field[string] `path:"zone_id"`
}

type RulesetListResponse added in v2.3.0

type RulesetListResponse struct {
	// The unique ID of the ruleset.
	ID string `json:"id,required"`
	// The kind of the ruleset.
	Kind Kind `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 Phase `json:"phase,required"`
	// The version of the ruleset.
	Version string `json:"version,required"`
	// An informative description of the ruleset.
	Description string                  `json:"description"`
	JSON        rulesetListResponseJSON `json:"-"`
}

A ruleset object.

func (*RulesetListResponse) UnmarshalJSON added in v2.3.0

func (r *RulesetListResponse) UnmarshalJSON(data []byte) (err error)

type RulesetNewParams

type RulesetNewParams struct {
	// The kind of the ruleset.
	Kind param.Field[Kind] `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[Phase] `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 (RulesetNewParams) MarshalJSON

func (r RulesetNewParams) MarshalJSON() (data []byte, err error)

type RulesetNewParamsRule

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[LoggingParam] `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref param.Field[string] `json:"ref"`
}

func (RulesetNewParamsRule) MarshalJSON

func (r RulesetNewParamsRule) MarshalJSON() (data []byte, err error)

type RulesetNewParamsRulesAction

type RulesetNewParamsRulesAction string

The action to perform when the rule matches.

const (
	RulesetNewParamsRulesActionBlock                RulesetNewParamsRulesAction = "block"
	RulesetNewParamsRulesActionChallenge            RulesetNewParamsRulesAction = "challenge"
	RulesetNewParamsRulesActionCompressResponse     RulesetNewParamsRulesAction = "compress_response"
	RulesetNewParamsRulesActionExecute              RulesetNewParamsRulesAction = "execute"
	RulesetNewParamsRulesActionJSChallenge          RulesetNewParamsRulesAction = "js_challenge"
	RulesetNewParamsRulesActionLog                  RulesetNewParamsRulesAction = "log"
	RulesetNewParamsRulesActionManagedChallenge     RulesetNewParamsRulesAction = "managed_challenge"
	RulesetNewParamsRulesActionRedirect             RulesetNewParamsRulesAction = "redirect"
	RulesetNewParamsRulesActionRewrite              RulesetNewParamsRulesAction = "rewrite"
	RulesetNewParamsRulesActionRoute                RulesetNewParamsRulesAction = "route"
	RulesetNewParamsRulesActionScore                RulesetNewParamsRulesAction = "score"
	RulesetNewParamsRulesActionServeError           RulesetNewParamsRulesAction = "serve_error"
	RulesetNewParamsRulesActionSetConfig            RulesetNewParamsRulesAction = "set_config"
	RulesetNewParamsRulesActionSkip                 RulesetNewParamsRulesAction = "skip"
	RulesetNewParamsRulesActionSetCacheSettings     RulesetNewParamsRulesAction = "set_cache_settings"
	RulesetNewParamsRulesActionLogCustomField       RulesetNewParamsRulesAction = "log_custom_field"
	RulesetNewParamsRulesActionDDoSDynamic          RulesetNewParamsRulesAction = "ddos_dynamic"
	RulesetNewParamsRulesActionForceConnectionClose RulesetNewParamsRulesAction = "force_connection_close"
)

func (RulesetNewParamsRulesAction) IsKnown

func (r RulesetNewParamsRulesAction) IsKnown() bool

type RulesetNewParamsRulesRulesetsDDoSDynamicRule added in v2.3.0

type RulesetNewParamsRulesRulesetsDDoSDynamicRule struct {
	// The unique ID of the rule.
	ID param.Field[string] `json:"id"`
	// The action to perform when the rule matches.
	Action param.Field[RulesetNewParamsRulesRulesetsDDoSDynamicRuleAction] `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[LoggingParam] `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref param.Field[string] `json:"ref"`
}

func (RulesetNewParamsRulesRulesetsDDoSDynamicRule) MarshalJSON added in v2.3.0

func (r RulesetNewParamsRulesRulesetsDDoSDynamicRule) MarshalJSON() (data []byte, err error)

type RulesetNewParamsRulesRulesetsDDoSDynamicRuleAction added in v2.3.0

type RulesetNewParamsRulesRulesetsDDoSDynamicRuleAction string

The action to perform when the rule matches.

const (
	RulesetNewParamsRulesRulesetsDDoSDynamicRuleActionDDoSDynamic RulesetNewParamsRulesRulesetsDDoSDynamicRuleAction = "ddos_dynamic"
)

func (RulesetNewParamsRulesRulesetsDDoSDynamicRuleAction) IsKnown added in v2.3.0

type RulesetNewParamsRulesRulesetsForceConnectionCloseRule added in v2.3.0

type RulesetNewParamsRulesRulesetsForceConnectionCloseRule struct {
	// The unique ID of the rule.
	ID param.Field[string] `json:"id"`
	// The action to perform when the rule matches.
	Action param.Field[RulesetNewParamsRulesRulesetsForceConnectionCloseRuleAction] `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[LoggingParam] `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref param.Field[string] `json:"ref"`
}

func (RulesetNewParamsRulesRulesetsForceConnectionCloseRule) MarshalJSON added in v2.3.0

type RulesetNewParamsRulesRulesetsForceConnectionCloseRuleAction added in v2.3.0

type RulesetNewParamsRulesRulesetsForceConnectionCloseRuleAction string

The action to perform when the rule matches.

const (
	RulesetNewParamsRulesRulesetsForceConnectionCloseRuleActionForceConnectionClose RulesetNewParamsRulesRulesetsForceConnectionCloseRuleAction = "force_connection_close"
)

func (RulesetNewParamsRulesRulesetsForceConnectionCloseRuleAction) IsKnown added in v2.3.0

type RulesetNewParamsRulesRulesetsLogCustomFieldRule added in v2.3.0

type RulesetNewParamsRulesRulesetsLogCustomFieldRule struct {
	// The unique ID of the rule.
	ID param.Field[string] `json:"id"`
	// The action to perform when the rule matches.
	Action param.Field[RulesetNewParamsRulesRulesetsLogCustomFieldRuleAction] `json:"action"`
	// The parameters configuring the rule's action.
	ActionParameters param.Field[RulesetNewParamsRulesRulesetsLogCustomFieldRuleActionParameters] `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[LoggingParam] `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref param.Field[string] `json:"ref"`
}

func (RulesetNewParamsRulesRulesetsLogCustomFieldRule) MarshalJSON added in v2.3.0

func (r RulesetNewParamsRulesRulesetsLogCustomFieldRule) MarshalJSON() (data []byte, err error)

type RulesetNewParamsRulesRulesetsLogCustomFieldRuleAction added in v2.3.0

type RulesetNewParamsRulesRulesetsLogCustomFieldRuleAction string

The action to perform when the rule matches.

const (
	RulesetNewParamsRulesRulesetsLogCustomFieldRuleActionLogCustomField RulesetNewParamsRulesRulesetsLogCustomFieldRuleAction = "log_custom_field"
)

func (RulesetNewParamsRulesRulesetsLogCustomFieldRuleAction) IsKnown added in v2.3.0

type RulesetNewParamsRulesRulesetsLogCustomFieldRuleActionParameters added in v2.3.0

type RulesetNewParamsRulesRulesetsLogCustomFieldRuleActionParameters struct {
	// The cookie fields to log.
	CookieFields param.Field[[]RulesetNewParamsRulesRulesetsLogCustomFieldRuleActionParametersCookieField] `json:"cookie_fields"`
	// The request fields to log.
	RequestFields param.Field[[]RulesetNewParamsRulesRulesetsLogCustomFieldRuleActionParametersRequestField] `json:"request_fields"`
	// The response fields to log.
	ResponseFields param.Field[[]RulesetNewParamsRulesRulesetsLogCustomFieldRuleActionParametersResponseField] `json:"response_fields"`
}

The parameters configuring the rule's action.

func (RulesetNewParamsRulesRulesetsLogCustomFieldRuleActionParameters) MarshalJSON added in v2.3.0

type RulesetNewParamsRulesRulesetsLogCustomFieldRuleActionParametersCookieField added in v2.3.0

type RulesetNewParamsRulesRulesetsLogCustomFieldRuleActionParametersCookieField struct {
	// The name of the field.
	Name param.Field[string] `json:"name,required"`
}

The cookie field to log.

func (RulesetNewParamsRulesRulesetsLogCustomFieldRuleActionParametersCookieField) MarshalJSON added in v2.3.0

type RulesetNewParamsRulesRulesetsLogCustomFieldRuleActionParametersRequestField added in v2.3.0

type RulesetNewParamsRulesRulesetsLogCustomFieldRuleActionParametersRequestField struct {
	// The name of the field.
	Name param.Field[string] `json:"name,required"`
}

The request field to log.

func (RulesetNewParamsRulesRulesetsLogCustomFieldRuleActionParametersRequestField) MarshalJSON added in v2.3.0

type RulesetNewParamsRulesRulesetsLogCustomFieldRuleActionParametersResponseField added in v2.3.0

type RulesetNewParamsRulesRulesetsLogCustomFieldRuleActionParametersResponseField struct {
	// The name of the field.
	Name param.Field[string] `json:"name,required"`
}

The response field to log.

func (RulesetNewParamsRulesRulesetsLogCustomFieldRuleActionParametersResponseField) MarshalJSON added in v2.3.0

type RulesetNewResponse

type RulesetNewResponse struct {
	// The unique ID of the ruleset.
	ID string `json:"id,required"`
	// The kind of the ruleset.
	Kind Kind `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 Phase `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:"-"`
}

A ruleset object.

func (*RulesetNewResponse) UnmarshalJSON

func (r *RulesetNewResponse) UnmarshalJSON(data []byte) (err error)

type RulesetNewResponseEnvelope

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:"-"`
}

A response object.

func (*RulesetNewResponseEnvelope) UnmarshalJSON

func (r *RulesetNewResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type RulesetNewResponseEnvelopeErrors

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:"-"`
}

A message.

func (*RulesetNewResponseEnvelopeErrors) UnmarshalJSON

func (r *RulesetNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type RulesetNewResponseEnvelopeErrorsSource

type RulesetNewResponseEnvelopeErrorsSource struct {
	// A JSON pointer to the field that is the source of the message.
	Pointer string                                     `json:"pointer,required"`
	JSON    rulesetNewResponseEnvelopeErrorsSourceJSON `json:"-"`
}

The source of this message.

func (*RulesetNewResponseEnvelopeErrorsSource) UnmarshalJSON

func (r *RulesetNewResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error)

type RulesetNewResponseEnvelopeMessages

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:"-"`
}

A message.

func (*RulesetNewResponseEnvelopeMessages) UnmarshalJSON

func (r *RulesetNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type RulesetNewResponseEnvelopeMessagesSource

type RulesetNewResponseEnvelopeMessagesSource struct {
	// A JSON pointer to the field that is the source of the message.
	Pointer string                                       `json:"pointer,required"`
	JSON    rulesetNewResponseEnvelopeMessagesSourceJSON `json:"-"`
}

The source of this message.

func (*RulesetNewResponseEnvelopeMessagesSource) UnmarshalJSON

func (r *RulesetNewResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error)

type RulesetNewResponseEnvelopeSuccess

type RulesetNewResponseEnvelopeSuccess bool

Whether the API call was successful.

const (
	RulesetNewResponseEnvelopeSuccessTrue RulesetNewResponseEnvelopeSuccess = true
)

func (RulesetNewResponseEnvelopeSuccess) IsKnown

type RulesetNewResponseRule

type RulesetNewResponseRule struct {
	// The action to perform when the rule matches.
	Action RulesetNewResponseRulesAction `json:"action"`
	// This field can have the runtime type of [BlockRuleActionParameters],
	// [interface{}], [CompressResponseRuleActionParameters],
	// [ExecuteRuleActionParameters], [RedirectRuleActionParameters],
	// [RewriteRuleActionParameters], [RouteRuleActionParameters],
	// [ScoreRuleActionParameters], [ServeErrorRuleActionParameters],
	// [SetConfigRuleActionParameters], [SkipRuleActionParameters],
	// [SetCacheSettingsRuleActionParameters],
	// [RulesetNewResponseRulesRulesetsLogCustomFieldRuleActionParameters].
	ActionParameters interface{} `json:"action_parameters,required"`
	// This field can have the runtime type of [[]string].
	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 Logging `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:"-"`
	// contains filtered or unexported fields
}

func (*RulesetNewResponseRule) UnmarshalJSON

func (r *RulesetNewResponseRule) UnmarshalJSON(data []byte) (err error)

type RulesetNewResponseRulesAction

type RulesetNewResponseRulesAction string

The action to perform when the rule matches.

const (
	RulesetNewResponseRulesActionBlock                RulesetNewResponseRulesAction = "block"
	RulesetNewResponseRulesActionChallenge            RulesetNewResponseRulesAction = "challenge"
	RulesetNewResponseRulesActionCompressResponse     RulesetNewResponseRulesAction = "compress_response"
	RulesetNewResponseRulesActionExecute              RulesetNewResponseRulesAction = "execute"
	RulesetNewResponseRulesActionJSChallenge          RulesetNewResponseRulesAction = "js_challenge"
	RulesetNewResponseRulesActionLog                  RulesetNewResponseRulesAction = "log"
	RulesetNewResponseRulesActionManagedChallenge     RulesetNewResponseRulesAction = "managed_challenge"
	RulesetNewResponseRulesActionRedirect             RulesetNewResponseRulesAction = "redirect"
	RulesetNewResponseRulesActionRewrite              RulesetNewResponseRulesAction = "rewrite"
	RulesetNewResponseRulesActionRoute                RulesetNewResponseRulesAction = "route"
	RulesetNewResponseRulesActionScore                RulesetNewResponseRulesAction = "score"
	RulesetNewResponseRulesActionServeError           RulesetNewResponseRulesAction = "serve_error"
	RulesetNewResponseRulesActionSetConfig            RulesetNewResponseRulesAction = "set_config"
	RulesetNewResponseRulesActionSkip                 RulesetNewResponseRulesAction = "skip"
	RulesetNewResponseRulesActionSetCacheSettings     RulesetNewResponseRulesAction = "set_cache_settings"
	RulesetNewResponseRulesActionLogCustomField       RulesetNewResponseRulesAction = "log_custom_field"
	RulesetNewResponseRulesActionDDoSDynamic          RulesetNewResponseRulesAction = "ddos_dynamic"
	RulesetNewResponseRulesActionForceConnectionClose RulesetNewResponseRulesAction = "force_connection_close"
)

func (RulesetNewResponseRulesAction) IsKnown

func (r RulesetNewResponseRulesAction) IsKnown() bool

type RulesetNewResponseRulesRulesetsDDoSDynamicRule added in v2.3.0

type RulesetNewResponseRulesRulesetsDDoSDynamicRule 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 RulesetNewResponseRulesRulesetsDDoSDynamicRuleAction `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 Logging `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref  string                                             `json:"ref"`
	JSON rulesetNewResponseRulesRulesetsDDoSDynamicRuleJSON `json:"-"`
}

func (*RulesetNewResponseRulesRulesetsDDoSDynamicRule) UnmarshalJSON added in v2.3.0

func (r *RulesetNewResponseRulesRulesetsDDoSDynamicRule) UnmarshalJSON(data []byte) (err error)

type RulesetNewResponseRulesRulesetsDDoSDynamicRuleAction added in v2.3.0

type RulesetNewResponseRulesRulesetsDDoSDynamicRuleAction string

The action to perform when the rule matches.

const (
	RulesetNewResponseRulesRulesetsDDoSDynamicRuleActionDDoSDynamic RulesetNewResponseRulesRulesetsDDoSDynamicRuleAction = "ddos_dynamic"
)

func (RulesetNewResponseRulesRulesetsDDoSDynamicRuleAction) IsKnown added in v2.3.0

type RulesetNewResponseRulesRulesetsForceConnectionCloseRule added in v2.3.0

type RulesetNewResponseRulesRulesetsForceConnectionCloseRule 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 RulesetNewResponseRulesRulesetsForceConnectionCloseRuleAction `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 Logging `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref  string                                                      `json:"ref"`
	JSON rulesetNewResponseRulesRulesetsForceConnectionCloseRuleJSON `json:"-"`
}

func (*RulesetNewResponseRulesRulesetsForceConnectionCloseRule) UnmarshalJSON added in v2.3.0

type RulesetNewResponseRulesRulesetsForceConnectionCloseRuleAction added in v2.3.0

type RulesetNewResponseRulesRulesetsForceConnectionCloseRuleAction string

The action to perform when the rule matches.

const (
	RulesetNewResponseRulesRulesetsForceConnectionCloseRuleActionForceConnectionClose RulesetNewResponseRulesRulesetsForceConnectionCloseRuleAction = "force_connection_close"
)

func (RulesetNewResponseRulesRulesetsForceConnectionCloseRuleAction) IsKnown added in v2.3.0

type RulesetNewResponseRulesRulesetsLogCustomFieldRule added in v2.3.0

type RulesetNewResponseRulesRulesetsLogCustomFieldRule 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 RulesetNewResponseRulesRulesetsLogCustomFieldRuleAction `json:"action"`
	// The parameters configuring the rule's action.
	ActionParameters RulesetNewResponseRulesRulesetsLogCustomFieldRuleActionParameters `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 Logging `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref  string                                                `json:"ref"`
	JSON rulesetNewResponseRulesRulesetsLogCustomFieldRuleJSON `json:"-"`
}

func (*RulesetNewResponseRulesRulesetsLogCustomFieldRule) UnmarshalJSON added in v2.3.0

func (r *RulesetNewResponseRulesRulesetsLogCustomFieldRule) UnmarshalJSON(data []byte) (err error)

type RulesetNewResponseRulesRulesetsLogCustomFieldRuleAction added in v2.3.0

type RulesetNewResponseRulesRulesetsLogCustomFieldRuleAction string

The action to perform when the rule matches.

const (
	RulesetNewResponseRulesRulesetsLogCustomFieldRuleActionLogCustomField RulesetNewResponseRulesRulesetsLogCustomFieldRuleAction = "log_custom_field"
)

func (RulesetNewResponseRulesRulesetsLogCustomFieldRuleAction) IsKnown added in v2.3.0

type RulesetNewResponseRulesRulesetsLogCustomFieldRuleActionParameters added in v2.3.0

type RulesetNewResponseRulesRulesetsLogCustomFieldRuleActionParameters struct {
	// The cookie fields to log.
	CookieFields []RulesetNewResponseRulesRulesetsLogCustomFieldRuleActionParametersCookieField `json:"cookie_fields"`
	// The request fields to log.
	RequestFields []RulesetNewResponseRulesRulesetsLogCustomFieldRuleActionParametersRequestField `json:"request_fields"`
	// The response fields to log.
	ResponseFields []RulesetNewResponseRulesRulesetsLogCustomFieldRuleActionParametersResponseField `json:"response_fields"`
	JSON           rulesetNewResponseRulesRulesetsLogCustomFieldRuleActionParametersJSON            `json:"-"`
}

The parameters configuring the rule's action.

func (*RulesetNewResponseRulesRulesetsLogCustomFieldRuleActionParameters) UnmarshalJSON added in v2.3.0

type RulesetNewResponseRulesRulesetsLogCustomFieldRuleActionParametersCookieField added in v2.3.0

type RulesetNewResponseRulesRulesetsLogCustomFieldRuleActionParametersCookieField struct {
	// The name of the field.
	Name string                                                                           `json:"name,required"`
	JSON rulesetNewResponseRulesRulesetsLogCustomFieldRuleActionParametersCookieFieldJSON `json:"-"`
}

The cookie field to log.

func (*RulesetNewResponseRulesRulesetsLogCustomFieldRuleActionParametersCookieField) UnmarshalJSON added in v2.3.0

type RulesetNewResponseRulesRulesetsLogCustomFieldRuleActionParametersRequestField added in v2.3.0

type RulesetNewResponseRulesRulesetsLogCustomFieldRuleActionParametersRequestField struct {
	// The name of the field.
	Name string                                                                            `json:"name,required"`
	JSON rulesetNewResponseRulesRulesetsLogCustomFieldRuleActionParametersRequestFieldJSON `json:"-"`
}

The request field to log.

func (*RulesetNewResponseRulesRulesetsLogCustomFieldRuleActionParametersRequestField) UnmarshalJSON added in v2.3.0

type RulesetNewResponseRulesRulesetsLogCustomFieldRuleActionParametersResponseField added in v2.3.0

type RulesetNewResponseRulesRulesetsLogCustomFieldRuleActionParametersResponseField struct {
	// The name of the field.
	Name string                                                                             `json:"name,required"`
	JSON rulesetNewResponseRulesRulesetsLogCustomFieldRuleActionParametersResponseFieldJSON `json:"-"`
}

The response field to log.

func (*RulesetNewResponseRulesRulesetsLogCustomFieldRuleActionParametersResponseField) UnmarshalJSON added in v2.3.0

type RulesetService

type RulesetService struct {
	Options  []option.RequestOption
	Phases   *PhaseService
	Rules    *RuleService
	Versions *VersionService
}

RulesetService contains methods and other services that help with interacting with the cloudflare API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewRulesetService method instead.

func NewRulesetService

func NewRulesetService(opts ...option.RequestOption) (r *RulesetService)

NewRulesetService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*RulesetService) Delete

func (r *RulesetService) Delete(ctx context.Context, rulesetID string, body RulesetDeleteParams, opts ...option.RequestOption) (err error)

Deletes all versions of an existing account or zone ruleset.

func (*RulesetService) Get

func (r *RulesetService) Get(ctx context.Context, rulesetID string, query RulesetGetParams, opts ...option.RequestOption) (res *RulesetGetResponse, err error)

Fetches the latest version of an account or zone ruleset.

func (*RulesetService) List

Fetches all rulesets.

func (*RulesetService) ListAutoPaging

Fetches all rulesets.

func (*RulesetService) New

Creates a ruleset.

func (*RulesetService) Update

func (r *RulesetService) Update(ctx context.Context, rulesetID string, params RulesetUpdateParams, opts ...option.RequestOption) (res *RulesetUpdateResponse, err error)

Updates an account or zone ruleset, creating a new version.

type RulesetUpdateParams

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[Kind] `json:"kind"`
	// The human-readable name of the ruleset.
	Name param.Field[string] `json:"name"`
	// The phase of the ruleset.
	Phase param.Field[Phase] `json:"phase"`
}

func (RulesetUpdateParams) MarshalJSON

func (r RulesetUpdateParams) MarshalJSON() (data []byte, err error)

type RulesetUpdateParamsRule

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[LoggingParam] `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref param.Field[string] `json:"ref"`
}

func (RulesetUpdateParamsRule) MarshalJSON

func (r RulesetUpdateParamsRule) MarshalJSON() (data []byte, err error)

type RulesetUpdateParamsRulesAction

type RulesetUpdateParamsRulesAction string

The action to perform when the rule matches.

const (
	RulesetUpdateParamsRulesActionBlock                RulesetUpdateParamsRulesAction = "block"
	RulesetUpdateParamsRulesActionChallenge            RulesetUpdateParamsRulesAction = "challenge"
	RulesetUpdateParamsRulesActionCompressResponse     RulesetUpdateParamsRulesAction = "compress_response"
	RulesetUpdateParamsRulesActionExecute              RulesetUpdateParamsRulesAction = "execute"
	RulesetUpdateParamsRulesActionJSChallenge          RulesetUpdateParamsRulesAction = "js_challenge"
	RulesetUpdateParamsRulesActionLog                  RulesetUpdateParamsRulesAction = "log"
	RulesetUpdateParamsRulesActionManagedChallenge     RulesetUpdateParamsRulesAction = "managed_challenge"
	RulesetUpdateParamsRulesActionRedirect             RulesetUpdateParamsRulesAction = "redirect"
	RulesetUpdateParamsRulesActionRewrite              RulesetUpdateParamsRulesAction = "rewrite"
	RulesetUpdateParamsRulesActionRoute                RulesetUpdateParamsRulesAction = "route"
	RulesetUpdateParamsRulesActionScore                RulesetUpdateParamsRulesAction = "score"
	RulesetUpdateParamsRulesActionServeError           RulesetUpdateParamsRulesAction = "serve_error"
	RulesetUpdateParamsRulesActionSetConfig            RulesetUpdateParamsRulesAction = "set_config"
	RulesetUpdateParamsRulesActionSkip                 RulesetUpdateParamsRulesAction = "skip"
	RulesetUpdateParamsRulesActionSetCacheSettings     RulesetUpdateParamsRulesAction = "set_cache_settings"
	RulesetUpdateParamsRulesActionLogCustomField       RulesetUpdateParamsRulesAction = "log_custom_field"
	RulesetUpdateParamsRulesActionDDoSDynamic          RulesetUpdateParamsRulesAction = "ddos_dynamic"
	RulesetUpdateParamsRulesActionForceConnectionClose RulesetUpdateParamsRulesAction = "force_connection_close"
)

func (RulesetUpdateParamsRulesAction) IsKnown

type RulesetUpdateParamsRulesRulesetsDDoSDynamicRule added in v2.3.0

type RulesetUpdateParamsRulesRulesetsDDoSDynamicRule struct {
	// The unique ID of the rule.
	ID param.Field[string] `json:"id"`
	// The action to perform when the rule matches.
	Action param.Field[RulesetUpdateParamsRulesRulesetsDDoSDynamicRuleAction] `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[LoggingParam] `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref param.Field[string] `json:"ref"`
}

func (RulesetUpdateParamsRulesRulesetsDDoSDynamicRule) MarshalJSON added in v2.3.0

func (r RulesetUpdateParamsRulesRulesetsDDoSDynamicRule) MarshalJSON() (data []byte, err error)

type RulesetUpdateParamsRulesRulesetsDDoSDynamicRuleAction added in v2.3.0

type RulesetUpdateParamsRulesRulesetsDDoSDynamicRuleAction string

The action to perform when the rule matches.

const (
	RulesetUpdateParamsRulesRulesetsDDoSDynamicRuleActionDDoSDynamic RulesetUpdateParamsRulesRulesetsDDoSDynamicRuleAction = "ddos_dynamic"
)

func (RulesetUpdateParamsRulesRulesetsDDoSDynamicRuleAction) IsKnown added in v2.3.0

type RulesetUpdateParamsRulesRulesetsForceConnectionCloseRule added in v2.3.0

type RulesetUpdateParamsRulesRulesetsForceConnectionCloseRule struct {
	// The unique ID of the rule.
	ID param.Field[string] `json:"id"`
	// The action to perform when the rule matches.
	Action param.Field[RulesetUpdateParamsRulesRulesetsForceConnectionCloseRuleAction] `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[LoggingParam] `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref param.Field[string] `json:"ref"`
}

func (RulesetUpdateParamsRulesRulesetsForceConnectionCloseRule) MarshalJSON added in v2.3.0

type RulesetUpdateParamsRulesRulesetsForceConnectionCloseRuleAction added in v2.3.0

type RulesetUpdateParamsRulesRulesetsForceConnectionCloseRuleAction string

The action to perform when the rule matches.

const (
	RulesetUpdateParamsRulesRulesetsForceConnectionCloseRuleActionForceConnectionClose RulesetUpdateParamsRulesRulesetsForceConnectionCloseRuleAction = "force_connection_close"
)

func (RulesetUpdateParamsRulesRulesetsForceConnectionCloseRuleAction) IsKnown added in v2.3.0

type RulesetUpdateParamsRulesRulesetsLogCustomFieldRule added in v2.3.0

type RulesetUpdateParamsRulesRulesetsLogCustomFieldRule struct {
	// The unique ID of the rule.
	ID param.Field[string] `json:"id"`
	// The action to perform when the rule matches.
	Action param.Field[RulesetUpdateParamsRulesRulesetsLogCustomFieldRuleAction] `json:"action"`
	// The parameters configuring the rule's action.
	ActionParameters param.Field[RulesetUpdateParamsRulesRulesetsLogCustomFieldRuleActionParameters] `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[LoggingParam] `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref param.Field[string] `json:"ref"`
}

func (RulesetUpdateParamsRulesRulesetsLogCustomFieldRule) MarshalJSON added in v2.3.0

func (r RulesetUpdateParamsRulesRulesetsLogCustomFieldRule) MarshalJSON() (data []byte, err error)

type RulesetUpdateParamsRulesRulesetsLogCustomFieldRuleAction added in v2.3.0

type RulesetUpdateParamsRulesRulesetsLogCustomFieldRuleAction string

The action to perform when the rule matches.

const (
	RulesetUpdateParamsRulesRulesetsLogCustomFieldRuleActionLogCustomField RulesetUpdateParamsRulesRulesetsLogCustomFieldRuleAction = "log_custom_field"
)

func (RulesetUpdateParamsRulesRulesetsLogCustomFieldRuleAction) IsKnown added in v2.3.0

type RulesetUpdateParamsRulesRulesetsLogCustomFieldRuleActionParameters added in v2.3.0

type RulesetUpdateParamsRulesRulesetsLogCustomFieldRuleActionParameters struct {
	// The cookie fields to log.
	CookieFields param.Field[[]RulesetUpdateParamsRulesRulesetsLogCustomFieldRuleActionParametersCookieField] `json:"cookie_fields"`
	// The request fields to log.
	RequestFields param.Field[[]RulesetUpdateParamsRulesRulesetsLogCustomFieldRuleActionParametersRequestField] `json:"request_fields"`
	// The response fields to log.
	ResponseFields param.Field[[]RulesetUpdateParamsRulesRulesetsLogCustomFieldRuleActionParametersResponseField] `json:"response_fields"`
}

The parameters configuring the rule's action.

func (RulesetUpdateParamsRulesRulesetsLogCustomFieldRuleActionParameters) MarshalJSON added in v2.3.0

type RulesetUpdateParamsRulesRulesetsLogCustomFieldRuleActionParametersCookieField added in v2.3.0

type RulesetUpdateParamsRulesRulesetsLogCustomFieldRuleActionParametersCookieField struct {
	// The name of the field.
	Name param.Field[string] `json:"name,required"`
}

The cookie field to log.

func (RulesetUpdateParamsRulesRulesetsLogCustomFieldRuleActionParametersCookieField) MarshalJSON added in v2.3.0

type RulesetUpdateParamsRulesRulesetsLogCustomFieldRuleActionParametersRequestField added in v2.3.0

type RulesetUpdateParamsRulesRulesetsLogCustomFieldRuleActionParametersRequestField struct {
	// The name of the field.
	Name param.Field[string] `json:"name,required"`
}

The request field to log.

func (RulesetUpdateParamsRulesRulesetsLogCustomFieldRuleActionParametersRequestField) MarshalJSON added in v2.3.0

type RulesetUpdateParamsRulesRulesetsLogCustomFieldRuleActionParametersResponseField added in v2.3.0

type RulesetUpdateParamsRulesRulesetsLogCustomFieldRuleActionParametersResponseField struct {
	// The name of the field.
	Name param.Field[string] `json:"name,required"`
}

The response field to log.

func (RulesetUpdateParamsRulesRulesetsLogCustomFieldRuleActionParametersResponseField) MarshalJSON added in v2.3.0

type RulesetUpdateResponse

type RulesetUpdateResponse struct {
	// The unique ID of the ruleset.
	ID string `json:"id,required"`
	// The kind of the ruleset.
	Kind Kind `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 Phase `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:"-"`
}

A ruleset object.

func (*RulesetUpdateResponse) UnmarshalJSON

func (r *RulesetUpdateResponse) UnmarshalJSON(data []byte) (err error)

type RulesetUpdateResponseEnvelope

type RulesetUpdateResponseEnvelope struct {
	// A list of error messages.
	Errors []RulesetUpdateResponseEnvelopeErrors `json:"errors,required"`
	// A list of warning messages.
	Messages []RulesetUpdateResponseEnvelopeMessages `json:"messages,required"`
	// A ruleset object.
	Result RulesetUpdateResponse `json:"result,required"`
	// Whether the API call was successful.
	Success RulesetUpdateResponseEnvelopeSuccess `json:"success,required"`
	JSON    rulesetUpdateResponseEnvelopeJSON    `json:"-"`
}

A response object.

func (*RulesetUpdateResponseEnvelope) UnmarshalJSON

func (r *RulesetUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type RulesetUpdateResponseEnvelopeErrors

type RulesetUpdateResponseEnvelopeErrors 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 RulesetUpdateResponseEnvelopeErrorsSource `json:"source"`
	JSON   rulesetUpdateResponseEnvelopeErrorsJSON   `json:"-"`
}

A message.

func (*RulesetUpdateResponseEnvelopeErrors) UnmarshalJSON

func (r *RulesetUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type RulesetUpdateResponseEnvelopeErrorsSource

type RulesetUpdateResponseEnvelopeErrorsSource struct {
	// A JSON pointer to the field that is the source of the message.
	Pointer string                                        `json:"pointer,required"`
	JSON    rulesetUpdateResponseEnvelopeErrorsSourceJSON `json:"-"`
}

The source of this message.

func (*RulesetUpdateResponseEnvelopeErrorsSource) UnmarshalJSON

func (r *RulesetUpdateResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error)

type RulesetUpdateResponseEnvelopeMessages

type RulesetUpdateResponseEnvelopeMessages 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 RulesetUpdateResponseEnvelopeMessagesSource `json:"source"`
	JSON   rulesetUpdateResponseEnvelopeMessagesJSON   `json:"-"`
}

A message.

func (*RulesetUpdateResponseEnvelopeMessages) UnmarshalJSON

func (r *RulesetUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type RulesetUpdateResponseEnvelopeMessagesSource

type RulesetUpdateResponseEnvelopeMessagesSource struct {
	// A JSON pointer to the field that is the source of the message.
	Pointer string                                          `json:"pointer,required"`
	JSON    rulesetUpdateResponseEnvelopeMessagesSourceJSON `json:"-"`
}

The source of this message.

func (*RulesetUpdateResponseEnvelopeMessagesSource) UnmarshalJSON

func (r *RulesetUpdateResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error)

type RulesetUpdateResponseEnvelopeSuccess

type RulesetUpdateResponseEnvelopeSuccess bool

Whether the API call was successful.

const (
	RulesetUpdateResponseEnvelopeSuccessTrue RulesetUpdateResponseEnvelopeSuccess = true
)

func (RulesetUpdateResponseEnvelopeSuccess) IsKnown

type RulesetUpdateResponseRule

type RulesetUpdateResponseRule struct {
	// The action to perform when the rule matches.
	Action RulesetUpdateResponseRulesAction `json:"action"`
	// This field can have the runtime type of [BlockRuleActionParameters],
	// [interface{}], [CompressResponseRuleActionParameters],
	// [ExecuteRuleActionParameters], [RedirectRuleActionParameters],
	// [RewriteRuleActionParameters], [RouteRuleActionParameters],
	// [ScoreRuleActionParameters], [ServeErrorRuleActionParameters],
	// [SetConfigRuleActionParameters], [SkipRuleActionParameters],
	// [SetCacheSettingsRuleActionParameters],
	// [RulesetUpdateResponseRulesRulesetsLogCustomFieldRuleActionParameters].
	ActionParameters interface{} `json:"action_parameters,required"`
	// This field can have the runtime type of [[]string].
	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 Logging `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:"-"`
	// contains filtered or unexported fields
}

func (*RulesetUpdateResponseRule) UnmarshalJSON

func (r *RulesetUpdateResponseRule) UnmarshalJSON(data []byte) (err error)

type RulesetUpdateResponseRulesAction

type RulesetUpdateResponseRulesAction string

The action to perform when the rule matches.

const (
	RulesetUpdateResponseRulesActionBlock                RulesetUpdateResponseRulesAction = "block"
	RulesetUpdateResponseRulesActionChallenge            RulesetUpdateResponseRulesAction = "challenge"
	RulesetUpdateResponseRulesActionCompressResponse     RulesetUpdateResponseRulesAction = "compress_response"
	RulesetUpdateResponseRulesActionExecute              RulesetUpdateResponseRulesAction = "execute"
	RulesetUpdateResponseRulesActionJSChallenge          RulesetUpdateResponseRulesAction = "js_challenge"
	RulesetUpdateResponseRulesActionLog                  RulesetUpdateResponseRulesAction = "log"
	RulesetUpdateResponseRulesActionManagedChallenge     RulesetUpdateResponseRulesAction = "managed_challenge"
	RulesetUpdateResponseRulesActionRedirect             RulesetUpdateResponseRulesAction = "redirect"
	RulesetUpdateResponseRulesActionRewrite              RulesetUpdateResponseRulesAction = "rewrite"
	RulesetUpdateResponseRulesActionRoute                RulesetUpdateResponseRulesAction = "route"
	RulesetUpdateResponseRulesActionScore                RulesetUpdateResponseRulesAction = "score"
	RulesetUpdateResponseRulesActionServeError           RulesetUpdateResponseRulesAction = "serve_error"
	RulesetUpdateResponseRulesActionSetConfig            RulesetUpdateResponseRulesAction = "set_config"
	RulesetUpdateResponseRulesActionSkip                 RulesetUpdateResponseRulesAction = "skip"
	RulesetUpdateResponseRulesActionSetCacheSettings     RulesetUpdateResponseRulesAction = "set_cache_settings"
	RulesetUpdateResponseRulesActionLogCustomField       RulesetUpdateResponseRulesAction = "log_custom_field"
	RulesetUpdateResponseRulesActionDDoSDynamic          RulesetUpdateResponseRulesAction = "ddos_dynamic"
	RulesetUpdateResponseRulesActionForceConnectionClose RulesetUpdateResponseRulesAction = "force_connection_close"
)

func (RulesetUpdateResponseRulesAction) IsKnown

type RulesetUpdateResponseRulesRulesetsDDoSDynamicRule added in v2.3.0

type RulesetUpdateResponseRulesRulesetsDDoSDynamicRule 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 RulesetUpdateResponseRulesRulesetsDDoSDynamicRuleAction `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 Logging `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref  string                                                `json:"ref"`
	JSON rulesetUpdateResponseRulesRulesetsDDoSDynamicRuleJSON `json:"-"`
}

func (*RulesetUpdateResponseRulesRulesetsDDoSDynamicRule) UnmarshalJSON added in v2.3.0

func (r *RulesetUpdateResponseRulesRulesetsDDoSDynamicRule) UnmarshalJSON(data []byte) (err error)

type RulesetUpdateResponseRulesRulesetsDDoSDynamicRuleAction added in v2.3.0

type RulesetUpdateResponseRulesRulesetsDDoSDynamicRuleAction string

The action to perform when the rule matches.

const (
	RulesetUpdateResponseRulesRulesetsDDoSDynamicRuleActionDDoSDynamic RulesetUpdateResponseRulesRulesetsDDoSDynamicRuleAction = "ddos_dynamic"
)

func (RulesetUpdateResponseRulesRulesetsDDoSDynamicRuleAction) IsKnown added in v2.3.0

type RulesetUpdateResponseRulesRulesetsForceConnectionCloseRule added in v2.3.0

type RulesetUpdateResponseRulesRulesetsForceConnectionCloseRule 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 RulesetUpdateResponseRulesRulesetsForceConnectionCloseRuleAction `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 Logging `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref  string                                                         `json:"ref"`
	JSON rulesetUpdateResponseRulesRulesetsForceConnectionCloseRuleJSON `json:"-"`
}

func (*RulesetUpdateResponseRulesRulesetsForceConnectionCloseRule) UnmarshalJSON added in v2.3.0

type RulesetUpdateResponseRulesRulesetsForceConnectionCloseRuleAction added in v2.3.0

type RulesetUpdateResponseRulesRulesetsForceConnectionCloseRuleAction string

The action to perform when the rule matches.

const (
	RulesetUpdateResponseRulesRulesetsForceConnectionCloseRuleActionForceConnectionClose RulesetUpdateResponseRulesRulesetsForceConnectionCloseRuleAction = "force_connection_close"
)

func (RulesetUpdateResponseRulesRulesetsForceConnectionCloseRuleAction) IsKnown added in v2.3.0

type RulesetUpdateResponseRulesRulesetsLogCustomFieldRule added in v2.3.0

type RulesetUpdateResponseRulesRulesetsLogCustomFieldRule 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 RulesetUpdateResponseRulesRulesetsLogCustomFieldRuleAction `json:"action"`
	// The parameters configuring the rule's action.
	ActionParameters RulesetUpdateResponseRulesRulesetsLogCustomFieldRuleActionParameters `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 Logging `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref  string                                                   `json:"ref"`
	JSON rulesetUpdateResponseRulesRulesetsLogCustomFieldRuleJSON `json:"-"`
}

func (*RulesetUpdateResponseRulesRulesetsLogCustomFieldRule) UnmarshalJSON added in v2.3.0

func (r *RulesetUpdateResponseRulesRulesetsLogCustomFieldRule) UnmarshalJSON(data []byte) (err error)

type RulesetUpdateResponseRulesRulesetsLogCustomFieldRuleAction added in v2.3.0

type RulesetUpdateResponseRulesRulesetsLogCustomFieldRuleAction string

The action to perform when the rule matches.

const (
	RulesetUpdateResponseRulesRulesetsLogCustomFieldRuleActionLogCustomField RulesetUpdateResponseRulesRulesetsLogCustomFieldRuleAction = "log_custom_field"
)

func (RulesetUpdateResponseRulesRulesetsLogCustomFieldRuleAction) IsKnown added in v2.3.0

type RulesetUpdateResponseRulesRulesetsLogCustomFieldRuleActionParameters added in v2.3.0

type RulesetUpdateResponseRulesRulesetsLogCustomFieldRuleActionParameters struct {
	// The cookie fields to log.
	CookieFields []RulesetUpdateResponseRulesRulesetsLogCustomFieldRuleActionParametersCookieField `json:"cookie_fields"`
	// The request fields to log.
	RequestFields []RulesetUpdateResponseRulesRulesetsLogCustomFieldRuleActionParametersRequestField `json:"request_fields"`
	// The response fields to log.
	ResponseFields []RulesetUpdateResponseRulesRulesetsLogCustomFieldRuleActionParametersResponseField `json:"response_fields"`
	JSON           rulesetUpdateResponseRulesRulesetsLogCustomFieldRuleActionParametersJSON            `json:"-"`
}

The parameters configuring the rule's action.

func (*RulesetUpdateResponseRulesRulesetsLogCustomFieldRuleActionParameters) UnmarshalJSON added in v2.3.0

type RulesetUpdateResponseRulesRulesetsLogCustomFieldRuleActionParametersCookieField added in v2.3.0

type RulesetUpdateResponseRulesRulesetsLogCustomFieldRuleActionParametersCookieField struct {
	// The name of the field.
	Name string                                                                              `json:"name,required"`
	JSON rulesetUpdateResponseRulesRulesetsLogCustomFieldRuleActionParametersCookieFieldJSON `json:"-"`
}

The cookie field to log.

func (*RulesetUpdateResponseRulesRulesetsLogCustomFieldRuleActionParametersCookieField) UnmarshalJSON added in v2.3.0

type RulesetUpdateResponseRulesRulesetsLogCustomFieldRuleActionParametersRequestField added in v2.3.0

type RulesetUpdateResponseRulesRulesetsLogCustomFieldRuleActionParametersRequestField struct {
	// The name of the field.
	Name string                                                                               `json:"name,required"`
	JSON rulesetUpdateResponseRulesRulesetsLogCustomFieldRuleActionParametersRequestFieldJSON `json:"-"`
}

The request field to log.

func (*RulesetUpdateResponseRulesRulesetsLogCustomFieldRuleActionParametersRequestField) UnmarshalJSON added in v2.3.0

type RulesetUpdateResponseRulesRulesetsLogCustomFieldRuleActionParametersResponseField added in v2.3.0

type RulesetUpdateResponseRulesRulesetsLogCustomFieldRuleActionParametersResponseField struct {
	// The name of the field.
	Name string                                                                                `json:"name,required"`
	JSON rulesetUpdateResponseRulesRulesetsLogCustomFieldRuleActionParametersResponseFieldJSON `json:"-"`
}

The response field to log.

func (*RulesetUpdateResponseRulesRulesetsLogCustomFieldRuleActionParametersResponseField) UnmarshalJSON added in v2.3.0

type ScoreRule

type ScoreRule 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 ScoreRuleAction `json:"action"`
	// The parameters configuring the rule's action.
	ActionParameters ScoreRuleActionParameters `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 Logging `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref  string        `json:"ref"`
	JSON scoreRuleJSON `json:"-"`
}

func (*ScoreRule) UnmarshalJSON

func (r *ScoreRule) UnmarshalJSON(data []byte) (err error)

type ScoreRuleAction

type ScoreRuleAction string

The action to perform when the rule matches.

const (
	ScoreRuleActionScore ScoreRuleAction = "score"
)

func (ScoreRuleAction) IsKnown

func (r ScoreRuleAction) IsKnown() bool

type ScoreRuleActionParameters

type ScoreRuleActionParameters struct {
	// Increment contains the delta to change the score and can be either positive or
	// negative.
	Increment int64                         `json:"increment"`
	JSON      scoreRuleActionParametersJSON `json:"-"`
}

The parameters configuring the rule's action.

func (*ScoreRuleActionParameters) UnmarshalJSON

func (r *ScoreRuleActionParameters) UnmarshalJSON(data []byte) (err error)

type ScoreRuleActionParametersParam

type ScoreRuleActionParametersParam struct {
	// Increment contains the delta to change the score and can be either positive or
	// negative.
	Increment param.Field[int64] `json:"increment"`
}

The parameters configuring the rule's action.

func (ScoreRuleActionParametersParam) MarshalJSON

func (r ScoreRuleActionParametersParam) MarshalJSON() (data []byte, err error)

type ScoreRuleParam

type ScoreRuleParam struct {
	// The unique ID of the rule.
	ID param.Field[string] `json:"id"`
	// The action to perform when the rule matches.
	Action param.Field[ScoreRuleAction] `json:"action"`
	// The parameters configuring the rule's action.
	ActionParameters param.Field[ScoreRuleActionParametersParam] `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[LoggingParam] `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref param.Field[string] `json:"ref"`
}

func (ScoreRuleParam) MarshalJSON

func (r ScoreRuleParam) MarshalJSON() (data []byte, err error)

type ServeErrorRule

type ServeErrorRule 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 ServeErrorRuleAction `json:"action"`
	// The parameters configuring the rule's action.
	ActionParameters ServeErrorRuleActionParameters `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 Logging `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref  string             `json:"ref"`
	JSON serveErrorRuleJSON `json:"-"`
}

func (*ServeErrorRule) UnmarshalJSON

func (r *ServeErrorRule) UnmarshalJSON(data []byte) (err error)

type ServeErrorRuleAction

type ServeErrorRuleAction string

The action to perform when the rule matches.

const (
	ServeErrorRuleActionServeError ServeErrorRuleAction = "serve_error"
)

func (ServeErrorRuleAction) IsKnown

func (r ServeErrorRuleAction) IsKnown() bool

type ServeErrorRuleActionParameters

type ServeErrorRuleActionParameters struct {
	// Error response content.
	Content string `json:"content"`
	// Content-type header to set with the response.
	ContentType ServeErrorRuleActionParametersContentType `json:"content_type"`
	// The status code to use for the error.
	StatusCode float64                            `json:"status_code"`
	JSON       serveErrorRuleActionParametersJSON `json:"-"`
}

The parameters configuring the rule's action.

func (*ServeErrorRuleActionParameters) UnmarshalJSON

func (r *ServeErrorRuleActionParameters) UnmarshalJSON(data []byte) (err error)

type ServeErrorRuleActionParametersContentType

type ServeErrorRuleActionParametersContentType string

Content-type header to set with the response.

const (
	ServeErrorRuleActionParametersContentTypeApplicationJson ServeErrorRuleActionParametersContentType = "application/json"
	ServeErrorRuleActionParametersContentTypeTextXml         ServeErrorRuleActionParametersContentType = "text/xml"
	ServeErrorRuleActionParametersContentTypeTextPlain       ServeErrorRuleActionParametersContentType = "text/plain"
	ServeErrorRuleActionParametersContentTypeTextHTML        ServeErrorRuleActionParametersContentType = "text/html"
)

func (ServeErrorRuleActionParametersContentType) IsKnown

type ServeErrorRuleActionParametersParam

type ServeErrorRuleActionParametersParam struct {
	// Error response content.
	Content param.Field[string] `json:"content"`
	// Content-type header to set with the response.
	ContentType param.Field[ServeErrorRuleActionParametersContentType] `json:"content_type"`
	// The status code to use for the error.
	StatusCode param.Field[float64] `json:"status_code"`
}

The parameters configuring the rule's action.

func (ServeErrorRuleActionParametersParam) MarshalJSON

func (r ServeErrorRuleActionParametersParam) MarshalJSON() (data []byte, err error)

type ServeErrorRuleParam

type ServeErrorRuleParam struct {
	// The unique ID of the rule.
	ID param.Field[string] `json:"id"`
	// The action to perform when the rule matches.
	Action param.Field[ServeErrorRuleAction] `json:"action"`
	// The parameters configuring the rule's action.
	ActionParameters param.Field[ServeErrorRuleActionParametersParam] `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[LoggingParam] `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref param.Field[string] `json:"ref"`
}

func (ServeErrorRuleParam) MarshalJSON

func (r ServeErrorRuleParam) MarshalJSON() (data []byte, err error)

type SetCacheSettingsRule

type SetCacheSettingsRule 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 SetCacheSettingsRuleAction `json:"action"`
	// The parameters configuring the rule's action.
	ActionParameters SetCacheSettingsRuleActionParameters `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 Logging `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref  string                   `json:"ref"`
	JSON setCacheSettingsRuleJSON `json:"-"`
}

func (*SetCacheSettingsRule) UnmarshalJSON

func (r *SetCacheSettingsRule) UnmarshalJSON(data []byte) (err error)

type SetCacheSettingsRuleAction

type SetCacheSettingsRuleAction string

The action to perform when the rule matches.

const (
	SetCacheSettingsRuleActionSetCacheSettings SetCacheSettingsRuleAction = "set_cache_settings"
)

func (SetCacheSettingsRuleAction) IsKnown

func (r SetCacheSettingsRuleAction) IsKnown() bool

type SetCacheSettingsRuleActionParameters

type SetCacheSettingsRuleActionParameters struct {
	// List of additional ports that caching can be enabled on.
	AdditionalCacheablePorts []int64 `json:"additional_cacheable_ports"`
	// Specify how long client browsers should cache the response. Cloudflare cache
	// purge will not purge content cached on client browsers, so high browser TTLs may
	// lead to stale content.
	BrowserTTL SetCacheSettingsRuleActionParametersBrowserTTL `json:"browser_ttl"`
	// Mark whether the request’s response from origin is eligible for caching. Caching
	// itself will still depend on the cache-control header and your other caching
	// configurations.
	Cache bool `json:"cache"`
	// Define which components of the request are included or excluded from the cache
	// key Cloudflare uses to store the response in cache.
	CacheKey SetCacheSettingsRuleActionParametersCacheKey `json:"cache_key"`
	// Mark whether the request's response from origin is eligible for Cache Reserve
	// (requires a Cache Reserve add-on plan).
	CacheReserve SetCacheSettingsRuleActionParametersCacheReserve `json:"cache_reserve"`
	// TTL (Time to Live) specifies the maximum time to cache a resource in the
	// Cloudflare edge network.
	EdgeTTL SetCacheSettingsRuleActionParametersEdgeTTL `json:"edge_ttl"`
	// When enabled, Cloudflare will aim to strictly adhere to RFC 7234.
	OriginCacheControl bool `json:"origin_cache_control"`
	// Generate Cloudflare error pages from issues sent from the origin server. When
	// on, error pages will trigger for issues from the origin
	OriginErrorPagePassthru bool `json:"origin_error_page_passthru"`
	// Define a timeout value between two successive read operations to your origin
	// server. Historically, the timeout value between two read options from Cloudflare
	// to an origin server is 100 seconds. If you are attempting to reduce HTTP 524
	// errors because of timeouts from an origin server, try increasing this timeout
	// value.
	ReadTimeout int64 `json:"read_timeout"`
	// Specify whether or not Cloudflare should respect strong ETag (entity tag)
	// headers. When off, Cloudflare converts strong ETag headers to weak ETag headers.
	RespectStrongEtags bool `json:"respect_strong_etags"`
	// Define if Cloudflare should serve stale content while getting the latest content
	// from the origin. If on, Cloudflare will not serve stale content while getting
	// the latest content from the origin.
	ServeStale SetCacheSettingsRuleActionParametersServeStale `json:"serve_stale"`
	JSON       setCacheSettingsRuleActionParametersJSON       `json:"-"`
}

The parameters configuring the rule's action.

func (*SetCacheSettingsRuleActionParameters) UnmarshalJSON

func (r *SetCacheSettingsRuleActionParameters) UnmarshalJSON(data []byte) (err error)

type SetCacheSettingsRuleActionParametersBrowserTTL

type SetCacheSettingsRuleActionParametersBrowserTTL struct {
	// Determines which browser ttl mode to use.
	Mode SetCacheSettingsRuleActionParametersBrowserTTLMode `json:"mode,required"`
	// The TTL (in seconds) if you choose override_origin mode.
	Default int64                                              `json:"default"`
	JSON    setCacheSettingsRuleActionParametersBrowserTTLJSON `json:"-"`
}

Specify how long client browsers should cache the response. Cloudflare cache purge will not purge content cached on client browsers, so high browser TTLs may lead to stale content.

func (*SetCacheSettingsRuleActionParametersBrowserTTL) UnmarshalJSON

func (r *SetCacheSettingsRuleActionParametersBrowserTTL) UnmarshalJSON(data []byte) (err error)

type SetCacheSettingsRuleActionParametersBrowserTTLMode

type SetCacheSettingsRuleActionParametersBrowserTTLMode string

Determines which browser ttl mode to use.

const (
	SetCacheSettingsRuleActionParametersBrowserTTLModeRespectOrigin   SetCacheSettingsRuleActionParametersBrowserTTLMode = "respect_origin"
	SetCacheSettingsRuleActionParametersBrowserTTLModeBypassByDefault SetCacheSettingsRuleActionParametersBrowserTTLMode = "bypass_by_default"
	SetCacheSettingsRuleActionParametersBrowserTTLModeOverrideOrigin  SetCacheSettingsRuleActionParametersBrowserTTLMode = "override_origin"
)

func (SetCacheSettingsRuleActionParametersBrowserTTLMode) IsKnown

type SetCacheSettingsRuleActionParametersBrowserTTLParam

type SetCacheSettingsRuleActionParametersBrowserTTLParam struct {
	// Determines which browser ttl mode to use.
	Mode param.Field[SetCacheSettingsRuleActionParametersBrowserTTLMode] `json:"mode,required"`
	// The TTL (in seconds) if you choose override_origin mode.
	Default param.Field[int64] `json:"default"`
}

Specify how long client browsers should cache the response. Cloudflare cache purge will not purge content cached on client browsers, so high browser TTLs may lead to stale content.

func (SetCacheSettingsRuleActionParametersBrowserTTLParam) MarshalJSON

func (r SetCacheSettingsRuleActionParametersBrowserTTLParam) MarshalJSON() (data []byte, err error)

type SetCacheSettingsRuleActionParametersCacheKey

type SetCacheSettingsRuleActionParametersCacheKey struct {
	// Separate cached content based on the visitor’s device type
	CacheByDeviceType bool `json:"cache_by_device_type"`
	// Protect from web cache deception attacks while allowing static assets to be
	// cached
	CacheDeceptionArmor bool `json:"cache_deception_armor"`
	// Customize which components of the request are included or excluded from the
	// cache key.
	CustomKey SetCacheSettingsRuleActionParametersCacheKeyCustomKey `json:"custom_key"`
	// Treat requests with the same query parameters the same, regardless of the order
	// those query parameters are in. A value of true ignores the query strings' order.
	IgnoreQueryStringsOrder bool                                             `json:"ignore_query_strings_order"`
	JSON                    setCacheSettingsRuleActionParametersCacheKeyJSON `json:"-"`
}

Define which components of the request are included or excluded from the cache key Cloudflare uses to store the response in cache.

func (*SetCacheSettingsRuleActionParametersCacheKey) UnmarshalJSON

func (r *SetCacheSettingsRuleActionParametersCacheKey) UnmarshalJSON(data []byte) (err error)

type SetCacheSettingsRuleActionParametersCacheKeyCustomKey

type SetCacheSettingsRuleActionParametersCacheKeyCustomKey struct {
	// The cookies to include in building the cache key.
	Cookie SetCacheSettingsRuleActionParametersCacheKeyCustomKeyCookie `json:"cookie"`
	// The header names and values to include in building the cache key.
	Header SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHeader `json:"header"`
	// Whether to use the original host or the resolved host in the cache key.
	Host SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHost `json:"host"`
	// Use the presence or absence of parameters in the query string to build the cache
	// key.
	QueryString SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryString `json:"query_string"`
	// Characteristics of the request user agent used in building the cache key.
	User SetCacheSettingsRuleActionParametersCacheKeyCustomKeyUser `json:"user"`
	JSON setCacheSettingsRuleActionParametersCacheKeyCustomKeyJSON `json:"-"`
}

Customize which components of the request are included or excluded from the cache key.

func (*SetCacheSettingsRuleActionParametersCacheKeyCustomKey) UnmarshalJSON

func (r *SetCacheSettingsRuleActionParametersCacheKeyCustomKey) UnmarshalJSON(data []byte) (err error)

type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyCookie

type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyCookie struct {
	// Checks for the presence of these cookie names. The presence of these cookies is
	// used in building the cache key.
	CheckPresence []string `json:"check_presence"`
	// Include these cookies' names and their values.
	Include []string                                                        `json:"include"`
	JSON    setCacheSettingsRuleActionParametersCacheKeyCustomKeyCookieJSON `json:"-"`
}

The cookies to include in building the cache key.

func (*SetCacheSettingsRuleActionParametersCacheKeyCustomKeyCookie) UnmarshalJSON

type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyCookieParam

type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyCookieParam struct {
	// Checks for the presence of these cookie names. The presence of these cookies is
	// used in building the cache key.
	CheckPresence param.Field[[]string] `json:"check_presence"`
	// Include these cookies' names and their values.
	Include param.Field[[]string] `json:"include"`
}

The cookies to include in building the cache key.

func (SetCacheSettingsRuleActionParametersCacheKeyCustomKeyCookieParam) MarshalJSON

type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHeader

type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHeader struct {
	// Checks for the presence of these header names. The presence of these headers is
	// used in building the cache key.
	CheckPresence []string `json:"check_presence"`
	// For each header name and list of values combination, check if the request header
	// contains any of the values provided. The presence of the request header and
	// whether any of the values provided are contained in the request header value is
	// used in building the cache key.
	Contains map[string][]string `json:"contains"`
	// Whether or not to include the origin header. A value of true will exclude the
	// origin header in the cache key.
	ExcludeOrigin bool `json:"exclude_origin"`
	// Include these headers' names and their values.
	Include []string                                                        `json:"include"`
	JSON    setCacheSettingsRuleActionParametersCacheKeyCustomKeyHeaderJSON `json:"-"`
}

The header names and values to include in building the cache key.

func (*SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHeader) UnmarshalJSON

type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHeaderParam

type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHeaderParam struct {
	// Checks for the presence of these header names. The presence of these headers is
	// used in building the cache key.
	CheckPresence param.Field[[]string] `json:"check_presence"`
	// For each header name and list of values combination, check if the request header
	// contains any of the values provided. The presence of the request header and
	// whether any of the values provided are contained in the request header value is
	// used in building the cache key.
	Contains param.Field[map[string][]string] `json:"contains"`
	// Whether or not to include the origin header. A value of true will exclude the
	// origin header in the cache key.
	ExcludeOrigin param.Field[bool] `json:"exclude_origin"`
	// Include these headers' names and their values.
	Include param.Field[[]string] `json:"include"`
}

The header names and values to include in building the cache key.

func (SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHeaderParam) MarshalJSON

type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHost

type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHost struct {
	// Use the resolved host in the cache key. A value of true will use the resolved
	// host, while a value or false will use the original host.
	Resolved bool                                                          `json:"resolved"`
	JSON     setCacheSettingsRuleActionParametersCacheKeyCustomKeyHostJSON `json:"-"`
}

Whether to use the original host or the resolved host in the cache key.

func (*SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHost) UnmarshalJSON

type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHostParam

type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHostParam struct {
	// Use the resolved host in the cache key. A value of true will use the resolved
	// host, while a value or false will use the original host.
	Resolved param.Field[bool] `json:"resolved"`
}

Whether to use the original host or the resolved host in the cache key.

func (SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHostParam) MarshalJSON

type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyParam

type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyParam struct {
	// The cookies to include in building the cache key.
	Cookie param.Field[SetCacheSettingsRuleActionParametersCacheKeyCustomKeyCookieParam] `json:"cookie"`
	// The header names and values to include in building the cache key.
	Header param.Field[SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHeaderParam] `json:"header"`
	// Whether to use the original host or the resolved host in the cache key.
	Host param.Field[SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHostParam] `json:"host"`
	// Use the presence or absence of parameters in the query string to build the cache
	// key.
	QueryString param.Field[SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringParam] `json:"query_string"`
	// Characteristics of the request user agent used in building the cache key.
	User param.Field[SetCacheSettingsRuleActionParametersCacheKeyCustomKeyUserParam] `json:"user"`
}

Customize which components of the request are included or excluded from the cache key.

func (SetCacheSettingsRuleActionParametersCacheKeyCustomKeyParam) MarshalJSON

type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryString

type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryString struct {
	// build the cache key using all query string parameters EXCECPT these excluded
	// parameters
	Exclude SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExclude `json:"exclude"`
	// build the cache key using a list of query string parameters that ARE in the
	// request.
	Include SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringInclude `json:"include"`
	JSON    setCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringJSON    `json:"-"`
}

Use the presence or absence of parameters in the query string to build the cache key.

func (*SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryString) UnmarshalJSON

type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExclude

type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExclude struct {
	// Exclude all query string parameters from use in building the cache key.
	All bool `json:"all"`
	// A list of query string parameters NOT used to build the cache key. All
	// parameters present in the request but missing in this list will be used to build
	// the cache key.
	List []string                                                                    `json:"list"`
	JSON setCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludeJSON `json:"-"`
}

build the cache key using all query string parameters EXCECPT these excluded parameters

func (*SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExclude) UnmarshalJSON

type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludeParam

type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludeParam struct {
	// Exclude all query string parameters from use in building the cache key.
	All param.Field[bool] `json:"all"`
	// A list of query string parameters NOT used to build the cache key. All
	// parameters present in the request but missing in this list will be used to build
	// the cache key.
	List param.Field[[]string] `json:"list"`
}

build the cache key using all query string parameters EXCECPT these excluded parameters

func (SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludeParam) MarshalJSON

type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringInclude

type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringInclude struct {
	// Use all query string parameters in the cache key.
	All bool `json:"all"`
	// A list of query string parameters used to build the cache key.
	List []string                                                                    `json:"list"`
	JSON setCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludeJSON `json:"-"`
}

build the cache key using a list of query string parameters that ARE in the request.

func (*SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringInclude) UnmarshalJSON

type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludeParam

type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludeParam struct {
	// Use all query string parameters in the cache key.
	All param.Field[bool] `json:"all"`
	// A list of query string parameters used to build the cache key.
	List param.Field[[]string] `json:"list"`
}

build the cache key using a list of query string parameters that ARE in the request.

func (SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludeParam) MarshalJSON

type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringParam

type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringParam struct {
	// build the cache key using all query string parameters EXCECPT these excluded
	// parameters
	Exclude param.Field[SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludeParam] `json:"exclude"`
	// build the cache key using a list of query string parameters that ARE in the
	// request.
	Include param.Field[SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludeParam] `json:"include"`
}

Use the presence or absence of parameters in the query string to build the cache key.

func (SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringParam) MarshalJSON

type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyUser

type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyUser struct {
	// Use the user agent's device type in the cache key.
	DeviceType bool `json:"device_type"`
	// Use the user agents's country in the cache key.
	Geo bool `json:"geo"`
	// Use the user agent's language in the cache key.
	Lang bool                                                          `json:"lang"`
	JSON setCacheSettingsRuleActionParametersCacheKeyCustomKeyUserJSON `json:"-"`
}

Characteristics of the request user agent used in building the cache key.

func (*SetCacheSettingsRuleActionParametersCacheKeyCustomKeyUser) UnmarshalJSON

type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyUserParam

type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyUserParam struct {
	// Use the user agent's device type in the cache key.
	DeviceType param.Field[bool] `json:"device_type"`
	// Use the user agents's country in the cache key.
	Geo param.Field[bool] `json:"geo"`
	// Use the user agent's language in the cache key.
	Lang param.Field[bool] `json:"lang"`
}

Characteristics of the request user agent used in building the cache key.

func (SetCacheSettingsRuleActionParametersCacheKeyCustomKeyUserParam) MarshalJSON

type SetCacheSettingsRuleActionParametersCacheKeyParam

type SetCacheSettingsRuleActionParametersCacheKeyParam struct {
	// Separate cached content based on the visitor’s device type
	CacheByDeviceType param.Field[bool] `json:"cache_by_device_type"`
	// Protect from web cache deception attacks while allowing static assets to be
	// cached
	CacheDeceptionArmor param.Field[bool] `json:"cache_deception_armor"`
	// Customize which components of the request are included or excluded from the
	// cache key.
	CustomKey param.Field[SetCacheSettingsRuleActionParametersCacheKeyCustomKeyParam] `json:"custom_key"`
	// Treat requests with the same query parameters the same, regardless of the order
	// those query parameters are in. A value of true ignores the query strings' order.
	IgnoreQueryStringsOrder param.Field[bool] `json:"ignore_query_strings_order"`
}

Define which components of the request are included or excluded from the cache key Cloudflare uses to store the response in cache.

func (SetCacheSettingsRuleActionParametersCacheKeyParam) MarshalJSON

func (r SetCacheSettingsRuleActionParametersCacheKeyParam) MarshalJSON() (data []byte, err error)

type SetCacheSettingsRuleActionParametersCacheReserve

type SetCacheSettingsRuleActionParametersCacheReserve struct {
	// Determines whether cache reserve is enabled. If this is true and a request meets
	// eligibility criteria, Cloudflare will write the resource to cache reserve.
	Eligible bool `json:"eligible,required"`
	// The minimum file size eligible for store in cache reserve.
	MinFileSize int64                                                `json:"min_file_size,required"`
	JSON        setCacheSettingsRuleActionParametersCacheReserveJSON `json:"-"`
}

Mark whether the request's response from origin is eligible for Cache Reserve (requires a Cache Reserve add-on plan).

func (*SetCacheSettingsRuleActionParametersCacheReserve) UnmarshalJSON

func (r *SetCacheSettingsRuleActionParametersCacheReserve) UnmarshalJSON(data []byte) (err error)

type SetCacheSettingsRuleActionParametersCacheReserveParam

type SetCacheSettingsRuleActionParametersCacheReserveParam struct {
	// Determines whether cache reserve is enabled. If this is true and a request meets
	// eligibility criteria, Cloudflare will write the resource to cache reserve.
	Eligible param.Field[bool] `json:"eligible,required"`
	// The minimum file size eligible for store in cache reserve.
	MinFileSize param.Field[int64] `json:"min_file_size,required"`
}

Mark whether the request's response from origin is eligible for Cache Reserve (requires a Cache Reserve add-on plan).

func (SetCacheSettingsRuleActionParametersCacheReserveParam) MarshalJSON

type SetCacheSettingsRuleActionParametersEdgeTTL

type SetCacheSettingsRuleActionParametersEdgeTTL struct {
	// The TTL (in seconds) if you choose override_origin mode.
	Default int64 `json:"default,required"`
	// edge ttl options
	Mode SetCacheSettingsRuleActionParametersEdgeTTLMode `json:"mode,required"`
	// List of single status codes, or status code ranges to apply the selected mode
	StatusCodeTTL []SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTL `json:"status_code_ttl,required"`
	JSON          setCacheSettingsRuleActionParametersEdgeTTLJSON            `json:"-"`
}

TTL (Time to Live) specifies the maximum time to cache a resource in the Cloudflare edge network.

func (*SetCacheSettingsRuleActionParametersEdgeTTL) UnmarshalJSON

func (r *SetCacheSettingsRuleActionParametersEdgeTTL) UnmarshalJSON(data []byte) (err error)

type SetCacheSettingsRuleActionParametersEdgeTTLMode

type SetCacheSettingsRuleActionParametersEdgeTTLMode string

edge ttl options

const (
	SetCacheSettingsRuleActionParametersEdgeTTLModeRespectOrigin   SetCacheSettingsRuleActionParametersEdgeTTLMode = "respect_origin"
	SetCacheSettingsRuleActionParametersEdgeTTLModeBypassByDefault SetCacheSettingsRuleActionParametersEdgeTTLMode = "bypass_by_default"
	SetCacheSettingsRuleActionParametersEdgeTTLModeOverrideOrigin  SetCacheSettingsRuleActionParametersEdgeTTLMode = "override_origin"
)

func (SetCacheSettingsRuleActionParametersEdgeTTLMode) IsKnown

type SetCacheSettingsRuleActionParametersEdgeTTLParam

type SetCacheSettingsRuleActionParametersEdgeTTLParam struct {
	// The TTL (in seconds) if you choose override_origin mode.
	Default param.Field[int64] `json:"default,required"`
	// edge ttl options
	Mode param.Field[SetCacheSettingsRuleActionParametersEdgeTTLMode] `json:"mode,required"`
	// List of single status codes, or status code ranges to apply the selected mode
	StatusCodeTTL param.Field[[]SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTLParam] `json:"status_code_ttl,required"`
}

TTL (Time to Live) specifies the maximum time to cache a resource in the Cloudflare edge network.

func (SetCacheSettingsRuleActionParametersEdgeTTLParam) MarshalJSON

func (r SetCacheSettingsRuleActionParametersEdgeTTLParam) MarshalJSON() (data []byte, err error)

type SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTL

type SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTL struct {
	// Time to cache a response (in seconds). A value of 0 is equivalent to setting the
	// Cache-Control header with the value "no-cache". A value of -1 is equivalent to
	// setting Cache-Control header with the value of "no-store".
	Value int64 `json:"value,required"`
	// The range of status codes used to apply the selected mode.
	StatusCodeRange SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTLStatusCodeRange `json:"status_code_range"`
	// Set the ttl for responses with this specific status code
	StatusCodeValue int64                                                        `json:"status_code_value"`
	JSON            setCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTLJSON `json:"-"`
}

Specify how long Cloudflare should cache the response based on the status code from the origin. Can be a single status code or a range or status codes

func (*SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTL) UnmarshalJSON

type SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTLParam

type SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTLParam struct {
	// Time to cache a response (in seconds). A value of 0 is equivalent to setting the
	// Cache-Control header with the value "no-cache". A value of -1 is equivalent to
	// setting Cache-Control header with the value of "no-store".
	Value param.Field[int64] `json:"value,required"`
	// The range of status codes used to apply the selected mode.
	StatusCodeRange param.Field[SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTLStatusCodeRangeParam] `json:"status_code_range"`
	// Set the ttl for responses with this specific status code
	StatusCodeValue param.Field[int64] `json:"status_code_value"`
}

Specify how long Cloudflare should cache the response based on the status code from the origin. Can be a single status code or a range or status codes

func (SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTLParam) MarshalJSON

type SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTLStatusCodeRange

type SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTLStatusCodeRange struct {
	// response status code lower bound
	From int64 `json:"from,required"`
	// response status code upper bound
	To   int64                                                                       `json:"to,required"`
	JSON setCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTLStatusCodeRangeJSON `json:"-"`
}

The range of status codes used to apply the selected mode.

func (*SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTLStatusCodeRange) UnmarshalJSON

type SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTLStatusCodeRangeParam

type SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTLStatusCodeRangeParam struct {
	// response status code lower bound
	From param.Field[int64] `json:"from,required"`
	// response status code upper bound
	To param.Field[int64] `json:"to,required"`
}

The range of status codes used to apply the selected mode.

func (SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTLStatusCodeRangeParam) MarshalJSON

type SetCacheSettingsRuleActionParametersParam

type SetCacheSettingsRuleActionParametersParam struct {
	// List of additional ports that caching can be enabled on.
	AdditionalCacheablePorts param.Field[[]int64] `json:"additional_cacheable_ports"`
	// Specify how long client browsers should cache the response. Cloudflare cache
	// purge will not purge content cached on client browsers, so high browser TTLs may
	// lead to stale content.
	BrowserTTL param.Field[SetCacheSettingsRuleActionParametersBrowserTTLParam] `json:"browser_ttl"`
	// Mark whether the request’s response from origin is eligible for caching. Caching
	// itself will still depend on the cache-control header and your other caching
	// configurations.
	Cache param.Field[bool] `json:"cache"`
	// Define which components of the request are included or excluded from the cache
	// key Cloudflare uses to store the response in cache.
	CacheKey param.Field[SetCacheSettingsRuleActionParametersCacheKeyParam] `json:"cache_key"`
	// Mark whether the request's response from origin is eligible for Cache Reserve
	// (requires a Cache Reserve add-on plan).
	CacheReserve param.Field[SetCacheSettingsRuleActionParametersCacheReserveParam] `json:"cache_reserve"`
	// TTL (Time to Live) specifies the maximum time to cache a resource in the
	// Cloudflare edge network.
	EdgeTTL param.Field[SetCacheSettingsRuleActionParametersEdgeTTLParam] `json:"edge_ttl"`
	// When enabled, Cloudflare will aim to strictly adhere to RFC 7234.
	OriginCacheControl param.Field[bool] `json:"origin_cache_control"`
	// Generate Cloudflare error pages from issues sent from the origin server. When
	// on, error pages will trigger for issues from the origin
	OriginErrorPagePassthru param.Field[bool] `json:"origin_error_page_passthru"`
	// Define a timeout value between two successive read operations to your origin
	// server. Historically, the timeout value between two read options from Cloudflare
	// to an origin server is 100 seconds. If you are attempting to reduce HTTP 524
	// errors because of timeouts from an origin server, try increasing this timeout
	// value.
	ReadTimeout param.Field[int64] `json:"read_timeout"`
	// Specify whether or not Cloudflare should respect strong ETag (entity tag)
	// headers. When off, Cloudflare converts strong ETag headers to weak ETag headers.
	RespectStrongEtags param.Field[bool] `json:"respect_strong_etags"`
	// Define if Cloudflare should serve stale content while getting the latest content
	// from the origin. If on, Cloudflare will not serve stale content while getting
	// the latest content from the origin.
	ServeStale param.Field[SetCacheSettingsRuleActionParametersServeStaleParam] `json:"serve_stale"`
}

The parameters configuring the rule's action.

func (SetCacheSettingsRuleActionParametersParam) MarshalJSON

func (r SetCacheSettingsRuleActionParametersParam) MarshalJSON() (data []byte, err error)

type SetCacheSettingsRuleActionParametersServeStale

type SetCacheSettingsRuleActionParametersServeStale struct {
	// Defines whether Cloudflare should serve stale content while updating. If true,
	// Cloudflare will not serve stale content while getting the latest content from
	// the origin.
	DisableStaleWhileUpdating bool                                               `json:"disable_stale_while_updating,required"`
	JSON                      setCacheSettingsRuleActionParametersServeStaleJSON `json:"-"`
}

Define if Cloudflare should serve stale content while getting the latest content from the origin. If on, Cloudflare will not serve stale content while getting the latest content from the origin.

func (*SetCacheSettingsRuleActionParametersServeStale) UnmarshalJSON

func (r *SetCacheSettingsRuleActionParametersServeStale) UnmarshalJSON(data []byte) (err error)

type SetCacheSettingsRuleActionParametersServeStaleParam

type SetCacheSettingsRuleActionParametersServeStaleParam struct {
	// Defines whether Cloudflare should serve stale content while updating. If true,
	// Cloudflare will not serve stale content while getting the latest content from
	// the origin.
	DisableStaleWhileUpdating param.Field[bool] `json:"disable_stale_while_updating,required"`
}

Define if Cloudflare should serve stale content while getting the latest content from the origin. If on, Cloudflare will not serve stale content while getting the latest content from the origin.

func (SetCacheSettingsRuleActionParametersServeStaleParam) MarshalJSON

func (r SetCacheSettingsRuleActionParametersServeStaleParam) MarshalJSON() (data []byte, err error)

type SetCacheSettingsRuleParam

type SetCacheSettingsRuleParam struct {
	// The unique ID of the rule.
	ID param.Field[string] `json:"id"`
	// The action to perform when the rule matches.
	Action param.Field[SetCacheSettingsRuleAction] `json:"action"`
	// The parameters configuring the rule's action.
	ActionParameters param.Field[SetCacheSettingsRuleActionParametersParam] `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[LoggingParam] `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref param.Field[string] `json:"ref"`
}

func (SetCacheSettingsRuleParam) MarshalJSON

func (r SetCacheSettingsRuleParam) MarshalJSON() (data []byte, err error)

type SetConfigRule

type SetConfigRule 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 SetConfigRuleAction `json:"action"`
	// The parameters configuring the rule's action.
	ActionParameters SetConfigRuleActionParameters `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 Logging `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref  string            `json:"ref"`
	JSON setConfigRuleJSON `json:"-"`
}

func (*SetConfigRule) UnmarshalJSON

func (r *SetConfigRule) UnmarshalJSON(data []byte) (err error)

type SetConfigRuleAction

type SetConfigRuleAction string

The action to perform when the rule matches.

const (
	SetConfigRuleActionSetConfig SetConfigRuleAction = "set_config"
)

func (SetConfigRuleAction) IsKnown

func (r SetConfigRuleAction) IsKnown() bool

type SetConfigRuleActionParameters

type SetConfigRuleActionParameters struct {
	// Turn on or off Automatic HTTPS Rewrites.
	AutomaticHTTPSRewrites bool `json:"automatic_https_rewrites"`
	// Select which file extensions to minify automatically.
	Autominify SetConfigRuleActionParametersAutominify `json:"autominify"`
	// Turn on or off Browser Integrity Check.
	Bic bool `json:"bic"`
	// Turn off all active Cloudflare Apps.
	DisableApps SetConfigRuleActionParametersDisableApps `json:"disable_apps"`
	// Turn off Real User Monitoring (RUM).
	DisableRUM SetConfigRuleActionParametersDisableRUM `json:"disable_rum"`
	// Turn off Zaraz.
	DisableZaraz SetConfigRuleActionParametersDisableZaraz `json:"disable_zaraz"`
	// Turn on or off Email Obfuscation.
	EmailObfuscation bool `json:"email_obfuscation"`
	// Turn on or off Cloudflare Fonts.
	Fonts bool `json:"fonts"`
	// Turn on or off the Hotlink Protection.
	HotlinkProtection bool `json:"hotlink_protection"`
	// Turn on or off Mirage.
	Mirage bool `json:"mirage"`
	// Turn on or off Opportunistic Encryption.
	OpportunisticEncryption bool `json:"opportunistic_encryption"`
	// Configure the Polish level.
	Polish SetConfigRuleActionParametersPolish `json:"polish"`
	// Turn on or off Rocket Loader
	RocketLoader bool `json:"rocket_loader"`
	// Configure the Security Level.
	SecurityLevel SetConfigRuleActionParametersSecurityLevel `json:"security_level"`
	// Turn on or off Server Side Excludes.
	ServerSideExcludes bool `json:"server_side_excludes"`
	// Configure the SSL level.
	SSL SetConfigRuleActionParametersSSL `json:"ssl"`
	// Turn on or off Signed Exchanges (SXG).
	Sxg  bool                              `json:"sxg"`
	JSON setConfigRuleActionParametersJSON `json:"-"`
}

The parameters configuring the rule's action.

func (*SetConfigRuleActionParameters) UnmarshalJSON

func (r *SetConfigRuleActionParameters) UnmarshalJSON(data []byte) (err error)

type SetConfigRuleActionParametersAutominify

type SetConfigRuleActionParametersAutominify struct {
	// Minify CSS files.
	Css bool `json:"css"`
	// Minify HTML files.
	HTML bool `json:"html"`
	// Minify JS files.
	JS   bool                                        `json:"js"`
	JSON setConfigRuleActionParametersAutominifyJSON `json:"-"`
}

Select which file extensions to minify automatically.

func (*SetConfigRuleActionParametersAutominify) UnmarshalJSON

func (r *SetConfigRuleActionParametersAutominify) UnmarshalJSON(data []byte) (err error)

type SetConfigRuleActionParametersAutominifyParam

type SetConfigRuleActionParametersAutominifyParam struct {
	// Minify CSS files.
	Css param.Field[bool] `json:"css"`
	// Minify HTML files.
	HTML param.Field[bool] `json:"html"`
	// Minify JS files.
	JS param.Field[bool] `json:"js"`
}

Select which file extensions to minify automatically.

func (SetConfigRuleActionParametersAutominifyParam) MarshalJSON

func (r SetConfigRuleActionParametersAutominifyParam) MarshalJSON() (data []byte, err error)

type SetConfigRuleActionParametersDisableApps added in v2.3.0

type SetConfigRuleActionParametersDisableApps bool

Turn off all active Cloudflare Apps.

const (
	SetConfigRuleActionParametersDisableAppsTrue SetConfigRuleActionParametersDisableApps = true
)

func (SetConfigRuleActionParametersDisableApps) IsKnown added in v2.3.0

type SetConfigRuleActionParametersDisableRUM added in v2.3.0

type SetConfigRuleActionParametersDisableRUM bool

Turn off Real User Monitoring (RUM).

const (
	SetConfigRuleActionParametersDisableRUMTrue SetConfigRuleActionParametersDisableRUM = true
)

func (SetConfigRuleActionParametersDisableRUM) IsKnown added in v2.3.0

type SetConfigRuleActionParametersDisableZaraz added in v2.3.0

type SetConfigRuleActionParametersDisableZaraz bool

Turn off Zaraz.

const (
	SetConfigRuleActionParametersDisableZarazTrue SetConfigRuleActionParametersDisableZaraz = true
)

func (SetConfigRuleActionParametersDisableZaraz) IsKnown added in v2.3.0

type SetConfigRuleActionParametersParam

type SetConfigRuleActionParametersParam struct {
	// Turn on or off Automatic HTTPS Rewrites.
	AutomaticHTTPSRewrites param.Field[bool] `json:"automatic_https_rewrites"`
	// Select which file extensions to minify automatically.
	Autominify param.Field[SetConfigRuleActionParametersAutominifyParam] `json:"autominify"`
	// Turn on or off Browser Integrity Check.
	Bic param.Field[bool] `json:"bic"`
	// Turn off all active Cloudflare Apps.
	DisableApps param.Field[SetConfigRuleActionParametersDisableApps] `json:"disable_apps"`
	// Turn off Real User Monitoring (RUM).
	DisableRUM param.Field[SetConfigRuleActionParametersDisableRUM] `json:"disable_rum"`
	// Turn off Zaraz.
	DisableZaraz param.Field[SetConfigRuleActionParametersDisableZaraz] `json:"disable_zaraz"`
	// Turn on or off Email Obfuscation.
	EmailObfuscation param.Field[bool] `json:"email_obfuscation"`
	// Turn on or off Cloudflare Fonts.
	Fonts param.Field[bool] `json:"fonts"`
	// Turn on or off the Hotlink Protection.
	HotlinkProtection param.Field[bool] `json:"hotlink_protection"`
	// Turn on or off Mirage.
	Mirage param.Field[bool] `json:"mirage"`
	// Turn on or off Opportunistic Encryption.
	OpportunisticEncryption param.Field[bool] `json:"opportunistic_encryption"`
	// Configure the Polish level.
	Polish param.Field[SetConfigRuleActionParametersPolish] `json:"polish"`
	// Turn on or off Rocket Loader
	RocketLoader param.Field[bool] `json:"rocket_loader"`
	// Configure the Security Level.
	SecurityLevel param.Field[SetConfigRuleActionParametersSecurityLevel] `json:"security_level"`
	// Turn on or off Server Side Excludes.
	ServerSideExcludes param.Field[bool] `json:"server_side_excludes"`
	// Configure the SSL level.
	SSL param.Field[SetConfigRuleActionParametersSSL] `json:"ssl"`
	// Turn on or off Signed Exchanges (SXG).
	Sxg param.Field[bool] `json:"sxg"`
}

The parameters configuring the rule's action.

func (SetConfigRuleActionParametersParam) MarshalJSON

func (r SetConfigRuleActionParametersParam) MarshalJSON() (data []byte, err error)

type SetConfigRuleActionParametersPolish

type SetConfigRuleActionParametersPolish string

Configure the Polish level.

const (
	SetConfigRuleActionParametersPolishOff      SetConfigRuleActionParametersPolish = "off"
	SetConfigRuleActionParametersPolishLossless SetConfigRuleActionParametersPolish = "lossless"
	SetConfigRuleActionParametersPolishLossy    SetConfigRuleActionParametersPolish = "lossy"
)

func (SetConfigRuleActionParametersPolish) IsKnown

type SetConfigRuleActionParametersSSL

type SetConfigRuleActionParametersSSL string

Configure the SSL level.

const (
	SetConfigRuleActionParametersSSLOff        SetConfigRuleActionParametersSSL = "off"
	SetConfigRuleActionParametersSSLFlexible   SetConfigRuleActionParametersSSL = "flexible"
	SetConfigRuleActionParametersSSLFull       SetConfigRuleActionParametersSSL = "full"
	SetConfigRuleActionParametersSSLStrict     SetConfigRuleActionParametersSSL = "strict"
	SetConfigRuleActionParametersSSLOriginPull SetConfigRuleActionParametersSSL = "origin_pull"
)

func (SetConfigRuleActionParametersSSL) IsKnown

type SetConfigRuleActionParametersSecurityLevel

type SetConfigRuleActionParametersSecurityLevel string

Configure the Security Level.

const (
	SetConfigRuleActionParametersSecurityLevelOff            SetConfigRuleActionParametersSecurityLevel = "off"
	SetConfigRuleActionParametersSecurityLevelEssentiallyOff SetConfigRuleActionParametersSecurityLevel = "essentially_off"
	SetConfigRuleActionParametersSecurityLevelLow            SetConfigRuleActionParametersSecurityLevel = "low"
	SetConfigRuleActionParametersSecurityLevelMedium         SetConfigRuleActionParametersSecurityLevel = "medium"
	SetConfigRuleActionParametersSecurityLevelHigh           SetConfigRuleActionParametersSecurityLevel = "high"
	SetConfigRuleActionParametersSecurityLevelUnderAttack    SetConfigRuleActionParametersSecurityLevel = "under_attack"
)

func (SetConfigRuleActionParametersSecurityLevel) IsKnown

type SetConfigRuleParam

type SetConfigRuleParam struct {
	// The unique ID of the rule.
	ID param.Field[string] `json:"id"`
	// The action to perform when the rule matches.
	Action param.Field[SetConfigRuleAction] `json:"action"`
	// The parameters configuring the rule's action.
	ActionParameters param.Field[SetConfigRuleActionParametersParam] `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[LoggingParam] `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref param.Field[string] `json:"ref"`
}

func (SetConfigRuleParam) MarshalJSON

func (r SetConfigRuleParam) MarshalJSON() (data []byte, err error)

type SkipRule

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.
	Version string `json:"version,required"`
	// The unique ID of the rule.
	ID string `json:"id"`
	// The action to perform when the rule matches.
	Action SkipRuleAction `json:"action"`
	// The parameters configuring the rule's action.
	ActionParameters SkipRuleActionParameters `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 Logging `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref  string       `json:"ref"`
	JSON skipRuleJSON `json:"-"`
}

func (*SkipRule) UnmarshalJSON

func (r *SkipRule) UnmarshalJSON(data []byte) (err error)

type SkipRuleAction

type SkipRuleAction string

The action to perform when the rule matches.

const (
	SkipRuleActionSkip SkipRuleAction = "skip"
)

func (SkipRuleAction) IsKnown

func (r SkipRuleAction) IsKnown() bool

type SkipRuleActionParameters

type SkipRuleActionParameters struct {
	// A list of phases to skip the execution of. This option is incompatible with the
	// ruleset and rulesets options.
	Phases []Phase `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:"-"`
}

The parameters configuring the rule's action.

func (*SkipRuleActionParameters) UnmarshalJSON

func (r *SkipRuleActionParameters) UnmarshalJSON(data []byte) (err error)

type SkipRuleActionParametersParam

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[[]Phase] `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"`
}

The parameters configuring the rule's action.

func (SkipRuleActionParametersParam) MarshalJSON

func (r SkipRuleActionParametersParam) MarshalJSON() (data []byte, err error)

type SkipRuleActionParametersProduct

type SkipRuleActionParametersProduct string

The name of a legacy security product to skip the execution of.

const (
	SkipRuleActionParametersProductBic           SkipRuleActionParametersProduct = "bic"
	SkipRuleActionParametersProductHot           SkipRuleActionParametersProduct = "hot"
	SkipRuleActionParametersProductRateLimit     SkipRuleActionParametersProduct = "rateLimit"
	SkipRuleActionParametersProductSecurityLevel SkipRuleActionParametersProduct = "securityLevel"
	SkipRuleActionParametersProductUABlock       SkipRuleActionParametersProduct = "uaBlock"
	SkipRuleActionParametersProductWAF           SkipRuleActionParametersProduct = "waf"
	SkipRuleActionParametersProductZoneLockdown  SkipRuleActionParametersProduct = "zoneLockdown"
)

func (SkipRuleActionParametersProduct) IsKnown

type SkipRuleActionParametersRuleset

type SkipRuleActionParametersRuleset string

A ruleset to skip the execution of. This option is incompatible with the rulesets, rules and phases options.

const (
	SkipRuleActionParametersRulesetCurrent SkipRuleActionParametersRuleset = "current"
)

func (SkipRuleActionParametersRuleset) IsKnown

type SkipRuleParam

type SkipRuleParam struct {
	// The unique ID of the rule.
	ID param.Field[string] `json:"id"`
	// The action to perform when the rule matches.
	Action param.Field[SkipRuleAction] `json:"action"`
	// The parameters configuring the rule's action.
	ActionParameters param.Field[SkipRuleActionParametersParam] `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[LoggingParam] `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref param.Field[string] `json:"ref"`
}

func (SkipRuleParam) MarshalJSON

func (r SkipRuleParam) MarshalJSON() (data []byte, err error)

type SortDirection added in v2.2.0

type SortDirection = shared.SortDirection

Direction to order DNS records in.

This is an alias to an internal type.

type VersionByTagGetParams

type VersionByTagGetParams struct {
	// The unique ID of the account.
	AccountID param.Field[string] `path:"account_id,required"`
}

type VersionByTagGetResponse

type VersionByTagGetResponse struct {
	// The unique ID of the ruleset.
	ID string `json:"id,required"`
	// The kind of the ruleset.
	Kind Kind `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 Phase `json:"phase,required"`
	// The list of rules in the ruleset.
	Rules []VersionByTagGetResponseRule `json:"rules,required"`
	// The version of the ruleset.
	Version string `json:"version,required"`
	// An informative description of the ruleset.
	Description string                      `json:"description"`
	JSON        versionByTagGetResponseJSON `json:"-"`
}

A ruleset object.

func (*VersionByTagGetResponse) UnmarshalJSON

func (r *VersionByTagGetResponse) UnmarshalJSON(data []byte) (err error)

type VersionByTagGetResponseEnvelope

type VersionByTagGetResponseEnvelope struct {
	// A list of error messages.
	Errors []VersionByTagGetResponseEnvelopeErrors `json:"errors,required"`
	// A list of warning messages.
	Messages []VersionByTagGetResponseEnvelopeMessages `json:"messages,required"`
	// A ruleset object.
	Result VersionByTagGetResponse `json:"result,required"`
	// Whether the API call was successful.
	Success VersionByTagGetResponseEnvelopeSuccess `json:"success,required"`
	JSON    versionByTagGetResponseEnvelopeJSON    `json:"-"`
}

A response object.

func (*VersionByTagGetResponseEnvelope) UnmarshalJSON

func (r *VersionByTagGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type VersionByTagGetResponseEnvelopeErrors

type VersionByTagGetResponseEnvelopeErrors 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 VersionByTagGetResponseEnvelopeErrorsSource `json:"source"`
	JSON   versionByTagGetResponseEnvelopeErrorsJSON   `json:"-"`
}

A message.

func (*VersionByTagGetResponseEnvelopeErrors) UnmarshalJSON

func (r *VersionByTagGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type VersionByTagGetResponseEnvelopeErrorsSource

type VersionByTagGetResponseEnvelopeErrorsSource struct {
	// A JSON pointer to the field that is the source of the message.
	Pointer string                                          `json:"pointer,required"`
	JSON    versionByTagGetResponseEnvelopeErrorsSourceJSON `json:"-"`
}

The source of this message.

func (*VersionByTagGetResponseEnvelopeErrorsSource) UnmarshalJSON

func (r *VersionByTagGetResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error)

type VersionByTagGetResponseEnvelopeMessages

type VersionByTagGetResponseEnvelopeMessages 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 VersionByTagGetResponseEnvelopeMessagesSource `json:"source"`
	JSON   versionByTagGetResponseEnvelopeMessagesJSON   `json:"-"`
}

A message.

func (*VersionByTagGetResponseEnvelopeMessages) UnmarshalJSON

func (r *VersionByTagGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type VersionByTagGetResponseEnvelopeMessagesSource

type VersionByTagGetResponseEnvelopeMessagesSource struct {
	// A JSON pointer to the field that is the source of the message.
	Pointer string                                            `json:"pointer,required"`
	JSON    versionByTagGetResponseEnvelopeMessagesSourceJSON `json:"-"`
}

The source of this message.

func (*VersionByTagGetResponseEnvelopeMessagesSource) UnmarshalJSON

func (r *VersionByTagGetResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error)

type VersionByTagGetResponseEnvelopeSuccess

type VersionByTagGetResponseEnvelopeSuccess bool

Whether the API call was successful.

const (
	VersionByTagGetResponseEnvelopeSuccessTrue VersionByTagGetResponseEnvelopeSuccess = true
)

func (VersionByTagGetResponseEnvelopeSuccess) IsKnown

type VersionByTagGetResponseRule

type VersionByTagGetResponseRule struct {
	// The action to perform when the rule matches.
	Action VersionByTagGetResponseRulesAction `json:"action"`
	// This field can have the runtime type of [BlockRuleActionParameters],
	// [interface{}], [CompressResponseRuleActionParameters],
	// [ExecuteRuleActionParameters], [RedirectRuleActionParameters],
	// [RewriteRuleActionParameters], [RouteRuleActionParameters],
	// [ScoreRuleActionParameters], [ServeErrorRuleActionParameters],
	// [SetConfigRuleActionParameters], [SkipRuleActionParameters],
	// [SetCacheSettingsRuleActionParameters],
	// [VersionByTagGetResponseRulesRulesetsLogCustomFieldRuleActionParameters].
	ActionParameters interface{} `json:"action_parameters,required"`
	// This field can have the runtime type of [[]string].
	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 Logging `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:"-"`
	// contains filtered or unexported fields
}

func (*VersionByTagGetResponseRule) UnmarshalJSON

func (r *VersionByTagGetResponseRule) UnmarshalJSON(data []byte) (err error)

type VersionByTagGetResponseRulesAction

type VersionByTagGetResponseRulesAction string

The action to perform when the rule matches.

const (
	VersionByTagGetResponseRulesActionBlock                VersionByTagGetResponseRulesAction = "block"
	VersionByTagGetResponseRulesActionChallenge            VersionByTagGetResponseRulesAction = "challenge"
	VersionByTagGetResponseRulesActionCompressResponse     VersionByTagGetResponseRulesAction = "compress_response"
	VersionByTagGetResponseRulesActionExecute              VersionByTagGetResponseRulesAction = "execute"
	VersionByTagGetResponseRulesActionJSChallenge          VersionByTagGetResponseRulesAction = "js_challenge"
	VersionByTagGetResponseRulesActionLog                  VersionByTagGetResponseRulesAction = "log"
	VersionByTagGetResponseRulesActionManagedChallenge     VersionByTagGetResponseRulesAction = "managed_challenge"
	VersionByTagGetResponseRulesActionRedirect             VersionByTagGetResponseRulesAction = "redirect"
	VersionByTagGetResponseRulesActionRewrite              VersionByTagGetResponseRulesAction = "rewrite"
	VersionByTagGetResponseRulesActionRoute                VersionByTagGetResponseRulesAction = "route"
	VersionByTagGetResponseRulesActionScore                VersionByTagGetResponseRulesAction = "score"
	VersionByTagGetResponseRulesActionServeError           VersionByTagGetResponseRulesAction = "serve_error"
	VersionByTagGetResponseRulesActionSetConfig            VersionByTagGetResponseRulesAction = "set_config"
	VersionByTagGetResponseRulesActionSkip                 VersionByTagGetResponseRulesAction = "skip"
	VersionByTagGetResponseRulesActionSetCacheSettings     VersionByTagGetResponseRulesAction = "set_cache_settings"
	VersionByTagGetResponseRulesActionLogCustomField       VersionByTagGetResponseRulesAction = "log_custom_field"
	VersionByTagGetResponseRulesActionDDoSDynamic          VersionByTagGetResponseRulesAction = "ddos_dynamic"
	VersionByTagGetResponseRulesActionForceConnectionClose VersionByTagGetResponseRulesAction = "force_connection_close"
)

func (VersionByTagGetResponseRulesAction) IsKnown

type VersionByTagGetResponseRulesRulesetsDDoSDynamicRule added in v2.3.0

type VersionByTagGetResponseRulesRulesetsDDoSDynamicRule 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 VersionByTagGetResponseRulesRulesetsDDoSDynamicRuleAction `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 Logging `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref  string                                                  `json:"ref"`
	JSON versionByTagGetResponseRulesRulesetsDDoSDynamicRuleJSON `json:"-"`
}

func (*VersionByTagGetResponseRulesRulesetsDDoSDynamicRule) UnmarshalJSON added in v2.3.0

func (r *VersionByTagGetResponseRulesRulesetsDDoSDynamicRule) UnmarshalJSON(data []byte) (err error)

type VersionByTagGetResponseRulesRulesetsDDoSDynamicRuleAction added in v2.3.0

type VersionByTagGetResponseRulesRulesetsDDoSDynamicRuleAction string

The action to perform when the rule matches.

const (
	VersionByTagGetResponseRulesRulesetsDDoSDynamicRuleActionDDoSDynamic VersionByTagGetResponseRulesRulesetsDDoSDynamicRuleAction = "ddos_dynamic"
)

func (VersionByTagGetResponseRulesRulesetsDDoSDynamicRuleAction) IsKnown added in v2.3.0

type VersionByTagGetResponseRulesRulesetsForceConnectionCloseRule added in v2.3.0

type VersionByTagGetResponseRulesRulesetsForceConnectionCloseRule 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 VersionByTagGetResponseRulesRulesetsForceConnectionCloseRuleAction `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 Logging `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref  string                                                           `json:"ref"`
	JSON versionByTagGetResponseRulesRulesetsForceConnectionCloseRuleJSON `json:"-"`
}

func (*VersionByTagGetResponseRulesRulesetsForceConnectionCloseRule) UnmarshalJSON added in v2.3.0

type VersionByTagGetResponseRulesRulesetsForceConnectionCloseRuleAction added in v2.3.0

type VersionByTagGetResponseRulesRulesetsForceConnectionCloseRuleAction string

The action to perform when the rule matches.

const (
	VersionByTagGetResponseRulesRulesetsForceConnectionCloseRuleActionForceConnectionClose VersionByTagGetResponseRulesRulesetsForceConnectionCloseRuleAction = "force_connection_close"
)

func (VersionByTagGetResponseRulesRulesetsForceConnectionCloseRuleAction) IsKnown added in v2.3.0

type VersionByTagGetResponseRulesRulesetsLogCustomFieldRule added in v2.3.0

type VersionByTagGetResponseRulesRulesetsLogCustomFieldRule 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 VersionByTagGetResponseRulesRulesetsLogCustomFieldRuleAction `json:"action"`
	// The parameters configuring the rule's action.
	ActionParameters VersionByTagGetResponseRulesRulesetsLogCustomFieldRuleActionParameters `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 Logging `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref  string                                                     `json:"ref"`
	JSON versionByTagGetResponseRulesRulesetsLogCustomFieldRuleJSON `json:"-"`
}

func (*VersionByTagGetResponseRulesRulesetsLogCustomFieldRule) UnmarshalJSON added in v2.3.0

func (r *VersionByTagGetResponseRulesRulesetsLogCustomFieldRule) UnmarshalJSON(data []byte) (err error)

type VersionByTagGetResponseRulesRulesetsLogCustomFieldRuleAction added in v2.3.0

type VersionByTagGetResponseRulesRulesetsLogCustomFieldRuleAction string

The action to perform when the rule matches.

const (
	VersionByTagGetResponseRulesRulesetsLogCustomFieldRuleActionLogCustomField VersionByTagGetResponseRulesRulesetsLogCustomFieldRuleAction = "log_custom_field"
)

func (VersionByTagGetResponseRulesRulesetsLogCustomFieldRuleAction) IsKnown added in v2.3.0

type VersionByTagGetResponseRulesRulesetsLogCustomFieldRuleActionParameters added in v2.3.0

type VersionByTagGetResponseRulesRulesetsLogCustomFieldRuleActionParameters struct {
	// The cookie fields to log.
	CookieFields []VersionByTagGetResponseRulesRulesetsLogCustomFieldRuleActionParametersCookieField `json:"cookie_fields"`
	// The request fields to log.
	RequestFields []VersionByTagGetResponseRulesRulesetsLogCustomFieldRuleActionParametersRequestField `json:"request_fields"`
	// The response fields to log.
	ResponseFields []VersionByTagGetResponseRulesRulesetsLogCustomFieldRuleActionParametersResponseField `json:"response_fields"`
	JSON           versionByTagGetResponseRulesRulesetsLogCustomFieldRuleActionParametersJSON            `json:"-"`
}

The parameters configuring the rule's action.

func (*VersionByTagGetResponseRulesRulesetsLogCustomFieldRuleActionParameters) UnmarshalJSON added in v2.3.0

type VersionByTagGetResponseRulesRulesetsLogCustomFieldRuleActionParametersCookieField added in v2.3.0

type VersionByTagGetResponseRulesRulesetsLogCustomFieldRuleActionParametersCookieField struct {
	// The name of the field.
	Name string                                                                                `json:"name,required"`
	JSON versionByTagGetResponseRulesRulesetsLogCustomFieldRuleActionParametersCookieFieldJSON `json:"-"`
}

The cookie field to log.

func (*VersionByTagGetResponseRulesRulesetsLogCustomFieldRuleActionParametersCookieField) UnmarshalJSON added in v2.3.0

type VersionByTagGetResponseRulesRulesetsLogCustomFieldRuleActionParametersRequestField added in v2.3.0

type VersionByTagGetResponseRulesRulesetsLogCustomFieldRuleActionParametersRequestField struct {
	// The name of the field.
	Name string                                                                                 `json:"name,required"`
	JSON versionByTagGetResponseRulesRulesetsLogCustomFieldRuleActionParametersRequestFieldJSON `json:"-"`
}

The request field to log.

func (*VersionByTagGetResponseRulesRulesetsLogCustomFieldRuleActionParametersRequestField) UnmarshalJSON added in v2.3.0

type VersionByTagGetResponseRulesRulesetsLogCustomFieldRuleActionParametersResponseField added in v2.3.0

type VersionByTagGetResponseRulesRulesetsLogCustomFieldRuleActionParametersResponseField struct {
	// The name of the field.
	Name string                                                                                  `json:"name,required"`
	JSON versionByTagGetResponseRulesRulesetsLogCustomFieldRuleActionParametersResponseFieldJSON `json:"-"`
}

The response field to log.

func (*VersionByTagGetResponseRulesRulesetsLogCustomFieldRuleActionParametersResponseField) UnmarshalJSON added in v2.3.0

type VersionByTagService

type VersionByTagService struct {
	Options []option.RequestOption
}

VersionByTagService contains methods and other services that help with interacting with the cloudflare API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewVersionByTagService method instead.

func NewVersionByTagService

func NewVersionByTagService(opts ...option.RequestOption) (r *VersionByTagService)

NewVersionByTagService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*VersionByTagService) Get

func (r *VersionByTagService) Get(ctx context.Context, rulesetID string, rulesetVersion string, ruleTag string, query VersionByTagGetParams, opts ...option.RequestOption) (res *VersionByTagGetResponse, err error)

Fetches the rules of a managed account ruleset version for a given tag.

type VersionDeleteParams

type VersionDeleteParams 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.
	ZoneID param.Field[string] `path:"zone_id"`
}

type VersionGetParams

type VersionGetParams 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.
	ZoneID param.Field[string] `path:"zone_id"`
}

type VersionGetResponse

type VersionGetResponse struct {
	// The unique ID of the ruleset.
	ID string `json:"id,required"`
	// The kind of the ruleset.
	Kind Kind `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 Phase `json:"phase,required"`
	// The list of rules in the ruleset.
	Rules []VersionGetResponseRule `json:"rules,required"`
	// The version of the ruleset.
	Version string `json:"version,required"`
	// An informative description of the ruleset.
	Description string                 `json:"description"`
	JSON        versionGetResponseJSON `json:"-"`
}

A ruleset object.

func (*VersionGetResponse) UnmarshalJSON

func (r *VersionGetResponse) UnmarshalJSON(data []byte) (err error)

type VersionGetResponseEnvelope

type VersionGetResponseEnvelope struct {
	// A list of error messages.
	Errors []VersionGetResponseEnvelopeErrors `json:"errors,required"`
	// A list of warning messages.
	Messages []VersionGetResponseEnvelopeMessages `json:"messages,required"`
	// A ruleset object.
	Result VersionGetResponse `json:"result,required"`
	// Whether the API call was successful.
	Success VersionGetResponseEnvelopeSuccess `json:"success,required"`
	JSON    versionGetResponseEnvelopeJSON    `json:"-"`
}

A response object.

func (*VersionGetResponseEnvelope) UnmarshalJSON

func (r *VersionGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type VersionGetResponseEnvelopeErrors

type VersionGetResponseEnvelopeErrors 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 VersionGetResponseEnvelopeErrorsSource `json:"source"`
	JSON   versionGetResponseEnvelopeErrorsJSON   `json:"-"`
}

A message.

func (*VersionGetResponseEnvelopeErrors) UnmarshalJSON

func (r *VersionGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type VersionGetResponseEnvelopeErrorsSource

type VersionGetResponseEnvelopeErrorsSource struct {
	// A JSON pointer to the field that is the source of the message.
	Pointer string                                     `json:"pointer,required"`
	JSON    versionGetResponseEnvelopeErrorsSourceJSON `json:"-"`
}

The source of this message.

func (*VersionGetResponseEnvelopeErrorsSource) UnmarshalJSON

func (r *VersionGetResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error)

type VersionGetResponseEnvelopeMessages

type VersionGetResponseEnvelopeMessages 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 VersionGetResponseEnvelopeMessagesSource `json:"source"`
	JSON   versionGetResponseEnvelopeMessagesJSON   `json:"-"`
}

A message.

func (*VersionGetResponseEnvelopeMessages) UnmarshalJSON

func (r *VersionGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type VersionGetResponseEnvelopeMessagesSource

type VersionGetResponseEnvelopeMessagesSource struct {
	// A JSON pointer to the field that is the source of the message.
	Pointer string                                       `json:"pointer,required"`
	JSON    versionGetResponseEnvelopeMessagesSourceJSON `json:"-"`
}

The source of this message.

func (*VersionGetResponseEnvelopeMessagesSource) UnmarshalJSON

func (r *VersionGetResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error)

type VersionGetResponseEnvelopeSuccess

type VersionGetResponseEnvelopeSuccess bool

Whether the API call was successful.

const (
	VersionGetResponseEnvelopeSuccessTrue VersionGetResponseEnvelopeSuccess = true
)

func (VersionGetResponseEnvelopeSuccess) IsKnown

type VersionGetResponseRule

type VersionGetResponseRule struct {
	// The action to perform when the rule matches.
	Action VersionGetResponseRulesAction `json:"action"`
	// This field can have the runtime type of [BlockRuleActionParameters],
	// [interface{}], [CompressResponseRuleActionParameters],
	// [ExecuteRuleActionParameters], [RedirectRuleActionParameters],
	// [RewriteRuleActionParameters], [RouteRuleActionParameters],
	// [ScoreRuleActionParameters], [ServeErrorRuleActionParameters],
	// [SetConfigRuleActionParameters], [SkipRuleActionParameters],
	// [SetCacheSettingsRuleActionParameters],
	// [VersionGetResponseRulesRulesetsLogCustomFieldRuleActionParameters].
	ActionParameters interface{} `json:"action_parameters,required"`
	// This field can have the runtime type of [[]string].
	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 Logging `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:"-"`
	// contains filtered or unexported fields
}

func (*VersionGetResponseRule) UnmarshalJSON

func (r *VersionGetResponseRule) UnmarshalJSON(data []byte) (err error)

type VersionGetResponseRulesAction

type VersionGetResponseRulesAction string

The action to perform when the rule matches.

const (
	VersionGetResponseRulesActionBlock                VersionGetResponseRulesAction = "block"
	VersionGetResponseRulesActionChallenge            VersionGetResponseRulesAction = "challenge"
	VersionGetResponseRulesActionCompressResponse     VersionGetResponseRulesAction = "compress_response"
	VersionGetResponseRulesActionExecute              VersionGetResponseRulesAction = "execute"
	VersionGetResponseRulesActionJSChallenge          VersionGetResponseRulesAction = "js_challenge"
	VersionGetResponseRulesActionLog                  VersionGetResponseRulesAction = "log"
	VersionGetResponseRulesActionManagedChallenge     VersionGetResponseRulesAction = "managed_challenge"
	VersionGetResponseRulesActionRedirect             VersionGetResponseRulesAction = "redirect"
	VersionGetResponseRulesActionRewrite              VersionGetResponseRulesAction = "rewrite"
	VersionGetResponseRulesActionRoute                VersionGetResponseRulesAction = "route"
	VersionGetResponseRulesActionScore                VersionGetResponseRulesAction = "score"
	VersionGetResponseRulesActionServeError           VersionGetResponseRulesAction = "serve_error"
	VersionGetResponseRulesActionSetConfig            VersionGetResponseRulesAction = "set_config"
	VersionGetResponseRulesActionSkip                 VersionGetResponseRulesAction = "skip"
	VersionGetResponseRulesActionSetCacheSettings     VersionGetResponseRulesAction = "set_cache_settings"
	VersionGetResponseRulesActionLogCustomField       VersionGetResponseRulesAction = "log_custom_field"
	VersionGetResponseRulesActionDDoSDynamic          VersionGetResponseRulesAction = "ddos_dynamic"
	VersionGetResponseRulesActionForceConnectionClose VersionGetResponseRulesAction = "force_connection_close"
)

func (VersionGetResponseRulesAction) IsKnown

func (r VersionGetResponseRulesAction) IsKnown() bool

type VersionGetResponseRulesRulesetsDDoSDynamicRule added in v2.3.0

type VersionGetResponseRulesRulesetsDDoSDynamicRule 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 VersionGetResponseRulesRulesetsDDoSDynamicRuleAction `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 Logging `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref  string                                             `json:"ref"`
	JSON versionGetResponseRulesRulesetsDDoSDynamicRuleJSON `json:"-"`
}

func (*VersionGetResponseRulesRulesetsDDoSDynamicRule) UnmarshalJSON added in v2.3.0

func (r *VersionGetResponseRulesRulesetsDDoSDynamicRule) UnmarshalJSON(data []byte) (err error)

type VersionGetResponseRulesRulesetsDDoSDynamicRuleAction added in v2.3.0

type VersionGetResponseRulesRulesetsDDoSDynamicRuleAction string

The action to perform when the rule matches.

const (
	VersionGetResponseRulesRulesetsDDoSDynamicRuleActionDDoSDynamic VersionGetResponseRulesRulesetsDDoSDynamicRuleAction = "ddos_dynamic"
)

func (VersionGetResponseRulesRulesetsDDoSDynamicRuleAction) IsKnown added in v2.3.0

type VersionGetResponseRulesRulesetsForceConnectionCloseRule added in v2.3.0

type VersionGetResponseRulesRulesetsForceConnectionCloseRule 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 VersionGetResponseRulesRulesetsForceConnectionCloseRuleAction `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 Logging `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref  string                                                      `json:"ref"`
	JSON versionGetResponseRulesRulesetsForceConnectionCloseRuleJSON `json:"-"`
}

func (*VersionGetResponseRulesRulesetsForceConnectionCloseRule) UnmarshalJSON added in v2.3.0

type VersionGetResponseRulesRulesetsForceConnectionCloseRuleAction added in v2.3.0

type VersionGetResponseRulesRulesetsForceConnectionCloseRuleAction string

The action to perform when the rule matches.

const (
	VersionGetResponseRulesRulesetsForceConnectionCloseRuleActionForceConnectionClose VersionGetResponseRulesRulesetsForceConnectionCloseRuleAction = "force_connection_close"
)

func (VersionGetResponseRulesRulesetsForceConnectionCloseRuleAction) IsKnown added in v2.3.0

type VersionGetResponseRulesRulesetsLogCustomFieldRule added in v2.3.0

type VersionGetResponseRulesRulesetsLogCustomFieldRule 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 VersionGetResponseRulesRulesetsLogCustomFieldRuleAction `json:"action"`
	// The parameters configuring the rule's action.
	ActionParameters VersionGetResponseRulesRulesetsLogCustomFieldRuleActionParameters `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 Logging `json:"logging"`
	// The reference of the rule (the rule ID by default).
	Ref  string                                                `json:"ref"`
	JSON versionGetResponseRulesRulesetsLogCustomFieldRuleJSON `json:"-"`
}

func (*VersionGetResponseRulesRulesetsLogCustomFieldRule) UnmarshalJSON added in v2.3.0

func (r *VersionGetResponseRulesRulesetsLogCustomFieldRule) UnmarshalJSON(data []byte) (err error)

type VersionGetResponseRulesRulesetsLogCustomFieldRuleAction added in v2.3.0

type VersionGetResponseRulesRulesetsLogCustomFieldRuleAction string

The action to perform when the rule matches.

const (
	VersionGetResponseRulesRulesetsLogCustomFieldRuleActionLogCustomField VersionGetResponseRulesRulesetsLogCustomFieldRuleAction = "log_custom_field"
)

func (VersionGetResponseRulesRulesetsLogCustomFieldRuleAction) IsKnown added in v2.3.0

type VersionGetResponseRulesRulesetsLogCustomFieldRuleActionParameters added in v2.3.0

type VersionGetResponseRulesRulesetsLogCustomFieldRuleActionParameters struct {
	// The cookie fields to log.
	CookieFields []VersionGetResponseRulesRulesetsLogCustomFieldRuleActionParametersCookieField `json:"cookie_fields"`
	// The request fields to log.
	RequestFields []VersionGetResponseRulesRulesetsLogCustomFieldRuleActionParametersRequestField `json:"request_fields"`
	// The response fields to log.
	ResponseFields []VersionGetResponseRulesRulesetsLogCustomFieldRuleActionParametersResponseField `json:"response_fields"`
	JSON           versionGetResponseRulesRulesetsLogCustomFieldRuleActionParametersJSON            `json:"-"`
}

The parameters configuring the rule's action.

func (*VersionGetResponseRulesRulesetsLogCustomFieldRuleActionParameters) UnmarshalJSON added in v2.3.0

type VersionGetResponseRulesRulesetsLogCustomFieldRuleActionParametersCookieField added in v2.3.0

type VersionGetResponseRulesRulesetsLogCustomFieldRuleActionParametersCookieField struct {
	// The name of the field.
	Name string                                                                           `json:"name,required"`
	JSON versionGetResponseRulesRulesetsLogCustomFieldRuleActionParametersCookieFieldJSON `json:"-"`
}

The cookie field to log.

func (*VersionGetResponseRulesRulesetsLogCustomFieldRuleActionParametersCookieField) UnmarshalJSON added in v2.3.0

type VersionGetResponseRulesRulesetsLogCustomFieldRuleActionParametersRequestField added in v2.3.0

type VersionGetResponseRulesRulesetsLogCustomFieldRuleActionParametersRequestField struct {
	// The name of the field.
	Name string                                                                            `json:"name,required"`
	JSON versionGetResponseRulesRulesetsLogCustomFieldRuleActionParametersRequestFieldJSON `json:"-"`
}

The request field to log.

func (*VersionGetResponseRulesRulesetsLogCustomFieldRuleActionParametersRequestField) UnmarshalJSON added in v2.3.0

type VersionGetResponseRulesRulesetsLogCustomFieldRuleActionParametersResponseField added in v2.3.0

type VersionGetResponseRulesRulesetsLogCustomFieldRuleActionParametersResponseField struct {
	// The name of the field.
	Name string                                                                             `json:"name,required"`
	JSON versionGetResponseRulesRulesetsLogCustomFieldRuleActionParametersResponseFieldJSON `json:"-"`
}

The response field to log.

func (*VersionGetResponseRulesRulesetsLogCustomFieldRuleActionParametersResponseField) UnmarshalJSON added in v2.3.0

type VersionListParams

type VersionListParams 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.
	ZoneID param.Field[string] `path:"zone_id"`
}

type VersionListResponse added in v2.3.0

type VersionListResponse struct {
	// The unique ID of the ruleset.
	ID string `json:"id,required"`
	// The kind of the ruleset.
	Kind Kind `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 Phase `json:"phase,required"`
	// The version of the ruleset.
	Version string `json:"version,required"`
	// An informative description of the ruleset.
	Description string                  `json:"description"`
	JSON        versionListResponseJSON `json:"-"`
}

A ruleset object.

func (*VersionListResponse) UnmarshalJSON added in v2.3.0

func (r *VersionListResponse) UnmarshalJSON(data []byte) (err error)

type VersionService

type VersionService struct {
	Options []option.RequestOption
	ByTag   *VersionByTagService
}

VersionService contains methods and other services that help with interacting with the cloudflare API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewVersionService method instead.

func NewVersionService

func NewVersionService(opts ...option.RequestOption) (r *VersionService)

NewVersionService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*VersionService) Delete

func (r *VersionService) Delete(ctx context.Context, rulesetID string, rulesetVersion string, body VersionDeleteParams, opts ...option.RequestOption) (err error)

Deletes an existing version of an account or zone ruleset.

func (*VersionService) Get

func (r *VersionService) Get(ctx context.Context, rulesetID string, rulesetVersion string, query VersionGetParams, opts ...option.RequestOption) (res *VersionGetResponse, err error)

Fetches a specific version of an account or zone ruleset.

func (*VersionService) List

Fetches the versions of an account or zone ruleset.

func (*VersionService) ListAutoPaging

Fetches the versions of an account or zone ruleset.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL