rules

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const AuditLogActorTypeAdmin = shared.AuditLogActorTypeAdmin

This is an alias to an internal value.

View Source
const AuditLogActorTypeCloudflare = shared.AuditLogActorTypeCloudflare

This is an alias to an internal value.

View Source
const AuditLogActorTypeUser = shared.AuditLogActorTypeUser

This is an alias to an internal value.

View Source
const CertificateCADigicert = shared.CertificateCADigicert

This is an alias to an internal value.

View Source
const CertificateCAGoogle = shared.CertificateCAGoogle

This is an alias to an internal value.

View Source
const CertificateCALetsEncrypt = shared.CertificateCALetsEncrypt

This is an alias to an internal value.

View Source
const CertificateRequestTypeKeylessCertificate = shared.CertificateRequestTypeKeylessCertificate

This is an alias to an internal value.

View Source
const CertificateRequestTypeOriginECC = shared.CertificateRequestTypeOriginECC

This is an alias to an internal value.

View Source
const CertificateRequestTypeOriginRSA = shared.CertificateRequestTypeOriginRSA

This is an alias to an internal value.

View Source
const CloudflareTunnelStatusDegraded = shared.CloudflareTunnelStatusDegraded

This is an alias to an internal value.

View Source
const CloudflareTunnelStatusDown = shared.CloudflareTunnelStatusDown

This is an alias to an internal value.

View Source
const CloudflareTunnelStatusHealthy = shared.CloudflareTunnelStatusHealthy

This is an alias to an internal value.

View Source
const CloudflareTunnelStatusInactive = shared.CloudflareTunnelStatusInactive

This is an alias to an internal value.

View Source
const CloudflareTunnelTunTypeCNI = shared.CloudflareTunnelTunTypeCNI

This is an alias to an internal value.

View Source
const CloudflareTunnelTunTypeCfdTunnel = shared.CloudflareTunnelTunTypeCfdTunnel

This is an alias to an internal value.

View Source
const CloudflareTunnelTunTypeGRE = shared.CloudflareTunnelTunTypeGRE

This is an alias to an internal value.

View Source
const CloudflareTunnelTunTypeIPSec = shared.CloudflareTunnelTunTypeIPSec

This is an alias to an internal value.

View Source
const CloudflareTunnelTunTypeWARPConnector = shared.CloudflareTunnelTunTypeWARPConnector

This is an alias to an internal value.

View Source
const MemberStatusAccepted = shared.MemberStatusAccepted

This is an alias to an internal value.

View Source
const MemberStatusPending = shared.MemberStatusPending

This is an alias to an internal value.

View Source
const SortDirectionAsc = shared.SortDirectionAsc

This is an alias to an internal value.

View Source
const SortDirectionDesc = shared.SortDirectionDesc

This is an alias to an internal value.

Variables

This section is empty.

Functions

This section is empty.

Types

type ASN

type ASN = shared.ASN

This is an alias to an internal type.

type ASNParam

type ASNParam = shared.ASNParam

This is an alias to an internal type.

type AuditLog

type AuditLog = shared.AuditLog

This is an alias to an internal type.

type AuditLogAction

type AuditLogAction = shared.AuditLogAction

This is an alias to an internal type.

type AuditLogActor

type AuditLogActor = shared.AuditLogActor

This is an alias to an internal type.

type AuditLogActorType

type AuditLogActorType = shared.AuditLogActorType

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

This is an alias to an internal type.

type AuditLogOwner

type AuditLogOwner = shared.AuditLogOwner

This is an alias to an internal type.

type AuditLogResource

type AuditLogResource = shared.AuditLogResource

This is an alias to an internal type.

type CertificateCA

type CertificateCA = shared.CertificateCA

The Certificate Authority that will issue the certificate

This is an alias to an internal type.

type CertificateRequestType

type CertificateRequestType = shared.CertificateRequestType

Signature type desired on certificate ("origin-rsa" (rsa), "origin-ecc" (ecdsa), or "keyless-certificate" (for Keyless SSL servers).

This is an alias to an internal type.

type CloudflareTunnel

type CloudflareTunnel = shared.CloudflareTunnel

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

This is an alias to an internal type.

type 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 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 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 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 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 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 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 {
	// 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 {
	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 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 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, accountID string, listID string, 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, accountID string, listID string, body 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, accountID string, listID string, body 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 {
	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 ListNewParams

type ListNewParams struct {
	// 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 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 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, accountID string, listID string, 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, accountID string, listID string, opts ...option.RequestOption) (res *ListsList, err error)

Fetches the details of a list.

func (*ListService) List

func (r *ListService) List(ctx context.Context, accountID string, opts ...option.RequestOption) (res *pagination.SinglePage[ListsList], err error)

Fetches all lists in the account.

func (*ListService) ListAutoPaging

func (r *ListService) ListAutoPaging(ctx context.Context, accountID string, opts ...option.RequestOption) *pagination.SinglePageAutoPager[ListsList]

Fetches all lists in the account.

func (*ListService) New

func (r *ListService) New(ctx context.Context, accountID string, body 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, accountID string, listID string, body ListUpdateParams, opts ...option.RequestOption) (res *ListsList, err error)

Updates the description of a list.

type ListUpdateParams

type ListUpdateParams struct {
	// 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 MemberParam

type MemberParam = shared.MemberParam

This is an alias to an internal type.

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

type SortDirection

type SortDirection = shared.SortDirection

Direction to order DNS records in.

This is an alias to an internal type.

Jump to

Keyboard shortcuts

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