firewall

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 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 CloudflareTunnelTunTypeCNI = shared.CloudflareTunnelTunTypeCNI

This is an alias to an internal value.

View Source
const CloudflareTunnelTunTypeCfdTunnel = shared.CloudflareTunnelTunTypeCfdTunnel

This is an alias to an internal value.

View Source
const CloudflareTunnelTunTypeGRE = shared.CloudflareTunnelTunTypeGRE

This is an alias to an internal value.

View Source
const CloudflareTunnelTunTypeIPSec = shared.CloudflareTunnelTunTypeIPSec

This is an alias to an internal value.

View Source
const CloudflareTunnelTunTypeWARPConnector = shared.CloudflareTunnelTunTypeWARPConnector

This is an alias to an internal value.

Variables

This section is empty.

Functions

This section is empty.

Types

type ASN added in v2.1.0

type ASN = shared.ASN

This is an alias to an internal type.

type ASNConfigurationParam

type ASNConfigurationParam struct {
	// The configuration target. You must set the target to `asn` when specifying an
	// Autonomous System Number (ASN) in the rule.
	Target param.Field[ASNConfigurationTarget] `json:"target"`
	// The AS number to match.
	Value param.Field[string] `json:"value"`
}

func (ASNConfigurationParam) MarshalJSON

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

type ASNConfigurationTarget

type ASNConfigurationTarget string

The configuration target. You must set the target to `asn` when specifying an Autonomous System Number (ASN) in the rule.

const (
	ASNConfigurationTargetASN ASNConfigurationTarget = "asn"
)

func (ASNConfigurationTarget) IsKnown

func (r ASNConfigurationTarget) IsKnown() bool

type ASNParam added in v2.1.0

type ASNParam = shared.ASNParam

This is an alias to an internal type.

type AccessRuleCIDRConfigurationParam

type AccessRuleCIDRConfigurationParam struct {
	// The configuration target. You must set the target to `ip_range` when specifying
	// an IP address range in the rule.
	Target param.Field[AccessRuleCIDRConfigurationTarget] `json:"target"`
	// The IP address range to match. You can only use prefix lengths `/16` and `/24`
	// for IPv4 ranges, and prefix lengths `/32`, `/48`, and `/64` for IPv6 ranges.
	Value param.Field[string] `json:"value"`
}

func (AccessRuleCIDRConfigurationParam) MarshalJSON

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

type AccessRuleCIDRConfigurationTarget

type AccessRuleCIDRConfigurationTarget string

The configuration target. You must set the target to `ip_range` when specifying an IP address range in the rule.

const (
	AccessRuleCIDRConfigurationTargetIPRange AccessRuleCIDRConfigurationTarget = "ip_range"
)

func (AccessRuleCIDRConfigurationTarget) IsKnown

type AccessRuleDeleteParams

type AccessRuleDeleteParams struct {
	Body interface{} `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 (AccessRuleDeleteParams) MarshalJSON

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

type AccessRuleDeleteResponse

type AccessRuleDeleteResponse struct {
	// Identifier
	ID   string                       `json:"id,required"`
	JSON accessRuleDeleteResponseJSON `json:"-"`
}

func (*AccessRuleDeleteResponse) UnmarshalJSON

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

type AccessRuleDeleteResponseEnvelope

type AccessRuleDeleteResponseEnvelope struct {
	Errors   []shared.ResponseInfo    `json:"errors,required"`
	Messages []shared.ResponseInfo    `json:"messages,required"`
	Result   AccessRuleDeleteResponse `json:"result,required,nullable"`
	// Whether the API call was successful
	Success AccessRuleDeleteResponseEnvelopeSuccess `json:"success,required"`
	JSON    accessRuleDeleteResponseEnvelopeJSON    `json:"-"`
}

func (*AccessRuleDeleteResponseEnvelope) UnmarshalJSON

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

type AccessRuleDeleteResponseEnvelopeSuccess

type AccessRuleDeleteResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	AccessRuleDeleteResponseEnvelopeSuccessTrue AccessRuleDeleteResponseEnvelopeSuccess = true
)

func (AccessRuleDeleteResponseEnvelopeSuccess) IsKnown

type AccessRuleEditParams

type AccessRuleEditParams struct {
	// The rule configuration.
	Configuration param.Field[AccessRuleEditParamsConfigurationUnion] `json:"configuration,required"`
	// The action to apply to a matched request.
	Mode param.Field[AccessRuleEditParamsMode] `json:"mode,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 summary of the rule, typically used as a reminder or explanation.
	Notes param.Field[string] `json:"notes"`
}

func (AccessRuleEditParams) MarshalJSON

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

type AccessRuleEditParamsConfiguration

type AccessRuleEditParamsConfiguration struct {
	// The configuration target. You must set the target to `ip` when specifying an IP
	// address in the rule.
	Target param.Field[AccessRuleEditParamsConfigurationTarget] `json:"target"`
	// The IP address to match. This address will be compared to the IP address of
	// incoming requests.
	Value param.Field[string] `json:"value"`
}

The rule configuration.

func (AccessRuleEditParamsConfiguration) MarshalJSON

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

type AccessRuleEditParamsConfigurationTarget

type AccessRuleEditParamsConfigurationTarget string

The configuration target. You must set the target to `ip` when specifying an IP address in the rule.

const (
	AccessRuleEditParamsConfigurationTargetIP      AccessRuleEditParamsConfigurationTarget = "ip"
	AccessRuleEditParamsConfigurationTargetIp6     AccessRuleEditParamsConfigurationTarget = "ip6"
	AccessRuleEditParamsConfigurationTargetIPRange AccessRuleEditParamsConfigurationTarget = "ip_range"
	AccessRuleEditParamsConfigurationTargetASN     AccessRuleEditParamsConfigurationTarget = "asn"
	AccessRuleEditParamsConfigurationTargetCountry AccessRuleEditParamsConfigurationTarget = "country"
)

func (AccessRuleEditParamsConfigurationTarget) IsKnown

type AccessRuleEditParamsMode

type AccessRuleEditParamsMode string

The action to apply to a matched request.

const (
	AccessRuleEditParamsModeBlock            AccessRuleEditParamsMode = "block"
	AccessRuleEditParamsModeChallenge        AccessRuleEditParamsMode = "challenge"
	AccessRuleEditParamsModeWhitelist        AccessRuleEditParamsMode = "whitelist"
	AccessRuleEditParamsModeJSChallenge      AccessRuleEditParamsMode = "js_challenge"
	AccessRuleEditParamsModeManagedChallenge AccessRuleEditParamsMode = "managed_challenge"
)

func (AccessRuleEditParamsMode) IsKnown

func (r AccessRuleEditParamsMode) IsKnown() bool

type AccessRuleEditResponseEnvelope

type AccessRuleEditResponseEnvelope struct {
	Errors   []shared.ResponseInfo       `json:"errors,required"`
	Messages []shared.ResponseInfo       `json:"messages,required"`
	Result   AccessRuleEditResponseUnion `json:"result,required"`
	// Whether the API call was successful
	Success AccessRuleEditResponseEnvelopeSuccess `json:"success,required"`
	JSON    accessRuleEditResponseEnvelopeJSON    `json:"-"`
}

func (*AccessRuleEditResponseEnvelope) UnmarshalJSON

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

type AccessRuleEditResponseEnvelopeSuccess

type AccessRuleEditResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	AccessRuleEditResponseEnvelopeSuccessTrue AccessRuleEditResponseEnvelopeSuccess = true
)

func (AccessRuleEditResponseEnvelopeSuccess) IsKnown

type AccessRuleEditResponseUnion

type AccessRuleEditResponseUnion interface {
	ImplementsFirewallAccessRuleEditResponseUnion()
}

Union satisfied by firewall.AccessRuleEditResponseUnknown or shared.UnionString.

type AccessRuleGetParams

type AccessRuleGetParams 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 AccessRuleGetResponseEnvelope

type AccessRuleGetResponseEnvelope struct {
	Errors   []shared.ResponseInfo      `json:"errors,required"`
	Messages []shared.ResponseInfo      `json:"messages,required"`
	Result   AccessRuleGetResponseUnion `json:"result,required"`
	// Whether the API call was successful
	Success AccessRuleGetResponseEnvelopeSuccess `json:"success,required"`
	JSON    accessRuleGetResponseEnvelopeJSON    `json:"-"`
}

func (*AccessRuleGetResponseEnvelope) UnmarshalJSON

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

type AccessRuleGetResponseEnvelopeSuccess

type AccessRuleGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	AccessRuleGetResponseEnvelopeSuccessTrue AccessRuleGetResponseEnvelopeSuccess = true
)

func (AccessRuleGetResponseEnvelopeSuccess) IsKnown

type AccessRuleGetResponseUnion

type AccessRuleGetResponseUnion interface {
	ImplementsFirewallAccessRuleGetResponseUnion()
}

Union satisfied by firewall.AccessRuleGetResponseUnknown or shared.UnionString.

type AccessRuleIPConfigurationParam

type AccessRuleIPConfigurationParam struct {
	// The configuration target. You must set the target to `ip` when specifying an IP
	// address in the rule.
	Target param.Field[AccessRuleIPConfigurationTarget] `json:"target"`
	// The IP address to match. This address will be compared to the IP address of
	// incoming requests.
	Value param.Field[string] `json:"value"`
}

func (AccessRuleIPConfigurationParam) MarshalJSON

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

type AccessRuleIPConfigurationTarget

type AccessRuleIPConfigurationTarget string

The configuration target. You must set the target to `ip` when specifying an IP address in the rule.

const (
	AccessRuleIPConfigurationTargetIP AccessRuleIPConfigurationTarget = "ip"
)

func (AccessRuleIPConfigurationTarget) IsKnown

type AccessRuleListParams

type AccessRuleListParams 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 direction used to sort returned rules.
	Direction     param.Field[AccessRuleListParamsDirection]     `query:"direction"`
	EgsPagination param.Field[AccessRuleListParamsEgsPagination] `query:"egs-pagination"`
	Filters       param.Field[AccessRuleListParamsFilters]       `query:"filters"`
	// The field used to sort returned rules.
	Order param.Field[AccessRuleListParamsOrder] `query:"order"`
	// Requested page within paginated list of results.
	Page param.Field[float64] `query:"page"`
	// Maximum number of results requested.
	PerPage param.Field[float64] `query:"per_page"`
}

func (AccessRuleListParams) URLQuery

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

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

type AccessRuleListParamsDirection

type AccessRuleListParamsDirection string

The direction used to sort returned rules.

const (
	AccessRuleListParamsDirectionAsc  AccessRuleListParamsDirection = "asc"
	AccessRuleListParamsDirectionDesc AccessRuleListParamsDirection = "desc"
)

func (AccessRuleListParamsDirection) IsKnown

func (r AccessRuleListParamsDirection) IsKnown() bool

type AccessRuleListParamsEgsPagination

type AccessRuleListParamsEgsPagination struct {
	Json param.Field[AccessRuleListParamsEgsPaginationJson] `query:"json"`
}

func (AccessRuleListParamsEgsPagination) URLQuery

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

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

type AccessRuleListParamsEgsPaginationJson

type AccessRuleListParamsEgsPaginationJson struct {
	// The page number of paginated results.
	Page param.Field[float64] `query:"page"`
	// The maximum number of results per page. You can only set the value to `1` or to
	// a multiple of 5 such as `5`, `10`, `15`, or `20`.
	PerPage param.Field[float64] `query:"per_page"`
}

func (AccessRuleListParamsEgsPaginationJson) URLQuery

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

type AccessRuleListParamsFilters

type AccessRuleListParamsFilters struct {
	// The target to search in existing rules.
	ConfigurationTarget param.Field[AccessRuleListParamsFiltersConfigurationTarget] `query:"configuration.target"`
	// The target value to search for in existing rules: an IP address, an IP address
	// range, or a country code, depending on the provided `configuration.target`.
	// Notes: You can search for a single IPv4 address, an IP address range with a
	// subnet of '/16' or '/24', or a two-letter ISO-3166-1 alpha-2 country code.
	ConfigurationValue param.Field[string] `query:"configuration.value"`
	// When set to `all`, all the search requirements must match. When set to `any`,
	// only one of the search requirements has to match.
	Match param.Field[AccessRuleListParamsFiltersMatch] `query:"match"`
	// The action to apply to a matched request.
	Mode param.Field[AccessRuleListParamsFiltersMode] `query:"mode"`
	// The string to search for in the notes of existing IP Access rules. Notes: For
	// example, the string 'attack' would match IP Access rules with notes 'Attack
	// 26/02' and 'Attack 27/02'. The search is case insensitive.
	Notes param.Field[string] `query:"notes"`
}

func (AccessRuleListParamsFilters) URLQuery

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

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

type AccessRuleListParamsFiltersConfigurationTarget

type AccessRuleListParamsFiltersConfigurationTarget string

The target to search in existing rules.

const (
	AccessRuleListParamsFiltersConfigurationTargetIP      AccessRuleListParamsFiltersConfigurationTarget = "ip"
	AccessRuleListParamsFiltersConfigurationTargetIPRange AccessRuleListParamsFiltersConfigurationTarget = "ip_range"
	AccessRuleListParamsFiltersConfigurationTargetASN     AccessRuleListParamsFiltersConfigurationTarget = "asn"
	AccessRuleListParamsFiltersConfigurationTargetCountry AccessRuleListParamsFiltersConfigurationTarget = "country"
)

func (AccessRuleListParamsFiltersConfigurationTarget) IsKnown

type AccessRuleListParamsFiltersMatch

type AccessRuleListParamsFiltersMatch string

When set to `all`, all the search requirements must match. When set to `any`, only one of the search requirements has to match.

const (
	AccessRuleListParamsFiltersMatchAny AccessRuleListParamsFiltersMatch = "any"
	AccessRuleListParamsFiltersMatchAll AccessRuleListParamsFiltersMatch = "all"
)

func (AccessRuleListParamsFiltersMatch) IsKnown

type AccessRuleListParamsFiltersMode

type AccessRuleListParamsFiltersMode string

The action to apply to a matched request.

const (
	AccessRuleListParamsFiltersModeBlock            AccessRuleListParamsFiltersMode = "block"
	AccessRuleListParamsFiltersModeChallenge        AccessRuleListParamsFiltersMode = "challenge"
	AccessRuleListParamsFiltersModeWhitelist        AccessRuleListParamsFiltersMode = "whitelist"
	AccessRuleListParamsFiltersModeJSChallenge      AccessRuleListParamsFiltersMode = "js_challenge"
	AccessRuleListParamsFiltersModeManagedChallenge AccessRuleListParamsFiltersMode = "managed_challenge"
)

func (AccessRuleListParamsFiltersMode) IsKnown

type AccessRuleListParamsOrder

type AccessRuleListParamsOrder string

The field used to sort returned rules.

const (
	AccessRuleListParamsOrderConfigurationTarget AccessRuleListParamsOrder = "configuration.target"
	AccessRuleListParamsOrderConfigurationValue  AccessRuleListParamsOrder = "configuration.value"
	AccessRuleListParamsOrderMode                AccessRuleListParamsOrder = "mode"
)

func (AccessRuleListParamsOrder) IsKnown

func (r AccessRuleListParamsOrder) IsKnown() bool

type AccessRuleListResponse

type AccessRuleListResponse = interface{}

type AccessRuleNewParams

type AccessRuleNewParams struct {
	// The rule configuration.
	Configuration param.Field[AccessRuleNewParamsConfigurationUnion] `json:"configuration,required"`
	// The action to apply to a matched request.
	Mode param.Field[AccessRuleNewParamsMode] `json:"mode,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 summary of the rule, typically used as a reminder or explanation.
	Notes param.Field[string] `json:"notes"`
}

func (AccessRuleNewParams) MarshalJSON

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

type AccessRuleNewParamsConfiguration

type AccessRuleNewParamsConfiguration struct {
	// The configuration target. You must set the target to `ip` when specifying an IP
	// address in the rule.
	Target param.Field[AccessRuleNewParamsConfigurationTarget] `json:"target"`
	// The IP address to match. This address will be compared to the IP address of
	// incoming requests.
	Value param.Field[string] `json:"value"`
}

The rule configuration.

func (AccessRuleNewParamsConfiguration) MarshalJSON

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

type AccessRuleNewParamsConfigurationTarget

type AccessRuleNewParamsConfigurationTarget string

The configuration target. You must set the target to `ip` when specifying an IP address in the rule.

const (
	AccessRuleNewParamsConfigurationTargetIP      AccessRuleNewParamsConfigurationTarget = "ip"
	AccessRuleNewParamsConfigurationTargetIp6     AccessRuleNewParamsConfigurationTarget = "ip6"
	AccessRuleNewParamsConfigurationTargetIPRange AccessRuleNewParamsConfigurationTarget = "ip_range"
	AccessRuleNewParamsConfigurationTargetASN     AccessRuleNewParamsConfigurationTarget = "asn"
	AccessRuleNewParamsConfigurationTargetCountry AccessRuleNewParamsConfigurationTarget = "country"
)

func (AccessRuleNewParamsConfigurationTarget) IsKnown

type AccessRuleNewParamsMode

type AccessRuleNewParamsMode string

The action to apply to a matched request.

const (
	AccessRuleNewParamsModeBlock            AccessRuleNewParamsMode = "block"
	AccessRuleNewParamsModeChallenge        AccessRuleNewParamsMode = "challenge"
	AccessRuleNewParamsModeWhitelist        AccessRuleNewParamsMode = "whitelist"
	AccessRuleNewParamsModeJSChallenge      AccessRuleNewParamsMode = "js_challenge"
	AccessRuleNewParamsModeManagedChallenge AccessRuleNewParamsMode = "managed_challenge"
)

func (AccessRuleNewParamsMode) IsKnown

func (r AccessRuleNewParamsMode) IsKnown() bool

type AccessRuleNewResponseEnvelope

type AccessRuleNewResponseEnvelope struct {
	Errors   []shared.ResponseInfo      `json:"errors,required"`
	Messages []shared.ResponseInfo      `json:"messages,required"`
	Result   AccessRuleNewResponseUnion `json:"result,required"`
	// Whether the API call was successful
	Success AccessRuleNewResponseEnvelopeSuccess `json:"success,required"`
	JSON    accessRuleNewResponseEnvelopeJSON    `json:"-"`
}

func (*AccessRuleNewResponseEnvelope) UnmarshalJSON

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

type AccessRuleNewResponseEnvelopeSuccess

type AccessRuleNewResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	AccessRuleNewResponseEnvelopeSuccessTrue AccessRuleNewResponseEnvelopeSuccess = true
)

func (AccessRuleNewResponseEnvelopeSuccess) IsKnown

type AccessRuleNewResponseUnion

type AccessRuleNewResponseUnion interface {
	ImplementsFirewallAccessRuleNewResponseUnion()
}

Union satisfied by firewall.AccessRuleNewResponseUnknown or shared.UnionString.

type AccessRuleService

type AccessRuleService struct {
	Options []option.RequestOption
}

AccessRuleService 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 NewAccessRuleService method instead.

func NewAccessRuleService

func NewAccessRuleService(opts ...option.RequestOption) (r *AccessRuleService)

NewAccessRuleService 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 (*AccessRuleService) Delete

func (r *AccessRuleService) Delete(ctx context.Context, identifier interface{}, params AccessRuleDeleteParams, opts ...option.RequestOption) (res *AccessRuleDeleteResponse, err error)

Deletes an existing IP Access rule defined.

Note: This operation will affect all zones in the account or zone.

func (*AccessRuleService) Edit

func (r *AccessRuleService) Edit(ctx context.Context, identifier interface{}, params AccessRuleEditParams, opts ...option.RequestOption) (res *AccessRuleEditResponseUnion, err error)

Updates an IP Access rule defined.

Note: This operation will affect all zones in the account or zone.

func (*AccessRuleService) Get

func (r *AccessRuleService) Get(ctx context.Context, identifier interface{}, query AccessRuleGetParams, opts ...option.RequestOption) (res *AccessRuleGetResponseUnion, err error)

Fetches the details of an IP Access rule defined.

func (*AccessRuleService) List

Fetches IP Access rules of an account or zone. These rules apply to all the zones in the account or zone. You can filter the results using several optional parameters.

func (*AccessRuleService) ListAutoPaging

Fetches IP Access rules of an account or zone. These rules apply to all the zones in the account or zone. You can filter the results using several optional parameters.

func (*AccessRuleService) New

Creates a new IP Access rule for an account or zone. The rule will apply to all zones in the account or zone.

Note: To create an IP Access rule that applies to a single zone, refer to the [IP Access rules for a zone](#ip-access-rules-for-a-zone) endpoints.

type AllowedModesAnomaly

type AllowedModesAnomaly string

When set to `on`, the current WAF rule will be used when evaluating the request. Applies to anomaly detection WAF rules.

const (
	AllowedModesAnomalyOn  AllowedModesAnomaly = "on"
	AllowedModesAnomalyOff AllowedModesAnomaly = "off"
)

func (AllowedModesAnomaly) IsKnown

func (r AllowedModesAnomaly) IsKnown() bool

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 CloudflareTunnel

type CloudflareTunnel = shared.CloudflareTunnel

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

This is an alias to an internal type.

type CloudflareTunnelConnection

type CloudflareTunnelConnection = shared.CloudflareTunnelConnection

This is an alias to an internal type.

type CloudflareTunnelTunType

type CloudflareTunnelTunType = shared.CloudflareTunnelTunType

The type of tunnel.

This is an alias to an internal type.

type Configuration

type Configuration struct {
	// The configuration target. You must set the target to `ip` when specifying an IP
	// address in the Zone Lockdown rule.
	Target ConfigurationTarget `json:"target"`
	// The IP address to match. This address will be compared to the IP address of
	// incoming requests.
	Value string            `json:"value"`
	JSON  configurationJSON `json:"-"`
	// contains filtered or unexported fields
}

A list of IP addresses or CIDR ranges that will be allowed to access the URLs specified in the Zone Lockdown rule. You can include any number of `ip` or `ip_range` configurations.

func (Configuration) AsUnion

func (r Configuration) AsUnion() ConfigurationUnion

func (*Configuration) UnmarshalJSON

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

type ConfigurationParam

type ConfigurationParam struct {
	// The configuration target. You must set the target to `ip` when specifying an IP
	// address in the Zone Lockdown rule.
	Target param.Field[ConfigurationTarget] `json:"target"`
	// The IP address to match. This address will be compared to the IP address of
	// incoming requests.
	Value param.Field[string] `json:"value"`
}

A list of IP addresses or CIDR ranges that will be allowed to access the URLs specified in the Zone Lockdown rule. You can include any number of `ip` or `ip_range` configurations.

func (ConfigurationParam) MarshalJSON

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

type ConfigurationTarget

type ConfigurationTarget string

The configuration target. You must set the target to `ip` when specifying an IP address in the Zone Lockdown rule.

const (
	ConfigurationTargetIP      ConfigurationTarget = "ip"
	ConfigurationTargetIPRange ConfigurationTarget = "ip_range"
)

func (ConfigurationTarget) IsKnown

func (r ConfigurationTarget) IsKnown() bool

type ConfigurationUnion

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

A list of IP addresses or CIDR ranges that will be allowed to access the URLs specified in the Zone Lockdown rule. You can include any number of `ip` or `ip_range` configurations.

Union satisfied by firewall.LockdownIPConfiguration or firewall.LockdownCIDRConfiguration.

type ConfigurationUnionParam

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

A list of IP addresses or CIDR ranges that will be allowed to access the URLs specified in the Zone Lockdown rule. You can include any number of `ip` or `ip_range` configurations.

Satisfied by firewall.LockdownIPConfigurationParam, firewall.LockdownCIDRConfigurationParam, ConfigurationParam.

type CountryConfigurationParam

type CountryConfigurationParam struct {
	// The configuration target. You must set the target to `country` when specifying a
	// country code in the rule.
	Target param.Field[CountryConfigurationTarget] `json:"target"`
	// The two-letter ISO-3166-1 alpha-2 code to match. For more information, refer to
	// [IP Access rules: Parameters](https://developers.cloudflare.com/waf/tools/ip-access-rules/parameters/#country).
	Value param.Field[string] `json:"value"`
}

func (CountryConfigurationParam) MarshalJSON

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

type CountryConfigurationTarget

type CountryConfigurationTarget string

The configuration target. You must set the target to `country` when specifying a country code in the rule.

const (
	CountryConfigurationTargetCountry CountryConfigurationTarget = "country"
)

func (CountryConfigurationTarget) IsKnown

func (r CountryConfigurationTarget) IsKnown() bool

type DeletedFilter

type DeletedFilter struct {
	// The unique identifier of the filter.
	ID string `json:"id,required"`
	// When true, indicates that the firewall rule was deleted.
	Deleted bool              `json:"deleted,required"`
	JSON    deletedFilterJSON `json:"-"`
}

func (*DeletedFilter) UnmarshalJSON

func (r *DeletedFilter) UnmarshalJSON(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 FirewallRule

type FirewallRule struct {
	// The unique identifier of the firewall rule.
	ID string `json:"id"`
	// The action to apply to a matched request. The `log` action is only available on
	// an Enterprise plan.
	Action rate_limits.Action `json:"action"`
	// An informative summary of the firewall rule.
	Description string             `json:"description"`
	Filter      FirewallRuleFilter `json:"filter"`
	// When true, indicates that the firewall rule is currently paused.
	Paused bool `json:"paused"`
	// The priority of the rule. Optional value used to define the processing order. A
	// lower number indicates a higher priority. If not provided, rules with a defined
	// priority will be processed before rules without a priority.
	Priority float64    `json:"priority"`
	Products []Products `json:"products"`
	// A short reference tag. Allows you to select related firewall rules.
	Ref  string           `json:"ref"`
	JSON firewallRuleJSON `json:"-"`
}

func (*FirewallRule) UnmarshalJSON

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

type FirewallRuleFilter

type FirewallRuleFilter struct {
	// An informative summary of the filter.
	Description string `json:"description"`
	// The filter expression. For more information, refer to
	// [Expressions](https://developers.cloudflare.com/ruleset-engine/rules-language/expressions/).
	Expression string `json:"expression"`
	// The unique identifier of the filter.
	ID string `json:"id"`
	// When true, indicates that the filter is currently paused.
	Paused bool `json:"paused"`
	// A short reference tag. Allows you to select related filters.
	Ref string `json:"ref"`
	// When true, indicates that the firewall rule was deleted.
	Deleted bool                   `json:"deleted"`
	JSON    firewallRuleFilterJSON `json:"-"`
	// contains filtered or unexported fields
}

func (FirewallRuleFilter) AsUnion

func (*FirewallRuleFilter) UnmarshalJSON

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

type FirewallRuleFilterUnion

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

Union satisfied by filters.FirewallFilter or firewall.DeletedFilter.

type FirewallService

type FirewallService struct {
	Options     []option.RequestOption
	Lockdowns   *LockdownService
	Rules       *RuleService
	AccessRules *AccessRuleService
	UARules     *UARuleService
	WAF         *WAFService
}

FirewallService 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 NewFirewallService method instead.

func NewFirewallService

func NewFirewallService(opts ...option.RequestOption) (r *FirewallService)

NewFirewallService 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.

type Group

type Group struct {
	// The unique identifier of the rule group.
	ID string `json:"id,required"`
	// An informative summary of what the rule group does.
	Description string `json:"description,required,nullable"`
	// The state of the rules contained in the rule group. When `on`, the rules in the
	// group are configurable/usable.
	Mode GroupMode `json:"mode,required"`
	// The name of the rule group.
	Name string `json:"name,required"`
	// The number of rules in the current rule group.
	RulesCount float64 `json:"rules_count,required"`
	// The available states for the rule group.
	AllowedModes []GroupAllowedMode `json:"allowed_modes"`
	// The number of rules within the group that have been modified from their default
	// configuration.
	ModifiedRulesCount float64 `json:"modified_rules_count"`
	// The unique identifier of a WAF package.
	PackageID string    `json:"package_id"`
	JSON      groupJSON `json:"-"`
}

func (*Group) UnmarshalJSON

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

type GroupAllowedMode

type GroupAllowedMode string

The state of the rules contained in the rule group. When `on`, the rules in the group are configurable/usable.

const (
	GroupAllowedModeOn  GroupAllowedMode = "on"
	GroupAllowedModeOff GroupAllowedMode = "off"
)

func (GroupAllowedMode) IsKnown

func (r GroupAllowedMode) IsKnown() bool

type GroupMode

type GroupMode string

The state of the rules contained in the rule group. When `on`, the rules in the group are configurable/usable.

const (
	GroupModeOn  GroupMode = "on"
	GroupModeOff GroupMode = "off"
)

func (GroupMode) IsKnown

func (r GroupMode) IsKnown() bool

type IPV6ConfigurationParam

type IPV6ConfigurationParam struct {
	// The configuration target. You must set the target to `ip6` when specifying an
	// IPv6 address in the rule.
	Target param.Field[IPV6ConfigurationTarget] `json:"target"`
	// The IPv6 address to match.
	Value param.Field[string] `json:"value"`
}

func (IPV6ConfigurationParam) MarshalJSON

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

type IPV6ConfigurationTarget

type IPV6ConfigurationTarget string

The configuration target. You must set the target to `ip6` when specifying an IPv6 address in the rule.

const (
	IPV6ConfigurationTargetIp6 IPV6ConfigurationTarget = "ip6"
)

func (IPV6ConfigurationTarget) IsKnown

func (r IPV6ConfigurationTarget) IsKnown() bool

type Lockdown

type Lockdown struct {
	// The unique identifier of the Zone Lockdown rule.
	ID string `json:"id,required"`
	// A list of IP addresses or CIDR ranges that will be allowed to access the URLs
	// specified in the Zone Lockdown rule. You can include any number of `ip` or
	// `ip_range` configurations.
	Configurations Configuration `json:"configurations,required"`
	// The timestamp of when the rule was created.
	CreatedOn time.Time `json:"created_on,required" format:"date-time"`
	// An informative summary of the rule.
	Description string `json:"description,required"`
	// The timestamp of when the rule was last modified.
	ModifiedOn time.Time `json:"modified_on,required" format:"date-time"`
	// When true, indicates that the rule is currently paused.
	Paused bool `json:"paused,required"`
	// The URLs to include in the rule definition. You can use wildcards. Each entered
	// URL will be escaped before use, which means you can only use simple wildcard
	// patterns.
	URLs []LockdownURL `json:"urls,required"`
	JSON lockdownJSON  `json:"-"`
}

func (*Lockdown) UnmarshalJSON

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

type LockdownCIDRConfiguration

type LockdownCIDRConfiguration struct {
	// The configuration target. You must set the target to `ip_range` when specifying
	// an IP address range in the Zone Lockdown rule.
	Target LockdownCIDRConfigurationTarget `json:"target"`
	// The IP address range to match. You can only use prefix lengths `/16` and `/24`.
	Value string                        `json:"value"`
	JSON  lockdownCIDRConfigurationJSON `json:"-"`
}

func (*LockdownCIDRConfiguration) UnmarshalJSON

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

type LockdownCIDRConfigurationTarget

type LockdownCIDRConfigurationTarget string

The configuration target. You must set the target to `ip_range` when specifying an IP address range in the Zone Lockdown rule.

const (
	LockdownCIDRConfigurationTargetIPRange LockdownCIDRConfigurationTarget = "ip_range"
)

func (LockdownCIDRConfigurationTarget) IsKnown

type LockdownDeleteParams

type LockdownDeleteParams struct {
	Body interface{} `json:"body,required"`
}

func (LockdownDeleteParams) MarshalJSON

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

type LockdownDeleteResponse

type LockdownDeleteResponse struct {
	// The unique identifier of the Zone Lockdown rule.
	ID   string                     `json:"id"`
	JSON lockdownDeleteResponseJSON `json:"-"`
}

func (*LockdownDeleteResponse) UnmarshalJSON

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

type LockdownDeleteResponseEnvelope

type LockdownDeleteResponseEnvelope struct {
	Result LockdownDeleteResponse             `json:"result"`
	JSON   lockdownDeleteResponseEnvelopeJSON `json:"-"`
}

func (*LockdownDeleteResponseEnvelope) UnmarshalJSON

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

type LockdownGetResponseEnvelope

type LockdownGetResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	Result   Lockdown              `json:"result,required"`
	// Whether the API call was successful
	Success LockdownGetResponseEnvelopeSuccess `json:"success,required"`
	JSON    lockdownGetResponseEnvelopeJSON    `json:"-"`
}

func (*LockdownGetResponseEnvelope) UnmarshalJSON

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

type LockdownGetResponseEnvelopeSuccess

type LockdownGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	LockdownGetResponseEnvelopeSuccessTrue LockdownGetResponseEnvelopeSuccess = true
)

func (LockdownGetResponseEnvelopeSuccess) IsKnown

type LockdownIPConfiguration

type LockdownIPConfiguration struct {
	// The configuration target. You must set the target to `ip` when specifying an IP
	// address in the Zone Lockdown rule.
	Target LockdownIPConfigurationTarget `json:"target"`
	// The IP address to match. This address will be compared to the IP address of
	// incoming requests.
	Value string                      `json:"value"`
	JSON  lockdownIPConfigurationJSON `json:"-"`
}

func (*LockdownIPConfiguration) UnmarshalJSON

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

type LockdownIPConfigurationTarget

type LockdownIPConfigurationTarget string

The configuration target. You must set the target to `ip` when specifying an IP address in the Zone Lockdown rule.

const (
	LockdownIPConfigurationTargetIP LockdownIPConfigurationTarget = "ip"
)

func (LockdownIPConfigurationTarget) IsKnown

func (r LockdownIPConfigurationTarget) IsKnown() bool

type LockdownListParams

type LockdownListParams struct {
	// The timestamp of when the rule was created.
	CreatedOn param.Field[time.Time] `query:"created_on" format:"date-time"`
	// A string to search for in the description of existing rules.
	Description param.Field[string] `query:"description"`
	// A string to search for in the description of existing rules.
	DescriptionSearch param.Field[string] `query:"description_search"`
	// A single IP address to search for in existing rules.
	IP param.Field[string] `query:"ip"`
	// A single IP address range to search for in existing rules.
	IPRangeSearch param.Field[string] `query:"ip_range_search"`
	// A single IP address to search for in existing rules.
	IPSearch param.Field[string] `query:"ip_search"`
	// The timestamp of when the rule was last modified.
	ModifiedOn param.Field[time.Time] `query:"modified_on" format:"date-time"`
	// Page number of paginated results.
	Page param.Field[float64] `query:"page"`
	// The maximum number of results per page. You can only set the value to `1` or to
	// a multiple of 5 such as `5`, `10`, `15`, or `20`.
	PerPage param.Field[float64] `query:"per_page"`
	// The priority of the rule to control the processing order. A lower number
	// indicates higher priority. If not provided, any rules with a configured priority
	// will be processed before rules without a priority.
	Priority param.Field[float64] `query:"priority"`
	// A single URI to search for in the list of URLs of existing rules.
	URISearch param.Field[string] `query:"uri_search"`
}

func (LockdownListParams) URLQuery

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

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

type LockdownNewParams

type LockdownNewParams struct {
	Body interface{} `json:"body,required"`
}

func (LockdownNewParams) MarshalJSON

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

type LockdownNewResponseEnvelope

type LockdownNewResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	Result   Lockdown              `json:"result,required"`
	// Whether the API call was successful
	Success LockdownNewResponseEnvelopeSuccess `json:"success,required"`
	JSON    lockdownNewResponseEnvelopeJSON    `json:"-"`
}

func (*LockdownNewResponseEnvelope) UnmarshalJSON

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

type LockdownNewResponseEnvelopeSuccess

type LockdownNewResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	LockdownNewResponseEnvelopeSuccessTrue LockdownNewResponseEnvelopeSuccess = true
)

func (LockdownNewResponseEnvelopeSuccess) IsKnown

type LockdownService

type LockdownService struct {
	Options []option.RequestOption
}

LockdownService 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 NewLockdownService method instead.

func NewLockdownService

func NewLockdownService(opts ...option.RequestOption) (r *LockdownService)

NewLockdownService 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 (*LockdownService) Delete

func (r *LockdownService) Delete(ctx context.Context, zoneIdentifier string, id string, body LockdownDeleteParams, opts ...option.RequestOption) (res *LockdownDeleteResponse, err error)

Deletes an existing Zone Lockdown rule.

func (*LockdownService) Get

func (r *LockdownService) Get(ctx context.Context, zoneIdentifier string, id string, opts ...option.RequestOption) (res *Lockdown, err error)

Fetches the details of a Zone Lockdown rule.

func (*LockdownService) List

Fetches Zone Lockdown rules. You can filter the results using several optional parameters.

func (*LockdownService) ListAutoPaging

Fetches Zone Lockdown rules. You can filter the results using several optional parameters.

func (*LockdownService) New

func (r *LockdownService) New(ctx context.Context, zoneIdentifier string, body LockdownNewParams, opts ...option.RequestOption) (res *Lockdown, err error)

Creates a new Zone Lockdown rule.

func (*LockdownService) Update

func (r *LockdownService) Update(ctx context.Context, zoneIdentifier string, id string, body LockdownUpdateParams, opts ...option.RequestOption) (res *Lockdown, err error)

Updates an existing Zone Lockdown rule.

type LockdownURL

type LockdownURL = string

type LockdownUpdateParams

type LockdownUpdateParams struct {
	Body interface{} `json:"body,required"`
}

func (LockdownUpdateParams) MarshalJSON

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

type LockdownUpdateResponseEnvelope

type LockdownUpdateResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	Result   Lockdown              `json:"result,required"`
	// Whether the API call was successful
	Success LockdownUpdateResponseEnvelopeSuccess `json:"success,required"`
	JSON    lockdownUpdateResponseEnvelopeJSON    `json:"-"`
}

func (*LockdownUpdateResponseEnvelope) UnmarshalJSON

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

type LockdownUpdateResponseEnvelopeSuccess

type LockdownUpdateResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	LockdownUpdateResponseEnvelopeSuccessTrue LockdownUpdateResponseEnvelopeSuccess = true
)

func (LockdownUpdateResponseEnvelopeSuccess) IsKnown

type Member added in v2.1.0

type Member = shared.Member

This is an alias to an internal type.

type MemberParam added in v2.1.0

type MemberParam = shared.MemberParam

This is an alias to an internal type.

type MemberRole added in v2.1.0

type MemberRole = shared.MemberRole

This is an alias to an internal type.

type MemberRoleParam added in v2.1.0

type MemberRoleParam = shared.MemberRoleParam

This is an alias to an internal type.

type MemberRolesPermissions added in v2.1.0

type MemberRolesPermissions = shared.MemberRolesPermissions

This is an alias to an internal type.

type MemberRolesPermissionsParam added in v2.1.0

type MemberRolesPermissionsParam = shared.MemberRolesPermissionsParam

This is an alias to an internal type.

type MemberUser added in v2.1.0

type MemberUser = shared.MemberUser

This is an alias to an internal type.

type MemberUserParam added in v2.1.0

type MemberUserParam = shared.MemberUserParam

This is an alias to an internal type.

type Override

type Override struct {
	// The unique identifier of the WAF override.
	ID string `json:"id"`
	// An informative summary of the current URI-based WAF override.
	Description string `json:"description,nullable"`
	// An object that allows you to enable or disable WAF rule groups for the current
	// WAF override. Each key of this object must be the ID of a WAF rule group, and
	// each value must be a valid WAF action (usually `default` or `disable`). When
	// creating a new URI-based WAF override, you must provide a `groups` object or a
	// `rules` object.
	Groups map[string]interface{} `json:"groups"`
	// When true, indicates that the WAF package is currently paused.
	Paused bool `json:"paused"`
	// The relative priority of the current URI-based WAF override when multiple
	// overrides match a single URL. A lower number indicates higher priority. Higher
	// priority overrides may overwrite values set by lower priority overrides.
	Priority float64 `json:"priority"`
	// Specifies that, when a WAF rule matches, its configured action will be replaced
	// by the action configured in this object.
	RewriteAction RewriteAction `json:"rewrite_action"`
	// An object that allows you to override the action of specific WAF rules. Each key
	// of this object must be the ID of a WAF rule, and each value must be a valid WAF
	// action. Unless you are disabling a rule, ensure that you also enable the rule
	// group that this WAF rule belongs to. When creating a new URI-based WAF override,
	// you must provide a `groups` object or a `rules` object.
	Rules WAFRule `json:"rules"`
	// The URLs to include in the current WAF override. You can use wildcards. Each
	// entered URL will be escaped before use, which means you can only use simple
	// wildcard patterns.
	URLs []OverrideURL `json:"urls"`
	JSON overrideJSON  `json:"-"`
}

func (*Override) UnmarshalJSON

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

type OverrideURL

type OverrideURL = string

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 Products

type Products string

A list of products to bypass for a request when using the `bypass` action.

const (
	ProductsZoneLockdown  Products = "zoneLockdown"
	ProductsUABlock       Products = "uaBlock"
	ProductsBic           Products = "bic"
	ProductsHot           Products = "hot"
	ProductsSecurityLevel Products = "securityLevel"
	ProductsRateLimit     Products = "rateLimit"
	ProductsWAF           Products = "waf"
)

func (Products) IsKnown

func (r Products) IsKnown() bool

type ResponseInfo

type ResponseInfo = shared.ResponseInfo

This is an alias to an internal type.

type RewriteAction

type RewriteAction struct {
	// The WAF rule action to apply.
	Block     RewriteActionBlock `json:"block"`
	Challenge string             `json:"challenge"`
	Default   string             `json:"default"`
	// The WAF rule action to apply.
	Disable  RewriteActionDisable `json:"disable"`
	Simulate string               `json:"simulate"`
	JSON     rewriteActionJSON    `json:"-"`
}

Specifies that, when a WAF rule matches, its configured action will be replaced by the action configured in this object.

func (*RewriteAction) UnmarshalJSON

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

type RewriteActionBlock

type RewriteActionBlock string

The WAF rule action to apply.

const (
	RewriteActionBlockChallenge RewriteActionBlock = "challenge"
	RewriteActionBlockBlock     RewriteActionBlock = "block"
	RewriteActionBlockSimulate  RewriteActionBlock = "simulate"
	RewriteActionBlockDisable   RewriteActionBlock = "disable"
	RewriteActionBlockDefault   RewriteActionBlock = "default"
)

func (RewriteActionBlock) IsKnown

func (r RewriteActionBlock) IsKnown() bool

type RewriteActionDisable

type RewriteActionDisable string

The WAF rule action to apply.

const (
	RewriteActionDisableChallenge RewriteActionDisable = "challenge"
	RewriteActionDisableBlock     RewriteActionDisable = "block"
	RewriteActionDisableSimulate  RewriteActionDisable = "simulate"
	RewriteActionDisableDisable   RewriteActionDisable = "disable"
	RewriteActionDisableDefault   RewriteActionDisable = "default"
)

func (RewriteActionDisable) IsKnown

func (r RewriteActionDisable) IsKnown() bool

type Role

type Role = shared.Role

This is an alias to an internal type.

type RuleDeleteParams

type RuleDeleteParams struct {
	// When true, indicates that Cloudflare should also delete the associated filter if
	// there are no other firewall rules referencing the filter.
	DeleteFilterIfUnused param.Field[bool] `json:"delete_filter_if_unused"`
}

func (RuleDeleteParams) MarshalJSON

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

type RuleDeleteResponseEnvelope

type RuleDeleteResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	Result   FirewallRule          `json:"result,required"`
	// Whether the API call was successful
	Success RuleDeleteResponseEnvelopeSuccess `json:"success,required"`
	JSON    ruleDeleteResponseEnvelopeJSON    `json:"-"`
}

func (*RuleDeleteResponseEnvelope) UnmarshalJSON

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

type RuleDeleteResponseEnvelopeSuccess

type RuleDeleteResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	RuleDeleteResponseEnvelopeSuccessTrue RuleDeleteResponseEnvelopeSuccess = true
)

func (RuleDeleteResponseEnvelopeSuccess) IsKnown

type RuleEditParams

type RuleEditParams struct {
	Body interface{} `json:"body,required"`
}

func (RuleEditParams) MarshalJSON

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

type RuleEditResponseEnvelope

type RuleEditResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	Result   []FirewallRule        `json:"result,required,nullable"`
	// Whether the API call was successful
	Success    RuleEditResponseEnvelopeSuccess    `json:"success,required"`
	ResultInfo RuleEditResponseEnvelopeResultInfo `json:"result_info"`
	JSON       ruleEditResponseEnvelopeJSON       `json:"-"`
}

func (*RuleEditResponseEnvelope) UnmarshalJSON

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

type RuleEditResponseEnvelopeResultInfo

type RuleEditResponseEnvelopeResultInfo struct {
	// Total number of results for the requested service
	Count float64 `json:"count"`
	// Current page within paginated list of results
	Page float64 `json:"page"`
	// Number of results per page of results
	PerPage float64 `json:"per_page"`
	// Total results available without any search parameters
	TotalCount float64                                `json:"total_count"`
	JSON       ruleEditResponseEnvelopeResultInfoJSON `json:"-"`
}

func (*RuleEditResponseEnvelopeResultInfo) UnmarshalJSON

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

type RuleEditResponseEnvelopeSuccess

type RuleEditResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	RuleEditResponseEnvelopeSuccessTrue RuleEditResponseEnvelopeSuccess = true
)

func (RuleEditResponseEnvelopeSuccess) IsKnown

type RuleGetParams

type RuleGetParams struct {
	// The unique identifier of the firewall rule.
	PathID param.Field[string] `path:"id,required"`
	// The unique identifier of the firewall rule.
	QueryID param.Field[string] `query:"id"`
}

func (RuleGetParams) URLQuery

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

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

type RuleGetResponseEnvelope

type RuleGetResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	Result   FirewallRule          `json:"result,required"`
	// Whether the API call was successful
	Success RuleGetResponseEnvelopeSuccess `json:"success,required"`
	JSON    ruleGetResponseEnvelopeJSON    `json:"-"`
}

func (*RuleGetResponseEnvelope) UnmarshalJSON

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

type RuleGetResponseEnvelopeSuccess

type RuleGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	RuleGetResponseEnvelopeSuccessTrue RuleGetResponseEnvelopeSuccess = true
)

func (RuleGetResponseEnvelopeSuccess) IsKnown

type RuleListParams

type RuleListParams struct {
	// The unique identifier of the firewall rule.
	ID param.Field[string] `query:"id"`
	// The action to search for. Must be an exact match.
	Action param.Field[string] `query:"action"`
	// A case-insensitive string to find in the description.
	Description param.Field[string] `query:"description"`
	// Page number of paginated results.
	Page param.Field[float64] `query:"page"`
	// When true, indicates that the firewall rule is currently paused.
	Paused param.Field[bool] `query:"paused"`
	// Number of firewall rules per page.
	PerPage param.Field[float64] `query:"per_page"`
}

func (RuleListParams) URLQuery

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

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

type RuleNewParams

type RuleNewParams struct {
	Body interface{} `json:"body,required"`
}

func (RuleNewParams) MarshalJSON

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

type RuleNewResponseEnvelope

type RuleNewResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	Result   []FirewallRule        `json:"result,required,nullable"`
	// Whether the API call was successful
	Success    RuleNewResponseEnvelopeSuccess    `json:"success,required"`
	ResultInfo RuleNewResponseEnvelopeResultInfo `json:"result_info"`
	JSON       ruleNewResponseEnvelopeJSON       `json:"-"`
}

func (*RuleNewResponseEnvelope) UnmarshalJSON

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

type RuleNewResponseEnvelopeResultInfo

type RuleNewResponseEnvelopeResultInfo struct {
	// Total number of results for the requested service
	Count float64 `json:"count"`
	// Current page within paginated list of results
	Page float64 `json:"page"`
	// Number of results per page of results
	PerPage float64 `json:"per_page"`
	// Total results available without any search parameters
	TotalCount float64                               `json:"total_count"`
	JSON       ruleNewResponseEnvelopeResultInfoJSON `json:"-"`
}

func (*RuleNewResponseEnvelopeResultInfo) UnmarshalJSON

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

type RuleNewResponseEnvelopeSuccess

type RuleNewResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	RuleNewResponseEnvelopeSuccessTrue RuleNewResponseEnvelopeSuccess = true
)

func (RuleNewResponseEnvelopeSuccess) IsKnown

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, zoneIdentifier string, id string, body RuleDeleteParams, opts ...option.RequestOption) (res *FirewallRule, err error)

Deletes an existing firewall rule.

func (*RuleService) Edit

func (r *RuleService) Edit(ctx context.Context, zoneIdentifier string, id string, body RuleEditParams, opts ...option.RequestOption) (res *[]FirewallRule, err error)

Updates the priority of an existing firewall rule.

func (*RuleService) Get

func (r *RuleService) Get(ctx context.Context, zoneIdentifier string, params RuleGetParams, opts ...option.RequestOption) (res *FirewallRule, err error)

Fetches the details of a firewall rule.

func (*RuleService) List

func (r *RuleService) List(ctx context.Context, zoneIdentifier string, query RuleListParams, opts ...option.RequestOption) (res *pagination.V4PagePaginationArray[FirewallRule], err error)

Fetches firewall rules in a zone. You can filter the results using several optional parameters.

func (*RuleService) ListAutoPaging

Fetches firewall rules in a zone. You can filter the results using several optional parameters.

func (*RuleService) New

func (r *RuleService) New(ctx context.Context, zoneIdentifier string, body RuleNewParams, opts ...option.RequestOption) (res *[]FirewallRule, err error)

Create one or more firewall rules.

func (*RuleService) Update

func (r *RuleService) Update(ctx context.Context, zoneIdentifier string, id string, body RuleUpdateParams, opts ...option.RequestOption) (res *FirewallRule, err error)

Updates an existing firewall rule.

type RuleUpdateParams

type RuleUpdateParams struct {
	Body interface{} `json:"body,required"`
}

func (RuleUpdateParams) MarshalJSON

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

type RuleUpdateResponseEnvelope

type RuleUpdateResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	Result   FirewallRule          `json:"result,required"`
	// Whether the API call was successful
	Success RuleUpdateResponseEnvelopeSuccess `json:"success,required"`
	JSON    ruleUpdateResponseEnvelopeJSON    `json:"-"`
}

func (*RuleUpdateResponseEnvelope) UnmarshalJSON

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

type RuleUpdateResponseEnvelopeSuccess

type RuleUpdateResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	RuleUpdateResponseEnvelopeSuccessTrue RuleUpdateResponseEnvelopeSuccess = true
)

func (RuleUpdateResponseEnvelopeSuccess) IsKnown

type UARuleDeleteParams

type UARuleDeleteParams struct {
	Body interface{} `json:"body,required"`
}

func (UARuleDeleteParams) MarshalJSON

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

type UARuleDeleteResponse

type UARuleDeleteResponse struct {
	// The unique identifier of the User Agent Blocking rule.
	ID   string                   `json:"id"`
	JSON uaRuleDeleteResponseJSON `json:"-"`
}

func (*UARuleDeleteResponse) UnmarshalJSON

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

type UARuleDeleteResponseEnvelope

type UARuleDeleteResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	Result   UARuleDeleteResponse  `json:"result,required"`
	// Whether the API call was successful
	Success UARuleDeleteResponseEnvelopeSuccess `json:"success,required"`
	JSON    uaRuleDeleteResponseEnvelopeJSON    `json:"-"`
}

func (*UARuleDeleteResponseEnvelope) UnmarshalJSON

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

type UARuleDeleteResponseEnvelopeSuccess

type UARuleDeleteResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	UARuleDeleteResponseEnvelopeSuccessTrue UARuleDeleteResponseEnvelopeSuccess = true
)

func (UARuleDeleteResponseEnvelopeSuccess) IsKnown

type UARuleGetResponseEnvelope

type UARuleGetResponseEnvelope struct {
	Errors   []shared.ResponseInfo  `json:"errors,required"`
	Messages []shared.ResponseInfo  `json:"messages,required"`
	Result   UARuleGetResponseUnion `json:"result,required"`
	// Whether the API call was successful
	Success UARuleGetResponseEnvelopeSuccess `json:"success,required"`
	JSON    uaRuleGetResponseEnvelopeJSON    `json:"-"`
}

func (*UARuleGetResponseEnvelope) UnmarshalJSON

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

type UARuleGetResponseEnvelopeSuccess

type UARuleGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	UARuleGetResponseEnvelopeSuccessTrue UARuleGetResponseEnvelopeSuccess = true
)

func (UARuleGetResponseEnvelopeSuccess) IsKnown

type UARuleGetResponseUnion

type UARuleGetResponseUnion interface {
	ImplementsFirewallUARuleGetResponseUnion()
}

Union satisfied by firewall.UARuleGetResponseUnknown or shared.UnionString.

type UARuleListParams

type UARuleListParams struct {
	// A string to search for in the description of existing rules.
	Description param.Field[string] `query:"description"`
	// A string to search for in the description of existing rules.
	DescriptionSearch param.Field[string] `query:"description_search"`
	// Page number of paginated results.
	Page param.Field[float64] `query:"page"`
	// The maximum number of results per page. You can only set the value to `1` or to
	// a multiple of 5 such as `5`, `10`, `15`, or `20`.
	PerPage param.Field[float64] `query:"per_page"`
	// A string to search for in the user agent values of existing rules.
	UASearch param.Field[string] `query:"ua_search"`
}

func (UARuleListParams) URLQuery

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

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

type UARuleListResponse

type UARuleListResponse struct {
	// The unique identifier of the User Agent Blocking rule.
	ID string `json:"id"`
	// The configuration object for the current rule.
	Configuration UARuleListResponseConfiguration `json:"configuration"`
	// An informative summary of the rule.
	Description string `json:"description"`
	// The action to apply to a matched request.
	Mode UARuleListResponseMode `json:"mode"`
	// When true, indicates that the rule is currently paused.
	Paused bool                   `json:"paused"`
	JSON   uaRuleListResponseJSON `json:"-"`
}

func (*UARuleListResponse) UnmarshalJSON

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

type UARuleListResponseConfiguration

type UARuleListResponseConfiguration struct {
	// The configuration target for this rule. You must set the target to `ua` for User
	// Agent Blocking rules.
	Target string `json:"target"`
	// The exact user agent string to match. This value will be compared to the
	// received `User-Agent` HTTP header value.
	Value string                              `json:"value"`
	JSON  uaRuleListResponseConfigurationJSON `json:"-"`
}

The configuration object for the current rule.

func (*UARuleListResponseConfiguration) UnmarshalJSON

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

type UARuleListResponseMode

type UARuleListResponseMode string

The action to apply to a matched request.

const (
	UARuleListResponseModeBlock            UARuleListResponseMode = "block"
	UARuleListResponseModeChallenge        UARuleListResponseMode = "challenge"
	UARuleListResponseModeJSChallenge      UARuleListResponseMode = "js_challenge"
	UARuleListResponseModeManagedChallenge UARuleListResponseMode = "managed_challenge"
)

func (UARuleListResponseMode) IsKnown

func (r UARuleListResponseMode) IsKnown() bool

type UARuleNewParams

type UARuleNewParams struct {
	Body interface{} `json:"body,required"`
}

func (UARuleNewParams) MarshalJSON

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

type UARuleNewResponseEnvelope

type UARuleNewResponseEnvelope struct {
	Errors   []shared.ResponseInfo  `json:"errors,required"`
	Messages []shared.ResponseInfo  `json:"messages,required"`
	Result   UARuleNewResponseUnion `json:"result,required"`
	// Whether the API call was successful
	Success UARuleNewResponseEnvelopeSuccess `json:"success,required"`
	JSON    uaRuleNewResponseEnvelopeJSON    `json:"-"`
}

func (*UARuleNewResponseEnvelope) UnmarshalJSON

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

type UARuleNewResponseEnvelopeSuccess

type UARuleNewResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	UARuleNewResponseEnvelopeSuccessTrue UARuleNewResponseEnvelopeSuccess = true
)

func (UARuleNewResponseEnvelopeSuccess) IsKnown

type UARuleNewResponseUnion

type UARuleNewResponseUnion interface {
	ImplementsFirewallUARuleNewResponseUnion()
}

Union satisfied by firewall.UARuleNewResponseUnknown or shared.UnionString.

type UARuleService

type UARuleService struct {
	Options []option.RequestOption
}

UARuleService 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 NewUARuleService method instead.

func NewUARuleService

func NewUARuleService(opts ...option.RequestOption) (r *UARuleService)

NewUARuleService 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 (*UARuleService) Delete

func (r *UARuleService) Delete(ctx context.Context, zoneIdentifier string, id string, body UARuleDeleteParams, opts ...option.RequestOption) (res *UARuleDeleteResponse, err error)

Deletes an existing User Agent Blocking rule.

func (*UARuleService) Get

func (r *UARuleService) Get(ctx context.Context, zoneIdentifier string, id string, opts ...option.RequestOption) (res *UARuleGetResponseUnion, err error)

Fetches the details of a User Agent Blocking rule.

func (*UARuleService) List

Fetches User Agent Blocking rules in a zone. You can filter the results using several optional parameters.

func (*UARuleService) ListAutoPaging

Fetches User Agent Blocking rules in a zone. You can filter the results using several optional parameters.

func (*UARuleService) New

func (r *UARuleService) New(ctx context.Context, zoneIdentifier string, body UARuleNewParams, opts ...option.RequestOption) (res *UARuleNewResponseUnion, err error)

Creates a new User Agent Blocking rule in a zone.

func (*UARuleService) Update

func (r *UARuleService) Update(ctx context.Context, zoneIdentifier string, id string, body UARuleUpdateParams, opts ...option.RequestOption) (res *UARuleUpdateResponseUnion, err error)

Updates an existing User Agent Blocking rule.

type UARuleUpdateParams

type UARuleUpdateParams struct {
	Body interface{} `json:"body,required"`
}

func (UARuleUpdateParams) MarshalJSON

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

type UARuleUpdateResponseEnvelope

type UARuleUpdateResponseEnvelope struct {
	Errors   []shared.ResponseInfo     `json:"errors,required"`
	Messages []shared.ResponseInfo     `json:"messages,required"`
	Result   UARuleUpdateResponseUnion `json:"result,required"`
	// Whether the API call was successful
	Success UARuleUpdateResponseEnvelopeSuccess `json:"success,required"`
	JSON    uaRuleUpdateResponseEnvelopeJSON    `json:"-"`
}

func (*UARuleUpdateResponseEnvelope) UnmarshalJSON

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

type UARuleUpdateResponseEnvelopeSuccess

type UARuleUpdateResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	UARuleUpdateResponseEnvelopeSuccessTrue UARuleUpdateResponseEnvelopeSuccess = true
)

func (UARuleUpdateResponseEnvelopeSuccess) IsKnown

type UARuleUpdateResponseUnion

type UARuleUpdateResponseUnion interface {
	ImplementsFirewallUARuleUpdateResponseUnion()
}

Union satisfied by firewall.UARuleUpdateResponseUnknown or shared.UnionString.

type WAFOverrideDeleteParams

type WAFOverrideDeleteParams struct {
	Body interface{} `json:"body,required"`
}

func (WAFOverrideDeleteParams) MarshalJSON

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

type WAFOverrideDeleteResponse

type WAFOverrideDeleteResponse struct {
	// The unique identifier of the WAF override.
	ID   string                        `json:"id"`
	JSON wafOverrideDeleteResponseJSON `json:"-"`
}

func (*WAFOverrideDeleteResponse) UnmarshalJSON

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

type WAFOverrideDeleteResponseEnvelope

type WAFOverrideDeleteResponseEnvelope struct {
	Result WAFOverrideDeleteResponse             `json:"result"`
	JSON   wafOverrideDeleteResponseEnvelopeJSON `json:"-"`
}

func (*WAFOverrideDeleteResponseEnvelope) UnmarshalJSON

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

type WAFOverrideGetResponseEnvelope

type WAFOverrideGetResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	Result   Override              `json:"result,required"`
	// Whether the API call was successful
	Success WAFOverrideGetResponseEnvelopeSuccess `json:"success,required"`
	JSON    wafOverrideGetResponseEnvelopeJSON    `json:"-"`
}

func (*WAFOverrideGetResponseEnvelope) UnmarshalJSON

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

type WAFOverrideGetResponseEnvelopeSuccess

type WAFOverrideGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	WAFOverrideGetResponseEnvelopeSuccessTrue WAFOverrideGetResponseEnvelopeSuccess = true
)

func (WAFOverrideGetResponseEnvelopeSuccess) IsKnown

type WAFOverrideListParams

type WAFOverrideListParams struct {
	// The page number of paginated results.
	Page param.Field[float64] `query:"page"`
	// The number of WAF overrides per page.
	PerPage param.Field[float64] `query:"per_page"`
}

func (WAFOverrideListParams) URLQuery

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

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

type WAFOverrideNewParams

type WAFOverrideNewParams struct {
	Body interface{} `json:"body,required"`
}

func (WAFOverrideNewParams) MarshalJSON

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

type WAFOverrideNewResponseEnvelope

type WAFOverrideNewResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	Result   Override              `json:"result,required"`
	// Whether the API call was successful
	Success WAFOverrideNewResponseEnvelopeSuccess `json:"success,required"`
	JSON    wafOverrideNewResponseEnvelopeJSON    `json:"-"`
}

func (*WAFOverrideNewResponseEnvelope) UnmarshalJSON

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

type WAFOverrideNewResponseEnvelopeSuccess

type WAFOverrideNewResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	WAFOverrideNewResponseEnvelopeSuccessTrue WAFOverrideNewResponseEnvelopeSuccess = true
)

func (WAFOverrideNewResponseEnvelopeSuccess) IsKnown

type WAFOverrideService

type WAFOverrideService struct {
	Options []option.RequestOption
}

WAFOverrideService 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 NewWAFOverrideService method instead.

func NewWAFOverrideService

func NewWAFOverrideService(opts ...option.RequestOption) (r *WAFOverrideService)

NewWAFOverrideService 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 (*WAFOverrideService) Delete

func (r *WAFOverrideService) Delete(ctx context.Context, zoneIdentifier string, id string, body WAFOverrideDeleteParams, opts ...option.RequestOption) (res *WAFOverrideDeleteResponse, err error)

Deletes an existing URI-based WAF override.

**Note:** Applies only to the [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).

func (*WAFOverrideService) Get

func (r *WAFOverrideService) Get(ctx context.Context, zoneIdentifier string, id string, opts ...option.RequestOption) (res *Override, err error)

Fetches the details of a URI-based WAF override.

**Note:** Applies only to the [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).

func (*WAFOverrideService) List

Fetches the URI-based WAF overrides in a zone.

**Note:** Applies only to the [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).

func (*WAFOverrideService) ListAutoPaging

Fetches the URI-based WAF overrides in a zone.

**Note:** Applies only to the [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).

func (*WAFOverrideService) New

func (r *WAFOverrideService) New(ctx context.Context, zoneIdentifier string, body WAFOverrideNewParams, opts ...option.RequestOption) (res *Override, err error)

Creates a URI-based WAF override for a zone.

**Note:** Applies only to the [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).

func (*WAFOverrideService) Update

func (r *WAFOverrideService) Update(ctx context.Context, zoneIdentifier string, id string, body WAFOverrideUpdateParams, opts ...option.RequestOption) (res *Override, err error)

Updates an existing URI-based WAF override.

**Note:** Applies only to the [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).

type WAFOverrideUpdateParams

type WAFOverrideUpdateParams struct {
	Body interface{} `json:"body,required"`
}

func (WAFOverrideUpdateParams) MarshalJSON

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

type WAFOverrideUpdateResponseEnvelope

type WAFOverrideUpdateResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	Result   Override              `json:"result,required"`
	// Whether the API call was successful
	Success WAFOverrideUpdateResponseEnvelopeSuccess `json:"success,required"`
	JSON    wafOverrideUpdateResponseEnvelopeJSON    `json:"-"`
}

func (*WAFOverrideUpdateResponseEnvelope) UnmarshalJSON

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

type WAFOverrideUpdateResponseEnvelopeSuccess

type WAFOverrideUpdateResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	WAFOverrideUpdateResponseEnvelopeSuccessTrue WAFOverrideUpdateResponseEnvelopeSuccess = true
)

func (WAFOverrideUpdateResponseEnvelopeSuccess) IsKnown

type WAFPackageGetResponse

type WAFPackageGetResponse struct {
	Errors   interface{} `json:"errors,required"`
	Messages interface{} `json:"messages,required"`
	Result   interface{} `json:"result,required"`
	// Whether the API call was successful
	Success WAFPackageGetResponseSuccess `json:"success"`
	JSON    wafPackageGetResponseJSON    `json:"-"`
	// contains filtered or unexported fields
}

func (WAFPackageGetResponse) AsUnion

func (*WAFPackageGetResponse) UnmarshalJSON

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

type WAFPackageGetResponseFirewallAPIResponseSingle

type WAFPackageGetResponseFirewallAPIResponseSingle struct {
	Errors   []shared.ResponseInfo                                     `json:"errors,required"`
	Messages []shared.ResponseInfo                                     `json:"messages,required"`
	Result   WAFPackageGetResponseFirewallAPIResponseSingleResultUnion `json:"result,required"`
	// Whether the API call was successful
	Success WAFPackageGetResponseFirewallAPIResponseSingleSuccess `json:"success,required"`
	JSON    wafPackageGetResponseFirewallAPIResponseSingleJSON    `json:"-"`
}

func (*WAFPackageGetResponseFirewallAPIResponseSingle) UnmarshalJSON

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

type WAFPackageGetResponseFirewallAPIResponseSingleResultUnion

type WAFPackageGetResponseFirewallAPIResponseSingleResultUnion interface {
	ImplementsFirewallWAFPackageGetResponseFirewallAPIResponseSingleResultUnion()
}

Union satisfied by firewall.WAFPackageGetResponseFirewallAPIResponseSingleResultUnknown or shared.UnionString.

type WAFPackageGetResponseFirewallAPIResponseSingleSuccess

type WAFPackageGetResponseFirewallAPIResponseSingleSuccess bool

Whether the API call was successful

const (
	WAFPackageGetResponseFirewallAPIResponseSingleSuccessTrue WAFPackageGetResponseFirewallAPIResponseSingleSuccess = true
)

func (WAFPackageGetResponseFirewallAPIResponseSingleSuccess) IsKnown

type WAFPackageGetResponseObject

type WAFPackageGetResponseObject struct {
	Result interface{}                     `json:"result"`
	JSON   wafPackageGetResponseObjectJSON `json:"-"`
}

func (*WAFPackageGetResponseObject) UnmarshalJSON

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

type WAFPackageGetResponseSuccess

type WAFPackageGetResponseSuccess bool

Whether the API call was successful

const (
	WAFPackageGetResponseSuccessTrue WAFPackageGetResponseSuccess = true
)

func (WAFPackageGetResponseSuccess) IsKnown

func (r WAFPackageGetResponseSuccess) IsKnown() bool

type WAFPackageGetResponseUnion

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

Union satisfied by firewall.WAFPackageGetResponseFirewallAPIResponseSingle or firewall.WAFPackageGetResponseObject.

type WAFPackageGroupEditParams

type WAFPackageGroupEditParams struct {
	// Identifier
	ZoneID param.Field[string] `path:"zone_id,required"`
	// The state of the rules contained in the rule group. When `on`, the rules in the
	// group are configurable/usable.
	Mode param.Field[WAFPackageGroupEditParamsMode] `json:"mode"`
}

func (WAFPackageGroupEditParams) MarshalJSON

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

type WAFPackageGroupEditParamsMode

type WAFPackageGroupEditParamsMode string

The state of the rules contained in the rule group. When `on`, the rules in the group are configurable/usable.

const (
	WAFPackageGroupEditParamsModeOn  WAFPackageGroupEditParamsMode = "on"
	WAFPackageGroupEditParamsModeOff WAFPackageGroupEditParamsMode = "off"
)

func (WAFPackageGroupEditParamsMode) IsKnown

func (r WAFPackageGroupEditParamsMode) IsKnown() bool

type WAFPackageGroupEditResponseEnvelope

type WAFPackageGroupEditResponseEnvelope struct {
	Errors   []shared.ResponseInfo            `json:"errors,required"`
	Messages []shared.ResponseInfo            `json:"messages,required"`
	Result   WAFPackageGroupEditResponseUnion `json:"result,required"`
	// Whether the API call was successful
	Success WAFPackageGroupEditResponseEnvelopeSuccess `json:"success,required"`
	JSON    wafPackageGroupEditResponseEnvelopeJSON    `json:"-"`
}

func (*WAFPackageGroupEditResponseEnvelope) UnmarshalJSON

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

type WAFPackageGroupEditResponseEnvelopeSuccess

type WAFPackageGroupEditResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	WAFPackageGroupEditResponseEnvelopeSuccessTrue WAFPackageGroupEditResponseEnvelopeSuccess = true
)

func (WAFPackageGroupEditResponseEnvelopeSuccess) IsKnown

type WAFPackageGroupEditResponseUnion

type WAFPackageGroupEditResponseUnion interface {
	ImplementsFirewallWAFPackageGroupEditResponseUnion()
}

Union satisfied by firewall.WAFPackageGroupEditResponseUnknown or shared.UnionString.

type WAFPackageGroupGetParams

type WAFPackageGroupGetParams struct {
	// Identifier
	ZoneID param.Field[string] `path:"zone_id,required"`
}

type WAFPackageGroupGetResponseEnvelope

type WAFPackageGroupGetResponseEnvelope struct {
	Errors   []shared.ResponseInfo           `json:"errors,required"`
	Messages []shared.ResponseInfo           `json:"messages,required"`
	Result   WAFPackageGroupGetResponseUnion `json:"result,required"`
	// Whether the API call was successful
	Success WAFPackageGroupGetResponseEnvelopeSuccess `json:"success,required"`
	JSON    wafPackageGroupGetResponseEnvelopeJSON    `json:"-"`
}

func (*WAFPackageGroupGetResponseEnvelope) UnmarshalJSON

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

type WAFPackageGroupGetResponseEnvelopeSuccess

type WAFPackageGroupGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	WAFPackageGroupGetResponseEnvelopeSuccessTrue WAFPackageGroupGetResponseEnvelopeSuccess = true
)

func (WAFPackageGroupGetResponseEnvelopeSuccess) IsKnown

type WAFPackageGroupGetResponseUnion

type WAFPackageGroupGetResponseUnion interface {
	ImplementsFirewallWAFPackageGroupGetResponseUnion()
}

Union satisfied by firewall.WAFPackageGroupGetResponseUnknown or shared.UnionString.

type WAFPackageGroupListParams

type WAFPackageGroupListParams struct {
	// Identifier
	ZoneID param.Field[string] `path:"zone_id,required"`
	// The direction used to sort returned rule groups.
	Direction param.Field[WAFPackageGroupListParamsDirection] `query:"direction"`
	// When set to `all`, all the search requirements must match. When set to `any`,
	// only one of the search requirements has to match.
	Match param.Field[WAFPackageGroupListParamsMatch] `query:"match"`
	// The state of the rules contained in the rule group. When `on`, the rules in the
	// group are configurable/usable.
	Mode param.Field[WAFPackageGroupListParamsMode] `query:"mode"`
	// The name of the rule group.
	Name param.Field[string] `query:"name"`
	// The field used to sort returned rule groups.
	Order param.Field[WAFPackageGroupListParamsOrder] `query:"order"`
	// The page number of paginated results.
	Page param.Field[float64] `query:"page"`
	// The number of rule groups per page.
	PerPage param.Field[float64] `query:"per_page"`
	// The number of rules in the current rule group.
	RulesCount param.Field[float64] `query:"rules_count"`
}

func (WAFPackageGroupListParams) URLQuery

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

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

type WAFPackageGroupListParamsDirection

type WAFPackageGroupListParamsDirection string

The direction used to sort returned rule groups.

const (
	WAFPackageGroupListParamsDirectionAsc  WAFPackageGroupListParamsDirection = "asc"
	WAFPackageGroupListParamsDirectionDesc WAFPackageGroupListParamsDirection = "desc"
)

func (WAFPackageGroupListParamsDirection) IsKnown

type WAFPackageGroupListParamsMatch

type WAFPackageGroupListParamsMatch string

When set to `all`, all the search requirements must match. When set to `any`, only one of the search requirements has to match.

const (
	WAFPackageGroupListParamsMatchAny WAFPackageGroupListParamsMatch = "any"
	WAFPackageGroupListParamsMatchAll WAFPackageGroupListParamsMatch = "all"
)

func (WAFPackageGroupListParamsMatch) IsKnown

type WAFPackageGroupListParamsMode

type WAFPackageGroupListParamsMode string

The state of the rules contained in the rule group. When `on`, the rules in the group are configurable/usable.

const (
	WAFPackageGroupListParamsModeOn  WAFPackageGroupListParamsMode = "on"
	WAFPackageGroupListParamsModeOff WAFPackageGroupListParamsMode = "off"
)

func (WAFPackageGroupListParamsMode) IsKnown

func (r WAFPackageGroupListParamsMode) IsKnown() bool

type WAFPackageGroupListParamsOrder

type WAFPackageGroupListParamsOrder string

The field used to sort returned rule groups.

const (
	WAFPackageGroupListParamsOrderMode       WAFPackageGroupListParamsOrder = "mode"
	WAFPackageGroupListParamsOrderRulesCount WAFPackageGroupListParamsOrder = "rules_count"
)

func (WAFPackageGroupListParamsOrder) IsKnown

type WAFPackageGroupService

type WAFPackageGroupService struct {
	Options []option.RequestOption
}

WAFPackageGroupService 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 NewWAFPackageGroupService method instead.

func NewWAFPackageGroupService

func NewWAFPackageGroupService(opts ...option.RequestOption) (r *WAFPackageGroupService)

NewWAFPackageGroupService 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 (*WAFPackageGroupService) Edit

Updates a WAF rule group. You can update the state (`mode` parameter) of a rule group.

**Note:** Applies only to the [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).

func (*WAFPackageGroupService) Get

Fetches the details of a WAF rule group.

**Note:** Applies only to the [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).

func (*WAFPackageGroupService) List

Fetches the WAF rule groups in a WAF package.

**Note:** Applies only to the [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).

func (*WAFPackageGroupService) ListAutoPaging

Fetches the WAF rule groups in a WAF package.

**Note:** Applies only to the [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).

type WAFPackageListParams

type WAFPackageListParams struct {
	// The direction used to sort returned packages.
	Direction param.Field[WAFPackageListParamsDirection] `query:"direction"`
	// When set to `all`, all the search requirements must match. When set to `any`,
	// only one of the search requirements has to match.
	Match param.Field[WAFPackageListParamsMatch] `query:"match"`
	// The name of the WAF package.
	Name param.Field[string] `query:"name"`
	// The field used to sort returned packages.
	Order param.Field[WAFPackageListParamsOrder] `query:"order"`
	// The page number of paginated results.
	Page param.Field[float64] `query:"page"`
	// The number of packages per page.
	PerPage param.Field[float64] `query:"per_page"`
}

func (WAFPackageListParams) URLQuery

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

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

type WAFPackageListParamsDirection

type WAFPackageListParamsDirection string

The direction used to sort returned packages.

const (
	WAFPackageListParamsDirectionAsc  WAFPackageListParamsDirection = "asc"
	WAFPackageListParamsDirectionDesc WAFPackageListParamsDirection = "desc"
)

func (WAFPackageListParamsDirection) IsKnown

func (r WAFPackageListParamsDirection) IsKnown() bool

type WAFPackageListParamsMatch

type WAFPackageListParamsMatch string

When set to `all`, all the search requirements must match. When set to `any`, only one of the search requirements has to match.

const (
	WAFPackageListParamsMatchAny WAFPackageListParamsMatch = "any"
	WAFPackageListParamsMatchAll WAFPackageListParamsMatch = "all"
)

func (WAFPackageListParamsMatch) IsKnown

func (r WAFPackageListParamsMatch) IsKnown() bool

type WAFPackageListParamsOrder

type WAFPackageListParamsOrder string

The field used to sort returned packages.

const (
	WAFPackageListParamsOrderName WAFPackageListParamsOrder = "name"
)

func (WAFPackageListParamsOrder) IsKnown

func (r WAFPackageListParamsOrder) IsKnown() bool

type WAFPackageListResponse

type WAFPackageListResponse struct {
	Errors   interface{} `json:"errors,required"`
	Messages interface{} `json:"messages,required"`
	Result   interface{} `json:"result,required"`
	// Whether the API call was successful
	Success    WAFPackageListResponseSuccess `json:"success"`
	ResultInfo interface{}                   `json:"result_info,required"`
	JSON       wafPackageListResponseJSON    `json:"-"`
	// contains filtered or unexported fields
}

func (WAFPackageListResponse) AsUnion

func (*WAFPackageListResponse) UnmarshalJSON

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

type WAFPackageListResponseFirewallAPIResponseCollection

type WAFPackageListResponseFirewallAPIResponseCollection struct {
	Errors   []shared.ResponseInfo                                          `json:"errors,required"`
	Messages []shared.ResponseInfo                                          `json:"messages,required"`
	Result   WAFPackageListResponseFirewallAPIResponseCollectionResultUnion `json:"result,required,nullable"`
	// Whether the API call was successful
	Success    WAFPackageListResponseFirewallAPIResponseCollectionSuccess    `json:"success,required"`
	ResultInfo WAFPackageListResponseFirewallAPIResponseCollectionResultInfo `json:"result_info"`
	JSON       wafPackageListResponseFirewallAPIResponseCollectionJSON       `json:"-"`
}

func (*WAFPackageListResponseFirewallAPIResponseCollection) UnmarshalJSON

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

type WAFPackageListResponseFirewallAPIResponseCollectionResultArray

type WAFPackageListResponseFirewallAPIResponseCollectionResultArray []interface{}

func (WAFPackageListResponseFirewallAPIResponseCollectionResultArray) ImplementsFirewallWAFPackageListResponseFirewallAPIResponseCollectionResultUnion

func (r WAFPackageListResponseFirewallAPIResponseCollectionResultArray) ImplementsFirewallWAFPackageListResponseFirewallAPIResponseCollectionResultUnion()

type WAFPackageListResponseFirewallAPIResponseCollectionResultInfo

type WAFPackageListResponseFirewallAPIResponseCollectionResultInfo struct {
	// Total number of results for the requested service
	Count float64 `json:"count"`
	// Current page within paginated list of results
	Page float64 `json:"page"`
	// Number of results per page of results
	PerPage float64 `json:"per_page"`
	// Total results available without any search parameters
	TotalCount float64                                                           `json:"total_count"`
	JSON       wafPackageListResponseFirewallAPIResponseCollectionResultInfoJSON `json:"-"`
}

func (*WAFPackageListResponseFirewallAPIResponseCollectionResultInfo) UnmarshalJSON

type WAFPackageListResponseFirewallAPIResponseCollectionResultUnion

type WAFPackageListResponseFirewallAPIResponseCollectionResultUnion interface {
	ImplementsFirewallWAFPackageListResponseFirewallAPIResponseCollectionResultUnion()
}

Union satisfied by firewall.WAFPackageListResponseFirewallAPIResponseCollectionResultUnknown, firewall.WAFPackageListResponseFirewallAPIResponseCollectionResultArray or shared.UnionString.

type WAFPackageListResponseFirewallAPIResponseCollectionSuccess

type WAFPackageListResponseFirewallAPIResponseCollectionSuccess bool

Whether the API call was successful

const (
	WAFPackageListResponseFirewallAPIResponseCollectionSuccessTrue WAFPackageListResponseFirewallAPIResponseCollectionSuccess = true
)

func (WAFPackageListResponseFirewallAPIResponseCollectionSuccess) IsKnown

type WAFPackageListResponseObject

type WAFPackageListResponseObject struct {
	Result []WAFPackageListResponseObjectResult `json:"result"`
	JSON   wafPackageListResponseObjectJSON     `json:"-"`
}

func (*WAFPackageListResponseObject) UnmarshalJSON

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

type WAFPackageListResponseObjectResult

type WAFPackageListResponseObjectResult struct {
	// A summary of the purpose/function of the WAF package.
	Description string `json:"description,required"`
	// The mode that defines how rules within the package are evaluated during the
	// course of a request. When a package uses anomaly detection mode (`anomaly`
	// value), each rule is given a score when triggered. If the total score of all
	// triggered rules exceeds the sensitivity defined in the WAF package, the action
	// configured in the package will be performed. Traditional detection mode
	// (`traditional` value) will decide the action to take when it is triggered by the
	// request. If multiple rules are triggered, the action providing the highest
	// protection will be applied (for example, a 'block' action will win over a
	// 'challenge' action).
	DetectionMode WAFPackageListResponseObjectResultDetectionMode `json:"detection_mode,required"`
	// Identifier
	ID string `json:"id,required"`
	// The name of the WAF package.
	Name string `json:"name,required"`
	// When set to `active`, indicates that the WAF package will be applied to the
	// zone.
	Status WAFPackageListResponseObjectResultStatus `json:"status"`
	// Identifier
	ZoneID string `json:"zone_id,required"`
	// The default action performed by the rules in the WAF package.
	ActionMode WAFPackageListResponseObjectResultActionMode `json:"action_mode"`
	// The sensitivity of the WAF package.
	Sensitivity WAFPackageListResponseObjectResultSensitivity `json:"sensitivity"`
	JSON        wafPackageListResponseObjectResultJSON        `json:"-"`
	// contains filtered or unexported fields
}

func (WAFPackageListResponseObjectResult) AsUnion

func (*WAFPackageListResponseObjectResult) UnmarshalJSON

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

type WAFPackageListResponseObjectResultActionMode

type WAFPackageListResponseObjectResultActionMode string

The default action performed by the rules in the WAF package.

const (
	WAFPackageListResponseObjectResultActionModeSimulate  WAFPackageListResponseObjectResultActionMode = "simulate"
	WAFPackageListResponseObjectResultActionModeBlock     WAFPackageListResponseObjectResultActionMode = "block"
	WAFPackageListResponseObjectResultActionModeChallenge WAFPackageListResponseObjectResultActionMode = "challenge"
)

func (WAFPackageListResponseObjectResultActionMode) IsKnown

type WAFPackageListResponseObjectResultDetectionMode

type WAFPackageListResponseObjectResultDetectionMode string

The mode that defines how rules within the package are evaluated during the course of a request. When a package uses anomaly detection mode (`anomaly` value), each rule is given a score when triggered. If the total score of all triggered rules exceeds the sensitivity defined in the WAF package, the action configured in the package will be performed. Traditional detection mode (`traditional` value) will decide the action to take when it is triggered by the request. If multiple rules are triggered, the action providing the highest protection will be applied (for example, a 'block' action will win over a 'challenge' action).

const (
	WAFPackageListResponseObjectResultDetectionModeAnomaly     WAFPackageListResponseObjectResultDetectionMode = "anomaly"
	WAFPackageListResponseObjectResultDetectionModeTraditional WAFPackageListResponseObjectResultDetectionMode = "traditional"
)

func (WAFPackageListResponseObjectResultDetectionMode) IsKnown

type WAFPackageListResponseObjectResultFirewallAnomalyPackage

type WAFPackageListResponseObjectResultFirewallAnomalyPackage struct {
	// Identifier
	ID string `json:"id,required"`
	// A summary of the purpose/function of the WAF package.
	Description string `json:"description,required"`
	// When a WAF package uses anomaly detection, each rule is given a score when
	// triggered. If the total score of all triggered rules exceeds the sensitivity
	// defined on the WAF package, the action defined on the package will be taken.
	DetectionMode WAFPackageListResponseObjectResultFirewallAnomalyPackageDetectionMode `json:"detection_mode,required"`
	// The name of the WAF package.
	Name string `json:"name,required"`
	// Identifier
	ZoneID string `json:"zone_id,required"`
	// The default action performed by the rules in the WAF package.
	ActionMode WAFPackageListResponseObjectResultFirewallAnomalyPackageActionMode `json:"action_mode"`
	// The sensitivity of the WAF package.
	Sensitivity WAFPackageListResponseObjectResultFirewallAnomalyPackageSensitivity `json:"sensitivity"`
	// When set to `active`, indicates that the WAF package will be applied to the
	// zone.
	Status WAFPackageListResponseObjectResultFirewallAnomalyPackageStatus `json:"status"`
	JSON   wafPackageListResponseObjectResultFirewallAnomalyPackageJSON   `json:"-"`
}

func (*WAFPackageListResponseObjectResultFirewallAnomalyPackage) UnmarshalJSON

type WAFPackageListResponseObjectResultFirewallAnomalyPackageActionMode

type WAFPackageListResponseObjectResultFirewallAnomalyPackageActionMode string

The default action performed by the rules in the WAF package.

const (
	WAFPackageListResponseObjectResultFirewallAnomalyPackageActionModeSimulate  WAFPackageListResponseObjectResultFirewallAnomalyPackageActionMode = "simulate"
	WAFPackageListResponseObjectResultFirewallAnomalyPackageActionModeBlock     WAFPackageListResponseObjectResultFirewallAnomalyPackageActionMode = "block"
	WAFPackageListResponseObjectResultFirewallAnomalyPackageActionModeChallenge WAFPackageListResponseObjectResultFirewallAnomalyPackageActionMode = "challenge"
)

func (WAFPackageListResponseObjectResultFirewallAnomalyPackageActionMode) IsKnown

type WAFPackageListResponseObjectResultFirewallAnomalyPackageDetectionMode

type WAFPackageListResponseObjectResultFirewallAnomalyPackageDetectionMode string

When a WAF package uses anomaly detection, each rule is given a score when triggered. If the total score of all triggered rules exceeds the sensitivity defined on the WAF package, the action defined on the package will be taken.

const (
	WAFPackageListResponseObjectResultFirewallAnomalyPackageDetectionModeAnomaly     WAFPackageListResponseObjectResultFirewallAnomalyPackageDetectionMode = "anomaly"
	WAFPackageListResponseObjectResultFirewallAnomalyPackageDetectionModeTraditional WAFPackageListResponseObjectResultFirewallAnomalyPackageDetectionMode = "traditional"
)

func (WAFPackageListResponseObjectResultFirewallAnomalyPackageDetectionMode) IsKnown

type WAFPackageListResponseObjectResultFirewallAnomalyPackageSensitivity

type WAFPackageListResponseObjectResultFirewallAnomalyPackageSensitivity string

The sensitivity of the WAF package.

const (
	WAFPackageListResponseObjectResultFirewallAnomalyPackageSensitivityHigh   WAFPackageListResponseObjectResultFirewallAnomalyPackageSensitivity = "high"
	WAFPackageListResponseObjectResultFirewallAnomalyPackageSensitivityMedium WAFPackageListResponseObjectResultFirewallAnomalyPackageSensitivity = "medium"
	WAFPackageListResponseObjectResultFirewallAnomalyPackageSensitivityLow    WAFPackageListResponseObjectResultFirewallAnomalyPackageSensitivity = "low"
	WAFPackageListResponseObjectResultFirewallAnomalyPackageSensitivityOff    WAFPackageListResponseObjectResultFirewallAnomalyPackageSensitivity = "off"
)

func (WAFPackageListResponseObjectResultFirewallAnomalyPackageSensitivity) IsKnown

type WAFPackageListResponseObjectResultFirewallAnomalyPackageStatus

type WAFPackageListResponseObjectResultFirewallAnomalyPackageStatus string

When set to `active`, indicates that the WAF package will be applied to the zone.

const (
	WAFPackageListResponseObjectResultFirewallAnomalyPackageStatusActive WAFPackageListResponseObjectResultFirewallAnomalyPackageStatus = "active"
)

func (WAFPackageListResponseObjectResultFirewallAnomalyPackageStatus) IsKnown

type WAFPackageListResponseObjectResultFirewallPackageDefinition

type WAFPackageListResponseObjectResultFirewallPackageDefinition struct {
	// Identifier
	ID string `json:"id,required"`
	// A summary of the purpose/function of the WAF package.
	Description string `json:"description,required"`
	// The mode that defines how rules within the package are evaluated during the
	// course of a request. When a package uses anomaly detection mode (`anomaly`
	// value), each rule is given a score when triggered. If the total score of all
	// triggered rules exceeds the sensitivity defined in the WAF package, the action
	// configured in the package will be performed. Traditional detection mode
	// (`traditional` value) will decide the action to take when it is triggered by the
	// request. If multiple rules are triggered, the action providing the highest
	// protection will be applied (for example, a 'block' action will win over a
	// 'challenge' action).
	DetectionMode WAFPackageListResponseObjectResultFirewallPackageDefinitionDetectionMode `json:"detection_mode,required"`
	// The name of the WAF package.
	Name string `json:"name,required"`
	// Identifier
	ZoneID string `json:"zone_id,required"`
	// When set to `active`, indicates that the WAF package will be applied to the
	// zone.
	Status WAFPackageListResponseObjectResultFirewallPackageDefinitionStatus `json:"status"`
	JSON   wafPackageListResponseObjectResultFirewallPackageDefinitionJSON   `json:"-"`
}

func (*WAFPackageListResponseObjectResultFirewallPackageDefinition) UnmarshalJSON

type WAFPackageListResponseObjectResultFirewallPackageDefinitionDetectionMode

type WAFPackageListResponseObjectResultFirewallPackageDefinitionDetectionMode string

The mode that defines how rules within the package are evaluated during the course of a request. When a package uses anomaly detection mode (`anomaly` value), each rule is given a score when triggered. If the total score of all triggered rules exceeds the sensitivity defined in the WAF package, the action configured in the package will be performed. Traditional detection mode (`traditional` value) will decide the action to take when it is triggered by the request. If multiple rules are triggered, the action providing the highest protection will be applied (for example, a 'block' action will win over a 'challenge' action).

const (
	WAFPackageListResponseObjectResultFirewallPackageDefinitionDetectionModeAnomaly     WAFPackageListResponseObjectResultFirewallPackageDefinitionDetectionMode = "anomaly"
	WAFPackageListResponseObjectResultFirewallPackageDefinitionDetectionModeTraditional WAFPackageListResponseObjectResultFirewallPackageDefinitionDetectionMode = "traditional"
)

func (WAFPackageListResponseObjectResultFirewallPackageDefinitionDetectionMode) IsKnown

type WAFPackageListResponseObjectResultFirewallPackageDefinitionStatus

type WAFPackageListResponseObjectResultFirewallPackageDefinitionStatus string

When set to `active`, indicates that the WAF package will be applied to the zone.

const (
	WAFPackageListResponseObjectResultFirewallPackageDefinitionStatusActive WAFPackageListResponseObjectResultFirewallPackageDefinitionStatus = "active"
)

func (WAFPackageListResponseObjectResultFirewallPackageDefinitionStatus) IsKnown

type WAFPackageListResponseObjectResultSensitivity

type WAFPackageListResponseObjectResultSensitivity string

The sensitivity of the WAF package.

const (
	WAFPackageListResponseObjectResultSensitivityHigh   WAFPackageListResponseObjectResultSensitivity = "high"
	WAFPackageListResponseObjectResultSensitivityMedium WAFPackageListResponseObjectResultSensitivity = "medium"
	WAFPackageListResponseObjectResultSensitivityLow    WAFPackageListResponseObjectResultSensitivity = "low"
	WAFPackageListResponseObjectResultSensitivityOff    WAFPackageListResponseObjectResultSensitivity = "off"
)

func (WAFPackageListResponseObjectResultSensitivity) IsKnown

type WAFPackageListResponseObjectResultStatus

type WAFPackageListResponseObjectResultStatus string

When set to `active`, indicates that the WAF package will be applied to the zone.

const (
	WAFPackageListResponseObjectResultStatusActive WAFPackageListResponseObjectResultStatus = "active"
)

func (WAFPackageListResponseObjectResultStatus) IsKnown

type WAFPackageListResponseObjectResultUnion

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

Union satisfied by firewall.WAFPackageListResponseObjectResultFirewallPackageDefinition or firewall.WAFPackageListResponseObjectResultFirewallAnomalyPackage.

type WAFPackageListResponseSuccess

type WAFPackageListResponseSuccess bool

Whether the API call was successful

const (
	WAFPackageListResponseSuccessTrue WAFPackageListResponseSuccess = true
)

func (WAFPackageListResponseSuccess) IsKnown

func (r WAFPackageListResponseSuccess) IsKnown() bool

type WAFPackageListResponseUnion

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

Union satisfied by firewall.WAFPackageListResponseFirewallAPIResponseCollection or firewall.WAFPackageListResponseObject.

type WAFPackageRuleEditParams

type WAFPackageRuleEditParams struct {
	// Identifier
	ZoneID param.Field[string] `path:"zone_id,required"`
	// The mode/action of the rule when triggered. You must use a value from the
	// `allowed_modes` array of the current rule.
	Mode param.Field[WAFPackageRuleEditParamsMode] `json:"mode"`
}

func (WAFPackageRuleEditParams) MarshalJSON

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

type WAFPackageRuleEditParamsMode

type WAFPackageRuleEditParamsMode string

The mode/action of the rule when triggered. You must use a value from the `allowed_modes` array of the current rule.

const (
	WAFPackageRuleEditParamsModeDefault   WAFPackageRuleEditParamsMode = "default"
	WAFPackageRuleEditParamsModeDisable   WAFPackageRuleEditParamsMode = "disable"
	WAFPackageRuleEditParamsModeSimulate  WAFPackageRuleEditParamsMode = "simulate"
	WAFPackageRuleEditParamsModeBlock     WAFPackageRuleEditParamsMode = "block"
	WAFPackageRuleEditParamsModeChallenge WAFPackageRuleEditParamsMode = "challenge"
	WAFPackageRuleEditParamsModeOn        WAFPackageRuleEditParamsMode = "on"
	WAFPackageRuleEditParamsModeOff       WAFPackageRuleEditParamsMode = "off"
)

func (WAFPackageRuleEditParamsMode) IsKnown

func (r WAFPackageRuleEditParamsMode) IsKnown() bool

type WAFPackageRuleEditResponse

type WAFPackageRuleEditResponse struct {
	// The public description of the WAF rule.
	Description string `json:"description,required"`
	// The rule group to which the current WAF rule belongs.
	Group WAFRuleGroup `json:"group,required"`
	// The unique identifier of the WAF rule.
	ID string `json:"id,required"`
	// The unique identifier of a WAF package.
	PackageID string `json:"package_id,required"`
	// The order in which the individual WAF rule is executed within its rule group.
	Priority     string      `json:"priority,required"`
	AllowedModes interface{} `json:"allowed_modes"`
	// When set to `on`, the current WAF rule will be used when evaluating the request.
	// Applies to anomaly detection WAF rules.
	Mode        AllowedModesAnomaly            `json:"mode,required"`
	DefaultMode interface{}                    `json:"default_mode,required"`
	JSON        wafPackageRuleEditResponseJSON `json:"-"`
	// contains filtered or unexported fields
}

When triggered, anomaly detection WAF rules contribute to an overall threat score that will determine if a request is considered malicious. You can configure the total scoring threshold through the 'sensitivity' property of the WAF package.

func (WAFPackageRuleEditResponse) AsUnion

func (*WAFPackageRuleEditResponse) UnmarshalJSON

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

type WAFPackageRuleEditResponseEnvelope

type WAFPackageRuleEditResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	// When triggered, anomaly detection WAF rules contribute to an overall threat
	// score that will determine if a request is considered malicious. You can
	// configure the total scoring threshold through the 'sensitivity' property of the
	// WAF package.
	Result WAFPackageRuleEditResponse `json:"result,required"`
	// Whether the API call was successful
	Success WAFPackageRuleEditResponseEnvelopeSuccess `json:"success,required"`
	JSON    wafPackageRuleEditResponseEnvelopeJSON    `json:"-"`
}

func (*WAFPackageRuleEditResponseEnvelope) UnmarshalJSON

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

type WAFPackageRuleEditResponseEnvelopeSuccess

type WAFPackageRuleEditResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	WAFPackageRuleEditResponseEnvelopeSuccessTrue WAFPackageRuleEditResponseEnvelopeSuccess = true
)

func (WAFPackageRuleEditResponseEnvelopeSuccess) IsKnown

type WAFPackageRuleEditResponseUnion

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

When triggered, anomaly detection WAF rules contribute to an overall threat score that will determine if a request is considered malicious. You can configure the total scoring threshold through the 'sensitivity' property of the WAF package.

Union satisfied by firewall.WAFPackageRuleEditResponseWAFManagedRulesAnomalyRule, firewall.WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRule or firewall.WAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRule.

type WAFPackageRuleEditResponseWAFManagedRulesAnomalyRule

type WAFPackageRuleEditResponseWAFManagedRulesAnomalyRule struct {
	// The unique identifier of the WAF rule.
	ID string `json:"id,required"`
	// Defines the available modes for the current WAF rule. Applies to anomaly
	// detection WAF rules.
	AllowedModes []AllowedModesAnomaly `json:"allowed_modes,required"`
	// The public description of the WAF rule.
	Description string `json:"description,required"`
	// The rule group to which the current WAF rule belongs.
	Group WAFRuleGroup `json:"group,required"`
	// When set to `on`, the current WAF rule will be used when evaluating the request.
	// Applies to anomaly detection WAF rules.
	Mode AllowedModesAnomaly `json:"mode,required"`
	// The unique identifier of a WAF package.
	PackageID string `json:"package_id,required"`
	// The order in which the individual WAF rule is executed within its rule group.
	Priority string                                                   `json:"priority,required"`
	JSON     wafPackageRuleEditResponseWAFManagedRulesAnomalyRuleJSON `json:"-"`
}

When triggered, anomaly detection WAF rules contribute to an overall threat score that will determine if a request is considered malicious. You can configure the total scoring threshold through the 'sensitivity' property of the WAF package.

func (*WAFPackageRuleEditResponseWAFManagedRulesAnomalyRule) UnmarshalJSON

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

type WAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRule

type WAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRule struct {
	// The unique identifier of the WAF rule.
	ID string `json:"id,required"`
	// Defines the available modes for the current WAF rule.
	AllowedModes []WAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleAllowedMode `json:"allowed_modes,required"`
	DefaultMode  interface{}                                                                `json:"default_mode,required"`
	// The public description of the WAF rule.
	Description string `json:"description,required"`
	// The rule group to which the current WAF rule belongs.
	Group WAFRuleGroup `json:"group,required"`
	// When set to `on`, the current rule will be used when evaluating the request.
	// Applies to traditional (allow) WAF rules.
	Mode WAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleMode `json:"mode,required"`
	// The unique identifier of a WAF package.
	PackageID string `json:"package_id,required"`
	// The order in which the individual WAF rule is executed within its rule group.
	Priority string                                                            `json:"priority,required"`
	JSON     wafPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleJSON `json:"-"`
}

When triggered, traditional WAF rules cause the firewall to immediately act on the request based on the rule configuration. An 'allow' rule will immediately allow the request and no other rules will be processed.

func (*WAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRule) UnmarshalJSON

type WAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleAllowedMode

type WAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleAllowedMode string

When set to `on`, the current rule will be used when evaluating the request. Applies to traditional (allow) WAF rules.

const (
	WAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleAllowedModeOn  WAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleAllowedMode = "on"
	WAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleAllowedModeOff WAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleAllowedMode = "off"
)

func (WAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleAllowedMode) IsKnown

type WAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleMode

type WAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleMode string

When set to `on`, the current rule will be used when evaluating the request. Applies to traditional (allow) WAF rules.

const (
	WAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleModeOn  WAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleMode = "on"
	WAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleModeOff WAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleMode = "off"
)

func (WAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleMode) IsKnown

type WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRule

type WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRule struct {
	// The unique identifier of the WAF rule.
	ID string `json:"id,required"`
	// The list of possible actions of the WAF rule when it is triggered.
	AllowedModes []WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleAllowedMode `json:"allowed_modes,required"`
	// The default action/mode of a rule.
	DefaultMode WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleDefaultMode `json:"default_mode,required"`
	// The public description of the WAF rule.
	Description string `json:"description,required"`
	// The rule group to which the current WAF rule belongs.
	Group WAFRuleGroup `json:"group,required"`
	// The action that the current WAF rule will perform when triggered. Applies to
	// traditional (deny) WAF rules.
	Mode WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleMode `json:"mode,required"`
	// The unique identifier of a WAF package.
	PackageID string `json:"package_id,required"`
	// The order in which the individual WAF rule is executed within its rule group.
	Priority string                                                           `json:"priority,required"`
	JSON     wafPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleJSON `json:"-"`
}

When triggered, traditional WAF rules cause the firewall to immediately act upon the request based on the configuration of the rule. A 'deny' rule will immediately respond to the request based on the configured rule action/mode (for example, 'block') and no other rules will be processed.

func (*WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRule) UnmarshalJSON

type WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleAllowedMode

type WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleAllowedMode string

The action that the current WAF rule will perform when triggered. Applies to traditional (deny) WAF rules.

const (
	WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleAllowedModeDefault   WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleAllowedMode = "default"
	WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleAllowedModeDisable   WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleAllowedMode = "disable"
	WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleAllowedModeSimulate  WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleAllowedMode = "simulate"
	WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleAllowedModeBlock     WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleAllowedMode = "block"
	WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleAllowedModeChallenge WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleAllowedMode = "challenge"
)

func (WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleAllowedMode) IsKnown

type WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleDefaultMode

type WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleDefaultMode string

The default action/mode of a rule.

const (
	WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleDefaultModeDisable   WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleDefaultMode = "disable"
	WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleDefaultModeSimulate  WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleDefaultMode = "simulate"
	WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleDefaultModeBlock     WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleDefaultMode = "block"
	WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleDefaultModeChallenge WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleDefaultMode = "challenge"
)

func (WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleDefaultMode) IsKnown

type WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleMode

type WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleMode string

The action that the current WAF rule will perform when triggered. Applies to traditional (deny) WAF rules.

const (
	WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleModeDefault   WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleMode = "default"
	WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleModeDisable   WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleMode = "disable"
	WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleModeSimulate  WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleMode = "simulate"
	WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleModeBlock     WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleMode = "block"
	WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleModeChallenge WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleMode = "challenge"
)

func (WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleMode) IsKnown

type WAFPackageRuleGetParams

type WAFPackageRuleGetParams struct {
	// Identifier
	ZoneID param.Field[string] `path:"zone_id,required"`
}

type WAFPackageRuleGetResponseEnvelope

type WAFPackageRuleGetResponseEnvelope struct {
	Errors   []shared.ResponseInfo          `json:"errors,required"`
	Messages []shared.ResponseInfo          `json:"messages,required"`
	Result   WAFPackageRuleGetResponseUnion `json:"result,required"`
	// Whether the API call was successful
	Success WAFPackageRuleGetResponseEnvelopeSuccess `json:"success,required"`
	JSON    wafPackageRuleGetResponseEnvelopeJSON    `json:"-"`
}

func (*WAFPackageRuleGetResponseEnvelope) UnmarshalJSON

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

type WAFPackageRuleGetResponseEnvelopeSuccess

type WAFPackageRuleGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	WAFPackageRuleGetResponseEnvelopeSuccessTrue WAFPackageRuleGetResponseEnvelopeSuccess = true
)

func (WAFPackageRuleGetResponseEnvelopeSuccess) IsKnown

type WAFPackageRuleGetResponseUnion

type WAFPackageRuleGetResponseUnion interface {
	ImplementsFirewallWAFPackageRuleGetResponseUnion()
}

Union satisfied by firewall.WAFPackageRuleGetResponseUnknown or shared.UnionString.

type WAFPackageRuleListParams

type WAFPackageRuleListParams struct {
	// Identifier
	ZoneID param.Field[string] `path:"zone_id,required"`
	// The public description of the WAF rule.
	Description param.Field[string] `query:"description"`
	// The direction used to sort returned rules.
	Direction param.Field[WAFPackageRuleListParamsDirection] `query:"direction"`
	// The unique identifier of the rule group.
	GroupID param.Field[string] `query:"group_id"`
	// When set to `all`, all the search requirements must match. When set to `any`,
	// only one of the search requirements has to match.
	Match param.Field[WAFPackageRuleListParamsMatch] `query:"match"`
	// The action/mode a rule has been overridden to perform.
	Mode param.Field[WAFPackageRuleListParamsMode] `query:"mode"`
	// The field used to sort returned rules.
	Order param.Field[WAFPackageRuleListParamsOrder] `query:"order"`
	// The page number of paginated results.
	Page param.Field[float64] `query:"page"`
	// The number of rules per page.
	PerPage param.Field[float64] `query:"per_page"`
	// The order in which the individual WAF rule is executed within its rule group.
	Priority param.Field[string] `query:"priority"`
}

func (WAFPackageRuleListParams) URLQuery

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

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

type WAFPackageRuleListParamsDirection

type WAFPackageRuleListParamsDirection string

The direction used to sort returned rules.

const (
	WAFPackageRuleListParamsDirectionAsc  WAFPackageRuleListParamsDirection = "asc"
	WAFPackageRuleListParamsDirectionDesc WAFPackageRuleListParamsDirection = "desc"
)

func (WAFPackageRuleListParamsDirection) IsKnown

type WAFPackageRuleListParamsMatch

type WAFPackageRuleListParamsMatch string

When set to `all`, all the search requirements must match. When set to `any`, only one of the search requirements has to match.

const (
	WAFPackageRuleListParamsMatchAny WAFPackageRuleListParamsMatch = "any"
	WAFPackageRuleListParamsMatchAll WAFPackageRuleListParamsMatch = "all"
)

func (WAFPackageRuleListParamsMatch) IsKnown

func (r WAFPackageRuleListParamsMatch) IsKnown() bool

type WAFPackageRuleListParamsMode

type WAFPackageRuleListParamsMode string

The action/mode a rule has been overridden to perform.

const (
	WAFPackageRuleListParamsModeDis WAFPackageRuleListParamsMode = "DIS"
	WAFPackageRuleListParamsModeChl WAFPackageRuleListParamsMode = "CHL"
	WAFPackageRuleListParamsModeBlk WAFPackageRuleListParamsMode = "BLK"
	WAFPackageRuleListParamsModeSim WAFPackageRuleListParamsMode = "SIM"
)

func (WAFPackageRuleListParamsMode) IsKnown

func (r WAFPackageRuleListParamsMode) IsKnown() bool

type WAFPackageRuleListParamsOrder

type WAFPackageRuleListParamsOrder string

The field used to sort returned rules.

const (
	WAFPackageRuleListParamsOrderPriority    WAFPackageRuleListParamsOrder = "priority"
	WAFPackageRuleListParamsOrderGroupID     WAFPackageRuleListParamsOrder = "group_id"
	WAFPackageRuleListParamsOrderDescription WAFPackageRuleListParamsOrder = "description"
)

func (WAFPackageRuleListParamsOrder) IsKnown

func (r WAFPackageRuleListParamsOrder) IsKnown() bool

type WAFPackageRuleListResponse

type WAFPackageRuleListResponse struct {
	// The public description of the WAF rule.
	Description string `json:"description,required"`
	// The rule group to which the current WAF rule belongs.
	Group WAFRuleGroup `json:"group,required"`
	// The unique identifier of the WAF rule.
	ID string `json:"id,required"`
	// The unique identifier of a WAF package.
	PackageID string `json:"package_id,required"`
	// The order in which the individual WAF rule is executed within its rule group.
	Priority     string      `json:"priority,required"`
	AllowedModes interface{} `json:"allowed_modes"`
	// When set to `on`, the current WAF rule will be used when evaluating the request.
	// Applies to anomaly detection WAF rules.
	Mode        AllowedModesAnomaly            `json:"mode,required"`
	DefaultMode interface{}                    `json:"default_mode,required"`
	JSON        wafPackageRuleListResponseJSON `json:"-"`
	// contains filtered or unexported fields
}

When triggered, anomaly detection WAF rules contribute to an overall threat score that will determine if a request is considered malicious. You can configure the total scoring threshold through the 'sensitivity' property of the WAF package.

func (WAFPackageRuleListResponse) AsUnion

func (*WAFPackageRuleListResponse) UnmarshalJSON

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

type WAFPackageRuleListResponseUnion

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

When triggered, anomaly detection WAF rules contribute to an overall threat score that will determine if a request is considered malicious. You can configure the total scoring threshold through the 'sensitivity' property of the WAF package.

Union satisfied by firewall.WAFPackageRuleListResponseWAFManagedRulesAnomalyRule, firewall.WAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRule or firewall.WAFPackageRuleListResponseWAFManagedRulesTraditionalAllowRule.

type WAFPackageRuleListResponseWAFManagedRulesAnomalyRule

type WAFPackageRuleListResponseWAFManagedRulesAnomalyRule struct {
	// The unique identifier of the WAF rule.
	ID string `json:"id,required"`
	// Defines the available modes for the current WAF rule. Applies to anomaly
	// detection WAF rules.
	AllowedModes []AllowedModesAnomaly `json:"allowed_modes,required"`
	// The public description of the WAF rule.
	Description string `json:"description,required"`
	// The rule group to which the current WAF rule belongs.
	Group WAFRuleGroup `json:"group,required"`
	// When set to `on`, the current WAF rule will be used when evaluating the request.
	// Applies to anomaly detection WAF rules.
	Mode AllowedModesAnomaly `json:"mode,required"`
	// The unique identifier of a WAF package.
	PackageID string `json:"package_id,required"`
	// The order in which the individual WAF rule is executed within its rule group.
	Priority string                                                   `json:"priority,required"`
	JSON     wafPackageRuleListResponseWAFManagedRulesAnomalyRuleJSON `json:"-"`
}

When triggered, anomaly detection WAF rules contribute to an overall threat score that will determine if a request is considered malicious. You can configure the total scoring threshold through the 'sensitivity' property of the WAF package.

func (*WAFPackageRuleListResponseWAFManagedRulesAnomalyRule) UnmarshalJSON

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

type WAFPackageRuleListResponseWAFManagedRulesTraditionalAllowRule

type WAFPackageRuleListResponseWAFManagedRulesTraditionalAllowRule struct {
	// The unique identifier of the WAF rule.
	ID string `json:"id,required"`
	// Defines the available modes for the current WAF rule.
	AllowedModes []WAFPackageRuleListResponseWAFManagedRulesTraditionalAllowRuleAllowedMode `json:"allowed_modes,required"`
	DefaultMode  interface{}                                                                `json:"default_mode,required"`
	// The public description of the WAF rule.
	Description string `json:"description,required"`
	// The rule group to which the current WAF rule belongs.
	Group WAFRuleGroup `json:"group,required"`
	// When set to `on`, the current rule will be used when evaluating the request.
	// Applies to traditional (allow) WAF rules.
	Mode WAFPackageRuleListResponseWAFManagedRulesTraditionalAllowRuleMode `json:"mode,required"`
	// The unique identifier of a WAF package.
	PackageID string `json:"package_id,required"`
	// The order in which the individual WAF rule is executed within its rule group.
	Priority string                                                            `json:"priority,required"`
	JSON     wafPackageRuleListResponseWAFManagedRulesTraditionalAllowRuleJSON `json:"-"`
}

When triggered, traditional WAF rules cause the firewall to immediately act on the request based on the rule configuration. An 'allow' rule will immediately allow the request and no other rules will be processed.

func (*WAFPackageRuleListResponseWAFManagedRulesTraditionalAllowRule) UnmarshalJSON

type WAFPackageRuleListResponseWAFManagedRulesTraditionalAllowRuleAllowedMode

type WAFPackageRuleListResponseWAFManagedRulesTraditionalAllowRuleAllowedMode string

When set to `on`, the current rule will be used when evaluating the request. Applies to traditional (allow) WAF rules.

const (
	WAFPackageRuleListResponseWAFManagedRulesTraditionalAllowRuleAllowedModeOn  WAFPackageRuleListResponseWAFManagedRulesTraditionalAllowRuleAllowedMode = "on"
	WAFPackageRuleListResponseWAFManagedRulesTraditionalAllowRuleAllowedModeOff WAFPackageRuleListResponseWAFManagedRulesTraditionalAllowRuleAllowedMode = "off"
)

func (WAFPackageRuleListResponseWAFManagedRulesTraditionalAllowRuleAllowedMode) IsKnown

type WAFPackageRuleListResponseWAFManagedRulesTraditionalAllowRuleMode

type WAFPackageRuleListResponseWAFManagedRulesTraditionalAllowRuleMode string

When set to `on`, the current rule will be used when evaluating the request. Applies to traditional (allow) WAF rules.

const (
	WAFPackageRuleListResponseWAFManagedRulesTraditionalAllowRuleModeOn  WAFPackageRuleListResponseWAFManagedRulesTraditionalAllowRuleMode = "on"
	WAFPackageRuleListResponseWAFManagedRulesTraditionalAllowRuleModeOff WAFPackageRuleListResponseWAFManagedRulesTraditionalAllowRuleMode = "off"
)

func (WAFPackageRuleListResponseWAFManagedRulesTraditionalAllowRuleMode) IsKnown

type WAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRule

type WAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRule struct {
	// The unique identifier of the WAF rule.
	ID string `json:"id,required"`
	// The list of possible actions of the WAF rule when it is triggered.
	AllowedModes []WAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleAllowedMode `json:"allowed_modes,required"`
	// The default action/mode of a rule.
	DefaultMode WAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleDefaultMode `json:"default_mode,required"`
	// The public description of the WAF rule.
	Description string `json:"description,required"`
	// The rule group to which the current WAF rule belongs.
	Group WAFRuleGroup `json:"group,required"`
	// The action that the current WAF rule will perform when triggered. Applies to
	// traditional (deny) WAF rules.
	Mode WAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleMode `json:"mode,required"`
	// The unique identifier of a WAF package.
	PackageID string `json:"package_id,required"`
	// The order in which the individual WAF rule is executed within its rule group.
	Priority string                                                           `json:"priority,required"`
	JSON     wafPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleJSON `json:"-"`
}

When triggered, traditional WAF rules cause the firewall to immediately act upon the request based on the configuration of the rule. A 'deny' rule will immediately respond to the request based on the configured rule action/mode (for example, 'block') and no other rules will be processed.

func (*WAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRule) UnmarshalJSON

type WAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleAllowedMode

type WAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleAllowedMode string

The action that the current WAF rule will perform when triggered. Applies to traditional (deny) WAF rules.

const (
	WAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleAllowedModeDefault   WAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleAllowedMode = "default"
	WAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleAllowedModeDisable   WAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleAllowedMode = "disable"
	WAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleAllowedModeSimulate  WAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleAllowedMode = "simulate"
	WAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleAllowedModeBlock     WAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleAllowedMode = "block"
	WAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleAllowedModeChallenge WAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleAllowedMode = "challenge"
)

func (WAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleAllowedMode) IsKnown

type WAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleDefaultMode

type WAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleDefaultMode string

The default action/mode of a rule.

const (
	WAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleDefaultModeDisable   WAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleDefaultMode = "disable"
	WAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleDefaultModeSimulate  WAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleDefaultMode = "simulate"
	WAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleDefaultModeBlock     WAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleDefaultMode = "block"
	WAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleDefaultModeChallenge WAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleDefaultMode = "challenge"
)

func (WAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleDefaultMode) IsKnown

type WAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleMode

type WAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleMode string

The action that the current WAF rule will perform when triggered. Applies to traditional (deny) WAF rules.

const (
	WAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleModeDefault   WAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleMode = "default"
	WAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleModeDisable   WAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleMode = "disable"
	WAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleModeSimulate  WAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleMode = "simulate"
	WAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleModeBlock     WAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleMode = "block"
	WAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleModeChallenge WAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleMode = "challenge"
)

func (WAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleMode) IsKnown

type WAFPackageRuleService

type WAFPackageRuleService struct {
	Options []option.RequestOption
}

WAFPackageRuleService 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 NewWAFPackageRuleService method instead.

func NewWAFPackageRuleService

func NewWAFPackageRuleService(opts ...option.RequestOption) (r *WAFPackageRuleService)

NewWAFPackageRuleService 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 (*WAFPackageRuleService) Edit

Updates a WAF rule. You can only update the mode/action of the rule.

**Note:** Applies only to the [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).

func (*WAFPackageRuleService) Get

Fetches the details of a WAF rule in a WAF package.

**Note:** Applies only to the [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).

func (*WAFPackageRuleService) List

Fetches WAF rules in a WAF package.

**Note:** Applies only to the [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).

func (*WAFPackageRuleService) ListAutoPaging

Fetches WAF rules in a WAF package.

**Note:** Applies only to the [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).

type WAFPackageService

type WAFPackageService struct {
	Options []option.RequestOption
	Groups  *WAFPackageGroupService
	Rules   *WAFPackageRuleService
}

WAFPackageService 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 NewWAFPackageService method instead.

func NewWAFPackageService

func NewWAFPackageService(opts ...option.RequestOption) (r *WAFPackageService)

NewWAFPackageService 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 (*WAFPackageService) Get

func (r *WAFPackageService) Get(ctx context.Context, zoneIdentifier string, identifier string, opts ...option.RequestOption) (res *WAFPackageGetResponse, err error)

Fetches the details of a WAF package.

**Note:** Applies only to the [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).

func (*WAFPackageService) List

Fetches WAF packages for a zone.

**Note:** Applies only to the [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).

func (*WAFPackageService) ListAutoPaging

Fetches WAF packages for a zone.

**Note:** Applies only to the [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).

type WAFRule

type WAFRule map[string]WAFRuleItem

type WAFRuleGroup

type WAFRuleGroup struct {
	// The unique identifier of the rule group.
	ID string `json:"id"`
	// The name of the rule group.
	Name string           `json:"name"`
	JSON wafRuleGroupJSON `json:"-"`
}

The rule group to which the current WAF rule belongs.

func (*WAFRuleGroup) UnmarshalJSON

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

type WAFRuleItem

type WAFRuleItem string

The WAF rule action to apply.

const (
	WAFRuleItemChallenge WAFRuleItem = "challenge"
	WAFRuleItemBlock     WAFRuleItem = "block"
	WAFRuleItemSimulate  WAFRuleItem = "simulate"
	WAFRuleItemDisable   WAFRuleItem = "disable"
	WAFRuleItemDefault   WAFRuleItem = "default"
)

func (WAFRuleItem) IsKnown

func (r WAFRuleItem) IsKnown() bool

type WAFService

type WAFService struct {
	Options   []option.RequestOption
	Overrides *WAFOverrideService
	Packages  *WAFPackageService
}

WAFService 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 NewWAFService method instead.

func NewWAFService

func NewWAFService(opts ...option.RequestOption) (r *WAFService)

NewWAFService 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.

Jump to

Keyboard shortcuts

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