rulesets

package
v6.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2026 License: Apache-2.0 Imports: 17 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 CertificateCASSLCom = shared.CertificateCASSLCom

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 CloudflareTunnelConfigSrcCloudflare = shared.CloudflareTunnelConfigSrcCloudflare

This is an alias to an internal value.

View Source
const CloudflareTunnelConfigSrcLocal = shared.CloudflareTunnelConfigSrcLocal

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 CloudflareTunnelTunTypeMagic = shared.CloudflareTunnelTunTypeMagic

This is an alias to an internal value.

View Source
const CloudflareTunnelTunTypeWARP = shared.CloudflareTunnelTunTypeWARP

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 MemberPoliciesAccessAllow = shared.MemberPoliciesAccessAllow

This is an alias to an internal value.

View Source
const MemberPoliciesAccessDeny = shared.MemberPoliciesAccessDeny

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 RatePlanIDBusiness = shared.RatePlanIDBusiness

This is an alias to an internal value.

View Source
const RatePlanIDEnterprise = shared.RatePlanIDEnterprise

This is an alias to an internal value.

View Source
const RatePlanIDFree = shared.RatePlanIDFree

This is an alias to an internal value.

View Source
const RatePlanIDLite = shared.RatePlanIDLite

This is an alias to an internal value.

View Source
const RatePlanIDPartnersBusiness = shared.RatePlanIDPartnersBusiness

This is an alias to an internal value.

View Source
const RatePlanIDPartnersEnterprise = shared.RatePlanIDPartnersEnterprise

This is an alias to an internal value.

View Source
const RatePlanIDPartnersFree = shared.RatePlanIDPartnersFree

This is an alias to an internal value.

View Source
const RatePlanIDPartnersPro = shared.RatePlanIDPartnersPro

This is an alias to an internal value.

View Source
const RatePlanIDPro = shared.RatePlanIDPro

This is an alias to an internal value.

View Source
const RatePlanIDProPlus = shared.RatePlanIDProPlus

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.

View Source
const SubscriptionFrequencyMonthly = shared.SubscriptionFrequencyMonthly

This is an alias to an internal value.

View Source
const SubscriptionFrequencyQuarterly = shared.SubscriptionFrequencyQuarterly

This is an alias to an internal value.

View Source
const SubscriptionFrequencyWeekly = shared.SubscriptionFrequencyWeekly

This is an alias to an internal value.

View Source
const SubscriptionFrequencyYearly = shared.SubscriptionFrequencyYearly

This is an alias to an internal value.

View Source
const SubscriptionStateAwaitingPayment = shared.SubscriptionStateAwaitingPayment

This is an alias to an internal value.

View Source
const SubscriptionStateCancelled = shared.SubscriptionStateCancelled

This is an alias to an internal value.

View Source
const SubscriptionStateExpired = shared.SubscriptionStateExpired

This is an alias to an internal value.

View Source
const SubscriptionStateFailed = shared.SubscriptionStateFailed

This is an alias to an internal value.

View Source
const SubscriptionStatePaid = shared.SubscriptionStatePaid

This is an alias to an internal value.

View Source
const SubscriptionStateProvisioned = shared.SubscriptionStateProvisioned

This is an alias to an internal value.

View Source
const SubscriptionStateTrial = shared.SubscriptionStateTrial

This is an alias to an internal value.

View Source
const TokenPolicyEffectAllow = shared.TokenPolicyEffectAllow

This is an alias to an internal value.

View Source
const TokenPolicyEffectDeny = shared.TokenPolicyEffectDeny

This is an alias to an internal value.

View Source
const TokenStatusActive = shared.TokenStatusActive

This is an alias to an internal value.

View Source
const TokenStatusDisabled = shared.TokenStatusDisabled

This is an alias to an internal value.

View Source
const TokenStatusExpired = shared.TokenStatusExpired

This is an alias to an internal value.

Variables

This section is empty.

Functions

This section is empty.

Types

type ASN

type ASN = shared.ASN

This is an alias to an internal type.

type ASNParam

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"`
	// Configuration for exposed credential checking.
	ExposedCredentialCheck BlockRuleExposedCredentialCheck `json:"exposed_credential_check"`
	// 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"`
	// An object configuring the rule's rate limit behavior.
	Ratelimit BlockRuleRatelimit `json:"ratelimit"`
	// The reference of the rule (the rule's 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 BlockRuleExposedCredentialCheck

type BlockRuleExposedCredentialCheck struct {
	// An expression that selects the password used in the credentials check.
	PasswordExpression string `json:"password_expression,required"`
	// An expression that selects the user ID used in the credentials check.
	UsernameExpression string                              `json:"username_expression,required"`
	JSON               blockRuleExposedCredentialCheckJSON `json:"-"`
}

Configuration for exposed credential checking.

func (*BlockRuleExposedCredentialCheck) UnmarshalJSON

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

type BlockRuleExposedCredentialCheckParam

type BlockRuleExposedCredentialCheckParam struct {
	// An expression that selects the password used in the credentials check.
	PasswordExpression param.Field[string] `json:"password_expression,required"`
	// An expression that selects the user ID used in the credentials check.
	UsernameExpression param.Field[string] `json:"username_expression,required"`
}

Configuration for exposed credential checking.

func (BlockRuleExposedCredentialCheckParam) MarshalJSON

func (r BlockRuleExposedCredentialCheckParam) 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"`
	// Configuration for exposed credential checking.
	ExposedCredentialCheck param.Field[BlockRuleExposedCredentialCheckParam] `json:"exposed_credential_check"`
	// 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"`
	// An object configuring the rule's rate limit behavior.
	Ratelimit param.Field[BlockRuleRatelimitParam] `json:"ratelimit"`
	// The reference of the rule (the rule's ID by default).
	Ref param.Field[string] `json:"ref"`
}

func (BlockRuleParam) MarshalJSON

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

type BlockRuleRatelimit

type BlockRuleRatelimit struct {
	// Characteristics of the request on which the rate limit counter will be
	// incremented.
	Characteristics []string `json:"characteristics,required"`
	// Period in seconds over which the counter is being incremented.
	Period int64 `json:"period,required"`
	// An expression that defines when the rate limit counter should be incremented. It
	// defaults to the same as the rule's expression.
	CountingExpression string `json:"counting_expression"`
	// Period of time in seconds after which the action will be disabled following its
	// first execution.
	MitigationTimeout int64 `json:"mitigation_timeout"`
	// The threshold of requests per period after which the action will be executed for
	// the first time.
	RequestsPerPeriod int64 `json:"requests_per_period"`
	// Whether counting is only performed when an origin is reached.
	RequestsToOrigin bool `json:"requests_to_origin"`
	// The score threshold per period for which the action will be executed the first
	// time.
	ScorePerPeriod int64 `json:"score_per_period"`
	// A response header name provided by the origin, which contains the score to
	// increment rate limit counter with.
	ScoreResponseHeaderName string                 `json:"score_response_header_name"`
	JSON                    blockRuleRatelimitJSON `json:"-"`
}

An object configuring the rule's rate limit behavior.

func (*BlockRuleRatelimit) UnmarshalJSON

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

type BlockRuleRatelimitParam

type BlockRuleRatelimitParam struct {
	// Characteristics of the request on which the rate limit counter will be
	// incremented.
	Characteristics param.Field[[]string] `json:"characteristics,required"`
	// Period in seconds over which the counter is being incremented.
	Period param.Field[int64] `json:"period,required"`
	// An expression that defines when the rate limit counter should be incremented. It
	// defaults to the same as the rule's expression.
	CountingExpression param.Field[string] `json:"counting_expression"`
	// Period of time in seconds after which the action will be disabled following its
	// first execution.
	MitigationTimeout param.Field[int64] `json:"mitigation_timeout"`
	// The threshold of requests per period after which the action will be executed for
	// the first time.
	RequestsPerPeriod param.Field[int64] `json:"requests_per_period"`
	// Whether counting is only performed when an origin is reached.
	RequestsToOrigin param.Field[bool] `json:"requests_to_origin"`
	// The score threshold per period for which the action will be executed the first
	// time.
	ScorePerPeriod param.Field[int64] `json:"score_per_period"`
	// A response header name provided by the origin, which contains the score to
	// increment rate limit counter with.
	ScoreResponseHeaderName param.Field[string] `json:"score_response_header_name"`
}

An object configuring the rule's rate limit behavior.

func (BlockRuleRatelimitParam) MarshalJSON

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

type CertificateCA

type CertificateCA = shared.CertificateCA

The Certificate Authority that will issue the certificate

This is an alias to an internal type.

type CertificateRequestType

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 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 CloudflareTunnelConfigSrc

type CloudflareTunnelConfigSrc = shared.CloudflareTunnelConfigSrc

Indicates if this is a locally or remotely configured tunnel. If `local`, manage the tunnel using a YAML file on the origin machine. If `cloudflare`, manage the tunnel on the Zero Trust dashboard.

This is an alias to an internal type.

type CloudflareTunnelConnection

type CloudflareTunnelConnection = shared.CloudflareTunnelConnection

This is an alias to an internal type.

type CloudflareTunnelStatus

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"`
	// Configuration for exposed credential checking.
	ExposedCredentialCheck CompressResponseRuleExposedCredentialCheck `json:"exposed_credential_check"`
	// 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"`
	// An object configuring the rule's rate limit behavior.
	Ratelimit CompressResponseRuleRatelimit `json:"ratelimit"`
	// The reference of the rule (the rule's 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,required"`
	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 the 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 the 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 the compression algorithm to enable.

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

func (CompressResponseRuleActionParametersAlgorithmsName) IsKnown

type CompressResponseRuleActionParametersParam

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

The parameters configuring the rule's action.

func (CompressResponseRuleActionParametersParam) MarshalJSON

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

type CompressResponseRuleExposedCredentialCheck

type CompressResponseRuleExposedCredentialCheck struct {
	// An expression that selects the password used in the credentials check.
	PasswordExpression string `json:"password_expression,required"`
	// An expression that selects the user ID used in the credentials check.
	UsernameExpression string                                         `json:"username_expression,required"`
	JSON               compressResponseRuleExposedCredentialCheckJSON `json:"-"`
}

Configuration for exposed credential checking.

func (*CompressResponseRuleExposedCredentialCheck) UnmarshalJSON

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

type CompressResponseRuleExposedCredentialCheckParam

type CompressResponseRuleExposedCredentialCheckParam struct {
	// An expression that selects the password used in the credentials check.
	PasswordExpression param.Field[string] `json:"password_expression,required"`
	// An expression that selects the user ID used in the credentials check.
	UsernameExpression param.Field[string] `json:"username_expression,required"`
}

Configuration for exposed credential checking.

func (CompressResponseRuleExposedCredentialCheckParam) MarshalJSON

func (r CompressResponseRuleExposedCredentialCheckParam) 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"`
	// Configuration for exposed credential checking.
	ExposedCredentialCheck param.Field[CompressResponseRuleExposedCredentialCheckParam] `json:"exposed_credential_check"`
	// 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"`
	// An object configuring the rule's rate limit behavior.
	Ratelimit param.Field[CompressResponseRuleRatelimitParam] `json:"ratelimit"`
	// The reference of the rule (the rule's ID by default).
	Ref param.Field[string] `json:"ref"`
}

func (CompressResponseRuleParam) MarshalJSON

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

type CompressResponseRuleRatelimit

type CompressResponseRuleRatelimit struct {
	// Characteristics of the request on which the rate limit counter will be
	// incremented.
	Characteristics []string `json:"characteristics,required"`
	// Period in seconds over which the counter is being incremented.
	Period int64 `json:"period,required"`
	// An expression that defines when the rate limit counter should be incremented. It
	// defaults to the same as the rule's expression.
	CountingExpression string `json:"counting_expression"`
	// Period of time in seconds after which the action will be disabled following its
	// first execution.
	MitigationTimeout int64 `json:"mitigation_timeout"`
	// The threshold of requests per period after which the action will be executed for
	// the first time.
	RequestsPerPeriod int64 `json:"requests_per_period"`
	// Whether counting is only performed when an origin is reached.
	RequestsToOrigin bool `json:"requests_to_origin"`
	// The score threshold per period for which the action will be executed the first
	// time.
	ScorePerPeriod int64 `json:"score_per_period"`
	// A response header name provided by the origin, which contains the score to
	// increment rate limit counter with.
	ScoreResponseHeaderName string                            `json:"score_response_header_name"`
	JSON                    compressResponseRuleRatelimitJSON `json:"-"`
}

An object configuring the rule's rate limit behavior.

func (*CompressResponseRuleRatelimit) UnmarshalJSON

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

type CompressResponseRuleRatelimitParam

type CompressResponseRuleRatelimitParam struct {
	// Characteristics of the request on which the rate limit counter will be
	// incremented.
	Characteristics param.Field[[]string] `json:"characteristics,required"`
	// Period in seconds over which the counter is being incremented.
	Period param.Field[int64] `json:"period,required"`
	// An expression that defines when the rate limit counter should be incremented. It
	// defaults to the same as the rule's expression.
	CountingExpression param.Field[string] `json:"counting_expression"`
	// Period of time in seconds after which the action will be disabled following its
	// first execution.
	MitigationTimeout param.Field[int64] `json:"mitigation_timeout"`
	// The threshold of requests per period after which the action will be executed for
	// the first time.
	RequestsPerPeriod param.Field[int64] `json:"requests_per_period"`
	// Whether counting is only performed when an origin is reached.
	RequestsToOrigin param.Field[bool] `json:"requests_to_origin"`
	// The score threshold per period for which the action will be executed the first
	// time.
	ScorePerPeriod param.Field[int64] `json:"score_per_period"`
	// A response header name provided by the origin, which contains the score to
	// increment rate limit counter with.
	ScoreResponseHeaderName param.Field[string] `json:"score_response_header_name"`
}

An object configuring the rule's rate limit behavior.

func (CompressResponseRuleRatelimitParam) MarshalJSON

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

type DDoSDynamicRule

type DDoSDynamicRule 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 DDoSDynamicRuleAction `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"`
	// Configuration for exposed credential checking.
	ExposedCredentialCheck DDoSDynamicRuleExposedCredentialCheck `json:"exposed_credential_check"`
	// 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"`
	// An object configuring the rule's rate limit behavior.
	Ratelimit DDoSDynamicRuleRatelimit `json:"ratelimit"`
	// The reference of the rule (the rule's ID by default).
	Ref  string              `json:"ref"`
	JSON DDoSDynamicRuleJSON `json:"-"`
}

func (*DDoSDynamicRule) UnmarshalJSON

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

type DDoSDynamicRuleAction

type DDoSDynamicRuleAction string

The action to perform when the rule matches.

const (
	DDoSDynamicRuleActionDDoSDynamic DDoSDynamicRuleAction = "ddos_dynamic"
)

func (DDoSDynamicRuleAction) IsKnown

func (r DDoSDynamicRuleAction) IsKnown() bool

type DDoSDynamicRuleExposedCredentialCheck

type DDoSDynamicRuleExposedCredentialCheck struct {
	// An expression that selects the password used in the credentials check.
	PasswordExpression string `json:"password_expression,required"`
	// An expression that selects the user ID used in the credentials check.
	UsernameExpression string                                    `json:"username_expression,required"`
	JSON               DDoSDynamicRuleExposedCredentialCheckJSON `json:"-"`
}

Configuration for exposed credential checking.

func (*DDoSDynamicRuleExposedCredentialCheck) UnmarshalJSON

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

type DDoSDynamicRuleExposedCredentialCheckJSON

type DDoSDynamicRuleExposedCredentialCheckJSON struct {
	PasswordExpression apijson.Field
	UsernameExpression apijson.Field

	ExtraFields map[string]apijson.Field
	// contains filtered or unexported fields
}

DDoSDynamicRuleExposedCredentialCheckJSON contains the JSON metadata for the struct DDoSDynamicRuleExposedCredentialCheck

func (DDoSDynamicRuleExposedCredentialCheckJSON) RawJSON

type DDoSDynamicRuleExposedCredentialCheckParam

type DDoSDynamicRuleExposedCredentialCheckParam struct {
	// An expression that selects the password used in the credentials check.
	PasswordExpression param.Field[string] `json:"password_expression,required"`
	// An expression that selects the user ID used in the credentials check.
	UsernameExpression param.Field[string] `json:"username_expression,required"`
}

Configuration for exposed credential checking.

func (DDoSDynamicRuleExposedCredentialCheckParam) MarshalJSON

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

type DDoSDynamicRuleJSON

type DDoSDynamicRuleJSON struct {
	LastUpdated            apijson.Field
	Version                apijson.Field
	ID                     apijson.Field
	Action                 apijson.Field
	ActionParameters       apijson.Field
	Categories             apijson.Field
	Description            apijson.Field
	Enabled                apijson.Field
	ExposedCredentialCheck apijson.Field
	Expression             apijson.Field
	Logging                apijson.Field
	Ratelimit              apijson.Field
	Ref                    apijson.Field

	ExtraFields map[string]apijson.Field
	// contains filtered or unexported fields
}

DDoSDynamicRuleJSON contains the JSON metadata for the struct DDoSDynamicRule

func (DDoSDynamicRuleJSON) RawJSON

func (r DDoSDynamicRuleJSON) RawJSON() string

type DDoSDynamicRuleParam

type DDoSDynamicRuleParam struct {
	// The unique ID of the rule.
	ID param.Field[string] `json:"id"`
	// The action to perform when the rule matches.
	Action param.Field[DDoSDynamicRuleAction] `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"`
	// Configuration for exposed credential checking.
	ExposedCredentialCheck param.Field[DDoSDynamicRuleExposedCredentialCheckParam] `json:"exposed_credential_check"`
	// 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"`
	// An object configuring the rule's rate limit behavior.
	Ratelimit param.Field[DDoSDynamicRuleRatelimitParam] `json:"ratelimit"`
	// The reference of the rule (the rule's ID by default).
	Ref param.Field[string] `json:"ref"`
}

func (DDoSDynamicRuleParam) MarshalJSON

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

type DDoSDynamicRuleRatelimit

type DDoSDynamicRuleRatelimit struct {
	// Characteristics of the request on which the rate limit counter will be
	// incremented.
	Characteristics []string `json:"characteristics,required"`
	// Period in seconds over which the counter is being incremented.
	Period int64 `json:"period,required"`
	// An expression that defines when the rate limit counter should be incremented. It
	// defaults to the same as the rule's expression.
	CountingExpression string `json:"counting_expression"`
	// Period of time in seconds after which the action will be disabled following its
	// first execution.
	MitigationTimeout int64 `json:"mitigation_timeout"`
	// The threshold of requests per period after which the action will be executed for
	// the first time.
	RequestsPerPeriod int64 `json:"requests_per_period"`
	// Whether counting is only performed when an origin is reached.
	RequestsToOrigin bool `json:"requests_to_origin"`
	// The score threshold per period for which the action will be executed the first
	// time.
	ScorePerPeriod int64 `json:"score_per_period"`
	// A response header name provided by the origin, which contains the score to
	// increment rate limit counter with.
	ScoreResponseHeaderName string                       `json:"score_response_header_name"`
	JSON                    DDoSDynamicRuleRatelimitJSON `json:"-"`
}

An object configuring the rule's rate limit behavior.

func (*DDoSDynamicRuleRatelimit) UnmarshalJSON

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

type DDoSDynamicRuleRatelimitJSON

type DDoSDynamicRuleRatelimitJSON struct {
	Characteristics         apijson.Field
	Period                  apijson.Field
	CountingExpression      apijson.Field
	MitigationTimeout       apijson.Field
	RequestsPerPeriod       apijson.Field
	RequestsToOrigin        apijson.Field
	ScorePerPeriod          apijson.Field
	ScoreResponseHeaderName apijson.Field

	ExtraFields map[string]apijson.Field
	// contains filtered or unexported fields
}

DDoSDynamicRuleRatelimitJSON contains the JSON metadata for the struct DDoSDynamicRuleRatelimit

func (DDoSDynamicRuleRatelimitJSON) RawJSON

type DDoSDynamicRuleRatelimitParam

type DDoSDynamicRuleRatelimitParam struct {
	// Characteristics of the request on which the rate limit counter will be
	// incremented.
	Characteristics param.Field[[]string] `json:"characteristics,required"`
	// Period in seconds over which the counter is being incremented.
	Period param.Field[int64] `json:"period,required"`
	// An expression that defines when the rate limit counter should be incremented. It
	// defaults to the same as the rule's expression.
	CountingExpression param.Field[string] `json:"counting_expression"`
	// Period of time in seconds after which the action will be disabled following its
	// first execution.
	MitigationTimeout param.Field[int64] `json:"mitigation_timeout"`
	// The threshold of requests per period after which the action will be executed for
	// the first time.
	RequestsPerPeriod param.Field[int64] `json:"requests_per_period"`
	// Whether counting is only performed when an origin is reached.
	RequestsToOrigin param.Field[bool] `json:"requests_to_origin"`
	// The score threshold per period for which the action will be executed the first
	// time.
	ScorePerPeriod param.Field[int64] `json:"score_per_period"`
	// A response header name provided by the origin, which contains the score to
	// increment rate limit counter with.
	ScoreResponseHeaderName param.Field[string] `json:"score_response_header_name"`
}

An object configuring the rule's rate limit behavior.

func (DDoSDynamicRuleRatelimitParam) MarshalJSON

func (r DDoSDynamicRuleRatelimitParam) 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 ErrorDataSource

type ErrorDataSource = shared.ErrorDataSource

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"`
	// Configuration for exposed credential checking.
	ExposedCredentialCheck ExecuteRuleExposedCredentialCheck `json:"exposed_credential_check"`
	// 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"`
	// An object configuring the rule's rate limit behavior.
	Ratelimit ExecuteRuleRatelimit `json:"ratelimit"`
	// The reference of the rule (the rule's 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. This option is only applicable for DDoS phases.

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. This option is only
	// applicable for DDoS phases.
	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. This option is only
	// applicable for DDoS phases.
	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. This option is only applicable for
	// DDoS phases.
	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. This option is only applicable for
	// DDoS phases.
	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. This option is only applicable for DDoS phases.

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 ExecuteRuleExposedCredentialCheck

type ExecuteRuleExposedCredentialCheck struct {
	// An expression that selects the password used in the credentials check.
	PasswordExpression string `json:"password_expression,required"`
	// An expression that selects the user ID used in the credentials check.
	UsernameExpression string                                `json:"username_expression,required"`
	JSON               executeRuleExposedCredentialCheckJSON `json:"-"`
}

Configuration for exposed credential checking.

func (*ExecuteRuleExposedCredentialCheck) UnmarshalJSON

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

type ExecuteRuleExposedCredentialCheckParam

type ExecuteRuleExposedCredentialCheckParam struct {
	// An expression that selects the password used in the credentials check.
	PasswordExpression param.Field[string] `json:"password_expression,required"`
	// An expression that selects the user ID used in the credentials check.
	UsernameExpression param.Field[string] `json:"username_expression,required"`
}

Configuration for exposed credential checking.

func (ExecuteRuleExposedCredentialCheckParam) MarshalJSON

func (r ExecuteRuleExposedCredentialCheckParam) 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"`
	// Configuration for exposed credential checking.
	ExposedCredentialCheck param.Field[ExecuteRuleExposedCredentialCheckParam] `json:"exposed_credential_check"`
	// 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"`
	// An object configuring the rule's rate limit behavior.
	Ratelimit param.Field[ExecuteRuleRatelimitParam] `json:"ratelimit"`
	// The reference of the rule (the rule's ID by default).
	Ref param.Field[string] `json:"ref"`
}

func (ExecuteRuleParam) MarshalJSON

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

type ExecuteRuleRatelimit

type ExecuteRuleRatelimit struct {
	// Characteristics of the request on which the rate limit counter will be
	// incremented.
	Characteristics []string `json:"characteristics,required"`
	// Period in seconds over which the counter is being incremented.
	Period int64 `json:"period,required"`
	// An expression that defines when the rate limit counter should be incremented. It
	// defaults to the same as the rule's expression.
	CountingExpression string `json:"counting_expression"`
	// Period of time in seconds after which the action will be disabled following its
	// first execution.
	MitigationTimeout int64 `json:"mitigation_timeout"`
	// The threshold of requests per period after which the action will be executed for
	// the first time.
	RequestsPerPeriod int64 `json:"requests_per_period"`
	// Whether counting is only performed when an origin is reached.
	RequestsToOrigin bool `json:"requests_to_origin"`
	// The score threshold per period for which the action will be executed the first
	// time.
	ScorePerPeriod int64 `json:"score_per_period"`
	// A response header name provided by the origin, which contains the score to
	// increment rate limit counter with.
	ScoreResponseHeaderName string                   `json:"score_response_header_name"`
	JSON                    executeRuleRatelimitJSON `json:"-"`
}

An object configuring the rule's rate limit behavior.

func (*ExecuteRuleRatelimit) UnmarshalJSON

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

type ExecuteRuleRatelimitParam

type ExecuteRuleRatelimitParam struct {
	// Characteristics of the request on which the rate limit counter will be
	// incremented.
	Characteristics param.Field[[]string] `json:"characteristics,required"`
	// Period in seconds over which the counter is being incremented.
	Period param.Field[int64] `json:"period,required"`
	// An expression that defines when the rate limit counter should be incremented. It
	// defaults to the same as the rule's expression.
	CountingExpression param.Field[string] `json:"counting_expression"`
	// Period of time in seconds after which the action will be disabled following its
	// first execution.
	MitigationTimeout param.Field[int64] `json:"mitigation_timeout"`
	// The threshold of requests per period after which the action will be executed for
	// the first time.
	RequestsPerPeriod param.Field[int64] `json:"requests_per_period"`
	// Whether counting is only performed when an origin is reached.
	RequestsToOrigin param.Field[bool] `json:"requests_to_origin"`
	// The score threshold per period for which the action will be executed the first
	// time.
	ScorePerPeriod param.Field[int64] `json:"score_per_period"`
	// A response header name provided by the origin, which contains the score to
	// increment rate limit counter with.
	ScoreResponseHeaderName param.Field[string] `json:"score_response_header_name"`
}

An object configuring the rule's rate limit behavior.

func (ExecuteRuleRatelimitParam) MarshalJSON

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

type ForceConnectionCloseRule

type ForceConnectionCloseRule 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 ForceConnectionCloseRuleAction `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"`
	// Configuration for exposed credential checking.
	ExposedCredentialCheck ForceConnectionCloseRuleExposedCredentialCheck `json:"exposed_credential_check"`
	// 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"`
	// An object configuring the rule's rate limit behavior.
	Ratelimit ForceConnectionCloseRuleRatelimit `json:"ratelimit"`
	// The reference of the rule (the rule's ID by default).
	Ref  string                       `json:"ref"`
	JSON forceConnectionCloseRuleJSON `json:"-"`
}

func (*ForceConnectionCloseRule) UnmarshalJSON

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

type ForceConnectionCloseRuleAction

type ForceConnectionCloseRuleAction string

The action to perform when the rule matches.

const (
	ForceConnectionCloseRuleActionForceConnectionClose ForceConnectionCloseRuleAction = "force_connection_close"
)

func (ForceConnectionCloseRuleAction) IsKnown

type ForceConnectionCloseRuleExposedCredentialCheck

type ForceConnectionCloseRuleExposedCredentialCheck struct {
	// An expression that selects the password used in the credentials check.
	PasswordExpression string `json:"password_expression,required"`
	// An expression that selects the user ID used in the credentials check.
	UsernameExpression string                                             `json:"username_expression,required"`
	JSON               forceConnectionCloseRuleExposedCredentialCheckJSON `json:"-"`
}

Configuration for exposed credential checking.

func (*ForceConnectionCloseRuleExposedCredentialCheck) UnmarshalJSON

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

type ForceConnectionCloseRuleExposedCredentialCheckParam

type ForceConnectionCloseRuleExposedCredentialCheckParam struct {
	// An expression that selects the password used in the credentials check.
	PasswordExpression param.Field[string] `json:"password_expression,required"`
	// An expression that selects the user ID used in the credentials check.
	UsernameExpression param.Field[string] `json:"username_expression,required"`
}

Configuration for exposed credential checking.

func (ForceConnectionCloseRuleExposedCredentialCheckParam) MarshalJSON

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

type ForceConnectionCloseRuleParam

type ForceConnectionCloseRuleParam struct {
	// The unique ID of the rule.
	ID param.Field[string] `json:"id"`
	// The action to perform when the rule matches.
	Action param.Field[ForceConnectionCloseRuleAction] `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"`
	// Configuration for exposed credential checking.
	ExposedCredentialCheck param.Field[ForceConnectionCloseRuleExposedCredentialCheckParam] `json:"exposed_credential_check"`
	// 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"`
	// An object configuring the rule's rate limit behavior.
	Ratelimit param.Field[ForceConnectionCloseRuleRatelimitParam] `json:"ratelimit"`
	// The reference of the rule (the rule's ID by default).
	Ref param.Field[string] `json:"ref"`
}

func (ForceConnectionCloseRuleParam) MarshalJSON

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

type ForceConnectionCloseRuleRatelimit

type ForceConnectionCloseRuleRatelimit struct {
	// Characteristics of the request on which the rate limit counter will be
	// incremented.
	Characteristics []string `json:"characteristics,required"`
	// Period in seconds over which the counter is being incremented.
	Period int64 `json:"period,required"`
	// An expression that defines when the rate limit counter should be incremented. It
	// defaults to the same as the rule's expression.
	CountingExpression string `json:"counting_expression"`
	// Period of time in seconds after which the action will be disabled following its
	// first execution.
	MitigationTimeout int64 `json:"mitigation_timeout"`
	// The threshold of requests per period after which the action will be executed for
	// the first time.
	RequestsPerPeriod int64 `json:"requests_per_period"`
	// Whether counting is only performed when an origin is reached.
	RequestsToOrigin bool `json:"requests_to_origin"`
	// The score threshold per period for which the action will be executed the first
	// time.
	ScorePerPeriod int64 `json:"score_per_period"`
	// A response header name provided by the origin, which contains the score to
	// increment rate limit counter with.
	ScoreResponseHeaderName string                                `json:"score_response_header_name"`
	JSON                    forceConnectionCloseRuleRatelimitJSON `json:"-"`
}

An object configuring the rule's rate limit behavior.

func (*ForceConnectionCloseRuleRatelimit) UnmarshalJSON

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

type ForceConnectionCloseRuleRatelimitParam

type ForceConnectionCloseRuleRatelimitParam struct {
	// Characteristics of the request on which the rate limit counter will be
	// incremented.
	Characteristics param.Field[[]string] `json:"characteristics,required"`
	// Period in seconds over which the counter is being incremented.
	Period param.Field[int64] `json:"period,required"`
	// An expression that defines when the rate limit counter should be incremented. It
	// defaults to the same as the rule's expression.
	CountingExpression param.Field[string] `json:"counting_expression"`
	// Period of time in seconds after which the action will be disabled following its
	// first execution.
	MitigationTimeout param.Field[int64] `json:"mitigation_timeout"`
	// The threshold of requests per period after which the action will be executed for
	// the first time.
	RequestsPerPeriod param.Field[int64] `json:"requests_per_period"`
	// Whether counting is only performed when an origin is reached.
	RequestsToOrigin param.Field[bool] `json:"requests_to_origin"`
	// The score threshold per period for which the action will be executed the first
	// time.
	ScorePerPeriod param.Field[int64] `json:"score_per_period"`
	// A response header name provided by the origin, which contains the score to
	// increment rate limit counter with.
	ScoreResponseHeaderName param.Field[string] `json:"score_response_header_name"`
}

An object configuring the rule's rate limit behavior.

func (ForceConnectionCloseRuleRatelimitParam) MarshalJSON

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

type Kind

type Kind string

The kind of the ruleset.

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

func (Kind) IsKnown

func (r Kind) IsKnown() bool

type LogCustomFieldRule

type LogCustomFieldRule 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 LogCustomFieldRuleAction `json:"action"`
	// The parameters configuring the rule's action.
	ActionParameters LogCustomFieldRuleActionParameters `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"`
	// Configuration for exposed credential checking.
	ExposedCredentialCheck LogCustomFieldRuleExposedCredentialCheck `json:"exposed_credential_check"`
	// 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"`
	// An object configuring the rule's rate limit behavior.
	Ratelimit LogCustomFieldRuleRatelimit `json:"ratelimit"`
	// The reference of the rule (the rule's ID by default).
	Ref  string                 `json:"ref"`
	JSON logCustomFieldRuleJSON `json:"-"`
}

func (*LogCustomFieldRule) UnmarshalJSON

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

type LogCustomFieldRuleAction

type LogCustomFieldRuleAction string

The action to perform when the rule matches.

const (
	LogCustomFieldRuleActionLogCustomField LogCustomFieldRuleAction = "log_custom_field"
)

func (LogCustomFieldRuleAction) IsKnown

func (r LogCustomFieldRuleAction) IsKnown() bool

type LogCustomFieldRuleActionParameters

type LogCustomFieldRuleActionParameters struct {
	// The cookie fields to log.
	CookieFields []LogCustomFieldRuleActionParametersCookieField `json:"cookie_fields"`
	// The raw response fields to log.
	RawResponseFields []LogCustomFieldRuleActionParametersRawResponseField `json:"raw_response_fields"`
	// The raw request fields to log.
	RequestFields []LogCustomFieldRuleActionParametersRequestField `json:"request_fields"`
	// The transformed response fields to log.
	ResponseFields []LogCustomFieldRuleActionParametersResponseField `json:"response_fields"`
	// The transformed request fields to log.
	TransformedRequestFields []LogCustomFieldRuleActionParametersTransformedRequestField `json:"transformed_request_fields"`
	JSON                     logCustomFieldRuleActionParametersJSON                      `json:"-"`
}

The parameters configuring the rule's action.

func (*LogCustomFieldRuleActionParameters) UnmarshalJSON

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

type LogCustomFieldRuleActionParametersCookieField

type LogCustomFieldRuleActionParametersCookieField struct {
	// The name of the cookie.
	Name string                                            `json:"name,required"`
	JSON logCustomFieldRuleActionParametersCookieFieldJSON `json:"-"`
}

The cookie field to log.

func (*LogCustomFieldRuleActionParametersCookieField) UnmarshalJSON

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

type LogCustomFieldRuleActionParametersCookieFieldParam

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

The cookie field to log.

func (LogCustomFieldRuleActionParametersCookieFieldParam) MarshalJSON

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

type LogCustomFieldRuleActionParametersParam

type LogCustomFieldRuleActionParametersParam struct {
	// The cookie fields to log.
	CookieFields param.Field[[]LogCustomFieldRuleActionParametersCookieFieldParam] `json:"cookie_fields"`
	// The raw response fields to log.
	RawResponseFields param.Field[[]LogCustomFieldRuleActionParametersRawResponseFieldParam] `json:"raw_response_fields"`
	// The raw request fields to log.
	RequestFields param.Field[[]LogCustomFieldRuleActionParametersRequestFieldParam] `json:"request_fields"`
	// The transformed response fields to log.
	ResponseFields param.Field[[]LogCustomFieldRuleActionParametersResponseFieldParam] `json:"response_fields"`
	// The transformed request fields to log.
	TransformedRequestFields param.Field[[]LogCustomFieldRuleActionParametersTransformedRequestFieldParam] `json:"transformed_request_fields"`
}

The parameters configuring the rule's action.

func (LogCustomFieldRuleActionParametersParam) MarshalJSON

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

type LogCustomFieldRuleActionParametersRawResponseField

type LogCustomFieldRuleActionParametersRawResponseField struct {
	// The name of the response header.
	Name string `json:"name,required"`
	// Whether to log duplicate values of the same header.
	PreserveDuplicates bool                                                   `json:"preserve_duplicates"`
	JSON               logCustomFieldRuleActionParametersRawResponseFieldJSON `json:"-"`
}

The raw response field to log.

func (*LogCustomFieldRuleActionParametersRawResponseField) UnmarshalJSON

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

type LogCustomFieldRuleActionParametersRawResponseFieldParam

type LogCustomFieldRuleActionParametersRawResponseFieldParam struct {
	// The name of the response header.
	Name param.Field[string] `json:"name,required"`
	// Whether to log duplicate values of the same header.
	PreserveDuplicates param.Field[bool] `json:"preserve_duplicates"`
}

The raw response field to log.

func (LogCustomFieldRuleActionParametersRawResponseFieldParam) MarshalJSON

type LogCustomFieldRuleActionParametersRequestField

type LogCustomFieldRuleActionParametersRequestField struct {
	// The name of the header.
	Name string                                             `json:"name,required"`
	JSON logCustomFieldRuleActionParametersRequestFieldJSON `json:"-"`
}

The raw request field to log.

func (*LogCustomFieldRuleActionParametersRequestField) UnmarshalJSON

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

type LogCustomFieldRuleActionParametersRequestFieldParam

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

The raw request field to log.

func (LogCustomFieldRuleActionParametersRequestFieldParam) MarshalJSON

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

type LogCustomFieldRuleActionParametersResponseField

type LogCustomFieldRuleActionParametersResponseField struct {
	// The name of the response header.
	Name string `json:"name,required"`
	// Whether to log duplicate values of the same header.
	PreserveDuplicates bool                                                `json:"preserve_duplicates"`
	JSON               logCustomFieldRuleActionParametersResponseFieldJSON `json:"-"`
}

The transformed response field to log.

func (*LogCustomFieldRuleActionParametersResponseField) UnmarshalJSON

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

type LogCustomFieldRuleActionParametersResponseFieldParam

type LogCustomFieldRuleActionParametersResponseFieldParam struct {
	// The name of the response header.
	Name param.Field[string] `json:"name,required"`
	// Whether to log duplicate values of the same header.
	PreserveDuplicates param.Field[bool] `json:"preserve_duplicates"`
}

The transformed response field to log.

func (LogCustomFieldRuleActionParametersResponseFieldParam) MarshalJSON

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

type LogCustomFieldRuleActionParametersTransformedRequestField

type LogCustomFieldRuleActionParametersTransformedRequestField struct {
	// The name of the header.
	Name string                                                        `json:"name,required"`
	JSON logCustomFieldRuleActionParametersTransformedRequestFieldJSON `json:"-"`
}

The transformed request field to log.

func (*LogCustomFieldRuleActionParametersTransformedRequestField) UnmarshalJSON

type LogCustomFieldRuleActionParametersTransformedRequestFieldParam

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

The transformed request field to log.

func (LogCustomFieldRuleActionParametersTransformedRequestFieldParam) MarshalJSON

type LogCustomFieldRuleExposedCredentialCheck

type LogCustomFieldRuleExposedCredentialCheck struct {
	// An expression that selects the password used in the credentials check.
	PasswordExpression string `json:"password_expression,required"`
	// An expression that selects the user ID used in the credentials check.
	UsernameExpression string                                       `json:"username_expression,required"`
	JSON               logCustomFieldRuleExposedCredentialCheckJSON `json:"-"`
}

Configuration for exposed credential checking.

func (*LogCustomFieldRuleExposedCredentialCheck) UnmarshalJSON

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

type LogCustomFieldRuleExposedCredentialCheckParam

type LogCustomFieldRuleExposedCredentialCheckParam struct {
	// An expression that selects the password used in the credentials check.
	PasswordExpression param.Field[string] `json:"password_expression,required"`
	// An expression that selects the user ID used in the credentials check.
	UsernameExpression param.Field[string] `json:"username_expression,required"`
}

Configuration for exposed credential checking.

func (LogCustomFieldRuleExposedCredentialCheckParam) MarshalJSON

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

type LogCustomFieldRuleParam

type LogCustomFieldRuleParam struct {
	// The unique ID of the rule.
	ID param.Field[string] `json:"id"`
	// The action to perform when the rule matches.
	Action param.Field[LogCustomFieldRuleAction] `json:"action"`
	// The parameters configuring the rule's action.
	ActionParameters param.Field[LogCustomFieldRuleActionParametersParam] `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"`
	// Configuration for exposed credential checking.
	ExposedCredentialCheck param.Field[LogCustomFieldRuleExposedCredentialCheckParam] `json:"exposed_credential_check"`
	// 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"`
	// An object configuring the rule's rate limit behavior.
	Ratelimit param.Field[LogCustomFieldRuleRatelimitParam] `json:"ratelimit"`
	// The reference of the rule (the rule's ID by default).
	Ref param.Field[string] `json:"ref"`
}

func (LogCustomFieldRuleParam) MarshalJSON

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

type LogCustomFieldRuleRatelimit

type LogCustomFieldRuleRatelimit struct {
	// Characteristics of the request on which the rate limit counter will be
	// incremented.
	Characteristics []string `json:"characteristics,required"`
	// Period in seconds over which the counter is being incremented.
	Period int64 `json:"period,required"`
	// An expression that defines when the rate limit counter should be incremented. It
	// defaults to the same as the rule's expression.
	CountingExpression string `json:"counting_expression"`
	// Period of time in seconds after which the action will be disabled following its
	// first execution.
	MitigationTimeout int64 `json:"mitigation_timeout"`
	// The threshold of requests per period after which the action will be executed for
	// the first time.
	RequestsPerPeriod int64 `json:"requests_per_period"`
	// Whether counting is only performed when an origin is reached.
	RequestsToOrigin bool `json:"requests_to_origin"`
	// The score threshold per period for which the action will be executed the first
	// time.
	ScorePerPeriod int64 `json:"score_per_period"`
	// A response header name provided by the origin, which contains the score to
	// increment rate limit counter with.
	ScoreResponseHeaderName string                          `json:"score_response_header_name"`
	JSON                    logCustomFieldRuleRatelimitJSON `json:"-"`
}

An object configuring the rule's rate limit behavior.

func (*LogCustomFieldRuleRatelimit) UnmarshalJSON

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

type LogCustomFieldRuleRatelimitParam

type LogCustomFieldRuleRatelimitParam struct {
	// Characteristics of the request on which the rate limit counter will be
	// incremented.
	Characteristics param.Field[[]string] `json:"characteristics,required"`
	// Period in seconds over which the counter is being incremented.
	Period param.Field[int64] `json:"period,required"`
	// An expression that defines when the rate limit counter should be incremented. It
	// defaults to the same as the rule's expression.
	CountingExpression param.Field[string] `json:"counting_expression"`
	// Period of time in seconds after which the action will be disabled following its
	// first execution.
	MitigationTimeout param.Field[int64] `json:"mitigation_timeout"`
	// The threshold of requests per period after which the action will be executed for
	// the first time.
	RequestsPerPeriod param.Field[int64] `json:"requests_per_period"`
	// Whether counting is only performed when an origin is reached.
	RequestsToOrigin param.Field[bool] `json:"requests_to_origin"`
	// The score threshold per period for which the action will be executed the first
	// time.
	ScorePerPeriod param.Field[int64] `json:"score_per_period"`
	// A response header name provided by the origin, which contains the score to
	// increment rate limit counter with.
	ScoreResponseHeaderName param.Field[string] `json:"score_response_header_name"`
}

An object configuring the rule's rate limit behavior.

func (LogCustomFieldRuleRatelimitParam) MarshalJSON

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

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"`
	// Configuration for exposed credential checking.
	ExposedCredentialCheck LogRuleExposedCredentialCheck `json:"exposed_credential_check"`
	// 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"`
	// An object configuring the rule's rate limit behavior.
	Ratelimit LogRuleRatelimit `json:"ratelimit"`
	// The reference of the rule (the rule's 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 LogRuleExposedCredentialCheck

type LogRuleExposedCredentialCheck struct {
	// An expression that selects the password used in the credentials check.
	PasswordExpression string `json:"password_expression,required"`
	// An expression that selects the user ID used in the credentials check.
	UsernameExpression string                            `json:"username_expression,required"`
	JSON               logRuleExposedCredentialCheckJSON `json:"-"`
}

Configuration for exposed credential checking.

func (*LogRuleExposedCredentialCheck) UnmarshalJSON

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

type LogRuleExposedCredentialCheckParam

type LogRuleExposedCredentialCheckParam struct {
	// An expression that selects the password used in the credentials check.
	PasswordExpression param.Field[string] `json:"password_expression,required"`
	// An expression that selects the user ID used in the credentials check.
	UsernameExpression param.Field[string] `json:"username_expression,required"`
}

Configuration for exposed credential checking.

func (LogRuleExposedCredentialCheckParam) MarshalJSON

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

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"`
	// Configuration for exposed credential checking.
	ExposedCredentialCheck param.Field[LogRuleExposedCredentialCheckParam] `json:"exposed_credential_check"`
	// 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"`
	// An object configuring the rule's rate limit behavior.
	Ratelimit param.Field[LogRuleRatelimitParam] `json:"ratelimit"`
	// The reference of the rule (the rule's ID by default).
	Ref param.Field[string] `json:"ref"`
}

func (LogRuleParam) MarshalJSON

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

type LogRuleRatelimit

type LogRuleRatelimit struct {
	// Characteristics of the request on which the rate limit counter will be
	// incremented.
	Characteristics []string `json:"characteristics,required"`
	// Period in seconds over which the counter is being incremented.
	Period int64 `json:"period,required"`
	// An expression that defines when the rate limit counter should be incremented. It
	// defaults to the same as the rule's expression.
	CountingExpression string `json:"counting_expression"`
	// Period of time in seconds after which the action will be disabled following its
	// first execution.
	MitigationTimeout int64 `json:"mitigation_timeout"`
	// The threshold of requests per period after which the action will be executed for
	// the first time.
	RequestsPerPeriod int64 `json:"requests_per_period"`
	// Whether counting is only performed when an origin is reached.
	RequestsToOrigin bool `json:"requests_to_origin"`
	// The score threshold per period for which the action will be executed the first
	// time.
	ScorePerPeriod int64 `json:"score_per_period"`
	// A response header name provided by the origin, which contains the score to
	// increment rate limit counter with.
	ScoreResponseHeaderName string               `json:"score_response_header_name"`
	JSON                    logRuleRatelimitJSON `json:"-"`
}

An object configuring the rule's rate limit behavior.

func (*LogRuleRatelimit) UnmarshalJSON

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

type LogRuleRatelimitParam

type LogRuleRatelimitParam struct {
	// Characteristics of the request on which the rate limit counter will be
	// incremented.
	Characteristics param.Field[[]string] `json:"characteristics,required"`
	// Period in seconds over which the counter is being incremented.
	Period param.Field[int64] `json:"period,required"`
	// An expression that defines when the rate limit counter should be incremented. It
	// defaults to the same as the rule's expression.
	CountingExpression param.Field[string] `json:"counting_expression"`
	// Period of time in seconds after which the action will be disabled following its
	// first execution.
	MitigationTimeout param.Field[int64] `json:"mitigation_timeout"`
	// The threshold of requests per period after which the action will be executed for
	// the first time.
	RequestsPerPeriod param.Field[int64] `json:"requests_per_period"`
	// Whether counting is only performed when an origin is reached.
	RequestsToOrigin param.Field[bool] `json:"requests_to_origin"`
	// The score threshold per period for which the action will be executed the first
	// time.
	ScorePerPeriod param.Field[int64] `json:"score_per_period"`
	// A response header name provided by the origin, which contains the score to
	// increment rate limit counter with.
	ScoreResponseHeaderName param.Field[string] `json:"score_response_header_name"`
}

An object configuring the rule's rate limit behavior.

func (LogRuleRatelimitParam) MarshalJSON

func (r LogRuleRatelimitParam) 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"`
	// Configuration for exposed credential checking.
	ExposedCredentialCheck ManagedChallengeRuleExposedCredentialCheck `json:"exposed_credential_check"`
	// 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"`
	// An object configuring the rule's rate limit behavior.
	Ratelimit ManagedChallengeRuleRatelimit `json:"ratelimit"`
	// The reference of the rule (the rule's 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 ManagedChallengeRuleExposedCredentialCheck

type ManagedChallengeRuleExposedCredentialCheck struct {
	// An expression that selects the password used in the credentials check.
	PasswordExpression string `json:"password_expression,required"`
	// An expression that selects the user ID used in the credentials check.
	UsernameExpression string                                         `json:"username_expression,required"`
	JSON               managedChallengeRuleExposedCredentialCheckJSON `json:"-"`
}

Configuration for exposed credential checking.

func (*ManagedChallengeRuleExposedCredentialCheck) UnmarshalJSON

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

type ManagedChallengeRuleExposedCredentialCheckParam

type ManagedChallengeRuleExposedCredentialCheckParam struct {
	// An expression that selects the password used in the credentials check.
	PasswordExpression param.Field[string] `json:"password_expression,required"`
	// An expression that selects the user ID used in the credentials check.
	UsernameExpression param.Field[string] `json:"username_expression,required"`
}

Configuration for exposed credential checking.

func (ManagedChallengeRuleExposedCredentialCheckParam) MarshalJSON

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

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"`
	// Configuration for exposed credential checking.
	ExposedCredentialCheck param.Field[ManagedChallengeRuleExposedCredentialCheckParam] `json:"exposed_credential_check"`
	// 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"`
	// An object configuring the rule's rate limit behavior.
	Ratelimit param.Field[ManagedChallengeRuleRatelimitParam] `json:"ratelimit"`
	// The reference of the rule (the rule's ID by default).
	Ref param.Field[string] `json:"ref"`
}

func (ManagedChallengeRuleParam) MarshalJSON

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

type ManagedChallengeRuleRatelimit

type ManagedChallengeRuleRatelimit struct {
	// Characteristics of the request on which the rate limit counter will be
	// incremented.
	Characteristics []string `json:"characteristics,required"`
	// Period in seconds over which the counter is being incremented.
	Period int64 `json:"period,required"`
	// An expression that defines when the rate limit counter should be incremented. It
	// defaults to the same as the rule's expression.
	CountingExpression string `json:"counting_expression"`
	// Period of time in seconds after which the action will be disabled following its
	// first execution.
	MitigationTimeout int64 `json:"mitigation_timeout"`
	// The threshold of requests per period after which the action will be executed for
	// the first time.
	RequestsPerPeriod int64 `json:"requests_per_period"`
	// Whether counting is only performed when an origin is reached.
	RequestsToOrigin bool `json:"requests_to_origin"`
	// The score threshold per period for which the action will be executed the first
	// time.
	ScorePerPeriod int64 `json:"score_per_period"`
	// A response header name provided by the origin, which contains the score to
	// increment rate limit counter with.
	ScoreResponseHeaderName string                            `json:"score_response_header_name"`
	JSON                    managedChallengeRuleRatelimitJSON `json:"-"`
}

An object configuring the rule's rate limit behavior.

func (*ManagedChallengeRuleRatelimit) UnmarshalJSON

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

type ManagedChallengeRuleRatelimitParam

type ManagedChallengeRuleRatelimitParam struct {
	// Characteristics of the request on which the rate limit counter will be
	// incremented.
	Characteristics param.Field[[]string] `json:"characteristics,required"`
	// Period in seconds over which the counter is being incremented.
	Period param.Field[int64] `json:"period,required"`
	// An expression that defines when the rate limit counter should be incremented. It
	// defaults to the same as the rule's expression.
	CountingExpression param.Field[string] `json:"counting_expression"`
	// Period of time in seconds after which the action will be disabled following its
	// first execution.
	MitigationTimeout param.Field[int64] `json:"mitigation_timeout"`
	// The threshold of requests per period after which the action will be executed for
	// the first time.
	RequestsPerPeriod param.Field[int64] `json:"requests_per_period"`
	// Whether counting is only performed when an origin is reached.
	RequestsToOrigin param.Field[bool] `json:"requests_to_origin"`
	// The score threshold per period for which the action will be executed the first
	// time.
	ScorePerPeriod param.Field[int64] `json:"score_per_period"`
	// A response header name provided by the origin, which contains the score to
	// increment rate limit counter with.
	ScoreResponseHeaderName param.Field[string] `json:"score_response_header_name"`
}

An object configuring the rule's rate limit behavior.

func (ManagedChallengeRuleRatelimitParam) MarshalJSON

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

type Member

type Member = shared.Member

This is an alias to an internal type.

type MemberPoliciesAccess

type MemberPoliciesAccess = shared.MemberPoliciesAccess

Allow or deny operations against the resources.

This is an alias to an internal type.

type MemberPoliciesPermissionGroup

type MemberPoliciesPermissionGroup = shared.MemberPoliciesPermissionGroup

A named group of permissions that map to a group of operations against resources.

This is an alias to an internal type.

type MemberPoliciesPermissionGroupsMeta

type MemberPoliciesPermissionGroupsMeta = shared.MemberPoliciesPermissionGroupsMeta

Attributes associated to the permission group.

This is an alias to an internal type.

type MemberPoliciesResourceGroup

type MemberPoliciesResourceGroup = shared.MemberPoliciesResourceGroup

A group of scoped resources.

This is an alias to an internal type.

type MemberPoliciesResourceGroupsMeta

type MemberPoliciesResourceGroupsMeta = shared.MemberPoliciesResourceGroupsMeta

Attributes associated to the resource group.

This is an alias to an internal type.

type MemberPoliciesResourceGroupsScope

type MemberPoliciesResourceGroupsScope = shared.MemberPoliciesResourceGroupsScope

A scope is a combination of scope objects which provides additional context.

This is an alias to an internal type.

type MemberPoliciesResourceGroupsScopeObject

type MemberPoliciesResourceGroupsScopeObject = shared.MemberPoliciesResourceGroupsScopeObject

A scope object represents any resource that can have actions applied against invite.

This is an alias to an internal type.

type MemberPolicy

type MemberPolicy = shared.MemberPolicy

This is an alias to an internal type.

type MemberStatus

type MemberStatus = shared.MemberStatus

A member's status in the account.

This is an alias to an internal type.

type MemberUser

type MemberUser = shared.MemberUser

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

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"
	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"
	PhaseMagicTransitRatelimit        Phase = "magic_transit_ratelimit"
)

func (Phase) IsKnown

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 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 PhaseGetResponseRulesAction `json:"action"`
	// This field can have the runtime type of [BlockRuleActionParameters],
	// [interface{}], [CompressResponseRuleActionParameters],
	// [ExecuteRuleActionParameters], [LogCustomFieldRuleActionParameters],
	// [RedirectRuleActionParameters], [RewriteRuleActionParameters],
	// [RouteRuleActionParameters], [ScoreRuleActionParameters],
	// [ServeErrorRuleActionParameters], [SetCacheSettingsRuleActionParameters],
	// [SetConfigRuleActionParameters], [SkipRuleActionParameters].
	ActionParameters interface{} `json:"action_parameters"`
	// This field can have the runtime type of [[]string].
	Categories interface{} `json:"categories"`
	// An informative description of the rule.
	Description string `json:"description"`
	// Whether the rule should be executed.
	Enabled bool `json:"enabled"`
	// This field can have the runtime type of [BlockRuleExposedCredentialCheck],
	// [PhaseGetResponseRulesRulesetsChallengeRuleExposedCredentialCheck],
	// [CompressResponseRuleExposedCredentialCheck],
	// [DDoSDynamicRuleExposedCredentialCheck], [ExecuteRuleExposedCredentialCheck],
	// [ForceConnectionCloseRuleExposedCredentialCheck],
	// [PhaseGetResponseRulesRulesetsJSChallengeRuleExposedCredentialCheck],
	// [LogRuleExposedCredentialCheck], [LogCustomFieldRuleExposedCredentialCheck],
	// [ManagedChallengeRuleExposedCredentialCheck],
	// [RedirectRuleExposedCredentialCheck], [RewriteRuleExposedCredentialCheck],
	// [RouteRuleExposedCredentialCheck], [ScoreRuleExposedCredentialCheck],
	// [ServeErrorRuleExposedCredentialCheck],
	// [SetCacheSettingsRuleExposedCredentialCheck],
	// [SetConfigRuleExposedCredentialCheck], [SkipRuleExposedCredentialCheck].
	ExposedCredentialCheck interface{} `json:"exposed_credential_check"`
	// 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"`
	// This field can have the runtime type of [BlockRuleRatelimit],
	// [PhaseGetResponseRulesRulesetsChallengeRuleRatelimit],
	// [CompressResponseRuleRatelimit], [DDoSDynamicRuleRatelimit],
	// [ExecuteRuleRatelimit], [ForceConnectionCloseRuleRatelimit],
	// [PhaseGetResponseRulesRulesetsJSChallengeRuleRatelimit], [LogRuleRatelimit],
	// [LogCustomFieldRuleRatelimit], [ManagedChallengeRuleRatelimit],
	// [RedirectRuleRatelimit], [RewriteRuleRatelimit], [RouteRuleRatelimit],
	// [ScoreRuleRatelimit], [ServeErrorRuleRatelimit],
	// [SetCacheSettingsRuleRatelimit], [SetConfigRuleRatelimit], [SkipRuleRatelimit].
	Ratelimit interface{} `json:"ratelimit"`
	// The reference of the rule (the rule's ID by default).
	Ref  string                   `json:"ref"`
	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"
	PhaseGetResponseRulesActionDDoSDynamic          PhaseGetResponseRulesAction = "ddos_dynamic"
	PhaseGetResponseRulesActionExecute              PhaseGetResponseRulesAction = "execute"
	PhaseGetResponseRulesActionForceConnectionClose PhaseGetResponseRulesAction = "force_connection_close"
	PhaseGetResponseRulesActionJSChallenge          PhaseGetResponseRulesAction = "js_challenge"
	PhaseGetResponseRulesActionLog                  PhaseGetResponseRulesAction = "log"
	PhaseGetResponseRulesActionLogCustomField       PhaseGetResponseRulesAction = "log_custom_field"
	PhaseGetResponseRulesActionManagedChallenge     PhaseGetResponseRulesAction = "managed_challenge"
	PhaseGetResponseRulesActionRedirect             PhaseGetResponseRulesAction = "redirect"
	PhaseGetResponseRulesActionRewrite              PhaseGetResponseRulesAction = "rewrite"
	PhaseGetResponseRulesActionRoute                PhaseGetResponseRulesAction = "route"
	PhaseGetResponseRulesActionScore                PhaseGetResponseRulesAction = "score"
	PhaseGetResponseRulesActionServeError           PhaseGetResponseRulesAction = "serve_error"
	PhaseGetResponseRulesActionSetCacheSettings     PhaseGetResponseRulesAction = "set_cache_settings"
	PhaseGetResponseRulesActionSetConfig            PhaseGetResponseRulesAction = "set_config"
	PhaseGetResponseRulesActionSkip                 PhaseGetResponseRulesAction = "skip"
)

func (PhaseGetResponseRulesAction) IsKnown

func (r PhaseGetResponseRulesAction) IsKnown() bool

type PhaseGetResponseRulesRulesetsChallengeRule

type PhaseGetResponseRulesRulesetsChallengeRule 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 PhaseGetResponseRulesRulesetsChallengeRuleAction `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"`
	// Configuration for exposed credential checking.
	ExposedCredentialCheck PhaseGetResponseRulesRulesetsChallengeRuleExposedCredentialCheck `json:"exposed_credential_check"`
	// 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"`
	// An object configuring the rule's rate limit behavior.
	Ratelimit PhaseGetResponseRulesRulesetsChallengeRuleRatelimit `json:"ratelimit"`
	// The reference of the rule (the rule's ID by default).
	Ref  string                                         `json:"ref"`
	JSON phaseGetResponseRulesRulesetsChallengeRuleJSON `json:"-"`
}

func (*PhaseGetResponseRulesRulesetsChallengeRule) UnmarshalJSON

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

type PhaseGetResponseRulesRulesetsChallengeRuleAction

type PhaseGetResponseRulesRulesetsChallengeRuleAction string

The action to perform when the rule matches.

const (
	PhaseGetResponseRulesRulesetsChallengeRuleActionChallenge PhaseGetResponseRulesRulesetsChallengeRuleAction = "challenge"
)

func (PhaseGetResponseRulesRulesetsChallengeRuleAction) IsKnown

type PhaseGetResponseRulesRulesetsChallengeRuleExposedCredentialCheck

type PhaseGetResponseRulesRulesetsChallengeRuleExposedCredentialCheck struct {
	// An expression that selects the password used in the credentials check.
	PasswordExpression string `json:"password_expression,required"`
	// An expression that selects the user ID used in the credentials check.
	UsernameExpression string                                                               `json:"username_expression,required"`
	JSON               phaseGetResponseRulesRulesetsChallengeRuleExposedCredentialCheckJSON `json:"-"`
}

Configuration for exposed credential checking.

func (*PhaseGetResponseRulesRulesetsChallengeRuleExposedCredentialCheck) UnmarshalJSON

type PhaseGetResponseRulesRulesetsChallengeRuleRatelimit

type PhaseGetResponseRulesRulesetsChallengeRuleRatelimit struct {
	// Characteristics of the request on which the rate limit counter will be
	// incremented.
	Characteristics []string `json:"characteristics,required"`
	// Period in seconds over which the counter is being incremented.
	Period int64 `json:"period,required"`
	// An expression that defines when the rate limit counter should be incremented. It
	// defaults to the same as the rule's expression.
	CountingExpression string `json:"counting_expression"`
	// Period of time in seconds after which the action will be disabled following its
	// first execution.
	MitigationTimeout int64 `json:"mitigation_timeout"`
	// The threshold of requests per period after which the action will be executed for
	// the first time.
	RequestsPerPeriod int64 `json:"requests_per_period"`
	// Whether counting is only performed when an origin is reached.
	RequestsToOrigin bool `json:"requests_to_origin"`
	// The score threshold per period for which the action will be executed the first
	// time.
	ScorePerPeriod int64 `json:"score_per_period"`
	// A response header name provided by the origin, which contains the score to
	// increment rate limit counter with.
	ScoreResponseHeaderName string                                                  `json:"score_response_header_name"`
	JSON                    phaseGetResponseRulesRulesetsChallengeRuleRatelimitJSON `json:"-"`
}

An object configuring the rule's rate limit behavior.

func (*PhaseGetResponseRulesRulesetsChallengeRuleRatelimit) UnmarshalJSON

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

type PhaseGetResponseRulesRulesetsJSChallengeRule

type PhaseGetResponseRulesRulesetsJSChallengeRule 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 PhaseGetResponseRulesRulesetsJSChallengeRuleAction `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"`
	// Configuration for exposed credential checking.
	ExposedCredentialCheck PhaseGetResponseRulesRulesetsJSChallengeRuleExposedCredentialCheck `json:"exposed_credential_check"`
	// 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"`
	// An object configuring the rule's rate limit behavior.
	Ratelimit PhaseGetResponseRulesRulesetsJSChallengeRuleRatelimit `json:"ratelimit"`
	// The reference of the rule (the rule's ID by default).
	Ref  string                                           `json:"ref"`
	JSON phaseGetResponseRulesRulesetsJSChallengeRuleJSON `json:"-"`
}

func (*PhaseGetResponseRulesRulesetsJSChallengeRule) UnmarshalJSON

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

type PhaseGetResponseRulesRulesetsJSChallengeRuleAction

type PhaseGetResponseRulesRulesetsJSChallengeRuleAction string

The action to perform when the rule matches.

const (
	PhaseGetResponseRulesRulesetsJSChallengeRuleActionJSChallenge PhaseGetResponseRulesRulesetsJSChallengeRuleAction = "js_challenge"
)

func (PhaseGetResponseRulesRulesetsJSChallengeRuleAction) IsKnown

type PhaseGetResponseRulesRulesetsJSChallengeRuleExposedCredentialCheck

type PhaseGetResponseRulesRulesetsJSChallengeRuleExposedCredentialCheck struct {
	// An expression that selects the password used in the credentials check.
	PasswordExpression string `json:"password_expression,required"`
	// An expression that selects the user ID used in the credentials check.
	UsernameExpression string                                                                 `json:"username_expression,required"`
	JSON               phaseGetResponseRulesRulesetsJSChallengeRuleExposedCredentialCheckJSON `json:"-"`
}

Configuration for exposed credential checking.

func (*PhaseGetResponseRulesRulesetsJSChallengeRuleExposedCredentialCheck) UnmarshalJSON

type PhaseGetResponseRulesRulesetsJSChallengeRuleRatelimit

type PhaseGetResponseRulesRulesetsJSChallengeRuleRatelimit struct {
	// Characteristics of the request on which the rate limit counter will be
	// incremented.
	Characteristics []string `json:"characteristics,required"`
	// Period in seconds over which the counter is being incremented.
	Period int64 `json:"period,required"`
	// An expression that defines when the rate limit counter should be incremented. It
	// defaults to the same as the rule's expression.
	CountingExpression string `json:"counting_expression"`
	// Period of time in seconds after which the action will be disabled following its
	// first execution.
	MitigationTimeout int64 `json:"mitigation_timeout"`
	// The threshold of requests per period after which the action will be executed for
	// the first time.
	RequestsPerPeriod int64 `json:"requests_per_period"`
	// Whether counting is only performed when an origin is reached.
	RequestsToOrigin bool `json:"requests_to_origin"`
	// The score threshold per period for which the action will be executed the first
	// time.
	ScorePerPeriod int64 `json:"score_per_period"`
	// A response header name provided by the origin, which contains the score to
	// increment rate limit counter with.
	ScoreResponseHeaderName string                                                    `json:"score_response_header_name"`
	JSON                    phaseGetResponseRulesRulesetsJSChallengeRuleRatelimitJSON `json:"-"`
}

An object configuring the rule's rate limit behavior.

func (*PhaseGetResponseRulesRulesetsJSChallengeRuleRatelimit) UnmarshalJSON

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

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 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"`
	// The list of rules in the ruleset.
	Rules param.Field[[]PhaseUpdateParamsRuleUnion] `json:"rules"`
}

func (PhaseUpdateParams) MarshalJSON

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

type PhaseUpdateParamsRule

type PhaseUpdateParamsRule struct {
	// The unique ID of the rule.
	ID param.Field[string] `json:"id"`
	// The action to perform when the rule matches.
	Action           param.Field[PhaseUpdateParamsRulesAction] `json:"action"`
	ActionParameters param.Field[interface{}]                  `json:"action_parameters"`
	Categories       param.Field[interface{}]                  `json:"categories"`
	// An informative description of the rule.
	Description param.Field[string] `json:"description"`
	// Whether the rule should be executed.
	Enabled                param.Field[bool]        `json:"enabled"`
	ExposedCredentialCheck param.Field[interface{}] `json:"exposed_credential_check"`
	// 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"`
	Ratelimit param.Field[interface{}]  `json:"ratelimit"`
	// The reference of the rule (the rule's 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"
	PhaseUpdateParamsRulesActionDDoSDynamic          PhaseUpdateParamsRulesAction = "ddos_dynamic"
	PhaseUpdateParamsRulesActionExecute              PhaseUpdateParamsRulesAction = "execute"
	PhaseUpdateParamsRulesActionForceConnectionClose PhaseUpdateParamsRulesAction = "force_connection_close"
	PhaseUpdateParamsRulesActionJSChallenge          PhaseUpdateParamsRulesAction = "js_challenge"
	PhaseUpdateParamsRulesActionLog                  PhaseUpdateParamsRulesAction = "log"
	PhaseUpdateParamsRulesActionLogCustomField       PhaseUpdateParamsRulesAction = "log_custom_field"
	PhaseUpdateParamsRulesActionManagedChallenge     PhaseUpdateParamsRulesAction = "managed_challenge"
	PhaseUpdateParamsRulesActionRedirect             PhaseUpdateParamsRulesAction = "redirect"
	PhaseUpdateParamsRulesActionRewrite              PhaseUpdateParamsRulesAction = "rewrite"
	PhaseUpdateParamsRulesActionRoute                PhaseUpdateParamsRulesAction = "route"
	PhaseUpdateParamsRulesActionScore                PhaseUpdateParamsRulesAction = "score"
	PhaseUpdateParamsRulesActionServeError           PhaseUpdateParamsRulesAction = "serve_error"
	PhaseUpdateParamsRulesActionSetCacheSettings     PhaseUpdateParamsRulesAction = "set_cache_settings"
	PhaseUpdateParamsRulesActionSetConfig            PhaseUpdateParamsRulesAction = "set_config"
	PhaseUpdateParamsRulesActionSkip                 PhaseUpdateParamsRulesAction = "skip"
)

func (PhaseUpdateParamsRulesAction) IsKnown

func (r PhaseUpdateParamsRulesAction) IsKnown() bool

type PhaseUpdateParamsRulesRulesetsChallengeRule

type PhaseUpdateParamsRulesRulesetsChallengeRule struct {
	// The unique ID of the rule.
	ID param.Field[string] `json:"id"`
	// The action to perform when the rule matches.
	Action param.Field[PhaseUpdateParamsRulesRulesetsChallengeRuleAction] `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"`
	// Configuration for exposed credential checking.
	ExposedCredentialCheck param.Field[PhaseUpdateParamsRulesRulesetsChallengeRuleExposedCredentialCheck] `json:"exposed_credential_check"`
	// 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"`
	// An object configuring the rule's rate limit behavior.
	Ratelimit param.Field[PhaseUpdateParamsRulesRulesetsChallengeRuleRatelimit] `json:"ratelimit"`
	// The reference of the rule (the rule's ID by default).
	Ref param.Field[string] `json:"ref"`
}

func (PhaseUpdateParamsRulesRulesetsChallengeRule) MarshalJSON

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

type PhaseUpdateParamsRulesRulesetsChallengeRuleAction

type PhaseUpdateParamsRulesRulesetsChallengeRuleAction string

The action to perform when the rule matches.

const (
	PhaseUpdateParamsRulesRulesetsChallengeRuleActionChallenge PhaseUpdateParamsRulesRulesetsChallengeRuleAction = "challenge"
)

func (PhaseUpdateParamsRulesRulesetsChallengeRuleAction) IsKnown

type PhaseUpdateParamsRulesRulesetsChallengeRuleExposedCredentialCheck

type PhaseUpdateParamsRulesRulesetsChallengeRuleExposedCredentialCheck struct {
	// An expression that selects the password used in the credentials check.
	PasswordExpression param.Field[string] `json:"password_expression,required"`
	// An expression that selects the user ID used in the credentials check.
	UsernameExpression param.Field[string] `json:"username_expression,required"`
}

Configuration for exposed credential checking.

func (PhaseUpdateParamsRulesRulesetsChallengeRuleExposedCredentialCheck) MarshalJSON

type PhaseUpdateParamsRulesRulesetsChallengeRuleRatelimit

type PhaseUpdateParamsRulesRulesetsChallengeRuleRatelimit struct {
	// Characteristics of the request on which the rate limit counter will be
	// incremented.
	Characteristics param.Field[[]string] `json:"characteristics,required"`
	// Period in seconds over which the counter is being incremented.
	Period param.Field[int64] `json:"period,required"`
	// An expression that defines when the rate limit counter should be incremented. It
	// defaults to the same as the rule's expression.
	CountingExpression param.Field[string] `json:"counting_expression"`
	// Period of time in seconds after which the action will be disabled following its
	// first execution.
	MitigationTimeout param.Field[int64] `json:"mitigation_timeout"`
	// The threshold of requests per period after which the action will be executed for
	// the first time.
	RequestsPerPeriod param.Field[int64] `json:"requests_per_period"`
	// Whether counting is only performed when an origin is reached.
	RequestsToOrigin param.Field[bool] `json:"requests_to_origin"`
	// The score threshold per period for which the action will be executed the first
	// time.
	ScorePerPeriod param.Field[int64] `json:"score_per_period"`
	// A response header name provided by the origin, which contains the score to
	// increment rate limit counter with.
	ScoreResponseHeaderName param.Field[string] `json:"score_response_header_name"`
}

An object configuring the rule's rate limit behavior.

func (PhaseUpdateParamsRulesRulesetsChallengeRuleRatelimit) MarshalJSON

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

type PhaseUpdateParamsRulesRulesetsJSChallengeRule

type PhaseUpdateParamsRulesRulesetsJSChallengeRule struct {
	// The unique ID of the rule.
	ID param.Field[string] `json:"id"`
	// The action to perform when the rule matches.
	Action param.Field[PhaseUpdateParamsRulesRulesetsJSChallengeRuleAction] `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"`
	// Configuration for exposed credential checking.
	ExposedCredentialCheck param.Field[PhaseUpdateParamsRulesRulesetsJSChallengeRuleExposedCredentialCheck] `json:"exposed_credential_check"`
	// 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"`
	// An object configuring the rule's rate limit behavior.
	Ratelimit param.Field[PhaseUpdateParamsRulesRulesetsJSChallengeRuleRatelimit] `json:"ratelimit"`
	// The reference of the rule (the rule's ID by default).
	Ref param.Field[string] `json:"ref"`
}

func (PhaseUpdateParamsRulesRulesetsJSChallengeRule) MarshalJSON

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

type PhaseUpdateParamsRulesRulesetsJSChallengeRuleAction

type PhaseUpdateParamsRulesRulesetsJSChallengeRuleAction string

The action to perform when the rule matches.

const (
	PhaseUpdateParamsRulesRulesetsJSChallengeRuleActionJSChallenge PhaseUpdateParamsRulesRulesetsJSChallengeRuleAction = "js_challenge"
)

func (PhaseUpdateParamsRulesRulesetsJSChallengeRuleAction) IsKnown

type PhaseUpdateParamsRulesRulesetsJSChallengeRuleExposedCredentialCheck

type PhaseUpdateParamsRulesRulesetsJSChallengeRuleExposedCredentialCheck struct {
	// An expression that selects the password used in the credentials check.
	PasswordExpression param.Field[string] `json:"password_expression,required"`
	// An expression that selects the user ID used in the credentials check.
	UsernameExpression param.Field[string] `json:"username_expression,required"`
}

Configuration for exposed credential checking.

func (PhaseUpdateParamsRulesRulesetsJSChallengeRuleExposedCredentialCheck) MarshalJSON

type PhaseUpdateParamsRulesRulesetsJSChallengeRuleRatelimit

type PhaseUpdateParamsRulesRulesetsJSChallengeRuleRatelimit struct {
	// Characteristics of the request on which the rate limit counter will be
	// incremented.
	Characteristics param.Field[[]string] `json:"characteristics,required"`
	// Period in seconds over which the counter is being incremented.
	Period param.Field[int64] `json:"period,required"`
	// An expression that defines when the rate limit counter should be incremented. It
	// defaults to the same as the rule's expression.
	CountingExpression param.Field[string] `json:"counting_expression"`
	// Period of time in seconds after which the action will be disabled following its
	// first execution.
	MitigationTimeout param.Field[int64] `json:"mitigation_timeout"`
	// The threshold of requests per period after which the action will be executed for
	// the first time.
	RequestsPerPeriod param.Field[int64] `json:"requests_per_period"`
	// Whether counting is only performed when an origin is reached.
	RequestsToOrigin param.Field[bool] `json:"requests_to_origin"`
	// The score threshold per period for which the action will be executed the first
	// time.
	ScorePerPeriod param.Field[int64] `json:"score_per_period"`
	// A response header name provided by the origin, which contains the score to
	// increment rate limit counter with.
	ScoreResponseHeaderName param.Field[string] `json:"score_response_header_name"`
}

An object configuring the rule's rate limit behavior.

func (PhaseUpdateParamsRulesRulesetsJSChallengeRuleRatelimit) MarshalJSON

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 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 PhaseUpdateResponseRulesAction `json:"action"`
	// This field can have the runtime type of [BlockRuleActionParameters],
	// [interface{}], [CompressResponseRuleActionParameters],
	// [ExecuteRuleActionParameters], [LogCustomFieldRuleActionParameters],
	// [RedirectRuleActionParameters], [RewriteRuleActionParameters],
	// [RouteRuleActionParameters], [ScoreRuleActionParameters],
	// [ServeErrorRuleActionParameters], [SetCacheSettingsRuleActionParameters],
	// [SetConfigRuleActionParameters], [SkipRuleActionParameters].
	ActionParameters interface{} `json:"action_parameters"`
	// This field can have the runtime type of [[]string].
	Categories interface{} `json:"categories"`
	// An informative description of the rule.
	Description string `json:"description"`
	// Whether the rule should be executed.
	Enabled bool `json:"enabled"`
	// This field can have the runtime type of [BlockRuleExposedCredentialCheck],
	// [PhaseUpdateResponseRulesRulesetsChallengeRuleExposedCredentialCheck],
	// [CompressResponseRuleExposedCredentialCheck],
	// [DDoSDynamicRuleExposedCredentialCheck], [ExecuteRuleExposedCredentialCheck],
	// [ForceConnectionCloseRuleExposedCredentialCheck],
	// [PhaseUpdateResponseRulesRulesetsJSChallengeRuleExposedCredentialCheck],
	// [LogRuleExposedCredentialCheck], [LogCustomFieldRuleExposedCredentialCheck],
	// [ManagedChallengeRuleExposedCredentialCheck],
	// [RedirectRuleExposedCredentialCheck], [RewriteRuleExposedCredentialCheck],
	// [RouteRuleExposedCredentialCheck], [ScoreRuleExposedCredentialCheck],
	// [ServeErrorRuleExposedCredentialCheck],
	// [SetCacheSettingsRuleExposedCredentialCheck],
	// [SetConfigRuleExposedCredentialCheck], [SkipRuleExposedCredentialCheck].
	ExposedCredentialCheck interface{} `json:"exposed_credential_check"`
	// 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"`
	// This field can have the runtime type of [BlockRuleRatelimit],
	// [PhaseUpdateResponseRulesRulesetsChallengeRuleRatelimit],
	// [CompressResponseRuleRatelimit], [DDoSDynamicRuleRatelimit],
	// [ExecuteRuleRatelimit], [ForceConnectionCloseRuleRatelimit],
	// [PhaseUpdateResponseRulesRulesetsJSChallengeRuleRatelimit], [LogRuleRatelimit],
	// [LogCustomFieldRuleRatelimit], [ManagedChallengeRuleRatelimit],
	// [RedirectRuleRatelimit], [RewriteRuleRatelimit], [RouteRuleRatelimit],
	// [ScoreRuleRatelimit], [ServeErrorRuleRatelimit],
	// [SetCacheSettingsRuleRatelimit], [SetConfigRuleRatelimit], [SkipRuleRatelimit].
	Ratelimit interface{} `json:"ratelimit"`
	// The reference of the rule (the rule's ID by default).
	Ref  string                      `json:"ref"`
	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"
	PhaseUpdateResponseRulesActionDDoSDynamic          PhaseUpdateResponseRulesAction = "ddos_dynamic"
	PhaseUpdateResponseRulesActionExecute              PhaseUpdateResponseRulesAction = "execute"
	PhaseUpdateResponseRulesActionForceConnectionClose PhaseUpdateResponseRulesAction = "force_connection_close"
	PhaseUpdateResponseRulesActionJSChallenge          PhaseUpdateResponseRulesAction = "js_challenge"
	PhaseUpdateResponseRulesActionLog                  PhaseUpdateResponseRulesAction = "log"
	PhaseUpdateResponseRulesActionLogCustomField       PhaseUpdateResponseRulesAction = "log_custom_field"
	PhaseUpdateResponseRulesActionManagedChallenge     PhaseUpdateResponseRulesAction = "managed_challenge"
	PhaseUpdateResponseRulesActionRedirect             PhaseUpdateResponseRulesAction = "redirect"
	PhaseUpdateResponseRulesActionRewrite              PhaseUpdateResponseRulesAction = "rewrite"
	PhaseUpdateResponseRulesActionRoute                PhaseUpdateResponseRulesAction = "route"
	PhaseUpdateResponseRulesActionScore                PhaseUpdateResponseRulesAction = "score"
	PhaseUpdateResponseRulesActionServeError           PhaseUpdateResponseRulesAction = "serve_error"
	PhaseUpdateResponseRulesActionSetCacheSettings     PhaseUpdateResponseRulesAction = "set_cache_settings"
	PhaseUpdateResponseRulesActionSetConfig            PhaseUpdateResponseRulesAction = "set_config"
	PhaseUpdateResponseRulesActionSkip                 PhaseUpdateResponseRulesAction = "skip"
)

func (PhaseUpdateResponseRulesAction) IsKnown

type PhaseUpdateResponseRulesRulesetsChallengeRule

type PhaseUpdateResponseRulesRulesetsChallengeRule 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 PhaseUpdateResponseRulesRulesetsChallengeRuleAction `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"`
	// Configuration for exposed credential checking.
	ExposedCredentialCheck PhaseUpdateResponseRulesRulesetsChallengeRuleExposedCredentialCheck `json:"exposed_credential_check"`
	// 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"`
	// An object configuring the rule's rate limit behavior.
	Ratelimit PhaseUpdateResponseRulesRulesetsChallengeRuleRatelimit `json:"ratelimit"`
	// The reference of the rule (the rule's ID by default).
	Ref  string                                            `json:"ref"`
	JSON phaseUpdateResponseRulesRulesetsChallengeRuleJSON `json:"-"`
}

func (*PhaseUpdateResponseRulesRulesetsChallengeRule) UnmarshalJSON

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

type PhaseUpdateResponseRulesRulesetsChallengeRuleAction

type PhaseUpdateResponseRulesRulesetsChallengeRuleAction string

The action to perform when the rule matches.

const (
	PhaseUpdateResponseRulesRulesetsChallengeRuleActionChallenge PhaseUpdateResponseRulesRulesetsChallengeRuleAction = "challenge"
)

func (PhaseUpdateResponseRulesRulesetsChallengeRuleAction) IsKnown

type PhaseUpdateResponseRulesRulesetsChallengeRuleExposedCredentialCheck

type PhaseUpdateResponseRulesRulesetsChallengeRuleExposedCredentialCheck struct {
	// An expression that selects the password used in the credentials check.
	PasswordExpression string `json:"password_expression,required"`
	// An expression that selects the user ID used in the credentials check.
	UsernameExpression string                                                                  `json:"username_expression,required"`
	JSON               phaseUpdateResponseRulesRulesetsChallengeRuleExposedCredentialCheckJSON `json:"-"`
}

Configuration for exposed credential checking.

func (*PhaseUpdateResponseRulesRulesetsChallengeRuleExposedCredentialCheck) UnmarshalJSON

type PhaseUpdateResponseRulesRulesetsChallengeRuleRatelimit

type PhaseUpdateResponseRulesRulesetsChallengeRuleRatelimit struct {
	// Characteristics of the request on which the rate limit counter will be
	// incremented.
	Characteristics []string `json:"characteristics,required"`
	// Period in seconds over which the counter is being incremented.
	Period int64 `json:"period,required"`
	// An expression that defines when the rate limit counter should be incremented. It
	// defaults to the same as the rule's expression.
	CountingExpression string `json:"counting_expression"`
	// Period of time in seconds after which the action will be disabled following its
	// first execution.
	MitigationTimeout int64 `json:"mitigation_timeout"`
	// The threshold of requests per period after which the action will be executed for
	// the first time.
	RequestsPerPeriod int64 `json:"requests_per_period"`
	// Whether counting is only performed when an origin is reached.
	RequestsToOrigin bool `json:"requests_to_origin"`
	// The score threshold per period for which the action will be executed the first
	// time.
	ScorePerPeriod int64 `json:"score_per_period"`
	// A response header name provided by the origin, which contains the score to
	// increment rate limit counter with.
	ScoreResponseHeaderName string                                                     `json:"score_response_header_name"`
	JSON                    phaseUpdateResponseRulesRulesetsChallengeRuleRatelimitJSON `json:"-"`
}

An object configuring the rule's rate limit behavior.

func (*PhaseUpdateResponseRulesRulesetsChallengeRuleRatelimit) UnmarshalJSON

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

type PhaseUpdateResponseRulesRulesetsJSChallengeRule

type PhaseUpdateResponseRulesRulesetsJSChallengeRule 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 PhaseUpdateResponseRulesRulesetsJSChallengeRuleAction `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"`
	// Configuration for exposed credential checking.
	ExposedCredentialCheck PhaseUpdateResponseRulesRulesetsJSChallengeRuleExposedCredentialCheck `json:"exposed_credential_check"`
	// 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"`
	// An object configuring the rule's rate limit behavior.
	Ratelimit PhaseUpdateResponseRulesRulesetsJSChallengeRuleRatelimit `json:"ratelimit"`
	// The reference of the rule (the rule's ID by default).
	Ref  string                                              `json:"ref"`
	JSON phaseUpdateResponseRulesRulesetsJSChallengeRuleJSON `json:"-"`
}

func (*PhaseUpdateResponseRulesRulesetsJSChallengeRule) UnmarshalJSON

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

type PhaseUpdateResponseRulesRulesetsJSChallengeRuleAction

type PhaseUpdateResponseRulesRulesetsJSChallengeRuleAction string

The action to perform when the rule matches.

const (
	PhaseUpdateResponseRulesRulesetsJSChallengeRuleActionJSChallenge PhaseUpdateResponseRulesRulesetsJSChallengeRuleAction = "js_challenge"
)

func (PhaseUpdateResponseRulesRulesetsJSChallengeRuleAction) IsKnown

type PhaseUpdateResponseRulesRulesetsJSChallengeRuleExposedCredentialCheck

type PhaseUpdateResponseRulesRulesetsJSChallengeRuleExposedCredentialCheck struct {
	// An expression that selects the password used in the credentials check.
	PasswordExpression string `json:"password_expression,required"`
	// An expression that selects the user ID used in the credentials check.
	UsernameExpression string                                                                    `json:"username_expression,required"`
	JSON               phaseUpdateResponseRulesRulesetsJSChallengeRuleExposedCredentialCheckJSON `json:"-"`
}

Configuration for exposed credential checking.

func (*PhaseUpdateResponseRulesRulesetsJSChallengeRuleExposedCredentialCheck) UnmarshalJSON

type PhaseUpdateResponseRulesRulesetsJSChallengeRuleRatelimit

type PhaseUpdateResponseRulesRulesetsJSChallengeRuleRatelimit struct {
	// Characteristics of the request on which the rate limit counter will be
	// incremented.
	Characteristics []string `json:"characteristics,required"`
	// Period in seconds over which the counter is being incremented.
	Period int64 `json:"period,required"`
	// An expression that defines when the rate limit counter should be incremented. It
	// defaults to the same as the rule's expression.
	CountingExpression string `json:"counting_expression"`
	// Period of time in seconds after which the action will be disabled following its
	// first execution.
	MitigationTimeout int64 `json:"mitigation_timeout"`
	// The threshold of requests per period after which the action will be executed for
	// the first time.
	RequestsPerPeriod int64 `json:"requests_per_period"`
	// Whether counting is only performed when an origin is reached.
	RequestsToOrigin bool `json:"requests_to_origin"`
	// The score threshold per period for which the action will be executed the first
	// time.
	ScorePerPeriod int64 `json:"score_per_period"`
	// A response header name provided by the origin, which contains the score to
	// increment rate limit counter with.
	ScoreResponseHeaderName string                                                       `json:"score_response_header_name"`
	JSON                    phaseUpdateResponseRulesRulesetsJSChallengeRuleRatelimitJSON `json:"-"`
}

An object configuring the rule's rate limit behavior.

func (*PhaseUpdateResponseRulesRulesetsJSChallengeRuleRatelimit) UnmarshalJSON

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 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 PhaseVersionGetResponseRulesAction `json:"action"`
	// This field can have the runtime type of [BlockRuleActionParameters],
	// [interface{}], [CompressResponseRuleActionParameters],
	// [ExecuteRuleActionParameters], [LogCustomFieldRuleActionParameters],
	// [RedirectRuleActionParameters], [RewriteRuleActionParameters],
	// [RouteRuleActionParameters], [ScoreRuleActionParameters],
	// [ServeErrorRuleActionParameters], [SetCacheSettingsRuleActionParameters],
	// [SetConfigRuleActionParameters], [SkipRuleActionParameters].
	ActionParameters interface{} `json:"action_parameters"`
	// This field can have the runtime type of [[]string].
	Categories interface{} `json:"categories"`
	// An informative description of the rule.
	Description string `json:"description"`
	// Whether the rule should be executed.
	Enabled bool `json:"enabled"`
	// This field can have the runtime type of [BlockRuleExposedCredentialCheck],
	// [PhaseVersionGetResponseRulesRulesetsChallengeRuleExposedCredentialCheck],
	// [CompressResponseRuleExposedCredentialCheck],
	// [DDoSDynamicRuleExposedCredentialCheck], [ExecuteRuleExposedCredentialCheck],
	// [ForceConnectionCloseRuleExposedCredentialCheck],
	// [PhaseVersionGetResponseRulesRulesetsJSChallengeRuleExposedCredentialCheck],
	// [LogRuleExposedCredentialCheck], [LogCustomFieldRuleExposedCredentialCheck],
	// [ManagedChallengeRuleExposedCredentialCheck],
	// [RedirectRuleExposedCredentialCheck], [RewriteRuleExposedCredentialCheck],
	// [RouteRuleExposedCredentialCheck], [ScoreRuleExposedCredentialCheck],
	// [ServeErrorRuleExposedCredentialCheck],
	// [SetCacheSettingsRuleExposedCredentialCheck],
	// [SetConfigRuleExposedCredentialCheck], [SkipRuleExposedCredentialCheck].
	ExposedCredentialCheck interface{} `json:"exposed_credential_check"`
	// 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"`
	// This field can have the runtime type of [BlockRuleRatelimit],
	// [PhaseVersionGetResponseRulesRulesetsChallengeRuleRatelimit],
	// [CompressResponseRuleRatelimit], [DDoSDynamicRuleRatelimit],
	// [ExecuteRuleRatelimit], [ForceConnectionCloseRuleRatelimit],
	// [PhaseVersionGetResponseRulesRulesetsJSChallengeRuleRatelimit],
	// [LogRuleRatelimit], [LogCustomFieldRuleRatelimit],
	// [ManagedChallengeRuleRatelimit], [RedirectRuleRatelimit],
	// [RewriteRuleRatelimit], [RouteRuleRatelimit], [ScoreRuleRatelimit],
	// [ServeErrorRuleRatelimit], [SetCacheSettingsRuleRatelimit],
	// [SetConfigRuleRatelimit], [SkipRuleRatelimit].
	Ratelimit interface{} `json:"ratelimit"`
	// The reference of the rule (the rule's ID by default).
	Ref  string                          `json:"ref"`
	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"
	PhaseVersionGetResponseRulesActionDDoSDynamic          PhaseVersionGetResponseRulesAction = "ddos_dynamic"
	PhaseVersionGetResponseRulesActionExecute              PhaseVersionGetResponseRulesAction = "execute"
	PhaseVersionGetResponseRulesActionForceConnectionClose PhaseVersionGetResponseRulesAction = "force_connection_close"
	PhaseVersionGetResponseRulesActionJSChallenge          PhaseVersionGetResponseRulesAction = "js_challenge"
	PhaseVersionGetResponseRulesActionLog                  PhaseVersionGetResponseRulesAction = "log"
	PhaseVersionGetResponseRulesActionLogCustomField       PhaseVersionGetResponseRulesAction = "log_custom_field"
	PhaseVersionGetResponseRulesActionManagedChallenge     PhaseVersionGetResponseRulesAction = "managed_challenge"
	PhaseVersionGetResponseRulesActionRedirect             PhaseVersionGetResponseRulesAction = "redirect"
	PhaseVersionGetResponseRulesActionRewrite              PhaseVersionGetResponseRulesAction = "rewrite"
	PhaseVersionGetResponseRulesActionRoute                PhaseVersionGetResponseRulesAction = "route"
	PhaseVersionGetResponseRulesActionScore                PhaseVersionGetResponseRulesAction = "score"
	PhaseVersionGetResponseRulesActionServeError           PhaseVersionGetResponseRulesAction = "serve_error"
	PhaseVersionGetResponseRulesActionSetCacheSettings     PhaseVersionGetResponseRulesAction = "set_cache_settings"
	PhaseVersionGetResponseRulesActionSetConfig            PhaseVersionGetResponseRulesAction = "set_config"
	PhaseVersionGetResponseRulesActionSkip                 PhaseVersionGetResponseRulesAction = "skip"
)

func (PhaseVersionGetResponseRulesAction) IsKnown

type PhaseVersionGetResponseRulesRulesetsChallengeRule

type PhaseVersionGetResponseRulesRulesetsChallengeRule 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 PhaseVersionGetResponseRulesRulesetsChallengeRuleAction `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"`
	// Configuration for exposed credential checking.
	ExposedCredentialCheck PhaseVersionGetResponseRulesRulesetsChallengeRuleExposedCredentialCheck `json:"exposed_credential_check"`
	// 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"`
	// An object configuring the rule's rate limit behavior.
	Ratelimit PhaseVersionGetResponseRulesRulesetsChallengeRuleRatelimit `json:"ratelimit"`
	// The reference of the rule (the rule's ID by default).
	Ref  string                                                `json:"ref"`
	JSON phaseVersionGetResponseRulesRulesetsChallengeRuleJSON `json:"-"`
}

func (*PhaseVersionGetResponseRulesRulesetsChallengeRule) UnmarshalJSON

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

type PhaseVersionGetResponseRulesRulesetsChallengeRuleAction

type PhaseVersionGetResponseRulesRulesetsChallengeRuleAction string

The action to perform when the rule matches.

const (
	PhaseVersionGetResponseRulesRulesetsChallengeRuleActionChallenge PhaseVersionGetResponseRulesRulesetsChallengeRuleAction = "challenge"
)

func (PhaseVersionGetResponseRulesRulesetsChallengeRuleAction) IsKnown

type PhaseVersionGetResponseRulesRulesetsChallengeRuleExposedCredentialCheck

type PhaseVersionGetResponseRulesRulesetsChallengeRuleExposedCredentialCheck struct {
	// An expression that selects the password used in the credentials check.
	PasswordExpression string `json:"password_expression,required"`
	// An expression that selects the user ID used in the credentials check.
	UsernameExpression string                                                                      `json:"username_expression,required"`
	JSON               phaseVersionGetResponseRulesRulesetsChallengeRuleExposedCredentialCheckJSON `json:"-"`
}

Configuration for exposed credential checking.

func (*PhaseVersionGetResponseRulesRulesetsChallengeRuleExposedCredentialCheck) UnmarshalJSON

type PhaseVersionGetResponseRulesRulesetsChallengeRuleRatelimit

type PhaseVersionGetResponseRulesRulesetsChallengeRuleRatelimit struct {
	// Characteristics of the request on which the rate limit counter will be
	// incremented.
	Characteristics []string `json:"characteristics,required"`
	// Period in seconds over which the counter is being incremented.
	Period int64 `json:"period,required"`
	// An expression that defines when the rate limit counter should be incremented. It
	// defaults to the same as the rule's expression.
	CountingExpression string `json:"counting_expression"`
	// Period of time in seconds after which the action will be disabled following its
	// first execution.
	MitigationTimeout int64 `json:"mitigation_timeout"`
	// The threshold of requests per period after which the action will be executed for
	// the first time.
	RequestsPerPeriod int64 `json:"requests_per_period"`
	// Whether counting is only performed when an origin is reached.
	RequestsToOrigin bool `json:"requests_to_origin"`
	// The score threshold per period for which the action will be executed the first
	// time.
	ScorePerPeriod int64 `json:"score_per_period"`
	// A response header name provided by the origin, which contains the score to
	// increment rate limit counter with.
	ScoreResponseHeaderName string                                                         `json:"score_response_header_name"`
	JSON                    phaseVersionGetResponseRulesRulesetsChallengeRuleRatelimitJSON `json:"-"`
}

An object configuring the rule's rate limit behavior.

func (*PhaseVersionGetResponseRulesRulesetsChallengeRuleRatelimit) UnmarshalJSON

type PhaseVersionGetResponseRulesRulesetsJSChallengeRule

type PhaseVersionGetResponseRulesRulesetsJSChallengeRule 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 PhaseVersionGetResponseRulesRulesetsJSChallengeRuleAction `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"`
	// Configuration for exposed credential checking.
	ExposedCredentialCheck PhaseVersionGetResponseRulesRulesetsJSChallengeRuleExposedCredentialCheck `json:"exposed_credential_check"`
	// 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"`
	// An object configuring the rule's rate limit behavior.
	Ratelimit PhaseVersionGetResponseRulesRulesetsJSChallengeRuleRatelimit `json:"ratelimit"`
	// The reference of the rule (the rule's ID by default).
	Ref  string                                                  `json:"ref"`
	JSON phaseVersionGetResponseRulesRulesetsJSChallengeRuleJSON `json:"-"`
}

func (*PhaseVersionGetResponseRulesRulesetsJSChallengeRule) UnmarshalJSON

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

type PhaseVersionGetResponseRulesRulesetsJSChallengeRuleAction

type PhaseVersionGetResponseRulesRulesetsJSChallengeRuleAction string

The action to perform when the rule matches.

const (
	PhaseVersionGetResponseRulesRulesetsJSChallengeRuleActionJSChallenge PhaseVersionGetResponseRulesRulesetsJSChallengeRuleAction = "js_challenge"
)

func (PhaseVersionGetResponseRulesRulesetsJSChallengeRuleAction) IsKnown

type PhaseVersionGetResponseRulesRulesetsJSChallengeRuleExposedCredentialCheck

type PhaseVersionGetResponseRulesRulesetsJSChallengeRuleExposedCredentialCheck struct {
	// An expression that selects the password used in the credentials check.
	PasswordExpression string `json:"password_expression,required"`
	// An expression that selects the user ID used in the credentials check.
	UsernameExpression string                                                                        `json:"username_expression,required"`
	JSON               phaseVersionGetResponseRulesRulesetsJSChallengeRuleExposedCredentialCheckJSON `json:"-"`
}

Configuration for exposed credential checking.

func (*PhaseVersionGetResponseRulesRulesetsJSChallengeRuleExposedCredentialCheck) UnmarshalJSON

type PhaseVersionGetResponseRulesRulesetsJSChallengeRuleRatelimit

type PhaseVersionGetResponseRulesRulesetsJSChallengeRuleRatelimit struct {
	// Characteristics of the request on which the rate limit counter will be
	// incremented.
	Characteristics []string `json:"characteristics,required"`
	// Period in seconds over which the counter is being incremented.
	Period int64 `json:"period,required"`
	// An expression that defines when the rate limit counter should be incremented. It
	// defaults to the same as the rule's expression.
	CountingExpression string `json:"counting_expression"`
	// Period of time in seconds after which the action will be disabled following its
	// first execution.
	MitigationTimeout int64 `json:"mitigation_timeout"`
	// The threshold of requests per period after which the action will be executed for
	// the first time.
	RequestsPerPeriod int64 `json:"requests_per_period"`
	// Whether counting is only performed when an origin is reached.
	RequestsToOrigin bool `json:"requests_to_origin"`
	// The score threshold per period for which the action will be executed the first
	// time.
	ScorePerPeriod int64 `json:"score_per_period"`
	// A response header name provided by the origin, which contains the score to
	// increment rate limit counter with.
	ScoreResponseHeaderName string                                                           `json:"score_response_header_name"`
	JSON                    phaseVersionGetResponseRulesRulesetsJSChallengeRuleRatelimitJSON `json:"-"`
}

An object configuring the rule's rate limit behavior.

func (*PhaseVersionGetResponseRulesRulesetsJSChallengeRuleRatelimit) UnmarshalJSON

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

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

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 RatePlan

type RatePlan = shared.RatePlan

The rate plan applied to the subscription.

This is an alias to an internal type.

type RatePlanID

type RatePlanID = shared.RatePlanID

The ID of the rate plan.

This is an alias to an internal type.

type RatePlanParam

type RatePlanParam = shared.RatePlanParam

The rate plan applied to the subscription.

This is an alias to an internal type.

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"`
	// Configuration for exposed credential checking.
	ExposedCredentialCheck RedirectRuleExposedCredentialCheck `json:"exposed_credential_check"`
	// 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"`
	// An object configuring the rule's rate limit behavior.
	Ratelimit RedirectRuleRatelimit `json:"ratelimit"`
	// The reference of the rule (the rule's 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 {
	// A redirect based on a bulk list lookup.
	FromList RedirectRuleActionParametersFromList `json:"from_list"`
	// 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 {
	// An expression that evaluates to the list lookup key.
	Key string `json:"key,required"`
	// The name of the list to match against.
	Name string                                   `json:"name,required"`
	JSON redirectRuleActionParametersFromListJSON `json:"-"`
}

A redirect based on a bulk list lookup.

func (*RedirectRuleActionParametersFromList) UnmarshalJSON

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

type RedirectRuleActionParametersFromListParam

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

A redirect based on a bulk list lookup.

func (RedirectRuleActionParametersFromListParam) MarshalJSON

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

type RedirectRuleActionParametersFromValue

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

A redirect based on the request properties.

func (*RedirectRuleActionParametersFromValue) UnmarshalJSON

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

type RedirectRuleActionParametersFromValueParam

type RedirectRuleActionParametersFromValueParam struct {
	// A URL to redirect the request to.
	TargetURL param.Field[RedirectRuleActionParametersFromValueTargetURLParam] `json:"target_url,required"`
	// Whether to keep the query string of the original request.
	PreserveQueryString param.Field[bool] `json:"preserve_query_string"`
	// The status code to use for the redirect.
	StatusCode param.Field[RedirectRuleActionParametersFromValueStatusCode] `json:"status_code"`
}

A redirect based on the request properties.

func (RedirectRuleActionParametersFromValueParam) MarshalJSON

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

type RedirectRuleActionParametersFromValueStatusCode

type RedirectRuleActionParametersFromValueStatusCode int64

The status code to use 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 {
	// An expression that evaluates to a URL to redirect the request to.
	Expression string `json:"expression"`
	// A URL to redirect the request to.
	Value string                                             `json:"value"`
	JSON  redirectRuleActionParametersFromValueTargetURLJSON `json:"-"`
}

A URL to redirect the request to.

func (*RedirectRuleActionParametersFromValueTargetURL) UnmarshalJSON

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

type RedirectRuleActionParametersFromValueTargetURLParam

type RedirectRuleActionParametersFromValueTargetURLParam struct {
	// An expression that evaluates to a URL to redirect the request to.
	Expression param.Field[string] `json:"expression"`
	// A URL to redirect the request to.
	Value param.Field[string] `json:"value"`
}

A URL to redirect the request to.

func (RedirectRuleActionParametersFromValueTargetURLParam) MarshalJSON

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

type RedirectRuleActionParametersParam

type RedirectRuleActionParametersParam struct {
	// A redirect based on a bulk list lookup.
	FromList param.Field[RedirectRuleActionParametersFromListParam] `json:"from_list"`
	// 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 RedirectRuleExposedCredentialCheck

type RedirectRuleExposedCredentialCheck struct {
	// An expression that selects the password used in the credentials check.
	PasswordExpression string `json:"password_expression,required"`
	// An expression that selects the user ID used in the credentials check.
	UsernameExpression string                                 `json:"username_expression,required"`
	JSON               redirectRuleExposedCredentialCheckJSON `json:"-"`
}

Configuration for exposed credential checking.

func (*RedirectRuleExposedCredentialCheck) UnmarshalJSON

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

type RedirectRuleExposedCredentialCheckParam

type RedirectRuleExposedCredentialCheckParam struct {
	// An expression that selects the password used in the credentials check.
	PasswordExpression param.Field[string] `json:"password_expression,required"`
	// An expression that selects the user ID used in the credentials check.
	UsernameExpression param.Field[string] `json:"username_expression,required"`
}

Configuration for exposed credential checking.

func (RedirectRuleExposedCredentialCheckParam) MarshalJSON

func (r RedirectRuleExposedCredentialCheckParam) 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"`
	// Configuration for exposed credential checking.
	ExposedCredentialCheck param.Field[RedirectRuleExposedCredentialCheckParam] `json:"exposed_credential_check"`
	// 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"`
	// An object configuring the rule's rate limit behavior.
	Ratelimit param.Field[RedirectRuleRatelimitParam] `json:"ratelimit"`
	// The reference of the rule (the rule's ID by default).
	Ref param.Field[string] `json:"ref"`
}

func (RedirectRuleParam) MarshalJSON

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

type RedirectRuleRatelimit

type RedirectRuleRatelimit struct {
	// Characteristics of the request on which the rate limit counter will be
	// incremented.
	Characteristics []string `json:"characteristics,required"`
	// Period in seconds over which the counter is being incremented.
	Period int64 `json:"period,required"`
	// An expression that defines when the rate limit counter should be incremented. It
	// defaults to the same as the rule's expression.
	CountingExpression string `json:"counting_expression"`
	// Period of time in seconds after which the action will be disabled following its
	// first execution.
	MitigationTimeout int64 `json:"mitigation_timeout"`
	// The threshold of requests per period after which the action will be executed for
	// the first time.
	RequestsPerPeriod int64 `json:"requests_per_period"`
	// Whether counting is only performed when an origin is reached.
	RequestsToOrigin bool `json:"requests_to_origin"`
	// The score threshold per period for which the action will be executed the first
	// time.
	ScorePerPeriod int64 `json:"score_per_period"`
	// A response header name provided by the origin, which contains the score to
	// increment rate limit counter with.
	ScoreResponseHeaderName string                    `json:"score_response_header_name"`
	JSON                    redirectRuleRatelimitJSON `json:"-"`
}

An object configuring the rule's rate limit behavior.

func (*RedirectRuleRatelimit) UnmarshalJSON

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

type RedirectRuleRatelimitParam

type RedirectRuleRatelimitParam struct {
	// Characteristics of the request on which the rate limit counter will be
	// incremented.
	Characteristics param.Field[[]string] `json:"characteristics,required"`
	// Period in seconds over which the counter is being incremented.
	Period param.Field[int64] `json:"period,required"`
	// An expression that defines when the rate limit counter should be incremented. It
	// defaults to the same as the rule's expression.
	CountingExpression param.Field[string] `json:"counting_expression"`
	// Period of time in seconds after which the action will be disabled following its
	// first execution.
	MitigationTimeout param.Field[int64] `json:"mitigation_timeout"`
	// The threshold of requests per period after which the action will be executed for
	// the first time.
	RequestsPerPeriod param.Field[int64] `json:"requests_per_period"`
	// Whether counting is only performed when an origin is reached.
	RequestsToOrigin param.Field[bool] `json:"requests_to_origin"`
	// The score threshold per period for which the action will be executed the first
	// time.
	ScorePerPeriod param.Field[int64] `json:"score_per_period"`
	// A response header name provided by the origin, which contains the score to
	// increment rate limit counter with.
	ScoreResponseHeaderName param.Field[string] `json:"score_response_header_name"`
}

An object configuring the rule's rate limit behavior.

func (RedirectRuleRatelimitParam) MarshalJSON

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

type ResponseInfo

type ResponseInfo = shared.ResponseInfo

This is an alias to an internal type.

type ResponseInfoSource

type ResponseInfoSource = shared.ResponseInfoSource

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"`
	// Configuration for exposed credential checking.
	ExposedCredentialCheck RewriteRuleExposedCredentialCheck `json:"exposed_credential_check"`
	// 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"`
	// An object configuring the rule's rate limit behavior.
	Ratelimit RewriteRuleRatelimit `json:"ratelimit"`
	// The reference of the rule (the rule's 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 {
	// A map of headers to rewrite.
	Headers map[string]RewriteRuleActionParametersHeader `json:"headers"`
	// A URI path rewrite.
	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 {
	// The operation to perform on the header.
	Operation RewriteRuleActionParametersHeadersOperation `json:"operation,required"`
	// An expression that evaluates to a value for the header.
	Expression string `json:"expression"`
	// A static value for the header.
	Value string                                `json:"value"`
	JSON  rewriteRuleActionParametersHeaderJSON `json:"-"`
	// contains filtered or unexported fields
}

A header with a static value to add.

func (*RewriteRuleActionParametersHeader) UnmarshalJSON

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

type RewriteRuleActionParametersHeaderParam

type RewriteRuleActionParametersHeaderParam struct {
	// The operation to perform on the header.
	Operation param.Field[RewriteRuleActionParametersHeadersOperation] `json:"operation,required"`
	// An expression that evaluates to a value for the header.
	Expression param.Field[string] `json:"expression"`
	// A static value for the header.
	Value param.Field[string] `json:"value"`
}

A header with a static value to add.

func (RewriteRuleActionParametersHeaderParam) MarshalJSON

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

type RewriteRuleActionParametersHeadersAddDynamicHeader

type RewriteRuleActionParametersHeadersAddDynamicHeader struct {
	// An expression that evaluates to a value for the header.
	Expression string `json:"expression,required"`
	// The operation to perform on the header.
	Operation RewriteRuleActionParametersHeadersAddDynamicHeaderOperation `json:"operation,required"`
	JSON      rewriteRuleActionParametersHeadersAddDynamicHeaderJSON      `json:"-"`
}

A header with a dynamic value to add.

func (*RewriteRuleActionParametersHeadersAddDynamicHeader) UnmarshalJSON

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

type RewriteRuleActionParametersHeadersAddDynamicHeaderOperation

type RewriteRuleActionParametersHeadersAddDynamicHeaderOperation string

The operation to perform on the header.

const (
	RewriteRuleActionParametersHeadersAddDynamicHeaderOperationAdd RewriteRuleActionParametersHeadersAddDynamicHeaderOperation = "add"
)

func (RewriteRuleActionParametersHeadersAddDynamicHeaderOperation) IsKnown

type RewriteRuleActionParametersHeadersAddDynamicHeaderParam

type RewriteRuleActionParametersHeadersAddDynamicHeaderParam struct {
	// An expression that evaluates to a value for the header.
	Expression param.Field[string] `json:"expression,required"`
	// The operation to perform on the header.
	Operation param.Field[RewriteRuleActionParametersHeadersAddDynamicHeaderOperation] `json:"operation,required"`
}

A header with a dynamic value to add.

func (RewriteRuleActionParametersHeadersAddDynamicHeaderParam) MarshalJSON

type RewriteRuleActionParametersHeadersAddStaticHeader

type RewriteRuleActionParametersHeadersAddStaticHeader struct {
	// The operation to perform on the header.
	Operation RewriteRuleActionParametersHeadersAddStaticHeaderOperation `json:"operation,required"`
	// A static value for the header.
	Value string                                                `json:"value,required"`
	JSON  rewriteRuleActionParametersHeadersAddStaticHeaderJSON `json:"-"`
}

A header with a static value to add.

func (*RewriteRuleActionParametersHeadersAddStaticHeader) UnmarshalJSON

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

type RewriteRuleActionParametersHeadersAddStaticHeaderOperation

type RewriteRuleActionParametersHeadersAddStaticHeaderOperation string

The operation to perform on the header.

const (
	RewriteRuleActionParametersHeadersAddStaticHeaderOperationAdd RewriteRuleActionParametersHeadersAddStaticHeaderOperation = "add"
)

func (RewriteRuleActionParametersHeadersAddStaticHeaderOperation) IsKnown

type RewriteRuleActionParametersHeadersAddStaticHeaderParam

type RewriteRuleActionParametersHeadersAddStaticHeaderParam struct {
	// The operation to perform on the header.
	Operation param.Field[RewriteRuleActionParametersHeadersAddStaticHeaderOperation] `json:"operation,required"`
	// A static value for the header.
	Value param.Field[string] `json:"value,required"`
}

A header with a static value to add.

func (RewriteRuleActionParametersHeadersAddStaticHeaderParam) MarshalJSON

type RewriteRuleActionParametersHeadersOperation

type RewriteRuleActionParametersHeadersOperation string

The operation to perform on the header.

const (
	RewriteRuleActionParametersHeadersOperationAdd    RewriteRuleActionParametersHeadersOperation = "add"
	RewriteRuleActionParametersHeadersOperationSet    RewriteRuleActionParametersHeadersOperation = "set"
	RewriteRuleActionParametersHeadersOperationRemove RewriteRuleActionParametersHeadersOperation = "remove"
)

func (RewriteRuleActionParametersHeadersOperation) IsKnown

type RewriteRuleActionParametersHeadersRemoveHeader

type RewriteRuleActionParametersHeadersRemoveHeader struct {
	// The operation to perform on the header.
	Operation RewriteRuleActionParametersHeadersRemoveHeaderOperation `json:"operation,required"`
	JSON      rewriteRuleActionParametersHeadersRemoveHeaderJSON      `json:"-"`
}

A header to remove.

func (*RewriteRuleActionParametersHeadersRemoveHeader) UnmarshalJSON

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

type RewriteRuleActionParametersHeadersRemoveHeaderOperation

type RewriteRuleActionParametersHeadersRemoveHeaderOperation string

The operation to perform on the header.

const (
	RewriteRuleActionParametersHeadersRemoveHeaderOperationRemove RewriteRuleActionParametersHeadersRemoveHeaderOperation = "remove"
)

func (RewriteRuleActionParametersHeadersRemoveHeaderOperation) IsKnown

type RewriteRuleActionParametersHeadersRemoveHeaderParam

type RewriteRuleActionParametersHeadersRemoveHeaderParam struct {
	// The operation to perform on the header.
	Operation param.Field[RewriteRuleActionParametersHeadersRemoveHeaderOperation] `json:"operation,required"`
}

A header to remove.

func (RewriteRuleActionParametersHeadersRemoveHeaderParam) MarshalJSON

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

type RewriteRuleActionParametersHeadersSetDynamicHeader

type RewriteRuleActionParametersHeadersSetDynamicHeader struct {
	// An expression that evaluates to a value for the header.
	Expression string `json:"expression,required"`
	// The operation to perform on the header.
	Operation RewriteRuleActionParametersHeadersSetDynamicHeaderOperation `json:"operation,required"`
	JSON      rewriteRuleActionParametersHeadersSetDynamicHeaderJSON      `json:"-"`
}

A header with a dynamic value to set.

func (*RewriteRuleActionParametersHeadersSetDynamicHeader) UnmarshalJSON

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

type RewriteRuleActionParametersHeadersSetDynamicHeaderOperation

type RewriteRuleActionParametersHeadersSetDynamicHeaderOperation string

The operation to perform on the header.

const (
	RewriteRuleActionParametersHeadersSetDynamicHeaderOperationSet RewriteRuleActionParametersHeadersSetDynamicHeaderOperation = "set"
)

func (RewriteRuleActionParametersHeadersSetDynamicHeaderOperation) IsKnown

type RewriteRuleActionParametersHeadersSetDynamicHeaderParam

type RewriteRuleActionParametersHeadersSetDynamicHeaderParam struct {
	// An expression that evaluates to a value for the header.
	Expression param.Field[string] `json:"expression,required"`
	// The operation to perform on the header.
	Operation param.Field[RewriteRuleActionParametersHeadersSetDynamicHeaderOperation] `json:"operation,required"`
}

A header with a dynamic value to set.

func (RewriteRuleActionParametersHeadersSetDynamicHeaderParam) MarshalJSON

type RewriteRuleActionParametersHeadersSetStaticHeader

type RewriteRuleActionParametersHeadersSetStaticHeader struct {
	// The operation to perform on the header.
	Operation RewriteRuleActionParametersHeadersSetStaticHeaderOperation `json:"operation,required"`
	// A static value for the header.
	Value string                                                `json:"value,required"`
	JSON  rewriteRuleActionParametersHeadersSetStaticHeaderJSON `json:"-"`
}

A header with a static value to set.

func (*RewriteRuleActionParametersHeadersSetStaticHeader) UnmarshalJSON

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

type RewriteRuleActionParametersHeadersSetStaticHeaderOperation

type RewriteRuleActionParametersHeadersSetStaticHeaderOperation string

The operation to perform on the header.

const (
	RewriteRuleActionParametersHeadersSetStaticHeaderOperationSet RewriteRuleActionParametersHeadersSetStaticHeaderOperation = "set"
)

func (RewriteRuleActionParametersHeadersSetStaticHeaderOperation) IsKnown

type RewriteRuleActionParametersHeadersSetStaticHeaderParam

type RewriteRuleActionParametersHeadersSetStaticHeaderParam struct {
	// The operation to perform on the header.
	Operation param.Field[RewriteRuleActionParametersHeadersSetStaticHeaderOperation] `json:"operation,required"`
	// A static value for the header.
	Value param.Field[string] `json:"value,required"`
}

A header with a static value to set.

func (RewriteRuleActionParametersHeadersSetStaticHeaderParam) MarshalJSON

type RewriteRuleActionParametersParam

type RewriteRuleActionParametersParam struct {
	// A map of headers to rewrite.
	Headers param.Field[map[string]RewriteRuleActionParametersHeadersUnionParam] `json:"headers"`
	// A URI path rewrite.
	URI param.Field[RewriteRuleActionParametersURIUnionParam] `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 {
	// Whether to propagate the rewritten URI to origin.
	Origin bool `json:"origin"`
	// This field can have the runtime type of
	// [RewriteRuleActionParametersURIURIPathPath].
	Path interface{} `json:"path"`
	// This field can have the runtime type of
	// [RewriteRuleActionParametersURIURIQueryQuery].
	Query interface{}                        `json:"query"`
	JSON  rewriteRuleActionParametersURIJSON `json:"-"`
	// contains filtered or unexported fields
}

A URI path rewrite.

func (RewriteRuleActionParametersURI) AsUnion

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

Possible runtime types of the union are RewriteRuleActionParametersURIURIPath, RewriteRuleActionParametersURIURIQuery.

func (*RewriteRuleActionParametersURI) UnmarshalJSON

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

type RewriteRuleActionParametersURIParam

type RewriteRuleActionParametersURIParam struct {
	Path  param.Field[interface{}] `json:"path"`
	Query param.Field[interface{}] `json:"query"`
}

A URI path rewrite.

func (RewriteRuleActionParametersURIParam) MarshalJSON

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

type RewriteRuleActionParametersURIURIPath

type RewriteRuleActionParametersURIURIPath struct {
	// A URI path rewrite.
	Path RewriteRuleActionParametersURIURIPathPath `json:"path,required"`
	// Whether to propagate the rewritten URI to origin.
	Origin bool                                      `json:"origin"`
	JSON   rewriteRuleActionParametersUriuriPathJSON `json:"-"`
}

A URI path rewrite.

func (*RewriteRuleActionParametersURIURIPath) UnmarshalJSON

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

type RewriteRuleActionParametersURIURIPathParam

type RewriteRuleActionParametersURIURIPathParam struct {
	// A URI path rewrite.
	Path param.Field[RewriteRuleActionParametersURIURIPathPathParam] `json:"path,required"`
}

A URI path rewrite.

func (RewriteRuleActionParametersURIURIPathParam) MarshalJSON

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

type RewriteRuleActionParametersURIURIPathPath

type RewriteRuleActionParametersURIURIPathPath struct {
	// An expression that evaluates to a value to rewrite the URI path to.
	Expression string `json:"expression"`
	// A value to rewrite the URI path to.
	Value string                                        `json:"value"`
	JSON  rewriteRuleActionParametersUriuriPathPathJSON `json:"-"`
}

A URI path rewrite.

func (*RewriteRuleActionParametersURIURIPathPath) UnmarshalJSON

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

type RewriteRuleActionParametersURIURIPathPathParam

type RewriteRuleActionParametersURIURIPathPathParam struct {
	// An expression that evaluates to a value to rewrite the URI path to.
	Expression param.Field[string] `json:"expression"`
	// A value to rewrite the URI path to.
	Value param.Field[string] `json:"value"`
}

A URI path rewrite.

func (RewriteRuleActionParametersURIURIPathPathParam) MarshalJSON

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

type RewriteRuleActionParametersURIURIQuery

type RewriteRuleActionParametersURIURIQuery struct {
	// A URI query rewrite.
	Query RewriteRuleActionParametersURIURIQueryQuery `json:"query,required"`
	// Whether to propagate the rewritten URI to origin.
	Origin bool                                       `json:"origin"`
	JSON   rewriteRuleActionParametersUriuriQueryJSON `json:"-"`
}

A URI query rewrite.

func (*RewriteRuleActionParametersURIURIQuery) UnmarshalJSON

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

type RewriteRuleActionParametersURIURIQueryParam

type RewriteRuleActionParametersURIURIQueryParam struct {
	// A URI query rewrite.
	Query param.Field[RewriteRuleActionParametersURIURIQueryQueryParam] `json:"query,required"`
}

A URI query rewrite.

func (RewriteRuleActionParametersURIURIQueryParam) MarshalJSON

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

type RewriteRuleActionParametersURIURIQueryQuery

type RewriteRuleActionParametersURIURIQueryQuery struct {
	// An expression that evaluates to a value to rewrite the URI query to.
	Expression string `json:"expression"`
	// A value to rewrite the URI query to.
	Value string                                          `json:"value"`
	JSON  rewriteRuleActionParametersUriuriQueryQueryJSON `json:"-"`
}

A URI query rewrite.

func (*RewriteRuleActionParametersURIURIQueryQuery) UnmarshalJSON

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

type RewriteRuleActionParametersURIURIQueryQueryParam

type RewriteRuleActionParametersURIURIQueryQueryParam struct {
	// An expression that evaluates to a value to rewrite the URI query to.
	Expression param.Field[string] `json:"expression"`
	// A value to rewrite the URI query to.
	Value param.Field[string] `json:"value"`
}

A URI query rewrite.

func (RewriteRuleActionParametersURIURIQueryQueryParam) MarshalJSON

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

type RewriteRuleActionParametersURIUnion

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

A URI path rewrite.

Union satisfied by RewriteRuleActionParametersURIURIPath or RewriteRuleActionParametersURIURIQuery.

type RewriteRuleActionParametersURIUnionParam

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

A URI path rewrite.

Satisfied by rulesets.RewriteRuleActionParametersURIURIPathParam, rulesets.RewriteRuleActionParametersURIURIQueryParam, RewriteRuleActionParametersURIParam.

type RewriteRuleExposedCredentialCheck

type RewriteRuleExposedCredentialCheck struct {
	// An expression that selects the password used in the credentials check.
	PasswordExpression string `json:"password_expression,required"`
	// An expression that selects the user ID used in the credentials check.
	UsernameExpression string                                `json:"username_expression,required"`
	JSON               rewriteRuleExposedCredentialCheckJSON `json:"-"`
}

Configuration for exposed credential checking.

func (*RewriteRuleExposedCredentialCheck) UnmarshalJSON

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

type RewriteRuleExposedCredentialCheckParam

type RewriteRuleExposedCredentialCheckParam struct {
	// An expression that selects the password used in the credentials check.
	PasswordExpression param.Field[string] `json:"password_expression,required"`
	// An expression that selects the user ID used in the credentials check.
	UsernameExpression param.Field[string] `json:"username_expression,required"`
}

Configuration for exposed credential checking.

func (RewriteRuleExposedCredentialCheckParam) MarshalJSON

func (r RewriteRuleExposedCredentialCheckParam) 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"`
	// Configuration for exposed credential checking.
	ExposedCredentialCheck param.Field[RewriteRuleExposedCredentialCheckParam] `json:"exposed_credential_check"`
	// 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"`
	// An object configuring the rule's rate limit behavior.
	Ratelimit param.Field[RewriteRuleRatelimitParam] `json:"ratelimit"`
	// The reference of the rule (the rule's ID by default).
	Ref param.Field[string] `json:"ref"`
}

func (RewriteRuleParam) MarshalJSON

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

type RewriteRuleRatelimit

type RewriteRuleRatelimit struct {
	// Characteristics of the request on which the rate limit counter will be
	// incremented.
	Characteristics []string `json:"characteristics,required"`
	// Period in seconds over which the counter is being incremented.
	Period int64 `json:"period,required"`
	// An expression that defines when the rate limit counter should be incremented. It
	// defaults to the same as the rule's expression.
	CountingExpression string `json:"counting_expression"`
	// Period of time in seconds after which the action will be disabled following its
	// first execution.
	MitigationTimeout int64 `json:"mitigation_timeout"`
	// The threshold of requests per period after which the action will be executed for
	// the first time.
	RequestsPerPeriod int64 `json:"requests_per_period"`
	// Whether counting is only performed when an origin is reached.
	RequestsToOrigin bool `json:"requests_to_origin"`
	// The score threshold per period for which the action will be executed the first
	// time.
	ScorePerPeriod int64 `json:"score_per_period"`
	// A response header name provided by the origin, which contains the score to
	// increment rate limit counter with.
	ScoreResponseHeaderName string                   `json:"score_response_header_name"`
	JSON                    rewriteRuleRatelimitJSON `json:"-"`
}

An object configuring the rule's rate limit behavior.

func (*RewriteRuleRatelimit) UnmarshalJSON

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

type RewriteRuleRatelimitParam

type RewriteRuleRatelimitParam struct {
	// Characteristics of the request on which the rate limit counter will be
	// incremented.
	Characteristics param.Field[[]string] `json:"characteristics,required"`
	// Period in seconds over which the counter is being incremented.
	Period param.Field[int64] `json:"period,required"`
	// An expression that defines when the rate limit counter should be incremented. It
	// defaults to the same as the rule's expression.
	CountingExpression param.Field[string] `json:"counting_expression"`
	// Period of time in seconds after which the action will be disabled following its
	// first execution.
	MitigationTimeout param.Field[int64] `json:"mitigation_timeout"`
	// The threshold of requests per period after which the action will be executed for
	// the first time.
	RequestsPerPeriod param.Field[int64] `json:"requests_per_period"`
	// Whether counting is only performed when an origin is reached.
	RequestsToOrigin param.Field[bool] `json:"requests_to_origin"`
	// The score threshold per period for which the action will be executed the first
	// time.
	ScorePerPeriod param.Field[int64] `json:"score_per_period"`
	// A response header name provided by the origin, which contains the score to
	// increment rate limit counter with.
	ScoreResponseHeaderName param.Field[string] `json:"score_response_header_name"`
}

An object configuring the rule's rate limit behavior.

func (RewriteRuleRatelimitParam) MarshalJSON

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

type Role

type Role = shared.Role

This is an alias to an internal type.

type RoleParam

type RoleParam = shared.RoleParam

This is an alias to an internal type.

type RolePermissions

type RolePermissions = shared.RolePermissions

This is an alias to an internal type.

type RolePermissionsParam

type RolePermissionsParam = shared.RolePermissionsParam

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"`
	// Configuration for exposed credential checking.
	ExposedCredentialCheck RouteRuleExposedCredentialCheck `json:"exposed_credential_check"`
	// 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"`
	// An object configuring the rule's rate limit behavior.
	Ratelimit RouteRuleRatelimit `json:"ratelimit"`
	// The reference of the rule (the rule's 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 {
	// A value to rewrite the HTTP host header to.
	HostHeader string `json:"host_header"`
	// An origin to route to.
	Origin RouteRuleActionParametersOrigin `json:"origin"`
	// A Server Name Indication (SNI) override.
	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 {
	// A resolved host to route to.
	Host string `json:"host"`
	// A destination port to route to.
	Port int64                               `json:"port"`
	JSON routeRuleActionParametersOriginJSON `json:"-"`
}

An origin to route to.

func (*RouteRuleActionParametersOrigin) UnmarshalJSON

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

type RouteRuleActionParametersOriginParam

type RouteRuleActionParametersOriginParam struct {
	// A resolved host to route to.
	Host param.Field[string] `json:"host"`
	// A destination port to route to.
	Port param.Field[int64] `json:"port"`
}

An origin to route to.

func (RouteRuleActionParametersOriginParam) MarshalJSON

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

type RouteRuleActionParametersParam

type RouteRuleActionParametersParam struct {
	// A value to rewrite the HTTP host header to.
	HostHeader param.Field[string] `json:"host_header"`
	// An origin to route to.
	Origin param.Field[RouteRuleActionParametersOriginParam] `json:"origin"`
	// A Server Name Indication (SNI) override.
	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

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

A Server Name Indication (SNI) override.

func (*RouteRuleActionParametersSNI) UnmarshalJSON

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

type RouteRuleActionParametersSNIParam

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

A Server Name Indication (SNI) override.

func (RouteRuleActionParametersSNIParam) MarshalJSON

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

type RouteRuleExposedCredentialCheck

type RouteRuleExposedCredentialCheck struct {
	// An expression that selects the password used in the credentials check.
	PasswordExpression string `json:"password_expression,required"`
	// An expression that selects the user ID used in the credentials check.
	UsernameExpression string                              `json:"username_expression,required"`
	JSON               routeRuleExposedCredentialCheckJSON `json:"-"`
}

Configuration for exposed credential checking.

func (*RouteRuleExposedCredentialCheck) UnmarshalJSON

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

type RouteRuleExposedCredentialCheckParam

type RouteRuleExposedCredentialCheckParam struct {
	// An expression that selects the password used in the credentials check.
	PasswordExpression param.Field[string] `json:"password_expression,required"`
	// An expression that selects the user ID used in the credentials check.
	UsernameExpression param.Field[string] `json:"username_expression,required"`
}

Configuration for exposed credential checking.

func (RouteRuleExposedCredentialCheckParam) MarshalJSON

func (r RouteRuleExposedCredentialCheckParam) 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"`
	// Configuration for exposed credential checking.
	ExposedCredentialCheck param.Field[RouteRuleExposedCredentialCheckParam] `json:"exposed_credential_check"`
	// 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"`
	// An object configuring the rule's rate limit behavior.
	Ratelimit param.Field[RouteRuleRatelimitParam] `json:"ratelimit"`
	// The reference of the rule (the rule's ID by default).
	Ref param.Field[string] `json:"ref"`
}

func (RouteRuleParam) MarshalJSON

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

type RouteRuleRatelimit

type RouteRuleRatelimit struct {
	// Characteristics of the request on which the rate limit counter will be
	// incremented.
	Characteristics []string `json:"characteristics,required"`
	// Period in seconds over which the counter is being incremented.
	Period int64 `json:"period,required"`
	// An expression that defines when the rate limit counter should be incremented. It
	// defaults to the same as the rule's expression.
	CountingExpression string `json:"counting_expression"`
	// Period of time in seconds after which the action will be disabled following its
	// first execution.
	MitigationTimeout int64 `json:"mitigation_timeout"`
	// The threshold of requests per period after which the action will be executed for
	// the first time.
	RequestsPerPeriod int64 `json:"requests_per_period"`
	// Whether counting is only performed when an origin is reached.
	RequestsToOrigin bool `json:"requests_to_origin"`
	// The score threshold per period for which the action will be executed the first
	// time.
	ScorePerPeriod int64 `json:"score_per_period"`
	// A response header name provided by the origin, which contains the score to
	// increment rate limit counter with.
	ScoreResponseHeaderName string                 `json:"score_response_header_name"`
	JSON                    routeRuleRatelimitJSON `json:"-"`
}

An object configuring the rule's rate limit behavior.

func (*RouteRuleRatelimit) UnmarshalJSON

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

type RouteRuleRatelimitParam

type RouteRuleRatelimitParam struct {
	// Characteristics of the request on which the rate limit counter will be
	// incremented.
	Characteristics param.Field[[]string] `json:"characteristics,required"`
	// Period in seconds over which the counter is being incremented.
	Period param.Field[int64] `json:"period,required"`
	// An expression that defines when the rate limit counter should be incremented. It
	// defaults to the same as the rule's expression.
	CountingExpression param.Field[string] `json:"counting_expression"`
	// Period of time in seconds after which the action will be disabled following its
	// first execution.
	MitigationTimeout param.Field[int64] `json:"mitigation_timeout"`
	// The threshold of requests per period after which the action will be executed for
	// the first time.
	RequestsPerPeriod param.Field[int64] `json:"requests_per_period"`
	// Whether counting is only performed when an origin is reached.
	RequestsToOrigin param.Field[bool] `json:"requests_to_origin"`
	// The score threshold per period for which the action will be executed the first
	// time.
	ScorePerPeriod param.Field[int64] `json:"score_per_period"`
	// A response header name provided by the origin, which contains the score to
	// increment rate limit counter with.
	ScoreResponseHeaderName param.Field[string] `json:"score_response_header_name"`
}

An object configuring the rule's rate limit behavior.

func (RouteRuleRatelimitParam) MarshalJSON

func (r RouteRuleRatelimitParam) 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 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 RuleDeleteResponseRulesAction `json:"action"`
	// This field can have the runtime type of [BlockRuleActionParameters],
	// [interface{}], [CompressResponseRuleActionParameters],
	// [ExecuteRuleActionParameters], [LogCustomFieldRuleActionParameters],
	// [RedirectRuleActionParameters], [RewriteRuleActionParameters],
	// [RouteRuleActionParameters], [ScoreRuleActionParameters],
	// [ServeErrorRuleActionParameters], [SetCacheSettingsRuleActionParameters],
	// [SetConfigRuleActionParameters], [SkipRuleActionParameters].
	ActionParameters interface{} `json:"action_parameters"`
	// This field can have the runtime type of [[]string].
	Categories interface{} `json:"categories"`
	// An informative description of the rule.
	Description string `json:"description"`
	// Whether the rule should be executed.
	Enabled bool `json:"enabled"`
	// This field can have the runtime type of [BlockRuleExposedCredentialCheck],
	// [RuleDeleteResponseRulesRulesetsChallengeRuleExposedCredentialCheck],
	// [CompressResponseRuleExposedCredentialCheck],
	// [DDoSDynamicRuleExposedCredentialCheck], [ExecuteRuleExposedCredentialCheck],
	// [ForceConnectionCloseRuleExposedCredentialCheck],
	// [RuleDeleteResponseRulesRulesetsJSChallengeRuleExposedCredentialCheck],
	// [LogRuleExposedCredentialCheck], [LogCustomFieldRuleExposedCredentialCheck],
	// [ManagedChallengeRuleExposedCredentialCheck],
	// [RedirectRuleExposedCredentialCheck], [RewriteRuleExposedCredentialCheck],
	// [RouteRuleExposedCredentialCheck], [ScoreRuleExposedCredentialCheck],
	// [ServeErrorRuleExposedCredentialCheck],
	// [SetCacheSettingsRuleExposedCredentialCheck],
	// [SetConfigRuleExposedCredentialCheck], [SkipRuleExposedCredentialCheck].
	ExposedCredentialCheck interface{} `json:"exposed_credential_check"`
	// 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"`
	// This field can have the runtime type of [BlockRuleRatelimit],
	// [RuleDeleteResponseRulesRulesetsChallengeRuleRatelimit],
	// [CompressResponseRuleRatelimit], [DDoSDynamicRuleRatelimit],
	// [ExecuteRuleRatelimit], [ForceConnectionCloseRuleRatelimit],
	// [RuleDeleteResponseRulesRulesetsJSChallengeRuleRatelimit], [LogRuleRatelimit],
	// [LogCustomFieldRuleRatelimit], [ManagedChallengeRuleRatelimit],
	// [RedirectRuleRatelimit], [RewriteRuleRatelimit], [RouteRuleRatelimit],
	// [ScoreRuleRatelimit], [ServeErrorRuleRatelimit],
	// [SetCacheSettingsRuleRatelimit], [SetConfigRuleRatelimit], [SkipRuleRatelimit].
	Ratelimit interface{} `json:"ratelimit"`
	// The reference of the rule (the rule's ID by default).
	Ref  string                     `json:"ref"`
	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"
	RuleDeleteResponseRulesActionDDoSDynamic          RuleDeleteResponseRulesAction = "ddos_dynamic"
	RuleDeleteResponseRulesActionExecute              RuleDeleteResponseRulesAction = "execute"
	RuleDeleteResponseRulesActionForceConnectionClose RuleDeleteResponseRulesAction = "force_connection_close"
	RuleDeleteResponseRulesActionJSChallenge          RuleDeleteResponseRulesAction = "js_challenge"
	RuleDeleteResponseRulesActionLog                  RuleDeleteResponseRulesAction = "log"
	RuleDeleteResponseRulesActionLogCustomField       RuleDeleteResponseRulesAction = "log_custom_field"
	RuleDeleteResponseRulesActionManagedChallenge     RuleDeleteResponseRulesAction = "managed_challenge"
	RuleDeleteResponseRulesActionRedirect             RuleDeleteResponseRulesAction = "redirect"
	RuleDeleteResponseRulesActionRewrite              RuleDeleteResponseRulesAction = "rewrite"
	RuleDeleteResponseRulesActionRoute                RuleDeleteResponseRulesAction = "route"
	RuleDeleteResponseRulesActionScore                RuleDeleteResponseRulesAction = "score"
	RuleDeleteResponseRulesActionServeError           RuleDeleteResponseRulesAction = "serve_error"
	RuleDeleteResponseRulesActionSetCacheSettings     RuleDeleteResponseRulesAction = "set_cache_settings"
	RuleDeleteResponseRulesActionSetConfig            RuleDeleteResponseRulesAction = "set_config"
	RuleDeleteResponseRulesActionSkip                 RuleDeleteResponseRulesAction = "skip"
)

func (RuleDeleteResponseRulesAction) IsKnown

func (r RuleDeleteResponseRulesAction) IsKnown() bool

type RuleDeleteResponseRulesRulesetsChallengeRule

type RuleDeleteResponseRulesRulesetsChallengeRule 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 RuleDeleteResponseRulesRulesetsChallengeRuleAction `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"`
	// Configuration for exposed credential checking.
	ExposedCredentialCheck RuleDeleteResponseRulesRulesetsChallengeRuleExposedCredentialCheck `json:"exposed_credential_check"`
	// 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"`
	// An object configuring the rule's rate limit behavior.
	Ratelimit RuleDeleteResponseRulesRulesetsChallengeRuleRatelimit `json:"ratelimit"`
	// The reference of the rule (the rule's ID by default).
	Ref  string                                           `json:"ref"`
	JSON ruleDeleteResponseRulesRulesetsChallengeRuleJSON `json:"-"`
}

func (*RuleDeleteResponseRulesRulesetsChallengeRule) UnmarshalJSON

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

type RuleDeleteResponseRulesRulesetsChallengeRuleAction

type RuleDeleteResponseRulesRulesetsChallengeRuleAction string

The action to perform when the rule matches.

const (
	RuleDeleteResponseRulesRulesetsChallengeRuleActionChallenge RuleDeleteResponseRulesRulesetsChallengeRuleAction = "challenge"
)

func (RuleDeleteResponseRulesRulesetsChallengeRuleAction) IsKnown

type RuleDeleteResponseRulesRulesetsChallengeRuleExposedCredentialCheck

type RuleDeleteResponseRulesRulesetsChallengeRuleExposedCredentialCheck struct {
	// An expression that selects the password used in the credentials check.
	PasswordExpression string `json:"password_expression,required"`
	// An expression that selects the user ID used in the credentials check.
	UsernameExpression string                                                                 `json:"username_expression,required"`
	JSON               ruleDeleteResponseRulesRulesetsChallengeRuleExposedCredentialCheckJSON `json:"-"`
}

Configuration for exposed credential checking.

func (*RuleDeleteResponseRulesRulesetsChallengeRuleExposedCredentialCheck) UnmarshalJSON

type RuleDeleteResponseRulesRulesetsChallengeRuleRatelimit

type RuleDeleteResponseRulesRulesetsChallengeRuleRatelimit struct {
	// Characteristics of the request on which the rate limit counter will be
	// incremented.
	Characteristics []string `json:"characteristics,required"`
	// Period in seconds over which the counter is being incremented.
	Period int64 `json:"period,required"`
	// An expression that defines when the rate limit counter should be incremented. It
	// defaults to the same as the rule's expression.
	CountingExpression string `json:"counting_expression"`
	// Period of time in seconds after which the action will be disabled following its
	// first execution.
	MitigationTimeout int64 `json:"mitigation_timeout"`
	// The threshold of requests per period after which the action will be executed for
	// the first time.
	RequestsPerPeriod int64 `json:"requests_per_period"`
	// Whether counting is only performed when an origin is reached.
	RequestsToOrigin bool `json:"requests_to_origin"`
	// The score threshold per period for which the action will be executed the first
	// time.
	ScorePerPeriod int64 `json:"score_per_period"`
	// A response header name provided by the origin, which contains the score to
	// increment rate limit counter with.
	ScoreResponseHeaderName string                                                    `json:"score_response_header_name"`
	JSON                    ruleDeleteResponseRulesRulesetsChallengeRuleRatelimitJSON `json:"-"`
}

An object configuring the rule's rate limit behavior.

func (*RuleDeleteResponseRulesRulesetsChallengeRuleRatelimit) UnmarshalJSON

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

type RuleDeleteResponseRulesRulesetsJSChallengeRule

type RuleDeleteResponseRulesRulesetsJSChallengeRule 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 RuleDeleteResponseRulesRulesetsJSChallengeRuleAction `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"`
	// Configuration for exposed credential checking.
	ExposedCredentialCheck RuleDeleteResponseRulesRulesetsJSChallengeRuleExposedCredentialCheck `json:"exposed_credential_check"`
	// 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"`
	// An object configuring the rule's rate limit behavior.
	Ratelimit RuleDeleteResponseRulesRulesetsJSChallengeRuleRatelimit `json:"ratelimit"`
	// The reference of the rule (the rule's ID by default).
	Ref  string                                             `json:"ref"`
	JSON ruleDeleteResponseRulesRulesetsJSChallengeRuleJSON `json:"-"`
}

func (*RuleDeleteResponseRulesRulesetsJSChallengeRule) UnmarshalJSON

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

type RuleDeleteResponseRulesRulesetsJSChallengeRuleAction

type RuleDeleteResponseRulesRulesetsJSChallengeRuleAction string

The action to perform when the rule matches.

const (
	RuleDeleteResponseRulesRulesetsJSChallengeRuleActionJSChallenge RuleDeleteResponseRulesRulesetsJSChallengeRuleAction = "js_challenge"
)

func (RuleDeleteResponseRulesRulesetsJSChallengeRuleAction) IsKnown

type RuleDeleteResponseRulesRulesetsJSChallengeRuleExposedCredentialCheck

type RuleDeleteResponseRulesRulesetsJSChallengeRuleExposedCredentialCheck struct {
	// An expression that selects the password used in the credentials check.
	PasswordExpression string `json:"password_expression,required"`
	// An expression that selects the user ID used in the credentials check.
	UsernameExpression string                                                                   `json:"username_expression,required"`
	JSON               ruleDeleteResponseRulesRulesetsJSChallengeRuleExposedCredentialCheckJSON `json:"-"`
}

Configuration for exposed credential checking.

func (*RuleDeleteResponseRulesRulesetsJSChallengeRuleExposedCredentialCheck) UnmarshalJSON

type RuleDeleteResponseRulesRulesetsJSChallengeRuleRatelimit

type RuleDeleteResponseRulesRulesetsJSChallengeRuleRatelimit struct {
	// Characteristics of the request on which the rate limit counter will be
	// incremented.
	Characteristics []string `json:"characteristics,required"`
	// Period in seconds over which the counter is being incremented.
	Period int64 `json:"period,required"`
	// An expression that defines when the rate limit counter should be incremented. It
	// defaults to the same as the rule's expression.
	CountingExpression string `json:"counting_expression"`
	// Period of time in seconds after which the action will be disabled following its
	// first execution.
	MitigationTimeout int64 `json:"mitigation_timeout"`
	// The threshold of requests per period after which the action will be executed for
	// the first time.
	RequestsPerPeriod int64 `json:"requests_per_period"`
	// Whether counting is only performed when an origin is reached.
	RequestsToOrigin bool `json:"requests_to_origin"`
	// The score threshold per period for which the action will be executed the first
	// time.
	ScorePerPeriod int64 `json:"score_per_period"`
	// A response header name provided by the origin, which contains the score to
	// increment rate limit counter with.
	ScoreResponseHeaderName string                                                      `json:"score_response_header_name"`
	JSON                    ruleDeleteResponseRulesRulesetsJSChallengeRuleRatelimitJSON `json:"-"`
}

An object configuring the rule's rate limit behavior.

func (*RuleDeleteResponseRulesRulesetsJSChallengeRuleRatelimit) UnmarshalJSON

type RuleEditParams

type RuleEditParams struct {
	Body RuleEditParamsBodyUnion `json:"body,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"`
}

func (RuleEditParams) MarshalJSON

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

type RuleEditParamsBody

type RuleEditParamsBody struct {
	// The unique ID of the rule.
	ID param.Field[string] `json:"id"`
	// The action to perform when the rule matches.
	Action           param.Field[RuleEditParamsBodyAction] `json:"action"`
	ActionParameters param.Field[interface{}]              `json:"action_parameters"`
	Categories       param.Field[interface{}]              `json:"categories"`
	// An informative description of the rule.
	Description param.Field[string] `json:"description"`
	// Whether the rule should be executed.
	Enabled                param.Field[bool]        `json:"enabled"`
	ExposedCredentialCheck param.Field[interface{}] `json:"exposed_credential_check"`
	// 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"`
	Position  param.Field[interface{}]  `json:"position"`
	Ratelimit param.Field[interface{}]  `json:"ratelimit"`
	// The reference of the rule (the rule's ID by default).
	Ref param.Field[string] `json:"ref"`
}

func (RuleEditParamsBody) MarshalJSON

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

type RuleEditParamsBodyAction

type RuleEditParamsBodyAction string

The action to perform when the rule matches.

const (
	RuleEditParamsBodyActionBlock                RuleEditParamsBodyAction = "block"
	RuleEditParamsBodyActionChallenge            RuleEditParamsBodyAction = "challenge"
	RuleEditParamsBodyActionCompressResponse     RuleEditParamsBodyAction = "compress_response"
	RuleEditParamsBodyActionDDoSDynamic          RuleEditParamsBodyAction = "ddos_dynamic"
	RuleEditParamsBodyActionExecute              RuleEditParamsBodyAction = "execute"
	RuleEditParamsBodyActionForceConnectionClose RuleEditParamsBodyAction = "force_connection_close"
	RuleEditParamsBodyActionJSChallenge          RuleEditParamsBodyAction = "js_challenge"
	RuleEditParamsBodyActionLog                  RuleEditParamsBodyAction = "log"
	RuleEditParamsBodyActionLogCustomField       RuleEditParamsBodyAction = "log_custom_field"
	RuleEditParamsBodyActionManagedChallenge     RuleEditParamsBodyAction = "managed_challenge"
	RuleEditParamsBodyActionRedirect             RuleEditParamsBodyAction = "redirect"
	RuleEditParamsBodyActionRewrite              RuleEditParamsBodyAction = "rewrite"
	RuleEditParamsBodyActionRoute                RuleEditParamsBodyAction = "route"
	RuleEditParamsBodyActionScore                RuleEditParamsBodyAction = "score"
	RuleEditParamsBodyActionServeError           RuleEditParamsBodyAction = "serve_error"
	RuleEditParamsBodyActionSetCacheSettings     RuleEditParamsBodyAction = "set_cache_settings"
	RuleEditParamsBodyActionSetConfig            RuleEditParamsBodyAction = "set_config"
	RuleEditParamsBodyActionSkip                 RuleEditParamsBodyAction = "skip"
)

func (RuleEditParamsBodyAction) IsKnown

func (r RuleEditParamsBodyAction) IsKnown() bool

type RuleEditParamsBodyBlockRule

type RuleEditParamsBodyBlockRule struct {
	// An object configuring where the rule will be placed.
	Position param.Field[RuleEditParamsBodyBlockRulePositionUnion] `json:"position"`
	BlockRuleParam
}

func (RuleEditParamsBodyBlockRule) MarshalJSON

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

type RuleEditParamsBodyBlockRulePosition

type RuleEditParamsBodyBlockRulePosition 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"`
	// 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 index at which to place the rule, where index 1 is the first rule.
	Index param.Field[int64] `json:"index"`
}

An object configuring where the rule will be placed.

func (RuleEditParamsBodyBlockRulePosition) MarshalJSON

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

type RuleEditParamsBodyBlockRulePositionAfterPosition

type RuleEditParamsBodyBlockRulePositionAfterPosition 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 (RuleEditParamsBodyBlockRulePositionAfterPosition) MarshalJSON

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

type RuleEditParamsBodyBlockRulePositionBeforePosition

type RuleEditParamsBodyBlockRulePositionBeforePosition 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 (RuleEditParamsBodyBlockRulePositionBeforePosition) MarshalJSON

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

type RuleEditParamsBodyBlockRulePositionIndexPosition

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

An object configuring where the rule will be placed.

func (RuleEditParamsBodyBlockRulePositionIndexPosition) MarshalJSON

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

type RuleEditParamsBodyBlockRulePositionUnion

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

An object configuring where the rule will be placed.

Satisfied by rulesets.RuleEditParamsBodyBlockRulePositionBeforePosition, rulesets.RuleEditParamsBodyBlockRulePositionAfterPosition, rulesets.RuleEditParamsBodyBlockRulePositionIndexPosition, RuleEditParamsBodyBlockRulePosition.

type RuleEditParamsBodyChallengeRule

type RuleEditParamsBodyChallengeRule struct {
	// The unique ID of the rule.
	ID param.Field[string] `json:"id"`
	// The action to perform when the rule matches.
	Action param.Field[RuleEditParamsBodyChallengeRuleAction] `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"`
	// Configuration for exposed credential checking.
	ExposedCredentialCheck param.Field[RuleEditParamsBodyChallengeRuleExposedCredentialCheck] `json:"exposed_credential_check"`
	// 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"`
	// An object configuring where the rule will be placed.
	Position param.Field[RuleEditParamsBodyChallengeRulePositionUnion] `json:"position"`
	// An object configuring the rule's rate limit behavior.
	Ratelimit param.Field[RuleEditParamsBodyChallengeRuleRatelimit] `json:"ratelimit"`
	// The reference of the rule (the rule's ID by default).
	Ref param.Field[string] `json:"ref"`
}

func (RuleEditParamsBodyChallengeRule) MarshalJSON

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

type RuleEditParamsBodyChallengeRuleAction

type RuleEditParamsBodyChallengeRuleAction string

The action to perform when the rule matches.

const (
	RuleEditParamsBodyChallengeRuleActionChallenge RuleEditParamsBodyChallengeRuleAction = "challenge"
)

func (RuleEditParamsBodyChallengeRuleAction) IsKnown

type RuleEditParamsBodyChallengeRuleExposedCredentialCheck

type RuleEditParamsBodyChallengeRuleExposedCredentialCheck struct {
	// An expression that selects the password used in the credentials check.
	PasswordExpression param.Field[string] `json:"password_expression,required"`
	// An expression that selects the user ID used in the credentials check.
	UsernameExpression param.Field[string] `json:"username_expression,required"`
}

Configuration for exposed credential checking.

func (RuleEditParamsBodyChallengeRuleExposedCredentialCheck) MarshalJSON

type RuleEditParamsBodyChallengeRulePosition

type RuleEditParamsBodyChallengeRulePosition 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"`
	// 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 index at which to place the rule, where index 1 is the first rule.
	Index param.Field[int64] `json:"index"`
}

An object configuring where the rule will be placed.

func (RuleEditParamsBodyChallengeRulePosition) MarshalJSON

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

type RuleEditParamsBodyChallengeRulePositionAfterPosition

type RuleEditParamsBodyChallengeRulePositionAfterPosition 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 (RuleEditParamsBodyChallengeRulePositionAfterPosition) MarshalJSON

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

type RuleEditParamsBodyChallengeRulePositionBeforePosition

type RuleEditParamsBodyChallengeRulePositionBeforePosition 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 (RuleEditParamsBodyChallengeRulePositionBeforePosition) MarshalJSON

type RuleEditParamsBodyChallengeRulePositionIndexPosition

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

An object configuring where the rule will be placed.

func (RuleEditParamsBodyChallengeRulePositionIndexPosition) MarshalJSON

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

type RuleEditParamsBodyChallengeRulePositionUnion

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

An object configuring where the rule will be placed.

Satisfied by rulesets.RuleEditParamsBodyChallengeRulePositionBeforePosition, rulesets.RuleEditParamsBodyChallengeRulePositionAfterPosition, rulesets.RuleEditParamsBodyChallengeRulePositionIndexPosition, RuleEditParamsBodyChallengeRulePosition.

type RuleEditParamsBodyChallengeRuleRatelimit

type RuleEditParamsBodyChallengeRuleRatelimit struct {
	// Characteristics of the request on which the rate limit counter will be
	// incremented.
	Characteristics param.Field[[]string] `json:"characteristics,required"`
	// Period in seconds over which the counter is being incremented.
	Period param.Field[int64] `json:"period,required"`
	// An expression that defines when the rate limit counter should be incremented. It
	// defaults to the same as the rule's expression.
	CountingExpression param.Field[string] `json:"counting_expression"`
	// Period of time in seconds after which the action will be disabled following its
	// first execution.
	MitigationTimeout param.Field[int64] `json:"mitigation_timeout"`
	// The threshold of requests per period after which the action will be executed for
	// the first time.
	RequestsPerPeriod param.Field[int64] `json:"requests_per_period"`
	// Whether counting is only performed when an origin is reached.
	RequestsToOrigin param.Field[bool] `json:"requests_to_origin"`
	// The score threshold per period for which the action will be executed the first
	// time.
	ScorePerPeriod param.Field[int64] `json:"score_per_period"`
	// A response header name provided by the origin, which contains the score to
	// increment rate limit counter with.
	ScoreResponseHeaderName param.Field[string] `json:"score_response_header_name"`
}

An object configuring the rule's rate limit behavior.

func (RuleEditParamsBodyChallengeRuleRatelimit) MarshalJSON

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

type RuleEditParamsBodyDDoSDynamicRule

type RuleEditParamsBodyDDoSDynamicRule struct {
	// An object configuring where the rule will be placed.
	Position param.Field[RuleEditParamsBodyDDoSDynamicRulePositionUnion] `json:"position"`
	DDoSDynamicRuleParam
}

func (RuleEditParamsBodyDDoSDynamicRule) MarshalJSON

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

type RuleEditParamsBodyDDoSDynamicRulePosition

type RuleEditParamsBodyDDoSDynamicRulePosition 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"`
	// 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 index at which to place the rule, where index 1 is the first rule.
	Index param.Field[int64] `json:"index"`
}

An object configuring where the rule will be placed.

func (RuleEditParamsBodyDDoSDynamicRulePosition) MarshalJSON

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

type RuleEditParamsBodyDDoSDynamicRulePositionAfterPosition

type RuleEditParamsBodyDDoSDynamicRulePositionAfterPosition 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 (RuleEditParamsBodyDDoSDynamicRulePositionAfterPosition) MarshalJSON

type RuleEditParamsBodyDDoSDynamicRulePositionBeforePosition

type RuleEditParamsBodyDDoSDynamicRulePositionBeforePosition 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 (RuleEditParamsBodyDDoSDynamicRulePositionBeforePosition) MarshalJSON

type RuleEditParamsBodyDDoSDynamicRulePositionIndexPosition

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

An object configuring where the rule will be placed.

func (RuleEditParamsBodyDDoSDynamicRulePositionIndexPosition) MarshalJSON

type RuleEditParamsBodyDDoSDynamicRulePositionUnion

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

An object configuring where the rule will be placed.

Satisfied by rulesets.RuleEditParamsBodyDDoSDynamicRulePositionBeforePosition, rulesets.RuleEditParamsBodyDDoSDynamicRulePositionAfterPosition, rulesets.RuleEditParamsBodyDDoSDynamicRulePositionIndexPosition, RuleEditParamsBodyDDoSDynamicRulePosition.

type RuleEditParamsBodyExecuteRule

type RuleEditParamsBodyExecuteRule struct {
	// An object configuring where the rule will be placed.
	Position param.Field[RuleEditParamsBodyExecuteRulePositionUnion] `json:"position"`
	ExecuteRuleParam
}

func (RuleEditParamsBodyExecuteRule) MarshalJSON

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

type RuleEditParamsBodyExecuteRulePosition

type RuleEditParamsBodyExecuteRulePosition 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"`
	// 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 index at which to place the rule, where index 1 is the first rule.
	Index param.Field[int64] `json:"index"`
}

An object configuring where the rule will be placed.

func (RuleEditParamsBodyExecuteRulePosition) MarshalJSON

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

type RuleEditParamsBodyExecuteRulePositionAfterPosition

type RuleEditParamsBodyExecuteRulePositionAfterPosition 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 (RuleEditParamsBodyExecuteRulePositionAfterPosition) MarshalJSON

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

type RuleEditParamsBodyExecuteRulePositionBeforePosition

type RuleEditParamsBodyExecuteRulePositionBeforePosition 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 (RuleEditParamsBodyExecuteRulePositionBeforePosition) MarshalJSON

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

type RuleEditParamsBodyExecuteRulePositionIndexPosition

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

An object configuring where the rule will be placed.

func (RuleEditParamsBodyExecuteRulePositionIndexPosition) MarshalJSON

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

type RuleEditParamsBodyExecuteRulePositionUnion

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

An object configuring where the rule will be placed.

Satisfied by rulesets.RuleEditParamsBodyExecuteRulePositionBeforePosition, rulesets.RuleEditParamsBodyExecuteRulePositionAfterPosition, rulesets.RuleEditParamsBodyExecuteRulePositionIndexPosition, RuleEditParamsBodyExecuteRulePosition.

type RuleEditParamsBodyForceConnectionCloseRule

type RuleEditParamsBodyForceConnectionCloseRule struct {
	// An object configuring where the rule will be placed.
	Position param.Field[RuleEditParamsBodyForceConnectionCloseRulePositionUnion] `json:"position"`
	ForceConnectionCloseRuleParam
}

func (RuleEditParamsBodyForceConnectionCloseRule) MarshalJSON

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

type RuleEditParamsBodyForceConnectionCloseRulePosition

type RuleEditParamsBodyForceConnectionCloseRulePosition 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"`
	// 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 index at which to place the rule, where index 1 is the first rule.
	Index param.Field[int64] `json:"index"`
}

An object configuring where the rule will be placed.

func (RuleEditParamsBodyForceConnectionCloseRulePosition) MarshalJSON

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

type RuleEditParamsBodyForceConnectionCloseRulePositionAfterPosition

type RuleEditParamsBodyForceConnectionCloseRulePositionAfterPosition 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 (RuleEditParamsBodyForceConnectionCloseRulePositionAfterPosition) MarshalJSON

type RuleEditParamsBodyForceConnectionCloseRulePositionBeforePosition

type RuleEditParamsBodyForceConnectionCloseRulePositionBeforePosition 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 (RuleEditParamsBodyForceConnectionCloseRulePositionBeforePosition) MarshalJSON

type RuleEditParamsBodyForceConnectionCloseRulePositionIndexPosition

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

An object configuring where the rule will be placed.

func (RuleEditParamsBodyForceConnectionCloseRulePositionIndexPosition) MarshalJSON

type RuleEditParamsBodyJavaScriptChallengeRule

type RuleEditParamsBodyJavaScriptChallengeRule struct {
	// The unique ID of the rule.
	ID param.Field[string] `json:"id"`
	// The action to perform when the rule matches.
	Action param.Field[RuleEditParamsBodyJavaScriptChallengeRuleAction] `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"`
	// Configuration for exposed credential checking.
	ExposedCredentialCheck param.Field[RuleEditParamsBodyJavaScriptChallengeRuleExposedCredentialCheck] `json:"exposed_credential_check"`
	// 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"`
	// An object configuring where the rule will be placed.
	Position param.Field[RuleEditParamsBodyJavaScriptChallengeRulePositionUnion] `json:"position"`
	// An object configuring the rule's rate limit behavior.
	Ratelimit param.Field[RuleEditParamsBodyJavaScriptChallengeRuleRatelimit] `json:"ratelimit"`
	// The reference of the rule (the rule's ID by default).
	Ref param.Field[string] `json:"ref"`
}

func (RuleEditParamsBodyJavaScriptChallengeRule) MarshalJSON

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

type RuleEditParamsBodyJavaScriptChallengeRuleAction

type RuleEditParamsBodyJavaScriptChallengeRuleAction string

The action to perform when the rule matches.

const (
	RuleEditParamsBodyJavaScriptChallengeRuleActionJSChallenge RuleEditParamsBodyJavaScriptChallengeRuleAction = "js_challenge"
)

func (RuleEditParamsBodyJavaScriptChallengeRuleAction) IsKnown

type RuleEditParamsBodyJavaScriptChallengeRuleExposedCredentialCheck

type RuleEditParamsBodyJavaScriptChallengeRuleExposedCredentialCheck struct {
	// An expression that selects the password used in the credentials check.
	PasswordExpression param.Field[string] `json:"password_expression,required"`
	// An expression that selects the user ID used in the credentials check.
	UsernameExpression param.Field[string] `json:"username_expression,required"`
}

Configuration for exposed credential checking.

func (RuleEditParamsBodyJavaScriptChallengeRuleExposedCredentialCheck) MarshalJSON

type RuleEditParamsBodyJavaScriptChallengeRulePosition

type RuleEditParamsBodyJavaScriptChallengeRulePosition 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"`
	// 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 index at which to place the rule, where index 1 is the first rule.
	Index param.Field[int64] `json:"index"`
}

An object configuring where the rule will be placed.

func (RuleEditParamsBodyJavaScriptChallengeRulePosition) MarshalJSON

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

type RuleEditParamsBodyJavaScriptChallengeRulePositionAfterPosition

type RuleEditParamsBodyJavaScriptChallengeRulePositionAfterPosition 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 (RuleEditParamsBodyJavaScriptChallengeRulePositionAfterPosition) MarshalJSON

type RuleEditParamsBodyJavaScriptChallengeRulePositionBeforePosition

type RuleEditParamsBodyJavaScriptChallengeRulePositionBeforePosition 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 (RuleEditParamsBodyJavaScriptChallengeRulePositionBeforePosition) MarshalJSON

type RuleEditParamsBodyJavaScriptChallengeRulePositionIndexPosition

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

An object configuring where the rule will be placed.

func (RuleEditParamsBodyJavaScriptChallengeRulePositionIndexPosition) MarshalJSON

type RuleEditParamsBodyJavaScriptChallengeRuleRatelimit

type RuleEditParamsBodyJavaScriptChallengeRuleRatelimit struct {
	// Characteristics of the request on which the rate limit counter will be
	// incremented.
	Characteristics param.Field[[]string] `json:"characteristics,required"`
	// Period in seconds over which the counter is being incremented.
	Period param.Field[int64] `json:"period,required"`
	// An expression that defines when the rate limit counter should be incremented. It
	// defaults to the same as the rule's expression.
	CountingExpression param.Field[string] `json:"counting_expression"`
	// Period of time in seconds after which the action will be disabled following its
	// first execution.
	MitigationTimeout param.Field[int64] `json:"mitigation_timeout"`
	// The threshold of requests per period after which the action will be executed for
	// the first time.
	RequestsPerPeriod param.Field[int64] `json:"requests_per_period"`
	// Whether counting is only performed when an origin is reached.
	RequestsToOrigin param.Field[bool] `json:"requests_to_origin"`
	// The score threshold per period for which the action will be executed the first
	// time.
	ScorePerPeriod param.Field[int64] `json:"score_per_period"`
	// A response header name provided by the origin, which contains the score to
	// increment rate limit counter with.
	ScoreResponseHeaderName param.Field[string] `json:"score_response_header_name"`
}

An object configuring the rule's rate limit behavior.

func (RuleEditParamsBodyJavaScriptChallengeRuleRatelimit) MarshalJSON

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

type RuleEditParamsBodyLogCustomFieldRule

type RuleEditParamsBodyLogCustomFieldRule struct {
	// An object configuring where the rule will be placed.
	Position param.Field[RuleEditParamsBodyLogCustomFieldRulePositionUnion] `json:"position"`
	LogCustomFieldRuleParam
}

func (RuleEditParamsBodyLogCustomFieldRule) MarshalJSON

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

type RuleEditParamsBodyLogCustomFieldRulePosition

type RuleEditParamsBodyLogCustomFieldRulePosition 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"`
	// 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 index at which to place the rule, where index 1 is the first rule.
	Index param.Field[int64] `json:"index"`
}

An object configuring where the rule will be placed.

func (RuleEditParamsBodyLogCustomFieldRulePosition) MarshalJSON

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

type RuleEditParamsBodyLogCustomFieldRulePositionAfterPosition

type RuleEditParamsBodyLogCustomFieldRulePositionAfterPosition 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 (RuleEditParamsBodyLogCustomFieldRulePositionAfterPosition) MarshalJSON

type RuleEditParamsBodyLogCustomFieldRulePositionBeforePosition

type RuleEditParamsBodyLogCustomFieldRulePositionBeforePosition 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 (RuleEditParamsBodyLogCustomFieldRulePositionBeforePosition) MarshalJSON

type RuleEditParamsBodyLogCustomFieldRulePositionIndexPosition

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

An object configuring where the rule will be placed.

func (RuleEditParamsBodyLogCustomFieldRulePositionIndexPosition) MarshalJSON

type RuleEditParamsBodyLogRule

type RuleEditParamsBodyLogRule struct {
	// An object configuring where the rule will be placed.
	Position param.Field[RuleEditParamsBodyLogRulePositionUnion] `json:"position"`
	LogRuleParam
}

func (RuleEditParamsBodyLogRule) MarshalJSON

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

type RuleEditParamsBodyLogRulePosition

type RuleEditParamsBodyLogRulePosition 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"`
	// 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 index at which to place the rule, where index 1 is the first rule.
	Index param.Field[int64] `json:"index"`
}

An object configuring where the rule will be placed.

func (RuleEditParamsBodyLogRulePosition) MarshalJSON

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

type RuleEditParamsBodyLogRulePositionAfterPosition

type RuleEditParamsBodyLogRulePositionAfterPosition 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 (RuleEditParamsBodyLogRulePositionAfterPosition) MarshalJSON

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

type RuleEditParamsBodyLogRulePositionBeforePosition

type RuleEditParamsBodyLogRulePositionBeforePosition 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 (RuleEditParamsBodyLogRulePositionBeforePosition) MarshalJSON

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

type RuleEditParamsBodyLogRulePositionIndexPosition

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

An object configuring where the rule will be placed.

func (RuleEditParamsBodyLogRulePositionIndexPosition) MarshalJSON

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

type RuleEditParamsBodyLogRulePositionUnion

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

An object configuring where the rule will be placed.

Satisfied by rulesets.RuleEditParamsBodyLogRulePositionBeforePosition, rulesets.RuleEditParamsBodyLogRulePositionAfterPosition, rulesets.RuleEditParamsBodyLogRulePositionIndexPosition, RuleEditParamsBodyLogRulePosition.

type RuleEditParamsBodyManagedChallengeRule

type RuleEditParamsBodyManagedChallengeRule struct {
	// An object configuring where the rule will be placed.
	Position param.Field[RuleEditParamsBodyManagedChallengeRulePositionUnion] `json:"position"`
	ManagedChallengeRuleParam
}

func (RuleEditParamsBodyManagedChallengeRule) MarshalJSON

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

type RuleEditParamsBodyManagedChallengeRulePosition

type RuleEditParamsBodyManagedChallengeRulePosition 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"`
	// 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 index at which to place the rule, where index 1 is the first rule.
	Index param.Field[int64] `json:"index"`
}

An object configuring where the rule will be placed.

func (RuleEditParamsBodyManagedChallengeRulePosition) MarshalJSON

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

type RuleEditParamsBodyManagedChallengeRulePositionAfterPosition

type RuleEditParamsBodyManagedChallengeRulePositionAfterPosition 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 (RuleEditParamsBodyManagedChallengeRulePositionAfterPosition) MarshalJSON

type RuleEditParamsBodyManagedChallengeRulePositionBeforePosition

type RuleEditParamsBodyManagedChallengeRulePositionBeforePosition 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 (RuleEditParamsBodyManagedChallengeRulePositionBeforePosition) MarshalJSON

type RuleEditParamsBodyManagedChallengeRulePositionIndexPosition

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

An object configuring where the rule will be placed.

func (RuleEditParamsBodyManagedChallengeRulePositionIndexPosition) MarshalJSON

type RuleEditParamsBodyRedirectRule

type RuleEditParamsBodyRedirectRule struct {
	// An object configuring where the rule will be placed.
	Position param.Field[RuleEditParamsBodyRedirectRulePositionUnion] `json:"position"`
	RedirectRuleParam
}

func (RuleEditParamsBodyRedirectRule) MarshalJSON

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

type RuleEditParamsBodyRedirectRulePosition

type RuleEditParamsBodyRedirectRulePosition 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"`
	// 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 index at which to place the rule, where index 1 is the first rule.
	Index param.Field[int64] `json:"index"`
}

An object configuring where the rule will be placed.

func (RuleEditParamsBodyRedirectRulePosition) MarshalJSON

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

type RuleEditParamsBodyRedirectRulePositionAfterPosition

type RuleEditParamsBodyRedirectRulePositionAfterPosition 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 (RuleEditParamsBodyRedirectRulePositionAfterPosition) MarshalJSON

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

type RuleEditParamsBodyRedirectRulePositionBeforePosition

type RuleEditParamsBodyRedirectRulePositionBeforePosition 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 (RuleEditParamsBodyRedirectRulePositionBeforePosition) MarshalJSON

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

type RuleEditParamsBodyRedirectRulePositionIndexPosition

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

An object configuring where the rule will be placed.

func (RuleEditParamsBodyRedirectRulePositionIndexPosition) MarshalJSON

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

type RuleEditParamsBodyRedirectRulePositionUnion

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

An object configuring where the rule will be placed.

Satisfied by rulesets.RuleEditParamsBodyRedirectRulePositionBeforePosition, rulesets.RuleEditParamsBodyRedirectRulePositionAfterPosition, rulesets.RuleEditParamsBodyRedirectRulePositionIndexPosition, RuleEditParamsBodyRedirectRulePosition.

type RuleEditParamsBodyResponseCompressionRule

type RuleEditParamsBodyResponseCompressionRule struct {
	// An object configuring where the rule will be placed.
	Position param.Field[RuleEditParamsBodyResponseCompressionRulePositionUnion] `json:"position"`
	CompressResponseRuleParam
}

func (RuleEditParamsBodyResponseCompressionRule) MarshalJSON

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

type RuleEditParamsBodyResponseCompressionRulePosition

type RuleEditParamsBodyResponseCompressionRulePosition 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"`
	// 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 index at which to place the rule, where index 1 is the first rule.
	Index param.Field[int64] `json:"index"`
}

An object configuring where the rule will be placed.

func (RuleEditParamsBodyResponseCompressionRulePosition) MarshalJSON

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

type RuleEditParamsBodyResponseCompressionRulePositionAfterPosition

type RuleEditParamsBodyResponseCompressionRulePositionAfterPosition 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 (RuleEditParamsBodyResponseCompressionRulePositionAfterPosition) MarshalJSON

type RuleEditParamsBodyResponseCompressionRulePositionBeforePosition

type RuleEditParamsBodyResponseCompressionRulePositionBeforePosition 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 (RuleEditParamsBodyResponseCompressionRulePositionBeforePosition) MarshalJSON

type RuleEditParamsBodyResponseCompressionRulePositionIndexPosition

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

An object configuring where the rule will be placed.

func (RuleEditParamsBodyResponseCompressionRulePositionIndexPosition) MarshalJSON

type RuleEditParamsBodyRewriteRule

type RuleEditParamsBodyRewriteRule struct {
	// An object configuring where the rule will be placed.
	Position param.Field[RuleEditParamsBodyRewriteRulePositionUnion] `json:"position"`
	RewriteRuleParam
}

func (RuleEditParamsBodyRewriteRule) MarshalJSON

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

type RuleEditParamsBodyRewriteRulePosition

type RuleEditParamsBodyRewriteRulePosition 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"`
	// 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 index at which to place the rule, where index 1 is the first rule.
	Index param.Field[int64] `json:"index"`
}

An object configuring where the rule will be placed.

func (RuleEditParamsBodyRewriteRulePosition) MarshalJSON

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

type RuleEditParamsBodyRewriteRulePositionAfterPosition

type RuleEditParamsBodyRewriteRulePositionAfterPosition 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 (RuleEditParamsBodyRewriteRulePositionAfterPosition) MarshalJSON

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

type RuleEditParamsBodyRewriteRulePositionBeforePosition

type RuleEditParamsBodyRewriteRulePositionBeforePosition 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 (RuleEditParamsBodyRewriteRulePositionBeforePosition) MarshalJSON

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

type RuleEditParamsBodyRewriteRulePositionIndexPosition

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

An object configuring where the rule will be placed.

func (RuleEditParamsBodyRewriteRulePositionIndexPosition) MarshalJSON

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

type RuleEditParamsBodyRewriteRulePositionUnion

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

An object configuring where the rule will be placed.

Satisfied by rulesets.RuleEditParamsBodyRewriteRulePositionBeforePosition, rulesets.RuleEditParamsBodyRewriteRulePositionAfterPosition, rulesets.RuleEditParamsBodyRewriteRulePositionIndexPosition, RuleEditParamsBodyRewriteRulePosition.

type RuleEditParamsBodyRouteRule

type RuleEditParamsBodyRouteRule struct {
	// An object configuring where the rule will be placed.
	Position param.Field[RuleEditParamsBodyRouteRulePositionUnion] `json:"position"`
	RouteRuleParam
}

func (RuleEditParamsBodyRouteRule) MarshalJSON

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

type RuleEditParamsBodyRouteRulePosition

type RuleEditParamsBodyRouteRulePosition 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"`
	// 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 index at which to place the rule, where index 1 is the first rule.
	Index param.Field[int64] `json:"index"`
}

An object configuring where the rule will be placed.

func (RuleEditParamsBodyRouteRulePosition) MarshalJSON

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

type RuleEditParamsBodyRouteRulePositionAfterPosition

type RuleEditParamsBodyRouteRulePositionAfterPosition 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 (RuleEditParamsBodyRouteRulePositionAfterPosition) MarshalJSON

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

type RuleEditParamsBodyRouteRulePositionBeforePosition

type RuleEditParamsBodyRouteRulePositionBeforePosition 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 (RuleEditParamsBodyRouteRulePositionBeforePosition) MarshalJSON

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

type RuleEditParamsBodyRouteRulePositionIndexPosition

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

An object configuring where the rule will be placed.

func (RuleEditParamsBodyRouteRulePositionIndexPosition) MarshalJSON

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

type RuleEditParamsBodyRouteRulePositionUnion

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

An object configuring where the rule will be placed.

Satisfied by rulesets.RuleEditParamsBodyRouteRulePositionBeforePosition, rulesets.RuleEditParamsBodyRouteRulePositionAfterPosition, rulesets.RuleEditParamsBodyRouteRulePositionIndexPosition, RuleEditParamsBodyRouteRulePosition.

type RuleEditParamsBodyScoreRule

type RuleEditParamsBodyScoreRule struct {
	// An object configuring where the rule will be placed.
	Position param.Field[RuleEditParamsBodyScoreRulePositionUnion] `json:"position"`
	ScoreRuleParam
}

func (RuleEditParamsBodyScoreRule) MarshalJSON

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

type RuleEditParamsBodyScoreRulePosition

type RuleEditParamsBodyScoreRulePosition 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"`
	// 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 index at which to place the rule, where index 1 is the first rule.
	Index param.Field[int64] `json:"index"`
}

An object configuring where the rule will be placed.

func (RuleEditParamsBodyScoreRulePosition) MarshalJSON

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

type RuleEditParamsBodyScoreRulePositionAfterPosition

type RuleEditParamsBodyScoreRulePositionAfterPosition 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 (RuleEditParamsBodyScoreRulePositionAfterPosition) MarshalJSON

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

type RuleEditParamsBodyScoreRulePositionBeforePosition

type RuleEditParamsBodyScoreRulePositionBeforePosition 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 (RuleEditParamsBodyScoreRulePositionBeforePosition) MarshalJSON

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

type RuleEditParamsBodyScoreRulePositionIndexPosition

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

An object configuring where the rule will be placed.

func (RuleEditParamsBodyScoreRulePositionIndexPosition) MarshalJSON

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

type RuleEditParamsBodyScoreRulePositionUnion

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

An object configuring where the rule will be placed.

Satisfied by rulesets.RuleEditParamsBodyScoreRulePositionBeforePosition, rulesets.RuleEditParamsBodyScoreRulePositionAfterPosition, rulesets.RuleEditParamsBodyScoreRulePositionIndexPosition, RuleEditParamsBodyScoreRulePosition.

type RuleEditParamsBodyServeErrorRule

type RuleEditParamsBodyServeErrorRule struct {
	// An object configuring where the rule will be placed.
	Position param.Field[RuleEditParamsBodyServeErrorRulePositionUnion] `json:"position"`
	ServeErrorRuleParam
}

func (RuleEditParamsBodyServeErrorRule) MarshalJSON

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

type RuleEditParamsBodyServeErrorRulePosition

type RuleEditParamsBodyServeErrorRulePosition 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"`
	// 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 index at which to place the rule, where index 1 is the first rule.
	Index param.Field[int64] `json:"index"`
}

An object configuring where the rule will be placed.

func (RuleEditParamsBodyServeErrorRulePosition) MarshalJSON

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

type RuleEditParamsBodyServeErrorRulePositionAfterPosition

type RuleEditParamsBodyServeErrorRulePositionAfterPosition 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 (RuleEditParamsBodyServeErrorRulePositionAfterPosition) MarshalJSON

type RuleEditParamsBodyServeErrorRulePositionBeforePosition

type RuleEditParamsBodyServeErrorRulePositionBeforePosition 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 (RuleEditParamsBodyServeErrorRulePositionBeforePosition) MarshalJSON

type RuleEditParamsBodyServeErrorRulePositionIndexPosition

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

An object configuring where the rule will be placed.

func (RuleEditParamsBodyServeErrorRulePositionIndexPosition) MarshalJSON

type RuleEditParamsBodyServeErrorRulePositionUnion

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

An object configuring where the rule will be placed.

Satisfied by rulesets.RuleEditParamsBodyServeErrorRulePositionBeforePosition, rulesets.RuleEditParamsBodyServeErrorRulePositionAfterPosition, rulesets.RuleEditParamsBodyServeErrorRulePositionIndexPosition, RuleEditParamsBodyServeErrorRulePosition.

type RuleEditParamsBodySetCacheSettingsRule

type RuleEditParamsBodySetCacheSettingsRule struct {
	// An object configuring where the rule will be placed.
	Position param.Field[RuleEditParamsBodySetCacheSettingsRulePositionUnion] `json:"position"`
	SetCacheSettingsRuleParam
}

func (RuleEditParamsBodySetCacheSettingsRule) MarshalJSON

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

type RuleEditParamsBodySetCacheSettingsRulePosition

type RuleEditParamsBodySetCacheSettingsRulePosition 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"`
	// 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 index at which to place the rule, where index 1 is the first rule.
	Index param.Field[int64] `json:"index"`
}

An object configuring where the rule will be placed.

func (RuleEditParamsBodySetCacheSettingsRulePosition) MarshalJSON

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

type RuleEditParamsBodySetCacheSettingsRulePositionAfterPosition

type RuleEditParamsBodySetCacheSettingsRulePositionAfterPosition 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 (RuleEditParamsBodySetCacheSettingsRulePositionAfterPosition) MarshalJSON

type RuleEditParamsBodySetCacheSettingsRulePositionBeforePosition

type RuleEditParamsBodySetCacheSettingsRulePositionBeforePosition 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 (RuleEditParamsBodySetCacheSettingsRulePositionBeforePosition) MarshalJSON

type RuleEditParamsBodySetCacheSettingsRulePositionIndexPosition

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

An object configuring where the rule will be placed.

func (RuleEditParamsBodySetCacheSettingsRulePositionIndexPosition) MarshalJSON

type RuleEditParamsBodySetConfigurationRule

type RuleEditParamsBodySetConfigurationRule struct {
	// An object configuring where the rule will be placed.
	Position param.Field[RuleEditParamsBodySetConfigurationRulePositionUnion] `json:"position"`
	SetConfigRuleParam
}

func (RuleEditParamsBodySetConfigurationRule) MarshalJSON

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

type RuleEditParamsBodySetConfigurationRulePosition

type RuleEditParamsBodySetConfigurationRulePosition 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"`
	// 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 index at which to place the rule, where index 1 is the first rule.
	Index param.Field[int64] `json:"index"`
}

An object configuring where the rule will be placed.

func (RuleEditParamsBodySetConfigurationRulePosition) MarshalJSON

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

type RuleEditParamsBodySetConfigurationRulePositionAfterPosition

type RuleEditParamsBodySetConfigurationRulePositionAfterPosition 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 (RuleEditParamsBodySetConfigurationRulePositionAfterPosition) MarshalJSON

type RuleEditParamsBodySetConfigurationRulePositionBeforePosition

type RuleEditParamsBodySetConfigurationRulePositionBeforePosition 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 (RuleEditParamsBodySetConfigurationRulePositionBeforePosition) MarshalJSON

type RuleEditParamsBodySetConfigurationRulePositionIndexPosition

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

An object configuring where the rule will be placed.

func (RuleEditParamsBodySetConfigurationRulePositionIndexPosition) MarshalJSON

type RuleEditParamsBodySkipRule

type RuleEditParamsBodySkipRule struct {
	// An object configuring where the rule will be placed.
	Position param.Field[RuleEditParamsBodySkipRulePositionUnion] `json:"position"`
	SkipRuleParam
}

func (RuleEditParamsBodySkipRule) MarshalJSON

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

type RuleEditParamsBodySkipRulePosition

type RuleEditParamsBodySkipRulePosition 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"`
	// 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 index at which to place the rule, where index 1 is the first rule.
	Index param.Field[int64] `json:"index"`
}

An object configuring where the rule will be placed.

func (RuleEditParamsBodySkipRulePosition) MarshalJSON

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

type RuleEditParamsBodySkipRulePositionAfterPosition

type RuleEditParamsBodySkipRulePositionAfterPosition 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 (RuleEditParamsBodySkipRulePositionAfterPosition) MarshalJSON

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

type RuleEditParamsBodySkipRulePositionBeforePosition

type RuleEditParamsBodySkipRulePositionBeforePosition 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 (RuleEditParamsBodySkipRulePositionBeforePosition) MarshalJSON

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

type RuleEditParamsBodySkipRulePositionIndexPosition

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

An object configuring where the rule will be placed.

func (RuleEditParamsBodySkipRulePositionIndexPosition) MarshalJSON

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

type RuleEditParamsBodySkipRulePositionUnion

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

An object configuring where the rule will be placed.

Satisfied by rulesets.RuleEditParamsBodySkipRulePositionBeforePosition, rulesets.RuleEditParamsBodySkipRulePositionAfterPosition, rulesets.RuleEditParamsBodySkipRulePositionIndexPosition, RuleEditParamsBodySkipRulePosition.

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 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 RuleEditResponseRulesAction `json:"action"`
	// This field can have the runtime type of [BlockRuleActionParameters],
	// [interface{}], [CompressResponseRuleActionParameters],
	// [ExecuteRuleActionParameters], [LogCustomFieldRuleActionParameters],
	// [RedirectRuleActionParameters], [RewriteRuleActionParameters],
	// [RouteRuleActionParameters], [ScoreRuleActionParameters],
	// [ServeErrorRuleActionParameters], [SetCacheSettingsRuleActionParameters],
	// [SetConfigRuleActionParameters], [SkipRuleActionParameters].
	ActionParameters interface{} `json:"action_parameters"`
	// This field can have the runtime type of [[]string].
	Categories interface{} `json:"categories"`
	// An informative description of the rule.
	Description string `json:"description"`
	// Whether the rule should be executed.
	Enabled bool `json:"enabled"`
	// This field can have the runtime type of [BlockRuleExposedCredentialCheck],
	// [RuleEditResponseRulesRulesetsChallengeRuleExposedCredentialCheck],
	// [CompressResponseRuleExposedCredentialCheck],
	// [DDoSDynamicRuleExposedCredentialCheck], [ExecuteRuleExposedCredentialCheck],
	// [ForceConnectionCloseRuleExposedCredentialCheck],
	// [RuleEditResponseRulesRulesetsJSChallengeRuleExposedCredentialCheck],
	// [LogRuleExposedCredentialCheck], [LogCustomFieldRuleExposedCredentialCheck],
	// [ManagedChallengeRuleExposedCredentialCheck],
	// [RedirectRuleExposedCredentialCheck], [RewriteRuleExposedCredentialCheck],
	// [RouteRuleExposedCredentialCheck], [ScoreRuleExposedCredentialCheck],
	// [ServeErrorRuleExposedCredentialCheck],
	// [SetCacheSettingsRuleExposedCredentialCheck],
	// [SetConfigRuleExposedCredentialCheck], [SkipRuleExposedCredentialCheck].
	ExposedCredentialCheck interface{} `json:"exposed_credential_check"`
	// 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"`
	// This field can have the runtime type of [BlockRuleRatelimit],
	// [RuleEditResponseRulesRulesetsChallengeRuleRatelimit],
	// [CompressResponseRuleRatelimit], [DDoSDynamicRuleRatelimit],
	// [ExecuteRuleRatelimit], [ForceConnectionCloseRuleRatelimit],
	// [RuleEditResponseRulesRulesetsJSChallengeRuleRatelimit], [LogRuleRatelimit],
	// [LogCustomFieldRuleRatelimit], [ManagedChallengeRuleRatelimit],
	// [RedirectRuleRatelimit], [RewriteRuleRatelimit], [RouteRuleRatelimit],
	// [ScoreRuleRatelimit], [ServeErrorRuleRatelimit],
	// [SetCacheSettingsRuleRatelimit], [SetConfigRuleRatelimit], [SkipRuleRatelimit].
	Ratelimit interface{} `json:"ratelimit"`
	// The reference of the rule (the rule's ID by default).
	Ref  string                   `json:"ref"`
	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"
	RuleEditResponseRulesActionDDoSDynamic          RuleEditResponseRulesAction = "ddos_dynamic"
	RuleEditResponseRulesActionExecute              RuleEditResponseRulesAction = "execute"
	RuleEditResponseRulesActionForceConnectionClose RuleEditResponseRulesAction = "force_connection_close"
	RuleEditResponseRulesActionJSChallenge          RuleEditResponseRulesAction = "js_challenge"
	RuleEditResponseRulesActionLog                  RuleEditResponseRulesAction = "log"
	RuleEditResponseRulesActionLogCustomField       RuleEditResponseRulesAction = "log_custom_field"
	RuleEditResponseRulesActionManagedChallenge     RuleEditResponseRulesAction = "managed_challenge"
	RuleEditResponseRulesActionRedirect             RuleEditResponseRulesAction = "redirect"
	RuleEditResponseRulesActionRewrite              RuleEditResponseRulesAction = "rewrite"
	RuleEditResponseRulesActionRoute                RuleEditResponseRulesAction = "route"
	RuleEditResponseRulesActionScore                RuleEditResponseRulesAction = "score"
	RuleEditResponseRulesActionServeError           RuleEditResponseRulesAction = "serve_error"
	RuleEditResponseRulesActionSetCacheSettings     RuleEditResponseRulesAction = "set_cache_settings"
	RuleEditResponseRulesActionSetConfig            RuleEditResponseRulesAction = "set_config"
	RuleEditResponseRulesActionSkip                 RuleEditResponseRulesAction = "skip"
)

func (RuleEditResponseRulesAction) IsKnown

func (r RuleEditResponseRulesAction) IsKnown() bool

type RuleEditResponseRulesRulesetsChallengeRule

type RuleEditResponseRulesRulesetsChallengeRule 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 RuleEditResponseRulesRulesetsChallengeRuleAction `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"`
	// Configuration for exposed credential checking.
	ExposedCredentialCheck RuleEditResponseRulesRulesetsChallengeRuleExposedCredentialCheck `json:"exposed_credential_check"`
	// 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"`
	// An object configuring the rule's rate limit behavior.
	Ratelimit RuleEditResponseRulesRulesetsChallengeRuleRatelimit `json:"ratelimit"`
	// The reference of the rule (the rule's ID by default).
	Ref  string                                         `json:"ref"`
	JSON ruleEditResponseRulesRulesetsChallengeRuleJSON `json:"-"`
}

func (*RuleEditResponseRulesRulesetsChallengeRule) UnmarshalJSON

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

type RuleEditResponseRulesRulesetsChallengeRuleAction

type RuleEditResponseRulesRulesetsChallengeRuleAction string

The action to perform when the rule matches.

const (
	RuleEditResponseRulesRulesetsChallengeRuleActionChallenge RuleEditResponseRulesRulesetsChallengeRuleAction = "challenge"
)

func (RuleEditResponseRulesRulesetsChallengeRuleAction) IsKnown

type RuleEditResponseRulesRulesetsChallengeRuleExposedCredentialCheck

type RuleEditResponseRulesRulesetsChallengeRuleExposedCredentialCheck struct {
	// An expression that selects the password used in the credentials check.
	PasswordExpression string `json:"password_expression,required"`
	// An expression that selects the user ID used in the credentials check.
	UsernameExpression string                                                               `json:"username_expression,required"`
	JSON               ruleEditResponseRulesRulesetsChallengeRuleExposedCredentialCheckJSON `json:"-"`
}

Configuration for exposed credential checking.

func (*RuleEditResponseRulesRulesetsChallengeRuleExposedCredentialCheck) UnmarshalJSON

type RuleEditResponseRulesRulesetsChallengeRuleRatelimit

type RuleEditResponseRulesRulesetsChallengeRuleRatelimit struct {
	// Characteristics of the request on which the rate limit counter will be
	// incremented.
	Characteristics []string `json:"characteristics,required"`
	// Period in seconds over which the counter is being incremented.
	Period int64 `json:"period,required"`
	// An expression that defines when the rate limit counter should be incremented. It
	// defaults to the same as the rule's expression.
	CountingExpression string `json:"counting_expression"`
	// Period of time in seconds after which the action will be disabled following its
	// first execution.
	MitigationTimeout int64 `json:"mitigation_timeout"`
	// The threshold of requests per period after which the action will be executed for
	// the first time.
	RequestsPerPeriod int64 `json:"requests_per_period"`
	// Whether counting is only performed when an origin is reached.
	RequestsToOrigin bool `json:"requests_to_origin"`
	// The score threshold per period for which the action will be executed the first
	// time.
	ScorePerPeriod int64 `json:"score_per_period"`
	// A response header name provided by the origin, which contains the score to
	// increment rate limit counter with.
	ScoreResponseHeaderName string                                                  `json:"score_response_header_name"`
	JSON                    ruleEditResponseRulesRulesetsChallengeRuleRatelimitJSON `json:"-"`
}

An object configuring the rule's rate limit behavior.

func (*RuleEditResponseRulesRulesetsChallengeRuleRatelimit) UnmarshalJSON

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

type RuleEditResponseRulesRulesetsJSChallengeRule

type RuleEditResponseRulesRulesetsJSChallengeRule 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 RuleEditResponseRulesRulesetsJSChallengeRuleAction `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"`
	// Configuration for exposed credential checking.
	ExposedCredentialCheck RuleEditResponseRulesRulesetsJSChallengeRuleExposedCredentialCheck `json:"exposed_credential_check"`
	// 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"`
	// An object configuring the rule's rate limit behavior.
	Ratelimit RuleEditResponseRulesRulesetsJSChallengeRuleRatelimit `json:"ratelimit"`
	// The reference of the rule (the rule's ID by default).
	Ref  string                                           `json:"ref"`
	JSON ruleEditResponseRulesRulesetsJSChallengeRuleJSON `json:"-"`
}

func (*RuleEditResponseRulesRulesetsJSChallengeRule) UnmarshalJSON

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

type RuleEditResponseRulesRulesetsJSChallengeRuleAction

type RuleEditResponseRulesRulesetsJSChallengeRuleAction string

The action to perform when the rule matches.

const (
	RuleEditResponseRulesRulesetsJSChallengeRuleActionJSChallenge RuleEditResponseRulesRulesetsJSChallengeRuleAction = "js_challenge"
)

func (RuleEditResponseRulesRulesetsJSChallengeRuleAction) IsKnown

type RuleEditResponseRulesRulesetsJSChallengeRuleExposedCredentialCheck

type RuleEditResponseRulesRulesetsJSChallengeRuleExposedCredentialCheck struct {
	// An expression that selects the password used in the credentials check.
	PasswordExpression string `json:"password_expression,required"`
	// An expression that selects the user ID used in the credentials check.
	UsernameExpression string                                                                 `json:"username_expression,required"`
	JSON               ruleEditResponseRulesRulesetsJSChallengeRuleExposedCredentialCheckJSON `json:"-"`
}

Configuration for exposed credential checking.

func (*RuleEditResponseRulesRulesetsJSChallengeRuleExposedCredentialCheck) UnmarshalJSON

type RuleEditResponseRulesRulesetsJSChallengeRuleRatelimit

type RuleEditResponseRulesRulesetsJSChallengeRuleRatelimit struct {
	// Characteristics of the request on which the rate limit counter will be
	// incremented.
	Characteristics []string `json:"characteristics,required"`
	// Period in seconds over which the counter is being incremented.
	Period int64 `json:"period,required"`
	// An expression that defines when the rate limit counter should be incremented. It
	// defaults to the same as the rule's expression.
	CountingExpression string `json:"counting_expression"`
	// Period of time in seconds after which the action will be disabled following its
	// first execution.
	MitigationTimeout int64 `json:"mitigation_timeout"`
	// The threshold of requests per period after which the action will be executed for
	// the first time.
	RequestsPerPeriod int64 `json:"requests_per_period"`
	// Whether counting is only performed when an origin is reached.
	RequestsToOrigin bool `json:"requests_to_origin"`
	// The score threshold per period for which the action will be executed the first
	// time.
	ScorePerPeriod int64 `json:"score_per_period"`
	// A response header name provided by the origin, which contains the score to
	// increment rate limit counter with.
	ScoreResponseHeaderName string                                                    `json:"score_response_header_name"`
	JSON                    ruleEditResponseRulesRulesetsJSChallengeRuleRatelimitJSON `json:"-"`
}

An object configuring the rule's rate limit behavior.

func (*RuleEditResponseRulesRulesetsJSChallengeRuleRatelimit) UnmarshalJSON

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

type RuleNewParams

type RuleNewParams struct {
	Body RuleNewParamsBodyUnion `json:"body,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"`
}

func (RuleNewParams) MarshalJSON

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

type RuleNewParamsBody

type RuleNewParamsBody struct {
	// The unique ID of the rule.
	ID param.Field[string] `json:"id"`
	// The action to perform when the rule matches.
	Action           param.Field[RuleNewParamsBodyAction] `json:"action"`
	ActionParameters param.Field[interface{}]             `json:"action_parameters"`
	Categories       param.Field[interface{}]             `json:"categories"`
	// An informative description of the rule.
	Description param.Field[string] `json:"description"`
	// Whether the rule should be executed.
	Enabled                param.Field[bool]        `json:"enabled"`
	ExposedCredentialCheck param.Field[interface{}] `json:"exposed_credential_check"`
	// 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"`
	Position  param.Field[interface{}]  `json:"position"`
	Ratelimit param.Field[interface{}]  `json:"ratelimit"`
	// The reference of the rule (the rule's ID by default).
	Ref param.Field[string] `json:"ref"`
}

func (RuleNewParamsBody) MarshalJSON

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

type RuleNewParamsBodyAction

type RuleNewParamsBodyAction string

The action to perform when the rule matches.

const (
	RuleNewParamsBodyActionBlock                RuleNewParamsBodyAction = "block"
	RuleNewParamsBodyActionChallenge            RuleNewParamsBodyAction = "challenge"
	RuleNewParamsBodyActionCompressResponse     RuleNewParamsBodyAction = "compress_response"
	RuleNewParamsBodyActionDDoSDynamic          RuleNewParamsBodyAction = "ddos_dynamic"
	RuleNewParamsBodyActionExecute              RuleNewParamsBodyAction = "execute"
	RuleNewParamsBodyActionForceConnectionClose RuleNewParamsBodyAction = "force_connection_close"
	RuleNewParamsBodyActionJSChallenge          RuleNewParamsBodyAction = "js_challenge"
	RuleNewParamsBodyActionLog                  RuleNewParamsBodyAction = "log"
	RuleNewParamsBodyActionLogCustomField       RuleNewParamsBodyAction = "log_custom_field"
	RuleNewParamsBodyActionManagedChallenge     RuleNewParamsBodyAction = "managed_challenge"
	RuleNewParamsBodyActionRedirect             RuleNewParamsBodyAction = "redirect"
	RuleNewParamsBodyActionRewrite              RuleNewParamsBodyAction = "rewrite"
	RuleNewParamsBodyActionRoute                RuleNewParamsBodyAction = "route"
	RuleNewParamsBodyActionScore                RuleNewParamsBodyAction = "score"
	RuleNewParamsBodyActionServeError           RuleNewParamsBodyAction = "serve_error"
	RuleNewParamsBodyActionSetCacheSettings     RuleNewParamsBodyAction = "set_cache_settings"
	RuleNewParamsBodyActionSetConfig            RuleNewParamsBodyAction = "set_config"
	RuleNewParamsBodyActionSkip                 RuleNewParamsBodyAction = "skip"
)

func (RuleNewParamsBodyAction) IsKnown

func (r RuleNewParamsBodyAction) IsKnown() bool

type RuleNewParamsBodyBlockRule

type RuleNewParamsBodyBlockRule struct {
	// An object configuring where the rule will be placed.
	Position param.Field[RuleNewParamsBodyBlockRulePositionUnion] `json:"position"`
	BlockRuleParam
}

func (RuleNewParamsBodyBlockRule) MarshalJSON

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

type RuleNewParamsBodyBlockRulePosition

type RuleNewParamsBodyBlockRulePosition 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"`
	// 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 index at which to place the rule, where index 1 is the first rule.
	Index param.Field[int64] `json:"index"`
}

An object configuring where the rule will be placed.

func (RuleNewParamsBodyBlockRulePosition) MarshalJSON

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

type RuleNewParamsBodyBlockRulePositionAfterPosition

type RuleNewParamsBodyBlockRulePositionAfterPosition 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 (RuleNewParamsBodyBlockRulePositionAfterPosition) MarshalJSON

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

type RuleNewParamsBodyBlockRulePositionBeforePosition

type RuleNewParamsBodyBlockRulePositionBeforePosition 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 (RuleNewParamsBodyBlockRulePositionBeforePosition) MarshalJSON

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

type RuleNewParamsBodyBlockRulePositionIndexPosition

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

An object configuring where the rule will be placed.

func (RuleNewParamsBodyBlockRulePositionIndexPosition) MarshalJSON

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

type RuleNewParamsBodyBlockRulePositionUnion

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

An object configuring where the rule will be placed.

Satisfied by rulesets.RuleNewParamsBodyBlockRulePositionBeforePosition, rulesets.RuleNewParamsBodyBlockRulePositionAfterPosition, rulesets.RuleNewParamsBodyBlockRulePositionIndexPosition, RuleNewParamsBodyBlockRulePosition.

type RuleNewParamsBodyChallengeRule

type RuleNewParamsBodyChallengeRule struct {
	// The unique ID of the rule.
	ID param.Field[string] `json:"id"`
	// The action to perform when the rule matches.
	Action param.Field[RuleNewParamsBodyChallengeRuleAction] `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"`
	// Configuration for exposed credential checking.
	ExposedCredentialCheck param.Field[RuleNewParamsBodyChallengeRuleExposedCredentialCheck] `json:"exposed_credential_check"`
	// 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"`
	// An object configuring where the rule will be placed.
	Position param.Field[RuleNewParamsBodyChallengeRulePositionUnion] `json:"position"`
	// An object configuring the rule's rate limit behavior.
	Ratelimit param.Field[RuleNewParamsBodyChallengeRuleRatelimit] `json:"ratelimit"`
	// The reference of the rule (the rule's ID by default).
	Ref param.Field[string] `json:"ref"`
}

func (RuleNewParamsBodyChallengeRule) MarshalJSON

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

type RuleNewParamsBodyChallengeRuleAction

type RuleNewParamsBodyChallengeRuleAction string

The action to perform when the rule matches.

const (
	RuleNewParamsBodyChallengeRuleActionChallenge RuleNewParamsBodyChallengeRuleAction = "challenge"
)

func (RuleNewParamsBodyChallengeRuleAction) IsKnown

type RuleNewParamsBodyChallengeRuleExposedCredentialCheck

type RuleNewParamsBodyChallengeRuleExposedCredentialCheck struct {
	// An expression that selects the password used in the credentials check.
	PasswordExpression param.Field[string] `json:"password_expression,required"`
	// An expression that selects the user ID used in the credentials check.
	UsernameExpression param.Field[string] `json:"username_expression,required"`
}

Configuration for exposed credential checking.

func (RuleNewParamsBodyChallengeRuleExposedCredentialCheck) MarshalJSON

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

type RuleNewParamsBodyChallengeRulePosition

type RuleNewParamsBodyChallengeRulePosition 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"`
	// 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 index at which to place the rule, where index 1 is the first rule.
	Index param.Field[int64] `json:"index"`
}

An object configuring where the rule will be placed.

func (RuleNewParamsBodyChallengeRulePosition) MarshalJSON

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

type RuleNewParamsBodyChallengeRulePositionAfterPosition

type RuleNewParamsBodyChallengeRulePositionAfterPosition 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 (RuleNewParamsBodyChallengeRulePositionAfterPosition) MarshalJSON

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

type RuleNewParamsBodyChallengeRulePositionBeforePosition

type RuleNewParamsBodyChallengeRulePositionBeforePosition 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 (RuleNewParamsBodyChallengeRulePositionBeforePosition) MarshalJSON

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

type RuleNewParamsBodyChallengeRulePositionIndexPosition

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

An object configuring where the rule will be placed.

func (RuleNewParamsBodyChallengeRulePositionIndexPosition) MarshalJSON

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

type RuleNewParamsBodyChallengeRulePositionUnion

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

An object configuring where the rule will be placed.

Satisfied by rulesets.RuleNewParamsBodyChallengeRulePositionBeforePosition, rulesets.RuleNewParamsBodyChallengeRulePositionAfterPosition, rulesets.RuleNewParamsBodyChallengeRulePositionIndexPosition, RuleNewParamsBodyChallengeRulePosition.

type RuleNewParamsBodyChallengeRuleRatelimit

type RuleNewParamsBodyChallengeRuleRatelimit struct {
	// Characteristics of the request on which the rate limit counter will be
	// incremented.
	Characteristics param.Field[[]string] `json:"characteristics,required"`
	// Period in seconds over which the counter is being incremented.
	Period param.Field[int64] `json:"period,required"`
	// An expression that defines when the rate limit counter should be incremented. It
	// defaults to the same as the rule's expression.
	CountingExpression param.Field[string] `json:"counting_expression"`
	// Period of time in seconds after which the action will be disabled following its
	// first execution.
	MitigationTimeout param.Field[int64] `json:"mitigation_timeout"`
	// The threshold of requests per period after which the action will be executed for
	// the first time.
	RequestsPerPeriod param.Field[int64] `json:"requests_per_period"`
	// Whether counting is only performed when an origin is reached.
	RequestsToOrigin param.Field[bool] `json:"requests_to_origin"`
	// The score threshold per period for which the action will be executed the first
	// time.
	ScorePerPeriod param.Field[int64] `json:"score_per_period"`
	// A response header name provided by the origin, which contains the score to
	// increment rate limit counter with.
	ScoreResponseHeaderName param.Field[string] `json:"score_response_header_name"`
}

An object configuring the rule's rate limit behavior.

func (RuleNewParamsBodyChallengeRuleRatelimit) MarshalJSON

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

type RuleNewParamsBodyDDoSDynamicRule

type RuleNewParamsBodyDDoSDynamicRule struct {
	// An object configuring where the rule will be placed.
	Position param.Field[RuleNewParamsBodyDDoSDynamicRulePositionUnion] `json:"position"`
	DDoSDynamicRuleParam
}

func (RuleNewParamsBodyDDoSDynamicRule) MarshalJSON

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

type RuleNewParamsBodyDDoSDynamicRulePosition

type RuleNewParamsBodyDDoSDynamicRulePosition 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"`
	// 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 index at which to place the rule, where index 1 is the first rule.
	Index param.Field[int64] `json:"index"`
}

An object configuring where the rule will be placed.

func (RuleNewParamsBodyDDoSDynamicRulePosition) MarshalJSON

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

type RuleNewParamsBodyDDoSDynamicRulePositionAfterPosition

type RuleNewParamsBodyDDoSDynamicRulePositionAfterPosition 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 (RuleNewParamsBodyDDoSDynamicRulePositionAfterPosition) MarshalJSON

type RuleNewParamsBodyDDoSDynamicRulePositionBeforePosition

type RuleNewParamsBodyDDoSDynamicRulePositionBeforePosition 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 (RuleNewParamsBodyDDoSDynamicRulePositionBeforePosition) MarshalJSON

type RuleNewParamsBodyDDoSDynamicRulePositionIndexPosition

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

An object configuring where the rule will be placed.

func (RuleNewParamsBodyDDoSDynamicRulePositionIndexPosition) MarshalJSON

type RuleNewParamsBodyDDoSDynamicRulePositionUnion

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

An object configuring where the rule will be placed.

Satisfied by rulesets.RuleNewParamsBodyDDoSDynamicRulePositionBeforePosition, rulesets.RuleNewParamsBodyDDoSDynamicRulePositionAfterPosition, rulesets.RuleNewParamsBodyDDoSDynamicRulePositionIndexPosition, RuleNewParamsBodyDDoSDynamicRulePosition.

type RuleNewParamsBodyExecuteRule

type RuleNewParamsBodyExecuteRule struct {
	// An object configuring where the rule will be placed.
	Position param.Field[RuleNewParamsBodyExecuteRulePositionUnion] `json:"position"`
	ExecuteRuleParam
}

func (RuleNewParamsBodyExecuteRule) MarshalJSON

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

type RuleNewParamsBodyExecuteRulePosition

type RuleNewParamsBodyExecuteRulePosition 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"`
	// 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 index at which to place the rule, where index 1 is the first rule.
	Index param.Field[int64] `json:"index"`
}

An object configuring where the rule will be placed.

func (RuleNewParamsBodyExecuteRulePosition) MarshalJSON

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

type RuleNewParamsBodyExecuteRulePositionAfterPosition

type RuleNewParamsBodyExecuteRulePositionAfterPosition 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 (RuleNewParamsBodyExecuteRulePositionAfterPosition) MarshalJSON

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

type RuleNewParamsBodyExecuteRulePositionBeforePosition

type RuleNewParamsBodyExecuteRulePositionBeforePosition 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 (RuleNewParamsBodyExecuteRulePositionBeforePosition) MarshalJSON

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

type RuleNewParamsBodyExecuteRulePositionIndexPosition

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

An object configuring where the rule will be placed.

func (RuleNewParamsBodyExecuteRulePositionIndexPosition) MarshalJSON

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

type RuleNewParamsBodyExecuteRulePositionUnion

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

An object configuring where the rule will be placed.

Satisfied by rulesets.RuleNewParamsBodyExecuteRulePositionBeforePosition, rulesets.RuleNewParamsBodyExecuteRulePositionAfterPosition, rulesets.RuleNewParamsBodyExecuteRulePositionIndexPosition, RuleNewParamsBodyExecuteRulePosition.

type RuleNewParamsBodyForceConnectionCloseRule

type RuleNewParamsBodyForceConnectionCloseRule struct {
	// An object configuring where the rule will be placed.
	Position param.Field[RuleNewParamsBodyForceConnectionCloseRulePositionUnion] `json:"position"`
	ForceConnectionCloseRuleParam
}

func (RuleNewParamsBodyForceConnectionCloseRule) MarshalJSON

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

type RuleNewParamsBodyForceConnectionCloseRulePosition

type RuleNewParamsBodyForceConnectionCloseRulePosition 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"`
	// 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 index at which to place the rule, where index 1 is the first rule.
	Index param.Field[int64] `json:"index"`
}

An object configuring where the rule will be placed.

func (RuleNewParamsBodyForceConnectionCloseRulePosition) MarshalJSON

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

type RuleNewParamsBodyForceConnectionCloseRulePositionAfterPosition

type RuleNewParamsBodyForceConnectionCloseRulePositionAfterPosition 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 (RuleNewParamsBodyForceConnectionCloseRulePositionAfterPosition) MarshalJSON

type RuleNewParamsBodyForceConnectionCloseRulePositionBeforePosition

type RuleNewParamsBodyForceConnectionCloseRulePositionBeforePosition 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 (RuleNewParamsBodyForceConnectionCloseRulePositionBeforePosition) MarshalJSON

type RuleNewParamsBodyForceConnectionCloseRulePositionIndexPosition

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

An object configuring where the rule will be placed.

func (RuleNewParamsBodyForceConnectionCloseRulePositionIndexPosition) MarshalJSON

type RuleNewParamsBodyJavaScriptChallengeRule

type RuleNewParamsBodyJavaScriptChallengeRule struct {
	// The unique ID of the rule.
	ID param.Field[string] `json:"id"`
	// The action to perform when the rule matches.
	Action param.Field[RuleNewParamsBodyJavaScriptChallengeRuleAction] `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"`
	// Configuration for exposed credential checking.
	ExposedCredentialCheck param.Field[RuleNewParamsBodyJavaScriptChallengeRuleExposedCredentialCheck] `json:"exposed_credential_check"`
	// 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"`
	// An object configuring where the rule will be placed.
	Position param.Field[RuleNewParamsBodyJavaScriptChallengeRulePositionUnion] `json:"position"`
	// An object configuring the rule's rate limit behavior.
	Ratelimit param.Field[RuleNewParamsBodyJavaScriptChallengeRuleRatelimit] `json:"ratelimit"`
	// The reference of the rule (the rule's ID by default).
	Ref param.Field[string] `json:"ref"`
}

func (RuleNewParamsBodyJavaScriptChallengeRule) MarshalJSON

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

type RuleNewParamsBodyJavaScriptChallengeRuleAction

type RuleNewParamsBodyJavaScriptChallengeRuleAction string

The action to perform when the rule matches.

const (
	RuleNewParamsBodyJavaScriptChallengeRuleActionJSChallenge RuleNewParamsBodyJavaScriptChallengeRuleAction = "js_challenge"
)

func (RuleNewParamsBodyJavaScriptChallengeRuleAction) IsKnown

type RuleNewParamsBodyJavaScriptChallengeRuleExposedCredentialCheck

type RuleNewParamsBodyJavaScriptChallengeRuleExposedCredentialCheck struct {
	// An expression that selects the password used in the credentials check.
	PasswordExpression param.Field[string] `json:"password_expression,required"`
	// An expression that selects the user ID used in the credentials check.
	UsernameExpression param.Field[string] `json:"username_expression,required"`
}

Configuration for exposed credential checking.

func (RuleNewParamsBodyJavaScriptChallengeRuleExposedCredentialCheck) MarshalJSON

type RuleNewParamsBodyJavaScriptChallengeRulePosition

type RuleNewParamsBodyJavaScriptChallengeRulePosition 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"`
	// 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 index at which to place the rule, where index 1 is the first rule.
	Index param.Field[int64] `json:"index"`
}

An object configuring where the rule will be placed.

func (RuleNewParamsBodyJavaScriptChallengeRulePosition) MarshalJSON

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

type RuleNewParamsBodyJavaScriptChallengeRulePositionAfterPosition

type RuleNewParamsBodyJavaScriptChallengeRulePositionAfterPosition 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 (RuleNewParamsBodyJavaScriptChallengeRulePositionAfterPosition) MarshalJSON

type RuleNewParamsBodyJavaScriptChallengeRulePositionBeforePosition

type RuleNewParamsBodyJavaScriptChallengeRulePositionBeforePosition 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 (RuleNewParamsBodyJavaScriptChallengeRulePositionBeforePosition) MarshalJSON

type RuleNewParamsBodyJavaScriptChallengeRulePositionIndexPosition

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

An object configuring where the rule will be placed.

func (RuleNewParamsBodyJavaScriptChallengeRulePositionIndexPosition) MarshalJSON

type RuleNewParamsBodyJavaScriptChallengeRuleRatelimit

type RuleNewParamsBodyJavaScriptChallengeRuleRatelimit struct {
	// Characteristics of the request on which the rate limit counter will be
	// incremented.
	Characteristics param.Field[[]string] `json:"characteristics,required"`
	// Period in seconds over which the counter is being incremented.
	Period param.Field[int64] `json:"period,required"`
	// An expression that defines when the rate limit counter should be incremented. It
	// defaults to the same as the rule's expression.
	CountingExpression param.Field[string] `json:"counting_expression"`
	// Period of time in seconds after which the action will be disabled following its
	// first execution.
	MitigationTimeout param.Field[int64] `json:"mitigation_timeout"`
	// The threshold of requests per period after which the action will be executed for
	// the first time.
	RequestsPerPeriod param.Field[int64] `json:"requests_per_period"`
	// Whether counting is only performed when an origin is reached.
	RequestsToOrigin param.Field[bool] `json:"requests_to_origin"`
	// The score threshold per period for which the action will be executed the first
	// time.
	ScorePerPeriod param.Field[int64] `json:"score_per_period"`
	// A response header name provided by the origin, which contains the score to
	// increment rate limit counter with.
	ScoreResponseHeaderName param.Field[string] `json:"score_response_header_name"`
}

An object configuring the rule's rate limit behavior.

func (RuleNewParamsBodyJavaScriptChallengeRuleRatelimit) MarshalJSON

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

type RuleNewParamsBodyLogCustomFieldRule

type RuleNewParamsBodyLogCustomFieldRule struct {
	// An object configuring where the rule will be placed.
	Position param.Field[RuleNewParamsBodyLogCustomFieldRulePositionUnion] `json:"position"`
	LogCustomFieldRuleParam
}

func (RuleNewParamsBodyLogCustomFieldRule) MarshalJSON

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

type RuleNewParamsBodyLogCustomFieldRulePosition

type RuleNewParamsBodyLogCustomFieldRulePosition 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"`
	// 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 index at which to place the rule, where index 1 is the first rule.
	Index param.Field[int64] `json:"index"`
}

An object configuring where the rule will be placed.

func (RuleNewParamsBodyLogCustomFieldRulePosition) MarshalJSON

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

type RuleNewParamsBodyLogCustomFieldRulePositionAfterPosition

type RuleNewParamsBodyLogCustomFieldRulePositionAfterPosition 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 (RuleNewParamsBodyLogCustomFieldRulePositionAfterPosition) MarshalJSON

type RuleNewParamsBodyLogCustomFieldRulePositionBeforePosition

type RuleNewParamsBodyLogCustomFieldRulePositionBeforePosition 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 (RuleNewParamsBodyLogCustomFieldRulePositionBeforePosition) MarshalJSON

type RuleNewParamsBodyLogCustomFieldRulePositionIndexPosition

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

An object configuring where the rule will be placed.

func (RuleNewParamsBodyLogCustomFieldRulePositionIndexPosition) MarshalJSON

type RuleNewParamsBodyLogCustomFieldRulePositionUnion

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

An object configuring where the rule will be placed.

Satisfied by rulesets.RuleNewParamsBodyLogCustomFieldRulePositionBeforePosition, rulesets.RuleNewParamsBodyLogCustomFieldRulePositionAfterPosition, rulesets.RuleNewParamsBodyLogCustomFieldRulePositionIndexPosition, RuleNewParamsBodyLogCustomFieldRulePosition.

type RuleNewParamsBodyLogRule

type RuleNewParamsBodyLogRule struct {
	// An object configuring where the rule will be placed.
	Position param.Field[RuleNewParamsBodyLogRulePositionUnion] `json:"position"`
	LogRuleParam
}

func (RuleNewParamsBodyLogRule) MarshalJSON

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

type RuleNewParamsBodyLogRulePosition

type RuleNewParamsBodyLogRulePosition 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"`
	// 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 index at which to place the rule, where index 1 is the first rule.
	Index param.Field[int64] `json:"index"`
}

An object configuring where the rule will be placed.

func (RuleNewParamsBodyLogRulePosition) MarshalJSON

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

type RuleNewParamsBodyLogRulePositionAfterPosition

type RuleNewParamsBodyLogRulePositionAfterPosition 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 (RuleNewParamsBodyLogRulePositionAfterPosition) MarshalJSON

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

type RuleNewParamsBodyLogRulePositionBeforePosition

type RuleNewParamsBodyLogRulePositionBeforePosition 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 (RuleNewParamsBodyLogRulePositionBeforePosition) MarshalJSON

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

type RuleNewParamsBodyLogRulePositionIndexPosition

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

An object configuring where the rule will be placed.

func (RuleNewParamsBodyLogRulePositionIndexPosition) MarshalJSON

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

type RuleNewParamsBodyLogRulePositionUnion

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

An object configuring where the rule will be placed.

Satisfied by rulesets.RuleNewParamsBodyLogRulePositionBeforePosition, rulesets.RuleNewParamsBodyLogRulePositionAfterPosition, rulesets.RuleNewParamsBodyLogRulePositionIndexPosition, RuleNewParamsBodyLogRulePosition.

type RuleNewParamsBodyManagedChallengeRule

type RuleNewParamsBodyManagedChallengeRule struct {
	// An object configuring where the rule will be placed.
	Position param.Field[RuleNewParamsBodyManagedChallengeRulePositionUnion] `json:"position"`
	ManagedChallengeRuleParam
}

func (RuleNewParamsBodyManagedChallengeRule) MarshalJSON

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

type RuleNewParamsBodyManagedChallengeRulePosition

type RuleNewParamsBodyManagedChallengeRulePosition 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"`
	// 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 index at which to place the rule, where index 1 is the first rule.
	Index param.Field[int64] `json:"index"`
}

An object configuring where the rule will be placed.

func (RuleNewParamsBodyManagedChallengeRulePosition) MarshalJSON

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

type RuleNewParamsBodyManagedChallengeRulePositionAfterPosition

type RuleNewParamsBodyManagedChallengeRulePositionAfterPosition 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 (RuleNewParamsBodyManagedChallengeRulePositionAfterPosition) MarshalJSON

type RuleNewParamsBodyManagedChallengeRulePositionBeforePosition

type RuleNewParamsBodyManagedChallengeRulePositionBeforePosition 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 (RuleNewParamsBodyManagedChallengeRulePositionBeforePosition) MarshalJSON

type RuleNewParamsBodyManagedChallengeRulePositionIndexPosition

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

An object configuring where the rule will be placed.

func (RuleNewParamsBodyManagedChallengeRulePositionIndexPosition) MarshalJSON

type RuleNewParamsBodyRedirectRule

type RuleNewParamsBodyRedirectRule struct {
	// An object configuring where the rule will be placed.
	Position param.Field[RuleNewParamsBodyRedirectRulePositionUnion] `json:"position"`
	RedirectRuleParam
}

func (RuleNewParamsBodyRedirectRule) MarshalJSON

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

type RuleNewParamsBodyRedirectRulePosition

type RuleNewParamsBodyRedirectRulePosition 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"`
	// 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 index at which to place the rule, where index 1 is the first rule.
	Index param.Field[int64] `json:"index"`
}

An object configuring where the rule will be placed.

func (RuleNewParamsBodyRedirectRulePosition) MarshalJSON

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

type RuleNewParamsBodyRedirectRulePositionAfterPosition

type RuleNewParamsBodyRedirectRulePositionAfterPosition 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 (RuleNewParamsBodyRedirectRulePositionAfterPosition) MarshalJSON

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

type RuleNewParamsBodyRedirectRulePositionBeforePosition

type RuleNewParamsBodyRedirectRulePositionBeforePosition 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 (RuleNewParamsBodyRedirectRulePositionBeforePosition) MarshalJSON

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

type RuleNewParamsBodyRedirectRulePositionIndexPosition

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

An object configuring where the rule will be placed.

func (RuleNewParamsBodyRedirectRulePositionIndexPosition) MarshalJSON

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

type RuleNewParamsBodyRedirectRulePositionUnion

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

An object configuring where the rule will be placed.

Satisfied by rulesets.RuleNewParamsBodyRedirectRulePositionBeforePosition, rulesets.RuleNewParamsBodyRedirectRulePositionAfterPosition, rulesets.RuleNewParamsBodyRedirectRulePositionIndexPosition, RuleNewParamsBodyRedirectRulePosition.

type RuleNewParamsBodyResponseCompressionRule

type RuleNewParamsBodyResponseCompressionRule struct {
	// An object configuring where the rule will be placed.
	Position param.Field[RuleNewParamsBodyResponseCompressionRulePositionUnion] `json:"position"`
	CompressResponseRuleParam
}

func (RuleNewParamsBodyResponseCompressionRule) MarshalJSON

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

type RuleNewParamsBodyResponseCompressionRulePosition

type RuleNewParamsBodyResponseCompressionRulePosition 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"`
	// 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 index at which to place the rule, where index 1 is the first rule.
	Index param.Field[int64] `json:"index"`
}

An object configuring where the rule will be placed.

func (RuleNewParamsBodyResponseCompressionRulePosition) MarshalJSON

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

type RuleNewParamsBodyResponseCompressionRulePositionAfterPosition

type RuleNewParamsBodyResponseCompressionRulePositionAfterPosition 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 (RuleNewParamsBodyResponseCompressionRulePositionAfterPosition) MarshalJSON

type RuleNewParamsBodyResponseCompressionRulePositionBeforePosition

type RuleNewParamsBodyResponseCompressionRulePositionBeforePosition 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 (RuleNewParamsBodyResponseCompressionRulePositionBeforePosition) MarshalJSON

type RuleNewParamsBodyResponseCompressionRulePositionIndexPosition

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

An object configuring where the rule will be placed.

func (RuleNewParamsBodyResponseCompressionRulePositionIndexPosition) MarshalJSON

type RuleNewParamsBodyRewriteRule

type RuleNewParamsBodyRewriteRule struct {
	// An object configuring where the rule will be placed.
	Position param.Field[RuleNewParamsBodyRewriteRulePositionUnion] `json:"position"`
	RewriteRuleParam
}

func (RuleNewParamsBodyRewriteRule) MarshalJSON

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

type RuleNewParamsBodyRewriteRulePosition

type RuleNewParamsBodyRewriteRulePosition 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"`
	// 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 index at which to place the rule, where index 1 is the first rule.
	Index param.Field[int64] `json:"index"`
}

An object configuring where the rule will be placed.

func (RuleNewParamsBodyRewriteRulePosition) MarshalJSON

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

type RuleNewParamsBodyRewriteRulePositionAfterPosition

type RuleNewParamsBodyRewriteRulePositionAfterPosition 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 (RuleNewParamsBodyRewriteRulePositionAfterPosition) MarshalJSON

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

type RuleNewParamsBodyRewriteRulePositionBeforePosition

type RuleNewParamsBodyRewriteRulePositionBeforePosition 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 (RuleNewParamsBodyRewriteRulePositionBeforePosition) MarshalJSON

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

type RuleNewParamsBodyRewriteRulePositionIndexPosition

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

An object configuring where the rule will be placed.

func (RuleNewParamsBodyRewriteRulePositionIndexPosition) MarshalJSON

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

type RuleNewParamsBodyRewriteRulePositionUnion

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

An object configuring where the rule will be placed.

Satisfied by rulesets.RuleNewParamsBodyRewriteRulePositionBeforePosition, rulesets.RuleNewParamsBodyRewriteRulePositionAfterPosition, rulesets.RuleNewParamsBodyRewriteRulePositionIndexPosition, RuleNewParamsBodyRewriteRulePosition.

type RuleNewParamsBodyRouteRule

type RuleNewParamsBodyRouteRule struct {
	// An object configuring where the rule will be placed.
	Position param.Field[RuleNewParamsBodyRouteRulePositionUnion] `json:"position"`
	RouteRuleParam
}

func (RuleNewParamsBodyRouteRule) MarshalJSON

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

type RuleNewParamsBodyRouteRulePosition

type RuleNewParamsBodyRouteRulePosition 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"`
	// 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 index at which to place the rule, where index 1 is the first rule.
	Index param.Field[int64] `json:"index"`
}

An object configuring where the rule will be placed.

func (RuleNewParamsBodyRouteRulePosition) MarshalJSON

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

type RuleNewParamsBodyRouteRulePositionAfterPosition

type RuleNewParamsBodyRouteRulePositionAfterPosition 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 (RuleNewParamsBodyRouteRulePositionAfterPosition) MarshalJSON

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

type RuleNewParamsBodyRouteRulePositionBeforePosition

type RuleNewParamsBodyRouteRulePositionBeforePosition 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 (RuleNewParamsBodyRouteRulePositionBeforePosition) MarshalJSON

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

type RuleNewParamsBodyRouteRulePositionIndexPosition

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

An object configuring where the rule will be placed.

func (RuleNewParamsBodyRouteRulePositionIndexPosition) MarshalJSON

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

type RuleNewParamsBodyRouteRulePositionUnion

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

An object configuring where the rule will be placed.

Satisfied by rulesets.RuleNewParamsBodyRouteRulePositionBeforePosition, rulesets.RuleNewParamsBodyRouteRulePositionAfterPosition, rulesets.RuleNewParamsBodyRouteRulePositionIndexPosition, RuleNewParamsBodyRouteRulePosition.

type RuleNewParamsBodyScoreRule

type RuleNewParamsBodyScoreRule struct {
	// An object configuring where the rule will be placed.
	Position param.Field[RuleNewParamsBodyScoreRulePositionUnion] `json:"position"`
	ScoreRuleParam
}

func (RuleNewParamsBodyScoreRule) MarshalJSON

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

type RuleNewParamsBodyScoreRulePosition

type RuleNewParamsBodyScoreRulePosition 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"`
	// 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 index at which to place the rule, where index 1 is the first rule.
	Index param.Field[int64] `json:"index"`
}

An object configuring where the rule will be placed.

func (RuleNewParamsBodyScoreRulePosition) MarshalJSON

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

type RuleNewParamsBodyScoreRulePositionAfterPosition

type RuleNewParamsBodyScoreRulePositionAfterPosition 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 (RuleNewParamsBodyScoreRulePositionAfterPosition) MarshalJSON

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

type RuleNewParamsBodyScoreRulePositionBeforePosition

type RuleNewParamsBodyScoreRulePositionBeforePosition 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 (RuleNewParamsBodyScoreRulePositionBeforePosition) MarshalJSON

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

type RuleNewParamsBodyScoreRulePositionIndexPosition

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

An object configuring where the rule will be placed.

func (RuleNewParamsBodyScoreRulePositionIndexPosition) MarshalJSON

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

type RuleNewParamsBodyScoreRulePositionUnion

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

An object configuring where the rule will be placed.

Satisfied by rulesets.RuleNewParamsBodyScoreRulePositionBeforePosition, rulesets.RuleNewParamsBodyScoreRulePositionAfterPosition, rulesets.RuleNewParamsBodyScoreRulePositionIndexPosition, RuleNewParamsBodyScoreRulePosition.

type RuleNewParamsBodyServeErrorRule

type RuleNewParamsBodyServeErrorRule struct {
	// An object configuring where the rule will be placed.
	Position param.Field[RuleNewParamsBodyServeErrorRulePositionUnion] `json:"position"`
	ServeErrorRuleParam
}

func (RuleNewParamsBodyServeErrorRule) MarshalJSON

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

type RuleNewParamsBodyServeErrorRulePosition

type RuleNewParamsBodyServeErrorRulePosition 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"`
	// 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 index at which to place the rule, where index 1 is the first rule.
	Index param.Field[int64] `json:"index"`
}

An object configuring where the rule will be placed.

func (RuleNewParamsBodyServeErrorRulePosition) MarshalJSON

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

type RuleNewParamsBodyServeErrorRulePositionAfterPosition

type RuleNewParamsBodyServeErrorRulePositionAfterPosition 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 (RuleNewParamsBodyServeErrorRulePositionAfterPosition) MarshalJSON

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

type RuleNewParamsBodyServeErrorRulePositionBeforePosition

type RuleNewParamsBodyServeErrorRulePositionBeforePosition 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 (RuleNewParamsBodyServeErrorRulePositionBeforePosition) MarshalJSON

type RuleNewParamsBodyServeErrorRulePositionIndexPosition

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

An object configuring where the rule will be placed.

func (RuleNewParamsBodyServeErrorRulePositionIndexPosition) MarshalJSON

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

type RuleNewParamsBodyServeErrorRulePositionUnion

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

An object configuring where the rule will be placed.

Satisfied by rulesets.RuleNewParamsBodyServeErrorRulePositionBeforePosition, rulesets.RuleNewParamsBodyServeErrorRulePositionAfterPosition, rulesets.RuleNewParamsBodyServeErrorRulePositionIndexPosition, RuleNewParamsBodyServeErrorRulePosition.

type RuleNewParamsBodySetCacheSettingsRule

type RuleNewParamsBodySetCacheSettingsRule struct {
	// An object configuring where the rule will be placed.
	Position param.Field[RuleNewParamsBodySetCacheSettingsRulePositionUnion] `json:"position"`
	SetCacheSettingsRuleParam
}

func (RuleNewParamsBodySetCacheSettingsRule) MarshalJSON

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

type RuleNewParamsBodySetCacheSettingsRulePosition

type RuleNewParamsBodySetCacheSettingsRulePosition 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"`
	// 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 index at which to place the rule, where index 1 is the first rule.
	Index param.Field[int64] `json:"index"`
}

An object configuring where the rule will be placed.

func (RuleNewParamsBodySetCacheSettingsRulePosition) MarshalJSON

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

type RuleNewParamsBodySetCacheSettingsRulePositionAfterPosition

type RuleNewParamsBodySetCacheSettingsRulePositionAfterPosition 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 (RuleNewParamsBodySetCacheSettingsRulePositionAfterPosition) MarshalJSON

type RuleNewParamsBodySetCacheSettingsRulePositionBeforePosition

type RuleNewParamsBodySetCacheSettingsRulePositionBeforePosition 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 (RuleNewParamsBodySetCacheSettingsRulePositionBeforePosition) MarshalJSON

type RuleNewParamsBodySetCacheSettingsRulePositionIndexPosition

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

An object configuring where the rule will be placed.

func (RuleNewParamsBodySetCacheSettingsRulePositionIndexPosition) MarshalJSON

type RuleNewParamsBodySetConfigurationRule

type RuleNewParamsBodySetConfigurationRule struct {
	// An object configuring where the rule will be placed.
	Position param.Field[RuleNewParamsBodySetConfigurationRulePositionUnion] `json:"position"`
	SetConfigRuleParam
}

func (RuleNewParamsBodySetConfigurationRule) MarshalJSON

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

type RuleNewParamsBodySetConfigurationRulePosition

type RuleNewParamsBodySetConfigurationRulePosition 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"`
	// 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 index at which to place the rule, where index 1 is the first rule.
	Index param.Field[int64] `json:"index"`
}

An object configuring where the rule will be placed.

func (RuleNewParamsBodySetConfigurationRulePosition) MarshalJSON

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

type RuleNewParamsBodySetConfigurationRulePositionAfterPosition

type RuleNewParamsBodySetConfigurationRulePositionAfterPosition 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 (RuleNewParamsBodySetConfigurationRulePositionAfterPosition) MarshalJSON

type RuleNewParamsBodySetConfigurationRulePositionBeforePosition

type RuleNewParamsBodySetConfigurationRulePositionBeforePosition 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 (RuleNewParamsBodySetConfigurationRulePositionBeforePosition) MarshalJSON

type RuleNewParamsBodySetConfigurationRulePositionIndexPosition

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

An object configuring where the rule will be placed.

func (RuleNewParamsBodySetConfigurationRulePositionIndexPosition) MarshalJSON

type RuleNewParamsBodySkipRule

type RuleNewParamsBodySkipRule struct {
	// An object configuring where the rule will be placed.
	Position param.Field[RuleNewParamsBodySkipRulePositionUnion] `json:"position"`
	SkipRuleParam
}

func (RuleNewParamsBodySkipRule) MarshalJSON

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

type RuleNewParamsBodySkipRulePosition

type RuleNewParamsBodySkipRulePosition 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"`
	// 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 index at which to place the rule, where index 1 is the first rule.
	Index param.Field[int64] `json:"index"`
}

An object configuring where the rule will be placed.

func (RuleNewParamsBodySkipRulePosition) MarshalJSON

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

type RuleNewParamsBodySkipRulePositionAfterPosition

type RuleNewParamsBodySkipRulePositionAfterPosition 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 (RuleNewParamsBodySkipRulePositionAfterPosition) MarshalJSON

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

type RuleNewParamsBodySkipRulePositionBeforePosition

type RuleNewParamsBodySkipRulePositionBeforePosition 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 (RuleNewParamsBodySkipRulePositionBeforePosition) MarshalJSON

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

type RuleNewParamsBodySkipRulePositionIndexPosition

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

An object configuring where the rule will be placed.

func (RuleNewParamsBodySkipRulePositionIndexPosition) MarshalJSON

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

type RuleNewParamsBodySkipRulePositionUnion

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

An object configuring where the rule will be placed.

Satisfied by rulesets.RuleNewParamsBodySkipRulePositionBeforePosition, rulesets.RuleNewParamsBodySkipRulePositionAfterPosition, rulesets.RuleNewParamsBodySkipRulePositionIndexPosition, RuleNewParamsBodySkipRulePosition.

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 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 RuleNewResponseRulesAction `json:"action"`
	// This field can have the runtime type of [BlockRuleActionParameters],
	// [interface{}], [CompressResponseRuleActionParameters],
	// [ExecuteRuleActionParameters], [LogCustomFieldRuleActionParameters],
	// [RedirectRuleActionParameters], [RewriteRuleActionParameters],
	// [RouteRuleActionParameters], [ScoreRuleActionParameters],
	// [ServeErrorRuleActionParameters], [SetCacheSettingsRuleActionParameters],
	// [SetConfigRuleActionParameters], [SkipRuleActionParameters].
	ActionParameters interface{} `json:"action_parameters"`
	// This field can have the runtime type of [[]string].
	Categories interface{} `json:"categories"`
	// An informative description of the rule.
	Description string `json:"description"`
	// Whether the rule should be executed.
	Enabled bool `json:"enabled"`
	// This field can have the runtime type of [BlockRuleExposedCredentialCheck],
	// [RuleNewResponseRulesRulesetsChallengeRuleExposedCredentialCheck],
	// [CompressResponseRuleExposedCredentialCheck],
	// [DDoSDynamicRuleExposedCredentialCheck], [ExecuteRuleExposedCredentialCheck],
	// [ForceConnectionCloseRuleExposedCredentialCheck],
	// [RuleNewResponseRulesRulesetsJSChallengeRuleExposedCredentialCheck],
	// [LogRuleExposedCredentialCheck], [LogCustomFieldRuleExposedCredentialCheck],
	// [ManagedChallengeRuleExposedCredentialCheck],
	// [RedirectRuleExposedCredentialCheck], [RewriteRuleExposedCredentialCheck],
	// [RouteRuleExposedCredentialCheck], [ScoreRuleExposedCredentialCheck],
	// [ServeErrorRuleExposedCredentialCheck],
	// [SetCacheSettingsRuleExposedCredentialCheck],
	// [SetConfigRuleExposedCredentialCheck], [SkipRuleExposedCredentialCheck].
	ExposedCredentialCheck interface{} `json:"exposed_credential_check"`
	// 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"`
	// This field can have the runtime type of [BlockRuleRatelimit],
	// [RuleNewResponseRulesRulesetsChallengeRuleRatelimit],
	// [CompressResponseRuleRatelimit], [DDoSDynamicRuleRatelimit],
	// [ExecuteRuleRatelimit], [ForceConnectionCloseRuleRatelimit],
	// [RuleNewResponseRulesRulesetsJSChallengeRuleRatelimit], [LogRuleRatelimit],
	// [LogCustomFieldRuleRatelimit], [ManagedChallengeRuleRatelimit],
	// [RedirectRuleRatelimit], [RewriteRuleRatelimit], [RouteRuleRatelimit],
	// [ScoreRuleRatelimit], [ServeErrorRuleRatelimit],
	// [SetCacheSettingsRuleRatelimit], [SetConfigRuleRatelimit], [SkipRuleRatelimit].
	Ratelimit interface{} `json:"ratelimit"`
	// The reference of the rule (the rule's ID by default).
	Ref  string                  `json:"ref"`
	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"
	RuleNewResponseRulesActionDDoSDynamic          RuleNewResponseRulesAction = "ddos_dynamic"
	RuleNewResponseRulesActionExecute              RuleNewResponseRulesAction = "execute"
	RuleNewResponseRulesActionForceConnectionClose RuleNewResponseRulesAction = "force_connection_close"
	RuleNewResponseRulesActionJSChallenge          RuleNewResponseRulesAction = "js_challenge"
	RuleNewResponseRulesActionLog                  RuleNewResponseRulesAction = "log"
	RuleNewResponseRulesActionLogCustomField       RuleNewResponseRulesAction = "log_custom_field"
	RuleNewResponseRulesActionManagedChallenge     RuleNewResponseRulesAction = "managed_challenge"
	RuleNewResponseRulesActionRedirect             RuleNewResponseRulesAction = "redirect"
	RuleNewResponseRulesActionRewrite              RuleNewResponseRulesAction = "rewrite"
	RuleNewResponseRulesActionRoute                RuleNewResponseRulesAction = "route"
	RuleNewResponseRulesActionScore                RuleNewResponseRulesAction = "score"
	RuleNewResponseRulesActionServeError           RuleNewResponseRulesAction = "serve_error"
	RuleNewResponseRulesActionSetCacheSettings     RuleNewResponseRulesAction = "set_cache_settings"
	RuleNewResponseRulesActionSetConfig            RuleNewResponseRulesAction = "set_config"
	RuleNewResponseRulesActionSkip                 RuleNewResponseRulesAction = "skip"
)

func (RuleNewResponseRulesAction) IsKnown

func (r RuleNewResponseRulesAction) IsKnown() bool

type RuleNewResponseRulesRulesetsChallengeRule

type RuleNewResponseRulesRulesetsChallengeRule 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 RuleNewResponseRulesRulesetsChallengeRuleAction `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"`
	// Configuration for exposed credential checking.
	ExposedCredentialCheck RuleNewResponseRulesRulesetsChallengeRuleExposedCredentialCheck `json:"exposed_credential_check"`
	// 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"`
	// An object configuring the rule's rate limit behavior.
	Ratelimit RuleNewResponseRulesRulesetsChallengeRuleRatelimit `json:"ratelimit"`
	// The reference of the rule (the rule's ID by default).
	Ref  string                                        `json:"ref"`
	JSON ruleNewResponseRulesRulesetsChallengeRuleJSON `json:"-"`
}

func (*RuleNewResponseRulesRulesetsChallengeRule) UnmarshalJSON

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

type RuleNewResponseRulesRulesetsChallengeRuleAction

type RuleNewResponseRulesRulesetsChallengeRuleAction string

The action to perform when the rule matches.

const (
	RuleNewResponseRulesRulesetsChallengeRuleActionChallenge RuleNewResponseRulesRulesetsChallengeRuleAction = "challenge"
)

func (RuleNewResponseRulesRulesetsChallengeRuleAction) IsKnown

type RuleNewResponseRulesRulesetsChallengeRuleExposedCredentialCheck

type RuleNewResponseRulesRulesetsChallengeRuleExposedCredentialCheck struct {
	// An expression that selects the password used in the credentials check.
	PasswordExpression string `json:"password_expression,required"`
	// An expression that selects the user ID used in the credentials check.
	UsernameExpression string                                                              `json:"username_expression,required"`
	JSON               ruleNewResponseRulesRulesetsChallengeRuleExposedCredentialCheckJSON `json:"-"`
}

Configuration for exposed credential checking.

func (*RuleNewResponseRulesRulesetsChallengeRuleExposedCredentialCheck) UnmarshalJSON

type RuleNewResponseRulesRulesetsChallengeRuleRatelimit

type RuleNewResponseRulesRulesetsChallengeRuleRatelimit struct {
	// Characteristics of the request on which the rate limit counter will be
	// incremented.
	Characteristics []string `json:"characteristics,required"`
	// Period in seconds over which the counter is being incremented.
	Period int64 `json:"period,required"`
	// An expression that defines when the rate limit counter should be incremented. It
	// defaults to the same as the rule's expression.
	CountingExpression string `json:"counting_expression"`
	// Period of time in seconds after which the action will be disabled following its
	// first execution.
	MitigationTimeout int64 `json:"mitigation_timeout"`
	// The threshold of requests per period after which the action will be executed for
	// the first time.
	RequestsPerPeriod int64 `json:"requests_per_period"`
	// Whether counting is only performed when an origin is reached.
	RequestsToOrigin bool `json:"requests_to_origin"`
	// The score threshold per period for which the action will be executed the first
	// time.
	ScorePerPeriod int64 `json:"score_per_period"`
	// A response header name provided by the origin, which contains the score to
	// increment rate limit counter with.
	ScoreResponseHeaderName string                                                 `json:"score_response_header_name"`
	JSON                    ruleNewResponseRulesRulesetsChallengeRuleRatelimitJSON `json:"-"`
}

An object configuring the rule's rate limit behavior.

func (*RuleNewResponseRulesRulesetsChallengeRuleRatelimit) UnmarshalJSON

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

type RuleNewResponseRulesRulesetsJSChallengeRule

type RuleNewResponseRulesRulesetsJSChallengeRule 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 RuleNewResponseRulesRulesetsJSChallengeRuleAction `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"`
	// Configuration for exposed credential checking.
	ExposedCredentialCheck RuleNewResponseRulesRulesetsJSChallengeRuleExposedCredentialCheck `json:"exposed_credential_check"`
	// 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"`
	// An object configuring the rule's rate limit behavior.
	Ratelimit RuleNewResponseRulesRulesetsJSChallengeRuleRatelimit `json:"ratelimit"`
	// The reference of the rule (the rule's ID by default).
	Ref  string                                          `json:"ref"`
	JSON ruleNewResponseRulesRulesetsJSChallengeRuleJSON `json:"-"`
}

func (*RuleNewResponseRulesRulesetsJSChallengeRule) UnmarshalJSON

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

type RuleNewResponseRulesRulesetsJSChallengeRuleAction

type RuleNewResponseRulesRulesetsJSChallengeRuleAction string

The action to perform when the rule matches.

const (
	RuleNewResponseRulesRulesetsJSChallengeRuleActionJSChallenge RuleNewResponseRulesRulesetsJSChallengeRuleAction = "js_challenge"
)

func (RuleNewResponseRulesRulesetsJSChallengeRuleAction) IsKnown

type RuleNewResponseRulesRulesetsJSChallengeRuleExposedCredentialCheck

type RuleNewResponseRulesRulesetsJSChallengeRuleExposedCredentialCheck struct {
	// An expression that selects the password used in the credentials check.
	PasswordExpression string `json:"password_expression,required"`
	// An expression that selects the user ID used in the credentials check.
	UsernameExpression string                                                                `json:"username_expression,required"`
	JSON               ruleNewResponseRulesRulesetsJSChallengeRuleExposedCredentialCheckJSON `json:"-"`
}

Configuration for exposed credential checking.

func (*RuleNewResponseRulesRulesetsJSChallengeRuleExposedCredentialCheck) UnmarshalJSON

type RuleNewResponseRulesRulesetsJSChallengeRuleRatelimit

type RuleNewResponseRulesRulesetsJSChallengeRuleRatelimit struct {
	// Characteristics of the request on which the rate limit counter will be
	// incremented.
	Characteristics []string `json:"characteristics,required"`
	// Period in seconds over which the counter is being incremented.
	Period int64 `json:"period,required"`
	// An expression that defines when the rate limit counter should be incremented. It
	// defaults to the same as the rule's expression.
	CountingExpression string `json:"counting_expression"`
	// Period of time in seconds after which the action will be disabled following its
	// first execution.
	MitigationTimeout int64 `json:"mitigation_timeout"`
	// The threshold of requests per period after which the action will be executed for
	// the first time.
	RequestsPerPeriod int64 `json:"requests_per_period"`
	// Whether counting is only performed when an origin is reached.
	RequestsToOrigin bool `json:"requests_to_origin"`
	// The score threshold per period for which the action will be executed the first
	// time.
	ScorePerPeriod int64 `json:"score_per_period"`
	// A response header name provided by the origin, which contains the score to
	// increment rate limit counter with.
	ScoreResponseHeaderName string                                                   `json:"score_response_header_name"`
	JSON                    ruleNewResponseRulesRulesetsJSChallengeRuleRatelimitJSON `json:"-"`
}

An object configuring the rule's rate limit behavior.

func (*RuleNewResponseRulesRulesetsJSChallengeRuleRatelimit) UnmarshalJSON

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

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 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 RulesetGetResponseRulesAction `json:"action"`
	// This field can have the runtime type of [BlockRuleActionParameters],
	// [interface{}], [CompressResponseRuleActionParameters],
	// [ExecuteRuleActionParameters], [LogCustomFieldRuleActionParameters],
	// [RedirectRuleActionParameters], [RewriteRuleActionParameters],
	// [RouteRuleActionParameters], [ScoreRuleActionParameters],
	// [ServeErrorRuleActionParameters], [SetCacheSettingsRuleActionParameters],
	// [SetConfigRuleActionParameters], [SkipRuleActionParameters].
	ActionParameters interface{} `json:"action_parameters"`
	// This field can have the runtime type of [[]string].
	Categories interface{} `json:"categories"`
	// An informative description of the rule.
	Description string `json:"description"`
	// Whether the rule should be executed.
	Enabled bool `json:"enabled"`
	// This field can have the runtime type of [BlockRuleExposedCredentialCheck],
	// [RulesetGetResponseRulesRulesetsChallengeRuleExposedCredentialCheck],
	// [CompressResponseRuleExposedCredentialCheck],
	// [DDoSDynamicRuleExposedCredentialCheck], [ExecuteRuleExposedCredentialCheck],
	// [ForceConnectionCloseRuleExposedCredentialCheck],
	// [RulesetGetResponseRulesRulesetsJSChallengeRuleExposedCredentialCheck],
	// [LogRuleExposedCredentialCheck], [LogCustomFieldRuleExposedCredentialCheck],
	// [ManagedChallengeRuleExposedCredentialCheck],
	// [RedirectRuleExposedCredentialCheck], [RewriteRuleExposedCredentialCheck],
	// [RouteRuleExposedCredentialCheck], [ScoreRuleExposedCredentialCheck],
	// [ServeErrorRuleExposedCredentialCheck],
	// [SetCacheSettingsRuleExposedCredentialCheck],
	// [SetConfigRuleExposedCredentialCheck], [SkipRuleExposedCredentialCheck].
	ExposedCredentialCheck interface{} `json:"exposed_credential_check"`
	// 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"`
	// This field can have the runtime type of [BlockRuleRatelimit],
	// [RulesetGetResponseRulesRulesetsChallengeRuleRatelimit],
	// [CompressResponseRuleRatelimit], [DDoSDynamicRuleRatelimit],
	// [ExecuteRuleRatelimit], [ForceConnectionCloseRuleRatelimit],
	// [RulesetGetResponseRulesRulesetsJSChallengeRuleRatelimit], [LogRuleRatelimit],
	// [LogCustomFieldRuleRatelimit], [ManagedChallengeRuleRatelimit],
	// [RedirectRuleRatelimit], [RewriteRuleRatelimit], [RouteRuleRatelimit],
	// [ScoreRuleRatelimit], [ServeErrorRuleRatelimit],
	// [SetCacheSettingsRuleRatelimit], [SetConfigRuleRatelimit], [SkipRuleRatelimit].
	Ratelimit interface{} `json:"ratelimit"`
	// The reference of the rule (the rule's ID by default).
	Ref  string                     `json:"ref"`
	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"
	RulesetGetResponseRulesActionDDoSDynamic          RulesetGetResponseRulesAction = "ddos_dynamic"
	RulesetGetResponseRulesActionExecute              RulesetGetResponseRulesAction = "execute"
	RulesetGetResponseRulesActionForceConnectionClose RulesetGetResponseRulesAction = "force_connection_close"
	RulesetGetResponseRulesActionJSChallenge          RulesetGetResponseRulesAction = "js_challenge"
	RulesetGetResponseRulesActionLog                  RulesetGetResponseRulesAction = "log"
	RulesetGetResponseRulesActionLogCustomField       RulesetGetResponseRulesAction = "log_custom_field"
	RulesetGetResponseRulesActionManagedChallenge     RulesetGetResponseRulesAction = "managed_challenge"
	RulesetGetResponseRulesActionRedirect             RulesetGetResponseRulesAction = "redirect"
	RulesetGetResponseRulesActionRewrite              RulesetGetResponseRulesAction = "rewrite"
	RulesetGetResponseRulesActionRoute                RulesetGetResponseRulesAction = "route"
	RulesetGetResponseRulesActionScore                RulesetGetResponseRulesAction = "score"
	RulesetGetResponseRulesActionServeError           RulesetGetResponseRulesAction = "serve_error"
	RulesetGetResponseRulesActionSetCacheSettings     RulesetGetResponseRulesAction = "set_cache_settings"
	RulesetGetResponseRulesActionSetConfig            RulesetGetResponseRulesAction = "set_config"
	RulesetGetResponseRulesActionSkip                 RulesetGetResponseRulesAction = "skip"
)

func (RulesetGetResponseRulesAction) IsKnown

func (r RulesetGetResponseRulesAction) IsKnown() bool

type RulesetGetResponseRulesRulesetsChallengeRule

type RulesetGetResponseRulesRulesetsChallengeRule 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 RulesetGetResponseRulesRulesetsChallengeRuleAction `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"`
	// Configuration for exposed credential checking.
	ExposedCredentialCheck RulesetGetResponseRulesRulesetsChallengeRuleExposedCredentialCheck `json:"exposed_credential_check"`
	// 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"`
	// An object configuring the rule's rate limit behavior.
	Ratelimit RulesetGetResponseRulesRulesetsChallengeRuleRatelimit `json:"ratelimit"`
	// The reference of the rule (the rule's ID by default).
	Ref  string                                           `json:"ref"`
	JSON rulesetGetResponseRulesRulesetsChallengeRuleJSON `json:"-"`
}

func (*RulesetGetResponseRulesRulesetsChallengeRule) UnmarshalJSON

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

type RulesetGetResponseRulesRulesetsChallengeRuleAction

type RulesetGetResponseRulesRulesetsChallengeRuleAction string

The action to perform when the rule matches.

const (
	RulesetGetResponseRulesRulesetsChallengeRuleActionChallenge RulesetGetResponseRulesRulesetsChallengeRuleAction = "challenge"
)

func (RulesetGetResponseRulesRulesetsChallengeRuleAction) IsKnown

type RulesetGetResponseRulesRulesetsChallengeRuleExposedCredentialCheck

type RulesetGetResponseRulesRulesetsChallengeRuleExposedCredentialCheck struct {
	// An expression that selects the password used in the credentials check.
	PasswordExpression string `json:"password_expression,required"`
	// An expression that selects the user ID used in the credentials check.
	UsernameExpression string                                                                 `json:"username_expression,required"`
	JSON               rulesetGetResponseRulesRulesetsChallengeRuleExposedCredentialCheckJSON `json:"-"`
}

Configuration for exposed credential checking.

func (*RulesetGetResponseRulesRulesetsChallengeRuleExposedCredentialCheck) UnmarshalJSON

type RulesetGetResponseRulesRulesetsChallengeRuleRatelimit

type RulesetGetResponseRulesRulesetsChallengeRuleRatelimit struct {
	// Characteristics of the request on which the rate limit counter will be
	// incremented.
	Characteristics []string `json:"characteristics,required"`
	// Period in seconds over which the counter is being incremented.
	Period int64 `json:"period,required"`
	// An expression that defines when the rate limit counter should be incremented. It
	// defaults to the same as the rule's expression.
	CountingExpression string `json:"counting_expression"`
	// Period of time in seconds after which the action will be disabled following its
	// first execution.
	MitigationTimeout int64 `json:"mitigation_timeout"`
	// The threshold of requests per period after which the action will be executed for
	// the first time.
	RequestsPerPeriod int64 `json:"requests_per_period"`
	// Whether counting is only performed when an origin is reached.
	RequestsToOrigin bool `json:"requests_to_origin"`
	// The score threshold per period for which the action will be executed the first
	// time.
	ScorePerPeriod int64 `json:"score_per_period"`
	// A response header name provided by the origin, which contains the score to
	// increment rate limit counter with.
	ScoreResponseHeaderName string                                                    `json:"score_response_header_name"`
	JSON                    rulesetGetResponseRulesRulesetsChallengeRuleRatelimitJSON `json:"-"`
}

An object configuring the rule's rate limit behavior.

func (*RulesetGetResponseRulesRulesetsChallengeRuleRatelimit) UnmarshalJSON

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

type RulesetGetResponseRulesRulesetsJSChallengeRule

type RulesetGetResponseRulesRulesetsJSChallengeRule 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 RulesetGetResponseRulesRulesetsJSChallengeRuleAction `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"`
	// Configuration for exposed credential checking.
	ExposedCredentialCheck RulesetGetResponseRulesRulesetsJSChallengeRuleExposedCredentialCheck `json:"exposed_credential_check"`
	// 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"`
	// An object configuring the rule's rate limit behavior.
	Ratelimit RulesetGetResponseRulesRulesetsJSChallengeRuleRatelimit `json:"ratelimit"`
	// The reference of the rule (the rule's ID by default).
	Ref  string                                             `json:"ref"`
	JSON rulesetGetResponseRulesRulesetsJSChallengeRuleJSON `json:"-"`
}

func (*RulesetGetResponseRulesRulesetsJSChallengeRule) UnmarshalJSON

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

type RulesetGetResponseRulesRulesetsJSChallengeRuleAction

type RulesetGetResponseRulesRulesetsJSChallengeRuleAction string

The action to perform when the rule matches.

const (
	RulesetGetResponseRulesRulesetsJSChallengeRuleActionJSChallenge RulesetGetResponseRulesRulesetsJSChallengeRuleAction = "js_challenge"
)

func (RulesetGetResponseRulesRulesetsJSChallengeRuleAction) IsKnown

type RulesetGetResponseRulesRulesetsJSChallengeRuleExposedCredentialCheck

type RulesetGetResponseRulesRulesetsJSChallengeRuleExposedCredentialCheck struct {
	// An expression that selects the password used in the credentials check.
	PasswordExpression string `json:"password_expression,required"`
	// An expression that selects the user ID used in the credentials check.
	UsernameExpression string                                                                   `json:"username_expression,required"`
	JSON               rulesetGetResponseRulesRulesetsJSChallengeRuleExposedCredentialCheckJSON `json:"-"`
}

Configuration for exposed credential checking.

func (*RulesetGetResponseRulesRulesetsJSChallengeRuleExposedCredentialCheck) UnmarshalJSON

type RulesetGetResponseRulesRulesetsJSChallengeRuleRatelimit

type RulesetGetResponseRulesRulesetsJSChallengeRuleRatelimit struct {
	// Characteristics of the request on which the rate limit counter will be
	// incremented.
	Characteristics []string `json:"characteristics,required"`
	// Period in seconds over which the counter is being incremented.
	Period int64 `json:"period,required"`
	// An expression that defines when the rate limit counter should be incremented. It
	// defaults to the same as the rule's expression.
	CountingExpression string `json:"counting_expression"`
	// Period of time in seconds after which the action will be disabled following its
	// first execution.
	MitigationTimeout int64 `json:"mitigation_timeout"`
	// The threshold of requests per period after which the action will be executed for
	// the first time.
	RequestsPerPeriod int64 `json:"requests_per_period"`
	// Whether counting is only performed when an origin is reached.
	RequestsToOrigin bool `json:"requests_to_origin"`
	// The score threshold per period for which the action will be executed the first
	// time.
	ScorePerPeriod int64 `json:"score_per_period"`
	// A response header name provided by the origin, which contains the score to
	// increment rate limit counter with.
	ScoreResponseHeaderName string                                                      `json:"score_response_header_name"`
	JSON                    rulesetGetResponseRulesRulesetsJSChallengeRuleRatelimitJSON `json:"-"`
}

An object configuring the rule's rate limit behavior.

func (*RulesetGetResponseRulesRulesetsJSChallengeRuleRatelimit) UnmarshalJSON

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"`
	// The cursor to use for the next page.
	Cursor param.Field[string] `query:"cursor"`
	// The number of rulesets to return per page.
	PerPage param.Field[int64] `query:"per_page"`
}

func (RulesetListParams) URLQuery

func (r RulesetListParams) URLQuery() (v url.Values)

URLQuery serializes RulesetListParams's query parameters as `url.Values`.

type RulesetListResponse

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

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 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 list of rules in the ruleset.
	Rules param.Field[[]RulesetNewParamsRuleUnion] `json:"rules"`
}

func (RulesetNewParams) MarshalJSON

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

type RulesetNewParamsRule

type RulesetNewParamsRule struct {
	// The unique ID of the rule.
	ID param.Field[string] `json:"id"`
	// The action to perform when the rule matches.
	Action           param.Field[RulesetNewParamsRulesAction] `json:"action"`
	ActionParameters param.Field[interface{}]                 `json:"action_parameters"`
	Categories       param.Field[interface{}]                 `json:"categories"`
	// An informative description of the rule.
	Description param.Field[string] `json:"description"`
	// Whether the rule should be executed.
	Enabled                param.Field[bool]        `json:"enabled"`
	ExposedCredentialCheck param.Field[interface{}] `json:"exposed_credential_check"`
	// 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"`
	Ratelimit param.Field[interface{}]  `json:"ratelimit"`
	// The reference of the rule (the rule's 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"
	RulesetNewParamsRulesActionDDoSDynamic          RulesetNewParamsRulesAction = "ddos_dynamic"
	RulesetNewParamsRulesActionExecute              RulesetNewParamsRulesAction = "execute"
	RulesetNewParamsRulesActionForceConnectionClose RulesetNewParamsRulesAction = "force_connection_close"
	RulesetNewParamsRulesActionJSChallenge          RulesetNewParamsRulesAction = "js_challenge"
	RulesetNewParamsRulesActionLog                  RulesetNewParamsRulesAction = "log"
	RulesetNewParamsRulesActionLogCustomField       RulesetNewParamsRulesAction = "log_custom_field"
	RulesetNewParamsRulesActionManagedChallenge     RulesetNewParamsRulesAction = "managed_challenge"
	RulesetNewParamsRulesActionRedirect             RulesetNewParamsRulesAction = "redirect"
	RulesetNewParamsRulesActionRewrite              RulesetNewParamsRulesAction = "rewrite"
	RulesetNewParamsRulesActionRoute                RulesetNewParamsRulesAction = "route"
	RulesetNewParamsRulesActionScore                RulesetNewParamsRulesAction = "score"
	RulesetNewParamsRulesActionServeError           RulesetNewParamsRulesAction = "serve_error"
	RulesetNewParamsRulesActionSetCacheSettings     RulesetNewParamsRulesAction = "set_cache_settings"
	RulesetNewParamsRulesActionSetConfig            RulesetNewParamsRulesAction = "set_config"
	RulesetNewParamsRulesActionSkip                 RulesetNewParamsRulesAction = "skip"
)

func (RulesetNewParamsRulesAction) IsKnown

func (r RulesetNewParamsRulesAction) IsKnown() bool

type RulesetNewParamsRulesRulesetsChallengeRule

type RulesetNewParamsRulesRulesetsChallengeRule struct {
	// The unique ID of the rule.
	ID param.Field[string] `json:"id"`
	// The action to perform when the rule matches.
	Action param.Field[RulesetNewParamsRulesRulesetsChallengeRuleAction] `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"`
	// Configuration for exposed credential checking.
	ExposedCredentialCheck param.Field[RulesetNewParamsRulesRulesetsChallengeRuleExposedCredentialCheck] `json:"exposed_credential_check"`
	// 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"`
	// An object configuring the rule's rate limit behavior.
	Ratelimit param.Field[RulesetNewParamsRulesRulesetsChallengeRuleRatelimit] `json:"ratelimit"`
	// The reference of the rule (the rule's ID by default).
	Ref param.Field[string] `json:"ref"`
}

func (RulesetNewParamsRulesRulesetsChallengeRule) MarshalJSON

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

type RulesetNewParamsRulesRulesetsChallengeRuleAction

type RulesetNewParamsRulesRulesetsChallengeRuleAction string

The action to perform when the rule matches.

const (
	RulesetNewParamsRulesRulesetsChallengeRuleActionChallenge RulesetNewParamsRulesRulesetsChallengeRuleAction = "challenge"
)

func (RulesetNewParamsRulesRulesetsChallengeRuleAction) IsKnown

type RulesetNewParamsRulesRulesetsChallengeRuleExposedCredentialCheck

type RulesetNewParamsRulesRulesetsChallengeRuleExposedCredentialCheck struct {
	// An expression that selects the password used in the credentials check.
	PasswordExpression param.Field[string] `json:"password_expression,required"`
	// An expression that selects the user ID used in the credentials check.
	UsernameExpression param.Field[string] `json:"username_expression,required"`
}

Configuration for exposed credential checking.

func (RulesetNewParamsRulesRulesetsChallengeRuleExposedCredentialCheck) MarshalJSON

type RulesetNewParamsRulesRulesetsChallengeRuleRatelimit

type RulesetNewParamsRulesRulesetsChallengeRuleRatelimit struct {
	// Characteristics of the request on which the rate limit counter will be
	// incremented.
	Characteristics param.Field[[]string] `json:"characteristics,required"`
	// Period in seconds over which the counter is being incremented.
	Period param.Field[int64] `json:"period,required"`
	// An expression that defines when the rate limit counter should be incremented. It
	// defaults to the same as the rule's expression.
	CountingExpression param.Field[string] `json:"counting_expression"`
	// Period of time in seconds after which the action will be disabled following its
	// first execution.
	MitigationTimeout param.Field[int64] `json:"mitigation_timeout"`
	// The threshold of requests per period after which the action will be executed for
	// the first time.
	RequestsPerPeriod param.Field[int64] `json:"requests_per_period"`
	// Whether counting is only performed when an origin is reached.
	RequestsToOrigin param.Field[bool] `json:"requests_to_origin"`
	// The score threshold per period for which the action will be executed the first
	// time.
	ScorePerPeriod param.Field[int64] `json:"score_per_period"`
	// A response header name provided by the origin, which contains the score to
	// increment rate limit counter with.
	ScoreResponseHeaderName param.Field[string] `json:"score_response_header_name"`
}

An object configuring the rule's rate limit behavior.

func (RulesetNewParamsRulesRulesetsChallengeRuleRatelimit) MarshalJSON

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

type RulesetNewParamsRulesRulesetsJSChallengeRule

type RulesetNewParamsRulesRulesetsJSChallengeRule struct {
	// The unique ID of the rule.
	ID param.Field[string] `json:"id"`
	// The action to perform when the rule matches.
	Action param.Field[RulesetNewParamsRulesRulesetsJSChallengeRuleAction] `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"`
	// Configuration for exposed credential checking.
	ExposedCredentialCheck param.Field[RulesetNewParamsRulesRulesetsJSChallengeRuleExposedCredentialCheck] `json:"exposed_credential_check"`
	// 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"`
	// An object configuring the rule's rate limit behavior.
	Ratelimit param.Field[RulesetNewParamsRulesRulesetsJSChallengeRuleRatelimit] `json:"ratelimit"`
	// The reference of the rule (the rule's ID by default).
	Ref param.Field[string] `json:"ref"`
}

func (RulesetNewParamsRulesRulesetsJSChallengeRule) MarshalJSON

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

type RulesetNewParamsRulesRulesetsJSChallengeRuleAction

type RulesetNewParamsRulesRulesetsJSChallengeRuleAction string

The action to perform when the rule matches.

const (
	RulesetNewParamsRulesRulesetsJSChallengeRuleActionJSChallenge RulesetNewParamsRulesRulesetsJSChallengeRuleAction = "js_challenge"
)

func (RulesetNewParamsRulesRulesetsJSChallengeRuleAction) IsKnown

type RulesetNewParamsRulesRulesetsJSChallengeRuleExposedCredentialCheck

type RulesetNewParamsRulesRulesetsJSChallengeRuleExposedCredentialCheck struct {
	// An expression that selects the password used in the credentials check.
	PasswordExpression param.Field[string] `json:"password_expression,required"`
	// An expression that selects the user ID used in the credentials check.
	UsernameExpression param.Field[string] `json:"username_expression,required"`
}

Configuration for exposed credential checking.

func (RulesetNewParamsRulesRulesetsJSChallengeRuleExposedCredentialCheck) MarshalJSON

type RulesetNewParamsRulesRulesetsJSChallengeRuleRatelimit

type RulesetNewParamsRulesRulesetsJSChallengeRuleRatelimit struct {
	// Characteristics of the request on which the rate limit counter will be
	// incremented.
	Characteristics param.Field[[]string] `json:"characteristics,required"`
	// Period in seconds over which the counter is being incremented.
	Period param.Field[int64] `json:"period,required"`
	// An expression that defines when the rate limit counter should be incremented. It
	// defaults to the same as the rule's expression.
	CountingExpression param.Field[string] `json:"counting_expression"`
	// Period of time in seconds after which the action will be disabled following its
	// first execution.
	MitigationTimeout param.Field[int64] `json:"mitigation_timeout"`
	// The threshold of requests per period after which the action will be executed for
	// the first time.
	RequestsPerPeriod param.Field[int64] `json:"requests_per_period"`
	// Whether counting is only performed when an origin is reached.
	RequestsToOrigin param.Field[bool] `json:"requests_to_origin"`
	// The score threshold per period for which the action will be executed the first
	// time.
	ScorePerPeriod param.Field[int64] `json:"score_per_period"`
	// A response header name provided by the origin, which contains the score to
	// increment rate limit counter with.
	ScoreResponseHeaderName param.Field[string] `json:"score_response_header_name"`
}

An object configuring the rule's rate limit behavior.

func (RulesetNewParamsRulesRulesetsJSChallengeRuleRatelimit) MarshalJSON

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 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 RulesetNewResponseRulesAction `json:"action"`
	// This field can have the runtime type of [BlockRuleActionParameters],
	// [interface{}], [CompressResponseRuleActionParameters],
	// [ExecuteRuleActionParameters], [LogCustomFieldRuleActionParameters],
	// [RedirectRuleActionParameters], [RewriteRuleActionParameters],
	// [RouteRuleActionParameters], [ScoreRuleActionParameters],
	// [ServeErrorRuleActionParameters], [SetCacheSettingsRuleActionParameters],
	// [SetConfigRuleActionParameters], [SkipRuleActionParameters].
	ActionParameters interface{} `json:"action_parameters"`
	// This field can have the runtime type of [[]string].
	Categories interface{} `json:"categories"`
	// An informative description of the rule.
	Description string `json:"description"`
	// Whether the rule should be executed.
	Enabled bool `json:"enabled"`
	// This field can have the runtime type of [BlockRuleExposedCredentialCheck],
	// [RulesetNewResponseRulesRulesetsChallengeRuleExposedCredentialCheck],
	// [CompressResponseRuleExposedCredentialCheck],
	// [DDoSDynamicRuleExposedCredentialCheck], [ExecuteRuleExposedCredentialCheck],
	// [ForceConnectionCloseRuleExposedCredentialCheck],
	// [RulesetNewResponseRulesRulesetsJSChallengeRuleExposedCredentialCheck],
	// [LogRuleExposedCredentialCheck], [LogCustomFieldRuleExposedCredentialCheck],
	// [ManagedChallengeRuleExposedCredentialCheck],
	// [RedirectRuleExposedCredentialCheck], [RewriteRuleExposedCredentialCheck],
	// [RouteRuleExposedCredentialCheck], [ScoreRuleExposedCredentialCheck],
	// [ServeErrorRuleExposedCredentialCheck],
	// [SetCacheSettingsRuleExposedCredentialCheck],
	// [SetConfigRuleExposedCredentialCheck], [SkipRuleExposedCredentialCheck].
	ExposedCredentialCheck interface{} `json:"exposed_credential_check"`
	// 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"`
	// This field can have the runtime type of [BlockRuleRatelimit],
	// [RulesetNewResponseRulesRulesetsChallengeRuleRatelimit],
	// [CompressResponseRuleRatelimit], [DDoSDynamicRuleRatelimit],
	// [ExecuteRuleRatelimit], [ForceConnectionCloseRuleRatelimit],
	// [RulesetNewResponseRulesRulesetsJSChallengeRuleRatelimit], [LogRuleRatelimit],
	// [LogCustomFieldRuleRatelimit], [ManagedChallengeRuleRatelimit],
	// [RedirectRuleRatelimit], [RewriteRuleRatelimit], [RouteRuleRatelimit],
	// [ScoreRuleRatelimit], [ServeErrorRuleRatelimit],
	// [SetCacheSettingsRuleRatelimit], [SetConfigRuleRatelimit], [SkipRuleRatelimit].
	Ratelimit interface{} `json:"ratelimit"`
	// The reference of the rule (the rule's ID by default).
	Ref  string                     `json:"ref"`
	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"
	RulesetNewResponseRulesActionDDoSDynamic          RulesetNewResponseRulesAction = "ddos_dynamic"
	RulesetNewResponseRulesActionExecute              RulesetNewResponseRulesAction = "execute"
	RulesetNewResponseRulesActionForceConnectionClose RulesetNewResponseRulesAction = "force_connection_close"
	RulesetNewResponseRulesActionJSChallenge          RulesetNewResponseRulesAction = "js_challenge"
	RulesetNewResponseRulesActionLog                  RulesetNewResponseRulesAction = "log"
	RulesetNewResponseRulesActionLogCustomField       RulesetNewResponseRulesAction = "log_custom_field"
	RulesetNewResponseRulesActionManagedChallenge     RulesetNewResponseRulesAction = "managed_challenge"
	RulesetNewResponseRulesActionRedirect             RulesetNewResponseRulesAction = "redirect"
	RulesetNewResponseRulesActionRewrite              RulesetNewResponseRulesAction = "rewrite"
	RulesetNewResponseRulesActionRoute                RulesetNewResponseRulesAction = "route"
	RulesetNewResponseRulesActionScore                RulesetNewResponseRulesAction = "score"
	RulesetNewResponseRulesActionServeError           RulesetNewResponseRulesAction = "serve_error"
	RulesetNewResponseRulesActionSetCacheSettings     RulesetNewResponseRulesAction = "set_cache_settings"
	RulesetNewResponseRulesActionSetConfig            RulesetNewResponseRulesAction = "set_config"
	RulesetNewResponseRulesActionSkip                 RulesetNewResponseRulesAction = "skip"
)

func (RulesetNewResponseRulesAction) IsKnown

func (r RulesetNewResponseRulesAction) IsKnown() bool

type RulesetNewResponseRulesRulesetsChallengeRule

type RulesetNewResponseRulesRulesetsChallengeRule 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 RulesetNewResponseRulesRulesetsChallengeRuleAction `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"`
	// Configuration for exposed credential checking.
	ExposedCredentialCheck RulesetNewResponseRulesRulesetsChallengeRuleExposedCredentialCheck `json:"exposed_credential_check"`
	// 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"`
	// An object configuring the rule's rate limit behavior.
	Ratelimit RulesetNewResponseRulesRulesetsChallengeRuleRatelimit `json:"ratelimit"`
	// The reference of the rule (the rule's ID by default).
	Ref  string                                           `json:"ref"`
	JSON rulesetNewResponseRulesRulesetsChallengeRuleJSON `json:"-"`
}

func (*RulesetNewResponseRulesRulesetsChallengeRule) UnmarshalJSON

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

type RulesetNewResponseRulesRulesetsChallengeRuleAction

type RulesetNewResponseRulesRulesetsChallengeRuleAction string

The action to perform when the rule matches.

const (
	RulesetNewResponseRulesRulesetsChallengeRuleActionChallenge RulesetNewResponseRulesRulesetsChallengeRuleAction = "challenge"
)

func (RulesetNewResponseRulesRulesetsChallengeRuleAction) IsKnown

type RulesetNewResponseRulesRulesetsChallengeRuleExposedCredentialCheck

type RulesetNewResponseRulesRulesetsChallengeRuleExposedCredentialCheck struct {
	// An expression that selects the password used in the credentials check.
	PasswordExpression string `json:"password_expression,required"`
	// An expression that selects the user ID used in the credentials check.
	UsernameExpression string                                                                 `json:"username_expression,required"`
	JSON               rulesetNewResponseRulesRulesetsChallengeRuleExposedCredentialCheckJSON `json:"-"`
}

Configuration for exposed credential checking.

func (*RulesetNewResponseRulesRulesetsChallengeRuleExposedCredentialCheck) UnmarshalJSON

type RulesetNewResponseRulesRulesetsChallengeRuleRatelimit

type RulesetNewResponseRulesRulesetsChallengeRuleRatelimit struct {
	// Characteristics of the request on which the rate limit counter will be
	// incremented.
	Characteristics []string `json:"characteristics,required"`
	// Period in seconds over which the counter is being incremented.
	Period int64 `json:"period,required"`
	// An expression that defines when the rate limit counter should be incremented. It
	// defaults to the same as the rule's expression.
	CountingExpression string `json:"counting_expression"`
	// Period of time in seconds after which the action will be disabled following its
	// first execution.
	MitigationTimeout int64 `json:"mitigation_timeout"`
	// The threshold of requests per period after which the action will be executed for
	// the first time.
	RequestsPerPeriod int64 `json:"requests_per_period"`
	// Whether counting is only performed when an origin is reached.
	RequestsToOrigin bool `json:"requests_to_origin"`
	// The score threshold per period for which the action will be executed the first
	// time.
	ScorePerPeriod int64 `json:"score_per_period"`
	// A response header name provided by the origin, which contains the score to
	// increment rate limit counter with.
	ScoreResponseHeaderName string                                                    `json:"score_response_header_name"`
	JSON                    rulesetNewResponseRulesRulesetsChallengeRuleRatelimitJSON `json:"-"`
}

An object configuring the rule's rate limit behavior.

func (*RulesetNewResponseRulesRulesetsChallengeRuleRatelimit) UnmarshalJSON

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

type RulesetNewResponseRulesRulesetsJSChallengeRule

type RulesetNewResponseRulesRulesetsJSChallengeRule 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 RulesetNewResponseRulesRulesetsJSChallengeRuleAction `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"`
	// Configuration for exposed credential checking.
	ExposedCredentialCheck RulesetNewResponseRulesRulesetsJSChallengeRuleExposedCredentialCheck `json:"exposed_credential_check"`
	// 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"`
	// An object configuring the rule's rate limit behavior.
	Ratelimit RulesetNewResponseRulesRulesetsJSChallengeRuleRatelimit `json:"ratelimit"`
	// The reference of the rule (the rule's ID by default).
	Ref  string                                             `json:"ref"`
	JSON rulesetNewResponseRulesRulesetsJSChallengeRuleJSON `json:"-"`
}

func (*RulesetNewResponseRulesRulesetsJSChallengeRule) UnmarshalJSON

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

type RulesetNewResponseRulesRulesetsJSChallengeRuleAction

type RulesetNewResponseRulesRulesetsJSChallengeRuleAction string

The action to perform when the rule matches.

const (
	RulesetNewResponseRulesRulesetsJSChallengeRuleActionJSChallenge RulesetNewResponseRulesRulesetsJSChallengeRuleAction = "js_challenge"
)

func (RulesetNewResponseRulesRulesetsJSChallengeRuleAction) IsKnown

type RulesetNewResponseRulesRulesetsJSChallengeRuleExposedCredentialCheck

type RulesetNewResponseRulesRulesetsJSChallengeRuleExposedCredentialCheck struct {
	// An expression that selects the password used in the credentials check.
	PasswordExpression string `json:"password_expression,required"`
	// An expression that selects the user ID used in the credentials check.
	UsernameExpression string                                                                   `json:"username_expression,required"`
	JSON               rulesetNewResponseRulesRulesetsJSChallengeRuleExposedCredentialCheckJSON `json:"-"`
}

Configuration for exposed credential checking.

func (*RulesetNewResponseRulesRulesetsJSChallengeRuleExposedCredentialCheck) UnmarshalJSON

type RulesetNewResponseRulesRulesetsJSChallengeRuleRatelimit

type RulesetNewResponseRulesRulesetsJSChallengeRuleRatelimit struct {
	// Characteristics of the request on which the rate limit counter will be
	// incremented.
	Characteristics []string `json:"characteristics,required"`
	// Period in seconds over which the counter is being incremented.
	Period int64 `json:"period,required"`
	// An expression that defines when the rate limit counter should be incremented. It
	// defaults to the same as the rule's expression.
	CountingExpression string `json:"counting_expression"`
	// Period of time in seconds after which the action will be disabled following its
	// first execution.
	MitigationTimeout int64 `json:"mitigation_timeout"`
	// The threshold of requests per period after which the action will be executed for
	// the first time.
	RequestsPerPeriod int64 `json:"requests_per_period"`
	// Whether counting is only performed when an origin is reached.
	RequestsToOrigin bool `json:"requests_to_origin"`
	// The score threshold per period for which the action will be executed the first
	// time.
	ScorePerPeriod int64 `json:"score_per_period"`
	// A response header name provided by the origin, which contains the score to
	// increment rate limit counter with.
	ScoreResponseHeaderName string                                                      `json:"score_response_header_name"`
	JSON                    rulesetNewResponseRulesRulesetsJSChallengeRuleRatelimitJSON `json:"-"`
}

An object configuring the rule's rate limit behavior.

func (*RulesetNewResponseRulesRulesetsJSChallengeRuleRatelimit) UnmarshalJSON

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 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"`
	// The list of rules in the ruleset.
	Rules param.Field[[]RulesetUpdateParamsRuleUnion] `json:"rules"`
}

func (RulesetUpdateParams) MarshalJSON

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

type RulesetUpdateParamsRule

type RulesetUpdateParamsRule struct {
	// The unique ID of the rule.
	ID param.Field[string] `json:"id"`
	// The action to perform when the rule matches.
	Action           param.Field[RulesetUpdateParamsRulesAction] `json:"action"`
	ActionParameters param.Field[interface{}]                    `json:"action_parameters"`
	Categories       param.Field[interface{}]                    `json:"categories"`
	// An informative description of the rule.
	Description param.Field[string] `json:"description"`
	// Whether the rule should be executed.
	Enabled                param.Field[bool]        `json:"enabled"`
	ExposedCredentialCheck param.Field[interface{}] `json:"exposed_credential_check"`
	// 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"`
	Ratelimit param.Field[interface{}]  `json:"ratelimit"`
	// The reference of the rule (the rule's 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"
	RulesetUpdateParamsRulesActionDDoSDynamic          RulesetUpdateParamsRulesAction = "ddos_dynamic"
	RulesetUpdateParamsRulesActionExecute              RulesetUpdateParamsRulesAction = "execute"
	RulesetUpdateParamsRulesActionForceConnectionClose RulesetUpdateParamsRulesAction = "force_connection_close"
	RulesetUpdateParamsRulesActionJSChallenge          RulesetUpdateParamsRulesAction = "js_challenge"
	RulesetUpdateParamsRulesActionLog                  RulesetUpdateParamsRulesAction = "log"
	RulesetUpdateParamsRulesActionLogCustomField       RulesetUpdateParamsRulesAction = "log_custom_field"
	RulesetUpdateParamsRulesActionManagedChallenge     RulesetUpdateParamsRulesAction = "managed_challenge"
	RulesetUpdateParamsRulesActionRedirect             RulesetUpdateParamsRulesAction = "redirect"
	RulesetUpdateParamsRulesActionRewrite              RulesetUpdateParamsRulesAction = "rewrite"
	RulesetUpdateParamsRulesActionRoute                RulesetUpdateParamsRulesAction = "route"
	RulesetUpdateParamsRulesActionScore                RulesetUpdateParamsRulesAction = "score"
	RulesetUpdateParamsRulesActionServeError           RulesetUpdateParamsRulesAction = "serve_error"
	RulesetUpdateParamsRulesActionSetCacheSettings     RulesetUpdateParamsRulesAction = "set_cache_settings"
	RulesetUpdateParamsRulesActionSetConfig            RulesetUpdateParamsRulesAction = "set_config"
	RulesetUpdateParamsRulesActionSkip                 RulesetUpdateParamsRulesAction = "skip"
)

func (RulesetUpdateParamsRulesAction) IsKnown

type RulesetUpdateParamsRulesRulesetsChallengeRule

type RulesetUpdateParamsRulesRulesetsChallengeRule struct {
	// The unique ID of the rule.
	ID param.Field[string] `json:"id"`
	// The action to perform when the rule matches.
	Action param.Field[RulesetUpdateParamsRulesRulesetsChallengeRuleAction] `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"`
	// Configuration for exposed credential checking.
	ExposedCredentialCheck param.Field[RulesetUpdateParamsRulesRulesetsChallengeRuleExposedCredentialCheck] `json:"exposed_credential_check"`
	// 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"`
	// An object configuring the rule's rate limit behavior.
	Ratelimit param.Field[RulesetUpdateParamsRulesRulesetsChallengeRuleRatelimit] `json:"ratelimit"`
	// The reference of the rule (the rule's ID by default).
	Ref param.Field[string] `json:"ref"`
}

func (RulesetUpdateParamsRulesRulesetsChallengeRule) MarshalJSON

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

type RulesetUpdateParamsRulesRulesetsChallengeRuleAction

type RulesetUpdateParamsRulesRulesetsChallengeRuleAction string

The action to perform when the rule matches.

const (
	RulesetUpdateParamsRulesRulesetsChallengeRuleActionChallenge RulesetUpdateParamsRulesRulesetsChallengeRuleAction = "challenge"
)

func (RulesetUpdateParamsRulesRulesetsChallengeRuleAction) IsKnown

type RulesetUpdateParamsRulesRulesetsChallengeRuleExposedCredentialCheck

type RulesetUpdateParamsRulesRulesetsChallengeRuleExposedCredentialCheck struct {
	// An expression that selects the password used in the credentials check.
	PasswordExpression param.Field[string] `json:"password_expression,required"`
	// An expression that selects the user ID used in the credentials check.
	UsernameExpression param.Field[string] `json:"username_expression,required"`
}

Configuration for exposed credential checking.

func (RulesetUpdateParamsRulesRulesetsChallengeRuleExposedCredentialCheck) MarshalJSON

type RulesetUpdateParamsRulesRulesetsChallengeRuleRatelimit

type RulesetUpdateParamsRulesRulesetsChallengeRuleRatelimit struct {
	// Characteristics of the request on which the rate limit counter will be
	// incremented.
	Characteristics param.Field[[]string] `json:"characteristics,required"`
	// Period in seconds over which the counter is being incremented.
	Period param.Field[int64] `json:"period,required"`
	// An expression that defines when the rate limit counter should be incremented. It
	// defaults to the same as the rule's expression.
	CountingExpression param.Field[string] `json:"counting_expression"`
	// Period of time in seconds after which the action will be disabled following its
	// first execution.
	MitigationTimeout param.Field[int64] `json:"mitigation_timeout"`
	// The threshold of requests per period after which the action will be executed for
	// the first time.
	RequestsPerPeriod param.Field[int64] `json:"requests_per_period"`
	// Whether counting is only performed when an origin is reached.
	RequestsToOrigin param.Field[bool] `json:"requests_to_origin"`
	// The score threshold per period for which the action will be executed the first
	// time.
	ScorePerPeriod param.Field[int64] `json:"score_per_period"`
	// A response header name provided by the origin, which contains the score to
	// increment rate limit counter with.
	ScoreResponseHeaderName param.Field[string] `json:"score_response_header_name"`
}

An object configuring the rule's rate limit behavior.

func (RulesetUpdateParamsRulesRulesetsChallengeRuleRatelimit) MarshalJSON

type RulesetUpdateParamsRulesRulesetsJSChallengeRule

type RulesetUpdateParamsRulesRulesetsJSChallengeRule struct {
	// The unique ID of the rule.
	ID param.Field[string] `json:"id"`
	// The action to perform when the rule matches.
	Action param.Field[RulesetUpdateParamsRulesRulesetsJSChallengeRuleAction] `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"`
	// Configuration for exposed credential checking.
	ExposedCredentialCheck param.Field[RulesetUpdateParamsRulesRulesetsJSChallengeRuleExposedCredentialCheck] `json:"exposed_credential_check"`
	// 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"`
	// An object configuring the rule's rate limit behavior.
	Ratelimit param.Field[RulesetUpdateParamsRulesRulesetsJSChallengeRuleRatelimit] `json:"ratelimit"`
	// The reference of the rule (the rule's ID by default).
	Ref param.Field[string] `json:"ref"`
}

func (RulesetUpdateParamsRulesRulesetsJSChallengeRule) MarshalJSON

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

type RulesetUpdateParamsRulesRulesetsJSChallengeRuleAction

type RulesetUpdateParamsRulesRulesetsJSChallengeRuleAction string

The action to perform when the rule matches.

const (
	RulesetUpdateParamsRulesRulesetsJSChallengeRuleActionJSChallenge RulesetUpdateParamsRulesRulesetsJSChallengeRuleAction = "js_challenge"
)

func (RulesetUpdateParamsRulesRulesetsJSChallengeRuleAction) IsKnown

type RulesetUpdateParamsRulesRulesetsJSChallengeRuleExposedCredentialCheck

type RulesetUpdateParamsRulesRulesetsJSChallengeRuleExposedCredentialCheck struct {
	// An expression that selects the password used in the credentials check.
	PasswordExpression param.Field[string] `json:"password_expression,required"`
	// An expression that selects the user ID used in the credentials check.
	UsernameExpression param.Field[string] `json:"username_expression,required"`
}

Configuration for exposed credential checking.

func (RulesetUpdateParamsRulesRulesetsJSChallengeRuleExposedCredentialCheck) MarshalJSON

type RulesetUpdateParamsRulesRulesetsJSChallengeRuleRatelimit

type RulesetUpdateParamsRulesRulesetsJSChallengeRuleRatelimit struct {
	// Characteristics of the request on which the rate limit counter will be
	// incremented.
	Characteristics param.Field[[]string] `json:"characteristics,required"`
	// Period in seconds over which the counter is being incremented.
	Period param.Field[int64] `json:"period,required"`
	// An expression that defines when the rate limit counter should be incremented. It
	// defaults to the same as the rule's expression.
	CountingExpression param.Field[string] `json:"counting_expression"`
	// Period of time in seconds after which the action will be disabled following its
	// first execution.
	MitigationTimeout param.Field[int64] `json:"mitigation_timeout"`
	// The threshold of requests per period after which the action will be executed for
	// the first time.
	RequestsPerPeriod param.Field[int64] `json:"requests_per_period"`
	// Whether counting is only performed when an origin is reached.
	RequestsToOrigin param.Field[bool] `json:"requests_to_origin"`
	// The score threshold per period for which the action will be executed the first
	// time.
	ScorePerPeriod param.Field[int64] `json:"score_per_period"`
	// A response header name provided by the origin, which contains the score to
	// increment rate limit counter with.
	ScoreResponseHeaderName param.Field[string] `json:"score_response_header_name"`
}

An object configuring the rule's rate limit behavior.

func (RulesetUpdateParamsRulesRulesetsJSChallengeRuleRatelimit) MarshalJSON

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 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 RulesetUpdateResponseRulesAction `json:"action"`
	// This field can have the runtime type of [BlockRuleActionParameters],
	// [interface{}], [CompressResponseRuleActionParameters],
	// [ExecuteRuleActionParameters], [LogCustomFieldRuleActionParameters],
	// [RedirectRuleActionParameters], [RewriteRuleActionParameters],
	// [RouteRuleActionParameters], [ScoreRuleActionParameters],
	// [ServeErrorRuleActionParameters], [SetCacheSettingsRuleActionParameters],
	// [SetConfigRuleActionParameters], [SkipRuleActionParameters].
	ActionParameters interface{} `json:"action_parameters"`
	// This field can have the runtime type of [[]string].
	Categories interface{} `json:"categories"`
	// An informative description of the rule.
	Description string `json:"description"`
	// Whether the rule should be executed.
	Enabled bool `json:"enabled"`
	// This field can have the runtime type of [BlockRuleExposedCredentialCheck],
	// [RulesetUpdateResponseRulesRulesetsChallengeRuleExposedCredentialCheck],
	// [CompressResponseRuleExposedCredentialCheck],
	// [DDoSDynamicRuleExposedCredentialCheck], [ExecuteRuleExposedCredentialCheck],
	// [ForceConnectionCloseRuleExposedCredentialCheck],
	// [RulesetUpdateResponseRulesRulesetsJSChallengeRuleExposedCredentialCheck],
	// [LogRuleExposedCredentialCheck], [LogCustomFieldRuleExposedCredentialCheck],
	// [ManagedChallengeRuleExposedCredentialCheck],
	// [RedirectRuleExposedCredentialCheck], [RewriteRuleExposedCredentialCheck],
	// [RouteRuleExposedCredentialCheck], [ScoreRuleExposedCredentialCheck],
	// [ServeErrorRuleExposedCredentialCheck],
	// [SetCacheSettingsRuleExposedCredentialCheck],
	// [SetConfigRuleExposedCredentialCheck], [SkipRuleExposedCredentialCheck].
	ExposedCredentialCheck interface{} `json:"exposed_credential_check"`
	// 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"`
	// This field can have the runtime type of [BlockRuleRatelimit],
	// [RulesetUpdateResponseRulesRulesetsChallengeRuleRatelimit],
	// [CompressResponseRuleRatelimit], [DDoSDynamicRuleRatelimit],
	// [ExecuteRuleRatelimit], [ForceConnectionCloseRuleRatelimit],
	// [RulesetUpdateResponseRulesRulesetsJSChallengeRuleRatelimit],
	// [LogRuleRatelimit], [LogCustomFieldRuleRatelimit],
	// [ManagedChallengeRuleRatelimit], [RedirectRuleRatelimit],
	// [RewriteRuleRatelimit], [RouteRuleRatelimit], [ScoreRuleRatelimit],
	// [ServeErrorRuleRatelimit], [SetCacheSettingsRuleRatelimit],
	// [SetConfigRuleRatelimit], [SkipRuleRatelimit].
	Ratelimit interface{} `json:"ratelimit"`
	// The reference of the rule (the rule's ID by default).
	Ref  string                        `json:"ref"`
	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"
	RulesetUpdateResponseRulesActionDDoSDynamic          RulesetUpdateResponseRulesAction = "ddos_dynamic"
	RulesetUpdateResponseRulesActionExecute              RulesetUpdateResponseRulesAction = "execute"
	RulesetUpdateResponseRulesActionForceConnectionClose RulesetUpdateResponseRulesAction = "force_connection_close"
	RulesetUpdateResponseRulesActionJSChallenge          RulesetUpdateResponseRulesAction = "js_challenge"
	RulesetUpdateResponseRulesActionLog                  RulesetUpdateResponseRulesAction = "log"
	RulesetUpdateResponseRulesActionLogCustomField       RulesetUpdateResponseRulesAction = "log_custom_field"
	RulesetUpdateResponseRulesActionManagedChallenge     RulesetUpdateResponseRulesAction = "managed_challenge"
	RulesetUpdateResponseRulesActionRedirect             RulesetUpdateResponseRulesAction = "redirect"
	RulesetUpdateResponseRulesActionRewrite              RulesetUpdateResponseRulesAction = "rewrite"
	RulesetUpdateResponseRulesActionRoute                RulesetUpdateResponseRulesAction = "route"
	RulesetUpdateResponseRulesActionScore                RulesetUpdateResponseRulesAction = "score"
	RulesetUpdateResponseRulesActionServeError           RulesetUpdateResponseRulesAction = "serve_error"
	RulesetUpdateResponseRulesActionSetCacheSettings     RulesetUpdateResponseRulesAction = "set_cache_settings"
	RulesetUpdateResponseRulesActionSetConfig            RulesetUpdateResponseRulesAction = "set_config"
	RulesetUpdateResponseRulesActionSkip                 RulesetUpdateResponseRulesAction = "skip"
)

func (RulesetUpdateResponseRulesAction) IsKnown

type RulesetUpdateResponseRulesRulesetsChallengeRule

type RulesetUpdateResponseRulesRulesetsChallengeRule 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 RulesetUpdateResponseRulesRulesetsChallengeRuleAction `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"`
	// Configuration for exposed credential checking.
	ExposedCredentialCheck RulesetUpdateResponseRulesRulesetsChallengeRuleExposedCredentialCheck `json:"exposed_credential_check"`
	// 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"`
	// An object configuring the rule's rate limit behavior.
	Ratelimit RulesetUpdateResponseRulesRulesetsChallengeRuleRatelimit `json:"ratelimit"`
	// The reference of the rule (the rule's ID by default).
	Ref  string                                              `json:"ref"`
	JSON rulesetUpdateResponseRulesRulesetsChallengeRuleJSON `json:"-"`
}

func (*RulesetUpdateResponseRulesRulesetsChallengeRule) UnmarshalJSON

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

type RulesetUpdateResponseRulesRulesetsChallengeRuleAction

type RulesetUpdateResponseRulesRulesetsChallengeRuleAction string

The action to perform when the rule matches.

const (
	RulesetUpdateResponseRulesRulesetsChallengeRuleActionChallenge RulesetUpdateResponseRulesRulesetsChallengeRuleAction = "challenge"
)

func (RulesetUpdateResponseRulesRulesetsChallengeRuleAction) IsKnown

type RulesetUpdateResponseRulesRulesetsChallengeRuleExposedCredentialCheck

type RulesetUpdateResponseRulesRulesetsChallengeRuleExposedCredentialCheck struct {
	// An expression that selects the password used in the credentials check.
	PasswordExpression string `json:"password_expression,required"`
	// An expression that selects the user ID used in the credentials check.
	UsernameExpression string                                                                    `json:"username_expression,required"`
	JSON               rulesetUpdateResponseRulesRulesetsChallengeRuleExposedCredentialCheckJSON `json:"-"`
}

Configuration for exposed credential checking.

func (*RulesetUpdateResponseRulesRulesetsChallengeRuleExposedCredentialCheck) UnmarshalJSON

type RulesetUpdateResponseRulesRulesetsChallengeRuleRatelimit

type RulesetUpdateResponseRulesRulesetsChallengeRuleRatelimit struct {
	// Characteristics of the request on which the rate limit counter will be
	// incremented.
	Characteristics []string `json:"characteristics,required"`
	// Period in seconds over which the counter is being incremented.
	Period int64 `json:"period,required"`
	// An expression that defines when the rate limit counter should be incremented. It
	// defaults to the same as the rule's expression.
	CountingExpression string `json:"counting_expression"`
	// Period of time in seconds after which the action will be disabled following its
	// first execution.
	MitigationTimeout int64 `json:"mitigation_timeout"`
	// The threshold of requests per period after which the action will be executed for
	// the first time.
	RequestsPerPeriod int64 `json:"requests_per_period"`
	// Whether counting is only performed when an origin is reached.
	RequestsToOrigin bool `json:"requests_to_origin"`
	// The score threshold per period for which the action will be executed the first
	// time.
	ScorePerPeriod int64 `json:"score_per_period"`
	// A response header name provided by the origin, which contains the score to
	// increment rate limit counter with.
	ScoreResponseHeaderName string                                                       `json:"score_response_header_name"`
	JSON                    rulesetUpdateResponseRulesRulesetsChallengeRuleRatelimitJSON `json:"-"`
}

An object configuring the rule's rate limit behavior.

func (*RulesetUpdateResponseRulesRulesetsChallengeRuleRatelimit) UnmarshalJSON

type RulesetUpdateResponseRulesRulesetsJSChallengeRule

type RulesetUpdateResponseRulesRulesetsJSChallengeRule 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 RulesetUpdateResponseRulesRulesetsJSChallengeRuleAction `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"`
	// Configuration for exposed credential checking.
	ExposedCredentialCheck RulesetUpdateResponseRulesRulesetsJSChallengeRuleExposedCredentialCheck `json:"exposed_credential_check"`
	// 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"`
	// An object configuring the rule's rate limit behavior.
	Ratelimit RulesetUpdateResponseRulesRulesetsJSChallengeRuleRatelimit `json:"ratelimit"`
	// The reference of the rule (the rule's ID by default).
	Ref  string                                                `json:"ref"`
	JSON rulesetUpdateResponseRulesRulesetsJSChallengeRuleJSON `json:"-"`
}

func (*RulesetUpdateResponseRulesRulesetsJSChallengeRule) UnmarshalJSON

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

type RulesetUpdateResponseRulesRulesetsJSChallengeRuleAction

type RulesetUpdateResponseRulesRulesetsJSChallengeRuleAction string

The action to perform when the rule matches.

const (
	RulesetUpdateResponseRulesRulesetsJSChallengeRuleActionJSChallenge RulesetUpdateResponseRulesRulesetsJSChallengeRuleAction = "js_challenge"
)

func (RulesetUpdateResponseRulesRulesetsJSChallengeRuleAction) IsKnown

type RulesetUpdateResponseRulesRulesetsJSChallengeRuleExposedCredentialCheck

type RulesetUpdateResponseRulesRulesetsJSChallengeRuleExposedCredentialCheck struct {
	// An expression that selects the password used in the credentials check.
	PasswordExpression string `json:"password_expression,required"`
	// An expression that selects the user ID used in the credentials check.
	UsernameExpression string                                                                      `json:"username_expression,required"`
	JSON               rulesetUpdateResponseRulesRulesetsJSChallengeRuleExposedCredentialCheckJSON `json:"-"`
}

Configuration for exposed credential checking.

func (*RulesetUpdateResponseRulesRulesetsJSChallengeRuleExposedCredentialCheck) UnmarshalJSON

type RulesetUpdateResponseRulesRulesetsJSChallengeRuleRatelimit

type RulesetUpdateResponseRulesRulesetsJSChallengeRuleRatelimit struct {
	// Characteristics of the request on which the rate limit counter will be
	// incremented.
	Characteristics []string `json:"characteristics,required"`
	// Period in seconds over which the counter is being incremented.
	Period int64 `json:"period,required"`
	// An expression that defines when the rate limit counter should be incremented. It
	// defaults to the same as the rule's expression.
	CountingExpression string `json:"counting_expression"`
	// Period of time in seconds after which the action will be disabled following its
	// first execution.
	MitigationTimeout int64 `json:"mitigation_timeout"`
	// The threshold of requests per period after which the action will be executed for
	// the first time.
	RequestsPerPeriod int64 `json:"requests_per_period"`
	// Whether counting is only performed when an origin is reached.
	RequestsToOrigin bool `json:"requests_to_origin"`
	// The score threshold per period for which the action will be executed the first
	// time.
	ScorePerPeriod int64 `json:"score_per_period"`
	// A response header name provided by the origin, which contains the score to
	// increment rate limit counter with.
	ScoreResponseHeaderName string                                                         `json:"score_response_header_name"`
	JSON                    rulesetUpdateResponseRulesRulesetsJSChallengeRuleRatelimitJSON `json:"-"`
}

An object configuring the rule's rate limit behavior.

func (*RulesetUpdateResponseRulesRulesetsJSChallengeRuleRatelimit) UnmarshalJSON

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"`
	// Configuration for exposed credential checking.
	ExposedCredentialCheck ScoreRuleExposedCredentialCheck `json:"exposed_credential_check"`
	// 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"`
	// An object configuring the rule's rate limit behavior.
	Ratelimit ScoreRuleRatelimit `json:"ratelimit"`
	// The reference of the rule (the rule's 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 {
	// A delta to change the score by, which can be either positive or negative.
	Increment int64                         `json:"increment,required"`
	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 {
	// A delta to change the score by, which can be either positive or negative.
	Increment param.Field[int64] `json:"increment,required"`
}

The parameters configuring the rule's action.

func (ScoreRuleActionParametersParam) MarshalJSON

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

type ScoreRuleExposedCredentialCheck

type ScoreRuleExposedCredentialCheck struct {
	// An expression that selects the password used in the credentials check.
	PasswordExpression string `json:"password_expression,required"`
	// An expression that selects the user ID used in the credentials check.
	UsernameExpression string                              `json:"username_expression,required"`
	JSON               scoreRuleExposedCredentialCheckJSON `json:"-"`
}

Configuration for exposed credential checking.

func (*ScoreRuleExposedCredentialCheck) UnmarshalJSON

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

type ScoreRuleExposedCredentialCheckParam

type ScoreRuleExposedCredentialCheckParam struct {
	// An expression that selects the password used in the credentials check.
	PasswordExpression param.Field[string] `json:"password_expression,required"`
	// An expression that selects the user ID used in the credentials check.
	UsernameExpression param.Field[string] `json:"username_expression,required"`
}

Configuration for exposed credential checking.

func (ScoreRuleExposedCredentialCheckParam) MarshalJSON

func (r ScoreRuleExposedCredentialCheckParam) 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"`
	// Configuration for exposed credential checking.
	ExposedCredentialCheck param.Field[ScoreRuleExposedCredentialCheckParam] `json:"exposed_credential_check"`
	// 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"`
	// An object configuring the rule's rate limit behavior.
	Ratelimit param.Field[ScoreRuleRatelimitParam] `json:"ratelimit"`
	// The reference of the rule (the rule's ID by default).
	Ref param.Field[string] `json:"ref"`
}

func (ScoreRuleParam) MarshalJSON

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

type ScoreRuleRatelimit

type ScoreRuleRatelimit struct {
	// Characteristics of the request on which the rate limit counter will be
	// incremented.
	Characteristics []string `json:"characteristics,required"`
	// Period in seconds over which the counter is being incremented.
	Period int64 `json:"period,required"`
	// An expression that defines when the rate limit counter should be incremented. It
	// defaults to the same as the rule's expression.
	CountingExpression string `json:"counting_expression"`
	// Period of time in seconds after which the action will be disabled following its
	// first execution.
	MitigationTimeout int64 `json:"mitigation_timeout"`
	// The threshold of requests per period after which the action will be executed for
	// the first time.
	RequestsPerPeriod int64 `json:"requests_per_period"`
	// Whether counting is only performed when an origin is reached.
	RequestsToOrigin bool `json:"requests_to_origin"`
	// The score threshold per period for which the action will be executed the first
	// time.
	ScorePerPeriod int64 `json:"score_per_period"`
	// A response header name provided by the origin, which contains the score to
	// increment rate limit counter with.
	ScoreResponseHeaderName string                 `json:"score_response_header_name"`
	JSON                    scoreRuleRatelimitJSON `json:"-"`
}

An object configuring the rule's rate limit behavior.

func (*ScoreRuleRatelimit) UnmarshalJSON

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

type ScoreRuleRatelimitParam

type ScoreRuleRatelimitParam struct {
	// Characteristics of the request on which the rate limit counter will be
	// incremented.
	Characteristics param.Field[[]string] `json:"characteristics,required"`
	// Period in seconds over which the counter is being incremented.
	Period param.Field[int64] `json:"period,required"`
	// An expression that defines when the rate limit counter should be incremented. It
	// defaults to the same as the rule's expression.
	CountingExpression param.Field[string] `json:"counting_expression"`
	// Period of time in seconds after which the action will be disabled following its
	// first execution.
	MitigationTimeout param.Field[int64] `json:"mitigation_timeout"`
	// The threshold of requests per period after which the action will be executed for
	// the first time.
	RequestsPerPeriod param.Field[int64] `json:"requests_per_period"`
	// Whether counting is only performed when an origin is reached.
	RequestsToOrigin param.Field[bool] `json:"requests_to_origin"`
	// The score threshold per period for which the action will be executed the first
	// time.
	ScorePerPeriod param.Field[int64] `json:"score_per_period"`
	// A response header name provided by the origin, which contains the score to
	// increment rate limit counter with.
	ScoreResponseHeaderName param.Field[string] `json:"score_response_header_name"`
}

An object configuring the rule's rate limit behavior.

func (ScoreRuleRatelimitParam) MarshalJSON

func (r ScoreRuleRatelimitParam) 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"`
	// Configuration for exposed credential checking.
	ExposedCredentialCheck ServeErrorRuleExposedCredentialCheck `json:"exposed_credential_check"`
	// 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"`
	// An object configuring the rule's rate limit behavior.
	Ratelimit ServeErrorRuleRatelimit `json:"ratelimit"`
	// The reference of the rule (the rule's 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 {
	// The name of a custom asset to serve as the error response.
	AssetName string `json:"asset_name"`
	// The response content.
	Content string `json:"content"`
	// The content type header to set with the error response.
	ContentType ServeErrorRuleActionParametersContentType `json:"content_type"`
	// The status code to use for the error.
	StatusCode int64                              `json:"status_code"`
	JSON       serveErrorRuleActionParametersJSON `json:"-"`
	// contains filtered or unexported fields
}

The parameters configuring the rule's action.

func (ServeErrorRuleActionParameters) AsUnion

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

Possible runtime types of the union are ServeErrorRuleActionParametersActionParametersContent, ServeErrorRuleActionParametersActionParametersAsset.

func (*ServeErrorRuleActionParameters) UnmarshalJSON

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

type ServeErrorRuleActionParametersActionParametersAsset

type ServeErrorRuleActionParametersActionParametersAsset struct {
	// The name of a custom asset to serve as the error response.
	AssetName string `json:"asset_name,required"`
	// The content type header to set with the error response.
	ContentType ServeErrorRuleActionParametersActionParametersAssetContentType `json:"content_type"`
	// The status code to use for the error.
	StatusCode int64                                                   `json:"status_code"`
	JSON       serveErrorRuleActionParametersActionParametersAssetJSON `json:"-"`
}

func (*ServeErrorRuleActionParametersActionParametersAsset) UnmarshalJSON

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

type ServeErrorRuleActionParametersActionParametersAssetContentType

type ServeErrorRuleActionParametersActionParametersAssetContentType string

The content type header to set with the error response.

const (
	ServeErrorRuleActionParametersActionParametersAssetContentTypeApplicationJson ServeErrorRuleActionParametersActionParametersAssetContentType = "application/json"
	ServeErrorRuleActionParametersActionParametersAssetContentTypeTextHTML        ServeErrorRuleActionParametersActionParametersAssetContentType = "text/html"
	ServeErrorRuleActionParametersActionParametersAssetContentTypeTextPlain       ServeErrorRuleActionParametersActionParametersAssetContentType = "text/plain"
	ServeErrorRuleActionParametersActionParametersAssetContentTypeTextXml         ServeErrorRuleActionParametersActionParametersAssetContentType = "text/xml"
)

func (ServeErrorRuleActionParametersActionParametersAssetContentType) IsKnown

type ServeErrorRuleActionParametersActionParametersAssetParam

type ServeErrorRuleActionParametersActionParametersAssetParam struct {
	// The name of a custom asset to serve as the error response.
	AssetName param.Field[string] `json:"asset_name,required"`
	// The content type header to set with the error response.
	ContentType param.Field[ServeErrorRuleActionParametersActionParametersAssetContentType] `json:"content_type"`
	// The status code to use for the error.
	StatusCode param.Field[int64] `json:"status_code"`
}

func (ServeErrorRuleActionParametersActionParametersAssetParam) MarshalJSON

type ServeErrorRuleActionParametersActionParametersContent

type ServeErrorRuleActionParametersActionParametersContent struct {
	// The response content.
	Content string `json:"content,required"`
	// The content type header to set with the error response.
	ContentType ServeErrorRuleActionParametersActionParametersContentContentType `json:"content_type"`
	// The status code to use for the error.
	StatusCode int64                                                     `json:"status_code"`
	JSON       serveErrorRuleActionParametersActionParametersContentJSON `json:"-"`
}

func (*ServeErrorRuleActionParametersActionParametersContent) UnmarshalJSON

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

type ServeErrorRuleActionParametersActionParametersContentContentType

type ServeErrorRuleActionParametersActionParametersContentContentType string

The content type header to set with the error response.

const (
	ServeErrorRuleActionParametersActionParametersContentContentTypeApplicationJson ServeErrorRuleActionParametersActionParametersContentContentType = "application/json"
	ServeErrorRuleActionParametersActionParametersContentContentTypeTextHTML        ServeErrorRuleActionParametersActionParametersContentContentType = "text/html"
	ServeErrorRuleActionParametersActionParametersContentContentTypeTextPlain       ServeErrorRuleActionParametersActionParametersContentContentType = "text/plain"
	ServeErrorRuleActionParametersActionParametersContentContentTypeTextXml         ServeErrorRuleActionParametersActionParametersContentContentType = "text/xml"
)

func (ServeErrorRuleActionParametersActionParametersContentContentType) IsKnown

type ServeErrorRuleActionParametersActionParametersContentParam

type ServeErrorRuleActionParametersActionParametersContentParam struct {
	// The response content.
	Content param.Field[string] `json:"content,required"`
	// The content type header to set with the error response.
	ContentType param.Field[ServeErrorRuleActionParametersActionParametersContentContentType] `json:"content_type"`
	// The status code to use for the error.
	StatusCode param.Field[int64] `json:"status_code"`
}

func (ServeErrorRuleActionParametersActionParametersContentParam) MarshalJSON

type ServeErrorRuleActionParametersContentType

type ServeErrorRuleActionParametersContentType string

The content type header to set with the error response.

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

func (ServeErrorRuleActionParametersContentType) IsKnown

type ServeErrorRuleActionParametersParam

type ServeErrorRuleActionParametersParam struct {
	// The name of a custom asset to serve as the error response.
	AssetName param.Field[string] `json:"asset_name"`
	// The response content.
	Content param.Field[string] `json:"content"`
	// The content type header to set with the error response.
	ContentType param.Field[ServeErrorRuleActionParametersContentType] `json:"content_type"`
	// The status code to use for the error.
	StatusCode param.Field[int64] `json:"status_code"`
}

The parameters configuring the rule's action.

func (ServeErrorRuleActionParametersParam) MarshalJSON

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

type ServeErrorRuleActionParametersUnion

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

The parameters configuring the rule's action.

Union satisfied by ServeErrorRuleActionParametersActionParametersContent or ServeErrorRuleActionParametersActionParametersAsset.

type ServeErrorRuleActionParametersUnionParam

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

The parameters configuring the rule's action.

Satisfied by rulesets.ServeErrorRuleActionParametersActionParametersContentParam, rulesets.ServeErrorRuleActionParametersActionParametersAssetParam, ServeErrorRuleActionParametersParam.

type ServeErrorRuleExposedCredentialCheck

type ServeErrorRuleExposedCredentialCheck struct {
	// An expression that selects the password used in the credentials check.
	PasswordExpression string `json:"password_expression,required"`
	// An expression that selects the user ID used in the credentials check.
	UsernameExpression string                                   `json:"username_expression,required"`
	JSON               serveErrorRuleExposedCredentialCheckJSON `json:"-"`
}

Configuration for exposed credential checking.

func (*ServeErrorRuleExposedCredentialCheck) UnmarshalJSON

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

type ServeErrorRuleExposedCredentialCheckParam

type ServeErrorRuleExposedCredentialCheckParam struct {
	// An expression that selects the password used in the credentials check.
	PasswordExpression param.Field[string] `json:"password_expression,required"`
	// An expression that selects the user ID used in the credentials check.
	UsernameExpression param.Field[string] `json:"username_expression,required"`
}

Configuration for exposed credential checking.

func (ServeErrorRuleExposedCredentialCheckParam) MarshalJSON

func (r ServeErrorRuleExposedCredentialCheckParam) 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[ServeErrorRuleActionParametersUnionParam] `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"`
	// Configuration for exposed credential checking.
	ExposedCredentialCheck param.Field[ServeErrorRuleExposedCredentialCheckParam] `json:"exposed_credential_check"`
	// 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"`
	// An object configuring the rule's rate limit behavior.
	Ratelimit param.Field[ServeErrorRuleRatelimitParam] `json:"ratelimit"`
	// The reference of the rule (the rule's ID by default).
	Ref param.Field[string] `json:"ref"`
}

func (ServeErrorRuleParam) MarshalJSON

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

type ServeErrorRuleRatelimit

type ServeErrorRuleRatelimit struct {
	// Characteristics of the request on which the rate limit counter will be
	// incremented.
	Characteristics []string `json:"characteristics,required"`
	// Period in seconds over which the counter is being incremented.
	Period int64 `json:"period,required"`
	// An expression that defines when the rate limit counter should be incremented. It
	// defaults to the same as the rule's expression.
	CountingExpression string `json:"counting_expression"`
	// Period of time in seconds after which the action will be disabled following its
	// first execution.
	MitigationTimeout int64 `json:"mitigation_timeout"`
	// The threshold of requests per period after which the action will be executed for
	// the first time.
	RequestsPerPeriod int64 `json:"requests_per_period"`
	// Whether counting is only performed when an origin is reached.
	RequestsToOrigin bool `json:"requests_to_origin"`
	// The score threshold per period for which the action will be executed the first
	// time.
	ScorePerPeriod int64 `json:"score_per_period"`
	// A response header name provided by the origin, which contains the score to
	// increment rate limit counter with.
	ScoreResponseHeaderName string                      `json:"score_response_header_name"`
	JSON                    serveErrorRuleRatelimitJSON `json:"-"`
}

An object configuring the rule's rate limit behavior.

func (*ServeErrorRuleRatelimit) UnmarshalJSON

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

type ServeErrorRuleRatelimitParam

type ServeErrorRuleRatelimitParam struct {
	// Characteristics of the request on which the rate limit counter will be
	// incremented.
	Characteristics param.Field[[]string] `json:"characteristics,required"`
	// Period in seconds over which the counter is being incremented.
	Period param.Field[int64] `json:"period,required"`
	// An expression that defines when the rate limit counter should be incremented. It
	// defaults to the same as the rule's expression.
	CountingExpression param.Field[string] `json:"counting_expression"`
	// Period of time in seconds after which the action will be disabled following its
	// first execution.
	MitigationTimeout param.Field[int64] `json:"mitigation_timeout"`
	// The threshold of requests per period after which the action will be executed for
	// the first time.
	RequestsPerPeriod param.Field[int64] `json:"requests_per_period"`
	// Whether counting is only performed when an origin is reached.
	RequestsToOrigin param.Field[bool] `json:"requests_to_origin"`
	// The score threshold per period for which the action will be executed the first
	// time.
	ScorePerPeriod param.Field[int64] `json:"score_per_period"`
	// A response header name provided by the origin, which contains the score to
	// increment rate limit counter with.
	ScoreResponseHeaderName param.Field[string] `json:"score_response_header_name"`
}

An object configuring the rule's rate limit behavior.

func (ServeErrorRuleRatelimitParam) MarshalJSON

func (r ServeErrorRuleRatelimitParam) 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"`
	// Configuration for exposed credential checking.
	ExposedCredentialCheck SetCacheSettingsRuleExposedCredentialCheck `json:"exposed_credential_check"`
	// 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"`
	// An object configuring the rule's rate limit behavior.
	Ratelimit SetCacheSettingsRuleRatelimit `json:"ratelimit"`
	// The reference of the rule (the rule's 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 {
	// A list of additional ports that caching should be enabled on.
	AdditionalCacheablePorts []int64 `json:"additional_cacheable_ports"`
	// 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"`
	// Whether the request's response from the origin is eligible for caching. Caching
	// itself will still depend on the cache control header and your other caching
	// configurations.
	Cache bool `json:"cache"`
	// Which components of the request are included in or excluded from the cache key
	// Cloudflare uses to store the response in cache.
	CacheKey SetCacheSettingsRuleActionParametersCacheKey `json:"cache_key"`
	// Settings to determine whether the request's response from origin is eligible for
	// Cache Reserve (requires a Cache Reserve add-on plan).
	CacheReserve SetCacheSettingsRuleActionParametersCacheReserve `json:"cache_reserve"`
	// How long the Cloudflare edge network should cache the response.
	EdgeTTL SetCacheSettingsRuleActionParametersEdgeTTL `json:"edge_ttl"`
	// Whether Cloudflare will aim to strictly adhere to RFC 7234.
	OriginCacheControl bool `json:"origin_cache_control"`
	// Whether to generate Cloudflare error pages for issues from the origin server.
	OriginErrorPagePassthru bool `json:"origin_error_page_passthru"`
	// A timeout value between two successive read operations to use for 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"`
	// Whether Cloudflare should respect strong ETag (entity tag) headers. If false,
	// Cloudflare converts strong ETag headers to weak ETag headers.
	RespectStrongEtags bool `json:"respect_strong_etags"`
	// When to serve stale content from cache.
	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 {
	// The browser TTL mode.
	Mode SetCacheSettingsRuleActionParametersBrowserTTLMode `json:"mode,required"`
	// The browser TTL (in seconds) if you choose the "override_origin" mode.
	Default int64                                              `json:"default"`
	JSON    setCacheSettingsRuleActionParametersBrowserTTLJSON `json:"-"`
}

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

The browser TTL mode.

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

func (SetCacheSettingsRuleActionParametersBrowserTTLMode) IsKnown

type SetCacheSettingsRuleActionParametersBrowserTTLParam

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

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 {
	// Whether to separate cached content based on the visitor's device type.
	CacheByDeviceType bool `json:"cache_by_device_type"`
	// Whether to protect from web cache deception attacks, while allowing static
	// assets to be cached.
	CacheDeceptionArmor bool `json:"cache_deception_armor"`
	// Which components of the request are included or excluded from the cache key.
	CustomKey SetCacheSettingsRuleActionParametersCacheKeyCustomKey `json:"custom_key"`
	// Whether to treat requests with the same query parameters the same, regardless of
	// the order those query parameters are in.
	IgnoreQueryStringsOrder bool                                             `json:"ignore_query_strings_order"`
	JSON                    setCacheSettingsRuleActionParametersCacheKeyJSON `json:"-"`
}

Which components of the request are included in 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 {
	// Which cookies to include in the cache key.
	Cookie SetCacheSettingsRuleActionParametersCacheKeyCustomKeyCookie `json:"cookie"`
	// Which headers to include in the cache key.
	Header SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHeader `json:"header"`
	// How to use the host in the cache key.
	Host SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHost `json:"host"`
	// Which query string parameters to include in or exclude from the cache key.
	QueryString SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryString `json:"query_string"`
	// How to use characteristics of the request user agent in the cache key.
	User SetCacheSettingsRuleActionParametersCacheKeyCustomKeyUser `json:"user"`
	JSON setCacheSettingsRuleActionParametersCacheKeyCustomKeyJSON `json:"-"`
}

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 {
	// A list of cookies to check for the presence of. The presence of these cookies is
	// included in the cache key.
	CheckPresence []string `json:"check_presence"`
	// A list of cookies to include in the cache key.
	Include []string                                                        `json:"include"`
	JSON    setCacheSettingsRuleActionParametersCacheKeyCustomKeyCookieJSON `json:"-"`
}

Which cookies to include in the cache key.

func (*SetCacheSettingsRuleActionParametersCacheKeyCustomKeyCookie) UnmarshalJSON

type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyCookieParam

type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyCookieParam struct {
	// A list of cookies to check for the presence of. The presence of these cookies is
	// included in the cache key.
	CheckPresence param.Field[[]string] `json:"check_presence"`
	// A list of cookies to include in the cache key.
	Include param.Field[[]string] `json:"include"`
}

Which cookies to include in the cache key.

func (SetCacheSettingsRuleActionParametersCacheKeyCustomKeyCookieParam) MarshalJSON

type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHeader

type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHeader struct {
	// A list of headers to check for the presence of. The presence of these headers is
	// included in the cache key.
	CheckPresence []string `json:"check_presence"`
	// A mapping of header names to a list of values. If a header is present in the
	// request and contains any of the values provided, its value is included in the
	// cache key.
	Contains map[string][]string `json:"contains"`
	// Whether to exclude the origin header in the cache key.
	ExcludeOrigin bool `json:"exclude_origin"`
	// A list of headers to include in the cache key.
	Include []string                                                        `json:"include"`
	JSON    setCacheSettingsRuleActionParametersCacheKeyCustomKeyHeaderJSON `json:"-"`
}

Which headers to include in the cache key.

func (*SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHeader) UnmarshalJSON

type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHeaderParam

type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHeaderParam struct {
	// A list of headers to check for the presence of. The presence of these headers is
	// included in the cache key.
	CheckPresence param.Field[[]string] `json:"check_presence"`
	// A mapping of header names to a list of values. If a header is present in the
	// request and contains any of the values provided, its value is included in the
	// cache key.
	Contains param.Field[map[string][]string] `json:"contains"`
	// Whether to exclude the origin header in the cache key.
	ExcludeOrigin param.Field[bool] `json:"exclude_origin"`
	// A list of headers to include in the cache key.
	Include param.Field[[]string] `json:"include"`
}

Which headers to include in the cache key.

func (SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHeaderParam) MarshalJSON

type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHost

type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHost struct {
	// Whether to use the resolved host in the cache key.
	Resolved bool                                                          `json:"resolved"`
	JSON     setCacheSettingsRuleActionParametersCacheKeyCustomKeyHostJSON `json:"-"`
}

How to use the host in the cache key.

func (*SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHost) UnmarshalJSON

type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHostParam

type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHostParam struct {
	// Whether to use the resolved host in the cache key.
	Resolved param.Field[bool] `json:"resolved"`
}

How to use the host in the cache key.

func (SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHostParam) MarshalJSON

type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyParam

type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyParam struct {
	// Which cookies to include in the cache key.
	Cookie param.Field[SetCacheSettingsRuleActionParametersCacheKeyCustomKeyCookieParam] `json:"cookie"`
	// Which headers to include in the cache key.
	Header param.Field[SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHeaderParam] `json:"header"`
	// How to use the host in the cache key.
	Host param.Field[SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHostParam] `json:"host"`
	// Which query string parameters to include in or exclude from the cache key.
	QueryString param.Field[SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringParam] `json:"query_string"`
	// How to use characteristics of the request user agent in the cache key.
	User param.Field[SetCacheSettingsRuleActionParametersCacheKeyCustomKeyUserParam] `json:"user"`
}

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

func (SetCacheSettingsRuleActionParametersCacheKeyCustomKeyParam) MarshalJSON

type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryString

type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryString struct {
	// Which query string parameters to exclude from the cache key.
	Exclude SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExclude `json:"exclude"`
	// Which query string parameters to include in the cache key.
	Include SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringInclude `json:"include"`
	JSON    setCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringJSON    `json:"-"`
}

Which query string parameters to include in or exclude from the cache key.

func (*SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryString) UnmarshalJSON

type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExclude

type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExclude struct {
	// Whether to exclude all query string parameters from the cache key.
	All SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludeAll `json:"all"`
	// A list of query string parameters to exclude from the cache key.
	List []string                                                                    `json:"list"`
	JSON setCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludeJSON `json:"-"`
}

Which query string parameters to exclude from the cache key.

func (*SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExclude) UnmarshalJSON

type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludeAll

type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludeAll bool

Whether to exclude all query string parameters from the cache key.

const (
	SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludeAllTrue SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludeAll = true
)

func (SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludeAll) IsKnown

type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludeParam

type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludeParam struct {
	// Whether to exclude all query string parameters from the cache key.
	All param.Field[SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludeAll] `json:"all"`
	// A list of query string parameters to exclude from the cache key.
	List param.Field[[]string] `json:"list"`
}

Which query string parameters to exclude from the cache key.

func (SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludeParam) MarshalJSON

type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringInclude

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

Which query string parameters to include in the cache key.

func (*SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringInclude) UnmarshalJSON

type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludeAll

type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludeAll bool

Whether to include all query string parameters in the cache key.

const (
	SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludeAllTrue SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludeAll = true
)

func (SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludeAll) IsKnown

type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludeParam

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

Which query string parameters to include in the cache key.

func (SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludeParam) MarshalJSON

type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringParam

type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringParam struct {
	// Which query string parameters to exclude from the cache key.
	Exclude param.Field[SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludeParam] `json:"exclude"`
	// Which query string parameters to include in the cache key.
	Include param.Field[SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludeParam] `json:"include"`
}

Which query string parameters to include in or exclude from the cache key.

func (SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringParam) MarshalJSON

type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyUser

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

How to use characteristics of the request user agent in the cache key.

func (*SetCacheSettingsRuleActionParametersCacheKeyCustomKeyUser) UnmarshalJSON

type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyUserParam

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

How to use characteristics of the request user agent in the cache key.

func (SetCacheSettingsRuleActionParametersCacheKeyCustomKeyUserParam) MarshalJSON

type SetCacheSettingsRuleActionParametersCacheKeyParam

type SetCacheSettingsRuleActionParametersCacheKeyParam struct {
	// Whether to separate cached content based on the visitor's device type.
	CacheByDeviceType param.Field[bool] `json:"cache_by_device_type"`
	// Whether to protect from web cache deception attacks, while allowing static
	// assets to be cached.
	CacheDeceptionArmor param.Field[bool] `json:"cache_deception_armor"`
	// Which components of the request are included or excluded from the cache key.
	CustomKey param.Field[SetCacheSettingsRuleActionParametersCacheKeyCustomKeyParam] `json:"custom_key"`
	// Whether to treat requests with the same query parameters the same, regardless of
	// the order those query parameters are in.
	IgnoreQueryStringsOrder param.Field[bool] `json:"ignore_query_strings_order"`
}

Which components of the request are included in 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 {
	// 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 storage in Cache Reserve.
	MinimumFileSize int64                                                `json:"minimum_file_size"`
	JSON            setCacheSettingsRuleActionParametersCacheReserveJSON `json:"-"`
}

Settings to determine 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 {
	// 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 storage in Cache Reserve.
	MinimumFileSize param.Field[int64] `json:"minimum_file_size"`
}

Settings to determine 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 edge TTL mode.
	Mode SetCacheSettingsRuleActionParametersEdgeTTLMode `json:"mode,required"`
	// The edge TTL (in seconds) if you choose the "override_origin" mode.
	Default int64 `json:"default"`
	// A list of TTLs to apply to specific status codes or status code ranges.
	StatusCodeTTL []SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTL `json:"status_code_ttl"`
	JSON          setCacheSettingsRuleActionParametersEdgeTTLJSON            `json:"-"`
}

How long the Cloudflare edge network should cache the response.

func (*SetCacheSettingsRuleActionParametersEdgeTTL) UnmarshalJSON

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

type SetCacheSettingsRuleActionParametersEdgeTTLMode

type SetCacheSettingsRuleActionParametersEdgeTTLMode string

The edge TTL mode.

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

func (SetCacheSettingsRuleActionParametersEdgeTTLMode) IsKnown

type SetCacheSettingsRuleActionParametersEdgeTTLParam

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

How long the Cloudflare edge network should cache the response.

func (SetCacheSettingsRuleActionParametersEdgeTTLParam) MarshalJSON

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

type SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTL

type SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTL struct {
	// The time to cache the response for (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 the cache control header with the value of "no-store".
	Value int64 `json:"value,required"`
	// A single status code to apply the TTL to.
	StatusCode int64 `json:"status_code"`
	// A range of status codes to apply the TTL to.
	StatusCodeRange SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTLStatusCodeRange `json:"status_code_range"`
	JSON            setCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTLJSON            `json:"-"`
}

func (*SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTL) UnmarshalJSON

type SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTLParam

type SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTLParam struct {
	// The time to cache the response for (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 the cache control header with the value of "no-store".
	Value param.Field[int64] `json:"value,required"`
	// A single status code to apply the TTL to.
	StatusCode param.Field[int64] `json:"status_code"`
	// A range of status codes to apply the TTL to.
	StatusCodeRange param.Field[SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTLStatusCodeRangeParam] `json:"status_code_range"`
}

func (SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTLParam) MarshalJSON

type SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTLStatusCodeRange

type SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTLStatusCodeRange struct {
	// The lower bound of the range.
	From int64 `json:"from"`
	// The upper bound of the range.
	To   int64                                                                       `json:"to"`
	JSON setCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTLStatusCodeRangeJSON `json:"-"`
}

A range of status codes to apply the TTL to.

func (*SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTLStatusCodeRange) UnmarshalJSON

type SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTLStatusCodeRangeParam

type SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTLStatusCodeRangeParam struct {
	// The lower bound of the range.
	From param.Field[int64] `json:"from"`
	// The upper bound of the range.
	To param.Field[int64] `json:"to"`
}

A range of status codes to apply the TTL to.

func (SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTLStatusCodeRangeParam) MarshalJSON

type SetCacheSettingsRuleActionParametersParam

type SetCacheSettingsRuleActionParametersParam struct {
	// A list of additional ports that caching should be enabled on.
	AdditionalCacheablePorts param.Field[[]int64] `json:"additional_cacheable_ports"`
	// 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"`
	// Whether the request's response from the 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"`
	// Which components of the request are included in or excluded from the cache key
	// Cloudflare uses to store the response in cache.
	CacheKey param.Field[SetCacheSettingsRuleActionParametersCacheKeyParam] `json:"cache_key"`
	// Settings to determine 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"`
	// How long the Cloudflare edge network should cache the response.
	EdgeTTL param.Field[SetCacheSettingsRuleActionParametersEdgeTTLParam] `json:"edge_ttl"`
	// Whether Cloudflare will aim to strictly adhere to RFC 7234.
	OriginCacheControl param.Field[bool] `json:"origin_cache_control"`
	// Whether to generate Cloudflare error pages for issues from the origin server.
	OriginErrorPagePassthru param.Field[bool] `json:"origin_error_page_passthru"`
	// A timeout value between two successive read operations to use for 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"`
	// Whether Cloudflare should respect strong ETag (entity tag) headers. If false,
	// Cloudflare converts strong ETag headers to weak ETag headers.
	RespectStrongEtags param.Field[bool] `json:"respect_strong_etags"`
	// When to serve stale content from cache.
	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 {
	// Whether Cloudflare should disable serving stale content while getting the latest
	// content from the origin.
	DisableStaleWhileUpdating bool                                               `json:"disable_stale_while_updating"`
	JSON                      setCacheSettingsRuleActionParametersServeStaleJSON `json:"-"`
}

When to serve stale content from cache.

func (*SetCacheSettingsRuleActionParametersServeStale) UnmarshalJSON

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

type SetCacheSettingsRuleActionParametersServeStaleParam

type SetCacheSettingsRuleActionParametersServeStaleParam struct {
	// Whether Cloudflare should disable serving stale content while getting the latest
	// content from the origin.
	DisableStaleWhileUpdating param.Field[bool] `json:"disable_stale_while_updating"`
}

When to serve stale content from cache.

func (SetCacheSettingsRuleActionParametersServeStaleParam) MarshalJSON

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

type SetCacheSettingsRuleExposedCredentialCheck

type SetCacheSettingsRuleExposedCredentialCheck struct {
	// An expression that selects the password used in the credentials check.
	PasswordExpression string `json:"password_expression,required"`
	// An expression that selects the user ID used in the credentials check.
	UsernameExpression string                                         `json:"username_expression,required"`
	JSON               setCacheSettingsRuleExposedCredentialCheckJSON `json:"-"`
}

Configuration for exposed credential checking.

func (*SetCacheSettingsRuleExposedCredentialCheck) UnmarshalJSON

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

type SetCacheSettingsRuleExposedCredentialCheckParam

type SetCacheSettingsRuleExposedCredentialCheckParam struct {
	// An expression that selects the password used in the credentials check.
	PasswordExpression param.Field[string] `json:"password_expression,required"`
	// An expression that selects the user ID used in the credentials check.
	UsernameExpression param.Field[string] `json:"username_expression,required"`
}

Configuration for exposed credential checking.

func (SetCacheSettingsRuleExposedCredentialCheckParam) MarshalJSON

func (r SetCacheSettingsRuleExposedCredentialCheckParam) 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"`
	// Configuration for exposed credential checking.
	ExposedCredentialCheck param.Field[SetCacheSettingsRuleExposedCredentialCheckParam] `json:"exposed_credential_check"`
	// 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"`
	// An object configuring the rule's rate limit behavior.
	Ratelimit param.Field[SetCacheSettingsRuleRatelimitParam] `json:"ratelimit"`
	// The reference of the rule (the rule's ID by default).
	Ref param.Field[string] `json:"ref"`
}

func (SetCacheSettingsRuleParam) MarshalJSON

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

type SetCacheSettingsRuleRatelimit

type SetCacheSettingsRuleRatelimit struct {
	// Characteristics of the request on which the rate limit counter will be
	// incremented.
	Characteristics []string `json:"characteristics,required"`
	// Period in seconds over which the counter is being incremented.
	Period int64 `json:"period,required"`
	// An expression that defines when the rate limit counter should be incremented. It
	// defaults to the same as the rule's expression.
	CountingExpression string `json:"counting_expression"`
	// Period of time in seconds after which the action will be disabled following its
	// first execution.
	MitigationTimeout int64 `json:"mitigation_timeout"`
	// The threshold of requests per period after which the action will be executed for
	// the first time.
	RequestsPerPeriod int64 `json:"requests_per_period"`
	// Whether counting is only performed when an origin is reached.
	RequestsToOrigin bool `json:"requests_to_origin"`
	// The score threshold per period for which the action will be executed the first
	// time.
	ScorePerPeriod int64 `json:"score_per_period"`
	// A response header name provided by the origin, which contains the score to
	// increment rate limit counter with.
	ScoreResponseHeaderName string                            `json:"score_response_header_name"`
	JSON                    setCacheSettingsRuleRatelimitJSON `json:"-"`
}

An object configuring the rule's rate limit behavior.

func (*SetCacheSettingsRuleRatelimit) UnmarshalJSON

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

type SetCacheSettingsRuleRatelimitParam

type SetCacheSettingsRuleRatelimitParam struct {
	// Characteristics of the request on which the rate limit counter will be
	// incremented.
	Characteristics param.Field[[]string] `json:"characteristics,required"`
	// Period in seconds over which the counter is being incremented.
	Period param.Field[int64] `json:"period,required"`
	// An expression that defines when the rate limit counter should be incremented. It
	// defaults to the same as the rule's expression.
	CountingExpression param.Field[string] `json:"counting_expression"`
	// Period of time in seconds after which the action will be disabled following its
	// first execution.
	MitigationTimeout param.Field[int64] `json:"mitigation_timeout"`
	// The threshold of requests per period after which the action will be executed for
	// the first time.
	RequestsPerPeriod param.Field[int64] `json:"requests_per_period"`
	// Whether counting is only performed when an origin is reached.
	RequestsToOrigin param.Field[bool] `json:"requests_to_origin"`
	// The score threshold per period for which the action will be executed the first
	// time.
	ScorePerPeriod param.Field[int64] `json:"score_per_period"`
	// A response header name provided by the origin, which contains the score to
	// increment rate limit counter with.
	ScoreResponseHeaderName param.Field[string] `json:"score_response_header_name"`
}

An object configuring the rule's rate limit behavior.

func (SetCacheSettingsRuleRatelimitParam) MarshalJSON

func (r SetCacheSettingsRuleRatelimitParam) 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"`
	// Configuration for exposed credential checking.
	ExposedCredentialCheck SetConfigRuleExposedCredentialCheck `json:"exposed_credential_check"`
	// 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"`
	// An object configuring the rule's rate limit behavior.
	Ratelimit SetConfigRuleRatelimit `json:"ratelimit"`
	// The reference of the rule (the rule's 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 {
	// Whether to enable Automatic HTTPS Rewrites.
	AutomaticHTTPSRewrites bool `json:"automatic_https_rewrites"`
	// Which file extensions to minify automatically.
	Autominify SetConfigRuleActionParametersAutominify `json:"autominify"`
	// Whether to enable Browser Integrity Check (BIC).
	BIC bool `json:"bic"`
	// Whether to disable Cloudflare Apps.
	//
	// Deprecated: Cloudflare Apps are deprected.
	DisableApps SetConfigRuleActionParametersDisableApps `json:"disable_apps"`
	// Whether to disable Pay Per Crawl.
	DisablePayPerCrawl SetConfigRuleActionParametersDisablePayPerCrawl `json:"disable_pay_per_crawl"`
	// Whether to disable Real User Monitoring (RUM).
	DisableRUM SetConfigRuleActionParametersDisableRUM `json:"disable_rum"`
	// Whether to disable Zaraz.
	DisableZaraz SetConfigRuleActionParametersDisableZaraz `json:"disable_zaraz"`
	// Whether to enable Email Obfuscation.
	EmailObfuscation bool `json:"email_obfuscation"`
	// Whether to enable Cloudflare Fonts.
	Fonts bool `json:"fonts"`
	// Whether to enable Hotlink Protection.
	HotlinkProtection bool `json:"hotlink_protection"`
	// Whether to enable Mirage.
	//
	// Deprecated: Mirage is deprecated. More information at
	// https://developers.cloudflare.com/speed/optimization/images/mirage/.
	Mirage bool `json:"mirage"`
	// Whether to enable Opportunistic Encryption.
	OpportunisticEncryption bool `json:"opportunistic_encryption"`
	// The Polish level to configure.
	Polish SetConfigRuleActionParametersPolish `json:"polish"`
	// The request body buffering mode.
	RequestBodyBuffering SetConfigRuleActionParametersRequestBodyBuffering `json:"request_body_buffering"`
	// The response body buffering mode.
	ResponseBodyBuffering SetConfigRuleActionParametersResponseBodyBuffering `json:"response_body_buffering"`
	// Whether to enable Rocket Loader.
	RocketLoader bool `json:"rocket_loader"`
	// The Security Level to configure.
	SecurityLevel SetConfigRuleActionParametersSecurityLevel `json:"security_level"`
	// Whether to enable Server-Side Excludes.
	ServerSideExcludes bool `json:"server_side_excludes"`
	// The SSL level to configure.
	SSL SetConfigRuleActionParametersSSL `json:"ssl"`
	// Whether to enable 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 {
	// Whether to minify CSS files.
	CSS bool `json:"css"`
	// Whether to minify HTML files.
	HTML bool `json:"html"`
	// Whether to minify JavaScript files.
	JS   bool                                        `json:"js"`
	JSON setConfigRuleActionParametersAutominifyJSON `json:"-"`
}

Which file extensions to minify automatically.

func (*SetConfigRuleActionParametersAutominify) UnmarshalJSON

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

type SetConfigRuleActionParametersAutominifyParam

type SetConfigRuleActionParametersAutominifyParam struct {
	// Whether to minify CSS files.
	CSS param.Field[bool] `json:"css"`
	// Whether to minify HTML files.
	HTML param.Field[bool] `json:"html"`
	// Whether to minify JavaScript files.
	JS param.Field[bool] `json:"js"`
}

Which file extensions to minify automatically.

func (SetConfigRuleActionParametersAutominifyParam) MarshalJSON

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

type SetConfigRuleActionParametersDisableApps

type SetConfigRuleActionParametersDisableApps bool

Whether to disable Cloudflare Apps.

const (
	SetConfigRuleActionParametersDisableAppsTrue SetConfigRuleActionParametersDisableApps = true
)

func (SetConfigRuleActionParametersDisableApps) IsKnown

type SetConfigRuleActionParametersDisablePayPerCrawl

type SetConfigRuleActionParametersDisablePayPerCrawl bool

Whether to disable Pay Per Crawl.

const (
	SetConfigRuleActionParametersDisablePayPerCrawlTrue SetConfigRuleActionParametersDisablePayPerCrawl = true
)

func (SetConfigRuleActionParametersDisablePayPerCrawl) IsKnown

type SetConfigRuleActionParametersDisableRUM

type SetConfigRuleActionParametersDisableRUM bool

Whether to disable Real User Monitoring (RUM).

const (
	SetConfigRuleActionParametersDisableRUMTrue SetConfigRuleActionParametersDisableRUM = true
)

func (SetConfigRuleActionParametersDisableRUM) IsKnown

type SetConfigRuleActionParametersDisableZaraz

type SetConfigRuleActionParametersDisableZaraz bool

Whether to disable Zaraz.

const (
	SetConfigRuleActionParametersDisableZarazTrue SetConfigRuleActionParametersDisableZaraz = true
)

func (SetConfigRuleActionParametersDisableZaraz) IsKnown

type SetConfigRuleActionParametersParam

type SetConfigRuleActionParametersParam struct {
	// Whether to enable Automatic HTTPS Rewrites.
	AutomaticHTTPSRewrites param.Field[bool] `json:"automatic_https_rewrites"`
	// Which file extensions to minify automatically.
	Autominify param.Field[SetConfigRuleActionParametersAutominifyParam] `json:"autominify"`
	// Whether to enable Browser Integrity Check (BIC).
	BIC param.Field[bool] `json:"bic"`
	// Whether to disable Cloudflare Apps.
	//
	// Deprecated: Cloudflare Apps are deprected.
	DisableApps param.Field[SetConfigRuleActionParametersDisableApps] `json:"disable_apps"`
	// Whether to disable Pay Per Crawl.
	DisablePayPerCrawl param.Field[SetConfigRuleActionParametersDisablePayPerCrawl] `json:"disable_pay_per_crawl"`
	// Whether to disable Real User Monitoring (RUM).
	DisableRUM param.Field[SetConfigRuleActionParametersDisableRUM] `json:"disable_rum"`
	// Whether to disable Zaraz.
	DisableZaraz param.Field[SetConfigRuleActionParametersDisableZaraz] `json:"disable_zaraz"`
	// Whether to enable Email Obfuscation.
	EmailObfuscation param.Field[bool] `json:"email_obfuscation"`
	// Whether to enable Cloudflare Fonts.
	Fonts param.Field[bool] `json:"fonts"`
	// Whether to enable Hotlink Protection.
	HotlinkProtection param.Field[bool] `json:"hotlink_protection"`
	// Whether to enable Mirage.
	//
	// Deprecated: Mirage is deprecated. More information at
	// https://developers.cloudflare.com/speed/optimization/images/mirage/.
	Mirage param.Field[bool] `json:"mirage"`
	// Whether to enable Opportunistic Encryption.
	OpportunisticEncryption param.Field[bool] `json:"opportunistic_encryption"`
	// The Polish level to configure.
	Polish param.Field[SetConfigRuleActionParametersPolish] `json:"polish"`
	// The request body buffering mode.
	RequestBodyBuffering param.Field[SetConfigRuleActionParametersRequestBodyBuffering] `json:"request_body_buffering"`
	// The response body buffering mode.
	ResponseBodyBuffering param.Field[SetConfigRuleActionParametersResponseBodyBuffering] `json:"response_body_buffering"`
	// Whether to enable Rocket Loader.
	RocketLoader param.Field[bool] `json:"rocket_loader"`
	// The Security Level to configure.
	SecurityLevel param.Field[SetConfigRuleActionParametersSecurityLevel] `json:"security_level"`
	// Whether to enable Server-Side Excludes.
	ServerSideExcludes param.Field[bool] `json:"server_side_excludes"`
	// The SSL level to configure.
	SSL param.Field[SetConfigRuleActionParametersSSL] `json:"ssl"`
	// Whether to enable 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

The Polish level to configure.

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

func (SetConfigRuleActionParametersPolish) IsKnown

type SetConfigRuleActionParametersRequestBodyBuffering added in v6.6.0

type SetConfigRuleActionParametersRequestBodyBuffering string

The request body buffering mode.

const (
	SetConfigRuleActionParametersRequestBodyBufferingNone     SetConfigRuleActionParametersRequestBodyBuffering = "none"
	SetConfigRuleActionParametersRequestBodyBufferingStandard SetConfigRuleActionParametersRequestBodyBuffering = "standard"
	SetConfigRuleActionParametersRequestBodyBufferingFull     SetConfigRuleActionParametersRequestBodyBuffering = "full"
)

func (SetConfigRuleActionParametersRequestBodyBuffering) IsKnown added in v6.6.0

type SetConfigRuleActionParametersResponseBodyBuffering added in v6.6.0

type SetConfigRuleActionParametersResponseBodyBuffering string

The response body buffering mode.

const (
	SetConfigRuleActionParametersResponseBodyBufferingNone     SetConfigRuleActionParametersResponseBodyBuffering = "none"
	SetConfigRuleActionParametersResponseBodyBufferingStandard SetConfigRuleActionParametersResponseBodyBuffering = "standard"
)

func (SetConfigRuleActionParametersResponseBodyBuffering) IsKnown added in v6.6.0

type SetConfigRuleActionParametersSSL

type SetConfigRuleActionParametersSSL string

The SSL level to configure.

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

The Security Level to configure.

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 SetConfigRuleExposedCredentialCheck

type SetConfigRuleExposedCredentialCheck struct {
	// An expression that selects the password used in the credentials check.
	PasswordExpression string `json:"password_expression,required"`
	// An expression that selects the user ID used in the credentials check.
	UsernameExpression string                                  `json:"username_expression,required"`
	JSON               setConfigRuleExposedCredentialCheckJSON `json:"-"`
}

Configuration for exposed credential checking.

func (*SetConfigRuleExposedCredentialCheck) UnmarshalJSON

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

type SetConfigRuleExposedCredentialCheckParam

type SetConfigRuleExposedCredentialCheckParam struct {
	// An expression that selects the password used in the credentials check.
	PasswordExpression param.Field[string] `json:"password_expression,required"`
	// An expression that selects the user ID used in the credentials check.
	UsernameExpression param.Field[string] `json:"username_expression,required"`
}

Configuration for exposed credential checking.

func (SetConfigRuleExposedCredentialCheckParam) MarshalJSON

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

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"`
	// Configuration for exposed credential checking.
	ExposedCredentialCheck param.Field[SetConfigRuleExposedCredentialCheckParam] `json:"exposed_credential_check"`
	// 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"`
	// An object configuring the rule's rate limit behavior.
	Ratelimit param.Field[SetConfigRuleRatelimitParam] `json:"ratelimit"`
	// The reference of the rule (the rule's ID by default).
	Ref param.Field[string] `json:"ref"`
}

func (SetConfigRuleParam) MarshalJSON

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

type SetConfigRuleRatelimit

type SetConfigRuleRatelimit struct {
	// Characteristics of the request on which the rate limit counter will be
	// incremented.
	Characteristics []string `json:"characteristics,required"`
	// Period in seconds over which the counter is being incremented.
	Period int64 `json:"period,required"`
	// An expression that defines when the rate limit counter should be incremented. It
	// defaults to the same as the rule's expression.
	CountingExpression string `json:"counting_expression"`
	// Period of time in seconds after which the action will be disabled following its
	// first execution.
	MitigationTimeout int64 `json:"mitigation_timeout"`
	// The threshold of requests per period after which the action will be executed for
	// the first time.
	RequestsPerPeriod int64 `json:"requests_per_period"`
	// Whether counting is only performed when an origin is reached.
	RequestsToOrigin bool `json:"requests_to_origin"`
	// The score threshold per period for which the action will be executed the first
	// time.
	ScorePerPeriod int64 `json:"score_per_period"`
	// A response header name provided by the origin, which contains the score to
	// increment rate limit counter with.
	ScoreResponseHeaderName string                     `json:"score_response_header_name"`
	JSON                    setConfigRuleRatelimitJSON `json:"-"`
}

An object configuring the rule's rate limit behavior.

func (*SetConfigRuleRatelimit) UnmarshalJSON

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

type SetConfigRuleRatelimitParam

type SetConfigRuleRatelimitParam struct {
	// Characteristics of the request on which the rate limit counter will be
	// incremented.
	Characteristics param.Field[[]string] `json:"characteristics,required"`
	// Period in seconds over which the counter is being incremented.
	Period param.Field[int64] `json:"period,required"`
	// An expression that defines when the rate limit counter should be incremented. It
	// defaults to the same as the rule's expression.
	CountingExpression param.Field[string] `json:"counting_expression"`
	// Period of time in seconds after which the action will be disabled following its
	// first execution.
	MitigationTimeout param.Field[int64] `json:"mitigation_timeout"`
	// The threshold of requests per period after which the action will be executed for
	// the first time.
	RequestsPerPeriod param.Field[int64] `json:"requests_per_period"`
	// Whether counting is only performed when an origin is reached.
	RequestsToOrigin param.Field[bool] `json:"requests_to_origin"`
	// The score threshold per period for which the action will be executed the first
	// time.
	ScorePerPeriod param.Field[int64] `json:"score_per_period"`
	// A response header name provided by the origin, which contains the score to
	// increment rate limit counter with.
	ScoreResponseHeaderName param.Field[string] `json:"score_response_header_name"`
}

An object configuring the rule's rate limit behavior.

func (SetConfigRuleRatelimitParam) MarshalJSON

func (r SetConfigRuleRatelimitParam) 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"`
	// Configuration for exposed credential checking.
	ExposedCredentialCheck SkipRuleExposedCredentialCheck `json:"exposed_credential_check"`
	// 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"`
	// An object configuring the rule's rate limit behavior.
	Ratelimit SkipRuleRatelimit `json:"ratelimit"`
	// The reference of the rule (the rule's 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 phase to skip the execution of. This option is only compatible with the
	// products option.
	Phase SkipRuleActionParametersPhase `json:"phase"`
	// A list of phases to skip the execution of. This option is incompatible with the
	// rulesets option.
	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 option.
	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 phase to skip the execution of. This option is only compatible with the
	// products option.
	Phase param.Field[SkipRuleActionParametersPhase] `json:"phase"`
	// A list of phases to skip the execution of. This option is incompatible with the
	// rulesets option.
	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 option.
	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 SkipRuleActionParametersPhase

type SkipRuleActionParametersPhase string

A phase to skip the execution of. This option is only compatible with the products option.

const (
	SkipRuleActionParametersPhaseCurrent SkipRuleActionParametersPhase = "current"
)

func (SkipRuleActionParametersPhase) IsKnown

func (r SkipRuleActionParametersPhase) IsKnown() bool

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 option.

const (
	SkipRuleActionParametersRulesetCurrent SkipRuleActionParametersRuleset = "current"
)

func (SkipRuleActionParametersRuleset) IsKnown

type SkipRuleExposedCredentialCheck

type SkipRuleExposedCredentialCheck struct {
	// An expression that selects the password used in the credentials check.
	PasswordExpression string `json:"password_expression,required"`
	// An expression that selects the user ID used in the credentials check.
	UsernameExpression string                             `json:"username_expression,required"`
	JSON               skipRuleExposedCredentialCheckJSON `json:"-"`
}

Configuration for exposed credential checking.

func (*SkipRuleExposedCredentialCheck) UnmarshalJSON

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

type SkipRuleExposedCredentialCheckParam

type SkipRuleExposedCredentialCheckParam struct {
	// An expression that selects the password used in the credentials check.
	PasswordExpression param.Field[string] `json:"password_expression,required"`
	// An expression that selects the user ID used in the credentials check.
	UsernameExpression param.Field[string] `json:"username_expression,required"`
}

Configuration for exposed credential checking.

func (SkipRuleExposedCredentialCheckParam) MarshalJSON

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

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"`
	// Configuration for exposed credential checking.
	ExposedCredentialCheck param.Field[SkipRuleExposedCredentialCheckParam] `json:"exposed_credential_check"`
	// 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"`
	// An object configuring the rule's rate limit behavior.
	Ratelimit param.Field[SkipRuleRatelimitParam] `json:"ratelimit"`
	// The reference of the rule (the rule's ID by default).
	Ref param.Field[string] `json:"ref"`
}

func (SkipRuleParam) MarshalJSON

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

type SkipRuleRatelimit

type SkipRuleRatelimit struct {
	// Characteristics of the request on which the rate limit counter will be
	// incremented.
	Characteristics []string `json:"characteristics,required"`
	// Period in seconds over which the counter is being incremented.
	Period int64 `json:"period,required"`
	// An expression that defines when the rate limit counter should be incremented. It
	// defaults to the same as the rule's expression.
	CountingExpression string `json:"counting_expression"`
	// Period of time in seconds after which the action will be disabled following its
	// first execution.
	MitigationTimeout int64 `json:"mitigation_timeout"`
	// The threshold of requests per period after which the action will be executed for
	// the first time.
	RequestsPerPeriod int64 `json:"requests_per_period"`
	// Whether counting is only performed when an origin is reached.
	RequestsToOrigin bool `json:"requests_to_origin"`
	// The score threshold per period for which the action will be executed the first
	// time.
	ScorePerPeriod int64 `json:"score_per_period"`
	// A response header name provided by the origin, which contains the score to
	// increment rate limit counter with.
	ScoreResponseHeaderName string                `json:"score_response_header_name"`
	JSON                    skipRuleRatelimitJSON `json:"-"`
}

An object configuring the rule's rate limit behavior.

func (*SkipRuleRatelimit) UnmarshalJSON

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

type SkipRuleRatelimitParam

type SkipRuleRatelimitParam struct {
	// Characteristics of the request on which the rate limit counter will be
	// incremented.
	Characteristics param.Field[[]string] `json:"characteristics,required"`
	// Period in seconds over which the counter is being incremented.
	Period param.Field[int64] `json:"period,required"`
	// An expression that defines when the rate limit counter should be incremented. It
	// defaults to the same as the rule's expression.
	CountingExpression param.Field[string] `json:"counting_expression"`
	// Period of time in seconds after which the action will be disabled following its
	// first execution.
	MitigationTimeout param.Field[int64] `json:"mitigation_timeout"`
	// The threshold of requests per period after which the action will be executed for
	// the first time.
	RequestsPerPeriod param.Field[int64] `json:"requests_per_period"`
	// Whether counting is only performed when an origin is reached.
	RequestsToOrigin param.Field[bool] `json:"requests_to_origin"`
	// The score threshold per period for which the action will be executed the first
	// time.
	ScorePerPeriod param.Field[int64] `json:"score_per_period"`
	// A response header name provided by the origin, which contains the score to
	// increment rate limit counter with.
	ScoreResponseHeaderName param.Field[string] `json:"score_response_header_name"`
}

An object configuring the rule's rate limit behavior.

func (SkipRuleRatelimitParam) MarshalJSON

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

type SortDirection

type SortDirection = shared.SortDirection

Direction to order DNS records in.

This is an alias to an internal type.

type Subscription

type Subscription = shared.Subscription

This is an alias to an internal type.

type SubscriptionFrequency

type SubscriptionFrequency = shared.SubscriptionFrequency

How often the subscription is renewed automatically.

This is an alias to an internal type.

type SubscriptionParam

type SubscriptionParam = shared.SubscriptionParam

This is an alias to an internal type.

type SubscriptionState

type SubscriptionState = shared.SubscriptionState

The state that the subscription is in.

This is an alias to an internal type.

type Token

type Token = shared.Token

This is an alias to an internal type.

type TokenCondition

type TokenCondition = shared.TokenCondition

This is an alias to an internal type.

type TokenConditionCIDRList

type TokenConditionCIDRList = shared.TokenConditionCIDRList

IPv4/IPv6 CIDR.

This is an alias to an internal type.

type TokenConditionCIDRListParam

type TokenConditionCIDRListParam = shared.TokenConditionCIDRListParam

IPv4/IPv6 CIDR.

This is an alias to an internal type.

type TokenConditionParam

type TokenConditionParam = shared.TokenConditionParam

This is an alias to an internal type.

type TokenConditionRequestIP

type TokenConditionRequestIP = shared.TokenConditionRequestIP

Client IP restrictions.

This is an alias to an internal type.

type TokenConditionRequestIPParam

type TokenConditionRequestIPParam = shared.TokenConditionRequestIPParam

Client IP restrictions.

This is an alias to an internal type.

type TokenParam

type TokenParam = shared.TokenParam

This is an alias to an internal type.

type TokenPolicy

type TokenPolicy = shared.TokenPolicy

This is an alias to an internal type.

type TokenPolicyEffect

type TokenPolicyEffect = shared.TokenPolicyEffect

Allow or deny operations against the resources.

This is an alias to an internal type.

type TokenPolicyParam

type TokenPolicyParam = shared.TokenPolicyParam

This is an alias to an internal type.

type TokenPolicyPermissionGroup

type TokenPolicyPermissionGroup = shared.TokenPolicyPermissionGroup

A named group of permissions that map to a group of operations against resources.

This is an alias to an internal type.

type TokenPolicyPermissionGroupParam

type TokenPolicyPermissionGroupParam = shared.TokenPolicyPermissionGroupParam

A named group of permissions that map to a group of operations against resources.

This is an alias to an internal type.

type TokenPolicyPermissionGroupsMeta

type TokenPolicyPermissionGroupsMeta = shared.TokenPolicyPermissionGroupsMeta

Attributes associated to the permission group.

This is an alias to an internal type.

type TokenPolicyPermissionGroupsMetaParam

type TokenPolicyPermissionGroupsMetaParam = shared.TokenPolicyPermissionGroupsMetaParam

Attributes associated to the permission group.

This is an alias to an internal type.

type TokenPolicyResourcesIAMResourcesTypeObjectNested

type TokenPolicyResourcesIAMResourcesTypeObjectNested = shared.TokenPolicyResourcesIAMResourcesTypeObjectNested

Map of nested resource permissions

This is an alias to an internal type.

type TokenPolicyResourcesIAMResourcesTypeObjectNestedParam

type TokenPolicyResourcesIAMResourcesTypeObjectNestedParam = shared.TokenPolicyResourcesIAMResourcesTypeObjectNestedParam

Map of nested resource permissions

This is an alias to an internal type.

type TokenPolicyResourcesIAMResourcesTypeObjectString

type TokenPolicyResourcesIAMResourcesTypeObjectString = shared.TokenPolicyResourcesIAMResourcesTypeObjectString

Map of simple string resource permissions

This is an alias to an internal type.

type TokenPolicyResourcesIAMResourcesTypeObjectStringParam

type TokenPolicyResourcesIAMResourcesTypeObjectStringParam = shared.TokenPolicyResourcesIAMResourcesTypeObjectStringParam

Map of simple string resource permissions

This is an alias to an internal type.

type TokenPolicyResourcesUnion

type TokenPolicyResourcesUnion = shared.TokenPolicyResourcesUnion

A list of resource names that the policy applies to.

This is an alias to an internal type.

type TokenPolicyResourcesUnionParam

type TokenPolicyResourcesUnionParam = shared.TokenPolicyResourcesUnionParam

A list of resource names that the policy applies to.

This is an alias to an internal type.

type TokenStatus

type TokenStatus = shared.TokenStatus

Status of the token.

This is an alias to an internal type.

type TokenValue

type TokenValue = shared.TokenValue

The token value.

This is an alias to an internal type.

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 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 VersionGetResponseRulesAction `json:"action"`
	// This field can have the runtime type of [BlockRuleActionParameters],
	// [interface{}], [CompressResponseRuleActionParameters],
	// [ExecuteRuleActionParameters], [LogCustomFieldRuleActionParameters],
	// [RedirectRuleActionParameters], [RewriteRuleActionParameters],
	// [RouteRuleActionParameters], [ScoreRuleActionParameters],
	// [ServeErrorRuleActionParameters], [SetCacheSettingsRuleActionParameters],
	// [SetConfigRuleActionParameters], [SkipRuleActionParameters].
	ActionParameters interface{} `json:"action_parameters"`
	// This field can have the runtime type of [[]string].
	Categories interface{} `json:"categories"`
	// An informative description of the rule.
	Description string `json:"description"`
	// Whether the rule should be executed.
	Enabled bool `json:"enabled"`
	// This field can have the runtime type of [BlockRuleExposedCredentialCheck],
	// [VersionGetResponseRulesRulesetsChallengeRuleExposedCredentialCheck],
	// [CompressResponseRuleExposedCredentialCheck],
	// [DDoSDynamicRuleExposedCredentialCheck], [ExecuteRuleExposedCredentialCheck],
	// [ForceConnectionCloseRuleExposedCredentialCheck],
	// [VersionGetResponseRulesRulesetsJSChallengeRuleExposedCredentialCheck],
	// [LogRuleExposedCredentialCheck], [LogCustomFieldRuleExposedCredentialCheck],
	// [ManagedChallengeRuleExposedCredentialCheck],
	// [RedirectRuleExposedCredentialCheck], [RewriteRuleExposedCredentialCheck],
	// [RouteRuleExposedCredentialCheck], [ScoreRuleExposedCredentialCheck],
	// [ServeErrorRuleExposedCredentialCheck],
	// [SetCacheSettingsRuleExposedCredentialCheck],
	// [SetConfigRuleExposedCredentialCheck], [SkipRuleExposedCredentialCheck].
	ExposedCredentialCheck interface{} `json:"exposed_credential_check"`
	// 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"`
	// This field can have the runtime type of [BlockRuleRatelimit],
	// [VersionGetResponseRulesRulesetsChallengeRuleRatelimit],
	// [CompressResponseRuleRatelimit], [DDoSDynamicRuleRatelimit],
	// [ExecuteRuleRatelimit], [ForceConnectionCloseRuleRatelimit],
	// [VersionGetResponseRulesRulesetsJSChallengeRuleRatelimit], [LogRuleRatelimit],
	// [LogCustomFieldRuleRatelimit], [ManagedChallengeRuleRatelimit],
	// [RedirectRuleRatelimit], [RewriteRuleRatelimit], [RouteRuleRatelimit],
	// [ScoreRuleRatelimit], [ServeErrorRuleRatelimit],
	// [SetCacheSettingsRuleRatelimit], [SetConfigRuleRatelimit], [SkipRuleRatelimit].
	Ratelimit interface{} `json:"ratelimit"`
	// The reference of the rule (the rule's ID by default).
	Ref  string                     `json:"ref"`
	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"
	VersionGetResponseRulesActionDDoSDynamic          VersionGetResponseRulesAction = "ddos_dynamic"
	VersionGetResponseRulesActionExecute              VersionGetResponseRulesAction = "execute"
	VersionGetResponseRulesActionForceConnectionClose VersionGetResponseRulesAction = "force_connection_close"
	VersionGetResponseRulesActionJSChallenge          VersionGetResponseRulesAction = "js_challenge"
	VersionGetResponseRulesActionLog                  VersionGetResponseRulesAction = "log"
	VersionGetResponseRulesActionLogCustomField       VersionGetResponseRulesAction = "log_custom_field"
	VersionGetResponseRulesActionManagedChallenge     VersionGetResponseRulesAction = "managed_challenge"
	VersionGetResponseRulesActionRedirect             VersionGetResponseRulesAction = "redirect"
	VersionGetResponseRulesActionRewrite              VersionGetResponseRulesAction = "rewrite"
	VersionGetResponseRulesActionRoute                VersionGetResponseRulesAction = "route"
	VersionGetResponseRulesActionScore                VersionGetResponseRulesAction = "score"
	VersionGetResponseRulesActionServeError           VersionGetResponseRulesAction = "serve_error"
	VersionGetResponseRulesActionSetCacheSettings     VersionGetResponseRulesAction = "set_cache_settings"
	VersionGetResponseRulesActionSetConfig            VersionGetResponseRulesAction = "set_config"
	VersionGetResponseRulesActionSkip                 VersionGetResponseRulesAction = "skip"
)

func (VersionGetResponseRulesAction) IsKnown

func (r VersionGetResponseRulesAction) IsKnown() bool

type VersionGetResponseRulesRulesetsChallengeRule

type VersionGetResponseRulesRulesetsChallengeRule 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 VersionGetResponseRulesRulesetsChallengeRuleAction `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"`
	// Configuration for exposed credential checking.
	ExposedCredentialCheck VersionGetResponseRulesRulesetsChallengeRuleExposedCredentialCheck `json:"exposed_credential_check"`
	// 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"`
	// An object configuring the rule's rate limit behavior.
	Ratelimit VersionGetResponseRulesRulesetsChallengeRuleRatelimit `json:"ratelimit"`
	// The reference of the rule (the rule's ID by default).
	Ref  string                                           `json:"ref"`
	JSON versionGetResponseRulesRulesetsChallengeRuleJSON `json:"-"`
}

func (*VersionGetResponseRulesRulesetsChallengeRule) UnmarshalJSON

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

type VersionGetResponseRulesRulesetsChallengeRuleAction

type VersionGetResponseRulesRulesetsChallengeRuleAction string

The action to perform when the rule matches.

const (
	VersionGetResponseRulesRulesetsChallengeRuleActionChallenge VersionGetResponseRulesRulesetsChallengeRuleAction = "challenge"
)

func (VersionGetResponseRulesRulesetsChallengeRuleAction) IsKnown

type VersionGetResponseRulesRulesetsChallengeRuleExposedCredentialCheck

type VersionGetResponseRulesRulesetsChallengeRuleExposedCredentialCheck struct {
	// An expression that selects the password used in the credentials check.
	PasswordExpression string `json:"password_expression,required"`
	// An expression that selects the user ID used in the credentials check.
	UsernameExpression string                                                                 `json:"username_expression,required"`
	JSON               versionGetResponseRulesRulesetsChallengeRuleExposedCredentialCheckJSON `json:"-"`
}

Configuration for exposed credential checking.

func (*VersionGetResponseRulesRulesetsChallengeRuleExposedCredentialCheck) UnmarshalJSON

type VersionGetResponseRulesRulesetsChallengeRuleRatelimit

type VersionGetResponseRulesRulesetsChallengeRuleRatelimit struct {
	// Characteristics of the request on which the rate limit counter will be
	// incremented.
	Characteristics []string `json:"characteristics,required"`
	// Period in seconds over which the counter is being incremented.
	Period int64 `json:"period,required"`
	// An expression that defines when the rate limit counter should be incremented. It
	// defaults to the same as the rule's expression.
	CountingExpression string `json:"counting_expression"`
	// Period of time in seconds after which the action will be disabled following its
	// first execution.
	MitigationTimeout int64 `json:"mitigation_timeout"`
	// The threshold of requests per period after which the action will be executed for
	// the first time.
	RequestsPerPeriod int64 `json:"requests_per_period"`
	// Whether counting is only performed when an origin is reached.
	RequestsToOrigin bool `json:"requests_to_origin"`
	// The score threshold per period for which the action will be executed the first
	// time.
	ScorePerPeriod int64 `json:"score_per_period"`
	// A response header name provided by the origin, which contains the score to
	// increment rate limit counter with.
	ScoreResponseHeaderName string                                                    `json:"score_response_header_name"`
	JSON                    versionGetResponseRulesRulesetsChallengeRuleRatelimitJSON `json:"-"`
}

An object configuring the rule's rate limit behavior.

func (*VersionGetResponseRulesRulesetsChallengeRuleRatelimit) UnmarshalJSON

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

type VersionGetResponseRulesRulesetsJSChallengeRule

type VersionGetResponseRulesRulesetsJSChallengeRule 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 VersionGetResponseRulesRulesetsJSChallengeRuleAction `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"`
	// Configuration for exposed credential checking.
	ExposedCredentialCheck VersionGetResponseRulesRulesetsJSChallengeRuleExposedCredentialCheck `json:"exposed_credential_check"`
	// 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"`
	// An object configuring the rule's rate limit behavior.
	Ratelimit VersionGetResponseRulesRulesetsJSChallengeRuleRatelimit `json:"ratelimit"`
	// The reference of the rule (the rule's ID by default).
	Ref  string                                             `json:"ref"`
	JSON versionGetResponseRulesRulesetsJSChallengeRuleJSON `json:"-"`
}

func (*VersionGetResponseRulesRulesetsJSChallengeRule) UnmarshalJSON

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

type VersionGetResponseRulesRulesetsJSChallengeRuleAction

type VersionGetResponseRulesRulesetsJSChallengeRuleAction string

The action to perform when the rule matches.

const (
	VersionGetResponseRulesRulesetsJSChallengeRuleActionJSChallenge VersionGetResponseRulesRulesetsJSChallengeRuleAction = "js_challenge"
)

func (VersionGetResponseRulesRulesetsJSChallengeRuleAction) IsKnown

type VersionGetResponseRulesRulesetsJSChallengeRuleExposedCredentialCheck

type VersionGetResponseRulesRulesetsJSChallengeRuleExposedCredentialCheck struct {
	// An expression that selects the password used in the credentials check.
	PasswordExpression string `json:"password_expression,required"`
	// An expression that selects the user ID used in the credentials check.
	UsernameExpression string                                                                   `json:"username_expression,required"`
	JSON               versionGetResponseRulesRulesetsJSChallengeRuleExposedCredentialCheckJSON `json:"-"`
}

Configuration for exposed credential checking.

func (*VersionGetResponseRulesRulesetsJSChallengeRuleExposedCredentialCheck) UnmarshalJSON

type VersionGetResponseRulesRulesetsJSChallengeRuleRatelimit

type VersionGetResponseRulesRulesetsJSChallengeRuleRatelimit struct {
	// Characteristics of the request on which the rate limit counter will be
	// incremented.
	Characteristics []string `json:"characteristics,required"`
	// Period in seconds over which the counter is being incremented.
	Period int64 `json:"period,required"`
	// An expression that defines when the rate limit counter should be incremented. It
	// defaults to the same as the rule's expression.
	CountingExpression string `json:"counting_expression"`
	// Period of time in seconds after which the action will be disabled following its
	// first execution.
	MitigationTimeout int64 `json:"mitigation_timeout"`
	// The threshold of requests per period after which the action will be executed for
	// the first time.
	RequestsPerPeriod int64 `json:"requests_per_period"`
	// Whether counting is only performed when an origin is reached.
	RequestsToOrigin bool `json:"requests_to_origin"`
	// The score threshold per period for which the action will be executed the first
	// time.
	ScorePerPeriod int64 `json:"score_per_period"`
	// A response header name provided by the origin, which contains the score to
	// increment rate limit counter with.
	ScoreResponseHeaderName string                                                      `json:"score_response_header_name"`
	JSON                    versionGetResponseRulesRulesetsJSChallengeRuleRatelimitJSON `json:"-"`
}

An object configuring the rule's rate limit behavior.

func (*VersionGetResponseRulesRulesetsJSChallengeRuleRatelimit) UnmarshalJSON

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

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

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

type VersionService

type VersionService struct {
	Options []option.RequestOption
}

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