Documentation ¶
Index ¶
- Constants
- type ASN
- type ASNParam
- type AuditLog
- type AuditLogAction
- type AuditLogActor
- type AuditLogActorType
- type AuditLogOwner
- type AuditLogResource
- type BlockRule
- type BlockRuleAction
- type BlockRuleActionParameters
- type BlockRuleActionParametersParam
- type BlockRuleActionParametersResponse
- type BlockRuleActionParametersResponseParam
- type BlockRuleParam
- type CertificateCA
- type CertificateRequestType
- type ChallengeRule
- type ChallengeRuleAction
- type ChallengeRuleParam
- type CloudflareTunnel
- type CloudflareTunnelConnection
- type CloudflareTunnelStatus
- type CloudflareTunnelTunType
- type CompressResponseRule
- type CompressResponseRuleAction
- type CompressResponseRuleActionParameters
- type CompressResponseRuleActionParametersAlgorithm
- type CompressResponseRuleActionParametersAlgorithmParam
- type CompressResponseRuleActionParametersAlgorithmsName
- type CompressResponseRuleActionParametersParam
- type CompressResponseRuleParam
- type DDoSDynamicRule
- type DDoSDynamicRuleAction
- type DDoSDynamicRuleJSON
- type DDoSDynamicRuleParam
- type Error
- type ErrorData
- type ExecuteRule
- type ExecuteRuleAction
- type ExecuteRuleActionParameters
- type ExecuteRuleActionParametersMatchedData
- type ExecuteRuleActionParametersMatchedDataParam
- type ExecuteRuleActionParametersOverrides
- type ExecuteRuleActionParametersOverridesCategoriesSensitivityLevel
- type ExecuteRuleActionParametersOverridesCategory
- type ExecuteRuleActionParametersOverridesCategoryParam
- type ExecuteRuleActionParametersOverridesParam
- type ExecuteRuleActionParametersOverridesRule
- type ExecuteRuleActionParametersOverridesRuleParam
- type ExecuteRuleActionParametersOverridesRulesSensitivityLevel
- type ExecuteRuleActionParametersOverridesSensitivityLevel
- type ExecuteRuleActionParametersParam
- type ExecuteRuleParam
- type ForceConnectionCloseRule
- type ForceConnectionCloseRuleAction
- type ForceConnectionCloseRuleParam
- type JSChallengeRule
- type JSChallengeRuleAction
- type JSChallengeRuleParam
- type Kind
- type LogCustomFieldRule
- type LogCustomFieldRuleAction
- type LogCustomFieldRuleActionParameters
- type LogCustomFieldRuleActionParametersCookieField
- type LogCustomFieldRuleActionParametersCookieFieldParam
- type LogCustomFieldRuleActionParametersParam
- type LogCustomFieldRuleActionParametersRequestField
- type LogCustomFieldRuleActionParametersRequestFieldParam
- type LogCustomFieldRuleActionParametersResponseField
- type LogCustomFieldRuleActionParametersResponseFieldParam
- type LogCustomFieldRuleParam
- type LogRule
- type LogRuleAction
- type LogRuleParam
- type Logging
- type LoggingParam
- type ManagedChallengeRule
- type ManagedChallengeRuleAction
- type ManagedChallengeRuleParam
- type MemberParam
- type MemberRoleParam
- type MemberRolesPermissionsParam
- type MemberStatus
- type MemberUserParam
- type Permission
- type PermissionGrant
- type PermissionGrantParam
- type Phase
- type PhaseGetResponse
- type PhaseGetResponseEnvelope
- type PhaseGetResponseEnvelopeErrors
- type PhaseGetResponseEnvelopeErrorsSource
- type PhaseGetResponseEnvelopeMessages
- type PhaseGetResponseEnvelopeMessagesSource
- type PhaseGetResponseEnvelopeSuccess
- type PhaseGetResponseRule
- type PhaseGetResponseRulesAction
- type PhaseGetResponseRulesUnion
- type PhaseService
- type PhaseUpdateParams
- type PhaseUpdateParamsRule
- type PhaseUpdateParamsRuleUnion
- type PhaseUpdateParamsRulesAction
- type PhaseUpdateResponse
- type PhaseUpdateResponseEnvelope
- type PhaseUpdateResponseEnvelopeErrors
- type PhaseUpdateResponseEnvelopeErrorsSource
- type PhaseUpdateResponseEnvelopeMessages
- type PhaseUpdateResponseEnvelopeMessagesSource
- type PhaseUpdateResponseEnvelopeSuccess
- type PhaseUpdateResponseRule
- type PhaseUpdateResponseRulesAction
- type PhaseUpdateResponseRulesUnion
- type PhaseVersionGetResponse
- type PhaseVersionGetResponseEnvelope
- type PhaseVersionGetResponseEnvelopeErrors
- type PhaseVersionGetResponseEnvelopeErrorsSource
- type PhaseVersionGetResponseEnvelopeMessages
- type PhaseVersionGetResponseEnvelopeMessagesSource
- type PhaseVersionGetResponseEnvelopeSuccess
- type PhaseVersionGetResponseRule
- type PhaseVersionGetResponseRulesAction
- type PhaseVersionGetResponseRulesUnion
- type PhaseVersionListResponse
- type PhaseVersionService
- func (r *PhaseVersionService) Get(ctx context.Context, accountOrZone string, accountOrZoneID string, ...) (res *PhaseVersionGetResponse, err error)
- func (r *PhaseVersionService) List(ctx context.Context, accountOrZone string, accountOrZoneID string, ...) (res *pagination.SinglePage[PhaseVersionListResponse], err error)
- func (r *PhaseVersionService) ListAutoPaging(ctx context.Context, accountOrZone string, accountOrZoneID string, ...) *pagination.SinglePageAutoPager[PhaseVersionListResponse]
- type RedirectRule
- type RedirectRuleAction
- type RedirectRuleActionParameters
- type RedirectRuleActionParametersFromList
- type RedirectRuleActionParametersFromListParam
- type RedirectRuleActionParametersFromValue
- type RedirectRuleActionParametersFromValueParam
- type RedirectRuleActionParametersFromValueStatusCode
- type RedirectRuleActionParametersFromValueTargetURL
- type RedirectRuleActionParametersFromValueTargetURLDynamicURLRedirect
- type RedirectRuleActionParametersFromValueTargetURLDynamicURLRedirectParam
- type RedirectRuleActionParametersFromValueTargetURLParam
- type RedirectRuleActionParametersFromValueTargetURLStaticURLRedirect
- type RedirectRuleActionParametersFromValueTargetURLStaticURLRedirectParam
- type RedirectRuleActionParametersFromValueTargetURLUnion
- type RedirectRuleActionParametersFromValueTargetURLUnionParam
- type RedirectRuleActionParametersParam
- type RedirectRuleParam
- type ResponseInfo
- type RewriteRule
- type RewriteRuleAction
- type RewriteRuleActionParameters
- type RewriteRuleActionParametersHeader
- type RewriteRuleActionParametersHeaderParam
- type RewriteRuleActionParametersHeadersDynamicHeader
- type RewriteRuleActionParametersHeadersDynamicHeaderOperation
- type RewriteRuleActionParametersHeadersDynamicHeaderParam
- type RewriteRuleActionParametersHeadersOperation
- type RewriteRuleActionParametersHeadersRemoveHeader
- type RewriteRuleActionParametersHeadersRemoveHeaderOperation
- type RewriteRuleActionParametersHeadersRemoveHeaderParam
- type RewriteRuleActionParametersHeadersStaticHeader
- type RewriteRuleActionParametersHeadersStaticHeaderOperation
- type RewriteRuleActionParametersHeadersStaticHeaderParam
- type RewriteRuleActionParametersHeadersUnion
- type RewriteRuleActionParametersHeadersUnionParam
- type RewriteRuleActionParametersParam
- type RewriteRuleActionParametersURI
- type RewriteRuleActionParametersURIParam
- type RewriteRuleParam
- type RewriteURIPart
- type RewriteURIPartDynamicValue
- type RewriteURIPartDynamicValueParam
- type RewriteURIPartParam
- type RewriteURIPartStaticValue
- type RewriteURIPartStaticValueParam
- type RewriteURIPartUnion
- type RewriteURIPartUnionParam
- type Role
- type RouteRule
- type RouteRuleAction
- type RouteRuleActionParameters
- type RouteRuleActionParametersOrigin
- type RouteRuleActionParametersOriginParam
- type RouteRuleActionParametersParam
- type RouteRuleActionParametersSNI
- type RouteRuleActionParametersSNIParam
- type RouteRuleParam
- type RuleDeleteResponse
- type RuleDeleteResponseEnvelope
- type RuleDeleteResponseEnvelopeErrors
- type RuleDeleteResponseEnvelopeErrorsSource
- type RuleDeleteResponseEnvelopeMessages
- type RuleDeleteResponseEnvelopeMessagesSource
- type RuleDeleteResponseEnvelopeSuccess
- type RuleDeleteResponseRule
- type RuleDeleteResponseRulesAction
- type RuleDeleteResponseRulesUnion
- type RuleEditParams
- type RuleEditParamsPosition
- type RuleEditParamsPositionAfterPosition
- type RuleEditParamsPositionBeforePosition
- type RuleEditParamsPositionIndexPosition
- type RuleEditParamsPositionUnion
- type RuleEditResponse
- type RuleEditResponseEnvelope
- type RuleEditResponseEnvelopeErrors
- type RuleEditResponseEnvelopeErrorsSource
- type RuleEditResponseEnvelopeMessages
- type RuleEditResponseEnvelopeMessagesSource
- type RuleEditResponseEnvelopeSuccess
- type RuleEditResponseRule
- type RuleEditResponseRulesAction
- type RuleEditResponseRulesUnion
- type RuleNewParams
- type RuleNewParamsPosition
- type RuleNewParamsPositionAfterPosition
- type RuleNewParamsPositionBeforePosition
- type RuleNewParamsPositionIndexPosition
- type RuleNewParamsPositionUnion
- type RuleNewResponse
- type RuleNewResponseEnvelope
- type RuleNewResponseEnvelopeErrors
- type RuleNewResponseEnvelopeErrorsSource
- type RuleNewResponseEnvelopeMessages
- type RuleNewResponseEnvelopeMessagesSource
- type RuleNewResponseEnvelopeSuccess
- type RuleNewResponseRule
- type RuleNewResponseRulesAction
- type RuleNewResponseRulesUnion
- type RuleService
- func (r *RuleService) Delete(ctx context.Context, accountOrZone string, accountOrZoneID string, ...) (res *RuleDeleteResponse, err error)
- func (r *RuleService) Edit(ctx context.Context, accountOrZone string, accountOrZoneID string, ...) (res *RuleEditResponse, err error)
- func (r *RuleService) New(ctx context.Context, accountOrZone string, accountOrZoneID string, ...) (res *RuleNewResponse, err error)
- type RulesetGetResponse
- type RulesetGetResponseEnvelope
- type RulesetGetResponseEnvelopeErrors
- type RulesetGetResponseEnvelopeErrorsSource
- type RulesetGetResponseEnvelopeMessages
- type RulesetGetResponseEnvelopeMessagesSource
- type RulesetGetResponseEnvelopeSuccess
- type RulesetGetResponseRule
- type RulesetGetResponseRulesAction
- type RulesetGetResponseRulesUnion
- type RulesetListResponse
- type RulesetNewParams
- type RulesetNewParamsRule
- type RulesetNewParamsRuleUnion
- type RulesetNewParamsRulesAction
- type RulesetNewResponse
- type RulesetNewResponseEnvelope
- type RulesetNewResponseEnvelopeErrors
- type RulesetNewResponseEnvelopeErrorsSource
- type RulesetNewResponseEnvelopeMessages
- type RulesetNewResponseEnvelopeMessagesSource
- type RulesetNewResponseEnvelopeSuccess
- type RulesetNewResponseRule
- type RulesetNewResponseRulesAction
- type RulesetNewResponseRulesUnion
- type RulesetService
- func (r *RulesetService) Delete(ctx context.Context, accountOrZone string, accountOrZoneID string, ...) (err error)
- func (r *RulesetService) Get(ctx context.Context, accountOrZone string, accountOrZoneID string, ...) (res *RulesetGetResponse, err error)
- func (r *RulesetService) List(ctx context.Context, accountOrZone string, accountOrZoneID string, ...) (res *pagination.SinglePage[RulesetListResponse], err error)
- func (r *RulesetService) ListAutoPaging(ctx context.Context, accountOrZone string, accountOrZoneID string, ...) *pagination.SinglePageAutoPager[RulesetListResponse]
- func (r *RulesetService) New(ctx context.Context, accountOrZone string, accountOrZoneID string, ...) (res *RulesetNewResponse, err error)
- func (r *RulesetService) Update(ctx context.Context, accountOrZone string, accountOrZoneID string, ...) (res *RulesetUpdateResponse, err error)
- type RulesetUpdateParams
- type RulesetUpdateParamsRule
- type RulesetUpdateParamsRuleUnion
- type RulesetUpdateParamsRulesAction
- type RulesetUpdateResponse
- type RulesetUpdateResponseEnvelope
- type RulesetUpdateResponseEnvelopeErrors
- type RulesetUpdateResponseEnvelopeErrorsSource
- type RulesetUpdateResponseEnvelopeMessages
- type RulesetUpdateResponseEnvelopeMessagesSource
- type RulesetUpdateResponseEnvelopeSuccess
- type RulesetUpdateResponseRule
- type RulesetUpdateResponseRulesAction
- type RulesetUpdateResponseRulesUnion
- type ScoreRule
- type ScoreRuleAction
- type ScoreRuleActionParameters
- type ScoreRuleActionParametersParam
- type ScoreRuleParam
- type ServeErrorRule
- type ServeErrorRuleAction
- type ServeErrorRuleActionParameters
- type ServeErrorRuleActionParametersContentType
- type ServeErrorRuleActionParametersParam
- type ServeErrorRuleParam
- type SetCacheSettingsRule
- type SetCacheSettingsRuleAction
- type SetCacheSettingsRuleActionParameters
- type SetCacheSettingsRuleActionParametersBrowserTTL
- type SetCacheSettingsRuleActionParametersBrowserTTLMode
- type SetCacheSettingsRuleActionParametersBrowserTTLParam
- type SetCacheSettingsRuleActionParametersCacheKey
- type SetCacheSettingsRuleActionParametersCacheKeyCustomKey
- type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyCookie
- type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyCookieParam
- type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHeader
- type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHeaderParam
- type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHost
- type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHostParam
- type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyParam
- type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryString
- type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExclude
- type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludeParam
- type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringInclude
- type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludeParam
- type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringParam
- type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyUser
- type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyUserParam
- type SetCacheSettingsRuleActionParametersCacheKeyParam
- type SetCacheSettingsRuleActionParametersCacheReserve
- type SetCacheSettingsRuleActionParametersCacheReserveParam
- type SetCacheSettingsRuleActionParametersEdgeTTL
- type SetCacheSettingsRuleActionParametersEdgeTTLMode
- type SetCacheSettingsRuleActionParametersEdgeTTLParam
- type SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTL
- type SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTLParam
- type SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTLStatusCodeRange
- type SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTLStatusCodeRangeParam
- type SetCacheSettingsRuleActionParametersParam
- type SetCacheSettingsRuleActionParametersServeStale
- type SetCacheSettingsRuleActionParametersServeStaleParam
- type SetCacheSettingsRuleParam
- type SetConfigRule
- type SetConfigRuleAction
- type SetConfigRuleActionParameters
- type SetConfigRuleActionParametersAutominify
- type SetConfigRuleActionParametersAutominifyParam
- type SetConfigRuleActionParametersDisableApps
- type SetConfigRuleActionParametersDisableRUM
- type SetConfigRuleActionParametersDisableZaraz
- type SetConfigRuleActionParametersParam
- type SetConfigRuleActionParametersPolish
- type SetConfigRuleActionParametersSSL
- type SetConfigRuleActionParametersSecurityLevel
- type SetConfigRuleParam
- type SkipRule
- type SkipRuleAction
- type SkipRuleActionParameters
- type SkipRuleActionParametersParam
- type SkipRuleActionParametersProduct
- type SkipRuleActionParametersRuleset
- type SkipRuleParam
- type SortDirection
- type VersionByTagGetResponse
- type VersionByTagGetResponseEnvelope
- type VersionByTagGetResponseEnvelopeErrors
- type VersionByTagGetResponseEnvelopeErrorsSource
- type VersionByTagGetResponseEnvelopeMessages
- type VersionByTagGetResponseEnvelopeMessagesSource
- type VersionByTagGetResponseEnvelopeSuccess
- type VersionByTagGetResponseRule
- type VersionByTagGetResponseRulesAction
- type VersionByTagGetResponseRulesUnion
- type VersionByTagService
- type VersionGetResponse
- type VersionGetResponseEnvelope
- type VersionGetResponseEnvelopeErrors
- type VersionGetResponseEnvelopeErrorsSource
- type VersionGetResponseEnvelopeMessages
- type VersionGetResponseEnvelopeMessagesSource
- type VersionGetResponseEnvelopeSuccess
- type VersionGetResponseRule
- type VersionGetResponseRulesAction
- type VersionGetResponseRulesUnion
- type VersionListResponse
- type VersionService
- func (r *VersionService) Delete(ctx context.Context, accountOrZone string, accountOrZoneID string, ...) (err error)
- func (r *VersionService) Get(ctx context.Context, accountOrZone string, accountOrZoneID string, ...) (res *VersionGetResponse, err error)
- func (r *VersionService) List(ctx context.Context, accountOrZone string, accountOrZoneID string, ...) (res *pagination.SinglePage[VersionListResponse], err error)
- func (r *VersionService) ListAutoPaging(ctx context.Context, accountOrZone string, accountOrZoneID string, ...) *pagination.SinglePageAutoPager[VersionListResponse]
Constants ¶
const AuditLogActorTypeAdmin = shared.AuditLogActorTypeAdmin
This is an alias to an internal value.
const AuditLogActorTypeCloudflare = shared.AuditLogActorTypeCloudflare
This is an alias to an internal value.
const AuditLogActorTypeUser = shared.AuditLogActorTypeUser
This is an alias to an internal value.
const CertificateCADigicert = shared.CertificateCADigicert
This is an alias to an internal value.
const CertificateCAGoogle = shared.CertificateCAGoogle
This is an alias to an internal value.
const CertificateCALetsEncrypt = shared.CertificateCALetsEncrypt
This is an alias to an internal value.
const CertificateRequestTypeKeylessCertificate = shared.CertificateRequestTypeKeylessCertificate
This is an alias to an internal value.
const CertificateRequestTypeOriginECC = shared.CertificateRequestTypeOriginECC
This is an alias to an internal value.
const CertificateRequestTypeOriginRSA = shared.CertificateRequestTypeOriginRSA
This is an alias to an internal value.
const CloudflareTunnelStatusDegraded = shared.CloudflareTunnelStatusDegraded
This is an alias to an internal value.
const CloudflareTunnelStatusDown = shared.CloudflareTunnelStatusDown
This is an alias to an internal value.
const CloudflareTunnelStatusHealthy = shared.CloudflareTunnelStatusHealthy
This is an alias to an internal value.
const CloudflareTunnelStatusInactive = shared.CloudflareTunnelStatusInactive
This is an alias to an internal value.
const CloudflareTunnelTunTypeCNI = shared.CloudflareTunnelTunTypeCNI
This is an alias to an internal value.
const CloudflareTunnelTunTypeCfdTunnel = shared.CloudflareTunnelTunTypeCfdTunnel
This is an alias to an internal value.
const CloudflareTunnelTunTypeGRE = shared.CloudflareTunnelTunTypeGRE
This is an alias to an internal value.
const CloudflareTunnelTunTypeIPSec = shared.CloudflareTunnelTunTypeIPSec
This is an alias to an internal value.
const CloudflareTunnelTunTypeWARPConnector = shared.CloudflareTunnelTunTypeWARPConnector
This is an alias to an internal value.
const MemberStatusAccepted = shared.MemberStatusAccepted
This is an alias to an internal value.
const MemberStatusPending = shared.MemberStatusPending
This is an alias to an internal value.
const SortDirectionAsc = shared.SortDirectionAsc
This is an alias to an internal value.
const SortDirectionDesc = shared.SortDirectionDesc
This is an alias to an internal value.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuditLogAction ¶
type AuditLogAction = shared.AuditLogAction
This is an alias to an internal type.
type AuditLogActor ¶
type AuditLogActor = shared.AuditLogActor
This is an alias to an internal type.
type AuditLogActorType ¶
type AuditLogActorType = shared.AuditLogActorType
The type of actor, whether a User, Cloudflare Admin, or an Automated System.
This is an alias to an internal type.
type AuditLogOwner ¶
type AuditLogOwner = shared.AuditLogOwner
This is an alias to an internal type.
type AuditLogResource ¶
type AuditLogResource = shared.AuditLogResource
This is an alias to an internal type.
type BlockRule ¶
type BlockRule struct { // The timestamp of when the rule was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // The version of the rule. Version string `json:"version,required"` // The unique ID of the rule. ID string `json:"id"` // The action to perform when the rule matches. Action BlockRuleAction `json:"action"` // The parameters configuring the rule's action. ActionParameters BlockRuleActionParameters `json:"action_parameters"` // The categories of the rule. Categories []string `json:"categories"` // An informative description of the rule. Description string `json:"description"` // Whether the rule should be executed. Enabled bool `json:"enabled"` // The expression defining which traffic will match the rule. Expression string `json:"expression"` // An object configuring the rule's logging behavior. Logging Logging `json:"logging"` // The reference of the rule (the rule ID by default). Ref string `json:"ref"` JSON blockRuleJSON `json:"-"` }
func (*BlockRule) UnmarshalJSON ¶
type BlockRuleAction ¶
type BlockRuleAction string
The action to perform when the rule matches.
const (
BlockRuleActionBlock BlockRuleAction = "block"
)
func (BlockRuleAction) IsKnown ¶
func (r BlockRuleAction) IsKnown() bool
type BlockRuleActionParameters ¶
type BlockRuleActionParameters struct { // The response to show when the block is applied. Response BlockRuleActionParametersResponse `json:"response"` JSON blockRuleActionParametersJSON `json:"-"` }
The parameters configuring the rule's action.
func (*BlockRuleActionParameters) UnmarshalJSON ¶
func (r *BlockRuleActionParameters) UnmarshalJSON(data []byte) (err error)
type BlockRuleActionParametersParam ¶
type BlockRuleActionParametersParam struct { // The response to show when the block is applied. Response param.Field[BlockRuleActionParametersResponseParam] `json:"response"` }
The parameters configuring the rule's action.
func (BlockRuleActionParametersParam) MarshalJSON ¶
func (r BlockRuleActionParametersParam) MarshalJSON() (data []byte, err error)
type BlockRuleActionParametersResponse ¶
type BlockRuleActionParametersResponse struct { // The content to return. Content string `json:"content,required"` // The type of the content to return. ContentType string `json:"content_type,required"` // The status code to return. StatusCode int64 `json:"status_code,required"` JSON blockRuleActionParametersResponseJSON `json:"-"` }
The response to show when the block is applied.
func (*BlockRuleActionParametersResponse) UnmarshalJSON ¶
func (r *BlockRuleActionParametersResponse) UnmarshalJSON(data []byte) (err error)
type BlockRuleActionParametersResponseParam ¶
type BlockRuleActionParametersResponseParam struct { // The content to return. Content param.Field[string] `json:"content,required"` // The type of the content to return. ContentType param.Field[string] `json:"content_type,required"` // The status code to return. StatusCode param.Field[int64] `json:"status_code,required"` }
The response to show when the block is applied.
func (BlockRuleActionParametersResponseParam) MarshalJSON ¶
func (r BlockRuleActionParametersResponseParam) MarshalJSON() (data []byte, err error)
type BlockRuleParam ¶
type BlockRuleParam struct { // The unique ID of the rule. ID param.Field[string] `json:"id"` // The action to perform when the rule matches. Action param.Field[BlockRuleAction] `json:"action"` // The parameters configuring the rule's action. ActionParameters param.Field[BlockRuleActionParametersParam] `json:"action_parameters"` // An informative description of the rule. Description param.Field[string] `json:"description"` // Whether the rule should be executed. Enabled param.Field[bool] `json:"enabled"` // The expression defining which traffic will match the rule. Expression param.Field[string] `json:"expression"` // An object configuring the rule's logging behavior. Logging param.Field[LoggingParam] `json:"logging"` // The reference of the rule (the rule ID by default). Ref param.Field[string] `json:"ref"` }
func (BlockRuleParam) MarshalJSON ¶
func (r BlockRuleParam) MarshalJSON() (data []byte, err error)
type CertificateCA ¶
type CertificateCA = shared.CertificateCA
The Certificate Authority that will issue the certificate
This is an alias to an internal type.
type CertificateRequestType ¶
type CertificateRequestType = shared.CertificateRequestType
Signature type desired on certificate ("origin-rsa" (rsa), "origin-ecc" (ecdsa), or "keyless-certificate" (for Keyless SSL servers).
This is an alias to an internal type.
type ChallengeRule ¶
type ChallengeRule struct { // The timestamp of when the rule was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // The version of the rule. Version string `json:"version,required"` // The unique ID of the rule. ID string `json:"id"` // The action to perform when the rule matches. Action ChallengeRuleAction `json:"action"` // The parameters configuring the rule's action. ActionParameters interface{} `json:"action_parameters"` // The categories of the rule. Categories []string `json:"categories"` // An informative description of the rule. Description string `json:"description"` // Whether the rule should be executed. Enabled bool `json:"enabled"` // The expression defining which traffic will match the rule. Expression string `json:"expression"` // An object configuring the rule's logging behavior. Logging Logging `json:"logging"` // The reference of the rule (the rule ID by default). Ref string `json:"ref"` JSON challengeRuleJSON `json:"-"` }
func (*ChallengeRule) UnmarshalJSON ¶
func (r *ChallengeRule) UnmarshalJSON(data []byte) (err error)
type ChallengeRuleAction ¶
type ChallengeRuleAction string
The action to perform when the rule matches.
const (
ChallengeRuleActionChallenge ChallengeRuleAction = "challenge"
)
func (ChallengeRuleAction) IsKnown ¶
func (r ChallengeRuleAction) IsKnown() bool
type ChallengeRuleParam ¶
type ChallengeRuleParam struct { // The unique ID of the rule. ID param.Field[string] `json:"id"` // The action to perform when the rule matches. Action param.Field[ChallengeRuleAction] `json:"action"` // The parameters configuring the rule's action. ActionParameters param.Field[interface{}] `json:"action_parameters"` // An informative description of the rule. Description param.Field[string] `json:"description"` // Whether the rule should be executed. Enabled param.Field[bool] `json:"enabled"` // The expression defining which traffic will match the rule. Expression param.Field[string] `json:"expression"` // An object configuring the rule's logging behavior. Logging param.Field[LoggingParam] `json:"logging"` // The reference of the rule (the rule ID by default). Ref param.Field[string] `json:"ref"` }
func (ChallengeRuleParam) MarshalJSON ¶
func (r ChallengeRuleParam) MarshalJSON() (data []byte, err error)
type CloudflareTunnel ¶
type CloudflareTunnel = shared.CloudflareTunnel
A Cloudflare Tunnel that connects your origin to Cloudflare's edge.
This is an alias to an internal type.
type CloudflareTunnelConnection ¶
type CloudflareTunnelConnection = shared.CloudflareTunnelConnection
This is an alias to an internal type.
type CloudflareTunnelStatus ¶
type CloudflareTunnelStatus = shared.CloudflareTunnelStatus
The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge).
This is an alias to an internal type.
type CloudflareTunnelTunType ¶
type CloudflareTunnelTunType = shared.CloudflareTunnelTunType
The type of tunnel.
This is an alias to an internal type.
type CompressResponseRule ¶
type CompressResponseRule struct { // The timestamp of when the rule was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // The version of the rule. Version string `json:"version,required"` // The unique ID of the rule. ID string `json:"id"` // The action to perform when the rule matches. Action CompressResponseRuleAction `json:"action"` // The parameters configuring the rule's action. ActionParameters CompressResponseRuleActionParameters `json:"action_parameters"` // The categories of the rule. Categories []string `json:"categories"` // An informative description of the rule. Description string `json:"description"` // Whether the rule should be executed. Enabled bool `json:"enabled"` // The expression defining which traffic will match the rule. Expression string `json:"expression"` // An object configuring the rule's logging behavior. Logging Logging `json:"logging"` // The reference of the rule (the rule ID by default). Ref string `json:"ref"` JSON compressResponseRuleJSON `json:"-"` }
func (*CompressResponseRule) UnmarshalJSON ¶
func (r *CompressResponseRule) UnmarshalJSON(data []byte) (err error)
type CompressResponseRuleAction ¶
type CompressResponseRuleAction string
The action to perform when the rule matches.
const (
CompressResponseRuleActionCompressResponse CompressResponseRuleAction = "compress_response"
)
func (CompressResponseRuleAction) IsKnown ¶
func (r CompressResponseRuleAction) IsKnown() bool
type CompressResponseRuleActionParameters ¶
type CompressResponseRuleActionParameters struct { // Custom order for compression algorithms. Algorithms []CompressResponseRuleActionParametersAlgorithm `json:"algorithms"` JSON compressResponseRuleActionParametersJSON `json:"-"` }
The parameters configuring the rule's action.
func (*CompressResponseRuleActionParameters) UnmarshalJSON ¶
func (r *CompressResponseRuleActionParameters) UnmarshalJSON(data []byte) (err error)
type CompressResponseRuleActionParametersAlgorithm ¶
type CompressResponseRuleActionParametersAlgorithm struct { // Name of compression algorithm to enable. Name CompressResponseRuleActionParametersAlgorithmsName `json:"name"` JSON compressResponseRuleActionParametersAlgorithmJSON `json:"-"` }
Compression algorithm to enable.
func (*CompressResponseRuleActionParametersAlgorithm) UnmarshalJSON ¶
func (r *CompressResponseRuleActionParametersAlgorithm) UnmarshalJSON(data []byte) (err error)
type CompressResponseRuleActionParametersAlgorithmParam ¶
type CompressResponseRuleActionParametersAlgorithmParam struct { // Name of compression algorithm to enable. Name param.Field[CompressResponseRuleActionParametersAlgorithmsName] `json:"name"` }
Compression algorithm to enable.
func (CompressResponseRuleActionParametersAlgorithmParam) MarshalJSON ¶
func (r CompressResponseRuleActionParametersAlgorithmParam) MarshalJSON() (data []byte, err error)
type CompressResponseRuleActionParametersAlgorithmsName ¶
type CompressResponseRuleActionParametersAlgorithmsName string
Name of compression algorithm to enable.
const ( CompressResponseRuleActionParametersAlgorithmsNameNone CompressResponseRuleActionParametersAlgorithmsName = "none" CompressResponseRuleActionParametersAlgorithmsNameAuto CompressResponseRuleActionParametersAlgorithmsName = "auto" CompressResponseRuleActionParametersAlgorithmsNameDefault CompressResponseRuleActionParametersAlgorithmsName = "default" CompressResponseRuleActionParametersAlgorithmsNameGzip CompressResponseRuleActionParametersAlgorithmsName = "gzip" CompressResponseRuleActionParametersAlgorithmsNameBrotli CompressResponseRuleActionParametersAlgorithmsName = "brotli" )
func (CompressResponseRuleActionParametersAlgorithmsName) IsKnown ¶
func (r CompressResponseRuleActionParametersAlgorithmsName) IsKnown() bool
type CompressResponseRuleActionParametersParam ¶
type CompressResponseRuleActionParametersParam struct { // Custom order for compression algorithms. Algorithms param.Field[[]CompressResponseRuleActionParametersAlgorithmParam] `json:"algorithms"` }
The parameters configuring the rule's action.
func (CompressResponseRuleActionParametersParam) MarshalJSON ¶
func (r CompressResponseRuleActionParametersParam) MarshalJSON() (data []byte, err error)
type CompressResponseRuleParam ¶
type CompressResponseRuleParam struct { // The unique ID of the rule. ID param.Field[string] `json:"id"` // The action to perform when the rule matches. Action param.Field[CompressResponseRuleAction] `json:"action"` // The parameters configuring the rule's action. ActionParameters param.Field[CompressResponseRuleActionParametersParam] `json:"action_parameters"` // An informative description of the rule. Description param.Field[string] `json:"description"` // Whether the rule should be executed. Enabled param.Field[bool] `json:"enabled"` // The expression defining which traffic will match the rule. Expression param.Field[string] `json:"expression"` // An object configuring the rule's logging behavior. Logging param.Field[LoggingParam] `json:"logging"` // The reference of the rule (the rule ID by default). Ref param.Field[string] `json:"ref"` }
func (CompressResponseRuleParam) MarshalJSON ¶
func (r CompressResponseRuleParam) MarshalJSON() (data []byte, err error)
type DDoSDynamicRule ¶
type DDoSDynamicRule struct { // The timestamp of when the rule was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // The version of the rule. Version string `json:"version,required"` // The unique ID of the rule. ID string `json:"id"` // The action to perform when the rule matches. Action DDoSDynamicRuleAction `json:"action"` // The parameters configuring the rule's action. ActionParameters interface{} `json:"action_parameters"` // The categories of the rule. Categories []string `json:"categories"` // An informative description of the rule. Description string `json:"description"` // Whether the rule should be executed. Enabled bool `json:"enabled"` // The expression defining which traffic will match the rule. Expression string `json:"expression"` // An object configuring the rule's logging behavior. Logging Logging `json:"logging"` // The reference of the rule (the rule ID by default). Ref string `json:"ref"` JSON DDoSDynamicRuleJSON `json:"-"` }
func (*DDoSDynamicRule) UnmarshalJSON ¶
func (r *DDoSDynamicRule) UnmarshalJSON(data []byte) (err error)
type DDoSDynamicRuleAction ¶
type DDoSDynamicRuleAction string
The action to perform when the rule matches.
const (
DDoSDynamicRuleActionDDoSDynamic DDoSDynamicRuleAction = "ddos_dynamic"
)
func (DDoSDynamicRuleAction) IsKnown ¶
func (r DDoSDynamicRuleAction) IsKnown() bool
type DDoSDynamicRuleJSON ¶
type DDoSDynamicRuleJSON struct { LastUpdated apijson.Field Version apijson.Field ID apijson.Field Action apijson.Field ActionParameters apijson.Field Categories apijson.Field Description apijson.Field Enabled apijson.Field Expression apijson.Field Logging apijson.Field Ref apijson.Field ExtraFields map[string]apijson.Field // contains filtered or unexported fields }
DDoSDynamicRuleJSON contains the JSON metadata for the struct DDoSDynamicRule
func (DDoSDynamicRuleJSON) RawJSON ¶
func (r DDoSDynamicRuleJSON) RawJSON() string
type DDoSDynamicRuleParam ¶
type DDoSDynamicRuleParam struct { // The unique ID of the rule. ID param.Field[string] `json:"id"` // The action to perform when the rule matches. Action param.Field[DDoSDynamicRuleAction] `json:"action"` // The parameters configuring the rule's action. ActionParameters param.Field[interface{}] `json:"action_parameters"` // An informative description of the rule. Description param.Field[string] `json:"description"` // Whether the rule should be executed. Enabled param.Field[bool] `json:"enabled"` // The expression defining which traffic will match the rule. Expression param.Field[string] `json:"expression"` // An object configuring the rule's logging behavior. Logging param.Field[LoggingParam] `json:"logging"` // The reference of the rule (the rule ID by default). Ref param.Field[string] `json:"ref"` }
func (DDoSDynamicRuleParam) MarshalJSON ¶
func (r DDoSDynamicRuleParam) MarshalJSON() (data []byte, err error)
type ExecuteRule ¶
type ExecuteRule struct { // The timestamp of when the rule was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // The version of the rule. Version string `json:"version,required"` // The unique ID of the rule. ID string `json:"id"` // The action to perform when the rule matches. Action ExecuteRuleAction `json:"action"` // The parameters configuring the rule's action. ActionParameters ExecuteRuleActionParameters `json:"action_parameters"` // The categories of the rule. Categories []string `json:"categories"` // An informative description of the rule. Description string `json:"description"` // Whether the rule should be executed. Enabled bool `json:"enabled"` // The expression defining which traffic will match the rule. Expression string `json:"expression"` // An object configuring the rule's logging behavior. Logging Logging `json:"logging"` // The reference of the rule (the rule ID by default). Ref string `json:"ref"` JSON executeRuleJSON `json:"-"` }
func (*ExecuteRule) UnmarshalJSON ¶
func (r *ExecuteRule) UnmarshalJSON(data []byte) (err error)
type ExecuteRuleAction ¶
type ExecuteRuleAction string
The action to perform when the rule matches.
const (
ExecuteRuleActionExecute ExecuteRuleAction = "execute"
)
func (ExecuteRuleAction) IsKnown ¶
func (r ExecuteRuleAction) IsKnown() bool
type ExecuteRuleActionParameters ¶
type ExecuteRuleActionParameters struct { // The ID of the ruleset to execute. ID string `json:"id,required"` // The configuration to use for matched data logging. MatchedData ExecuteRuleActionParametersMatchedData `json:"matched_data"` // A set of overrides to apply to the target ruleset. Overrides ExecuteRuleActionParametersOverrides `json:"overrides"` JSON executeRuleActionParametersJSON `json:"-"` }
The parameters configuring the rule's action.
func (*ExecuteRuleActionParameters) UnmarshalJSON ¶
func (r *ExecuteRuleActionParameters) UnmarshalJSON(data []byte) (err error)
type ExecuteRuleActionParametersMatchedData ¶
type ExecuteRuleActionParametersMatchedData struct { // The public key to encrypt matched data logs with. PublicKey string `json:"public_key,required"` JSON executeRuleActionParametersMatchedDataJSON `json:"-"` }
The configuration to use for matched data logging.
func (*ExecuteRuleActionParametersMatchedData) UnmarshalJSON ¶
func (r *ExecuteRuleActionParametersMatchedData) UnmarshalJSON(data []byte) (err error)
type ExecuteRuleActionParametersMatchedDataParam ¶
type ExecuteRuleActionParametersMatchedDataParam struct { // The public key to encrypt matched data logs with. PublicKey param.Field[string] `json:"public_key,required"` }
The configuration to use for matched data logging.
func (ExecuteRuleActionParametersMatchedDataParam) MarshalJSON ¶
func (r ExecuteRuleActionParametersMatchedDataParam) MarshalJSON() (data []byte, err error)
type ExecuteRuleActionParametersOverrides ¶
type ExecuteRuleActionParametersOverrides struct { // An action to override all rules with. This option has lower precedence than rule // and category overrides. Action string `json:"action"` // A list of category-level overrides. This option has the second-highest // precedence after rule-level overrides. Categories []ExecuteRuleActionParametersOverridesCategory `json:"categories"` // Whether to enable execution of all rules. This option has lower precedence than // rule and category overrides. Enabled bool `json:"enabled"` // A list of rule-level overrides. This option has the highest precedence. Rules []ExecuteRuleActionParametersOverridesRule `json:"rules"` // A sensitivity level to set for all rules. This option has lower precedence than // rule and category overrides and is only applicable for DDoS phases. SensitivityLevel ExecuteRuleActionParametersOverridesSensitivityLevel `json:"sensitivity_level"` JSON executeRuleActionParametersOverridesJSON `json:"-"` }
A set of overrides to apply to the target ruleset.
func (*ExecuteRuleActionParametersOverrides) UnmarshalJSON ¶
func (r *ExecuteRuleActionParametersOverrides) UnmarshalJSON(data []byte) (err error)
type ExecuteRuleActionParametersOverridesCategoriesSensitivityLevel ¶
type ExecuteRuleActionParametersOverridesCategoriesSensitivityLevel string
The sensitivity level to use for rules in the category.
const ( ExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault ExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "default" ExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium ExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "medium" ExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow ExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "low" ExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff ExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "eoff" )
func (ExecuteRuleActionParametersOverridesCategoriesSensitivityLevel) IsKnown ¶
func (r ExecuteRuleActionParametersOverridesCategoriesSensitivityLevel) IsKnown() bool
type ExecuteRuleActionParametersOverridesCategory ¶
type ExecuteRuleActionParametersOverridesCategory struct { // The name of the category to override. Category string `json:"category,required"` // The action to override rules in the category with. Action string `json:"action"` // Whether to enable execution of rules in the category. Enabled bool `json:"enabled"` // The sensitivity level to use for rules in the category. SensitivityLevel ExecuteRuleActionParametersOverridesCategoriesSensitivityLevel `json:"sensitivity_level"` JSON executeRuleActionParametersOverridesCategoryJSON `json:"-"` }
A category-level override
func (*ExecuteRuleActionParametersOverridesCategory) UnmarshalJSON ¶
func (r *ExecuteRuleActionParametersOverridesCategory) UnmarshalJSON(data []byte) (err error)
type ExecuteRuleActionParametersOverridesCategoryParam ¶
type ExecuteRuleActionParametersOverridesCategoryParam struct { // The name of the category to override. Category param.Field[string] `json:"category,required"` // The action to override rules in the category with. Action param.Field[string] `json:"action"` // Whether to enable execution of rules in the category. Enabled param.Field[bool] `json:"enabled"` // The sensitivity level to use for rules in the category. SensitivityLevel param.Field[ExecuteRuleActionParametersOverridesCategoriesSensitivityLevel] `json:"sensitivity_level"` }
A category-level override
func (ExecuteRuleActionParametersOverridesCategoryParam) MarshalJSON ¶
func (r ExecuteRuleActionParametersOverridesCategoryParam) MarshalJSON() (data []byte, err error)
type ExecuteRuleActionParametersOverridesParam ¶
type ExecuteRuleActionParametersOverridesParam struct { // An action to override all rules with. This option has lower precedence than rule // and category overrides. Action param.Field[string] `json:"action"` // A list of category-level overrides. This option has the second-highest // precedence after rule-level overrides. Categories param.Field[[]ExecuteRuleActionParametersOverridesCategoryParam] `json:"categories"` // Whether to enable execution of all rules. This option has lower precedence than // rule and category overrides. Enabled param.Field[bool] `json:"enabled"` // A list of rule-level overrides. This option has the highest precedence. Rules param.Field[[]ExecuteRuleActionParametersOverridesRuleParam] `json:"rules"` // A sensitivity level to set for all rules. This option has lower precedence than // rule and category overrides and is only applicable for DDoS phases. SensitivityLevel param.Field[ExecuteRuleActionParametersOverridesSensitivityLevel] `json:"sensitivity_level"` }
A set of overrides to apply to the target ruleset.
func (ExecuteRuleActionParametersOverridesParam) MarshalJSON ¶
func (r ExecuteRuleActionParametersOverridesParam) MarshalJSON() (data []byte, err error)
type ExecuteRuleActionParametersOverridesRule ¶
type ExecuteRuleActionParametersOverridesRule struct { // The ID of the rule to override. ID string `json:"id,required"` // The action to override the rule with. Action string `json:"action"` // Whether to enable execution of the rule. Enabled bool `json:"enabled"` // The score threshold to use for the rule. ScoreThreshold int64 `json:"score_threshold"` // The sensitivity level to use for the rule. SensitivityLevel ExecuteRuleActionParametersOverridesRulesSensitivityLevel `json:"sensitivity_level"` JSON executeRuleActionParametersOverridesRuleJSON `json:"-"` }
A rule-level override
func (*ExecuteRuleActionParametersOverridesRule) UnmarshalJSON ¶
func (r *ExecuteRuleActionParametersOverridesRule) UnmarshalJSON(data []byte) (err error)
type ExecuteRuleActionParametersOverridesRuleParam ¶
type ExecuteRuleActionParametersOverridesRuleParam struct { // The ID of the rule to override. ID param.Field[string] `json:"id,required"` // The action to override the rule with. Action param.Field[string] `json:"action"` // Whether to enable execution of the rule. Enabled param.Field[bool] `json:"enabled"` // The score threshold to use for the rule. ScoreThreshold param.Field[int64] `json:"score_threshold"` // The sensitivity level to use for the rule. SensitivityLevel param.Field[ExecuteRuleActionParametersOverridesRulesSensitivityLevel] `json:"sensitivity_level"` }
A rule-level override
func (ExecuteRuleActionParametersOverridesRuleParam) MarshalJSON ¶
func (r ExecuteRuleActionParametersOverridesRuleParam) MarshalJSON() (data []byte, err error)
type ExecuteRuleActionParametersOverridesRulesSensitivityLevel ¶
type ExecuteRuleActionParametersOverridesRulesSensitivityLevel string
The sensitivity level to use for the rule.
const ( ExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault ExecuteRuleActionParametersOverridesRulesSensitivityLevel = "default" ExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium ExecuteRuleActionParametersOverridesRulesSensitivityLevel = "medium" ExecuteRuleActionParametersOverridesRulesSensitivityLevelLow ExecuteRuleActionParametersOverridesRulesSensitivityLevel = "low" ExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff ExecuteRuleActionParametersOverridesRulesSensitivityLevel = "eoff" )
func (ExecuteRuleActionParametersOverridesRulesSensitivityLevel) IsKnown ¶
func (r ExecuteRuleActionParametersOverridesRulesSensitivityLevel) IsKnown() bool
type ExecuteRuleActionParametersOverridesSensitivityLevel ¶
type ExecuteRuleActionParametersOverridesSensitivityLevel string
A sensitivity level to set for all rules. This option has lower precedence than rule and category overrides and is only applicable for DDoS phases.
const ( ExecuteRuleActionParametersOverridesSensitivityLevelDefault ExecuteRuleActionParametersOverridesSensitivityLevel = "default" ExecuteRuleActionParametersOverridesSensitivityLevelMedium ExecuteRuleActionParametersOverridesSensitivityLevel = "medium" ExecuteRuleActionParametersOverridesSensitivityLevelLow ExecuteRuleActionParametersOverridesSensitivityLevel = "low" ExecuteRuleActionParametersOverridesSensitivityLevelEoff ExecuteRuleActionParametersOverridesSensitivityLevel = "eoff" )
func (ExecuteRuleActionParametersOverridesSensitivityLevel) IsKnown ¶
func (r ExecuteRuleActionParametersOverridesSensitivityLevel) IsKnown() bool
type ExecuteRuleActionParametersParam ¶
type ExecuteRuleActionParametersParam struct { // The ID of the ruleset to execute. ID param.Field[string] `json:"id,required"` // The configuration to use for matched data logging. MatchedData param.Field[ExecuteRuleActionParametersMatchedDataParam] `json:"matched_data"` // A set of overrides to apply to the target ruleset. Overrides param.Field[ExecuteRuleActionParametersOverridesParam] `json:"overrides"` }
The parameters configuring the rule's action.
func (ExecuteRuleActionParametersParam) MarshalJSON ¶
func (r ExecuteRuleActionParametersParam) MarshalJSON() (data []byte, err error)
type ExecuteRuleParam ¶
type ExecuteRuleParam struct { // The unique ID of the rule. ID param.Field[string] `json:"id"` // The action to perform when the rule matches. Action param.Field[ExecuteRuleAction] `json:"action"` // The parameters configuring the rule's action. ActionParameters param.Field[ExecuteRuleActionParametersParam] `json:"action_parameters"` // An informative description of the rule. Description param.Field[string] `json:"description"` // Whether the rule should be executed. Enabled param.Field[bool] `json:"enabled"` // The expression defining which traffic will match the rule. Expression param.Field[string] `json:"expression"` // An object configuring the rule's logging behavior. Logging param.Field[LoggingParam] `json:"logging"` // The reference of the rule (the rule ID by default). Ref param.Field[string] `json:"ref"` }
func (ExecuteRuleParam) MarshalJSON ¶
func (r ExecuteRuleParam) MarshalJSON() (data []byte, err error)
type ForceConnectionCloseRule ¶
type ForceConnectionCloseRule struct { // The timestamp of when the rule was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // The version of the rule. Version string `json:"version,required"` // The unique ID of the rule. ID string `json:"id"` // The action to perform when the rule matches. Action ForceConnectionCloseRuleAction `json:"action"` // The parameters configuring the rule's action. ActionParameters interface{} `json:"action_parameters"` // The categories of the rule. Categories []string `json:"categories"` // An informative description of the rule. Description string `json:"description"` // Whether the rule should be executed. Enabled bool `json:"enabled"` // The expression defining which traffic will match the rule. Expression string `json:"expression"` // An object configuring the rule's logging behavior. Logging Logging `json:"logging"` // The reference of the rule (the rule ID by default). Ref string `json:"ref"` JSON forceConnectionCloseRuleJSON `json:"-"` }
func (*ForceConnectionCloseRule) UnmarshalJSON ¶
func (r *ForceConnectionCloseRule) UnmarshalJSON(data []byte) (err error)
type ForceConnectionCloseRuleAction ¶
type ForceConnectionCloseRuleAction string
The action to perform when the rule matches.
const (
ForceConnectionCloseRuleActionForceConnectionClose ForceConnectionCloseRuleAction = "force_connection_close"
)
func (ForceConnectionCloseRuleAction) IsKnown ¶
func (r ForceConnectionCloseRuleAction) IsKnown() bool
type ForceConnectionCloseRuleParam ¶
type ForceConnectionCloseRuleParam struct { // The unique ID of the rule. ID param.Field[string] `json:"id"` // The action to perform when the rule matches. Action param.Field[ForceConnectionCloseRuleAction] `json:"action"` // The parameters configuring the rule's action. ActionParameters param.Field[interface{}] `json:"action_parameters"` // An informative description of the rule. Description param.Field[string] `json:"description"` // Whether the rule should be executed. Enabled param.Field[bool] `json:"enabled"` // The expression defining which traffic will match the rule. Expression param.Field[string] `json:"expression"` // An object configuring the rule's logging behavior. Logging param.Field[LoggingParam] `json:"logging"` // The reference of the rule (the rule ID by default). Ref param.Field[string] `json:"ref"` }
func (ForceConnectionCloseRuleParam) MarshalJSON ¶
func (r ForceConnectionCloseRuleParam) MarshalJSON() (data []byte, err error)
type JSChallengeRule ¶
type JSChallengeRule struct { // The timestamp of when the rule was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // The version of the rule. Version string `json:"version,required"` // The unique ID of the rule. ID string `json:"id"` // The action to perform when the rule matches. Action JSChallengeRuleAction `json:"action"` // The parameters configuring the rule's action. ActionParameters interface{} `json:"action_parameters"` // The categories of the rule. Categories []string `json:"categories"` // An informative description of the rule. Description string `json:"description"` // Whether the rule should be executed. Enabled bool `json:"enabled"` // The expression defining which traffic will match the rule. Expression string `json:"expression"` // An object configuring the rule's logging behavior. Logging Logging `json:"logging"` // The reference of the rule (the rule ID by default). Ref string `json:"ref"` JSON jsChallengeRuleJSON `json:"-"` }
func (*JSChallengeRule) UnmarshalJSON ¶
func (r *JSChallengeRule) UnmarshalJSON(data []byte) (err error)
type JSChallengeRuleAction ¶
type JSChallengeRuleAction string
The action to perform when the rule matches.
const (
JSChallengeRuleActionJSChallenge JSChallengeRuleAction = "js_challenge"
)
func (JSChallengeRuleAction) IsKnown ¶
func (r JSChallengeRuleAction) IsKnown() bool
type JSChallengeRuleParam ¶
type JSChallengeRuleParam struct { // The unique ID of the rule. ID param.Field[string] `json:"id"` // The action to perform when the rule matches. Action param.Field[JSChallengeRuleAction] `json:"action"` // The parameters configuring the rule's action. ActionParameters param.Field[interface{}] `json:"action_parameters"` // An informative description of the rule. Description param.Field[string] `json:"description"` // Whether the rule should be executed. Enabled param.Field[bool] `json:"enabled"` // The expression defining which traffic will match the rule. Expression param.Field[string] `json:"expression"` // An object configuring the rule's logging behavior. Logging param.Field[LoggingParam] `json:"logging"` // The reference of the rule (the rule ID by default). Ref param.Field[string] `json:"ref"` }
func (JSChallengeRuleParam) MarshalJSON ¶
func (r JSChallengeRuleParam) MarshalJSON() (data []byte, err error)
type LogCustomFieldRule ¶
type LogCustomFieldRule struct { // The timestamp of when the rule was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // The version of the rule. Version string `json:"version,required"` // The unique ID of the rule. ID string `json:"id"` // The action to perform when the rule matches. Action LogCustomFieldRuleAction `json:"action"` // The parameters configuring the rule's action. ActionParameters LogCustomFieldRuleActionParameters `json:"action_parameters"` // The categories of the rule. Categories []string `json:"categories"` // An informative description of the rule. Description string `json:"description"` // Whether the rule should be executed. Enabled bool `json:"enabled"` // The expression defining which traffic will match the rule. Expression string `json:"expression"` // An object configuring the rule's logging behavior. Logging Logging `json:"logging"` // The reference of the rule (the rule ID by default). Ref string `json:"ref"` JSON logCustomFieldRuleJSON `json:"-"` }
func (*LogCustomFieldRule) UnmarshalJSON ¶
func (r *LogCustomFieldRule) UnmarshalJSON(data []byte) (err error)
type LogCustomFieldRuleAction ¶
type LogCustomFieldRuleAction string
The action to perform when the rule matches.
const (
LogCustomFieldRuleActionLogCustomField LogCustomFieldRuleAction = "log_custom_field"
)
func (LogCustomFieldRuleAction) IsKnown ¶
func (r LogCustomFieldRuleAction) IsKnown() bool
type LogCustomFieldRuleActionParameters ¶
type LogCustomFieldRuleActionParameters struct { // The cookie fields to log. CookieFields []LogCustomFieldRuleActionParametersCookieField `json:"cookie_fields"` // The request fields to log. RequestFields []LogCustomFieldRuleActionParametersRequestField `json:"request_fields"` // The response fields to log. ResponseFields []LogCustomFieldRuleActionParametersResponseField `json:"response_fields"` JSON logCustomFieldRuleActionParametersJSON `json:"-"` }
The parameters configuring the rule's action.
func (*LogCustomFieldRuleActionParameters) UnmarshalJSON ¶
func (r *LogCustomFieldRuleActionParameters) UnmarshalJSON(data []byte) (err error)
type LogCustomFieldRuleActionParametersCookieField ¶
type LogCustomFieldRuleActionParametersCookieField struct { // The name of the field. Name string `json:"name,required"` JSON logCustomFieldRuleActionParametersCookieFieldJSON `json:"-"` }
The cookie field to log.
func (*LogCustomFieldRuleActionParametersCookieField) UnmarshalJSON ¶
func (r *LogCustomFieldRuleActionParametersCookieField) UnmarshalJSON(data []byte) (err error)
type LogCustomFieldRuleActionParametersCookieFieldParam ¶
type LogCustomFieldRuleActionParametersCookieFieldParam struct { // The name of the field. Name param.Field[string] `json:"name,required"` }
The cookie field to log.
func (LogCustomFieldRuleActionParametersCookieFieldParam) MarshalJSON ¶
func (r LogCustomFieldRuleActionParametersCookieFieldParam) MarshalJSON() (data []byte, err error)
type LogCustomFieldRuleActionParametersParam ¶
type LogCustomFieldRuleActionParametersParam struct { // The cookie fields to log. CookieFields param.Field[[]LogCustomFieldRuleActionParametersCookieFieldParam] `json:"cookie_fields"` // The request fields to log. RequestFields param.Field[[]LogCustomFieldRuleActionParametersRequestFieldParam] `json:"request_fields"` // The response fields to log. ResponseFields param.Field[[]LogCustomFieldRuleActionParametersResponseFieldParam] `json:"response_fields"` }
The parameters configuring the rule's action.
func (LogCustomFieldRuleActionParametersParam) MarshalJSON ¶
func (r LogCustomFieldRuleActionParametersParam) MarshalJSON() (data []byte, err error)
type LogCustomFieldRuleActionParametersRequestField ¶
type LogCustomFieldRuleActionParametersRequestField struct { // The name of the field. Name string `json:"name,required"` JSON logCustomFieldRuleActionParametersRequestFieldJSON `json:"-"` }
The request field to log.
func (*LogCustomFieldRuleActionParametersRequestField) UnmarshalJSON ¶
func (r *LogCustomFieldRuleActionParametersRequestField) UnmarshalJSON(data []byte) (err error)
type LogCustomFieldRuleActionParametersRequestFieldParam ¶
type LogCustomFieldRuleActionParametersRequestFieldParam struct { // The name of the field. Name param.Field[string] `json:"name,required"` }
The request field to log.
func (LogCustomFieldRuleActionParametersRequestFieldParam) MarshalJSON ¶
func (r LogCustomFieldRuleActionParametersRequestFieldParam) MarshalJSON() (data []byte, err error)
type LogCustomFieldRuleActionParametersResponseField ¶
type LogCustomFieldRuleActionParametersResponseField struct { // The name of the field. Name string `json:"name,required"` JSON logCustomFieldRuleActionParametersResponseFieldJSON `json:"-"` }
The response field to log.
func (*LogCustomFieldRuleActionParametersResponseField) UnmarshalJSON ¶
func (r *LogCustomFieldRuleActionParametersResponseField) UnmarshalJSON(data []byte) (err error)
type LogCustomFieldRuleActionParametersResponseFieldParam ¶
type LogCustomFieldRuleActionParametersResponseFieldParam struct { // The name of the field. Name param.Field[string] `json:"name,required"` }
The response field to log.
func (LogCustomFieldRuleActionParametersResponseFieldParam) MarshalJSON ¶
func (r LogCustomFieldRuleActionParametersResponseFieldParam) MarshalJSON() (data []byte, err error)
type LogCustomFieldRuleParam ¶
type LogCustomFieldRuleParam struct { // The unique ID of the rule. ID param.Field[string] `json:"id"` // The action to perform when the rule matches. Action param.Field[LogCustomFieldRuleAction] `json:"action"` // The parameters configuring the rule's action. ActionParameters param.Field[LogCustomFieldRuleActionParametersParam] `json:"action_parameters"` // An informative description of the rule. Description param.Field[string] `json:"description"` // Whether the rule should be executed. Enabled param.Field[bool] `json:"enabled"` // The expression defining which traffic will match the rule. Expression param.Field[string] `json:"expression"` // An object configuring the rule's logging behavior. Logging param.Field[LoggingParam] `json:"logging"` // The reference of the rule (the rule ID by default). Ref param.Field[string] `json:"ref"` }
func (LogCustomFieldRuleParam) MarshalJSON ¶
func (r LogCustomFieldRuleParam) MarshalJSON() (data []byte, err error)
type LogRule ¶
type LogRule struct { // The timestamp of when the rule was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // The version of the rule. Version string `json:"version,required"` // The unique ID of the rule. ID string `json:"id"` // The action to perform when the rule matches. Action LogRuleAction `json:"action"` // The parameters configuring the rule's action. ActionParameters interface{} `json:"action_parameters"` // The categories of the rule. Categories []string `json:"categories"` // An informative description of the rule. Description string `json:"description"` // Whether the rule should be executed. Enabled bool `json:"enabled"` // The expression defining which traffic will match the rule. Expression string `json:"expression"` // An object configuring the rule's logging behavior. Logging Logging `json:"logging"` // The reference of the rule (the rule ID by default). Ref string `json:"ref"` JSON logRuleJSON `json:"-"` }
func (*LogRule) UnmarshalJSON ¶
type LogRuleAction ¶
type LogRuleAction string
The action to perform when the rule matches.
const (
LogRuleActionLog LogRuleAction = "log"
)
func (LogRuleAction) IsKnown ¶
func (r LogRuleAction) IsKnown() bool
type LogRuleParam ¶
type LogRuleParam struct { // The unique ID of the rule. ID param.Field[string] `json:"id"` // The action to perform when the rule matches. Action param.Field[LogRuleAction] `json:"action"` // The parameters configuring the rule's action. ActionParameters param.Field[interface{}] `json:"action_parameters"` // An informative description of the rule. Description param.Field[string] `json:"description"` // Whether the rule should be executed. Enabled param.Field[bool] `json:"enabled"` // The expression defining which traffic will match the rule. Expression param.Field[string] `json:"expression"` // An object configuring the rule's logging behavior. Logging param.Field[LoggingParam] `json:"logging"` // The reference of the rule (the rule ID by default). Ref param.Field[string] `json:"ref"` }
func (LogRuleParam) MarshalJSON ¶
func (r LogRuleParam) MarshalJSON() (data []byte, err error)
type Logging ¶
type Logging struct { // Whether to generate a log when the rule matches. Enabled bool `json:"enabled,required"` JSON loggingJSON `json:"-"` }
An object configuring the rule's logging behavior.
func (*Logging) UnmarshalJSON ¶
type LoggingParam ¶
type LoggingParam struct { // Whether to generate a log when the rule matches. Enabled param.Field[bool] `json:"enabled,required"` }
An object configuring the rule's logging behavior.
func (LoggingParam) MarshalJSON ¶
func (r LoggingParam) MarshalJSON() (data []byte, err error)
type ManagedChallengeRule ¶
type ManagedChallengeRule struct { // The timestamp of when the rule was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // The version of the rule. Version string `json:"version,required"` // The unique ID of the rule. ID string `json:"id"` // The action to perform when the rule matches. Action ManagedChallengeRuleAction `json:"action"` // The parameters configuring the rule's action. ActionParameters interface{} `json:"action_parameters"` // The categories of the rule. Categories []string `json:"categories"` // An informative description of the rule. Description string `json:"description"` // Whether the rule should be executed. Enabled bool `json:"enabled"` // The expression defining which traffic will match the rule. Expression string `json:"expression"` // An object configuring the rule's logging behavior. Logging Logging `json:"logging"` // The reference of the rule (the rule ID by default). Ref string `json:"ref"` JSON managedChallengeRuleJSON `json:"-"` }
func (*ManagedChallengeRule) UnmarshalJSON ¶
func (r *ManagedChallengeRule) UnmarshalJSON(data []byte) (err error)
type ManagedChallengeRuleAction ¶
type ManagedChallengeRuleAction string
The action to perform when the rule matches.
const (
ManagedChallengeRuleActionManagedChallenge ManagedChallengeRuleAction = "managed_challenge"
)
func (ManagedChallengeRuleAction) IsKnown ¶
func (r ManagedChallengeRuleAction) IsKnown() bool
type ManagedChallengeRuleParam ¶
type ManagedChallengeRuleParam struct { // The unique ID of the rule. ID param.Field[string] `json:"id"` // The action to perform when the rule matches. Action param.Field[ManagedChallengeRuleAction] `json:"action"` // The parameters configuring the rule's action. ActionParameters param.Field[interface{}] `json:"action_parameters"` // An informative description of the rule. Description param.Field[string] `json:"description"` // Whether the rule should be executed. Enabled param.Field[bool] `json:"enabled"` // The expression defining which traffic will match the rule. Expression param.Field[string] `json:"expression"` // An object configuring the rule's logging behavior. Logging param.Field[LoggingParam] `json:"logging"` // The reference of the rule (the rule ID by default). Ref param.Field[string] `json:"ref"` }
func (ManagedChallengeRuleParam) MarshalJSON ¶
func (r ManagedChallengeRuleParam) MarshalJSON() (data []byte, err error)
type MemberRoleParam ¶
type MemberRoleParam = shared.MemberRoleParam
This is an alias to an internal type.
type MemberRolesPermissionsParam ¶
type MemberRolesPermissionsParam = shared.MemberRolesPermissionsParam
This is an alias to an internal type.
type MemberStatus ¶
type MemberStatus = shared.MemberStatus
A member's status in the account.
This is an alias to an internal type.
type MemberUserParam ¶
type MemberUserParam = shared.MemberUserParam
Details of the user associated to the membership.
This is an alias to an internal type.
type PermissionGrant ¶
type PermissionGrant = shared.PermissionGrant
This is an alias to an internal type.
type PermissionGrantParam ¶
type PermissionGrantParam = shared.PermissionGrantParam
This is an alias to an internal type.
type Phase ¶
type Phase string
The phase of the ruleset.
const ( PhaseDDoSL4 Phase = "ddos_l4" PhaseDDoSL7 Phase = "ddos_l7" PhaseHTTPConfigSettings Phase = "http_config_settings" PhaseHTTPCustomErrors Phase = "http_custom_errors" PhaseHTTPLogCustomFields Phase = "http_log_custom_fields" PhaseHTTPRatelimit Phase = "http_ratelimit" PhaseHTTPRequestCacheSettings Phase = "http_request_cache_settings" PhaseHTTPRequestDynamicRedirect Phase = "http_request_dynamic_redirect" PhaseHTTPRequestFirewallCustom Phase = "http_request_firewall_custom" PhaseHTTPRequestFirewallManaged Phase = "http_request_firewall_managed" PhaseHTTPRequestLateTransform Phase = "http_request_late_transform" PhaseHTTPRequestOrigin Phase = "http_request_origin" PhaseHTTPRequestRedirect Phase = "http_request_redirect" PhaseHTTPRequestSanitize Phase = "http_request_sanitize" PhaseHTTPRequestSBFM Phase = "http_request_sbfm" PhaseHTTPRequestSelectConfiguration Phase = "http_request_select_configuration" PhaseHTTPRequestTransform Phase = "http_request_transform" PhaseHTTPResponseCompression Phase = "http_response_compression" PhaseHTTPResponseFirewallManaged Phase = "http_response_firewall_managed" PhaseHTTPResponseHeadersTransform Phase = "http_response_headers_transform" PhaseMagicTransit Phase = "magic_transit" PhaseMagicTransitIDsManaged Phase = "magic_transit_ids_managed" PhaseMagicTransitManaged Phase = "magic_transit_managed" )
type PhaseGetResponse ¶
type PhaseGetResponse struct { // The unique ID of the ruleset. ID string `json:"id,required"` // The kind of the ruleset. Kind Kind `json:"kind,required"` // The timestamp of when the ruleset was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // The human-readable name of the ruleset. Name string `json:"name,required"` // The phase of the ruleset. Phase Phase `json:"phase,required"` // The list of rules in the ruleset. Rules []PhaseGetResponseRule `json:"rules,required"` // The version of the ruleset. Version string `json:"version,required"` // An informative description of the ruleset. Description string `json:"description"` JSON phaseGetResponseJSON `json:"-"` }
A ruleset object.
func (*PhaseGetResponse) UnmarshalJSON ¶
func (r *PhaseGetResponse) UnmarshalJSON(data []byte) (err error)
type PhaseGetResponseEnvelope ¶
type PhaseGetResponseEnvelope struct { // A list of error messages. Errors []PhaseGetResponseEnvelopeErrors `json:"errors,required"` // A list of warning messages. Messages []PhaseGetResponseEnvelopeMessages `json:"messages,required"` // A ruleset object. Result PhaseGetResponse `json:"result,required"` // Whether the API call was successful. Success PhaseGetResponseEnvelopeSuccess `json:"success,required"` JSON phaseGetResponseEnvelopeJSON `json:"-"` }
A response object.
func (*PhaseGetResponseEnvelope) UnmarshalJSON ¶
func (r *PhaseGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type PhaseGetResponseEnvelopeErrors ¶
type PhaseGetResponseEnvelopeErrors struct { // A text description of this message. Message string `json:"message,required"` // A unique code for this message. Code int64 `json:"code"` // The source of this message. Source PhaseGetResponseEnvelopeErrorsSource `json:"source"` JSON phaseGetResponseEnvelopeErrorsJSON `json:"-"` }
A message.
func (*PhaseGetResponseEnvelopeErrors) UnmarshalJSON ¶
func (r *PhaseGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)
type PhaseGetResponseEnvelopeErrorsSource ¶
type PhaseGetResponseEnvelopeErrorsSource struct { // A JSON pointer to the field that is the source of the message. Pointer string `json:"pointer,required"` JSON phaseGetResponseEnvelopeErrorsSourceJSON `json:"-"` }
The source of this message.
func (*PhaseGetResponseEnvelopeErrorsSource) UnmarshalJSON ¶
func (r *PhaseGetResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error)
type PhaseGetResponseEnvelopeMessages ¶
type PhaseGetResponseEnvelopeMessages struct { // A text description of this message. Message string `json:"message,required"` // A unique code for this message. Code int64 `json:"code"` // The source of this message. Source PhaseGetResponseEnvelopeMessagesSource `json:"source"` JSON phaseGetResponseEnvelopeMessagesJSON `json:"-"` }
A message.
func (*PhaseGetResponseEnvelopeMessages) UnmarshalJSON ¶
func (r *PhaseGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)
type PhaseGetResponseEnvelopeMessagesSource ¶
type PhaseGetResponseEnvelopeMessagesSource struct { // A JSON pointer to the field that is the source of the message. Pointer string `json:"pointer,required"` JSON phaseGetResponseEnvelopeMessagesSourceJSON `json:"-"` }
The source of this message.
func (*PhaseGetResponseEnvelopeMessagesSource) UnmarshalJSON ¶
func (r *PhaseGetResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error)
type PhaseGetResponseEnvelopeSuccess ¶
type PhaseGetResponseEnvelopeSuccess bool
Whether the API call was successful.
const (
PhaseGetResponseEnvelopeSuccessTrue PhaseGetResponseEnvelopeSuccess = true
)
func (PhaseGetResponseEnvelopeSuccess) IsKnown ¶
func (r PhaseGetResponseEnvelopeSuccess) IsKnown() bool
type PhaseGetResponseRule ¶
type PhaseGetResponseRule struct { // The action to perform when the rule matches. Action PhaseGetResponseRulesAction `json:"action"` // This field can have the runtime type of [BlockRuleActionParameters], // [interface{}], [CompressResponseRuleActionParameters], // [ExecuteRuleActionParameters], [RedirectRuleActionParameters], // [RewriteRuleActionParameters], [RouteRuleActionParameters], // [ScoreRuleActionParameters], [ServeErrorRuleActionParameters], // [SetConfigRuleActionParameters], [SkipRuleActionParameters], // [SetCacheSettingsRuleActionParameters], [LogCustomFieldRuleActionParameters]. ActionParameters interface{} `json:"action_parameters,required"` // This field can have the runtime type of [[]string]. Categories interface{} `json:"categories,required"` // An informative description of the rule. Description string `json:"description"` // Whether the rule should be executed. Enabled bool `json:"enabled"` // The expression defining which traffic will match the rule. Expression string `json:"expression"` // The unique ID of the rule. ID string `json:"id"` // The timestamp of when the rule was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // An object configuring the rule's logging behavior. Logging Logging `json:"logging"` // The reference of the rule (the rule ID by default). Ref string `json:"ref"` // The version of the rule. Version string `json:"version,required"` JSON phaseGetResponseRuleJSON `json:"-"` // contains filtered or unexported fields }
func (PhaseGetResponseRule) AsUnion ¶
func (r PhaseGetResponseRule) AsUnion() PhaseGetResponseRulesUnion
AsUnion returns a PhaseGetResponseRulesUnion interface which you can cast to the specific types for more type safety.
Possible runtime types of the union are rulesets.BlockRule, rulesets.ChallengeRule, rulesets.CompressResponseRule, rulesets.ExecuteRule, rulesets.JSChallengeRule, rulesets.LogRule, rulesets.ManagedChallengeRule, rulesets.RedirectRule, rulesets.RewriteRule, rulesets.RouteRule, rulesets.ScoreRule, rulesets.ServeErrorRule, rulesets.SetConfigRule, rulesets.SkipRule, rulesets.SetCacheSettingsRule, rulesets.LogCustomFieldRule, rulesets.DDoSDynamicRule, rulesets.ForceConnectionCloseRule.
func (*PhaseGetResponseRule) UnmarshalJSON ¶
func (r *PhaseGetResponseRule) UnmarshalJSON(data []byte) (err error)
type PhaseGetResponseRulesAction ¶
type PhaseGetResponseRulesAction string
The action to perform when the rule matches.
const ( PhaseGetResponseRulesActionBlock PhaseGetResponseRulesAction = "block" PhaseGetResponseRulesActionChallenge PhaseGetResponseRulesAction = "challenge" PhaseGetResponseRulesActionCompressResponse PhaseGetResponseRulesAction = "compress_response" PhaseGetResponseRulesActionExecute PhaseGetResponseRulesAction = "execute" PhaseGetResponseRulesActionJSChallenge PhaseGetResponseRulesAction = "js_challenge" PhaseGetResponseRulesActionLog PhaseGetResponseRulesAction = "log" PhaseGetResponseRulesActionManagedChallenge PhaseGetResponseRulesAction = "managed_challenge" PhaseGetResponseRulesActionRedirect PhaseGetResponseRulesAction = "redirect" PhaseGetResponseRulesActionRewrite PhaseGetResponseRulesAction = "rewrite" PhaseGetResponseRulesActionRoute PhaseGetResponseRulesAction = "route" PhaseGetResponseRulesActionScore PhaseGetResponseRulesAction = "score" PhaseGetResponseRulesActionServeError PhaseGetResponseRulesAction = "serve_error" PhaseGetResponseRulesActionSetConfig PhaseGetResponseRulesAction = "set_config" PhaseGetResponseRulesActionSkip PhaseGetResponseRulesAction = "skip" PhaseGetResponseRulesActionSetCacheSettings PhaseGetResponseRulesAction = "set_cache_settings" PhaseGetResponseRulesActionLogCustomField PhaseGetResponseRulesAction = "log_custom_field" PhaseGetResponseRulesActionDDoSDynamic PhaseGetResponseRulesAction = "ddos_dynamic" PhaseGetResponseRulesActionForceConnectionClose PhaseGetResponseRulesAction = "force_connection_close" )
func (PhaseGetResponseRulesAction) IsKnown ¶
func (r PhaseGetResponseRulesAction) IsKnown() bool
type PhaseGetResponseRulesUnion ¶
type PhaseGetResponseRulesUnion interface {
// contains filtered or unexported methods
}
Union satisfied by rulesets.BlockRule, rulesets.ChallengeRule, rulesets.CompressResponseRule, rulesets.ExecuteRule, rulesets.JSChallengeRule, rulesets.LogRule, rulesets.ManagedChallengeRule, rulesets.RedirectRule, rulesets.RewriteRule, rulesets.RouteRule, rulesets.ScoreRule, rulesets.ServeErrorRule, rulesets.SetConfigRule, rulesets.SkipRule, rulesets.SetCacheSettingsRule, rulesets.LogCustomFieldRule, rulesets.DDoSDynamicRule or rulesets.ForceConnectionCloseRule.
type PhaseService ¶
type PhaseService struct { Options []option.RequestOption Versions *PhaseVersionService }
PhaseService contains methods and other services that help with interacting with the testcloudflare API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewPhaseService method instead.
func NewPhaseService ¶
func NewPhaseService(opts ...option.RequestOption) (r *PhaseService)
NewPhaseService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*PhaseService) Get ¶
func (r *PhaseService) Get(ctx context.Context, accountOrZone string, accountOrZoneID string, rulesetPhase Phase, opts ...option.RequestOption) (res *PhaseGetResponse, err error)
Fetches the latest version of the account or zone entry point ruleset for a given phase.
func (*PhaseService) Update ¶
func (r *PhaseService) Update(ctx context.Context, accountOrZone string, accountOrZoneID string, rulesetPhase Phase, body PhaseUpdateParams, opts ...option.RequestOption) (res *PhaseUpdateResponse, err error)
Updates an account or zone entry point ruleset, creating a new version.
type PhaseUpdateParams ¶
type PhaseUpdateParams struct { // The list of rules in the ruleset. Rules param.Field[[]PhaseUpdateParamsRuleUnion] `json:"rules,required"` // An informative description of the ruleset. Description param.Field[string] `json:"description"` // The human-readable name of the ruleset. Name param.Field[string] `json:"name"` }
func (PhaseUpdateParams) MarshalJSON ¶
func (r PhaseUpdateParams) MarshalJSON() (data []byte, err error)
type PhaseUpdateParamsRule ¶
type PhaseUpdateParamsRule struct { // The action to perform when the rule matches. Action param.Field[PhaseUpdateParamsRulesAction] `json:"action"` ActionParameters param.Field[interface{}] `json:"action_parameters,required"` Categories param.Field[interface{}] `json:"categories,required"` // An informative description of the rule. Description param.Field[string] `json:"description"` // Whether the rule should be executed. Enabled param.Field[bool] `json:"enabled"` // The expression defining which traffic will match the rule. Expression param.Field[string] `json:"expression"` // The unique ID of the rule. ID param.Field[string] `json:"id"` // An object configuring the rule's logging behavior. Logging param.Field[LoggingParam] `json:"logging"` // The reference of the rule (the rule ID by default). Ref param.Field[string] `json:"ref"` }
func (PhaseUpdateParamsRule) MarshalJSON ¶
func (r PhaseUpdateParamsRule) MarshalJSON() (data []byte, err error)
type PhaseUpdateParamsRuleUnion ¶
type PhaseUpdateParamsRuleUnion interface {
// contains filtered or unexported methods
}
Satisfied by rulesets.BlockRuleParam, rulesets.ChallengeRuleParam, rulesets.CompressResponseRuleParam, rulesets.ExecuteRuleParam, rulesets.JSChallengeRuleParam, rulesets.LogRuleParam, rulesets.ManagedChallengeRuleParam, rulesets.RedirectRuleParam, rulesets.RewriteRuleParam, rulesets.RouteRuleParam, rulesets.ScoreRuleParam, rulesets.ServeErrorRuleParam, rulesets.SetConfigRuleParam, rulesets.SkipRuleParam, rulesets.SetCacheSettingsRuleParam, rulesets.LogCustomFieldRuleParam, rulesets.DDoSDynamicRuleParam, rulesets.ForceConnectionCloseRuleParam, PhaseUpdateParamsRule.
type PhaseUpdateParamsRulesAction ¶
type PhaseUpdateParamsRulesAction string
The action to perform when the rule matches.
const ( PhaseUpdateParamsRulesActionBlock PhaseUpdateParamsRulesAction = "block" PhaseUpdateParamsRulesActionChallenge PhaseUpdateParamsRulesAction = "challenge" PhaseUpdateParamsRulesActionCompressResponse PhaseUpdateParamsRulesAction = "compress_response" PhaseUpdateParamsRulesActionExecute PhaseUpdateParamsRulesAction = "execute" PhaseUpdateParamsRulesActionJSChallenge PhaseUpdateParamsRulesAction = "js_challenge" PhaseUpdateParamsRulesActionLog PhaseUpdateParamsRulesAction = "log" PhaseUpdateParamsRulesActionManagedChallenge PhaseUpdateParamsRulesAction = "managed_challenge" PhaseUpdateParamsRulesActionRedirect PhaseUpdateParamsRulesAction = "redirect" PhaseUpdateParamsRulesActionRewrite PhaseUpdateParamsRulesAction = "rewrite" PhaseUpdateParamsRulesActionRoute PhaseUpdateParamsRulesAction = "route" PhaseUpdateParamsRulesActionScore PhaseUpdateParamsRulesAction = "score" PhaseUpdateParamsRulesActionServeError PhaseUpdateParamsRulesAction = "serve_error" PhaseUpdateParamsRulesActionSetConfig PhaseUpdateParamsRulesAction = "set_config" PhaseUpdateParamsRulesActionSkip PhaseUpdateParamsRulesAction = "skip" PhaseUpdateParamsRulesActionSetCacheSettings PhaseUpdateParamsRulesAction = "set_cache_settings" PhaseUpdateParamsRulesActionLogCustomField PhaseUpdateParamsRulesAction = "log_custom_field" PhaseUpdateParamsRulesActionDDoSDynamic PhaseUpdateParamsRulesAction = "ddos_dynamic" PhaseUpdateParamsRulesActionForceConnectionClose PhaseUpdateParamsRulesAction = "force_connection_close" )
func (PhaseUpdateParamsRulesAction) IsKnown ¶
func (r PhaseUpdateParamsRulesAction) IsKnown() bool
type PhaseUpdateResponse ¶
type PhaseUpdateResponse struct { // The unique ID of the ruleset. ID string `json:"id,required"` // The kind of the ruleset. Kind Kind `json:"kind,required"` // The timestamp of when the ruleset was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // The human-readable name of the ruleset. Name string `json:"name,required"` // The phase of the ruleset. Phase Phase `json:"phase,required"` // The list of rules in the ruleset. Rules []PhaseUpdateResponseRule `json:"rules,required"` // The version of the ruleset. Version string `json:"version,required"` // An informative description of the ruleset. Description string `json:"description"` JSON phaseUpdateResponseJSON `json:"-"` }
A ruleset object.
func (*PhaseUpdateResponse) UnmarshalJSON ¶
func (r *PhaseUpdateResponse) UnmarshalJSON(data []byte) (err error)
type PhaseUpdateResponseEnvelope ¶
type PhaseUpdateResponseEnvelope struct { // A list of error messages. Errors []PhaseUpdateResponseEnvelopeErrors `json:"errors,required"` // A list of warning messages. Messages []PhaseUpdateResponseEnvelopeMessages `json:"messages,required"` // A ruleset object. Result PhaseUpdateResponse `json:"result,required"` // Whether the API call was successful. Success PhaseUpdateResponseEnvelopeSuccess `json:"success,required"` JSON phaseUpdateResponseEnvelopeJSON `json:"-"` }
A response object.
func (*PhaseUpdateResponseEnvelope) UnmarshalJSON ¶
func (r *PhaseUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type PhaseUpdateResponseEnvelopeErrors ¶
type PhaseUpdateResponseEnvelopeErrors struct { // A text description of this message. Message string `json:"message,required"` // A unique code for this message. Code int64 `json:"code"` // The source of this message. Source PhaseUpdateResponseEnvelopeErrorsSource `json:"source"` JSON phaseUpdateResponseEnvelopeErrorsJSON `json:"-"` }
A message.
func (*PhaseUpdateResponseEnvelopeErrors) UnmarshalJSON ¶
func (r *PhaseUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)
type PhaseUpdateResponseEnvelopeErrorsSource ¶
type PhaseUpdateResponseEnvelopeErrorsSource struct { // A JSON pointer to the field that is the source of the message. Pointer string `json:"pointer,required"` JSON phaseUpdateResponseEnvelopeErrorsSourceJSON `json:"-"` }
The source of this message.
func (*PhaseUpdateResponseEnvelopeErrorsSource) UnmarshalJSON ¶
func (r *PhaseUpdateResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error)
type PhaseUpdateResponseEnvelopeMessages ¶
type PhaseUpdateResponseEnvelopeMessages struct { // A text description of this message. Message string `json:"message,required"` // A unique code for this message. Code int64 `json:"code"` // The source of this message. Source PhaseUpdateResponseEnvelopeMessagesSource `json:"source"` JSON phaseUpdateResponseEnvelopeMessagesJSON `json:"-"` }
A message.
func (*PhaseUpdateResponseEnvelopeMessages) UnmarshalJSON ¶
func (r *PhaseUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)
type PhaseUpdateResponseEnvelopeMessagesSource ¶
type PhaseUpdateResponseEnvelopeMessagesSource struct { // A JSON pointer to the field that is the source of the message. Pointer string `json:"pointer,required"` JSON phaseUpdateResponseEnvelopeMessagesSourceJSON `json:"-"` }
The source of this message.
func (*PhaseUpdateResponseEnvelopeMessagesSource) UnmarshalJSON ¶
func (r *PhaseUpdateResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error)
type PhaseUpdateResponseEnvelopeSuccess ¶
type PhaseUpdateResponseEnvelopeSuccess bool
Whether the API call was successful.
const (
PhaseUpdateResponseEnvelopeSuccessTrue PhaseUpdateResponseEnvelopeSuccess = true
)
func (PhaseUpdateResponseEnvelopeSuccess) IsKnown ¶
func (r PhaseUpdateResponseEnvelopeSuccess) IsKnown() bool
type PhaseUpdateResponseRule ¶
type PhaseUpdateResponseRule struct { // The action to perform when the rule matches. Action PhaseUpdateResponseRulesAction `json:"action"` // This field can have the runtime type of [BlockRuleActionParameters], // [interface{}], [CompressResponseRuleActionParameters], // [ExecuteRuleActionParameters], [RedirectRuleActionParameters], // [RewriteRuleActionParameters], [RouteRuleActionParameters], // [ScoreRuleActionParameters], [ServeErrorRuleActionParameters], // [SetConfigRuleActionParameters], [SkipRuleActionParameters], // [SetCacheSettingsRuleActionParameters], [LogCustomFieldRuleActionParameters]. ActionParameters interface{} `json:"action_parameters,required"` // This field can have the runtime type of [[]string]. Categories interface{} `json:"categories,required"` // An informative description of the rule. Description string `json:"description"` // Whether the rule should be executed. Enabled bool `json:"enabled"` // The expression defining which traffic will match the rule. Expression string `json:"expression"` // The unique ID of the rule. ID string `json:"id"` // The timestamp of when the rule was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // An object configuring the rule's logging behavior. Logging Logging `json:"logging"` // The reference of the rule (the rule ID by default). Ref string `json:"ref"` // The version of the rule. Version string `json:"version,required"` JSON phaseUpdateResponseRuleJSON `json:"-"` // contains filtered or unexported fields }
func (PhaseUpdateResponseRule) AsUnion ¶
func (r PhaseUpdateResponseRule) AsUnion() PhaseUpdateResponseRulesUnion
AsUnion returns a PhaseUpdateResponseRulesUnion interface which you can cast to the specific types for more type safety.
Possible runtime types of the union are rulesets.BlockRule, rulesets.ChallengeRule, rulesets.CompressResponseRule, rulesets.ExecuteRule, rulesets.JSChallengeRule, rulesets.LogRule, rulesets.ManagedChallengeRule, rulesets.RedirectRule, rulesets.RewriteRule, rulesets.RouteRule, rulesets.ScoreRule, rulesets.ServeErrorRule, rulesets.SetConfigRule, rulesets.SkipRule, rulesets.SetCacheSettingsRule, rulesets.LogCustomFieldRule, rulesets.DDoSDynamicRule, rulesets.ForceConnectionCloseRule.
func (*PhaseUpdateResponseRule) UnmarshalJSON ¶
func (r *PhaseUpdateResponseRule) UnmarshalJSON(data []byte) (err error)
type PhaseUpdateResponseRulesAction ¶
type PhaseUpdateResponseRulesAction string
The action to perform when the rule matches.
const ( PhaseUpdateResponseRulesActionBlock PhaseUpdateResponseRulesAction = "block" PhaseUpdateResponseRulesActionChallenge PhaseUpdateResponseRulesAction = "challenge" PhaseUpdateResponseRulesActionCompressResponse PhaseUpdateResponseRulesAction = "compress_response" PhaseUpdateResponseRulesActionExecute PhaseUpdateResponseRulesAction = "execute" PhaseUpdateResponseRulesActionJSChallenge PhaseUpdateResponseRulesAction = "js_challenge" PhaseUpdateResponseRulesActionLog PhaseUpdateResponseRulesAction = "log" PhaseUpdateResponseRulesActionManagedChallenge PhaseUpdateResponseRulesAction = "managed_challenge" PhaseUpdateResponseRulesActionRedirect PhaseUpdateResponseRulesAction = "redirect" PhaseUpdateResponseRulesActionRewrite PhaseUpdateResponseRulesAction = "rewrite" PhaseUpdateResponseRulesActionRoute PhaseUpdateResponseRulesAction = "route" PhaseUpdateResponseRulesActionScore PhaseUpdateResponseRulesAction = "score" PhaseUpdateResponseRulesActionServeError PhaseUpdateResponseRulesAction = "serve_error" PhaseUpdateResponseRulesActionSetConfig PhaseUpdateResponseRulesAction = "set_config" PhaseUpdateResponseRulesActionSkip PhaseUpdateResponseRulesAction = "skip" PhaseUpdateResponseRulesActionSetCacheSettings PhaseUpdateResponseRulesAction = "set_cache_settings" PhaseUpdateResponseRulesActionLogCustomField PhaseUpdateResponseRulesAction = "log_custom_field" PhaseUpdateResponseRulesActionDDoSDynamic PhaseUpdateResponseRulesAction = "ddos_dynamic" PhaseUpdateResponseRulesActionForceConnectionClose PhaseUpdateResponseRulesAction = "force_connection_close" )
func (PhaseUpdateResponseRulesAction) IsKnown ¶
func (r PhaseUpdateResponseRulesAction) IsKnown() bool
type PhaseUpdateResponseRulesUnion ¶
type PhaseUpdateResponseRulesUnion interface {
// contains filtered or unexported methods
}
Union satisfied by rulesets.BlockRule, rulesets.ChallengeRule, rulesets.CompressResponseRule, rulesets.ExecuteRule, rulesets.JSChallengeRule, rulesets.LogRule, rulesets.ManagedChallengeRule, rulesets.RedirectRule, rulesets.RewriteRule, rulesets.RouteRule, rulesets.ScoreRule, rulesets.ServeErrorRule, rulesets.SetConfigRule, rulesets.SkipRule, rulesets.SetCacheSettingsRule, rulesets.LogCustomFieldRule, rulesets.DDoSDynamicRule or rulesets.ForceConnectionCloseRule.
type PhaseVersionGetResponse ¶
type PhaseVersionGetResponse struct { // The unique ID of the ruleset. ID string `json:"id,required"` // The kind of the ruleset. Kind Kind `json:"kind,required"` // The timestamp of when the ruleset was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // The human-readable name of the ruleset. Name string `json:"name,required"` // The phase of the ruleset. Phase Phase `json:"phase,required"` // The list of rules in the ruleset. Rules []PhaseVersionGetResponseRule `json:"rules,required"` // The version of the ruleset. Version string `json:"version,required"` // An informative description of the ruleset. Description string `json:"description"` JSON phaseVersionGetResponseJSON `json:"-"` }
A ruleset object.
func (*PhaseVersionGetResponse) UnmarshalJSON ¶
func (r *PhaseVersionGetResponse) UnmarshalJSON(data []byte) (err error)
type PhaseVersionGetResponseEnvelope ¶
type PhaseVersionGetResponseEnvelope struct { // A list of error messages. Errors []PhaseVersionGetResponseEnvelopeErrors `json:"errors,required"` // A list of warning messages. Messages []PhaseVersionGetResponseEnvelopeMessages `json:"messages,required"` // A ruleset object. Result PhaseVersionGetResponse `json:"result,required"` // Whether the API call was successful. Success PhaseVersionGetResponseEnvelopeSuccess `json:"success,required"` JSON phaseVersionGetResponseEnvelopeJSON `json:"-"` }
A response object.
func (*PhaseVersionGetResponseEnvelope) UnmarshalJSON ¶
func (r *PhaseVersionGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type PhaseVersionGetResponseEnvelopeErrors ¶
type PhaseVersionGetResponseEnvelopeErrors struct { // A text description of this message. Message string `json:"message,required"` // A unique code for this message. Code int64 `json:"code"` // The source of this message. Source PhaseVersionGetResponseEnvelopeErrorsSource `json:"source"` JSON phaseVersionGetResponseEnvelopeErrorsJSON `json:"-"` }
A message.
func (*PhaseVersionGetResponseEnvelopeErrors) UnmarshalJSON ¶
func (r *PhaseVersionGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)
type PhaseVersionGetResponseEnvelopeErrorsSource ¶
type PhaseVersionGetResponseEnvelopeErrorsSource struct { // A JSON pointer to the field that is the source of the message. Pointer string `json:"pointer,required"` JSON phaseVersionGetResponseEnvelopeErrorsSourceJSON `json:"-"` }
The source of this message.
func (*PhaseVersionGetResponseEnvelopeErrorsSource) UnmarshalJSON ¶
func (r *PhaseVersionGetResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error)
type PhaseVersionGetResponseEnvelopeMessages ¶
type PhaseVersionGetResponseEnvelopeMessages struct { // A text description of this message. Message string `json:"message,required"` // A unique code for this message. Code int64 `json:"code"` // The source of this message. Source PhaseVersionGetResponseEnvelopeMessagesSource `json:"source"` JSON phaseVersionGetResponseEnvelopeMessagesJSON `json:"-"` }
A message.
func (*PhaseVersionGetResponseEnvelopeMessages) UnmarshalJSON ¶
func (r *PhaseVersionGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)
type PhaseVersionGetResponseEnvelopeMessagesSource ¶
type PhaseVersionGetResponseEnvelopeMessagesSource struct { // A JSON pointer to the field that is the source of the message. Pointer string `json:"pointer,required"` JSON phaseVersionGetResponseEnvelopeMessagesSourceJSON `json:"-"` }
The source of this message.
func (*PhaseVersionGetResponseEnvelopeMessagesSource) UnmarshalJSON ¶
func (r *PhaseVersionGetResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error)
type PhaseVersionGetResponseEnvelopeSuccess ¶
type PhaseVersionGetResponseEnvelopeSuccess bool
Whether the API call was successful.
const (
PhaseVersionGetResponseEnvelopeSuccessTrue PhaseVersionGetResponseEnvelopeSuccess = true
)
func (PhaseVersionGetResponseEnvelopeSuccess) IsKnown ¶
func (r PhaseVersionGetResponseEnvelopeSuccess) IsKnown() bool
type PhaseVersionGetResponseRule ¶
type PhaseVersionGetResponseRule struct { // The action to perform when the rule matches. Action PhaseVersionGetResponseRulesAction `json:"action"` // This field can have the runtime type of [BlockRuleActionParameters], // [interface{}], [CompressResponseRuleActionParameters], // [ExecuteRuleActionParameters], [RedirectRuleActionParameters], // [RewriteRuleActionParameters], [RouteRuleActionParameters], // [ScoreRuleActionParameters], [ServeErrorRuleActionParameters], // [SetConfigRuleActionParameters], [SkipRuleActionParameters], // [SetCacheSettingsRuleActionParameters], [LogCustomFieldRuleActionParameters]. ActionParameters interface{} `json:"action_parameters,required"` // This field can have the runtime type of [[]string]. Categories interface{} `json:"categories,required"` // An informative description of the rule. Description string `json:"description"` // Whether the rule should be executed. Enabled bool `json:"enabled"` // The expression defining which traffic will match the rule. Expression string `json:"expression"` // The unique ID of the rule. ID string `json:"id"` // The timestamp of when the rule was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // An object configuring the rule's logging behavior. Logging Logging `json:"logging"` // The reference of the rule (the rule ID by default). Ref string `json:"ref"` // The version of the rule. Version string `json:"version,required"` JSON phaseVersionGetResponseRuleJSON `json:"-"` // contains filtered or unexported fields }
func (PhaseVersionGetResponseRule) AsUnion ¶
func (r PhaseVersionGetResponseRule) AsUnion() PhaseVersionGetResponseRulesUnion
AsUnion returns a PhaseVersionGetResponseRulesUnion interface which you can cast to the specific types for more type safety.
Possible runtime types of the union are rulesets.BlockRule, rulesets.ChallengeRule, rulesets.CompressResponseRule, rulesets.ExecuteRule, rulesets.JSChallengeRule, rulesets.LogRule, rulesets.ManagedChallengeRule, rulesets.RedirectRule, rulesets.RewriteRule, rulesets.RouteRule, rulesets.ScoreRule, rulesets.ServeErrorRule, rulesets.SetConfigRule, rulesets.SkipRule, rulesets.SetCacheSettingsRule, rulesets.LogCustomFieldRule, rulesets.DDoSDynamicRule, rulesets.ForceConnectionCloseRule.
func (*PhaseVersionGetResponseRule) UnmarshalJSON ¶
func (r *PhaseVersionGetResponseRule) UnmarshalJSON(data []byte) (err error)
type PhaseVersionGetResponseRulesAction ¶
type PhaseVersionGetResponseRulesAction string
The action to perform when the rule matches.
const ( PhaseVersionGetResponseRulesActionBlock PhaseVersionGetResponseRulesAction = "block" PhaseVersionGetResponseRulesActionChallenge PhaseVersionGetResponseRulesAction = "challenge" PhaseVersionGetResponseRulesActionCompressResponse PhaseVersionGetResponseRulesAction = "compress_response" PhaseVersionGetResponseRulesActionExecute PhaseVersionGetResponseRulesAction = "execute" PhaseVersionGetResponseRulesActionJSChallenge PhaseVersionGetResponseRulesAction = "js_challenge" PhaseVersionGetResponseRulesActionLog PhaseVersionGetResponseRulesAction = "log" PhaseVersionGetResponseRulesActionManagedChallenge PhaseVersionGetResponseRulesAction = "managed_challenge" PhaseVersionGetResponseRulesActionRedirect PhaseVersionGetResponseRulesAction = "redirect" PhaseVersionGetResponseRulesActionRewrite PhaseVersionGetResponseRulesAction = "rewrite" PhaseVersionGetResponseRulesActionRoute PhaseVersionGetResponseRulesAction = "route" PhaseVersionGetResponseRulesActionScore PhaseVersionGetResponseRulesAction = "score" PhaseVersionGetResponseRulesActionServeError PhaseVersionGetResponseRulesAction = "serve_error" PhaseVersionGetResponseRulesActionSetConfig PhaseVersionGetResponseRulesAction = "set_config" PhaseVersionGetResponseRulesActionSkip PhaseVersionGetResponseRulesAction = "skip" PhaseVersionGetResponseRulesActionSetCacheSettings PhaseVersionGetResponseRulesAction = "set_cache_settings" PhaseVersionGetResponseRulesActionLogCustomField PhaseVersionGetResponseRulesAction = "log_custom_field" PhaseVersionGetResponseRulesActionDDoSDynamic PhaseVersionGetResponseRulesAction = "ddos_dynamic" PhaseVersionGetResponseRulesActionForceConnectionClose PhaseVersionGetResponseRulesAction = "force_connection_close" )
func (PhaseVersionGetResponseRulesAction) IsKnown ¶
func (r PhaseVersionGetResponseRulesAction) IsKnown() bool
type PhaseVersionGetResponseRulesUnion ¶
type PhaseVersionGetResponseRulesUnion interface {
// contains filtered or unexported methods
}
Union satisfied by rulesets.BlockRule, rulesets.ChallengeRule, rulesets.CompressResponseRule, rulesets.ExecuteRule, rulesets.JSChallengeRule, rulesets.LogRule, rulesets.ManagedChallengeRule, rulesets.RedirectRule, rulesets.RewriteRule, rulesets.RouteRule, rulesets.ScoreRule, rulesets.ServeErrorRule, rulesets.SetConfigRule, rulesets.SkipRule, rulesets.SetCacheSettingsRule, rulesets.LogCustomFieldRule, rulesets.DDoSDynamicRule or rulesets.ForceConnectionCloseRule.
type PhaseVersionListResponse ¶
type PhaseVersionListResponse struct { // The unique ID of the ruleset. ID string `json:"id,required"` // The kind of the ruleset. Kind Kind `json:"kind,required"` // The timestamp of when the ruleset was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // The human-readable name of the ruleset. Name string `json:"name,required"` // The phase of the ruleset. Phase Phase `json:"phase,required"` // The version of the ruleset. Version string `json:"version,required"` // An informative description of the ruleset. Description string `json:"description"` JSON phaseVersionListResponseJSON `json:"-"` }
A ruleset object.
func (*PhaseVersionListResponse) UnmarshalJSON ¶
func (r *PhaseVersionListResponse) UnmarshalJSON(data []byte) (err error)
type PhaseVersionService ¶
type PhaseVersionService struct {
Options []option.RequestOption
}
PhaseVersionService contains methods and other services that help with interacting with the testcloudflare API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewPhaseVersionService method instead.
func NewPhaseVersionService ¶
func NewPhaseVersionService(opts ...option.RequestOption) (r *PhaseVersionService)
NewPhaseVersionService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*PhaseVersionService) Get ¶
func (r *PhaseVersionService) Get(ctx context.Context, accountOrZone string, accountOrZoneID string, rulesetPhase Phase, rulesetVersion string, opts ...option.RequestOption) (res *PhaseVersionGetResponse, err error)
Fetches a specific version of an account or zone entry point ruleset.
func (*PhaseVersionService) List ¶
func (r *PhaseVersionService) List(ctx context.Context, accountOrZone string, accountOrZoneID string, rulesetPhase Phase, opts ...option.RequestOption) (res *pagination.SinglePage[PhaseVersionListResponse], err error)
Fetches the versions of an account or zone entry point ruleset.
func (*PhaseVersionService) ListAutoPaging ¶
func (r *PhaseVersionService) ListAutoPaging(ctx context.Context, accountOrZone string, accountOrZoneID string, rulesetPhase Phase, opts ...option.RequestOption) *pagination.SinglePageAutoPager[PhaseVersionListResponse]
Fetches the versions of an account or zone entry point ruleset.
type RedirectRule ¶
type RedirectRule struct { // The timestamp of when the rule was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // The version of the rule. Version string `json:"version,required"` // The unique ID of the rule. ID string `json:"id"` // The action to perform when the rule matches. Action RedirectRuleAction `json:"action"` // The parameters configuring the rule's action. ActionParameters RedirectRuleActionParameters `json:"action_parameters"` // The categories of the rule. Categories []string `json:"categories"` // An informative description of the rule. Description string `json:"description"` // Whether the rule should be executed. Enabled bool `json:"enabled"` // The expression defining which traffic will match the rule. Expression string `json:"expression"` // An object configuring the rule's logging behavior. Logging Logging `json:"logging"` // The reference of the rule (the rule ID by default). Ref string `json:"ref"` JSON redirectRuleJSON `json:"-"` }
func (*RedirectRule) UnmarshalJSON ¶
func (r *RedirectRule) UnmarshalJSON(data []byte) (err error)
type RedirectRuleAction ¶
type RedirectRuleAction string
The action to perform when the rule matches.
const (
RedirectRuleActionRedirect RedirectRuleAction = "redirect"
)
func (RedirectRuleAction) IsKnown ¶
func (r RedirectRuleAction) IsKnown() bool
type RedirectRuleActionParameters ¶
type RedirectRuleActionParameters struct { // Serve a redirect based on a bulk list lookup. FromList RedirectRuleActionParametersFromList `json:"from_list"` // Serve a redirect based on the request properties. FromValue RedirectRuleActionParametersFromValue `json:"from_value"` JSON redirectRuleActionParametersJSON `json:"-"` }
The parameters configuring the rule's action.
func (*RedirectRuleActionParameters) UnmarshalJSON ¶
func (r *RedirectRuleActionParameters) UnmarshalJSON(data []byte) (err error)
type RedirectRuleActionParametersFromList ¶
type RedirectRuleActionParametersFromList struct { // Expression that evaluates to the list lookup key. Key string `json:"key"` // The name of the list to match against. Name string `json:"name"` JSON redirectRuleActionParametersFromListJSON `json:"-"` }
Serve a redirect based on a bulk list lookup.
func (*RedirectRuleActionParametersFromList) UnmarshalJSON ¶
func (r *RedirectRuleActionParametersFromList) UnmarshalJSON(data []byte) (err error)
type RedirectRuleActionParametersFromListParam ¶
type RedirectRuleActionParametersFromListParam struct { // Expression that evaluates to the list lookup key. Key param.Field[string] `json:"key"` // The name of the list to match against. Name param.Field[string] `json:"name"` }
Serve a redirect based on a bulk list lookup.
func (RedirectRuleActionParametersFromListParam) MarshalJSON ¶
func (r RedirectRuleActionParametersFromListParam) MarshalJSON() (data []byte, err error)
type RedirectRuleActionParametersFromValue ¶
type RedirectRuleActionParametersFromValue struct { // Keep the query string of the original request. PreserveQueryString bool `json:"preserve_query_string"` // The status code to be used for the redirect. StatusCode RedirectRuleActionParametersFromValueStatusCode `json:"status_code"` // The URL to redirect the request to. TargetURL RedirectRuleActionParametersFromValueTargetURL `json:"target_url"` JSON redirectRuleActionParametersFromValueJSON `json:"-"` }
Serve a redirect based on the request properties.
func (*RedirectRuleActionParametersFromValue) UnmarshalJSON ¶
func (r *RedirectRuleActionParametersFromValue) UnmarshalJSON(data []byte) (err error)
type RedirectRuleActionParametersFromValueParam ¶
type RedirectRuleActionParametersFromValueParam struct { // Keep the query string of the original request. PreserveQueryString param.Field[bool] `json:"preserve_query_string"` // The status code to be used for the redirect. StatusCode param.Field[RedirectRuleActionParametersFromValueStatusCode] `json:"status_code"` // The URL to redirect the request to. TargetURL param.Field[RedirectRuleActionParametersFromValueTargetURLUnionParam] `json:"target_url"` }
Serve a redirect based on the request properties.
func (RedirectRuleActionParametersFromValueParam) MarshalJSON ¶
func (r RedirectRuleActionParametersFromValueParam) MarshalJSON() (data []byte, err error)
type RedirectRuleActionParametersFromValueStatusCode ¶
type RedirectRuleActionParametersFromValueStatusCode float64
The status code to be used for the redirect.
const ( RedirectRuleActionParametersFromValueStatusCode301 RedirectRuleActionParametersFromValueStatusCode = 301 RedirectRuleActionParametersFromValueStatusCode302 RedirectRuleActionParametersFromValueStatusCode = 302 RedirectRuleActionParametersFromValueStatusCode303 RedirectRuleActionParametersFromValueStatusCode = 303 RedirectRuleActionParametersFromValueStatusCode307 RedirectRuleActionParametersFromValueStatusCode = 307 RedirectRuleActionParametersFromValueStatusCode308 RedirectRuleActionParametersFromValueStatusCode = 308 )
func (RedirectRuleActionParametersFromValueStatusCode) IsKnown ¶
func (r RedirectRuleActionParametersFromValueStatusCode) IsKnown() bool
type RedirectRuleActionParametersFromValueTargetURL ¶
type RedirectRuleActionParametersFromValueTargetURL struct { // The URL to redirect the request to. Value string `json:"value"` // An expression to evaluate to get the URL to redirect the request to. Expression string `json:"expression"` JSON redirectRuleActionParametersFromValueTargetURLJSON `json:"-"` // contains filtered or unexported fields }
The URL to redirect the request to.
func (RedirectRuleActionParametersFromValueTargetURL) AsUnion ¶
func (r RedirectRuleActionParametersFromValueTargetURL) AsUnion() RedirectRuleActionParametersFromValueTargetURLUnion
AsUnion returns a RedirectRuleActionParametersFromValueTargetURLUnion interface which you can cast to the specific types for more type safety.
Possible runtime types of the union are rulesets.RedirectRuleActionParametersFromValueTargetURLStaticURLRedirect, rulesets.RedirectRuleActionParametersFromValueTargetURLDynamicURLRedirect.
func (*RedirectRuleActionParametersFromValueTargetURL) UnmarshalJSON ¶
func (r *RedirectRuleActionParametersFromValueTargetURL) UnmarshalJSON(data []byte) (err error)
type RedirectRuleActionParametersFromValueTargetURLDynamicURLRedirect ¶
type RedirectRuleActionParametersFromValueTargetURLDynamicURLRedirect struct { // An expression to evaluate to get the URL to redirect the request to. Expression string `json:"expression"` JSON redirectRuleActionParametersFromValueTargetURLDynamicURLRedirectJSON `json:"-"` }
func (*RedirectRuleActionParametersFromValueTargetURLDynamicURLRedirect) UnmarshalJSON ¶
func (r *RedirectRuleActionParametersFromValueTargetURLDynamicURLRedirect) UnmarshalJSON(data []byte) (err error)
type RedirectRuleActionParametersFromValueTargetURLDynamicURLRedirectParam ¶
type RedirectRuleActionParametersFromValueTargetURLDynamicURLRedirectParam struct { // An expression to evaluate to get the URL to redirect the request to. Expression param.Field[string] `json:"expression"` }
func (RedirectRuleActionParametersFromValueTargetURLDynamicURLRedirectParam) MarshalJSON ¶
func (r RedirectRuleActionParametersFromValueTargetURLDynamicURLRedirectParam) MarshalJSON() (data []byte, err error)
type RedirectRuleActionParametersFromValueTargetURLParam ¶
type RedirectRuleActionParametersFromValueTargetURLParam struct { // The URL to redirect the request to. Value param.Field[string] `json:"value"` // An expression to evaluate to get the URL to redirect the request to. Expression param.Field[string] `json:"expression"` }
The URL to redirect the request to.
func (RedirectRuleActionParametersFromValueTargetURLParam) MarshalJSON ¶
func (r RedirectRuleActionParametersFromValueTargetURLParam) MarshalJSON() (data []byte, err error)
type RedirectRuleActionParametersFromValueTargetURLStaticURLRedirect ¶
type RedirectRuleActionParametersFromValueTargetURLStaticURLRedirect struct { // The URL to redirect the request to. Value string `json:"value"` JSON redirectRuleActionParametersFromValueTargetURLStaticURLRedirectJSON `json:"-"` }
func (*RedirectRuleActionParametersFromValueTargetURLStaticURLRedirect) UnmarshalJSON ¶
func (r *RedirectRuleActionParametersFromValueTargetURLStaticURLRedirect) UnmarshalJSON(data []byte) (err error)
type RedirectRuleActionParametersFromValueTargetURLStaticURLRedirectParam ¶
type RedirectRuleActionParametersFromValueTargetURLStaticURLRedirectParam struct { // The URL to redirect the request to. Value param.Field[string] `json:"value"` }
func (RedirectRuleActionParametersFromValueTargetURLStaticURLRedirectParam) MarshalJSON ¶
func (r RedirectRuleActionParametersFromValueTargetURLStaticURLRedirectParam) MarshalJSON() (data []byte, err error)
type RedirectRuleActionParametersFromValueTargetURLUnion ¶
type RedirectRuleActionParametersFromValueTargetURLUnion interface {
// contains filtered or unexported methods
}
The URL to redirect the request to.
Union satisfied by rulesets.RedirectRuleActionParametersFromValueTargetURLStaticURLRedirect or rulesets.RedirectRuleActionParametersFromValueTargetURLDynamicURLRedirect.
type RedirectRuleActionParametersFromValueTargetURLUnionParam ¶
type RedirectRuleActionParametersFromValueTargetURLUnionParam interface {
// contains filtered or unexported methods
}
The URL to redirect the request to.
Satisfied by rulesets.RedirectRuleActionParametersFromValueTargetURLStaticURLRedirectParam, rulesets.RedirectRuleActionParametersFromValueTargetURLDynamicURLRedirectParam, RedirectRuleActionParametersFromValueTargetURLParam.
type RedirectRuleActionParametersParam ¶
type RedirectRuleActionParametersParam struct { // Serve a redirect based on a bulk list lookup. FromList param.Field[RedirectRuleActionParametersFromListParam] `json:"from_list"` // Serve a redirect based on the request properties. FromValue param.Field[RedirectRuleActionParametersFromValueParam] `json:"from_value"` }
The parameters configuring the rule's action.
func (RedirectRuleActionParametersParam) MarshalJSON ¶
func (r RedirectRuleActionParametersParam) MarshalJSON() (data []byte, err error)
type RedirectRuleParam ¶
type RedirectRuleParam struct { // The unique ID of the rule. ID param.Field[string] `json:"id"` // The action to perform when the rule matches. Action param.Field[RedirectRuleAction] `json:"action"` // The parameters configuring the rule's action. ActionParameters param.Field[RedirectRuleActionParametersParam] `json:"action_parameters"` // An informative description of the rule. Description param.Field[string] `json:"description"` // Whether the rule should be executed. Enabled param.Field[bool] `json:"enabled"` // The expression defining which traffic will match the rule. Expression param.Field[string] `json:"expression"` // An object configuring the rule's logging behavior. Logging param.Field[LoggingParam] `json:"logging"` // The reference of the rule (the rule ID by default). Ref param.Field[string] `json:"ref"` }
func (RedirectRuleParam) MarshalJSON ¶
func (r RedirectRuleParam) MarshalJSON() (data []byte, err error)
type RewriteRule ¶
type RewriteRule struct { // The timestamp of when the rule was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // The version of the rule. Version string `json:"version,required"` // The unique ID of the rule. ID string `json:"id"` // The action to perform when the rule matches. Action RewriteRuleAction `json:"action"` // The parameters configuring the rule's action. ActionParameters RewriteRuleActionParameters `json:"action_parameters"` // The categories of the rule. Categories []string `json:"categories"` // An informative description of the rule. Description string `json:"description"` // Whether the rule should be executed. Enabled bool `json:"enabled"` // The expression defining which traffic will match the rule. Expression string `json:"expression"` // An object configuring the rule's logging behavior. Logging Logging `json:"logging"` // The reference of the rule (the rule ID by default). Ref string `json:"ref"` JSON rewriteRuleJSON `json:"-"` }
func (*RewriteRule) UnmarshalJSON ¶
func (r *RewriteRule) UnmarshalJSON(data []byte) (err error)
type RewriteRuleAction ¶
type RewriteRuleAction string
The action to perform when the rule matches.
const (
RewriteRuleActionRewrite RewriteRuleAction = "rewrite"
)
func (RewriteRuleAction) IsKnown ¶
func (r RewriteRuleAction) IsKnown() bool
type RewriteRuleActionParameters ¶
type RewriteRuleActionParameters struct { // Map of request headers to modify. Headers map[string]RewriteRuleActionParametersHeader `json:"headers"` // URI to rewrite the request to. URI RewriteRuleActionParametersURI `json:"uri"` JSON rewriteRuleActionParametersJSON `json:"-"` }
The parameters configuring the rule's action.
func (*RewriteRuleActionParameters) UnmarshalJSON ¶
func (r *RewriteRuleActionParameters) UnmarshalJSON(data []byte) (err error)
type RewriteRuleActionParametersHeader ¶
type RewriteRuleActionParametersHeader struct { Operation RewriteRuleActionParametersHeadersOperation `json:"operation,required"` // Static value for the header. Value string `json:"value"` // Expression for the header value. Expression string `json:"expression"` JSON rewriteRuleActionParametersHeaderJSON `json:"-"` // contains filtered or unexported fields }
Remove the header from the request.
func (RewriteRuleActionParametersHeader) AsUnion ¶
func (r RewriteRuleActionParametersHeader) AsUnion() RewriteRuleActionParametersHeadersUnion
AsUnion returns a RewriteRuleActionParametersHeadersUnion interface which you can cast to the specific types for more type safety.
Possible runtime types of the union are rulesets.RewriteRuleActionParametersHeadersRemoveHeader, rulesets.RewriteRuleActionParametersHeadersStaticHeader, rulesets.RewriteRuleActionParametersHeadersDynamicHeader.
func (*RewriteRuleActionParametersHeader) UnmarshalJSON ¶
func (r *RewriteRuleActionParametersHeader) UnmarshalJSON(data []byte) (err error)
type RewriteRuleActionParametersHeaderParam ¶
type RewriteRuleActionParametersHeaderParam struct { Operation param.Field[RewriteRuleActionParametersHeadersOperation] `json:"operation,required"` // Static value for the header. Value param.Field[string] `json:"value"` // Expression for the header value. Expression param.Field[string] `json:"expression"` }
Remove the header from the request.
func (RewriteRuleActionParametersHeaderParam) MarshalJSON ¶
func (r RewriteRuleActionParametersHeaderParam) MarshalJSON() (data []byte, err error)
type RewriteRuleActionParametersHeadersDynamicHeader ¶
type RewriteRuleActionParametersHeadersDynamicHeader struct { // Expression for the header value. Expression string `json:"expression,required"` Operation RewriteRuleActionParametersHeadersDynamicHeaderOperation `json:"operation,required"` JSON rewriteRuleActionParametersHeadersDynamicHeaderJSON `json:"-"` }
Set a request header with a dynamic value.
func (*RewriteRuleActionParametersHeadersDynamicHeader) UnmarshalJSON ¶
func (r *RewriteRuleActionParametersHeadersDynamicHeader) UnmarshalJSON(data []byte) (err error)
type RewriteRuleActionParametersHeadersDynamicHeaderOperation ¶
type RewriteRuleActionParametersHeadersDynamicHeaderOperation string
const (
RewriteRuleActionParametersHeadersDynamicHeaderOperationSet RewriteRuleActionParametersHeadersDynamicHeaderOperation = "set"
)
func (RewriteRuleActionParametersHeadersDynamicHeaderOperation) IsKnown ¶
func (r RewriteRuleActionParametersHeadersDynamicHeaderOperation) IsKnown() bool
type RewriteRuleActionParametersHeadersDynamicHeaderParam ¶
type RewriteRuleActionParametersHeadersDynamicHeaderParam struct { // Expression for the header value. Expression param.Field[string] `json:"expression,required"` Operation param.Field[RewriteRuleActionParametersHeadersDynamicHeaderOperation] `json:"operation,required"` }
Set a request header with a dynamic value.
func (RewriteRuleActionParametersHeadersDynamicHeaderParam) MarshalJSON ¶
func (r RewriteRuleActionParametersHeadersDynamicHeaderParam) MarshalJSON() (data []byte, err error)
type RewriteRuleActionParametersHeadersOperation ¶
type RewriteRuleActionParametersHeadersOperation string
const ( RewriteRuleActionParametersHeadersOperationRemove RewriteRuleActionParametersHeadersOperation = "remove" RewriteRuleActionParametersHeadersOperationSet RewriteRuleActionParametersHeadersOperation = "set" )
func (RewriteRuleActionParametersHeadersOperation) IsKnown ¶
func (r RewriteRuleActionParametersHeadersOperation) IsKnown() bool
type RewriteRuleActionParametersHeadersRemoveHeader ¶
type RewriteRuleActionParametersHeadersRemoveHeader struct { Operation RewriteRuleActionParametersHeadersRemoveHeaderOperation `json:"operation,required"` JSON rewriteRuleActionParametersHeadersRemoveHeaderJSON `json:"-"` }
Remove the header from the request.
func (*RewriteRuleActionParametersHeadersRemoveHeader) UnmarshalJSON ¶
func (r *RewriteRuleActionParametersHeadersRemoveHeader) UnmarshalJSON(data []byte) (err error)
type RewriteRuleActionParametersHeadersRemoveHeaderOperation ¶
type RewriteRuleActionParametersHeadersRemoveHeaderOperation string
const (
RewriteRuleActionParametersHeadersRemoveHeaderOperationRemove RewriteRuleActionParametersHeadersRemoveHeaderOperation = "remove"
)
func (RewriteRuleActionParametersHeadersRemoveHeaderOperation) IsKnown ¶
func (r RewriteRuleActionParametersHeadersRemoveHeaderOperation) IsKnown() bool
type RewriteRuleActionParametersHeadersRemoveHeaderParam ¶
type RewriteRuleActionParametersHeadersRemoveHeaderParam struct {
Operation param.Field[RewriteRuleActionParametersHeadersRemoveHeaderOperation] `json:"operation,required"`
}
Remove the header from the request.
func (RewriteRuleActionParametersHeadersRemoveHeaderParam) MarshalJSON ¶
func (r RewriteRuleActionParametersHeadersRemoveHeaderParam) MarshalJSON() (data []byte, err error)
type RewriteRuleActionParametersHeadersStaticHeader ¶
type RewriteRuleActionParametersHeadersStaticHeader struct { Operation RewriteRuleActionParametersHeadersStaticHeaderOperation `json:"operation,required"` // Static value for the header. Value string `json:"value,required"` JSON rewriteRuleActionParametersHeadersStaticHeaderJSON `json:"-"` }
Set a request header with a static value.
func (*RewriteRuleActionParametersHeadersStaticHeader) UnmarshalJSON ¶
func (r *RewriteRuleActionParametersHeadersStaticHeader) UnmarshalJSON(data []byte) (err error)
type RewriteRuleActionParametersHeadersStaticHeaderOperation ¶
type RewriteRuleActionParametersHeadersStaticHeaderOperation string
const (
RewriteRuleActionParametersHeadersStaticHeaderOperationSet RewriteRuleActionParametersHeadersStaticHeaderOperation = "set"
)
func (RewriteRuleActionParametersHeadersStaticHeaderOperation) IsKnown ¶
func (r RewriteRuleActionParametersHeadersStaticHeaderOperation) IsKnown() bool
type RewriteRuleActionParametersHeadersStaticHeaderParam ¶
type RewriteRuleActionParametersHeadersStaticHeaderParam struct { Operation param.Field[RewriteRuleActionParametersHeadersStaticHeaderOperation] `json:"operation,required"` // Static value for the header. Value param.Field[string] `json:"value,required"` }
Set a request header with a static value.
func (RewriteRuleActionParametersHeadersStaticHeaderParam) MarshalJSON ¶
func (r RewriteRuleActionParametersHeadersStaticHeaderParam) MarshalJSON() (data []byte, err error)
type RewriteRuleActionParametersHeadersUnion ¶
type RewriteRuleActionParametersHeadersUnion interface {
// contains filtered or unexported methods
}
Remove the header from the request.
Union satisfied by rulesets.RewriteRuleActionParametersHeadersRemoveHeader, rulesets.RewriteRuleActionParametersHeadersStaticHeader or rulesets.RewriteRuleActionParametersHeadersDynamicHeader.
type RewriteRuleActionParametersHeadersUnionParam ¶
type RewriteRuleActionParametersHeadersUnionParam interface {
// contains filtered or unexported methods
}
Remove the header from the request.
Satisfied by rulesets.RewriteRuleActionParametersHeadersRemoveHeaderParam, rulesets.RewriteRuleActionParametersHeadersStaticHeaderParam, rulesets.RewriteRuleActionParametersHeadersDynamicHeaderParam, RewriteRuleActionParametersHeaderParam.
type RewriteRuleActionParametersParam ¶
type RewriteRuleActionParametersParam struct { // Map of request headers to modify. Headers param.Field[map[string]RewriteRuleActionParametersHeadersUnionParam] `json:"headers"` // URI to rewrite the request to. URI param.Field[RewriteRuleActionParametersURIParam] `json:"uri"` }
The parameters configuring the rule's action.
func (RewriteRuleActionParametersParam) MarshalJSON ¶
func (r RewriteRuleActionParametersParam) MarshalJSON() (data []byte, err error)
type RewriteRuleActionParametersURI ¶
type RewriteRuleActionParametersURI struct { // Path portion rewrite. Path RewriteURIPart `json:"path"` // Query portion rewrite. Query RewriteURIPart `json:"query"` JSON rewriteRuleActionParametersURIJSON `json:"-"` }
URI to rewrite the request to.
func (*RewriteRuleActionParametersURI) UnmarshalJSON ¶
func (r *RewriteRuleActionParametersURI) UnmarshalJSON(data []byte) (err error)
type RewriteRuleActionParametersURIParam ¶
type RewriteRuleActionParametersURIParam struct { // Path portion rewrite. Path param.Field[RewriteURIPartUnionParam] `json:"path"` // Query portion rewrite. Query param.Field[RewriteURIPartUnionParam] `json:"query"` }
URI to rewrite the request to.
func (RewriteRuleActionParametersURIParam) MarshalJSON ¶
func (r RewriteRuleActionParametersURIParam) MarshalJSON() (data []byte, err error)
type RewriteRuleParam ¶
type RewriteRuleParam struct { // The unique ID of the rule. ID param.Field[string] `json:"id"` // The action to perform when the rule matches. Action param.Field[RewriteRuleAction] `json:"action"` // The parameters configuring the rule's action. ActionParameters param.Field[RewriteRuleActionParametersParam] `json:"action_parameters"` // An informative description of the rule. Description param.Field[string] `json:"description"` // Whether the rule should be executed. Enabled param.Field[bool] `json:"enabled"` // The expression defining which traffic will match the rule. Expression param.Field[string] `json:"expression"` // An object configuring the rule's logging behavior. Logging param.Field[LoggingParam] `json:"logging"` // The reference of the rule (the rule ID by default). Ref param.Field[string] `json:"ref"` }
func (RewriteRuleParam) MarshalJSON ¶
func (r RewriteRuleParam) MarshalJSON() (data []byte, err error)
type RewriteURIPart ¶
type RewriteURIPart struct { // Predefined replacement value. Value string `json:"value"` // Expression to evaluate for the replacement value. Expression string `json:"expression"` JSON rewriteURIPartJSON `json:"-"` // contains filtered or unexported fields }
func (RewriteURIPart) AsUnion ¶
func (r RewriteURIPart) AsUnion() RewriteURIPartUnion
AsUnion returns a RewriteURIPartUnion interface which you can cast to the specific types for more type safety.
Possible runtime types of the union are rulesets.RewriteURIPartStaticValue, rulesets.RewriteURIPartDynamicValue.
func (*RewriteURIPart) UnmarshalJSON ¶
func (r *RewriteURIPart) UnmarshalJSON(data []byte) (err error)
type RewriteURIPartDynamicValue ¶
type RewriteURIPartDynamicValue struct { // Expression to evaluate for the replacement value. Expression string `json:"expression,required"` JSON rewriteURIPartDynamicValueJSON `json:"-"` }
func (*RewriteURIPartDynamicValue) UnmarshalJSON ¶
func (r *RewriteURIPartDynamicValue) UnmarshalJSON(data []byte) (err error)
type RewriteURIPartDynamicValueParam ¶
type RewriteURIPartDynamicValueParam struct { // Expression to evaluate for the replacement value. Expression param.Field[string] `json:"expression,required"` }
func (RewriteURIPartDynamicValueParam) MarshalJSON ¶
func (r RewriteURIPartDynamicValueParam) MarshalJSON() (data []byte, err error)
type RewriteURIPartParam ¶
type RewriteURIPartParam struct { // Predefined replacement value. Value param.Field[string] `json:"value"` // Expression to evaluate for the replacement value. Expression param.Field[string] `json:"expression"` }
func (RewriteURIPartParam) MarshalJSON ¶
func (r RewriteURIPartParam) MarshalJSON() (data []byte, err error)
type RewriteURIPartStaticValue ¶
type RewriteURIPartStaticValue struct { // Predefined replacement value. Value string `json:"value,required"` JSON rewriteURIPartStaticValueJSON `json:"-"` }
func (*RewriteURIPartStaticValue) UnmarshalJSON ¶
func (r *RewriteURIPartStaticValue) UnmarshalJSON(data []byte) (err error)
type RewriteURIPartStaticValueParam ¶
type RewriteURIPartStaticValueParam struct { // Predefined replacement value. Value param.Field[string] `json:"value,required"` }
func (RewriteURIPartStaticValueParam) MarshalJSON ¶
func (r RewriteURIPartStaticValueParam) MarshalJSON() (data []byte, err error)
type RewriteURIPartUnion ¶
type RewriteURIPartUnion interface {
// contains filtered or unexported methods
}
Union satisfied by rulesets.RewriteURIPartStaticValue or rulesets.RewriteURIPartDynamicValue.
type RewriteURIPartUnionParam ¶
type RewriteURIPartUnionParam interface {
// contains filtered or unexported methods
}
Satisfied by rulesets.RewriteURIPartStaticValueParam, rulesets.RewriteURIPartDynamicValueParam, RewriteURIPartParam.
type RouteRule ¶
type RouteRule struct { // The timestamp of when the rule was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // The version of the rule. Version string `json:"version,required"` // The unique ID of the rule. ID string `json:"id"` // The action to perform when the rule matches. Action RouteRuleAction `json:"action"` // The parameters configuring the rule's action. ActionParameters RouteRuleActionParameters `json:"action_parameters"` // The categories of the rule. Categories []string `json:"categories"` // An informative description of the rule. Description string `json:"description"` // Whether the rule should be executed. Enabled bool `json:"enabled"` // The expression defining which traffic will match the rule. Expression string `json:"expression"` // An object configuring the rule's logging behavior. Logging Logging `json:"logging"` // The reference of the rule (the rule ID by default). Ref string `json:"ref"` JSON routeRuleJSON `json:"-"` }
func (*RouteRule) UnmarshalJSON ¶
type RouteRuleAction ¶
type RouteRuleAction string
The action to perform when the rule matches.
const (
RouteRuleActionRoute RouteRuleAction = "route"
)
func (RouteRuleAction) IsKnown ¶
func (r RouteRuleAction) IsKnown() bool
type RouteRuleActionParameters ¶
type RouteRuleActionParameters struct { // Rewrite the HTTP Host header. HostHeader string `json:"host_header"` // Override the IP/TCP destination. Origin RouteRuleActionParametersOrigin `json:"origin"` // Override the Server Name Indication (SNI). SNI RouteRuleActionParametersSNI `json:"sni"` JSON routeRuleActionParametersJSON `json:"-"` }
The parameters configuring the rule's action.
func (*RouteRuleActionParameters) UnmarshalJSON ¶
func (r *RouteRuleActionParameters) UnmarshalJSON(data []byte) (err error)
type RouteRuleActionParametersOrigin ¶
type RouteRuleActionParametersOrigin struct { // Override the resolved hostname. Host string `json:"host"` // Override the destination port. Port float64 `json:"port"` JSON routeRuleActionParametersOriginJSON `json:"-"` }
Override the IP/TCP destination.
func (*RouteRuleActionParametersOrigin) UnmarshalJSON ¶
func (r *RouteRuleActionParametersOrigin) UnmarshalJSON(data []byte) (err error)
type RouteRuleActionParametersOriginParam ¶
type RouteRuleActionParametersOriginParam struct { // Override the resolved hostname. Host param.Field[string] `json:"host"` // Override the destination port. Port param.Field[float64] `json:"port"` }
Override the IP/TCP destination.
func (RouteRuleActionParametersOriginParam) MarshalJSON ¶
func (r RouteRuleActionParametersOriginParam) MarshalJSON() (data []byte, err error)
type RouteRuleActionParametersParam ¶
type RouteRuleActionParametersParam struct { // Rewrite the HTTP Host header. HostHeader param.Field[string] `json:"host_header"` // Override the IP/TCP destination. Origin param.Field[RouteRuleActionParametersOriginParam] `json:"origin"` // Override the Server Name Indication (SNI). SNI param.Field[RouteRuleActionParametersSNIParam] `json:"sni"` }
The parameters configuring the rule's action.
func (RouteRuleActionParametersParam) MarshalJSON ¶
func (r RouteRuleActionParametersParam) MarshalJSON() (data []byte, err error)
type RouteRuleActionParametersSNI ¶
type RouteRuleActionParametersSNI struct { // The SNI override. Value string `json:"value,required"` JSON routeRuleActionParametersSNIJSON `json:"-"` }
Override the Server Name Indication (SNI).
func (*RouteRuleActionParametersSNI) UnmarshalJSON ¶
func (r *RouteRuleActionParametersSNI) UnmarshalJSON(data []byte) (err error)
type RouteRuleActionParametersSNIParam ¶
type RouteRuleActionParametersSNIParam struct { // The SNI override. Value param.Field[string] `json:"value,required"` }
Override the Server Name Indication (SNI).
func (RouteRuleActionParametersSNIParam) MarshalJSON ¶
func (r RouteRuleActionParametersSNIParam) MarshalJSON() (data []byte, err error)
type RouteRuleParam ¶
type RouteRuleParam struct { // The unique ID of the rule. ID param.Field[string] `json:"id"` // The action to perform when the rule matches. Action param.Field[RouteRuleAction] `json:"action"` // The parameters configuring the rule's action. ActionParameters param.Field[RouteRuleActionParametersParam] `json:"action_parameters"` // An informative description of the rule. Description param.Field[string] `json:"description"` // Whether the rule should be executed. Enabled param.Field[bool] `json:"enabled"` // The expression defining which traffic will match the rule. Expression param.Field[string] `json:"expression"` // An object configuring the rule's logging behavior. Logging param.Field[LoggingParam] `json:"logging"` // The reference of the rule (the rule ID by default). Ref param.Field[string] `json:"ref"` }
func (RouteRuleParam) MarshalJSON ¶
func (r RouteRuleParam) MarshalJSON() (data []byte, err error)
type RuleDeleteResponse ¶
type RuleDeleteResponse struct { // The unique ID of the ruleset. ID string `json:"id,required"` // The kind of the ruleset. Kind Kind `json:"kind,required"` // The timestamp of when the ruleset was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // The human-readable name of the ruleset. Name string `json:"name,required"` // The phase of the ruleset. Phase Phase `json:"phase,required"` // The list of rules in the ruleset. Rules []RuleDeleteResponseRule `json:"rules,required"` // The version of the ruleset. Version string `json:"version,required"` // An informative description of the ruleset. Description string `json:"description"` JSON ruleDeleteResponseJSON `json:"-"` }
A ruleset object.
func (*RuleDeleteResponse) UnmarshalJSON ¶
func (r *RuleDeleteResponse) UnmarshalJSON(data []byte) (err error)
type RuleDeleteResponseEnvelope ¶
type RuleDeleteResponseEnvelope struct { // A list of error messages. Errors []RuleDeleteResponseEnvelopeErrors `json:"errors,required"` // A list of warning messages. Messages []RuleDeleteResponseEnvelopeMessages `json:"messages,required"` // A ruleset object. Result RuleDeleteResponse `json:"result,required"` // Whether the API call was successful. Success RuleDeleteResponseEnvelopeSuccess `json:"success,required"` JSON ruleDeleteResponseEnvelopeJSON `json:"-"` }
A response object.
func (*RuleDeleteResponseEnvelope) UnmarshalJSON ¶
func (r *RuleDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type RuleDeleteResponseEnvelopeErrors ¶
type RuleDeleteResponseEnvelopeErrors struct { // A text description of this message. Message string `json:"message,required"` // A unique code for this message. Code int64 `json:"code"` // The source of this message. Source RuleDeleteResponseEnvelopeErrorsSource `json:"source"` JSON ruleDeleteResponseEnvelopeErrorsJSON `json:"-"` }
A message.
func (*RuleDeleteResponseEnvelopeErrors) UnmarshalJSON ¶
func (r *RuleDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)
type RuleDeleteResponseEnvelopeErrorsSource ¶
type RuleDeleteResponseEnvelopeErrorsSource struct { // A JSON pointer to the field that is the source of the message. Pointer string `json:"pointer,required"` JSON ruleDeleteResponseEnvelopeErrorsSourceJSON `json:"-"` }
The source of this message.
func (*RuleDeleteResponseEnvelopeErrorsSource) UnmarshalJSON ¶
func (r *RuleDeleteResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error)
type RuleDeleteResponseEnvelopeMessages ¶
type RuleDeleteResponseEnvelopeMessages struct { // A text description of this message. Message string `json:"message,required"` // A unique code for this message. Code int64 `json:"code"` // The source of this message. Source RuleDeleteResponseEnvelopeMessagesSource `json:"source"` JSON ruleDeleteResponseEnvelopeMessagesJSON `json:"-"` }
A message.
func (*RuleDeleteResponseEnvelopeMessages) UnmarshalJSON ¶
func (r *RuleDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)
type RuleDeleteResponseEnvelopeMessagesSource ¶
type RuleDeleteResponseEnvelopeMessagesSource struct { // A JSON pointer to the field that is the source of the message. Pointer string `json:"pointer,required"` JSON ruleDeleteResponseEnvelopeMessagesSourceJSON `json:"-"` }
The source of this message.
func (*RuleDeleteResponseEnvelopeMessagesSource) UnmarshalJSON ¶
func (r *RuleDeleteResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error)
type RuleDeleteResponseEnvelopeSuccess ¶
type RuleDeleteResponseEnvelopeSuccess bool
Whether the API call was successful.
const (
RuleDeleteResponseEnvelopeSuccessTrue RuleDeleteResponseEnvelopeSuccess = true
)
func (RuleDeleteResponseEnvelopeSuccess) IsKnown ¶
func (r RuleDeleteResponseEnvelopeSuccess) IsKnown() bool
type RuleDeleteResponseRule ¶
type RuleDeleteResponseRule struct { // The action to perform when the rule matches. Action RuleDeleteResponseRulesAction `json:"action"` // This field can have the runtime type of [BlockRuleActionParameters], // [interface{}], [CompressResponseRuleActionParameters], // [ExecuteRuleActionParameters], [RedirectRuleActionParameters], // [RewriteRuleActionParameters], [RouteRuleActionParameters], // [ScoreRuleActionParameters], [ServeErrorRuleActionParameters], // [SetConfigRuleActionParameters], [SkipRuleActionParameters], // [SetCacheSettingsRuleActionParameters], [LogCustomFieldRuleActionParameters]. ActionParameters interface{} `json:"action_parameters,required"` // This field can have the runtime type of [[]string]. Categories interface{} `json:"categories,required"` // An informative description of the rule. Description string `json:"description"` // Whether the rule should be executed. Enabled bool `json:"enabled"` // The expression defining which traffic will match the rule. Expression string `json:"expression"` // The unique ID of the rule. ID string `json:"id"` // The timestamp of when the rule was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // An object configuring the rule's logging behavior. Logging Logging `json:"logging"` // The reference of the rule (the rule ID by default). Ref string `json:"ref"` // The version of the rule. Version string `json:"version,required"` JSON ruleDeleteResponseRuleJSON `json:"-"` // contains filtered or unexported fields }
func (RuleDeleteResponseRule) AsUnion ¶
func (r RuleDeleteResponseRule) AsUnion() RuleDeleteResponseRulesUnion
AsUnion returns a RuleDeleteResponseRulesUnion interface which you can cast to the specific types for more type safety.
Possible runtime types of the union are rulesets.BlockRule, rulesets.ChallengeRule, rulesets.CompressResponseRule, rulesets.ExecuteRule, rulesets.JSChallengeRule, rulesets.LogRule, rulesets.ManagedChallengeRule, rulesets.RedirectRule, rulesets.RewriteRule, rulesets.RouteRule, rulesets.ScoreRule, rulesets.ServeErrorRule, rulesets.SetConfigRule, rulesets.SkipRule, rulesets.SetCacheSettingsRule, rulesets.LogCustomFieldRule, rulesets.DDoSDynamicRule, rulesets.ForceConnectionCloseRule.
func (*RuleDeleteResponseRule) UnmarshalJSON ¶
func (r *RuleDeleteResponseRule) UnmarshalJSON(data []byte) (err error)
type RuleDeleteResponseRulesAction ¶
type RuleDeleteResponseRulesAction string
The action to perform when the rule matches.
const ( RuleDeleteResponseRulesActionBlock RuleDeleteResponseRulesAction = "block" RuleDeleteResponseRulesActionChallenge RuleDeleteResponseRulesAction = "challenge" RuleDeleteResponseRulesActionCompressResponse RuleDeleteResponseRulesAction = "compress_response" RuleDeleteResponseRulesActionExecute RuleDeleteResponseRulesAction = "execute" RuleDeleteResponseRulesActionJSChallenge RuleDeleteResponseRulesAction = "js_challenge" RuleDeleteResponseRulesActionLog RuleDeleteResponseRulesAction = "log" RuleDeleteResponseRulesActionManagedChallenge RuleDeleteResponseRulesAction = "managed_challenge" RuleDeleteResponseRulesActionRedirect RuleDeleteResponseRulesAction = "redirect" RuleDeleteResponseRulesActionRewrite RuleDeleteResponseRulesAction = "rewrite" RuleDeleteResponseRulesActionRoute RuleDeleteResponseRulesAction = "route" RuleDeleteResponseRulesActionScore RuleDeleteResponseRulesAction = "score" RuleDeleteResponseRulesActionServeError RuleDeleteResponseRulesAction = "serve_error" RuleDeleteResponseRulesActionSetConfig RuleDeleteResponseRulesAction = "set_config" RuleDeleteResponseRulesActionSkip RuleDeleteResponseRulesAction = "skip" RuleDeleteResponseRulesActionSetCacheSettings RuleDeleteResponseRulesAction = "set_cache_settings" RuleDeleteResponseRulesActionLogCustomField RuleDeleteResponseRulesAction = "log_custom_field" RuleDeleteResponseRulesActionDDoSDynamic RuleDeleteResponseRulesAction = "ddos_dynamic" RuleDeleteResponseRulesActionForceConnectionClose RuleDeleteResponseRulesAction = "force_connection_close" )
func (RuleDeleteResponseRulesAction) IsKnown ¶
func (r RuleDeleteResponseRulesAction) IsKnown() bool
type RuleDeleteResponseRulesUnion ¶
type RuleDeleteResponseRulesUnion interface {
// contains filtered or unexported methods
}
Union satisfied by rulesets.BlockRule, rulesets.ChallengeRule, rulesets.CompressResponseRule, rulesets.ExecuteRule, rulesets.JSChallengeRule, rulesets.LogRule, rulesets.ManagedChallengeRule, rulesets.RedirectRule, rulesets.RewriteRule, rulesets.RouteRule, rulesets.ScoreRule, rulesets.ServeErrorRule, rulesets.SetConfigRule, rulesets.SkipRule, rulesets.SetCacheSettingsRule, rulesets.LogCustomFieldRule, rulesets.DDoSDynamicRule or rulesets.ForceConnectionCloseRule.
type RuleEditParams ¶
type RuleEditParams struct { // An object configuring where the rule will be placed. Position param.Field[RuleEditParamsPositionUnion] `json:"position"` }
func (RuleEditParams) MarshalJSON ¶
func (r RuleEditParams) MarshalJSON() (data []byte, err error)
type RuleEditParamsPosition ¶
type RuleEditParamsPosition struct { // The ID of another rule to place the rule before. An empty value causes the rule // to be placed at the top. Before param.Field[string] `json:"before"` // The ID of another rule to place the rule after. An empty value causes the rule // to be placed at the bottom. After param.Field[string] `json:"after"` // An index at which to place the rule, where index 1 is the first rule. Index param.Field[float64] `json:"index"` }
An object configuring where the rule will be placed.
func (RuleEditParamsPosition) MarshalJSON ¶
func (r RuleEditParamsPosition) MarshalJSON() (data []byte, err error)
type RuleEditParamsPositionAfterPosition ¶
type RuleEditParamsPositionAfterPosition struct { // The ID of another rule to place the rule after. An empty value causes the rule // to be placed at the bottom. After param.Field[string] `json:"after"` }
An object configuring where the rule will be placed.
func (RuleEditParamsPositionAfterPosition) MarshalJSON ¶
func (r RuleEditParamsPositionAfterPosition) MarshalJSON() (data []byte, err error)
type RuleEditParamsPositionBeforePosition ¶
type RuleEditParamsPositionBeforePosition struct { // The ID of another rule to place the rule before. An empty value causes the rule // to be placed at the top. Before param.Field[string] `json:"before"` }
An object configuring where the rule will be placed.
func (RuleEditParamsPositionBeforePosition) MarshalJSON ¶
func (r RuleEditParamsPositionBeforePosition) MarshalJSON() (data []byte, err error)
type RuleEditParamsPositionIndexPosition ¶
type RuleEditParamsPositionIndexPosition struct { // An index at which to place the rule, where index 1 is the first rule. Index param.Field[float64] `json:"index"` }
An object configuring where the rule will be placed.
func (RuleEditParamsPositionIndexPosition) MarshalJSON ¶
func (r RuleEditParamsPositionIndexPosition) MarshalJSON() (data []byte, err error)
type RuleEditParamsPositionUnion ¶
type RuleEditParamsPositionUnion interface {
// contains filtered or unexported methods
}
An object configuring where the rule will be placed.
Satisfied by rulesets.RuleEditParamsPositionBeforePosition, rulesets.RuleEditParamsPositionAfterPosition, rulesets.RuleEditParamsPositionIndexPosition, RuleEditParamsPosition.
type RuleEditResponse ¶
type RuleEditResponse struct { // The unique ID of the ruleset. ID string `json:"id,required"` // The kind of the ruleset. Kind Kind `json:"kind,required"` // The timestamp of when the ruleset was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // The human-readable name of the ruleset. Name string `json:"name,required"` // The phase of the ruleset. Phase Phase `json:"phase,required"` // The list of rules in the ruleset. Rules []RuleEditResponseRule `json:"rules,required"` // The version of the ruleset. Version string `json:"version,required"` // An informative description of the ruleset. Description string `json:"description"` JSON ruleEditResponseJSON `json:"-"` }
A ruleset object.
func (*RuleEditResponse) UnmarshalJSON ¶
func (r *RuleEditResponse) UnmarshalJSON(data []byte) (err error)
type RuleEditResponseEnvelope ¶
type RuleEditResponseEnvelope struct { // A list of error messages. Errors []RuleEditResponseEnvelopeErrors `json:"errors,required"` // A list of warning messages. Messages []RuleEditResponseEnvelopeMessages `json:"messages,required"` // A ruleset object. Result RuleEditResponse `json:"result,required"` // Whether the API call was successful. Success RuleEditResponseEnvelopeSuccess `json:"success,required"` JSON ruleEditResponseEnvelopeJSON `json:"-"` }
A response object.
func (*RuleEditResponseEnvelope) UnmarshalJSON ¶
func (r *RuleEditResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type RuleEditResponseEnvelopeErrors ¶
type RuleEditResponseEnvelopeErrors struct { // A text description of this message. Message string `json:"message,required"` // A unique code for this message. Code int64 `json:"code"` // The source of this message. Source RuleEditResponseEnvelopeErrorsSource `json:"source"` JSON ruleEditResponseEnvelopeErrorsJSON `json:"-"` }
A message.
func (*RuleEditResponseEnvelopeErrors) UnmarshalJSON ¶
func (r *RuleEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)
type RuleEditResponseEnvelopeErrorsSource ¶
type RuleEditResponseEnvelopeErrorsSource struct { // A JSON pointer to the field that is the source of the message. Pointer string `json:"pointer,required"` JSON ruleEditResponseEnvelopeErrorsSourceJSON `json:"-"` }
The source of this message.
func (*RuleEditResponseEnvelopeErrorsSource) UnmarshalJSON ¶
func (r *RuleEditResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error)
type RuleEditResponseEnvelopeMessages ¶
type RuleEditResponseEnvelopeMessages struct { // A text description of this message. Message string `json:"message,required"` // A unique code for this message. Code int64 `json:"code"` // The source of this message. Source RuleEditResponseEnvelopeMessagesSource `json:"source"` JSON ruleEditResponseEnvelopeMessagesJSON `json:"-"` }
A message.
func (*RuleEditResponseEnvelopeMessages) UnmarshalJSON ¶
func (r *RuleEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)
type RuleEditResponseEnvelopeMessagesSource ¶
type RuleEditResponseEnvelopeMessagesSource struct { // A JSON pointer to the field that is the source of the message. Pointer string `json:"pointer,required"` JSON ruleEditResponseEnvelopeMessagesSourceJSON `json:"-"` }
The source of this message.
func (*RuleEditResponseEnvelopeMessagesSource) UnmarshalJSON ¶
func (r *RuleEditResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error)
type RuleEditResponseEnvelopeSuccess ¶
type RuleEditResponseEnvelopeSuccess bool
Whether the API call was successful.
const (
RuleEditResponseEnvelopeSuccessTrue RuleEditResponseEnvelopeSuccess = true
)
func (RuleEditResponseEnvelopeSuccess) IsKnown ¶
func (r RuleEditResponseEnvelopeSuccess) IsKnown() bool
type RuleEditResponseRule ¶
type RuleEditResponseRule struct { // The action to perform when the rule matches. Action RuleEditResponseRulesAction `json:"action"` // This field can have the runtime type of [BlockRuleActionParameters], // [interface{}], [CompressResponseRuleActionParameters], // [ExecuteRuleActionParameters], [RedirectRuleActionParameters], // [RewriteRuleActionParameters], [RouteRuleActionParameters], // [ScoreRuleActionParameters], [ServeErrorRuleActionParameters], // [SetConfigRuleActionParameters], [SkipRuleActionParameters], // [SetCacheSettingsRuleActionParameters], [LogCustomFieldRuleActionParameters]. ActionParameters interface{} `json:"action_parameters,required"` // This field can have the runtime type of [[]string]. Categories interface{} `json:"categories,required"` // An informative description of the rule. Description string `json:"description"` // Whether the rule should be executed. Enabled bool `json:"enabled"` // The expression defining which traffic will match the rule. Expression string `json:"expression"` // The unique ID of the rule. ID string `json:"id"` // The timestamp of when the rule was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // An object configuring the rule's logging behavior. Logging Logging `json:"logging"` // The reference of the rule (the rule ID by default). Ref string `json:"ref"` // The version of the rule. Version string `json:"version,required"` JSON ruleEditResponseRuleJSON `json:"-"` // contains filtered or unexported fields }
func (RuleEditResponseRule) AsUnion ¶
func (r RuleEditResponseRule) AsUnion() RuleEditResponseRulesUnion
AsUnion returns a RuleEditResponseRulesUnion interface which you can cast to the specific types for more type safety.
Possible runtime types of the union are rulesets.BlockRule, rulesets.ChallengeRule, rulesets.CompressResponseRule, rulesets.ExecuteRule, rulesets.JSChallengeRule, rulesets.LogRule, rulesets.ManagedChallengeRule, rulesets.RedirectRule, rulesets.RewriteRule, rulesets.RouteRule, rulesets.ScoreRule, rulesets.ServeErrorRule, rulesets.SetConfigRule, rulesets.SkipRule, rulesets.SetCacheSettingsRule, rulesets.LogCustomFieldRule, rulesets.DDoSDynamicRule, rulesets.ForceConnectionCloseRule.
func (*RuleEditResponseRule) UnmarshalJSON ¶
func (r *RuleEditResponseRule) UnmarshalJSON(data []byte) (err error)
type RuleEditResponseRulesAction ¶
type RuleEditResponseRulesAction string
The action to perform when the rule matches.
const ( RuleEditResponseRulesActionBlock RuleEditResponseRulesAction = "block" RuleEditResponseRulesActionChallenge RuleEditResponseRulesAction = "challenge" RuleEditResponseRulesActionCompressResponse RuleEditResponseRulesAction = "compress_response" RuleEditResponseRulesActionExecute RuleEditResponseRulesAction = "execute" RuleEditResponseRulesActionJSChallenge RuleEditResponseRulesAction = "js_challenge" RuleEditResponseRulesActionLog RuleEditResponseRulesAction = "log" RuleEditResponseRulesActionManagedChallenge RuleEditResponseRulesAction = "managed_challenge" RuleEditResponseRulesActionRedirect RuleEditResponseRulesAction = "redirect" RuleEditResponseRulesActionRewrite RuleEditResponseRulesAction = "rewrite" RuleEditResponseRulesActionRoute RuleEditResponseRulesAction = "route" RuleEditResponseRulesActionScore RuleEditResponseRulesAction = "score" RuleEditResponseRulesActionServeError RuleEditResponseRulesAction = "serve_error" RuleEditResponseRulesActionSetConfig RuleEditResponseRulesAction = "set_config" RuleEditResponseRulesActionSkip RuleEditResponseRulesAction = "skip" RuleEditResponseRulesActionSetCacheSettings RuleEditResponseRulesAction = "set_cache_settings" RuleEditResponseRulesActionLogCustomField RuleEditResponseRulesAction = "log_custom_field" RuleEditResponseRulesActionDDoSDynamic RuleEditResponseRulesAction = "ddos_dynamic" RuleEditResponseRulesActionForceConnectionClose RuleEditResponseRulesAction = "force_connection_close" )
func (RuleEditResponseRulesAction) IsKnown ¶
func (r RuleEditResponseRulesAction) IsKnown() bool
type RuleEditResponseRulesUnion ¶
type RuleEditResponseRulesUnion interface {
// contains filtered or unexported methods
}
Union satisfied by rulesets.BlockRule, rulesets.ChallengeRule, rulesets.CompressResponseRule, rulesets.ExecuteRule, rulesets.JSChallengeRule, rulesets.LogRule, rulesets.ManagedChallengeRule, rulesets.RedirectRule, rulesets.RewriteRule, rulesets.RouteRule, rulesets.ScoreRule, rulesets.ServeErrorRule, rulesets.SetConfigRule, rulesets.SkipRule, rulesets.SetCacheSettingsRule, rulesets.LogCustomFieldRule, rulesets.DDoSDynamicRule or rulesets.ForceConnectionCloseRule.
type RuleNewParams ¶
type RuleNewParams struct { // An object configuring where the rule will be placed. Position param.Field[RuleNewParamsPositionUnion] `json:"position"` }
func (RuleNewParams) MarshalJSON ¶
func (r RuleNewParams) MarshalJSON() (data []byte, err error)
type RuleNewParamsPosition ¶
type RuleNewParamsPosition struct { // The ID of another rule to place the rule before. An empty value causes the rule // to be placed at the top. Before param.Field[string] `json:"before"` // The ID of another rule to place the rule after. An empty value causes the rule // to be placed at the bottom. After param.Field[string] `json:"after"` // An index at which to place the rule, where index 1 is the first rule. Index param.Field[float64] `json:"index"` }
An object configuring where the rule will be placed.
func (RuleNewParamsPosition) MarshalJSON ¶
func (r RuleNewParamsPosition) MarshalJSON() (data []byte, err error)
type RuleNewParamsPositionAfterPosition ¶
type RuleNewParamsPositionAfterPosition struct { // The ID of another rule to place the rule after. An empty value causes the rule // to be placed at the bottom. After param.Field[string] `json:"after"` }
An object configuring where the rule will be placed.
func (RuleNewParamsPositionAfterPosition) MarshalJSON ¶
func (r RuleNewParamsPositionAfterPosition) MarshalJSON() (data []byte, err error)
type RuleNewParamsPositionBeforePosition ¶
type RuleNewParamsPositionBeforePosition struct { // The ID of another rule to place the rule before. An empty value causes the rule // to be placed at the top. Before param.Field[string] `json:"before"` }
An object configuring where the rule will be placed.
func (RuleNewParamsPositionBeforePosition) MarshalJSON ¶
func (r RuleNewParamsPositionBeforePosition) MarshalJSON() (data []byte, err error)
type RuleNewParamsPositionIndexPosition ¶
type RuleNewParamsPositionIndexPosition struct { // An index at which to place the rule, where index 1 is the first rule. Index param.Field[float64] `json:"index"` }
An object configuring where the rule will be placed.
func (RuleNewParamsPositionIndexPosition) MarshalJSON ¶
func (r RuleNewParamsPositionIndexPosition) MarshalJSON() (data []byte, err error)
type RuleNewParamsPositionUnion ¶
type RuleNewParamsPositionUnion interface {
// contains filtered or unexported methods
}
An object configuring where the rule will be placed.
Satisfied by rulesets.RuleNewParamsPositionBeforePosition, rulesets.RuleNewParamsPositionAfterPosition, rulesets.RuleNewParamsPositionIndexPosition, RuleNewParamsPosition.
type RuleNewResponse ¶
type RuleNewResponse struct { // The unique ID of the ruleset. ID string `json:"id,required"` // The kind of the ruleset. Kind Kind `json:"kind,required"` // The timestamp of when the ruleset was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // The human-readable name of the ruleset. Name string `json:"name,required"` // The phase of the ruleset. Phase Phase `json:"phase,required"` // The list of rules in the ruleset. Rules []RuleNewResponseRule `json:"rules,required"` // The version of the ruleset. Version string `json:"version,required"` // An informative description of the ruleset. Description string `json:"description"` JSON ruleNewResponseJSON `json:"-"` }
A ruleset object.
func (*RuleNewResponse) UnmarshalJSON ¶
func (r *RuleNewResponse) UnmarshalJSON(data []byte) (err error)
type RuleNewResponseEnvelope ¶
type RuleNewResponseEnvelope struct { // A list of error messages. Errors []RuleNewResponseEnvelopeErrors `json:"errors,required"` // A list of warning messages. Messages []RuleNewResponseEnvelopeMessages `json:"messages,required"` // A ruleset object. Result RuleNewResponse `json:"result,required"` // Whether the API call was successful. Success RuleNewResponseEnvelopeSuccess `json:"success,required"` JSON ruleNewResponseEnvelopeJSON `json:"-"` }
A response object.
func (*RuleNewResponseEnvelope) UnmarshalJSON ¶
func (r *RuleNewResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type RuleNewResponseEnvelopeErrors ¶
type RuleNewResponseEnvelopeErrors struct { // A text description of this message. Message string `json:"message,required"` // A unique code for this message. Code int64 `json:"code"` // The source of this message. Source RuleNewResponseEnvelopeErrorsSource `json:"source"` JSON ruleNewResponseEnvelopeErrorsJSON `json:"-"` }
A message.
func (*RuleNewResponseEnvelopeErrors) UnmarshalJSON ¶
func (r *RuleNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)
type RuleNewResponseEnvelopeErrorsSource ¶
type RuleNewResponseEnvelopeErrorsSource struct { // A JSON pointer to the field that is the source of the message. Pointer string `json:"pointer,required"` JSON ruleNewResponseEnvelopeErrorsSourceJSON `json:"-"` }
The source of this message.
func (*RuleNewResponseEnvelopeErrorsSource) UnmarshalJSON ¶
func (r *RuleNewResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error)
type RuleNewResponseEnvelopeMessages ¶
type RuleNewResponseEnvelopeMessages struct { // A text description of this message. Message string `json:"message,required"` // A unique code for this message. Code int64 `json:"code"` // The source of this message. Source RuleNewResponseEnvelopeMessagesSource `json:"source"` JSON ruleNewResponseEnvelopeMessagesJSON `json:"-"` }
A message.
func (*RuleNewResponseEnvelopeMessages) UnmarshalJSON ¶
func (r *RuleNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)
type RuleNewResponseEnvelopeMessagesSource ¶
type RuleNewResponseEnvelopeMessagesSource struct { // A JSON pointer to the field that is the source of the message. Pointer string `json:"pointer,required"` JSON ruleNewResponseEnvelopeMessagesSourceJSON `json:"-"` }
The source of this message.
func (*RuleNewResponseEnvelopeMessagesSource) UnmarshalJSON ¶
func (r *RuleNewResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error)
type RuleNewResponseEnvelopeSuccess ¶
type RuleNewResponseEnvelopeSuccess bool
Whether the API call was successful.
const (
RuleNewResponseEnvelopeSuccessTrue RuleNewResponseEnvelopeSuccess = true
)
func (RuleNewResponseEnvelopeSuccess) IsKnown ¶
func (r RuleNewResponseEnvelopeSuccess) IsKnown() bool
type RuleNewResponseRule ¶
type RuleNewResponseRule struct { // The action to perform when the rule matches. Action RuleNewResponseRulesAction `json:"action"` // This field can have the runtime type of [BlockRuleActionParameters], // [interface{}], [CompressResponseRuleActionParameters], // [ExecuteRuleActionParameters], [RedirectRuleActionParameters], // [RewriteRuleActionParameters], [RouteRuleActionParameters], // [ScoreRuleActionParameters], [ServeErrorRuleActionParameters], // [SetConfigRuleActionParameters], [SkipRuleActionParameters], // [SetCacheSettingsRuleActionParameters], [LogCustomFieldRuleActionParameters]. ActionParameters interface{} `json:"action_parameters,required"` // This field can have the runtime type of [[]string]. Categories interface{} `json:"categories,required"` // An informative description of the rule. Description string `json:"description"` // Whether the rule should be executed. Enabled bool `json:"enabled"` // The expression defining which traffic will match the rule. Expression string `json:"expression"` // The unique ID of the rule. ID string `json:"id"` // The timestamp of when the rule was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // An object configuring the rule's logging behavior. Logging Logging `json:"logging"` // The reference of the rule (the rule ID by default). Ref string `json:"ref"` // The version of the rule. Version string `json:"version,required"` JSON ruleNewResponseRuleJSON `json:"-"` // contains filtered or unexported fields }
func (RuleNewResponseRule) AsUnion ¶
func (r RuleNewResponseRule) AsUnion() RuleNewResponseRulesUnion
AsUnion returns a RuleNewResponseRulesUnion interface which you can cast to the specific types for more type safety.
Possible runtime types of the union are rulesets.BlockRule, rulesets.ChallengeRule, rulesets.CompressResponseRule, rulesets.ExecuteRule, rulesets.JSChallengeRule, rulesets.LogRule, rulesets.ManagedChallengeRule, rulesets.RedirectRule, rulesets.RewriteRule, rulesets.RouteRule, rulesets.ScoreRule, rulesets.ServeErrorRule, rulesets.SetConfigRule, rulesets.SkipRule, rulesets.SetCacheSettingsRule, rulesets.LogCustomFieldRule, rulesets.DDoSDynamicRule, rulesets.ForceConnectionCloseRule.
func (*RuleNewResponseRule) UnmarshalJSON ¶
func (r *RuleNewResponseRule) UnmarshalJSON(data []byte) (err error)
type RuleNewResponseRulesAction ¶
type RuleNewResponseRulesAction string
The action to perform when the rule matches.
const ( RuleNewResponseRulesActionBlock RuleNewResponseRulesAction = "block" RuleNewResponseRulesActionChallenge RuleNewResponseRulesAction = "challenge" RuleNewResponseRulesActionCompressResponse RuleNewResponseRulesAction = "compress_response" RuleNewResponseRulesActionExecute RuleNewResponseRulesAction = "execute" RuleNewResponseRulesActionJSChallenge RuleNewResponseRulesAction = "js_challenge" RuleNewResponseRulesActionLog RuleNewResponseRulesAction = "log" RuleNewResponseRulesActionManagedChallenge RuleNewResponseRulesAction = "managed_challenge" RuleNewResponseRulesActionRedirect RuleNewResponseRulesAction = "redirect" RuleNewResponseRulesActionRewrite RuleNewResponseRulesAction = "rewrite" RuleNewResponseRulesActionRoute RuleNewResponseRulesAction = "route" RuleNewResponseRulesActionScore RuleNewResponseRulesAction = "score" RuleNewResponseRulesActionServeError RuleNewResponseRulesAction = "serve_error" RuleNewResponseRulesActionSetConfig RuleNewResponseRulesAction = "set_config" RuleNewResponseRulesActionSkip RuleNewResponseRulesAction = "skip" RuleNewResponseRulesActionSetCacheSettings RuleNewResponseRulesAction = "set_cache_settings" RuleNewResponseRulesActionLogCustomField RuleNewResponseRulesAction = "log_custom_field" RuleNewResponseRulesActionDDoSDynamic RuleNewResponseRulesAction = "ddos_dynamic" RuleNewResponseRulesActionForceConnectionClose RuleNewResponseRulesAction = "force_connection_close" )
func (RuleNewResponseRulesAction) IsKnown ¶
func (r RuleNewResponseRulesAction) IsKnown() bool
type RuleNewResponseRulesUnion ¶
type RuleNewResponseRulesUnion interface {
// contains filtered or unexported methods
}
Union satisfied by rulesets.BlockRule, rulesets.ChallengeRule, rulesets.CompressResponseRule, rulesets.ExecuteRule, rulesets.JSChallengeRule, rulesets.LogRule, rulesets.ManagedChallengeRule, rulesets.RedirectRule, rulesets.RewriteRule, rulesets.RouteRule, rulesets.ScoreRule, rulesets.ServeErrorRule, rulesets.SetConfigRule, rulesets.SkipRule, rulesets.SetCacheSettingsRule, rulesets.LogCustomFieldRule, rulesets.DDoSDynamicRule or rulesets.ForceConnectionCloseRule.
type RuleService ¶
type RuleService struct {
Options []option.RequestOption
}
RuleService contains methods and other services that help with interacting with the testcloudflare 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, accountOrZone string, accountOrZoneID string, rulesetID string, ruleID string, opts ...option.RequestOption) (res *RuleDeleteResponse, err error)
Deletes an existing rule from an account or zone ruleset.
func (*RuleService) Edit ¶
func (r *RuleService) Edit(ctx context.Context, accountOrZone string, accountOrZoneID string, rulesetID string, ruleID string, body RuleEditParams, opts ...option.RequestOption) (res *RuleEditResponse, err error)
Updates an existing rule in an account or zone ruleset.
func (*RuleService) New ¶
func (r *RuleService) New(ctx context.Context, accountOrZone string, accountOrZoneID string, rulesetID string, body RuleNewParams, opts ...option.RequestOption) (res *RuleNewResponse, err error)
Adds a new rule to an account or zone ruleset. The rule will be added to the end of the existing list of rules in the ruleset by default.
type RulesetGetResponse ¶
type RulesetGetResponse struct { // The unique ID of the ruleset. ID string `json:"id,required"` // The kind of the ruleset. Kind Kind `json:"kind,required"` // The timestamp of when the ruleset was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // The human-readable name of the ruleset. Name string `json:"name,required"` // The phase of the ruleset. Phase Phase `json:"phase,required"` // The list of rules in the ruleset. Rules []RulesetGetResponseRule `json:"rules,required"` // The version of the ruleset. Version string `json:"version,required"` // An informative description of the ruleset. Description string `json:"description"` JSON rulesetGetResponseJSON `json:"-"` }
A ruleset object.
func (*RulesetGetResponse) UnmarshalJSON ¶
func (r *RulesetGetResponse) UnmarshalJSON(data []byte) (err error)
type RulesetGetResponseEnvelope ¶
type RulesetGetResponseEnvelope struct { // A list of error messages. Errors []RulesetGetResponseEnvelopeErrors `json:"errors,required"` // A list of warning messages. Messages []RulesetGetResponseEnvelopeMessages `json:"messages,required"` // A ruleset object. Result RulesetGetResponse `json:"result,required"` // Whether the API call was successful. Success RulesetGetResponseEnvelopeSuccess `json:"success,required"` JSON rulesetGetResponseEnvelopeJSON `json:"-"` }
A response object.
func (*RulesetGetResponseEnvelope) UnmarshalJSON ¶
func (r *RulesetGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type RulesetGetResponseEnvelopeErrors ¶
type RulesetGetResponseEnvelopeErrors struct { // A text description of this message. Message string `json:"message,required"` // A unique code for this message. Code int64 `json:"code"` // The source of this message. Source RulesetGetResponseEnvelopeErrorsSource `json:"source"` JSON rulesetGetResponseEnvelopeErrorsJSON `json:"-"` }
A message.
func (*RulesetGetResponseEnvelopeErrors) UnmarshalJSON ¶
func (r *RulesetGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)
type RulesetGetResponseEnvelopeErrorsSource ¶
type RulesetGetResponseEnvelopeErrorsSource struct { // A JSON pointer to the field that is the source of the message. Pointer string `json:"pointer,required"` JSON rulesetGetResponseEnvelopeErrorsSourceJSON `json:"-"` }
The source of this message.
func (*RulesetGetResponseEnvelopeErrorsSource) UnmarshalJSON ¶
func (r *RulesetGetResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error)
type RulesetGetResponseEnvelopeMessages ¶
type RulesetGetResponseEnvelopeMessages struct { // A text description of this message. Message string `json:"message,required"` // A unique code for this message. Code int64 `json:"code"` // The source of this message. Source RulesetGetResponseEnvelopeMessagesSource `json:"source"` JSON rulesetGetResponseEnvelopeMessagesJSON `json:"-"` }
A message.
func (*RulesetGetResponseEnvelopeMessages) UnmarshalJSON ¶
func (r *RulesetGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)
type RulesetGetResponseEnvelopeMessagesSource ¶
type RulesetGetResponseEnvelopeMessagesSource struct { // A JSON pointer to the field that is the source of the message. Pointer string `json:"pointer,required"` JSON rulesetGetResponseEnvelopeMessagesSourceJSON `json:"-"` }
The source of this message.
func (*RulesetGetResponseEnvelopeMessagesSource) UnmarshalJSON ¶
func (r *RulesetGetResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error)
type RulesetGetResponseEnvelopeSuccess ¶
type RulesetGetResponseEnvelopeSuccess bool
Whether the API call was successful.
const (
RulesetGetResponseEnvelopeSuccessTrue RulesetGetResponseEnvelopeSuccess = true
)
func (RulesetGetResponseEnvelopeSuccess) IsKnown ¶
func (r RulesetGetResponseEnvelopeSuccess) IsKnown() bool
type RulesetGetResponseRule ¶
type RulesetGetResponseRule struct { // The action to perform when the rule matches. Action RulesetGetResponseRulesAction `json:"action"` // This field can have the runtime type of [BlockRuleActionParameters], // [interface{}], [CompressResponseRuleActionParameters], // [ExecuteRuleActionParameters], [RedirectRuleActionParameters], // [RewriteRuleActionParameters], [RouteRuleActionParameters], // [ScoreRuleActionParameters], [ServeErrorRuleActionParameters], // [SetConfigRuleActionParameters], [SkipRuleActionParameters], // [SetCacheSettingsRuleActionParameters], [LogCustomFieldRuleActionParameters]. ActionParameters interface{} `json:"action_parameters,required"` // This field can have the runtime type of [[]string]. Categories interface{} `json:"categories,required"` // An informative description of the rule. Description string `json:"description"` // Whether the rule should be executed. Enabled bool `json:"enabled"` // The expression defining which traffic will match the rule. Expression string `json:"expression"` // The unique ID of the rule. ID string `json:"id"` // The timestamp of when the rule was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // An object configuring the rule's logging behavior. Logging Logging `json:"logging"` // The reference of the rule (the rule ID by default). Ref string `json:"ref"` // The version of the rule. Version string `json:"version,required"` JSON rulesetGetResponseRuleJSON `json:"-"` // contains filtered or unexported fields }
func (RulesetGetResponseRule) AsUnion ¶
func (r RulesetGetResponseRule) AsUnion() RulesetGetResponseRulesUnion
AsUnion returns a RulesetGetResponseRulesUnion interface which you can cast to the specific types for more type safety.
Possible runtime types of the union are rulesets.BlockRule, rulesets.ChallengeRule, rulesets.CompressResponseRule, rulesets.ExecuteRule, rulesets.JSChallengeRule, rulesets.LogRule, rulesets.ManagedChallengeRule, rulesets.RedirectRule, rulesets.RewriteRule, rulesets.RouteRule, rulesets.ScoreRule, rulesets.ServeErrorRule, rulesets.SetConfigRule, rulesets.SkipRule, rulesets.SetCacheSettingsRule, rulesets.LogCustomFieldRule, rulesets.DDoSDynamicRule, rulesets.ForceConnectionCloseRule.
func (*RulesetGetResponseRule) UnmarshalJSON ¶
func (r *RulesetGetResponseRule) UnmarshalJSON(data []byte) (err error)
type RulesetGetResponseRulesAction ¶
type RulesetGetResponseRulesAction string
The action to perform when the rule matches.
const ( RulesetGetResponseRulesActionBlock RulesetGetResponseRulesAction = "block" RulesetGetResponseRulesActionChallenge RulesetGetResponseRulesAction = "challenge" RulesetGetResponseRulesActionCompressResponse RulesetGetResponseRulesAction = "compress_response" RulesetGetResponseRulesActionExecute RulesetGetResponseRulesAction = "execute" RulesetGetResponseRulesActionJSChallenge RulesetGetResponseRulesAction = "js_challenge" RulesetGetResponseRulesActionLog RulesetGetResponseRulesAction = "log" RulesetGetResponseRulesActionManagedChallenge RulesetGetResponseRulesAction = "managed_challenge" RulesetGetResponseRulesActionRedirect RulesetGetResponseRulesAction = "redirect" RulesetGetResponseRulesActionRewrite RulesetGetResponseRulesAction = "rewrite" RulesetGetResponseRulesActionRoute RulesetGetResponseRulesAction = "route" RulesetGetResponseRulesActionScore RulesetGetResponseRulesAction = "score" RulesetGetResponseRulesActionServeError RulesetGetResponseRulesAction = "serve_error" RulesetGetResponseRulesActionSetConfig RulesetGetResponseRulesAction = "set_config" RulesetGetResponseRulesActionSkip RulesetGetResponseRulesAction = "skip" RulesetGetResponseRulesActionSetCacheSettings RulesetGetResponseRulesAction = "set_cache_settings" RulesetGetResponseRulesActionLogCustomField RulesetGetResponseRulesAction = "log_custom_field" RulesetGetResponseRulesActionDDoSDynamic RulesetGetResponseRulesAction = "ddos_dynamic" RulesetGetResponseRulesActionForceConnectionClose RulesetGetResponseRulesAction = "force_connection_close" )
func (RulesetGetResponseRulesAction) IsKnown ¶
func (r RulesetGetResponseRulesAction) IsKnown() bool
type RulesetGetResponseRulesUnion ¶
type RulesetGetResponseRulesUnion interface {
// contains filtered or unexported methods
}
Union satisfied by rulesets.BlockRule, rulesets.ChallengeRule, rulesets.CompressResponseRule, rulesets.ExecuteRule, rulesets.JSChallengeRule, rulesets.LogRule, rulesets.ManagedChallengeRule, rulesets.RedirectRule, rulesets.RewriteRule, rulesets.RouteRule, rulesets.ScoreRule, rulesets.ServeErrorRule, rulesets.SetConfigRule, rulesets.SkipRule, rulesets.SetCacheSettingsRule, rulesets.LogCustomFieldRule, rulesets.DDoSDynamicRule or rulesets.ForceConnectionCloseRule.
type RulesetListResponse ¶
type RulesetListResponse struct { // The unique ID of the ruleset. ID string `json:"id,required"` // The kind of the ruleset. Kind Kind `json:"kind,required"` // The timestamp of when the ruleset was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // The human-readable name of the ruleset. Name string `json:"name,required"` // The phase of the ruleset. Phase Phase `json:"phase,required"` // The version of the ruleset. Version string `json:"version,required"` // An informative description of the ruleset. Description string `json:"description"` JSON rulesetListResponseJSON `json:"-"` }
A ruleset object.
func (*RulesetListResponse) UnmarshalJSON ¶
func (r *RulesetListResponse) UnmarshalJSON(data []byte) (err error)
type RulesetNewParams ¶
type RulesetNewParams struct { // The kind of the ruleset. Kind param.Field[Kind] `json:"kind,required"` // The human-readable name of the ruleset. Name param.Field[string] `json:"name,required"` // The phase of the ruleset. Phase param.Field[Phase] `json:"phase,required"` // The list of rules in the ruleset. Rules param.Field[[]RulesetNewParamsRuleUnion] `json:"rules,required"` // An informative description of the ruleset. Description param.Field[string] `json:"description"` }
func (RulesetNewParams) MarshalJSON ¶
func (r RulesetNewParams) MarshalJSON() (data []byte, err error)
type RulesetNewParamsRule ¶
type RulesetNewParamsRule struct { // The action to perform when the rule matches. Action param.Field[RulesetNewParamsRulesAction] `json:"action"` ActionParameters param.Field[interface{}] `json:"action_parameters,required"` Categories param.Field[interface{}] `json:"categories,required"` // An informative description of the rule. Description param.Field[string] `json:"description"` // Whether the rule should be executed. Enabled param.Field[bool] `json:"enabled"` // The expression defining which traffic will match the rule. Expression param.Field[string] `json:"expression"` // The unique ID of the rule. ID param.Field[string] `json:"id"` // An object configuring the rule's logging behavior. Logging param.Field[LoggingParam] `json:"logging"` // The reference of the rule (the rule ID by default). Ref param.Field[string] `json:"ref"` }
func (RulesetNewParamsRule) MarshalJSON ¶
func (r RulesetNewParamsRule) MarshalJSON() (data []byte, err error)
type RulesetNewParamsRuleUnion ¶
type RulesetNewParamsRuleUnion interface {
// contains filtered or unexported methods
}
Satisfied by rulesets.BlockRuleParam, rulesets.ChallengeRuleParam, rulesets.CompressResponseRuleParam, rulesets.ExecuteRuleParam, rulesets.JSChallengeRuleParam, rulesets.LogRuleParam, rulesets.ManagedChallengeRuleParam, rulesets.RedirectRuleParam, rulesets.RewriteRuleParam, rulesets.RouteRuleParam, rulesets.ScoreRuleParam, rulesets.ServeErrorRuleParam, rulesets.SetConfigRuleParam, rulesets.SkipRuleParam, rulesets.SetCacheSettingsRuleParam, rulesets.LogCustomFieldRuleParam, rulesets.DDoSDynamicRuleParam, rulesets.ForceConnectionCloseRuleParam, RulesetNewParamsRule.
type RulesetNewParamsRulesAction ¶
type RulesetNewParamsRulesAction string
The action to perform when the rule matches.
const ( RulesetNewParamsRulesActionBlock RulesetNewParamsRulesAction = "block" RulesetNewParamsRulesActionChallenge RulesetNewParamsRulesAction = "challenge" RulesetNewParamsRulesActionCompressResponse RulesetNewParamsRulesAction = "compress_response" RulesetNewParamsRulesActionExecute RulesetNewParamsRulesAction = "execute" RulesetNewParamsRulesActionJSChallenge RulesetNewParamsRulesAction = "js_challenge" RulesetNewParamsRulesActionLog RulesetNewParamsRulesAction = "log" RulesetNewParamsRulesActionManagedChallenge RulesetNewParamsRulesAction = "managed_challenge" RulesetNewParamsRulesActionRedirect RulesetNewParamsRulesAction = "redirect" RulesetNewParamsRulesActionRewrite RulesetNewParamsRulesAction = "rewrite" RulesetNewParamsRulesActionRoute RulesetNewParamsRulesAction = "route" RulesetNewParamsRulesActionScore RulesetNewParamsRulesAction = "score" RulesetNewParamsRulesActionServeError RulesetNewParamsRulesAction = "serve_error" RulesetNewParamsRulesActionSetConfig RulesetNewParamsRulesAction = "set_config" RulesetNewParamsRulesActionSkip RulesetNewParamsRulesAction = "skip" RulesetNewParamsRulesActionSetCacheSettings RulesetNewParamsRulesAction = "set_cache_settings" RulesetNewParamsRulesActionLogCustomField RulesetNewParamsRulesAction = "log_custom_field" RulesetNewParamsRulesActionDDoSDynamic RulesetNewParamsRulesAction = "ddos_dynamic" RulesetNewParamsRulesActionForceConnectionClose RulesetNewParamsRulesAction = "force_connection_close" )
func (RulesetNewParamsRulesAction) IsKnown ¶
func (r RulesetNewParamsRulesAction) IsKnown() bool
type RulesetNewResponse ¶
type RulesetNewResponse struct { // The unique ID of the ruleset. ID string `json:"id,required"` // The kind of the ruleset. Kind Kind `json:"kind,required"` // The timestamp of when the ruleset was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // The human-readable name of the ruleset. Name string `json:"name,required"` // The phase of the ruleset. Phase Phase `json:"phase,required"` // The list of rules in the ruleset. Rules []RulesetNewResponseRule `json:"rules,required"` // The version of the ruleset. Version string `json:"version,required"` // An informative description of the ruleset. Description string `json:"description"` JSON rulesetNewResponseJSON `json:"-"` }
A ruleset object.
func (*RulesetNewResponse) UnmarshalJSON ¶
func (r *RulesetNewResponse) UnmarshalJSON(data []byte) (err error)
type RulesetNewResponseEnvelope ¶
type RulesetNewResponseEnvelope struct { // A list of error messages. Errors []RulesetNewResponseEnvelopeErrors `json:"errors,required"` // A list of warning messages. Messages []RulesetNewResponseEnvelopeMessages `json:"messages,required"` // A ruleset object. Result RulesetNewResponse `json:"result,required"` // Whether the API call was successful. Success RulesetNewResponseEnvelopeSuccess `json:"success,required"` JSON rulesetNewResponseEnvelopeJSON `json:"-"` }
A response object.
func (*RulesetNewResponseEnvelope) UnmarshalJSON ¶
func (r *RulesetNewResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type RulesetNewResponseEnvelopeErrors ¶
type RulesetNewResponseEnvelopeErrors struct { // A text description of this message. Message string `json:"message,required"` // A unique code for this message. Code int64 `json:"code"` // The source of this message. Source RulesetNewResponseEnvelopeErrorsSource `json:"source"` JSON rulesetNewResponseEnvelopeErrorsJSON `json:"-"` }
A message.
func (*RulesetNewResponseEnvelopeErrors) UnmarshalJSON ¶
func (r *RulesetNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)
type RulesetNewResponseEnvelopeErrorsSource ¶
type RulesetNewResponseEnvelopeErrorsSource struct { // A JSON pointer to the field that is the source of the message. Pointer string `json:"pointer,required"` JSON rulesetNewResponseEnvelopeErrorsSourceJSON `json:"-"` }
The source of this message.
func (*RulesetNewResponseEnvelopeErrorsSource) UnmarshalJSON ¶
func (r *RulesetNewResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error)
type RulesetNewResponseEnvelopeMessages ¶
type RulesetNewResponseEnvelopeMessages struct { // A text description of this message. Message string `json:"message,required"` // A unique code for this message. Code int64 `json:"code"` // The source of this message. Source RulesetNewResponseEnvelopeMessagesSource `json:"source"` JSON rulesetNewResponseEnvelopeMessagesJSON `json:"-"` }
A message.
func (*RulesetNewResponseEnvelopeMessages) UnmarshalJSON ¶
func (r *RulesetNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)
type RulesetNewResponseEnvelopeMessagesSource ¶
type RulesetNewResponseEnvelopeMessagesSource struct { // A JSON pointer to the field that is the source of the message. Pointer string `json:"pointer,required"` JSON rulesetNewResponseEnvelopeMessagesSourceJSON `json:"-"` }
The source of this message.
func (*RulesetNewResponseEnvelopeMessagesSource) UnmarshalJSON ¶
func (r *RulesetNewResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error)
type RulesetNewResponseEnvelopeSuccess ¶
type RulesetNewResponseEnvelopeSuccess bool
Whether the API call was successful.
const (
RulesetNewResponseEnvelopeSuccessTrue RulesetNewResponseEnvelopeSuccess = true
)
func (RulesetNewResponseEnvelopeSuccess) IsKnown ¶
func (r RulesetNewResponseEnvelopeSuccess) IsKnown() bool
type RulesetNewResponseRule ¶
type RulesetNewResponseRule struct { // The action to perform when the rule matches. Action RulesetNewResponseRulesAction `json:"action"` // This field can have the runtime type of [BlockRuleActionParameters], // [interface{}], [CompressResponseRuleActionParameters], // [ExecuteRuleActionParameters], [RedirectRuleActionParameters], // [RewriteRuleActionParameters], [RouteRuleActionParameters], // [ScoreRuleActionParameters], [ServeErrorRuleActionParameters], // [SetConfigRuleActionParameters], [SkipRuleActionParameters], // [SetCacheSettingsRuleActionParameters], [LogCustomFieldRuleActionParameters]. ActionParameters interface{} `json:"action_parameters,required"` // This field can have the runtime type of [[]string]. Categories interface{} `json:"categories,required"` // An informative description of the rule. Description string `json:"description"` // Whether the rule should be executed. Enabled bool `json:"enabled"` // The expression defining which traffic will match the rule. Expression string `json:"expression"` // The unique ID of the rule. ID string `json:"id"` // The timestamp of when the rule was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // An object configuring the rule's logging behavior. Logging Logging `json:"logging"` // The reference of the rule (the rule ID by default). Ref string `json:"ref"` // The version of the rule. Version string `json:"version,required"` JSON rulesetNewResponseRuleJSON `json:"-"` // contains filtered or unexported fields }
func (RulesetNewResponseRule) AsUnion ¶
func (r RulesetNewResponseRule) AsUnion() RulesetNewResponseRulesUnion
AsUnion returns a RulesetNewResponseRulesUnion interface which you can cast to the specific types for more type safety.
Possible runtime types of the union are rulesets.BlockRule, rulesets.ChallengeRule, rulesets.CompressResponseRule, rulesets.ExecuteRule, rulesets.JSChallengeRule, rulesets.LogRule, rulesets.ManagedChallengeRule, rulesets.RedirectRule, rulesets.RewriteRule, rulesets.RouteRule, rulesets.ScoreRule, rulesets.ServeErrorRule, rulesets.SetConfigRule, rulesets.SkipRule, rulesets.SetCacheSettingsRule, rulesets.LogCustomFieldRule, rulesets.DDoSDynamicRule, rulesets.ForceConnectionCloseRule.
func (*RulesetNewResponseRule) UnmarshalJSON ¶
func (r *RulesetNewResponseRule) UnmarshalJSON(data []byte) (err error)
type RulesetNewResponseRulesAction ¶
type RulesetNewResponseRulesAction string
The action to perform when the rule matches.
const ( RulesetNewResponseRulesActionBlock RulesetNewResponseRulesAction = "block" RulesetNewResponseRulesActionChallenge RulesetNewResponseRulesAction = "challenge" RulesetNewResponseRulesActionCompressResponse RulesetNewResponseRulesAction = "compress_response" RulesetNewResponseRulesActionExecute RulesetNewResponseRulesAction = "execute" RulesetNewResponseRulesActionJSChallenge RulesetNewResponseRulesAction = "js_challenge" RulesetNewResponseRulesActionLog RulesetNewResponseRulesAction = "log" RulesetNewResponseRulesActionManagedChallenge RulesetNewResponseRulesAction = "managed_challenge" RulesetNewResponseRulesActionRedirect RulesetNewResponseRulesAction = "redirect" RulesetNewResponseRulesActionRewrite RulesetNewResponseRulesAction = "rewrite" RulesetNewResponseRulesActionRoute RulesetNewResponseRulesAction = "route" RulesetNewResponseRulesActionScore RulesetNewResponseRulesAction = "score" RulesetNewResponseRulesActionServeError RulesetNewResponseRulesAction = "serve_error" RulesetNewResponseRulesActionSetConfig RulesetNewResponseRulesAction = "set_config" RulesetNewResponseRulesActionSkip RulesetNewResponseRulesAction = "skip" RulesetNewResponseRulesActionSetCacheSettings RulesetNewResponseRulesAction = "set_cache_settings" RulesetNewResponseRulesActionLogCustomField RulesetNewResponseRulesAction = "log_custom_field" RulesetNewResponseRulesActionDDoSDynamic RulesetNewResponseRulesAction = "ddos_dynamic" RulesetNewResponseRulesActionForceConnectionClose RulesetNewResponseRulesAction = "force_connection_close" )
func (RulesetNewResponseRulesAction) IsKnown ¶
func (r RulesetNewResponseRulesAction) IsKnown() bool
type RulesetNewResponseRulesUnion ¶
type RulesetNewResponseRulesUnion interface {
// contains filtered or unexported methods
}
Union satisfied by rulesets.BlockRule, rulesets.ChallengeRule, rulesets.CompressResponseRule, rulesets.ExecuteRule, rulesets.JSChallengeRule, rulesets.LogRule, rulesets.ManagedChallengeRule, rulesets.RedirectRule, rulesets.RewriteRule, rulesets.RouteRule, rulesets.ScoreRule, rulesets.ServeErrorRule, rulesets.SetConfigRule, rulesets.SkipRule, rulesets.SetCacheSettingsRule, rulesets.LogCustomFieldRule, rulesets.DDoSDynamicRule or rulesets.ForceConnectionCloseRule.
type RulesetService ¶
type RulesetService struct { Options []option.RequestOption Phases *PhaseService Rules *RuleService Versions *VersionService }
RulesetService contains methods and other services that help with interacting with the testcloudflare API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewRulesetService method instead.
func NewRulesetService ¶
func NewRulesetService(opts ...option.RequestOption) (r *RulesetService)
NewRulesetService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*RulesetService) Delete ¶
func (r *RulesetService) Delete(ctx context.Context, accountOrZone string, accountOrZoneID string, rulesetID string, opts ...option.RequestOption) (err error)
Deletes all versions of an existing account or zone ruleset.
func (*RulesetService) Get ¶
func (r *RulesetService) Get(ctx context.Context, accountOrZone string, accountOrZoneID string, rulesetID string, opts ...option.RequestOption) (res *RulesetGetResponse, err error)
Fetches the latest version of an account or zone ruleset.
func (*RulesetService) List ¶
func (r *RulesetService) List(ctx context.Context, accountOrZone string, accountOrZoneID string, opts ...option.RequestOption) (res *pagination.SinglePage[RulesetListResponse], err error)
Fetches all rulesets.
func (*RulesetService) ListAutoPaging ¶
func (r *RulesetService) ListAutoPaging(ctx context.Context, accountOrZone string, accountOrZoneID string, opts ...option.RequestOption) *pagination.SinglePageAutoPager[RulesetListResponse]
Fetches all rulesets.
func (*RulesetService) New ¶
func (r *RulesetService) New(ctx context.Context, accountOrZone string, accountOrZoneID string, body RulesetNewParams, opts ...option.RequestOption) (res *RulesetNewResponse, err error)
Creates a ruleset.
func (*RulesetService) Update ¶
func (r *RulesetService) Update(ctx context.Context, accountOrZone string, accountOrZoneID string, rulesetID string, body RulesetUpdateParams, opts ...option.RequestOption) (res *RulesetUpdateResponse, err error)
Updates an account or zone ruleset, creating a new version.
type RulesetUpdateParams ¶
type RulesetUpdateParams struct { // The list of rules in the ruleset. Rules param.Field[[]RulesetUpdateParamsRuleUnion] `json:"rules,required"` // An informative description of the ruleset. Description param.Field[string] `json:"description"` // The kind of the ruleset. Kind param.Field[Kind] `json:"kind"` // The human-readable name of the ruleset. Name param.Field[string] `json:"name"` // The phase of the ruleset. Phase param.Field[Phase] `json:"phase"` }
func (RulesetUpdateParams) MarshalJSON ¶
func (r RulesetUpdateParams) MarshalJSON() (data []byte, err error)
type RulesetUpdateParamsRule ¶
type RulesetUpdateParamsRule struct { // The action to perform when the rule matches. Action param.Field[RulesetUpdateParamsRulesAction] `json:"action"` ActionParameters param.Field[interface{}] `json:"action_parameters,required"` Categories param.Field[interface{}] `json:"categories,required"` // An informative description of the rule. Description param.Field[string] `json:"description"` // Whether the rule should be executed. Enabled param.Field[bool] `json:"enabled"` // The expression defining which traffic will match the rule. Expression param.Field[string] `json:"expression"` // The unique ID of the rule. ID param.Field[string] `json:"id"` // An object configuring the rule's logging behavior. Logging param.Field[LoggingParam] `json:"logging"` // The reference of the rule (the rule ID by default). Ref param.Field[string] `json:"ref"` }
func (RulesetUpdateParamsRule) MarshalJSON ¶
func (r RulesetUpdateParamsRule) MarshalJSON() (data []byte, err error)
type RulesetUpdateParamsRuleUnion ¶
type RulesetUpdateParamsRuleUnion interface {
// contains filtered or unexported methods
}
Satisfied by rulesets.BlockRuleParam, rulesets.ChallengeRuleParam, rulesets.CompressResponseRuleParam, rulesets.ExecuteRuleParam, rulesets.JSChallengeRuleParam, rulesets.LogRuleParam, rulesets.ManagedChallengeRuleParam, rulesets.RedirectRuleParam, rulesets.RewriteRuleParam, rulesets.RouteRuleParam, rulesets.ScoreRuleParam, rulesets.ServeErrorRuleParam, rulesets.SetConfigRuleParam, rulesets.SkipRuleParam, rulesets.SetCacheSettingsRuleParam, rulesets.LogCustomFieldRuleParam, rulesets.DDoSDynamicRuleParam, rulesets.ForceConnectionCloseRuleParam, RulesetUpdateParamsRule.
type RulesetUpdateParamsRulesAction ¶
type RulesetUpdateParamsRulesAction string
The action to perform when the rule matches.
const ( RulesetUpdateParamsRulesActionBlock RulesetUpdateParamsRulesAction = "block" RulesetUpdateParamsRulesActionChallenge RulesetUpdateParamsRulesAction = "challenge" RulesetUpdateParamsRulesActionCompressResponse RulesetUpdateParamsRulesAction = "compress_response" RulesetUpdateParamsRulesActionExecute RulesetUpdateParamsRulesAction = "execute" RulesetUpdateParamsRulesActionJSChallenge RulesetUpdateParamsRulesAction = "js_challenge" RulesetUpdateParamsRulesActionLog RulesetUpdateParamsRulesAction = "log" RulesetUpdateParamsRulesActionManagedChallenge RulesetUpdateParamsRulesAction = "managed_challenge" RulesetUpdateParamsRulesActionRedirect RulesetUpdateParamsRulesAction = "redirect" RulesetUpdateParamsRulesActionRewrite RulesetUpdateParamsRulesAction = "rewrite" RulesetUpdateParamsRulesActionRoute RulesetUpdateParamsRulesAction = "route" RulesetUpdateParamsRulesActionScore RulesetUpdateParamsRulesAction = "score" RulesetUpdateParamsRulesActionServeError RulesetUpdateParamsRulesAction = "serve_error" RulesetUpdateParamsRulesActionSetConfig RulesetUpdateParamsRulesAction = "set_config" RulesetUpdateParamsRulesActionSkip RulesetUpdateParamsRulesAction = "skip" RulesetUpdateParamsRulesActionSetCacheSettings RulesetUpdateParamsRulesAction = "set_cache_settings" RulesetUpdateParamsRulesActionLogCustomField RulesetUpdateParamsRulesAction = "log_custom_field" RulesetUpdateParamsRulesActionDDoSDynamic RulesetUpdateParamsRulesAction = "ddos_dynamic" RulesetUpdateParamsRulesActionForceConnectionClose RulesetUpdateParamsRulesAction = "force_connection_close" )
func (RulesetUpdateParamsRulesAction) IsKnown ¶
func (r RulesetUpdateParamsRulesAction) IsKnown() bool
type RulesetUpdateResponse ¶
type RulesetUpdateResponse struct { // The unique ID of the ruleset. ID string `json:"id,required"` // The kind of the ruleset. Kind Kind `json:"kind,required"` // The timestamp of when the ruleset was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // The human-readable name of the ruleset. Name string `json:"name,required"` // The phase of the ruleset. Phase Phase `json:"phase,required"` // The list of rules in the ruleset. Rules []RulesetUpdateResponseRule `json:"rules,required"` // The version of the ruleset. Version string `json:"version,required"` // An informative description of the ruleset. Description string `json:"description"` JSON rulesetUpdateResponseJSON `json:"-"` }
A ruleset object.
func (*RulesetUpdateResponse) UnmarshalJSON ¶
func (r *RulesetUpdateResponse) UnmarshalJSON(data []byte) (err error)
type RulesetUpdateResponseEnvelope ¶
type RulesetUpdateResponseEnvelope struct { // A list of error messages. Errors []RulesetUpdateResponseEnvelopeErrors `json:"errors,required"` // A list of warning messages. Messages []RulesetUpdateResponseEnvelopeMessages `json:"messages,required"` // A ruleset object. Result RulesetUpdateResponse `json:"result,required"` // Whether the API call was successful. Success RulesetUpdateResponseEnvelopeSuccess `json:"success,required"` JSON rulesetUpdateResponseEnvelopeJSON `json:"-"` }
A response object.
func (*RulesetUpdateResponseEnvelope) UnmarshalJSON ¶
func (r *RulesetUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type RulesetUpdateResponseEnvelopeErrors ¶
type RulesetUpdateResponseEnvelopeErrors struct { // A text description of this message. Message string `json:"message,required"` // A unique code for this message. Code int64 `json:"code"` // The source of this message. Source RulesetUpdateResponseEnvelopeErrorsSource `json:"source"` JSON rulesetUpdateResponseEnvelopeErrorsJSON `json:"-"` }
A message.
func (*RulesetUpdateResponseEnvelopeErrors) UnmarshalJSON ¶
func (r *RulesetUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)
type RulesetUpdateResponseEnvelopeErrorsSource ¶
type RulesetUpdateResponseEnvelopeErrorsSource struct { // A JSON pointer to the field that is the source of the message. Pointer string `json:"pointer,required"` JSON rulesetUpdateResponseEnvelopeErrorsSourceJSON `json:"-"` }
The source of this message.
func (*RulesetUpdateResponseEnvelopeErrorsSource) UnmarshalJSON ¶
func (r *RulesetUpdateResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error)
type RulesetUpdateResponseEnvelopeMessages ¶
type RulesetUpdateResponseEnvelopeMessages struct { // A text description of this message. Message string `json:"message,required"` // A unique code for this message. Code int64 `json:"code"` // The source of this message. Source RulesetUpdateResponseEnvelopeMessagesSource `json:"source"` JSON rulesetUpdateResponseEnvelopeMessagesJSON `json:"-"` }
A message.
func (*RulesetUpdateResponseEnvelopeMessages) UnmarshalJSON ¶
func (r *RulesetUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)
type RulesetUpdateResponseEnvelopeMessagesSource ¶
type RulesetUpdateResponseEnvelopeMessagesSource struct { // A JSON pointer to the field that is the source of the message. Pointer string `json:"pointer,required"` JSON rulesetUpdateResponseEnvelopeMessagesSourceJSON `json:"-"` }
The source of this message.
func (*RulesetUpdateResponseEnvelopeMessagesSource) UnmarshalJSON ¶
func (r *RulesetUpdateResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error)
type RulesetUpdateResponseEnvelopeSuccess ¶
type RulesetUpdateResponseEnvelopeSuccess bool
Whether the API call was successful.
const (
RulesetUpdateResponseEnvelopeSuccessTrue RulesetUpdateResponseEnvelopeSuccess = true
)
func (RulesetUpdateResponseEnvelopeSuccess) IsKnown ¶
func (r RulesetUpdateResponseEnvelopeSuccess) IsKnown() bool
type RulesetUpdateResponseRule ¶
type RulesetUpdateResponseRule struct { // The action to perform when the rule matches. Action RulesetUpdateResponseRulesAction `json:"action"` // This field can have the runtime type of [BlockRuleActionParameters], // [interface{}], [CompressResponseRuleActionParameters], // [ExecuteRuleActionParameters], [RedirectRuleActionParameters], // [RewriteRuleActionParameters], [RouteRuleActionParameters], // [ScoreRuleActionParameters], [ServeErrorRuleActionParameters], // [SetConfigRuleActionParameters], [SkipRuleActionParameters], // [SetCacheSettingsRuleActionParameters], [LogCustomFieldRuleActionParameters]. ActionParameters interface{} `json:"action_parameters,required"` // This field can have the runtime type of [[]string]. Categories interface{} `json:"categories,required"` // An informative description of the rule. Description string `json:"description"` // Whether the rule should be executed. Enabled bool `json:"enabled"` // The expression defining which traffic will match the rule. Expression string `json:"expression"` // The unique ID of the rule. ID string `json:"id"` // The timestamp of when the rule was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // An object configuring the rule's logging behavior. Logging Logging `json:"logging"` // The reference of the rule (the rule ID by default). Ref string `json:"ref"` // The version of the rule. Version string `json:"version,required"` JSON rulesetUpdateResponseRuleJSON `json:"-"` // contains filtered or unexported fields }
func (RulesetUpdateResponseRule) AsUnion ¶
func (r RulesetUpdateResponseRule) AsUnion() RulesetUpdateResponseRulesUnion
AsUnion returns a RulesetUpdateResponseRulesUnion interface which you can cast to the specific types for more type safety.
Possible runtime types of the union are rulesets.BlockRule, rulesets.ChallengeRule, rulesets.CompressResponseRule, rulesets.ExecuteRule, rulesets.JSChallengeRule, rulesets.LogRule, rulesets.ManagedChallengeRule, rulesets.RedirectRule, rulesets.RewriteRule, rulesets.RouteRule, rulesets.ScoreRule, rulesets.ServeErrorRule, rulesets.SetConfigRule, rulesets.SkipRule, rulesets.SetCacheSettingsRule, rulesets.LogCustomFieldRule, rulesets.DDoSDynamicRule, rulesets.ForceConnectionCloseRule.
func (*RulesetUpdateResponseRule) UnmarshalJSON ¶
func (r *RulesetUpdateResponseRule) UnmarshalJSON(data []byte) (err error)
type RulesetUpdateResponseRulesAction ¶
type RulesetUpdateResponseRulesAction string
The action to perform when the rule matches.
const ( RulesetUpdateResponseRulesActionBlock RulesetUpdateResponseRulesAction = "block" RulesetUpdateResponseRulesActionChallenge RulesetUpdateResponseRulesAction = "challenge" RulesetUpdateResponseRulesActionCompressResponse RulesetUpdateResponseRulesAction = "compress_response" RulesetUpdateResponseRulesActionExecute RulesetUpdateResponseRulesAction = "execute" RulesetUpdateResponseRulesActionJSChallenge RulesetUpdateResponseRulesAction = "js_challenge" RulesetUpdateResponseRulesActionLog RulesetUpdateResponseRulesAction = "log" RulesetUpdateResponseRulesActionManagedChallenge RulesetUpdateResponseRulesAction = "managed_challenge" RulesetUpdateResponseRulesActionRedirect RulesetUpdateResponseRulesAction = "redirect" RulesetUpdateResponseRulesActionRewrite RulesetUpdateResponseRulesAction = "rewrite" RulesetUpdateResponseRulesActionRoute RulesetUpdateResponseRulesAction = "route" RulesetUpdateResponseRulesActionScore RulesetUpdateResponseRulesAction = "score" RulesetUpdateResponseRulesActionServeError RulesetUpdateResponseRulesAction = "serve_error" RulesetUpdateResponseRulesActionSetConfig RulesetUpdateResponseRulesAction = "set_config" RulesetUpdateResponseRulesActionSkip RulesetUpdateResponseRulesAction = "skip" RulesetUpdateResponseRulesActionSetCacheSettings RulesetUpdateResponseRulesAction = "set_cache_settings" RulesetUpdateResponseRulesActionLogCustomField RulesetUpdateResponseRulesAction = "log_custom_field" RulesetUpdateResponseRulesActionDDoSDynamic RulesetUpdateResponseRulesAction = "ddos_dynamic" RulesetUpdateResponseRulesActionForceConnectionClose RulesetUpdateResponseRulesAction = "force_connection_close" )
func (RulesetUpdateResponseRulesAction) IsKnown ¶
func (r RulesetUpdateResponseRulesAction) IsKnown() bool
type RulesetUpdateResponseRulesUnion ¶
type RulesetUpdateResponseRulesUnion interface {
// contains filtered or unexported methods
}
Union satisfied by rulesets.BlockRule, rulesets.ChallengeRule, rulesets.CompressResponseRule, rulesets.ExecuteRule, rulesets.JSChallengeRule, rulesets.LogRule, rulesets.ManagedChallengeRule, rulesets.RedirectRule, rulesets.RewriteRule, rulesets.RouteRule, rulesets.ScoreRule, rulesets.ServeErrorRule, rulesets.SetConfigRule, rulesets.SkipRule, rulesets.SetCacheSettingsRule, rulesets.LogCustomFieldRule, rulesets.DDoSDynamicRule or rulesets.ForceConnectionCloseRule.
type ScoreRule ¶
type ScoreRule struct { // The timestamp of when the rule was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // The version of the rule. Version string `json:"version,required"` // The unique ID of the rule. ID string `json:"id"` // The action to perform when the rule matches. Action ScoreRuleAction `json:"action"` // The parameters configuring the rule's action. ActionParameters ScoreRuleActionParameters `json:"action_parameters"` // The categories of the rule. Categories []string `json:"categories"` // An informative description of the rule. Description string `json:"description"` // Whether the rule should be executed. Enabled bool `json:"enabled"` // The expression defining which traffic will match the rule. Expression string `json:"expression"` // An object configuring the rule's logging behavior. Logging Logging `json:"logging"` // The reference of the rule (the rule ID by default). Ref string `json:"ref"` JSON scoreRuleJSON `json:"-"` }
func (*ScoreRule) UnmarshalJSON ¶
type ScoreRuleAction ¶
type ScoreRuleAction string
The action to perform when the rule matches.
const (
ScoreRuleActionScore ScoreRuleAction = "score"
)
func (ScoreRuleAction) IsKnown ¶
func (r ScoreRuleAction) IsKnown() bool
type ScoreRuleActionParameters ¶
type ScoreRuleActionParameters struct { // Increment contains the delta to change the score and can be either positive or // negative. Increment int64 `json:"increment"` JSON scoreRuleActionParametersJSON `json:"-"` }
The parameters configuring the rule's action.
func (*ScoreRuleActionParameters) UnmarshalJSON ¶
func (r *ScoreRuleActionParameters) UnmarshalJSON(data []byte) (err error)
type ScoreRuleActionParametersParam ¶
type ScoreRuleActionParametersParam struct { // Increment contains the delta to change the score and can be either positive or // negative. Increment param.Field[int64] `json:"increment"` }
The parameters configuring the rule's action.
func (ScoreRuleActionParametersParam) MarshalJSON ¶
func (r ScoreRuleActionParametersParam) MarshalJSON() (data []byte, err error)
type ScoreRuleParam ¶
type ScoreRuleParam struct { // The unique ID of the rule. ID param.Field[string] `json:"id"` // The action to perform when the rule matches. Action param.Field[ScoreRuleAction] `json:"action"` // The parameters configuring the rule's action. ActionParameters param.Field[ScoreRuleActionParametersParam] `json:"action_parameters"` // An informative description of the rule. Description param.Field[string] `json:"description"` // Whether the rule should be executed. Enabled param.Field[bool] `json:"enabled"` // The expression defining which traffic will match the rule. Expression param.Field[string] `json:"expression"` // An object configuring the rule's logging behavior. Logging param.Field[LoggingParam] `json:"logging"` // The reference of the rule (the rule ID by default). Ref param.Field[string] `json:"ref"` }
func (ScoreRuleParam) MarshalJSON ¶
func (r ScoreRuleParam) MarshalJSON() (data []byte, err error)
type ServeErrorRule ¶
type ServeErrorRule struct { // The timestamp of when the rule was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // The version of the rule. Version string `json:"version,required"` // The unique ID of the rule. ID string `json:"id"` // The action to perform when the rule matches. Action ServeErrorRuleAction `json:"action"` // The parameters configuring the rule's action. ActionParameters ServeErrorRuleActionParameters `json:"action_parameters"` // The categories of the rule. Categories []string `json:"categories"` // An informative description of the rule. Description string `json:"description"` // Whether the rule should be executed. Enabled bool `json:"enabled"` // The expression defining which traffic will match the rule. Expression string `json:"expression"` // An object configuring the rule's logging behavior. Logging Logging `json:"logging"` // The reference of the rule (the rule ID by default). Ref string `json:"ref"` JSON serveErrorRuleJSON `json:"-"` }
func (*ServeErrorRule) UnmarshalJSON ¶
func (r *ServeErrorRule) UnmarshalJSON(data []byte) (err error)
type ServeErrorRuleAction ¶
type ServeErrorRuleAction string
The action to perform when the rule matches.
const (
ServeErrorRuleActionServeError ServeErrorRuleAction = "serve_error"
)
func (ServeErrorRuleAction) IsKnown ¶
func (r ServeErrorRuleAction) IsKnown() bool
type ServeErrorRuleActionParameters ¶
type ServeErrorRuleActionParameters struct { // Error response content. Content string `json:"content"` // Content-type header to set with the response. ContentType ServeErrorRuleActionParametersContentType `json:"content_type"` // The status code to use for the error. StatusCode float64 `json:"status_code"` JSON serveErrorRuleActionParametersJSON `json:"-"` }
The parameters configuring the rule's action.
func (*ServeErrorRuleActionParameters) UnmarshalJSON ¶
func (r *ServeErrorRuleActionParameters) UnmarshalJSON(data []byte) (err error)
type ServeErrorRuleActionParametersContentType ¶
type ServeErrorRuleActionParametersContentType string
Content-type header to set with the response.
const ( ServeErrorRuleActionParametersContentTypeApplicationJson ServeErrorRuleActionParametersContentType = "application/json" ServeErrorRuleActionParametersContentTypeTextXml ServeErrorRuleActionParametersContentType = "text/xml" ServeErrorRuleActionParametersContentTypeTextPlain ServeErrorRuleActionParametersContentType = "text/plain" ServeErrorRuleActionParametersContentTypeTextHTML ServeErrorRuleActionParametersContentType = "text/html" )
func (ServeErrorRuleActionParametersContentType) IsKnown ¶
func (r ServeErrorRuleActionParametersContentType) IsKnown() bool
type ServeErrorRuleActionParametersParam ¶
type ServeErrorRuleActionParametersParam struct { // Error response content. Content param.Field[string] `json:"content"` // Content-type header to set with the response. ContentType param.Field[ServeErrorRuleActionParametersContentType] `json:"content_type"` // The status code to use for the error. StatusCode param.Field[float64] `json:"status_code"` }
The parameters configuring the rule's action.
func (ServeErrorRuleActionParametersParam) MarshalJSON ¶
func (r ServeErrorRuleActionParametersParam) MarshalJSON() (data []byte, err error)
type ServeErrorRuleParam ¶
type ServeErrorRuleParam struct { // The unique ID of the rule. ID param.Field[string] `json:"id"` // The action to perform when the rule matches. Action param.Field[ServeErrorRuleAction] `json:"action"` // The parameters configuring the rule's action. ActionParameters param.Field[ServeErrorRuleActionParametersParam] `json:"action_parameters"` // An informative description of the rule. Description param.Field[string] `json:"description"` // Whether the rule should be executed. Enabled param.Field[bool] `json:"enabled"` // The expression defining which traffic will match the rule. Expression param.Field[string] `json:"expression"` // An object configuring the rule's logging behavior. Logging param.Field[LoggingParam] `json:"logging"` // The reference of the rule (the rule ID by default). Ref param.Field[string] `json:"ref"` }
func (ServeErrorRuleParam) MarshalJSON ¶
func (r ServeErrorRuleParam) MarshalJSON() (data []byte, err error)
type SetCacheSettingsRule ¶
type SetCacheSettingsRule struct { // The timestamp of when the rule was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // The version of the rule. Version string `json:"version,required"` // The unique ID of the rule. ID string `json:"id"` // The action to perform when the rule matches. Action SetCacheSettingsRuleAction `json:"action"` // The parameters configuring the rule's action. ActionParameters SetCacheSettingsRuleActionParameters `json:"action_parameters"` // The categories of the rule. Categories []string `json:"categories"` // An informative description of the rule. Description string `json:"description"` // Whether the rule should be executed. Enabled bool `json:"enabled"` // The expression defining which traffic will match the rule. Expression string `json:"expression"` // An object configuring the rule's logging behavior. Logging Logging `json:"logging"` // The reference of the rule (the rule ID by default). Ref string `json:"ref"` JSON setCacheSettingsRuleJSON `json:"-"` }
func (*SetCacheSettingsRule) UnmarshalJSON ¶
func (r *SetCacheSettingsRule) UnmarshalJSON(data []byte) (err error)
type SetCacheSettingsRuleAction ¶
type SetCacheSettingsRuleAction string
The action to perform when the rule matches.
const (
SetCacheSettingsRuleActionSetCacheSettings SetCacheSettingsRuleAction = "set_cache_settings"
)
func (SetCacheSettingsRuleAction) IsKnown ¶
func (r SetCacheSettingsRuleAction) IsKnown() bool
type SetCacheSettingsRuleActionParameters ¶
type SetCacheSettingsRuleActionParameters struct { // List of additional ports that caching can be enabled on. AdditionalCacheablePorts []int64 `json:"additional_cacheable_ports"` // Specify how long client browsers should cache the response. Cloudflare cache // purge will not purge content cached on client browsers, so high browser TTLs may // lead to stale content. BrowserTTL SetCacheSettingsRuleActionParametersBrowserTTL `json:"browser_ttl"` // Mark whether the request’s response from origin is eligible for caching. Caching // itself will still depend on the cache-control header and your other caching // configurations. Cache bool `json:"cache"` // Define which components of the request are included or excluded from the cache // key Cloudflare uses to store the response in cache. CacheKey SetCacheSettingsRuleActionParametersCacheKey `json:"cache_key"` // Mark whether the request's response from origin is eligible for Cache Reserve // (requires a Cache Reserve add-on plan). CacheReserve SetCacheSettingsRuleActionParametersCacheReserve `json:"cache_reserve"` // TTL (Time to Live) specifies the maximum time to cache a resource in the // Cloudflare edge network. EdgeTTL SetCacheSettingsRuleActionParametersEdgeTTL `json:"edge_ttl"` // When enabled, Cloudflare will aim to strictly adhere to RFC 7234. OriginCacheControl bool `json:"origin_cache_control"` // Generate Cloudflare error pages from issues sent from the origin server. When // on, error pages will trigger for issues from the origin OriginErrorPagePassthru bool `json:"origin_error_page_passthru"` // Define a timeout value between two successive read operations to your origin // server. Historically, the timeout value between two read options from Cloudflare // to an origin server is 100 seconds. If you are attempting to reduce HTTP 524 // errors because of timeouts from an origin server, try increasing this timeout // value. ReadTimeout int64 `json:"read_timeout"` // headers. When off, Cloudflare converts strong ETag headers to weak ETag headers. RespectStrongEtags bool `json:"respect_strong_etags"` // Define if Cloudflare should serve stale content while getting the latest content // from the origin. If on, Cloudflare will not serve stale content while getting // the latest content from the origin. ServeStale SetCacheSettingsRuleActionParametersServeStale `json:"serve_stale"` JSON setCacheSettingsRuleActionParametersJSON `json:"-"` }
The parameters configuring the rule's action.
func (*SetCacheSettingsRuleActionParameters) UnmarshalJSON ¶
func (r *SetCacheSettingsRuleActionParameters) UnmarshalJSON(data []byte) (err error)
type SetCacheSettingsRuleActionParametersBrowserTTL ¶
type SetCacheSettingsRuleActionParametersBrowserTTL struct { // Determines which browser ttl mode to use. Mode SetCacheSettingsRuleActionParametersBrowserTTLMode `json:"mode,required"` // The TTL (in seconds) if you choose override_origin mode. Default int64 `json:"default"` JSON setCacheSettingsRuleActionParametersBrowserTTLJSON `json:"-"` }
Specify how long client browsers should cache the response. Cloudflare cache purge will not purge content cached on client browsers, so high browser TTLs may lead to stale content.
func (*SetCacheSettingsRuleActionParametersBrowserTTL) UnmarshalJSON ¶
func (r *SetCacheSettingsRuleActionParametersBrowserTTL) UnmarshalJSON(data []byte) (err error)
type SetCacheSettingsRuleActionParametersBrowserTTLMode ¶
type SetCacheSettingsRuleActionParametersBrowserTTLMode string
Determines which browser ttl mode to use.
const ( SetCacheSettingsRuleActionParametersBrowserTTLModeRespectOrigin SetCacheSettingsRuleActionParametersBrowserTTLMode = "respect_origin" SetCacheSettingsRuleActionParametersBrowserTTLModeBypassByDefault SetCacheSettingsRuleActionParametersBrowserTTLMode = "bypass_by_default" SetCacheSettingsRuleActionParametersBrowserTTLModeOverrideOrigin SetCacheSettingsRuleActionParametersBrowserTTLMode = "override_origin" )
func (SetCacheSettingsRuleActionParametersBrowserTTLMode) IsKnown ¶
func (r SetCacheSettingsRuleActionParametersBrowserTTLMode) IsKnown() bool
type SetCacheSettingsRuleActionParametersBrowserTTLParam ¶
type SetCacheSettingsRuleActionParametersBrowserTTLParam struct { // Determines which browser ttl mode to use. Mode param.Field[SetCacheSettingsRuleActionParametersBrowserTTLMode] `json:"mode,required"` // The TTL (in seconds) if you choose override_origin mode. Default param.Field[int64] `json:"default"` }
Specify how long client browsers should cache the response. Cloudflare cache purge will not purge content cached on client browsers, so high browser TTLs may lead to stale content.
func (SetCacheSettingsRuleActionParametersBrowserTTLParam) MarshalJSON ¶
func (r SetCacheSettingsRuleActionParametersBrowserTTLParam) MarshalJSON() (data []byte, err error)
type SetCacheSettingsRuleActionParametersCacheKey ¶
type SetCacheSettingsRuleActionParametersCacheKey struct { // Separate cached content based on the visitor’s device type CacheByDeviceType bool `json:"cache_by_device_type"` // Protect from web cache deception attacks while allowing static assets to be // cached CacheDeceptionArmor bool `json:"cache_deception_armor"` // Customize which components of the request are included or excluded from the // cache key. CustomKey SetCacheSettingsRuleActionParametersCacheKeyCustomKey `json:"custom_key"` // Treat requests with the same query parameters the same, regardless of the order // those query parameters are in. A value of true ignores the query strings' order. IgnoreQueryStringsOrder bool `json:"ignore_query_strings_order"` JSON setCacheSettingsRuleActionParametersCacheKeyJSON `json:"-"` }
Define which components of the request are included or excluded from the cache key Cloudflare uses to store the response in cache.
func (*SetCacheSettingsRuleActionParametersCacheKey) UnmarshalJSON ¶
func (r *SetCacheSettingsRuleActionParametersCacheKey) UnmarshalJSON(data []byte) (err error)
type SetCacheSettingsRuleActionParametersCacheKeyCustomKey ¶
type SetCacheSettingsRuleActionParametersCacheKeyCustomKey struct { // The cookies to include in building the cache key. Cookie SetCacheSettingsRuleActionParametersCacheKeyCustomKeyCookie `json:"cookie"` // The header names and values to include in building the cache key. Header SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHeader `json:"header"` // Whether to use the original host or the resolved host in the cache key. Host SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHost `json:"host"` // Use the presence or absence of parameters in the query string to build the cache // key. QueryString SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryString `json:"query_string"` // Characteristics of the request user agent used in building the cache key. User SetCacheSettingsRuleActionParametersCacheKeyCustomKeyUser `json:"user"` JSON setCacheSettingsRuleActionParametersCacheKeyCustomKeyJSON `json:"-"` }
Customize which components of the request are included or excluded from the cache key.
func (*SetCacheSettingsRuleActionParametersCacheKeyCustomKey) UnmarshalJSON ¶
func (r *SetCacheSettingsRuleActionParametersCacheKeyCustomKey) UnmarshalJSON(data []byte) (err error)
type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyCookie ¶
type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyCookie struct { // Checks for the presence of these cookie names. The presence of these cookies is // used in building the cache key. CheckPresence []string `json:"check_presence"` // Include these cookies' names and their values. Include []string `json:"include"` JSON setCacheSettingsRuleActionParametersCacheKeyCustomKeyCookieJSON `json:"-"` }
The cookies to include in building the cache key.
func (*SetCacheSettingsRuleActionParametersCacheKeyCustomKeyCookie) UnmarshalJSON ¶
func (r *SetCacheSettingsRuleActionParametersCacheKeyCustomKeyCookie) UnmarshalJSON(data []byte) (err error)
type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyCookieParam ¶
type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyCookieParam struct { // Checks for the presence of these cookie names. The presence of these cookies is // used in building the cache key. CheckPresence param.Field[[]string] `json:"check_presence"` // Include these cookies' names and their values. Include param.Field[[]string] `json:"include"` }
The cookies to include in building the cache key.
func (SetCacheSettingsRuleActionParametersCacheKeyCustomKeyCookieParam) MarshalJSON ¶
func (r SetCacheSettingsRuleActionParametersCacheKeyCustomKeyCookieParam) MarshalJSON() (data []byte, err error)
type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHeader ¶
type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHeader struct { // Checks for the presence of these header names. The presence of these headers is // used in building the cache key. CheckPresence []string `json:"check_presence"` // For each header name and list of values combination, check if the request header // contains any of the values provided. The presence of the request header and // whether any of the values provided are contained in the request header value is // used in building the cache key. Contains map[string][]string `json:"contains"` // Whether or not to include the origin header. A value of true will exclude the // origin header in the cache key. ExcludeOrigin bool `json:"exclude_origin"` // Include these headers' names and their values. Include []string `json:"include"` JSON setCacheSettingsRuleActionParametersCacheKeyCustomKeyHeaderJSON `json:"-"` }
The header names and values to include in building the cache key.
func (*SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHeader) UnmarshalJSON ¶
func (r *SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHeader) UnmarshalJSON(data []byte) (err error)
type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHeaderParam ¶
type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHeaderParam struct { // Checks for the presence of these header names. The presence of these headers is // used in building the cache key. CheckPresence param.Field[[]string] `json:"check_presence"` // For each header name and list of values combination, check if the request header // contains any of the values provided. The presence of the request header and // whether any of the values provided are contained in the request header value is // used in building the cache key. Contains param.Field[map[string][]string] `json:"contains"` // Whether or not to include the origin header. A value of true will exclude the // origin header in the cache key. ExcludeOrigin param.Field[bool] `json:"exclude_origin"` // Include these headers' names and their values. Include param.Field[[]string] `json:"include"` }
The header names and values to include in building the cache key.
func (SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHeaderParam) MarshalJSON ¶
func (r SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHeaderParam) MarshalJSON() (data []byte, err error)
type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHost ¶
type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHost struct { // Use the resolved host in the cache key. A value of true will use the resolved // host, while a value or false will use the original host. Resolved bool `json:"resolved"` JSON setCacheSettingsRuleActionParametersCacheKeyCustomKeyHostJSON `json:"-"` }
Whether to use the original host or the resolved host in the cache key.
func (*SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHost) UnmarshalJSON ¶
func (r *SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHost) UnmarshalJSON(data []byte) (err error)
type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHostParam ¶
type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHostParam struct { // Use the resolved host in the cache key. A value of true will use the resolved // host, while a value or false will use the original host. Resolved param.Field[bool] `json:"resolved"` }
Whether to use the original host or the resolved host in the cache key.
func (SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHostParam) MarshalJSON ¶
func (r SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHostParam) MarshalJSON() (data []byte, err error)
type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyParam ¶
type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyParam struct { // The cookies to include in building the cache key. Cookie param.Field[SetCacheSettingsRuleActionParametersCacheKeyCustomKeyCookieParam] `json:"cookie"` // The header names and values to include in building the cache key. Header param.Field[SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHeaderParam] `json:"header"` // Whether to use the original host or the resolved host in the cache key. Host param.Field[SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHostParam] `json:"host"` // Use the presence or absence of parameters in the query string to build the cache // key. QueryString param.Field[SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringParam] `json:"query_string"` // Characteristics of the request user agent used in building the cache key. User param.Field[SetCacheSettingsRuleActionParametersCacheKeyCustomKeyUserParam] `json:"user"` }
Customize which components of the request are included or excluded from the cache key.
func (SetCacheSettingsRuleActionParametersCacheKeyCustomKeyParam) MarshalJSON ¶
func (r SetCacheSettingsRuleActionParametersCacheKeyCustomKeyParam) MarshalJSON() (data []byte, err error)
type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryString ¶
type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryString struct { // build the cache key using all query string parameters EXCECPT these excluded // parameters Exclude SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExclude `json:"exclude"` // build the cache key using a list of query string parameters that ARE in the // request. Include SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringInclude `json:"include"` JSON setCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringJSON `json:"-"` }
Use the presence or absence of parameters in the query string to build the cache key.
func (*SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryString) UnmarshalJSON ¶
func (r *SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryString) UnmarshalJSON(data []byte) (err error)
type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExclude ¶
type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExclude struct { // Exclude all query string parameters from use in building the cache key. All bool `json:"all"` // A list of query string parameters NOT used to build the cache key. All // parameters present in the request but missing in this list will be used to build // the cache key. List []string `json:"list"` JSON setCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludeJSON `json:"-"` }
build the cache key using all query string parameters EXCECPT these excluded parameters
func (*SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExclude) UnmarshalJSON ¶
func (r *SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExclude) UnmarshalJSON(data []byte) (err error)
type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludeParam ¶
type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludeParam struct { // Exclude all query string parameters from use in building the cache key. All param.Field[bool] `json:"all"` // A list of query string parameters NOT used to build the cache key. All // parameters present in the request but missing in this list will be used to build // the cache key. List param.Field[[]string] `json:"list"` }
build the cache key using all query string parameters EXCECPT these excluded parameters
func (SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludeParam) MarshalJSON ¶
func (r SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludeParam) MarshalJSON() (data []byte, err error)
type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringInclude ¶
type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringInclude struct { // Use all query string parameters in the cache key. All bool `json:"all"` // A list of query string parameters used to build the cache key. List []string `json:"list"` JSON setCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludeJSON `json:"-"` }
build the cache key using a list of query string parameters that ARE in the request.
func (*SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringInclude) UnmarshalJSON ¶
func (r *SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringInclude) UnmarshalJSON(data []byte) (err error)
type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludeParam ¶
type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludeParam struct { // Use all query string parameters in the cache key. All param.Field[bool] `json:"all"` // A list of query string parameters used to build the cache key. List param.Field[[]string] `json:"list"` }
build the cache key using a list of query string parameters that ARE in the request.
func (SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludeParam) MarshalJSON ¶
func (r SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludeParam) MarshalJSON() (data []byte, err error)
type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringParam ¶
type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringParam struct { // build the cache key using all query string parameters EXCECPT these excluded // parameters Exclude param.Field[SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludeParam] `json:"exclude"` // build the cache key using a list of query string parameters that ARE in the // request. Include param.Field[SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludeParam] `json:"include"` }
Use the presence or absence of parameters in the query string to build the cache key.
func (SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringParam) MarshalJSON ¶
func (r SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringParam) MarshalJSON() (data []byte, err error)
type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyUser ¶
type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyUser struct { // Use the user agent's device type in the cache key. DeviceType bool `json:"device_type"` // Use the user agents's country in the cache key. Geo bool `json:"geo"` // Use the user agent's language in the cache key. Lang bool `json:"lang"` JSON setCacheSettingsRuleActionParametersCacheKeyCustomKeyUserJSON `json:"-"` }
Characteristics of the request user agent used in building the cache key.
func (*SetCacheSettingsRuleActionParametersCacheKeyCustomKeyUser) UnmarshalJSON ¶
func (r *SetCacheSettingsRuleActionParametersCacheKeyCustomKeyUser) UnmarshalJSON(data []byte) (err error)
type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyUserParam ¶
type SetCacheSettingsRuleActionParametersCacheKeyCustomKeyUserParam struct { // Use the user agent's device type in the cache key. DeviceType param.Field[bool] `json:"device_type"` // Use the user agents's country in the cache key. Geo param.Field[bool] `json:"geo"` // Use the user agent's language in the cache key. Lang param.Field[bool] `json:"lang"` }
Characteristics of the request user agent used in building the cache key.
func (SetCacheSettingsRuleActionParametersCacheKeyCustomKeyUserParam) MarshalJSON ¶
func (r SetCacheSettingsRuleActionParametersCacheKeyCustomKeyUserParam) MarshalJSON() (data []byte, err error)
type SetCacheSettingsRuleActionParametersCacheKeyParam ¶
type SetCacheSettingsRuleActionParametersCacheKeyParam struct { // Separate cached content based on the visitor’s device type CacheByDeviceType param.Field[bool] `json:"cache_by_device_type"` // Protect from web cache deception attacks while allowing static assets to be // cached CacheDeceptionArmor param.Field[bool] `json:"cache_deception_armor"` // Customize which components of the request are included or excluded from the // cache key. CustomKey param.Field[SetCacheSettingsRuleActionParametersCacheKeyCustomKeyParam] `json:"custom_key"` // Treat requests with the same query parameters the same, regardless of the order // those query parameters are in. A value of true ignores the query strings' order. IgnoreQueryStringsOrder param.Field[bool] `json:"ignore_query_strings_order"` }
Define which components of the request are included or excluded from the cache key Cloudflare uses to store the response in cache.
func (SetCacheSettingsRuleActionParametersCacheKeyParam) MarshalJSON ¶
func (r SetCacheSettingsRuleActionParametersCacheKeyParam) MarshalJSON() (data []byte, err error)
type SetCacheSettingsRuleActionParametersCacheReserve ¶
type SetCacheSettingsRuleActionParametersCacheReserve struct { // Determines whether cache reserve is enabled. If this is true and a request meets // eligibility criteria, Cloudflare will write the resource to cache reserve. Eligible bool `json:"eligible,required"` // The minimum file size eligible for store in cache reserve. MinFileSize int64 `json:"min_file_size,required"` JSON setCacheSettingsRuleActionParametersCacheReserveJSON `json:"-"` }
Mark whether the request's response from origin is eligible for Cache Reserve (requires a Cache Reserve add-on plan).
func (*SetCacheSettingsRuleActionParametersCacheReserve) UnmarshalJSON ¶
func (r *SetCacheSettingsRuleActionParametersCacheReserve) UnmarshalJSON(data []byte) (err error)
type SetCacheSettingsRuleActionParametersCacheReserveParam ¶
type SetCacheSettingsRuleActionParametersCacheReserveParam struct { // Determines whether cache reserve is enabled. If this is true and a request meets // eligibility criteria, Cloudflare will write the resource to cache reserve. Eligible param.Field[bool] `json:"eligible,required"` // The minimum file size eligible for store in cache reserve. MinFileSize param.Field[int64] `json:"min_file_size,required"` }
Mark whether the request's response from origin is eligible for Cache Reserve (requires a Cache Reserve add-on plan).
func (SetCacheSettingsRuleActionParametersCacheReserveParam) MarshalJSON ¶
func (r SetCacheSettingsRuleActionParametersCacheReserveParam) MarshalJSON() (data []byte, err error)
type SetCacheSettingsRuleActionParametersEdgeTTL ¶
type SetCacheSettingsRuleActionParametersEdgeTTL struct { // The TTL (in seconds) if you choose override_origin mode. Default int64 `json:"default,required"` // edge ttl options Mode SetCacheSettingsRuleActionParametersEdgeTTLMode `json:"mode,required"` // List of single status codes, or status code ranges to apply the selected mode StatusCodeTTL []SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTL `json:"status_code_ttl,required"` JSON setCacheSettingsRuleActionParametersEdgeTTLJSON `json:"-"` }
TTL (Time to Live) specifies the maximum time to cache a resource in the Cloudflare edge network.
func (*SetCacheSettingsRuleActionParametersEdgeTTL) UnmarshalJSON ¶
func (r *SetCacheSettingsRuleActionParametersEdgeTTL) UnmarshalJSON(data []byte) (err error)
type SetCacheSettingsRuleActionParametersEdgeTTLMode ¶
type SetCacheSettingsRuleActionParametersEdgeTTLMode string
edge ttl options
const ( SetCacheSettingsRuleActionParametersEdgeTTLModeRespectOrigin SetCacheSettingsRuleActionParametersEdgeTTLMode = "respect_origin" SetCacheSettingsRuleActionParametersEdgeTTLModeBypassByDefault SetCacheSettingsRuleActionParametersEdgeTTLMode = "bypass_by_default" SetCacheSettingsRuleActionParametersEdgeTTLModeOverrideOrigin SetCacheSettingsRuleActionParametersEdgeTTLMode = "override_origin" )
func (SetCacheSettingsRuleActionParametersEdgeTTLMode) IsKnown ¶
func (r SetCacheSettingsRuleActionParametersEdgeTTLMode) IsKnown() bool
type SetCacheSettingsRuleActionParametersEdgeTTLParam ¶
type SetCacheSettingsRuleActionParametersEdgeTTLParam struct { // The TTL (in seconds) if you choose override_origin mode. Default param.Field[int64] `json:"default,required"` // edge ttl options Mode param.Field[SetCacheSettingsRuleActionParametersEdgeTTLMode] `json:"mode,required"` // List of single status codes, or status code ranges to apply the selected mode StatusCodeTTL param.Field[[]SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTLParam] `json:"status_code_ttl,required"` }
TTL (Time to Live) specifies the maximum time to cache a resource in the Cloudflare edge network.
func (SetCacheSettingsRuleActionParametersEdgeTTLParam) MarshalJSON ¶
func (r SetCacheSettingsRuleActionParametersEdgeTTLParam) MarshalJSON() (data []byte, err error)
type SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTL ¶
type SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTL struct { // Time to cache a response (in seconds). A value of 0 is equivalent to setting the // Cache-Control header with the value "no-cache". A value of -1 is equivalent to // setting Cache-Control header with the value of "no-store". Value int64 `json:"value,required"` // The range of status codes used to apply the selected mode. StatusCodeRange SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTLStatusCodeRange `json:"status_code_range"` // Set the ttl for responses with this specific status code StatusCodeValue int64 `json:"status_code_value"` JSON setCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTLJSON `json:"-"` }
Specify how long Cloudflare should cache the response based on the status code from the origin. Can be a single status code or a range or status codes
func (*SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTL) UnmarshalJSON ¶
func (r *SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTL) UnmarshalJSON(data []byte) (err error)
type SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTLParam ¶
type SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTLParam struct { // Time to cache a response (in seconds). A value of 0 is equivalent to setting the // Cache-Control header with the value "no-cache". A value of -1 is equivalent to // setting Cache-Control header with the value of "no-store". Value param.Field[int64] `json:"value,required"` // The range of status codes used to apply the selected mode. StatusCodeRange param.Field[SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTLStatusCodeRangeParam] `json:"status_code_range"` // Set the ttl for responses with this specific status code StatusCodeValue param.Field[int64] `json:"status_code_value"` }
Specify how long Cloudflare should cache the response based on the status code from the origin. Can be a single status code or a range or status codes
func (SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTLParam) MarshalJSON ¶
func (r SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTLParam) MarshalJSON() (data []byte, err error)
type SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTLStatusCodeRange ¶
type SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTLStatusCodeRange struct { // response status code lower bound From int64 `json:"from,required"` // response status code upper bound To int64 `json:"to,required"` JSON setCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTLStatusCodeRangeJSON `json:"-"` }
The range of status codes used to apply the selected mode.
func (*SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTLStatusCodeRange) UnmarshalJSON ¶
func (r *SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTLStatusCodeRange) UnmarshalJSON(data []byte) (err error)
type SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTLStatusCodeRangeParam ¶
type SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTLStatusCodeRangeParam struct { // response status code lower bound From param.Field[int64] `json:"from,required"` // response status code upper bound To param.Field[int64] `json:"to,required"` }
The range of status codes used to apply the selected mode.
func (SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTLStatusCodeRangeParam) MarshalJSON ¶
func (r SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTLStatusCodeRangeParam) MarshalJSON() (data []byte, err error)
type SetCacheSettingsRuleActionParametersParam ¶
type SetCacheSettingsRuleActionParametersParam struct { // List of additional ports that caching can be enabled on. AdditionalCacheablePorts param.Field[[]int64] `json:"additional_cacheable_ports"` // Specify how long client browsers should cache the response. Cloudflare cache // purge will not purge content cached on client browsers, so high browser TTLs may // lead to stale content. BrowserTTL param.Field[SetCacheSettingsRuleActionParametersBrowserTTLParam] `json:"browser_ttl"` // Mark whether the request’s response from origin is eligible for caching. Caching // itself will still depend on the cache-control header and your other caching // configurations. Cache param.Field[bool] `json:"cache"` // Define which components of the request are included or excluded from the cache // key Cloudflare uses to store the response in cache. CacheKey param.Field[SetCacheSettingsRuleActionParametersCacheKeyParam] `json:"cache_key"` // Mark whether the request's response from origin is eligible for Cache Reserve // (requires a Cache Reserve add-on plan). CacheReserve param.Field[SetCacheSettingsRuleActionParametersCacheReserveParam] `json:"cache_reserve"` // TTL (Time to Live) specifies the maximum time to cache a resource in the // Cloudflare edge network. EdgeTTL param.Field[SetCacheSettingsRuleActionParametersEdgeTTLParam] `json:"edge_ttl"` // When enabled, Cloudflare will aim to strictly adhere to RFC 7234. OriginCacheControl param.Field[bool] `json:"origin_cache_control"` // Generate Cloudflare error pages from issues sent from the origin server. When // on, error pages will trigger for issues from the origin OriginErrorPagePassthru param.Field[bool] `json:"origin_error_page_passthru"` // Define a timeout value between two successive read operations to your origin // server. Historically, the timeout value between two read options from Cloudflare // to an origin server is 100 seconds. If you are attempting to reduce HTTP 524 // errors because of timeouts from an origin server, try increasing this timeout // value. ReadTimeout param.Field[int64] `json:"read_timeout"` // headers. When off, Cloudflare converts strong ETag headers to weak ETag headers. RespectStrongEtags param.Field[bool] `json:"respect_strong_etags"` // Define if Cloudflare should serve stale content while getting the latest content // from the origin. If on, Cloudflare will not serve stale content while getting // the latest content from the origin. ServeStale param.Field[SetCacheSettingsRuleActionParametersServeStaleParam] `json:"serve_stale"` }
The parameters configuring the rule's action.
func (SetCacheSettingsRuleActionParametersParam) MarshalJSON ¶
func (r SetCacheSettingsRuleActionParametersParam) MarshalJSON() (data []byte, err error)
type SetCacheSettingsRuleActionParametersServeStale ¶
type SetCacheSettingsRuleActionParametersServeStale struct { // Defines whether Cloudflare should serve stale content while updating. If true, // Cloudflare will not serve stale content while getting the latest content from // the origin. DisableStaleWhileUpdating bool `json:"disable_stale_while_updating,required"` JSON setCacheSettingsRuleActionParametersServeStaleJSON `json:"-"` }
Define if Cloudflare should serve stale content while getting the latest content from the origin. If on, Cloudflare will not serve stale content while getting the latest content from the origin.
func (*SetCacheSettingsRuleActionParametersServeStale) UnmarshalJSON ¶
func (r *SetCacheSettingsRuleActionParametersServeStale) UnmarshalJSON(data []byte) (err error)
type SetCacheSettingsRuleActionParametersServeStaleParam ¶
type SetCacheSettingsRuleActionParametersServeStaleParam struct { // Defines whether Cloudflare should serve stale content while updating. If true, // Cloudflare will not serve stale content while getting the latest content from // the origin. DisableStaleWhileUpdating param.Field[bool] `json:"disable_stale_while_updating,required"` }
Define if Cloudflare should serve stale content while getting the latest content from the origin. If on, Cloudflare will not serve stale content while getting the latest content from the origin.
func (SetCacheSettingsRuleActionParametersServeStaleParam) MarshalJSON ¶
func (r SetCacheSettingsRuleActionParametersServeStaleParam) MarshalJSON() (data []byte, err error)
type SetCacheSettingsRuleParam ¶
type SetCacheSettingsRuleParam struct { // The unique ID of the rule. ID param.Field[string] `json:"id"` // The action to perform when the rule matches. Action param.Field[SetCacheSettingsRuleAction] `json:"action"` // The parameters configuring the rule's action. ActionParameters param.Field[SetCacheSettingsRuleActionParametersParam] `json:"action_parameters"` // An informative description of the rule. Description param.Field[string] `json:"description"` // Whether the rule should be executed. Enabled param.Field[bool] `json:"enabled"` // The expression defining which traffic will match the rule. Expression param.Field[string] `json:"expression"` // An object configuring the rule's logging behavior. Logging param.Field[LoggingParam] `json:"logging"` // The reference of the rule (the rule ID by default). Ref param.Field[string] `json:"ref"` }
func (SetCacheSettingsRuleParam) MarshalJSON ¶
func (r SetCacheSettingsRuleParam) MarshalJSON() (data []byte, err error)
type SetConfigRule ¶
type SetConfigRule struct { // The timestamp of when the rule was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // The version of the rule. Version string `json:"version,required"` // The unique ID of the rule. ID string `json:"id"` // The action to perform when the rule matches. Action SetConfigRuleAction `json:"action"` // The parameters configuring the rule's action. ActionParameters SetConfigRuleActionParameters `json:"action_parameters"` // The categories of the rule. Categories []string `json:"categories"` // An informative description of the rule. Description string `json:"description"` // Whether the rule should be executed. Enabled bool `json:"enabled"` // The expression defining which traffic will match the rule. Expression string `json:"expression"` // An object configuring the rule's logging behavior. Logging Logging `json:"logging"` // The reference of the rule (the rule ID by default). Ref string `json:"ref"` JSON setConfigRuleJSON `json:"-"` }
func (*SetConfigRule) UnmarshalJSON ¶
func (r *SetConfigRule) UnmarshalJSON(data []byte) (err error)
type SetConfigRuleAction ¶
type SetConfigRuleAction string
The action to perform when the rule matches.
const (
SetConfigRuleActionSetConfig SetConfigRuleAction = "set_config"
)
func (SetConfigRuleAction) IsKnown ¶
func (r SetConfigRuleAction) IsKnown() bool
type SetConfigRuleActionParameters ¶
type SetConfigRuleActionParameters struct { // Turn on or off Automatic HTTPS Rewrites. AutomaticHTTPSRewrites bool `json:"automatic_https_rewrites"` // Select which file extensions to minify automatically. Autominify SetConfigRuleActionParametersAutominify `json:"autominify"` // Turn on or off Browser Integrity Check. Bic bool `json:"bic"` // Turn off all active Cloudflare Apps. DisableApps SetConfigRuleActionParametersDisableApps `json:"disable_apps"` // Turn off Real User Monitoring (RUM). DisableRUM SetConfigRuleActionParametersDisableRUM `json:"disable_rum"` // Turn off Zaraz. DisableZaraz SetConfigRuleActionParametersDisableZaraz `json:"disable_zaraz"` // Turn on or off Email Obfuscation. EmailObfuscation bool `json:"email_obfuscation"` // Turn on or off Cloudflare Fonts. Fonts bool `json:"fonts"` // Turn on or off the Hotlink Protection. HotlinkProtection bool `json:"hotlink_protection"` // Turn on or off Mirage. Mirage bool `json:"mirage"` // Turn on or off Opportunistic Encryption. OpportunisticEncryption bool `json:"opportunistic_encryption"` // Configure the Polish level. Polish SetConfigRuleActionParametersPolish `json:"polish"` // Turn on or off Rocket Loader RocketLoader bool `json:"rocket_loader"` // Configure the Security Level. SecurityLevel SetConfigRuleActionParametersSecurityLevel `json:"security_level"` // Turn on or off Server Side Excludes. ServerSideExcludes bool `json:"server_side_excludes"` // Configure the SSL level. SSL SetConfigRuleActionParametersSSL `json:"ssl"` // Turn on or off Signed Exchanges (SXG). Sxg bool `json:"sxg"` JSON setConfigRuleActionParametersJSON `json:"-"` }
The parameters configuring the rule's action.
func (*SetConfigRuleActionParameters) UnmarshalJSON ¶
func (r *SetConfigRuleActionParameters) UnmarshalJSON(data []byte) (err error)
type SetConfigRuleActionParametersAutominify ¶
type SetConfigRuleActionParametersAutominify struct { // Minify CSS files. Css bool `json:"css"` // Minify HTML files. HTML bool `json:"html"` // Minify JS files. JS bool `json:"js"` JSON setConfigRuleActionParametersAutominifyJSON `json:"-"` }
Select which file extensions to minify automatically.
func (*SetConfigRuleActionParametersAutominify) UnmarshalJSON ¶
func (r *SetConfigRuleActionParametersAutominify) UnmarshalJSON(data []byte) (err error)
type SetConfigRuleActionParametersAutominifyParam ¶
type SetConfigRuleActionParametersAutominifyParam struct { // Minify CSS files. Css param.Field[bool] `json:"css"` // Minify HTML files. HTML param.Field[bool] `json:"html"` // Minify JS files. JS param.Field[bool] `json:"js"` }
Select which file extensions to minify automatically.
func (SetConfigRuleActionParametersAutominifyParam) MarshalJSON ¶
func (r SetConfigRuleActionParametersAutominifyParam) MarshalJSON() (data []byte, err error)
type SetConfigRuleActionParametersDisableApps ¶
type SetConfigRuleActionParametersDisableApps bool
Turn off all active Cloudflare Apps.
const (
SetConfigRuleActionParametersDisableAppsTrue SetConfigRuleActionParametersDisableApps = true
)
func (SetConfigRuleActionParametersDisableApps) IsKnown ¶
func (r SetConfigRuleActionParametersDisableApps) IsKnown() bool
type SetConfigRuleActionParametersDisableRUM ¶
type SetConfigRuleActionParametersDisableRUM bool
Turn off Real User Monitoring (RUM).
const (
SetConfigRuleActionParametersDisableRUMTrue SetConfigRuleActionParametersDisableRUM = true
)
func (SetConfigRuleActionParametersDisableRUM) IsKnown ¶
func (r SetConfigRuleActionParametersDisableRUM) IsKnown() bool
type SetConfigRuleActionParametersDisableZaraz ¶
type SetConfigRuleActionParametersDisableZaraz bool
Turn off Zaraz.
const (
SetConfigRuleActionParametersDisableZarazTrue SetConfigRuleActionParametersDisableZaraz = true
)
func (SetConfigRuleActionParametersDisableZaraz) IsKnown ¶
func (r SetConfigRuleActionParametersDisableZaraz) IsKnown() bool
type SetConfigRuleActionParametersParam ¶
type SetConfigRuleActionParametersParam struct { // Turn on or off Automatic HTTPS Rewrites. AutomaticHTTPSRewrites param.Field[bool] `json:"automatic_https_rewrites"` // Select which file extensions to minify automatically. Autominify param.Field[SetConfigRuleActionParametersAutominifyParam] `json:"autominify"` // Turn on or off Browser Integrity Check. Bic param.Field[bool] `json:"bic"` // Turn off all active Cloudflare Apps. DisableApps param.Field[SetConfigRuleActionParametersDisableApps] `json:"disable_apps"` // Turn off Real User Monitoring (RUM). DisableRUM param.Field[SetConfigRuleActionParametersDisableRUM] `json:"disable_rum"` // Turn off Zaraz. DisableZaraz param.Field[SetConfigRuleActionParametersDisableZaraz] `json:"disable_zaraz"` // Turn on or off Email Obfuscation. EmailObfuscation param.Field[bool] `json:"email_obfuscation"` // Turn on or off Cloudflare Fonts. Fonts param.Field[bool] `json:"fonts"` // Turn on or off the Hotlink Protection. HotlinkProtection param.Field[bool] `json:"hotlink_protection"` // Turn on or off Mirage. Mirage param.Field[bool] `json:"mirage"` // Turn on or off Opportunistic Encryption. OpportunisticEncryption param.Field[bool] `json:"opportunistic_encryption"` // Configure the Polish level. Polish param.Field[SetConfigRuleActionParametersPolish] `json:"polish"` // Turn on or off Rocket Loader RocketLoader param.Field[bool] `json:"rocket_loader"` // Configure the Security Level. SecurityLevel param.Field[SetConfigRuleActionParametersSecurityLevel] `json:"security_level"` // Turn on or off Server Side Excludes. ServerSideExcludes param.Field[bool] `json:"server_side_excludes"` // Configure the SSL level. SSL param.Field[SetConfigRuleActionParametersSSL] `json:"ssl"` // Turn on or off Signed Exchanges (SXG). Sxg param.Field[bool] `json:"sxg"` }
The parameters configuring the rule's action.
func (SetConfigRuleActionParametersParam) MarshalJSON ¶
func (r SetConfigRuleActionParametersParam) MarshalJSON() (data []byte, err error)
type SetConfigRuleActionParametersPolish ¶
type SetConfigRuleActionParametersPolish string
Configure the Polish level.
const ( SetConfigRuleActionParametersPolishOff SetConfigRuleActionParametersPolish = "off" SetConfigRuleActionParametersPolishLossless SetConfigRuleActionParametersPolish = "lossless" SetConfigRuleActionParametersPolishLossy SetConfigRuleActionParametersPolish = "lossy" )
func (SetConfigRuleActionParametersPolish) IsKnown ¶
func (r SetConfigRuleActionParametersPolish) IsKnown() bool
type SetConfigRuleActionParametersSSL ¶
type SetConfigRuleActionParametersSSL string
Configure the SSL level.
const ( SetConfigRuleActionParametersSSLOff SetConfigRuleActionParametersSSL = "off" SetConfigRuleActionParametersSSLFlexible SetConfigRuleActionParametersSSL = "flexible" SetConfigRuleActionParametersSSLFull SetConfigRuleActionParametersSSL = "full" SetConfigRuleActionParametersSSLStrict SetConfigRuleActionParametersSSL = "strict" SetConfigRuleActionParametersSSLOriginPull SetConfigRuleActionParametersSSL = "origin_pull" )
func (SetConfigRuleActionParametersSSL) IsKnown ¶
func (r SetConfigRuleActionParametersSSL) IsKnown() bool
type SetConfigRuleActionParametersSecurityLevel ¶
type SetConfigRuleActionParametersSecurityLevel string
Configure the Security Level.
const ( SetConfigRuleActionParametersSecurityLevelOff SetConfigRuleActionParametersSecurityLevel = "off" SetConfigRuleActionParametersSecurityLevelEssentiallyOff SetConfigRuleActionParametersSecurityLevel = "essentially_off" SetConfigRuleActionParametersSecurityLevelLow SetConfigRuleActionParametersSecurityLevel = "low" SetConfigRuleActionParametersSecurityLevelMedium SetConfigRuleActionParametersSecurityLevel = "medium" SetConfigRuleActionParametersSecurityLevelHigh SetConfigRuleActionParametersSecurityLevel = "high" SetConfigRuleActionParametersSecurityLevelUnderAttack SetConfigRuleActionParametersSecurityLevel = "under_attack" )
func (SetConfigRuleActionParametersSecurityLevel) IsKnown ¶
func (r SetConfigRuleActionParametersSecurityLevel) IsKnown() bool
type SetConfigRuleParam ¶
type SetConfigRuleParam struct { // The unique ID of the rule. ID param.Field[string] `json:"id"` // The action to perform when the rule matches. Action param.Field[SetConfigRuleAction] `json:"action"` // The parameters configuring the rule's action. ActionParameters param.Field[SetConfigRuleActionParametersParam] `json:"action_parameters"` // An informative description of the rule. Description param.Field[string] `json:"description"` // Whether the rule should be executed. Enabled param.Field[bool] `json:"enabled"` // The expression defining which traffic will match the rule. Expression param.Field[string] `json:"expression"` // An object configuring the rule's logging behavior. Logging param.Field[LoggingParam] `json:"logging"` // The reference of the rule (the rule ID by default). Ref param.Field[string] `json:"ref"` }
func (SetConfigRuleParam) MarshalJSON ¶
func (r SetConfigRuleParam) MarshalJSON() (data []byte, err error)
type SkipRule ¶
type SkipRule struct { // The timestamp of when the rule was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // The version of the rule. Version string `json:"version,required"` // The unique ID of the rule. ID string `json:"id"` // The action to perform when the rule matches. Action SkipRuleAction `json:"action"` // The parameters configuring the rule's action. ActionParameters SkipRuleActionParameters `json:"action_parameters"` // The categories of the rule. Categories []string `json:"categories"` // An informative description of the rule. Description string `json:"description"` // Whether the rule should be executed. Enabled bool `json:"enabled"` // The expression defining which traffic will match the rule. Expression string `json:"expression"` // An object configuring the rule's logging behavior. Logging Logging `json:"logging"` // The reference of the rule (the rule ID by default). Ref string `json:"ref"` JSON skipRuleJSON `json:"-"` }
func (*SkipRule) UnmarshalJSON ¶
type SkipRuleAction ¶
type SkipRuleAction string
The action to perform when the rule matches.
const (
SkipRuleActionSkip SkipRuleAction = "skip"
)
func (SkipRuleAction) IsKnown ¶
func (r SkipRuleAction) IsKnown() bool
type SkipRuleActionParameters ¶
type SkipRuleActionParameters struct { // A list of phases to skip the execution of. This option is incompatible with the // ruleset and rulesets options. Phases []Phase `json:"phases"` // A list of legacy security products to skip the execution of. Products []SkipRuleActionParametersProduct `json:"products"` // A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the // execution of. This option is incompatible with the ruleset option. Rules map[string][]string `json:"rules"` // A ruleset to skip the execution of. This option is incompatible with the // rulesets, rules and phases options. Ruleset SkipRuleActionParametersRuleset `json:"ruleset"` // A list of ruleset IDs to skip the execution of. This option is incompatible with // the ruleset and phases options. Rulesets []string `json:"rulesets"` JSON skipRuleActionParametersJSON `json:"-"` }
The parameters configuring the rule's action.
func (*SkipRuleActionParameters) UnmarshalJSON ¶
func (r *SkipRuleActionParameters) UnmarshalJSON(data []byte) (err error)
type SkipRuleActionParametersParam ¶
type SkipRuleActionParametersParam struct { // A list of phases to skip the execution of. This option is incompatible with the // ruleset and rulesets options. Phases param.Field[[]Phase] `json:"phases"` // A list of legacy security products to skip the execution of. Products param.Field[[]SkipRuleActionParametersProduct] `json:"products"` // A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the // execution of. This option is incompatible with the ruleset option. Rules param.Field[map[string][]string] `json:"rules"` // A ruleset to skip the execution of. This option is incompatible with the // rulesets, rules and phases options. Ruleset param.Field[SkipRuleActionParametersRuleset] `json:"ruleset"` // A list of ruleset IDs to skip the execution of. This option is incompatible with // the ruleset and phases options. Rulesets param.Field[[]string] `json:"rulesets"` }
The parameters configuring the rule's action.
func (SkipRuleActionParametersParam) MarshalJSON ¶
func (r SkipRuleActionParametersParam) MarshalJSON() (data []byte, err error)
type SkipRuleActionParametersProduct ¶
type SkipRuleActionParametersProduct string
The name of a legacy security product to skip the execution of.
const ( SkipRuleActionParametersProductBic SkipRuleActionParametersProduct = "bic" SkipRuleActionParametersProductHot SkipRuleActionParametersProduct = "hot" SkipRuleActionParametersProductRateLimit SkipRuleActionParametersProduct = "rateLimit" SkipRuleActionParametersProductSecurityLevel SkipRuleActionParametersProduct = "securityLevel" SkipRuleActionParametersProductUABlock SkipRuleActionParametersProduct = "uaBlock" SkipRuleActionParametersProductWAF SkipRuleActionParametersProduct = "waf" SkipRuleActionParametersProductZoneLockdown SkipRuleActionParametersProduct = "zoneLockdown" )
func (SkipRuleActionParametersProduct) IsKnown ¶
func (r SkipRuleActionParametersProduct) IsKnown() bool
type SkipRuleActionParametersRuleset ¶
type SkipRuleActionParametersRuleset string
A ruleset to skip the execution of. This option is incompatible with the rulesets, rules and phases options.
const (
SkipRuleActionParametersRulesetCurrent SkipRuleActionParametersRuleset = "current"
)
func (SkipRuleActionParametersRuleset) IsKnown ¶
func (r SkipRuleActionParametersRuleset) IsKnown() bool
type SkipRuleParam ¶
type SkipRuleParam struct { // The unique ID of the rule. ID param.Field[string] `json:"id"` // The action to perform when the rule matches. Action param.Field[SkipRuleAction] `json:"action"` // The parameters configuring the rule's action. ActionParameters param.Field[SkipRuleActionParametersParam] `json:"action_parameters"` // An informative description of the rule. Description param.Field[string] `json:"description"` // Whether the rule should be executed. Enabled param.Field[bool] `json:"enabled"` // The expression defining which traffic will match the rule. Expression param.Field[string] `json:"expression"` // An object configuring the rule's logging behavior. Logging param.Field[LoggingParam] `json:"logging"` // The reference of the rule (the rule ID by default). Ref param.Field[string] `json:"ref"` }
func (SkipRuleParam) MarshalJSON ¶
func (r SkipRuleParam) MarshalJSON() (data []byte, err error)
type SortDirection ¶
type SortDirection = shared.SortDirection
Direction to order DNS records in.
This is an alias to an internal type.
type VersionByTagGetResponse ¶
type VersionByTagGetResponse struct { // The unique ID of the ruleset. ID string `json:"id,required"` // The kind of the ruleset. Kind Kind `json:"kind,required"` // The timestamp of when the ruleset was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // The human-readable name of the ruleset. Name string `json:"name,required"` // The phase of the ruleset. Phase Phase `json:"phase,required"` // The list of rules in the ruleset. Rules []VersionByTagGetResponseRule `json:"rules,required"` // The version of the ruleset. Version string `json:"version,required"` // An informative description of the ruleset. Description string `json:"description"` JSON versionByTagGetResponseJSON `json:"-"` }
A ruleset object.
func (*VersionByTagGetResponse) UnmarshalJSON ¶
func (r *VersionByTagGetResponse) UnmarshalJSON(data []byte) (err error)
type VersionByTagGetResponseEnvelope ¶
type VersionByTagGetResponseEnvelope struct { // A list of error messages. Errors []VersionByTagGetResponseEnvelopeErrors `json:"errors,required"` // A list of warning messages. Messages []VersionByTagGetResponseEnvelopeMessages `json:"messages,required"` // A ruleset object. Result VersionByTagGetResponse `json:"result,required"` // Whether the API call was successful. Success VersionByTagGetResponseEnvelopeSuccess `json:"success,required"` JSON versionByTagGetResponseEnvelopeJSON `json:"-"` }
A response object.
func (*VersionByTagGetResponseEnvelope) UnmarshalJSON ¶
func (r *VersionByTagGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type VersionByTagGetResponseEnvelopeErrors ¶
type VersionByTagGetResponseEnvelopeErrors struct { // A text description of this message. Message string `json:"message,required"` // A unique code for this message. Code int64 `json:"code"` // The source of this message. Source VersionByTagGetResponseEnvelopeErrorsSource `json:"source"` JSON versionByTagGetResponseEnvelopeErrorsJSON `json:"-"` }
A message.
func (*VersionByTagGetResponseEnvelopeErrors) UnmarshalJSON ¶
func (r *VersionByTagGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)
type VersionByTagGetResponseEnvelopeErrorsSource ¶
type VersionByTagGetResponseEnvelopeErrorsSource struct { // A JSON pointer to the field that is the source of the message. Pointer string `json:"pointer,required"` JSON versionByTagGetResponseEnvelopeErrorsSourceJSON `json:"-"` }
The source of this message.
func (*VersionByTagGetResponseEnvelopeErrorsSource) UnmarshalJSON ¶
func (r *VersionByTagGetResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error)
type VersionByTagGetResponseEnvelopeMessages ¶
type VersionByTagGetResponseEnvelopeMessages struct { // A text description of this message. Message string `json:"message,required"` // A unique code for this message. Code int64 `json:"code"` // The source of this message. Source VersionByTagGetResponseEnvelopeMessagesSource `json:"source"` JSON versionByTagGetResponseEnvelopeMessagesJSON `json:"-"` }
A message.
func (*VersionByTagGetResponseEnvelopeMessages) UnmarshalJSON ¶
func (r *VersionByTagGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)
type VersionByTagGetResponseEnvelopeMessagesSource ¶
type VersionByTagGetResponseEnvelopeMessagesSource struct { // A JSON pointer to the field that is the source of the message. Pointer string `json:"pointer,required"` JSON versionByTagGetResponseEnvelopeMessagesSourceJSON `json:"-"` }
The source of this message.
func (*VersionByTagGetResponseEnvelopeMessagesSource) UnmarshalJSON ¶
func (r *VersionByTagGetResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error)
type VersionByTagGetResponseEnvelopeSuccess ¶
type VersionByTagGetResponseEnvelopeSuccess bool
Whether the API call was successful.
const (
VersionByTagGetResponseEnvelopeSuccessTrue VersionByTagGetResponseEnvelopeSuccess = true
)
func (VersionByTagGetResponseEnvelopeSuccess) IsKnown ¶
func (r VersionByTagGetResponseEnvelopeSuccess) IsKnown() bool
type VersionByTagGetResponseRule ¶
type VersionByTagGetResponseRule struct { // The action to perform when the rule matches. Action VersionByTagGetResponseRulesAction `json:"action"` // This field can have the runtime type of [BlockRuleActionParameters], // [interface{}], [CompressResponseRuleActionParameters], // [ExecuteRuleActionParameters], [RedirectRuleActionParameters], // [RewriteRuleActionParameters], [RouteRuleActionParameters], // [ScoreRuleActionParameters], [ServeErrorRuleActionParameters], // [SetConfigRuleActionParameters], [SkipRuleActionParameters], // [SetCacheSettingsRuleActionParameters], [LogCustomFieldRuleActionParameters]. ActionParameters interface{} `json:"action_parameters,required"` // This field can have the runtime type of [[]string]. Categories interface{} `json:"categories,required"` // An informative description of the rule. Description string `json:"description"` // Whether the rule should be executed. Enabled bool `json:"enabled"` // The expression defining which traffic will match the rule. Expression string `json:"expression"` // The unique ID of the rule. ID string `json:"id"` // The timestamp of when the rule was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // An object configuring the rule's logging behavior. Logging Logging `json:"logging"` // The reference of the rule (the rule ID by default). Ref string `json:"ref"` // The version of the rule. Version string `json:"version,required"` JSON versionByTagGetResponseRuleJSON `json:"-"` // contains filtered or unexported fields }
func (VersionByTagGetResponseRule) AsUnion ¶
func (r VersionByTagGetResponseRule) AsUnion() VersionByTagGetResponseRulesUnion
AsUnion returns a VersionByTagGetResponseRulesUnion interface which you can cast to the specific types for more type safety.
Possible runtime types of the union are rulesets.BlockRule, rulesets.ChallengeRule, rulesets.CompressResponseRule, rulesets.ExecuteRule, rulesets.JSChallengeRule, rulesets.LogRule, rulesets.ManagedChallengeRule, rulesets.RedirectRule, rulesets.RewriteRule, rulesets.RouteRule, rulesets.ScoreRule, rulesets.ServeErrorRule, rulesets.SetConfigRule, rulesets.SkipRule, rulesets.SetCacheSettingsRule, rulesets.LogCustomFieldRule, rulesets.DDoSDynamicRule, rulesets.ForceConnectionCloseRule.
func (*VersionByTagGetResponseRule) UnmarshalJSON ¶
func (r *VersionByTagGetResponseRule) UnmarshalJSON(data []byte) (err error)
type VersionByTagGetResponseRulesAction ¶
type VersionByTagGetResponseRulesAction string
The action to perform when the rule matches.
const ( VersionByTagGetResponseRulesActionBlock VersionByTagGetResponseRulesAction = "block" VersionByTagGetResponseRulesActionChallenge VersionByTagGetResponseRulesAction = "challenge" VersionByTagGetResponseRulesActionCompressResponse VersionByTagGetResponseRulesAction = "compress_response" VersionByTagGetResponseRulesActionExecute VersionByTagGetResponseRulesAction = "execute" VersionByTagGetResponseRulesActionJSChallenge VersionByTagGetResponseRulesAction = "js_challenge" VersionByTagGetResponseRulesActionLog VersionByTagGetResponseRulesAction = "log" VersionByTagGetResponseRulesActionManagedChallenge VersionByTagGetResponseRulesAction = "managed_challenge" VersionByTagGetResponseRulesActionRedirect VersionByTagGetResponseRulesAction = "redirect" VersionByTagGetResponseRulesActionRewrite VersionByTagGetResponseRulesAction = "rewrite" VersionByTagGetResponseRulesActionRoute VersionByTagGetResponseRulesAction = "route" VersionByTagGetResponseRulesActionScore VersionByTagGetResponseRulesAction = "score" VersionByTagGetResponseRulesActionServeError VersionByTagGetResponseRulesAction = "serve_error" VersionByTagGetResponseRulesActionSetConfig VersionByTagGetResponseRulesAction = "set_config" VersionByTagGetResponseRulesActionSkip VersionByTagGetResponseRulesAction = "skip" VersionByTagGetResponseRulesActionSetCacheSettings VersionByTagGetResponseRulesAction = "set_cache_settings" VersionByTagGetResponseRulesActionLogCustomField VersionByTagGetResponseRulesAction = "log_custom_field" VersionByTagGetResponseRulesActionDDoSDynamic VersionByTagGetResponseRulesAction = "ddos_dynamic" VersionByTagGetResponseRulesActionForceConnectionClose VersionByTagGetResponseRulesAction = "force_connection_close" )
func (VersionByTagGetResponseRulesAction) IsKnown ¶
func (r VersionByTagGetResponseRulesAction) IsKnown() bool
type VersionByTagGetResponseRulesUnion ¶
type VersionByTagGetResponseRulesUnion interface {
// contains filtered or unexported methods
}
Union satisfied by rulesets.BlockRule, rulesets.ChallengeRule, rulesets.CompressResponseRule, rulesets.ExecuteRule, rulesets.JSChallengeRule, rulesets.LogRule, rulesets.ManagedChallengeRule, rulesets.RedirectRule, rulesets.RewriteRule, rulesets.RouteRule, rulesets.ScoreRule, rulesets.ServeErrorRule, rulesets.SetConfigRule, rulesets.SkipRule, rulesets.SetCacheSettingsRule, rulesets.LogCustomFieldRule, rulesets.DDoSDynamicRule or rulesets.ForceConnectionCloseRule.
type VersionByTagService ¶
type VersionByTagService struct {
Options []option.RequestOption
}
VersionByTagService contains methods and other services that help with interacting with the testcloudflare API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewVersionByTagService method instead.
func NewVersionByTagService ¶
func NewVersionByTagService(opts ...option.RequestOption) (r *VersionByTagService)
NewVersionByTagService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*VersionByTagService) Get ¶
func (r *VersionByTagService) Get(ctx context.Context, accountID string, rulesetID string, rulesetVersion string, ruleTag string, opts ...option.RequestOption) (res *VersionByTagGetResponse, err error)
Fetches the rules of a managed account ruleset version for a given tag.
type VersionGetResponse ¶
type VersionGetResponse struct { // The unique ID of the ruleset. ID string `json:"id,required"` // The kind of the ruleset. Kind Kind `json:"kind,required"` // The timestamp of when the ruleset was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // The human-readable name of the ruleset. Name string `json:"name,required"` // The phase of the ruleset. Phase Phase `json:"phase,required"` // The list of rules in the ruleset. Rules []VersionGetResponseRule `json:"rules,required"` // The version of the ruleset. Version string `json:"version,required"` // An informative description of the ruleset. Description string `json:"description"` JSON versionGetResponseJSON `json:"-"` }
A ruleset object.
func (*VersionGetResponse) UnmarshalJSON ¶
func (r *VersionGetResponse) UnmarshalJSON(data []byte) (err error)
type VersionGetResponseEnvelope ¶
type VersionGetResponseEnvelope struct { // A list of error messages. Errors []VersionGetResponseEnvelopeErrors `json:"errors,required"` // A list of warning messages. Messages []VersionGetResponseEnvelopeMessages `json:"messages,required"` // A ruleset object. Result VersionGetResponse `json:"result,required"` // Whether the API call was successful. Success VersionGetResponseEnvelopeSuccess `json:"success,required"` JSON versionGetResponseEnvelopeJSON `json:"-"` }
A response object.
func (*VersionGetResponseEnvelope) UnmarshalJSON ¶
func (r *VersionGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type VersionGetResponseEnvelopeErrors ¶
type VersionGetResponseEnvelopeErrors struct { // A text description of this message. Message string `json:"message,required"` // A unique code for this message. Code int64 `json:"code"` // The source of this message. Source VersionGetResponseEnvelopeErrorsSource `json:"source"` JSON versionGetResponseEnvelopeErrorsJSON `json:"-"` }
A message.
func (*VersionGetResponseEnvelopeErrors) UnmarshalJSON ¶
func (r *VersionGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)
type VersionGetResponseEnvelopeErrorsSource ¶
type VersionGetResponseEnvelopeErrorsSource struct { // A JSON pointer to the field that is the source of the message. Pointer string `json:"pointer,required"` JSON versionGetResponseEnvelopeErrorsSourceJSON `json:"-"` }
The source of this message.
func (*VersionGetResponseEnvelopeErrorsSource) UnmarshalJSON ¶
func (r *VersionGetResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error)
type VersionGetResponseEnvelopeMessages ¶
type VersionGetResponseEnvelopeMessages struct { // A text description of this message. Message string `json:"message,required"` // A unique code for this message. Code int64 `json:"code"` // The source of this message. Source VersionGetResponseEnvelopeMessagesSource `json:"source"` JSON versionGetResponseEnvelopeMessagesJSON `json:"-"` }
A message.
func (*VersionGetResponseEnvelopeMessages) UnmarshalJSON ¶
func (r *VersionGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)
type VersionGetResponseEnvelopeMessagesSource ¶
type VersionGetResponseEnvelopeMessagesSource struct { // A JSON pointer to the field that is the source of the message. Pointer string `json:"pointer,required"` JSON versionGetResponseEnvelopeMessagesSourceJSON `json:"-"` }
The source of this message.
func (*VersionGetResponseEnvelopeMessagesSource) UnmarshalJSON ¶
func (r *VersionGetResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error)
type VersionGetResponseEnvelopeSuccess ¶
type VersionGetResponseEnvelopeSuccess bool
Whether the API call was successful.
const (
VersionGetResponseEnvelopeSuccessTrue VersionGetResponseEnvelopeSuccess = true
)
func (VersionGetResponseEnvelopeSuccess) IsKnown ¶
func (r VersionGetResponseEnvelopeSuccess) IsKnown() bool
type VersionGetResponseRule ¶
type VersionGetResponseRule struct { // The action to perform when the rule matches. Action VersionGetResponseRulesAction `json:"action"` // This field can have the runtime type of [BlockRuleActionParameters], // [interface{}], [CompressResponseRuleActionParameters], // [ExecuteRuleActionParameters], [RedirectRuleActionParameters], // [RewriteRuleActionParameters], [RouteRuleActionParameters], // [ScoreRuleActionParameters], [ServeErrorRuleActionParameters], // [SetConfigRuleActionParameters], [SkipRuleActionParameters], // [SetCacheSettingsRuleActionParameters], [LogCustomFieldRuleActionParameters]. ActionParameters interface{} `json:"action_parameters,required"` // This field can have the runtime type of [[]string]. Categories interface{} `json:"categories,required"` // An informative description of the rule. Description string `json:"description"` // Whether the rule should be executed. Enabled bool `json:"enabled"` // The expression defining which traffic will match the rule. Expression string `json:"expression"` // The unique ID of the rule. ID string `json:"id"` // The timestamp of when the rule was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // An object configuring the rule's logging behavior. Logging Logging `json:"logging"` // The reference of the rule (the rule ID by default). Ref string `json:"ref"` // The version of the rule. Version string `json:"version,required"` JSON versionGetResponseRuleJSON `json:"-"` // contains filtered or unexported fields }
func (VersionGetResponseRule) AsUnion ¶
func (r VersionGetResponseRule) AsUnion() VersionGetResponseRulesUnion
AsUnion returns a VersionGetResponseRulesUnion interface which you can cast to the specific types for more type safety.
Possible runtime types of the union are rulesets.BlockRule, rulesets.ChallengeRule, rulesets.CompressResponseRule, rulesets.ExecuteRule, rulesets.JSChallengeRule, rulesets.LogRule, rulesets.ManagedChallengeRule, rulesets.RedirectRule, rulesets.RewriteRule, rulesets.RouteRule, rulesets.ScoreRule, rulesets.ServeErrorRule, rulesets.SetConfigRule, rulesets.SkipRule, rulesets.SetCacheSettingsRule, rulesets.LogCustomFieldRule, rulesets.DDoSDynamicRule, rulesets.ForceConnectionCloseRule.
func (*VersionGetResponseRule) UnmarshalJSON ¶
func (r *VersionGetResponseRule) UnmarshalJSON(data []byte) (err error)
type VersionGetResponseRulesAction ¶
type VersionGetResponseRulesAction string
The action to perform when the rule matches.
const ( VersionGetResponseRulesActionBlock VersionGetResponseRulesAction = "block" VersionGetResponseRulesActionChallenge VersionGetResponseRulesAction = "challenge" VersionGetResponseRulesActionCompressResponse VersionGetResponseRulesAction = "compress_response" VersionGetResponseRulesActionExecute VersionGetResponseRulesAction = "execute" VersionGetResponseRulesActionJSChallenge VersionGetResponseRulesAction = "js_challenge" VersionGetResponseRulesActionLog VersionGetResponseRulesAction = "log" VersionGetResponseRulesActionManagedChallenge VersionGetResponseRulesAction = "managed_challenge" VersionGetResponseRulesActionRedirect VersionGetResponseRulesAction = "redirect" VersionGetResponseRulesActionRewrite VersionGetResponseRulesAction = "rewrite" VersionGetResponseRulesActionRoute VersionGetResponseRulesAction = "route" VersionGetResponseRulesActionScore VersionGetResponseRulesAction = "score" VersionGetResponseRulesActionServeError VersionGetResponseRulesAction = "serve_error" VersionGetResponseRulesActionSetConfig VersionGetResponseRulesAction = "set_config" VersionGetResponseRulesActionSkip VersionGetResponseRulesAction = "skip" VersionGetResponseRulesActionSetCacheSettings VersionGetResponseRulesAction = "set_cache_settings" VersionGetResponseRulesActionLogCustomField VersionGetResponseRulesAction = "log_custom_field" VersionGetResponseRulesActionDDoSDynamic VersionGetResponseRulesAction = "ddos_dynamic" VersionGetResponseRulesActionForceConnectionClose VersionGetResponseRulesAction = "force_connection_close" )
func (VersionGetResponseRulesAction) IsKnown ¶
func (r VersionGetResponseRulesAction) IsKnown() bool
type VersionGetResponseRulesUnion ¶
type VersionGetResponseRulesUnion interface {
// contains filtered or unexported methods
}
Union satisfied by rulesets.BlockRule, rulesets.ChallengeRule, rulesets.CompressResponseRule, rulesets.ExecuteRule, rulesets.JSChallengeRule, rulesets.LogRule, rulesets.ManagedChallengeRule, rulesets.RedirectRule, rulesets.RewriteRule, rulesets.RouteRule, rulesets.ScoreRule, rulesets.ServeErrorRule, rulesets.SetConfigRule, rulesets.SkipRule, rulesets.SetCacheSettingsRule, rulesets.LogCustomFieldRule, rulesets.DDoSDynamicRule or rulesets.ForceConnectionCloseRule.
type VersionListResponse ¶
type VersionListResponse struct { // The unique ID of the ruleset. ID string `json:"id,required"` // The kind of the ruleset. Kind Kind `json:"kind,required"` // The timestamp of when the ruleset was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // The human-readable name of the ruleset. Name string `json:"name,required"` // The phase of the ruleset. Phase Phase `json:"phase,required"` // The version of the ruleset. Version string `json:"version,required"` // An informative description of the ruleset. Description string `json:"description"` JSON versionListResponseJSON `json:"-"` }
A ruleset object.
func (*VersionListResponse) UnmarshalJSON ¶
func (r *VersionListResponse) UnmarshalJSON(data []byte) (err error)
type VersionService ¶
type VersionService struct { Options []option.RequestOption ByTag *VersionByTagService }
VersionService contains methods and other services that help with interacting with the testcloudflare API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewVersionService method instead.
func NewVersionService ¶
func NewVersionService(opts ...option.RequestOption) (r *VersionService)
NewVersionService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*VersionService) Delete ¶
func (r *VersionService) Delete(ctx context.Context, accountOrZone string, accountOrZoneID string, rulesetID string, rulesetVersion string, opts ...option.RequestOption) (err error)
Deletes an existing version of an account or zone ruleset.
func (*VersionService) Get ¶
func (r *VersionService) Get(ctx context.Context, accountOrZone string, accountOrZoneID string, rulesetID string, rulesetVersion string, opts ...option.RequestOption) (res *VersionGetResponse, err error)
Fetches a specific version of an account or zone ruleset.
func (*VersionService) List ¶
func (r *VersionService) List(ctx context.Context, accountOrZone string, accountOrZoneID string, rulesetID string, opts ...option.RequestOption) (res *pagination.SinglePage[VersionListResponse], err error)
Fetches the versions of an account or zone ruleset.
func (*VersionService) ListAutoPaging ¶
func (r *VersionService) ListAutoPaging(ctx context.Context, accountOrZone string, accountOrZoneID string, rulesetID string, opts ...option.RequestOption) *pagination.SinglePageAutoPager[VersionListResponse]
Fetches the versions of an account or zone ruleset.