pagerules

package
v2.0.0-beta.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error = apierror.Error

type PageruleDeleteParams

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

type PageruleDeleteResponse

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

func (*PageruleDeleteResponse) UnmarshalJSON

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

type PageruleDeleteResponseEnvelope

type PageruleDeleteResponseEnvelope struct {
	Errors   []PageruleDeleteResponseEnvelopeErrors   `json:"errors,required"`
	Messages []PageruleDeleteResponseEnvelopeMessages `json:"messages,required"`
	Result   PageruleDeleteResponse                   `json:"result,required,nullable"`
	// Whether the API call was successful
	Success PageruleDeleteResponseEnvelopeSuccess `json:"success,required"`
	JSON    pageruleDeleteResponseEnvelopeJSON    `json:"-"`
}

func (*PageruleDeleteResponseEnvelope) UnmarshalJSON

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

type PageruleDeleteResponseEnvelopeErrors

type PageruleDeleteResponseEnvelopeErrors struct {
	Code    int64                                    `json:"code,required"`
	Message string                                   `json:"message,required"`
	JSON    pageruleDeleteResponseEnvelopeErrorsJSON `json:"-"`
}

func (*PageruleDeleteResponseEnvelopeErrors) UnmarshalJSON

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

type PageruleDeleteResponseEnvelopeMessages

type PageruleDeleteResponseEnvelopeMessages struct {
	Code    int64                                      `json:"code,required"`
	Message string                                     `json:"message,required"`
	JSON    pageruleDeleteResponseEnvelopeMessagesJSON `json:"-"`
}

func (*PageruleDeleteResponseEnvelopeMessages) UnmarshalJSON

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

type PageruleDeleteResponseEnvelopeSuccess

type PageruleDeleteResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	PageruleDeleteResponseEnvelopeSuccessTrue PageruleDeleteResponseEnvelopeSuccess = true
)

type PageruleEditParams

type PageruleEditParams struct {
	// Identifier
	ZoneID param.Field[string] `path:"zone_id,required"`
	// The set of actions to perform if the targets of this rule match the request.
	// Actions can redirect to another URL or override settings, but not both.
	Actions param.Field[[]PageruleEditParamsAction] `json:"actions"`
	// The priority of the rule, used to define which Page Rule is processed over
	// another. A higher number indicates a higher priority. For example, if you have a
	// catch-all Page Rule (rule A: `/images/*`) but want a more specific Page Rule to
	// take precedence (rule B: `/images/special/*`), specify a higher priority for
	// rule B so it overrides rule A.
	Priority param.Field[int64] `json:"priority"`
	// The status of the Page Rule.
	Status param.Field[PageruleEditParamsStatus] `json:"status"`
	// The rule targets to evaluate on each request.
	Targets param.Field[[]PageruleEditParamsTarget] `json:"targets"`
}

func (PageruleEditParams) MarshalJSON

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

type PageruleEditParamsAction

type PageruleEditParamsAction struct {
	// The type of route.
	Name  param.Field[PageruleEditParamsActionsName]  `json:"name"`
	Value param.Field[PageruleEditParamsActionsValue] `json:"value"`
}

func (PageruleEditParamsAction) MarshalJSON

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

type PageruleEditParamsActionsName

type PageruleEditParamsActionsName string

The type of route.

const (
	PageruleEditParamsActionsNameForwardURL PageruleEditParamsActionsName = "forward_url"
)

type PageruleEditParamsActionsValue

type PageruleEditParamsActionsValue struct {
	// The response type for the URL redirect.
	Type param.Field[PageruleEditParamsActionsValueType] `json:"type"`
	// The URL to redirect the request to. Notes: ${num} refers to the position of '\*'
	// in the constraint value.
	URL param.Field[string] `json:"url"`
}

func (PageruleEditParamsActionsValue) MarshalJSON

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

type PageruleEditParamsActionsValueType

type PageruleEditParamsActionsValueType string

The response type for the URL redirect.

const (
	PageruleEditParamsActionsValueTypeTemporary PageruleEditParamsActionsValueType = "temporary"
	PageruleEditParamsActionsValueTypePermanent PageruleEditParamsActionsValueType = "permanent"
)

type PageruleEditParamsStatus

type PageruleEditParamsStatus string

The status of the Page Rule.

const (
	PageruleEditParamsStatusActive   PageruleEditParamsStatus = "active"
	PageruleEditParamsStatusDisabled PageruleEditParamsStatus = "disabled"
)

type PageruleEditParamsTarget

type PageruleEditParamsTarget struct {
	// String constraint.
	Constraint param.Field[PageruleEditParamsTargetsConstraint] `json:"constraint,required"`
	// A target based on the URL of the request.
	Target param.Field[PageruleEditParamsTargetsTarget] `json:"target,required"`
}

A request condition target.

func (PageruleEditParamsTarget) MarshalJSON

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

type PageruleEditParamsTargetsConstraint

type PageruleEditParamsTargetsConstraint struct {
	// The matches operator can use asterisks and pipes as wildcard and 'or' operators.
	Operator param.Field[PageruleEditParamsTargetsConstraintOperator] `json:"operator,required"`
	// The URL pattern to match against the current request. The pattern may contain up
	// to four asterisks ('\*') as placeholders.
	Value param.Field[string] `json:"value,required"`
}

String constraint.

func (PageruleEditParamsTargetsConstraint) MarshalJSON

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

type PageruleEditParamsTargetsConstraintOperator

type PageruleEditParamsTargetsConstraintOperator string

The matches operator can use asterisks and pipes as wildcard and 'or' operators.

const (
	PageruleEditParamsTargetsConstraintOperatorMatches    PageruleEditParamsTargetsConstraintOperator = "matches"
	PageruleEditParamsTargetsConstraintOperatorContains   PageruleEditParamsTargetsConstraintOperator = "contains"
	PageruleEditParamsTargetsConstraintOperatorEquals     PageruleEditParamsTargetsConstraintOperator = "equals"
	PageruleEditParamsTargetsConstraintOperatorNotEqual   PageruleEditParamsTargetsConstraintOperator = "not_equal"
	PageruleEditParamsTargetsConstraintOperatorNotContain PageruleEditParamsTargetsConstraintOperator = "not_contain"
)

type PageruleEditParamsTargetsTarget

type PageruleEditParamsTargetsTarget string

A target based on the URL of the request.

const (
	PageruleEditParamsTargetsTargetURL PageruleEditParamsTargetsTarget = "url"
)

type PageruleEditResponse

type PageruleEditResponse interface {
	ImplementsPagerulesPageruleEditResponse()
}

Union satisfied by pagerules.PageruleEditResponseUnknown or shared.UnionString.

type PageruleEditResponseEnvelope

type PageruleEditResponseEnvelope struct {
	Errors   []PageruleEditResponseEnvelopeErrors   `json:"errors,required"`
	Messages []PageruleEditResponseEnvelopeMessages `json:"messages,required"`
	Result   PageruleEditResponse                   `json:"result,required"`
	// Whether the API call was successful
	Success PageruleEditResponseEnvelopeSuccess `json:"success,required"`
	JSON    pageruleEditResponseEnvelopeJSON    `json:"-"`
}

func (*PageruleEditResponseEnvelope) UnmarshalJSON

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

type PageruleEditResponseEnvelopeErrors

type PageruleEditResponseEnvelopeErrors struct {
	Code    int64                                  `json:"code,required"`
	Message string                                 `json:"message,required"`
	JSON    pageruleEditResponseEnvelopeErrorsJSON `json:"-"`
}

func (*PageruleEditResponseEnvelopeErrors) UnmarshalJSON

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

type PageruleEditResponseEnvelopeMessages

type PageruleEditResponseEnvelopeMessages struct {
	Code    int64                                    `json:"code,required"`
	Message string                                   `json:"message,required"`
	JSON    pageruleEditResponseEnvelopeMessagesJSON `json:"-"`
}

func (*PageruleEditResponseEnvelopeMessages) UnmarshalJSON

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

type PageruleEditResponseEnvelopeSuccess

type PageruleEditResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	PageruleEditResponseEnvelopeSuccessTrue PageruleEditResponseEnvelopeSuccess = true
)

type PageruleGetParams

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

type PageruleGetResponse

type PageruleGetResponse interface {
	ImplementsPagerulesPageruleGetResponse()
}

Union satisfied by pagerules.PageruleGetResponseUnknown or shared.UnionString.

type PageruleGetResponseEnvelope

type PageruleGetResponseEnvelope struct {
	Errors   []PageruleGetResponseEnvelopeErrors   `json:"errors,required"`
	Messages []PageruleGetResponseEnvelopeMessages `json:"messages,required"`
	Result   PageruleGetResponse                   `json:"result,required"`
	// Whether the API call was successful
	Success PageruleGetResponseEnvelopeSuccess `json:"success,required"`
	JSON    pageruleGetResponseEnvelopeJSON    `json:"-"`
}

func (*PageruleGetResponseEnvelope) UnmarshalJSON

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

type PageruleGetResponseEnvelopeErrors

type PageruleGetResponseEnvelopeErrors struct {
	Code    int64                                 `json:"code,required"`
	Message string                                `json:"message,required"`
	JSON    pageruleGetResponseEnvelopeErrorsJSON `json:"-"`
}

func (*PageruleGetResponseEnvelopeErrors) UnmarshalJSON

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

type PageruleGetResponseEnvelopeMessages

type PageruleGetResponseEnvelopeMessages struct {
	Code    int64                                   `json:"code,required"`
	Message string                                  `json:"message,required"`
	JSON    pageruleGetResponseEnvelopeMessagesJSON `json:"-"`
}

func (*PageruleGetResponseEnvelopeMessages) UnmarshalJSON

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

type PageruleGetResponseEnvelopeSuccess

type PageruleGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	PageruleGetResponseEnvelopeSuccessTrue PageruleGetResponseEnvelopeSuccess = true
)

type PageruleListParams

type PageruleListParams struct {
	// Identifier
	ZoneID param.Field[string] `path:"zone_id,required"`
	// The direction used to sort returned Page Rules.
	Direction param.Field[PageruleListParamsDirection] `query:"direction"`
	// When set to `all`, all the search requirements must match. When set to `any`,
	// only one of the search requirements has to match.
	Match param.Field[PageruleListParamsMatch] `query:"match"`
	// The field used to sort returned Page Rules.
	Order param.Field[PageruleListParamsOrder] `query:"order"`
	// The status of the Page Rule.
	Status param.Field[PageruleListParamsStatus] `query:"status"`
}

func (PageruleListParams) URLQuery

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

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

type PageruleListParamsDirection

type PageruleListParamsDirection string

The direction used to sort returned Page Rules.

const (
	PageruleListParamsDirectionAsc  PageruleListParamsDirection = "asc"
	PageruleListParamsDirectionDesc PageruleListParamsDirection = "desc"
)

type PageruleListParamsMatch

type PageruleListParamsMatch string

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

const (
	PageruleListParamsMatchAny PageruleListParamsMatch = "any"
	PageruleListParamsMatchAll PageruleListParamsMatch = "all"
)

type PageruleListParamsOrder

type PageruleListParamsOrder string

The field used to sort returned Page Rules.

const (
	PageruleListParamsOrderStatus   PageruleListParamsOrder = "status"
	PageruleListParamsOrderPriority PageruleListParamsOrder = "priority"
)

type PageruleListParamsStatus

type PageruleListParamsStatus string

The status of the Page Rule.

const (
	PageruleListParamsStatusActive   PageruleListParamsStatus = "active"
	PageruleListParamsStatusDisabled PageruleListParamsStatus = "disabled"
)

type PageruleListResponseEnvelope

type PageruleListResponseEnvelope struct {
	Errors   []PageruleListResponseEnvelopeErrors   `json:"errors,required"`
	Messages []PageruleListResponseEnvelopeMessages `json:"messages,required"`
	Result   []ZonesPageRule                        `json:"result,required"`
	// Whether the API call was successful
	Success PageruleListResponseEnvelopeSuccess `json:"success,required"`
	JSON    pageruleListResponseEnvelopeJSON    `json:"-"`
}

func (*PageruleListResponseEnvelope) UnmarshalJSON

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

type PageruleListResponseEnvelopeErrors

type PageruleListResponseEnvelopeErrors struct {
	Code    int64                                  `json:"code,required"`
	Message string                                 `json:"message,required"`
	JSON    pageruleListResponseEnvelopeErrorsJSON `json:"-"`
}

func (*PageruleListResponseEnvelopeErrors) UnmarshalJSON

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

type PageruleListResponseEnvelopeMessages

type PageruleListResponseEnvelopeMessages struct {
	Code    int64                                    `json:"code,required"`
	Message string                                   `json:"message,required"`
	JSON    pageruleListResponseEnvelopeMessagesJSON `json:"-"`
}

func (*PageruleListResponseEnvelopeMessages) UnmarshalJSON

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

type PageruleListResponseEnvelopeSuccess

type PageruleListResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	PageruleListResponseEnvelopeSuccessTrue PageruleListResponseEnvelopeSuccess = true
)

type PageruleNewParams

type PageruleNewParams struct {
	// Identifier
	ZoneID param.Field[string] `path:"zone_id,required"`
	// The set of actions to perform if the targets of this rule match the request.
	// Actions can redirect to another URL or override settings, but not both.
	Actions param.Field[[]PageruleNewParamsAction] `json:"actions,required"`
	// The rule targets to evaluate on each request.
	Targets param.Field[[]PageruleNewParamsTarget] `json:"targets,required"`
	// The priority of the rule, used to define which Page Rule is processed over
	// another. A higher number indicates a higher priority. For example, if you have a
	// catch-all Page Rule (rule A: `/images/*`) but want a more specific Page Rule to
	// take precedence (rule B: `/images/special/*`), specify a higher priority for
	// rule B so it overrides rule A.
	Priority param.Field[int64] `json:"priority"`
	// The status of the Page Rule.
	Status param.Field[PageruleNewParamsStatus] `json:"status"`
}

func (PageruleNewParams) MarshalJSON

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

type PageruleNewParamsAction

type PageruleNewParamsAction struct {
	// The type of route.
	Name  param.Field[PageruleNewParamsActionsName]  `json:"name"`
	Value param.Field[PageruleNewParamsActionsValue] `json:"value"`
}

func (PageruleNewParamsAction) MarshalJSON

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

type PageruleNewParamsActionsName

type PageruleNewParamsActionsName string

The type of route.

const (
	PageruleNewParamsActionsNameForwardURL PageruleNewParamsActionsName = "forward_url"
)

type PageruleNewParamsActionsValue

type PageruleNewParamsActionsValue struct {
	// The response type for the URL redirect.
	Type param.Field[PageruleNewParamsActionsValueType] `json:"type"`
	// The URL to redirect the request to. Notes: ${num} refers to the position of '\*'
	// in the constraint value.
	URL param.Field[string] `json:"url"`
}

func (PageruleNewParamsActionsValue) MarshalJSON

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

type PageruleNewParamsActionsValueType

type PageruleNewParamsActionsValueType string

The response type for the URL redirect.

const (
	PageruleNewParamsActionsValueTypeTemporary PageruleNewParamsActionsValueType = "temporary"
	PageruleNewParamsActionsValueTypePermanent PageruleNewParamsActionsValueType = "permanent"
)

type PageruleNewParamsStatus

type PageruleNewParamsStatus string

The status of the Page Rule.

const (
	PageruleNewParamsStatusActive   PageruleNewParamsStatus = "active"
	PageruleNewParamsStatusDisabled PageruleNewParamsStatus = "disabled"
)

type PageruleNewParamsTarget

type PageruleNewParamsTarget struct {
	// String constraint.
	Constraint param.Field[PageruleNewParamsTargetsConstraint] `json:"constraint,required"`
	// A target based on the URL of the request.
	Target param.Field[PageruleNewParamsTargetsTarget] `json:"target,required"`
}

A request condition target.

func (PageruleNewParamsTarget) MarshalJSON

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

type PageruleNewParamsTargetsConstraint

type PageruleNewParamsTargetsConstraint struct {
	// The matches operator can use asterisks and pipes as wildcard and 'or' operators.
	Operator param.Field[PageruleNewParamsTargetsConstraintOperator] `json:"operator,required"`
	// The URL pattern to match against the current request. The pattern may contain up
	// to four asterisks ('\*') as placeholders.
	Value param.Field[string] `json:"value,required"`
}

String constraint.

func (PageruleNewParamsTargetsConstraint) MarshalJSON

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

type PageruleNewParamsTargetsConstraintOperator

type PageruleNewParamsTargetsConstraintOperator string

The matches operator can use asterisks and pipes as wildcard and 'or' operators.

const (
	PageruleNewParamsTargetsConstraintOperatorMatches    PageruleNewParamsTargetsConstraintOperator = "matches"
	PageruleNewParamsTargetsConstraintOperatorContains   PageruleNewParamsTargetsConstraintOperator = "contains"
	PageruleNewParamsTargetsConstraintOperatorEquals     PageruleNewParamsTargetsConstraintOperator = "equals"
	PageruleNewParamsTargetsConstraintOperatorNotEqual   PageruleNewParamsTargetsConstraintOperator = "not_equal"
	PageruleNewParamsTargetsConstraintOperatorNotContain PageruleNewParamsTargetsConstraintOperator = "not_contain"
)

type PageruleNewParamsTargetsTarget

type PageruleNewParamsTargetsTarget string

A target based on the URL of the request.

const (
	PageruleNewParamsTargetsTargetURL PageruleNewParamsTargetsTarget = "url"
)

type PageruleNewResponse

type PageruleNewResponse interface {
	ImplementsPagerulesPageruleNewResponse()
}

Union satisfied by pagerules.PageruleNewResponseUnknown or shared.UnionString.

type PageruleNewResponseEnvelope

type PageruleNewResponseEnvelope struct {
	Errors   []PageruleNewResponseEnvelopeErrors   `json:"errors,required"`
	Messages []PageruleNewResponseEnvelopeMessages `json:"messages,required"`
	Result   PageruleNewResponse                   `json:"result,required"`
	// Whether the API call was successful
	Success PageruleNewResponseEnvelopeSuccess `json:"success,required"`
	JSON    pageruleNewResponseEnvelopeJSON    `json:"-"`
}

func (*PageruleNewResponseEnvelope) UnmarshalJSON

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

type PageruleNewResponseEnvelopeErrors

type PageruleNewResponseEnvelopeErrors struct {
	Code    int64                                 `json:"code,required"`
	Message string                                `json:"message,required"`
	JSON    pageruleNewResponseEnvelopeErrorsJSON `json:"-"`
}

func (*PageruleNewResponseEnvelopeErrors) UnmarshalJSON

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

type PageruleNewResponseEnvelopeMessages

type PageruleNewResponseEnvelopeMessages struct {
	Code    int64                                   `json:"code,required"`
	Message string                                  `json:"message,required"`
	JSON    pageruleNewResponseEnvelopeMessagesJSON `json:"-"`
}

func (*PageruleNewResponseEnvelopeMessages) UnmarshalJSON

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

type PageruleNewResponseEnvelopeSuccess

type PageruleNewResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	PageruleNewResponseEnvelopeSuccessTrue PageruleNewResponseEnvelopeSuccess = true
)

type PageruleService

type PageruleService struct {
	Options  []option.RequestOption
	Settings *SettingService
}

PageruleService contains methods and other services that help with interacting with the cloudflare API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewPageruleService method instead.

func NewPageruleService

func NewPageruleService(opts ...option.RequestOption) (r *PageruleService)

NewPageruleService 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 (*PageruleService) Delete

func (r *PageruleService) Delete(ctx context.Context, pageruleID string, body PageruleDeleteParams, opts ...option.RequestOption) (res *PageruleDeleteResponse, err error)

Deletes an existing Page Rule.

func (*PageruleService) Edit

func (r *PageruleService) Edit(ctx context.Context, pageruleID string, params PageruleEditParams, opts ...option.RequestOption) (res *PageruleEditResponse, err error)

Updates one or more fields of an existing Page Rule.

func (*PageruleService) Get

func (r *PageruleService) Get(ctx context.Context, pageruleID string, query PageruleGetParams, opts ...option.RequestOption) (res *PageruleGetResponse, err error)

Fetches the details of a Page Rule.

func (*PageruleService) List

func (r *PageruleService) List(ctx context.Context, params PageruleListParams, opts ...option.RequestOption) (res *[]ZonesPageRule, err error)

Fetches Page Rules in a zone.

func (*PageruleService) New

Creates a new Page Rule.

func (*PageruleService) Update

func (r *PageruleService) Update(ctx context.Context, pageruleID string, params PageruleUpdateParams, opts ...option.RequestOption) (res *PageruleUpdateResponse, err error)

Replaces the configuration of an existing Page Rule. The configuration of the updated Page Rule will exactly match the data passed in the API request.

type PageruleUpdateParams

type PageruleUpdateParams struct {
	// Identifier
	ZoneID param.Field[string] `path:"zone_id,required"`
	// The set of actions to perform if the targets of this rule match the request.
	// Actions can redirect to another URL or override settings, but not both.
	Actions param.Field[[]PageruleUpdateParamsAction] `json:"actions,required"`
	// The rule targets to evaluate on each request.
	Targets param.Field[[]PageruleUpdateParamsTarget] `json:"targets,required"`
	// The priority of the rule, used to define which Page Rule is processed over
	// another. A higher number indicates a higher priority. For example, if you have a
	// catch-all Page Rule (rule A: `/images/*`) but want a more specific Page Rule to
	// take precedence (rule B: `/images/special/*`), specify a higher priority for
	// rule B so it overrides rule A.
	Priority param.Field[int64] `json:"priority"`
	// The status of the Page Rule.
	Status param.Field[PageruleUpdateParamsStatus] `json:"status"`
}

func (PageruleUpdateParams) MarshalJSON

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

type PageruleUpdateParamsAction

type PageruleUpdateParamsAction struct {
	// The type of route.
	Name  param.Field[PageruleUpdateParamsActionsName]  `json:"name"`
	Value param.Field[PageruleUpdateParamsActionsValue] `json:"value"`
}

func (PageruleUpdateParamsAction) MarshalJSON

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

type PageruleUpdateParamsActionsName

type PageruleUpdateParamsActionsName string

The type of route.

const (
	PageruleUpdateParamsActionsNameForwardURL PageruleUpdateParamsActionsName = "forward_url"
)

type PageruleUpdateParamsActionsValue

type PageruleUpdateParamsActionsValue struct {
	// The response type for the URL redirect.
	Type param.Field[PageruleUpdateParamsActionsValueType] `json:"type"`
	// The URL to redirect the request to. Notes: ${num} refers to the position of '\*'
	// in the constraint value.
	URL param.Field[string] `json:"url"`
}

func (PageruleUpdateParamsActionsValue) MarshalJSON

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

type PageruleUpdateParamsActionsValueType

type PageruleUpdateParamsActionsValueType string

The response type for the URL redirect.

const (
	PageruleUpdateParamsActionsValueTypeTemporary PageruleUpdateParamsActionsValueType = "temporary"
	PageruleUpdateParamsActionsValueTypePermanent PageruleUpdateParamsActionsValueType = "permanent"
)

type PageruleUpdateParamsStatus

type PageruleUpdateParamsStatus string

The status of the Page Rule.

const (
	PageruleUpdateParamsStatusActive   PageruleUpdateParamsStatus = "active"
	PageruleUpdateParamsStatusDisabled PageruleUpdateParamsStatus = "disabled"
)

type PageruleUpdateParamsTarget

type PageruleUpdateParamsTarget struct {
	// String constraint.
	Constraint param.Field[PageruleUpdateParamsTargetsConstraint] `json:"constraint,required"`
	// A target based on the URL of the request.
	Target param.Field[PageruleUpdateParamsTargetsTarget] `json:"target,required"`
}

A request condition target.

func (PageruleUpdateParamsTarget) MarshalJSON

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

type PageruleUpdateParamsTargetsConstraint

type PageruleUpdateParamsTargetsConstraint struct {
	// The matches operator can use asterisks and pipes as wildcard and 'or' operators.
	Operator param.Field[PageruleUpdateParamsTargetsConstraintOperator] `json:"operator,required"`
	// The URL pattern to match against the current request. The pattern may contain up
	// to four asterisks ('\*') as placeholders.
	Value param.Field[string] `json:"value,required"`
}

String constraint.

func (PageruleUpdateParamsTargetsConstraint) MarshalJSON

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

type PageruleUpdateParamsTargetsConstraintOperator

type PageruleUpdateParamsTargetsConstraintOperator string

The matches operator can use asterisks and pipes as wildcard and 'or' operators.

const (
	PageruleUpdateParamsTargetsConstraintOperatorMatches    PageruleUpdateParamsTargetsConstraintOperator = "matches"
	PageruleUpdateParamsTargetsConstraintOperatorContains   PageruleUpdateParamsTargetsConstraintOperator = "contains"
	PageruleUpdateParamsTargetsConstraintOperatorEquals     PageruleUpdateParamsTargetsConstraintOperator = "equals"
	PageruleUpdateParamsTargetsConstraintOperatorNotEqual   PageruleUpdateParamsTargetsConstraintOperator = "not_equal"
	PageruleUpdateParamsTargetsConstraintOperatorNotContain PageruleUpdateParamsTargetsConstraintOperator = "not_contain"
)

type PageruleUpdateParamsTargetsTarget

type PageruleUpdateParamsTargetsTarget string

A target based on the URL of the request.

const (
	PageruleUpdateParamsTargetsTargetURL PageruleUpdateParamsTargetsTarget = "url"
)

type PageruleUpdateResponse

type PageruleUpdateResponse interface {
	ImplementsPagerulesPageruleUpdateResponse()
}

Union satisfied by pagerules.PageruleUpdateResponseUnknown or shared.UnionString.

type PageruleUpdateResponseEnvelope

type PageruleUpdateResponseEnvelope struct {
	Errors   []PageruleUpdateResponseEnvelopeErrors   `json:"errors,required"`
	Messages []PageruleUpdateResponseEnvelopeMessages `json:"messages,required"`
	Result   PageruleUpdateResponse                   `json:"result,required"`
	// Whether the API call was successful
	Success PageruleUpdateResponseEnvelopeSuccess `json:"success,required"`
	JSON    pageruleUpdateResponseEnvelopeJSON    `json:"-"`
}

func (*PageruleUpdateResponseEnvelope) UnmarshalJSON

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

type PageruleUpdateResponseEnvelopeErrors

type PageruleUpdateResponseEnvelopeErrors struct {
	Code    int64                                    `json:"code,required"`
	Message string                                   `json:"message,required"`
	JSON    pageruleUpdateResponseEnvelopeErrorsJSON `json:"-"`
}

func (*PageruleUpdateResponseEnvelopeErrors) UnmarshalJSON

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

type PageruleUpdateResponseEnvelopeMessages

type PageruleUpdateResponseEnvelopeMessages struct {
	Code    int64                                      `json:"code,required"`
	Message string                                     `json:"message,required"`
	JSON    pageruleUpdateResponseEnvelopeMessagesJSON `json:"-"`
}

func (*PageruleUpdateResponseEnvelopeMessages) UnmarshalJSON

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

type PageruleUpdateResponseEnvelopeSuccess

type PageruleUpdateResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	PageruleUpdateResponseEnvelopeSuccessTrue PageruleUpdateResponseEnvelopeSuccess = true
)

type SettingListParams

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

type SettingListResponse

type SettingListResponse = interface{}

type SettingListResponseEnvelope

type SettingListResponseEnvelope struct {
	Errors   []SettingListResponseEnvelopeErrors   `json:"errors,required"`
	Messages []SettingListResponseEnvelopeMessages `json:"messages,required"`
	// Settings available for the zone.
	Result ZonesSettings `json:"result,required"`
	// Whether the API call was successful
	Success SettingListResponseEnvelopeSuccess `json:"success,required"`
	JSON    settingListResponseEnvelopeJSON    `json:"-"`
}

func (*SettingListResponseEnvelope) UnmarshalJSON

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

type SettingListResponseEnvelopeErrors

type SettingListResponseEnvelopeErrors struct {
	Code    int64                                 `json:"code,required"`
	Message string                                `json:"message,required"`
	JSON    settingListResponseEnvelopeErrorsJSON `json:"-"`
}

func (*SettingListResponseEnvelopeErrors) UnmarshalJSON

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

type SettingListResponseEnvelopeMessages

type SettingListResponseEnvelopeMessages struct {
	Code    int64                                   `json:"code,required"`
	Message string                                  `json:"message,required"`
	JSON    settingListResponseEnvelopeMessagesJSON `json:"-"`
}

func (*SettingListResponseEnvelopeMessages) UnmarshalJSON

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

type SettingListResponseEnvelopeSuccess

type SettingListResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	SettingListResponseEnvelopeSuccessTrue SettingListResponseEnvelopeSuccess = true
)

type SettingService

type SettingService struct {
	Options []option.RequestOption
}

SettingService contains methods and other services that help with interacting with the cloudflare API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewSettingService method instead.

func NewSettingService

func NewSettingService(opts ...option.RequestOption) (r *SettingService)

NewSettingService 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 (*SettingService) List

func (r *SettingService) List(ctx context.Context, query SettingListParams, opts ...option.RequestOption) (res *ZonesSettings, err error)

Returns a list of settings (and their details) that Page Rules can apply to matching requests.

type ZonesPageRule

type ZonesPageRule struct {
	// Identifier
	ID string `json:"id,required"`
	// The set of actions to perform if the targets of this rule match the request.
	// Actions can redirect to another URL or override settings, but not both.
	Actions []ZonesPageRuleAction `json:"actions,required"`
	// The timestamp of when the Page Rule was created.
	CreatedOn time.Time `json:"created_on,required" format:"date-time"`
	// The timestamp of when the Page Rule was last modified.
	ModifiedOn time.Time `json:"modified_on,required" format:"date-time"`
	// The priority of the rule, used to define which Page Rule is processed over
	// another. A higher number indicates a higher priority. For example, if you have a
	// catch-all Page Rule (rule A: `/images/*`) but want a more specific Page Rule to
	// take precedence (rule B: `/images/special/*`), specify a higher priority for
	// rule B so it overrides rule A.
	Priority int64 `json:"priority,required"`
	// The status of the Page Rule.
	Status ZonesPageRuleStatus `json:"status,required"`
	// The rule targets to evaluate on each request.
	Targets []ZonesPageRuleTarget `json:"targets,required"`
	JSON    zonesPageRuleJSON     `json:"-"`
}

func (*ZonesPageRule) UnmarshalJSON

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

type ZonesPageRuleAction

type ZonesPageRuleAction struct {
	// The timestamp of when the override was last modified.
	ModifiedOn time.Time `json:"modified_on" format:"date-time"`
	// The type of route.
	Name  ZonesPageRuleActionsName  `json:"name"`
	Value ZonesPageRuleActionsValue `json:"value"`
	JSON  zonesPageRuleActionJSON   `json:"-"`
}

func (*ZonesPageRuleAction) UnmarshalJSON

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

type ZonesPageRuleActionsName

type ZonesPageRuleActionsName string

The type of route.

const (
	ZonesPageRuleActionsNameForwardURL ZonesPageRuleActionsName = "forward_url"
)

type ZonesPageRuleActionsValue

type ZonesPageRuleActionsValue struct {
	// The response type for the URL redirect.
	Type ZonesPageRuleActionsValueType `json:"type"`
	// The URL to redirect the request to. Notes: ${num} refers to the position of '\*'
	// in the constraint value.
	URL  string                        `json:"url"`
	JSON zonesPageRuleActionsValueJSON `json:"-"`
}

func (*ZonesPageRuleActionsValue) UnmarshalJSON

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

type ZonesPageRuleActionsValueType

type ZonesPageRuleActionsValueType string

The response type for the URL redirect.

const (
	ZonesPageRuleActionsValueTypeTemporary ZonesPageRuleActionsValueType = "temporary"
	ZonesPageRuleActionsValueTypePermanent ZonesPageRuleActionsValueType = "permanent"
)

type ZonesPageRuleStatus

type ZonesPageRuleStatus string

The status of the Page Rule.

const (
	ZonesPageRuleStatusActive   ZonesPageRuleStatus = "active"
	ZonesPageRuleStatusDisabled ZonesPageRuleStatus = "disabled"
)

type ZonesPageRuleTarget

type ZonesPageRuleTarget struct {
	// String constraint.
	Constraint ZonesPageRuleTargetsConstraint `json:"constraint,required"`
	// A target based on the URL of the request.
	Target ZonesPageRuleTargetsTarget `json:"target,required"`
	JSON   zonesPageRuleTargetJSON    `json:"-"`
}

A request condition target.

func (*ZonesPageRuleTarget) UnmarshalJSON

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

type ZonesPageRuleTargetsConstraint

type ZonesPageRuleTargetsConstraint struct {
	// The matches operator can use asterisks and pipes as wildcard and 'or' operators.
	Operator ZonesPageRuleTargetsConstraintOperator `json:"operator,required"`
	// The URL pattern to match against the current request. The pattern may contain up
	// to four asterisks ('\*') as placeholders.
	Value string                             `json:"value,required"`
	JSON  zonesPageRuleTargetsConstraintJSON `json:"-"`
}

String constraint.

func (*ZonesPageRuleTargetsConstraint) UnmarshalJSON

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

type ZonesPageRuleTargetsConstraintOperator

type ZonesPageRuleTargetsConstraintOperator string

The matches operator can use asterisks and pipes as wildcard and 'or' operators.

const (
	ZonesPageRuleTargetsConstraintOperatorMatches    ZonesPageRuleTargetsConstraintOperator = "matches"
	ZonesPageRuleTargetsConstraintOperatorContains   ZonesPageRuleTargetsConstraintOperator = "contains"
	ZonesPageRuleTargetsConstraintOperatorEquals     ZonesPageRuleTargetsConstraintOperator = "equals"
	ZonesPageRuleTargetsConstraintOperatorNotEqual   ZonesPageRuleTargetsConstraintOperator = "not_equal"
	ZonesPageRuleTargetsConstraintOperatorNotContain ZonesPageRuleTargetsConstraintOperator = "not_contain"
)

type ZonesPageRuleTargetsTarget

type ZonesPageRuleTargetsTarget string

A target based on the URL of the request.

const (
	ZonesPageRuleTargetsTargetURL ZonesPageRuleTargetsTarget = "url"
)

type ZonesSettings

type ZonesSettings []interface{}

Jump to

Keyboard shortcuts

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