rules

package
v2.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const AuditLogActorTypeAdmin = shared.AuditLogActorTypeAdmin

This is an alias to an internal value.

View Source
const AuditLogActorTypeCloudflare = shared.AuditLogActorTypeCloudflare

This is an alias to an internal value.

View Source
const AuditLogActorTypeUser = shared.AuditLogActorTypeUser

This is an alias to an internal value.

View Source
const CloudflareTunnelTunTypeCNI = shared.CloudflareTunnelTunTypeCNI

This is an alias to an internal value.

View Source
const CloudflareTunnelTunTypeCfdTunnel = shared.CloudflareTunnelTunTypeCfdTunnel

This is an alias to an internal value.

View Source
const CloudflareTunnelTunTypeGRE = shared.CloudflareTunnelTunTypeGRE

This is an alias to an internal value.

View Source
const CloudflareTunnelTunTypeIPSec = shared.CloudflareTunnelTunTypeIPSec

This is an alias to an internal value.

View Source
const CloudflareTunnelTunTypeWARPConnector = shared.CloudflareTunnelTunTypeWARPConnector

This is an alias to an internal value.

Variables

This section is empty.

Functions

This section is empty.

Types

type ASN added in v2.1.0

type ASN = shared.ASN

This is an alias to an internal type.

type ASNParam added in v2.1.0

type ASNParam = shared.ASNParam

This is an alias to an internal type.

type AuditLog

type AuditLog = shared.AuditLog

This is an alias to an internal type.

type AuditLogAction

type AuditLogAction = shared.AuditLogAction

This is an alias to an internal type.

type AuditLogActor

type AuditLogActor = shared.AuditLogActor

This is an alias to an internal type.

type AuditLogActorType

type AuditLogActorType = shared.AuditLogActorType

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

This is an alias to an internal type.

type AuditLogOwner

type AuditLogOwner = shared.AuditLogOwner

This is an alias to an internal type.

type AuditLogResource

type AuditLogResource = shared.AuditLogResource

This is an alias to an internal type.

type CloudflareTunnel

type CloudflareTunnel = shared.CloudflareTunnel

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

This is an alias to an internal type.

type CloudflareTunnelConnection

type CloudflareTunnelConnection = shared.CloudflareTunnelConnection

This is an alias to an internal type.

type CloudflareTunnelTunType

type CloudflareTunnelTunType = shared.CloudflareTunnelTunType

The type of tunnel.

This is an alias to an internal type.

type Error

type Error = apierror.Error

type ErrorData

type ErrorData = shared.ErrorData

This is an alias to an internal type.

type Hostname

type Hostname struct {
	URLHostname string       `json:"url_hostname,required"`
	JSON        hostnameJSON `json:"-"`
}

Valid characters for hostnames are ASCII(7) letters from a to z, the digits from 0 to 9, wildcards (\*), and the hyphen (-).

func (Hostname) ImplementsRulesListItemGetResponseUnion

func (r Hostname) ImplementsRulesListItemGetResponseUnion()

func (*Hostname) UnmarshalJSON

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

type HostnameParam

type HostnameParam struct {
	URLHostname param.Field[string] `json:"url_hostname,required"`
}

Valid characters for hostnames are ASCII(7) letters from a to z, the digits from 0 to 9, wildcards (\*), and the hyphen (-).

func (HostnameParam) MarshalJSON

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

type ListBulkOperationGetResponse

type ListBulkOperationGetResponse = interface{}

type ListBulkOperationGetResponseEnvelope

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

func (*ListBulkOperationGetResponseEnvelope) UnmarshalJSON

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

type ListBulkOperationGetResponseEnvelopeSuccess

type ListBulkOperationGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	ListBulkOperationGetResponseEnvelopeSuccessTrue ListBulkOperationGetResponseEnvelopeSuccess = true
)

func (ListBulkOperationGetResponseEnvelopeSuccess) IsKnown

type ListBulkOperationService

type ListBulkOperationService struct {
	Options []option.RequestOption
}

ListBulkOperationService 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 NewListBulkOperationService method instead.

func NewListBulkOperationService

func NewListBulkOperationService(opts ...option.RequestOption) (r *ListBulkOperationService)

NewListBulkOperationService 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 (*ListBulkOperationService) Get

func (r *ListBulkOperationService) Get(ctx context.Context, accountIdentifier string, operationID string, opts ...option.RequestOption) (res *[]ListBulkOperationGetResponse, err error)

Gets the current status of an asynchronous operation on a list.

The `status` property can have one of the following values: `pending`, `running`, `completed`, or `failed`. If the status is `failed`, the `error` property will contain a message describing the error.

type ListCursor

type ListCursor struct {
	After  string         `json:"after"`
	Before string         `json:"before"`
	JSON   listCursorJSON `json:"-"`
}

func (*ListCursor) UnmarshalJSON

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

type ListDeleteParams

type ListDeleteParams struct {
	// Identifier
	AccountID param.Field[string] `path:"account_id,required"`
	Body      interface{}         `json:"body,required"`
}

func (ListDeleteParams) MarshalJSON

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

type ListDeleteResponse

type ListDeleteResponse struct {
	// The unique ID of the item in the List.
	ID   string                 `json:"id"`
	JSON listDeleteResponseJSON `json:"-"`
}

func (*ListDeleteResponse) UnmarshalJSON

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

type ListDeleteResponseEnvelope

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

func (*ListDeleteResponseEnvelope) UnmarshalJSON

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

type ListDeleteResponseEnvelopeSuccess

type ListDeleteResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	ListDeleteResponseEnvelopeSuccessTrue ListDeleteResponseEnvelopeSuccess = true
)

func (ListDeleteResponseEnvelopeSuccess) IsKnown

type ListGetParams

type ListGetParams struct {
	// Identifier
	AccountID param.Field[string] `path:"account_id,required"`
}

type ListGetResponse

type ListGetResponse = interface{}

type ListGetResponseEnvelope

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

func (*ListGetResponseEnvelope) UnmarshalJSON

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

type ListGetResponseEnvelopeSuccess

type ListGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	ListGetResponseEnvelopeSuccessTrue ListGetResponseEnvelopeSuccess = true
)

func (ListGetResponseEnvelopeSuccess) IsKnown

type ListItem

type ListItem struct {
	// The unique operation ID of the asynchronous action.
	OperationID string       `json:"operation_id"`
	JSON        listItemJSON `json:"-"`
}

func (*ListItem) UnmarshalJSON

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

type ListItemDeleteParams

type ListItemDeleteParams struct {
	// Identifier
	AccountID param.Field[string]                     `path:"account_id,required"`
	Items     param.Field[[]ListItemDeleteParamsItem] `json:"items"`
}

func (ListItemDeleteParams) MarshalJSON

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

type ListItemDeleteParamsItem

type ListItemDeleteParamsItem struct {
	// The unique ID of the item in the List.
	ID param.Field[string] `json:"id"`
}

func (ListItemDeleteParamsItem) MarshalJSON

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

type ListItemDeleteResponse

type ListItemDeleteResponse struct {
	// The unique operation ID of the asynchronous action.
	OperationID string                     `json:"operation_id"`
	JSON        listItemDeleteResponseJSON `json:"-"`
}

func (*ListItemDeleteResponse) UnmarshalJSON

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

type ListItemDeleteResponseEnvelope

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

func (*ListItemDeleteResponseEnvelope) UnmarshalJSON

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

type ListItemDeleteResponseEnvelopeSuccess

type ListItemDeleteResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	ListItemDeleteResponseEnvelopeSuccessTrue ListItemDeleteResponseEnvelopeSuccess = true
)

func (ListItemDeleteResponseEnvelopeSuccess) IsKnown

type ListItemGetResponseEnvelope

type ListItemGetResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	// An IPv4 address, an IPv4 CIDR, or an IPv6 CIDR. IPv6 CIDRs are limited to a
	// maximum of /64.
	Result ListItemGetResponseUnion `json:"result,required,nullable"`
	// Whether the API call was successful
	Success ListItemGetResponseEnvelopeSuccess `json:"success,required"`
	JSON    listItemGetResponseEnvelopeJSON    `json:"-"`
}

func (*ListItemGetResponseEnvelope) UnmarshalJSON

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

type ListItemGetResponseEnvelopeSuccess

type ListItemGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	ListItemGetResponseEnvelopeSuccessTrue ListItemGetResponseEnvelopeSuccess = true
)

func (ListItemGetResponseEnvelopeSuccess) IsKnown

type ListItemGetResponseUnion

type ListItemGetResponseUnion interface {
	ImplementsRulesListItemGetResponseUnion()
}

An IPv4 address, an IPv4 CIDR, or an IPv6 CIDR. IPv6 CIDRs are limited to a maximum of /64.

Union satisfied by shared.UnionString, rules.Redirect, rules.Hostname or shared.UnionInt.

type ListItemListParams

type ListItemListParams struct {
	// Identifier
	AccountID param.Field[string] `path:"account_id,required"`
	// The pagination cursor. An opaque string token indicating the position from which
	// to continue when requesting the next/previous set of records. Cursor values are
	// provided under `result_info.cursors` in the response. You should make no
	// assumptions about a cursor's content or length.
	Cursor param.Field[string] `query:"cursor"`
	// Amount of results to include in each paginated response. A non-negative 32 bit
	// integer.
	PerPage param.Field[int64] `query:"per_page"`
	// A search query to filter returned items. Its meaning depends on the list type:
	// IP addresses must start with the provided string, hostnames and bulk redirects
	// must contain the string, and ASNs must match the string exactly.
	Search param.Field[string] `query:"search"`
}

func (ListItemListParams) URLQuery

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

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

type ListItemListResponse

type ListItemListResponse = interface{}

type ListItemNewParams

type ListItemNewParams struct {
	// Identifier
	AccountID param.Field[string]     `path:"account_id,required"`
	Body      []ListItemNewParamsBody `json:"body,required"`
}

func (ListItemNewParams) MarshalJSON

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

type ListItemNewParamsBody

type ListItemNewParamsBody struct {
	// A non-negative 32 bit integer
	ASN param.Field[int64] `json:"asn"`
	// An informative summary of the list item.
	Comment param.Field[string] `json:"comment"`
	// Valid characters for hostnames are ASCII(7) letters from a to z, the digits from
	// 0 to 9, wildcards (\*), and the hyphen (-).
	Hostname param.Field[HostnameParam] `json:"hostname"`
	// An IPv4 address, an IPv4 CIDR, or an IPv6 CIDR. IPv6 CIDRs are limited to a
	// maximum of /64.
	IP param.Field[string] `json:"ip"`
	// The definition of the redirect.
	Redirect param.Field[RedirectParam] `json:"redirect"`
}

func (ListItemNewParamsBody) MarshalJSON

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

type ListItemNewResponse

type ListItemNewResponse struct {
	// The unique operation ID of the asynchronous action.
	OperationID string                  `json:"operation_id"`
	JSON        listItemNewResponseJSON `json:"-"`
}

func (*ListItemNewResponse) UnmarshalJSON

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

type ListItemNewResponseEnvelope

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

func (*ListItemNewResponseEnvelope) UnmarshalJSON

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

type ListItemNewResponseEnvelopeSuccess

type ListItemNewResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	ListItemNewResponseEnvelopeSuccessTrue ListItemNewResponseEnvelopeSuccess = true
)

func (ListItemNewResponseEnvelopeSuccess) IsKnown

type ListItemService

type ListItemService struct {
	Options []option.RequestOption
}

ListItemService 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 NewListItemService method instead.

func NewListItemService

func NewListItemService(opts ...option.RequestOption) (r *ListItemService)

NewListItemService 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 (*ListItemService) Delete

func (r *ListItemService) Delete(ctx context.Context, listID string, params ListItemDeleteParams, opts ...option.RequestOption) (res *ListItemDeleteResponse, err error)

Removes one or more items from a list.

This operation is asynchronous. To get current the operation status, invoke the [Get bulk operation status](/operations/lists-get-bulk-operation-status) endpoint with the returned `operation_id`.

func (*ListItemService) Get

func (r *ListItemService) Get(ctx context.Context, accountIdentifier string, listID string, itemID string, opts ...option.RequestOption) (res *ListItemGetResponseUnion, err error)

Fetches a list item in the list.

func (*ListItemService) List

Fetches all the items in the list.

func (*ListItemService) ListAutoPaging

Fetches all the items in the list.

func (*ListItemService) New

func (r *ListItemService) New(ctx context.Context, listID string, params ListItemNewParams, opts ...option.RequestOption) (res *ListItemNewResponse, err error)

Appends new items to the list.

This operation is asynchronous. To get current the operation status, invoke the [Get bulk operation status](/operations/lists-get-bulk-operation-status) endpoint with the returned `operation_id`.

func (*ListItemService) Update

func (r *ListItemService) Update(ctx context.Context, listID string, params ListItemUpdateParams, opts ...option.RequestOption) (res *ListItemUpdateResponse, err error)

Removes all existing items from the list and adds the provided items to the list.

This operation is asynchronous. To get current the operation status, invoke the [Get bulk operation status](/operations/lists-get-bulk-operation-status) endpoint with the returned `operation_id`.

type ListItemUpdateParams

type ListItemUpdateParams struct {
	// Identifier
	AccountID param.Field[string]        `path:"account_id,required"`
	Body      []ListItemUpdateParamsBody `json:"body,required"`
}

func (ListItemUpdateParams) MarshalJSON

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

type ListItemUpdateParamsBody

type ListItemUpdateParamsBody struct {
	// A non-negative 32 bit integer
	ASN param.Field[int64] `json:"asn"`
	// An informative summary of the list item.
	Comment param.Field[string] `json:"comment"`
	// Valid characters for hostnames are ASCII(7) letters from a to z, the digits from
	// 0 to 9, wildcards (\*), and the hyphen (-).
	Hostname param.Field[HostnameParam] `json:"hostname"`
	// An IPv4 address, an IPv4 CIDR, or an IPv6 CIDR. IPv6 CIDRs are limited to a
	// maximum of /64.
	IP param.Field[string] `json:"ip"`
	// The definition of the redirect.
	Redirect param.Field[RedirectParam] `json:"redirect"`
}

func (ListItemUpdateParamsBody) MarshalJSON

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

type ListItemUpdateResponse

type ListItemUpdateResponse struct {
	// The unique operation ID of the asynchronous action.
	OperationID string                     `json:"operation_id"`
	JSON        listItemUpdateResponseJSON `json:"-"`
}

func (*ListItemUpdateResponse) UnmarshalJSON

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

type ListItemUpdateResponseEnvelope

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

func (*ListItemUpdateResponseEnvelope) UnmarshalJSON

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

type ListItemUpdateResponseEnvelopeSuccess

type ListItemUpdateResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	ListItemUpdateResponseEnvelopeSuccessTrue ListItemUpdateResponseEnvelopeSuccess = true
)

func (ListItemUpdateResponseEnvelopeSuccess) IsKnown

type ListListParams

type ListListParams struct {
	// Identifier
	AccountID param.Field[string] `path:"account_id,required"`
}

type ListNewParams

type ListNewParams struct {
	// Identifier
	AccountID param.Field[string] `path:"account_id,required"`
	// The type of the list. Each type supports specific list items (IP addresses,
	// ASNs, hostnames or redirects).
	Kind param.Field[ListNewParamsKind] `json:"kind,required"`
	// An informative name for the list. Use this name in filter and rule expressions.
	Name param.Field[string] `json:"name,required"`
	// An informative summary of the list.
	Description param.Field[string] `json:"description"`
}

func (ListNewParams) MarshalJSON

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

type ListNewParamsKind

type ListNewParamsKind string

The type of the list. Each type supports specific list items (IP addresses, ASNs, hostnames or redirects).

const (
	ListNewParamsKindIP       ListNewParamsKind = "ip"
	ListNewParamsKindRedirect ListNewParamsKind = "redirect"
	ListNewParamsKindHostname ListNewParamsKind = "hostname"
	ListNewParamsKindASN      ListNewParamsKind = "asn"
)

func (ListNewParamsKind) IsKnown

func (r ListNewParamsKind) IsKnown() bool

type ListNewResponse

type ListNewResponse = interface{}

type ListNewResponseEnvelope

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

func (*ListNewResponseEnvelope) UnmarshalJSON

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

type ListNewResponseEnvelopeSuccess

type ListNewResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	ListNewResponseEnvelopeSuccessTrue ListNewResponseEnvelopeSuccess = true
)

func (ListNewResponseEnvelopeSuccess) IsKnown

type ListService

type ListService struct {
	Options        []option.RequestOption
	BulkOperations *ListBulkOperationService
	Items          *ListItemService
}

ListService 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 NewListService method instead.

func NewListService

func NewListService(opts ...option.RequestOption) (r *ListService)

NewListService 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 (*ListService) Delete

func (r *ListService) Delete(ctx context.Context, listID string, params ListDeleteParams, opts ...option.RequestOption) (res *ListDeleteResponse, err error)

Deletes a specific list and all its items.

func (*ListService) Get

func (r *ListService) Get(ctx context.Context, listID string, query ListGetParams, opts ...option.RequestOption) (res *ListsList, err error)

Fetches the details of a list.

func (*ListService) List

Fetches all lists in the account.

func (*ListService) ListAutoPaging

Fetches all lists in the account.

func (*ListService) New

func (r *ListService) New(ctx context.Context, params ListNewParams, opts ...option.RequestOption) (res *ListsList, err error)

Creates a new list of the specified type.

func (*ListService) Update

func (r *ListService) Update(ctx context.Context, listID string, params ListUpdateParams, opts ...option.RequestOption) (res *ListsList, err error)

Updates the description of a list.

type ListUpdateParams

type ListUpdateParams struct {
	// Identifier
	AccountID param.Field[string] `path:"account_id,required"`
	// An informative summary of the list.
	Description param.Field[string] `json:"description"`
}

func (ListUpdateParams) MarshalJSON

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

type ListUpdateResponse

type ListUpdateResponse = interface{}

type ListUpdateResponseEnvelope

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

func (*ListUpdateResponseEnvelope) UnmarshalJSON

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

type ListUpdateResponseEnvelopeSuccess

type ListUpdateResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	ListUpdateResponseEnvelopeSuccessTrue ListUpdateResponseEnvelopeSuccess = true
)

func (ListUpdateResponseEnvelopeSuccess) IsKnown

type ListsList

type ListsList struct {
	// The unique ID of the list.
	ID string `json:"id"`
	// The RFC 3339 timestamp of when the list was created.
	CreatedOn string `json:"created_on"`
	// An informative summary of the list.
	Description string `json:"description"`
	// The type of the list. Each type supports specific list items (IP addresses,
	// ASNs, hostnames or redirects).
	Kind ListsListKind `json:"kind"`
	// The RFC 3339 timestamp of when the list was last modified.
	ModifiedOn string `json:"modified_on"`
	// An informative name for the list. Use this name in filter and rule expressions.
	Name string `json:"name"`
	// The number of items in the list.
	NumItems float64 `json:"num_items"`
	// The number of [filters](/operations/filters-list-filters) referencing the list.
	NumReferencingFilters float64       `json:"num_referencing_filters"`
	JSON                  listsListJSON `json:"-"`
}

func (*ListsList) UnmarshalJSON

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

type ListsListKind

type ListsListKind string

The type of the list. Each type supports specific list items (IP addresses, ASNs, hostnames or redirects).

const (
	ListsListKindIP       ListsListKind = "ip"
	ListsListKindRedirect ListsListKind = "redirect"
	ListsListKindHostname ListsListKind = "hostname"
	ListsListKindASN      ListsListKind = "asn"
)

func (ListsListKind) IsKnown

func (r ListsListKind) IsKnown() bool

type Member added in v2.1.0

type Member = shared.Member

This is an alias to an internal type.

type MemberParam added in v2.1.0

type MemberParam = shared.MemberParam

This is an alias to an internal type.

type MemberRole added in v2.1.0

type MemberRole = shared.MemberRole

This is an alias to an internal type.

type MemberRoleParam added in v2.1.0

type MemberRoleParam = shared.MemberRoleParam

This is an alias to an internal type.

type MemberRolesPermissions added in v2.1.0

type MemberRolesPermissions = shared.MemberRolesPermissions

This is an alias to an internal type.

type MemberRolesPermissionsParam added in v2.1.0

type MemberRolesPermissionsParam = shared.MemberRolesPermissionsParam

This is an alias to an internal type.

type MemberUser added in v2.1.0

type MemberUser = shared.MemberUser

This is an alias to an internal type.

type MemberUserParam added in v2.1.0

type MemberUserParam = shared.MemberUserParam

This is an alias to an internal type.

type Permission

type Permission = shared.Permission

This is an alias to an internal type.

type PermissionGrant

type PermissionGrant = shared.PermissionGrant

This is an alias to an internal type.

type PermissionGrantParam

type PermissionGrantParam = shared.PermissionGrantParam

This is an alias to an internal type.

type Redirect

type Redirect struct {
	SourceURL           string             `json:"source_url,required"`
	TargetURL           string             `json:"target_url,required"`
	IncludeSubdomains   bool               `json:"include_subdomains"`
	PreservePathSuffix  bool               `json:"preserve_path_suffix"`
	PreserveQueryString bool               `json:"preserve_query_string"`
	StatusCode          RedirectStatusCode `json:"status_code"`
	SubpathMatching     bool               `json:"subpath_matching"`
	JSON                redirectJSON       `json:"-"`
}

The definition of the redirect.

func (Redirect) ImplementsRulesListItemGetResponseUnion

func (r Redirect) ImplementsRulesListItemGetResponseUnion()

func (*Redirect) UnmarshalJSON

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

type RedirectParam

type RedirectParam struct {
	SourceURL           param.Field[string]             `json:"source_url,required"`
	TargetURL           param.Field[string]             `json:"target_url,required"`
	IncludeSubdomains   param.Field[bool]               `json:"include_subdomains"`
	PreservePathSuffix  param.Field[bool]               `json:"preserve_path_suffix"`
	PreserveQueryString param.Field[bool]               `json:"preserve_query_string"`
	StatusCode          param.Field[RedirectStatusCode] `json:"status_code"`
	SubpathMatching     param.Field[bool]               `json:"subpath_matching"`
}

The definition of the redirect.

func (RedirectParam) MarshalJSON

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

type RedirectStatusCode

type RedirectStatusCode int64
const (
	RedirectStatusCode301 RedirectStatusCode = 301
	RedirectStatusCode302 RedirectStatusCode = 302
	RedirectStatusCode307 RedirectStatusCode = 307
	RedirectStatusCode308 RedirectStatusCode = 308
)

func (RedirectStatusCode) IsKnown

func (r RedirectStatusCode) IsKnown() bool

type ResponseInfo

type ResponseInfo = shared.ResponseInfo

This is an alias to an internal type.

type Role

type Role = shared.Role

This is an alias to an internal type.

type RuleService

type RuleService struct {
	Options []option.RequestOption
	Lists   *ListService
}

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

func NewRuleService

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

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

Jump to

Keyboard shortcuts

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