cloudflare

package module
v0.93.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: BSD-3-Clause Imports: 31 Imported by: 942

README

cloudflare-go

Go Reference Test Go Report Card

Note: This library is under active development as we expand it to cover our (expanding!) API. Consider the public API of this package a little unstable as we work towards a v1.0.

A Go library for interacting with Cloudflare's API v4. This library allows you to:

  • Manage and automate changes to your DNS records within Cloudflare
  • Manage and automate changes to your zones (domains) on Cloudflare, including adding new zones to your account
  • List and modify the status of WAF (Web Application Firewall) rules for your zones
  • Fetch Cloudflare's IP ranges for automating your firewall whitelisting

A command-line client, flarectl, is also available as part of this project.

Installation

You need a working Go environment. We officially support only currently supported Go versions according to Go project's release policy.

go get github.com/cloudflare/cloudflare-go

Getting Started

package main

import (
	"context"
	"fmt"
	"log"
	"os"

	"github.com/cloudflare/cloudflare-go"
)

func main() {
	// Construct a new API object using a global API key
	api, err := cloudflare.New(os.Getenv("CLOUDFLARE_API_KEY"), os.Getenv("CLOUDFLARE_API_EMAIL"))
	// alternatively, you can use a scoped API token
	// api, err := cloudflare.NewWithAPIToken(os.Getenv("CLOUDFLARE_API_TOKEN"))
	if err != nil {
		log.Fatal(err)
	}

	// Most API calls require a Context
	ctx := context.Background()

	// Fetch user details on the account
	u, err := api.UserDetails(ctx)
	if err != nil {
		log.Fatal(err)
	}
	// Print user details
	fmt.Println(u)
}

Also refer to the API documentation for how to use this package in-depth.

Experimental improvements

This library is starting to ship with experimental improvements that are not yet ready for production but will be introduced before the next major version. See experimental README for full details.

Contributing

Pull Requests are welcome, but please open an issue (or comment in an existing issue) to discuss any non-trivial changes before submitting code.

License

BSD licensed. See the LICENSE file for details.

Documentation

Overview

Package cloudflare implements the Cloudflare v4 API.

File contains helper methods for accepting variants (pointers, values, slices, etc) of a particular type and returning them in another. A common use is pointer to values and back.

_Most_ follow the convention of (where <type> is a Golang type such as Bool):

<type>Ptr: Accepts a value and returns a pointer. <type>: Accepts a pointer and returns a value. <type>PtrSlice: Accepts a slice of values and returns a slice of pointers. <type>Slice: Accepts a slice of pointers and returns a slice of values. <type>PtrMap: Accepts a string map of values into a string map of pointers. <type>Map: Accepts a string map of pointers into a string map of values.

Not all Golang types are covered here, only those that are commonly used.

Example
package main

import (
	"context"
	"fmt"

	cloudflare "github.com/cloudflare/cloudflare-go"
)

const (
	user   = "cloudflare@example.org"
	domain = "example.com"
	apiKey = "deadbeef"
)

func main() {
	api, err := cloudflare.New("deadbeef", "cloudflare@example.org")
	if err != nil {
		fmt.Println(err)
		return
	}

	// Fetch the zone ID for zone example.org
	zoneID, err := api.ZoneIDByName("example.org")
	if err != nil {
		fmt.Println(err)
		return
	}

	// Fetch all DNS records for example.org
	records, _, err := api.ListDNSRecords(context.Background(), cloudflare.ZoneIdentifier(zoneID), cloudflare.ListDNSRecordsParams{})
	if err != nil {
		fmt.Println(err)
		return
	}

	for _, r := range records {
		fmt.Printf("%s: %s\n", r.Name, r.Content)
	}
}
Output:

Index

Examples

Constants

View Source
const (
	// AuthKeyEmail specifies that we should authenticate with API key and email address.
	AuthKeyEmail = 1 << iota
	// AuthUserService specifies that we should authenticate with a User-Service key.
	AuthUserService
	// AuthToken specifies that we should authenticate with an API Token.
	AuthToken
)
View Source
const (
	IPAccessRulesConfigurationTarget  ListIPAccessRulesOrderOption = "configuration.target"
	IPAccessRulesConfigurationValue   ListIPAccessRulesOrderOption = "configuration.value"
	IPAccessRulesMatchOptionAll       ListIPAccessRulesMatchOption = "all"
	IPAccessRulesMatchOptionAny       ListIPAccessRulesMatchOption = "any"
	IPAccessRulesModeBlock            IPAccessRulesModeOption      = "block"
	IPAccessRulesModeChallenge        IPAccessRulesModeOption      = "challenge"
	IPAccessRulesModeJsChallenge      IPAccessRulesModeOption      = "js_challenge"
	IPAccessRulesModeManagedChallenge IPAccessRulesModeOption      = "managed_challenge"
	IPAccessRulesModeWhitelist        IPAccessRulesModeOption      = "whitelist"
)
View Source
const (
	// ListTypeIP specifies a list containing IP addresses.
	ListTypeIP = "ip"
	// ListTypeRedirect specifies a list containing redirects.
	ListTypeRedirect = "redirect"
	// ListTypeHostname specifies a list containing hostnames.
	ListTypeHostname = "hostname"
	// ListTypeHostname specifies a list containing autonomous system numbers (ASNs).
	ListTypeASN = "asn"
)
View Source
const (
	// MagicFirewallRulesetKindRoot specifies a root Ruleset.
	MagicFirewallRulesetKindRoot = "root"

	// MagicFirewallRulesetPhaseMagicTransit specifies the Magic Transit Ruleset phase.
	MagicFirewallRulesetPhaseMagicTransit = "magic_transit"

	// MagicFirewallRulesetRuleActionSkip specifies a skip (allow) action.
	MagicFirewallRulesetRuleActionSkip MagicFirewallRulesetRuleAction = "skip"

	// MagicFirewallRulesetRuleActionBlock specifies a block action.
	MagicFirewallRulesetRuleActionBlock MagicFirewallRulesetRuleAction = "block"
)
View Source
const (
	AccountRouteLevel RouteLevel = accounts
	ZoneRouteLevel    RouteLevel = zones
	UserRouteLevel    RouteLevel = user

	AccountType ResourceType = account
	ZoneType    ResourceType = zone
	UserType    ResourceType = user
)
View Source
const (
	RulesetKindCustom  RulesetKind = "custom"
	RulesetKindManaged RulesetKind = "managed"
	RulesetKindRoot    RulesetKind = "root"
	RulesetKindZone    RulesetKind = "zone"

	RulesetPhaseDDoSL4                       RulesetPhase = "ddos_l4"
	RulesetPhaseDDoSL7                       RulesetPhase = "ddos_l7"
	RulesetPhaseHTTPConfigSettings           RulesetPhase = "http_config_settings"
	RulesetPhaseHTTPCustomErrors             RulesetPhase = "http_custom_errors"
	RulesetPhaseHTTPLogCustomFields          RulesetPhase = "http_log_custom_fields"
	RulesetPhaseHTTPRatelimit                RulesetPhase = "http_ratelimit"
	RulesetPhaseHTTPRequestCacheSettings     RulesetPhase = "http_request_cache_settings"
	RulesetPhaseHTTPRequestDynamicRedirect   RulesetPhase = "http_request_dynamic_redirect" //nolint:gosec
	RulesetPhaseHTTPRequestFirewallCustom    RulesetPhase = "http_request_firewall_custom"
	RulesetPhaseHTTPRequestFirewallManaged   RulesetPhase = "http_request_firewall_managed"
	RulesetPhaseHTTPRequestLateTransform     RulesetPhase = "http_request_late_transform"
	RulesetPhaseHTTPRequestOrigin            RulesetPhase = "http_request_origin"
	RulesetPhaseHTTPRequestRedirect          RulesetPhase = "http_request_redirect"
	RulesetPhaseHTTPRequestSanitize          RulesetPhase = "http_request_sanitize"
	RulesetPhaseHTTPRequestSBFM              RulesetPhase = "http_request_sbfm"
	RulesetPhaseHTTPRequestTransform         RulesetPhase = "http_request_transform"
	RulesetPhaseHTTPResponseCompression      RulesetPhase = "http_response_compression"
	RulesetPhaseHTTPResponseFirewallManaged  RulesetPhase = "http_response_firewall_managed"
	RulesetPhaseHTTPResponseHeadersTransform RulesetPhase = "http_response_headers_transform"
	RulesetPhaseMagicTransit                 RulesetPhase = "magic_transit"

	RulesetRuleActionBlock                RulesetRuleAction = "block"
	RulesetRuleActionChallenge            RulesetRuleAction = "challenge"
	RulesetRuleActionCompressResponse     RulesetRuleAction = "compress_response"
	RulesetRuleActionDDoSDynamic          RulesetRuleAction = "ddos_dynamic"
	RulesetRuleActionDDoSMitigation       RulesetRuleAction = "ddos_mitigation"
	RulesetRuleActionExecute              RulesetRuleAction = "execute"
	RulesetRuleActionForceConnectionClose RulesetRuleAction = "force_connection_close"
	RulesetRuleActionJSChallenge          RulesetRuleAction = "js_challenge"
	RulesetRuleActionLog                  RulesetRuleAction = "log"
	RulesetRuleActionLogCustomField       RulesetRuleAction = "log_custom_field"
	RulesetRuleActionManagedChallenge     RulesetRuleAction = "managed_challenge"
	RulesetRuleActionRedirect             RulesetRuleAction = "redirect"
	RulesetRuleActionRewrite              RulesetRuleAction = "rewrite"
	RulesetRuleActionRoute                RulesetRuleAction = "route"
	RulesetRuleActionScore                RulesetRuleAction = "score"
	RulesetRuleActionServeError           RulesetRuleAction = "serve_error"
	RulesetRuleActionSetCacheSettings     RulesetRuleAction = "set_cache_settings"
	RulesetRuleActionSetConfig            RulesetRuleAction = "set_config"
	RulesetRuleActionSkip                 RulesetRuleAction = "skip"

	RulesetActionParameterProductBIC           RulesetActionParameterProduct = "bic"
	RulesetActionParameterProductHOT           RulesetActionParameterProduct = "hot"
	RulesetActionParameterProductRateLimit     RulesetActionParameterProduct = "ratelimit"
	RulesetActionParameterProductSecurityLevel RulesetActionParameterProduct = "securityLevel"
	RulesetActionParameterProductUABlock       RulesetActionParameterProduct = "uablock"
	RulesetActionParameterProductWAF           RulesetActionParameterProduct = "waf"
	RulesetActionParameterProductZoneLockdown  RulesetActionParameterProduct = "zonelockdown"

	RulesetRuleActionParametersHTTPHeaderOperationRemove RulesetRuleActionParametersHTTPHeaderOperation = "remove"
	RulesetRuleActionParametersHTTPHeaderOperationSet    RulesetRuleActionParametersHTTPHeaderOperation = "set"
	RulesetRuleActionParametersHTTPHeaderOperationAdd    RulesetRuleActionParametersHTTPHeaderOperation = "add"
)
View Source
const (
	// IPListTypeIP specifies a list containing IP addresses.
	IPListTypeIP = "ip"
)

Variables

View Source
var (
	ErrAPIKeysAndTokensAreMutuallyExclusive   = errors.New(errAPIKeysAndTokensAreMutuallyExclusive)
	ErrMissingCredentials                     = errors.New(errMissingCredentials)
	ErrMissingAccountID                       = errors.New(errMissingAccountID)
	ErrMissingZoneID                          = errors.New(errMissingZoneID)
	ErrAccountIDOrZoneIDAreRequired           = errors.New(errMissingAccountOrZoneID)
	ErrAccountIDAndZoneIDAreMutuallyExclusive = errors.New(errAccountIDAndZoneIDAreMutuallyExclusive)
	ErrMissingResourceIdentifier              = errors.New(errMissingResourceIdentifier)

	ErrRequiredAccountLevelResourceContainer = errors.New(errRequiredAccountLevelResourceContainer)
	ErrRequiredZoneLevelResourceContainer    = errors.New(errRequiredZoneLevelResourceContainer)
)
View Source
var (
	ErrMissingHyperdriveConfigID             = errors.New("required hyperdrive config id is missing")
	ErrMissingHyperdriveConfigName           = errors.New("required hyperdrive config name is missing")
	ErrMissingHyperdriveConfigOriginDatabase = errors.New("required hyperdrive config origin database is missing")
	ErrMissingHyperdriveConfigOriginPassword = errors.New("required hyperdrive config origin password is missing")
	ErrMissingHyperdriveConfigOriginHost     = errors.New("required hyperdrive config origin host is missing")
	ErrMissingHyperdriveConfigOriginScheme   = errors.New("required hyperdrive config origin scheme is missing")
	ErrMissingHyperdriveConfigOriginUser     = errors.New("required hyperdrive config origin user is missing")
)
View Source
var (
	ErrInvalidImagesAPIVersion = errors.New("invalid images API version")
	ErrMissingImageID          = errors.New("required image ID missing")
)
View Source
var (
	ErrMissingPoolID         = errors.New("missing required pool ID")
	ErrMissingMonitorID      = errors.New("missing required monitor ID")
	ErrMissingLoadBalancerID = errors.New("missing required load balancer ID")
)
View Source
var (
	// ErrMissingIP is for when ipv4 or ipv6 indicator was given but ip is missing.
	ErrMissingIP = errors.New("ip is required when using 'ipv4' or 'ipv6' indicator type and is missing")
	// ErrMissingURL is for when url or domain indicator was given but url is missing.
	ErrMissingURL = errors.New("url is required when using 'domain' or 'url' indicator type and is missing")
)
View Source
var (
	ErrMissingObservatoryUrl    = errors.New("missing required page url")
	ErrMissingObservatoryTestID = errors.New("missing required test id")
)
View Source
var (
	ErrMissingProjectName  = errors.New("required missing project name")
	ErrMissingDeploymentID = errors.New("required missing deployment ID")
)
View Source
var (
	ErrMissingQueueName         = errors.New("required queue name is missing")
	ErrMissingQueueConsumerName = errors.New("required queue consumer name is missing")
)
View Source
var (
	// ErrMissingUploadURL is for when a URL is required but missing.
	ErrMissingUploadURL = errors.New("required url missing")
	// ErrMissingMaxDuration is for when MaxDuration is required but missing.
	ErrMissingMaxDuration = errors.New("required max duration missing")
	// ErrMissingVideoID is for when VideoID is required but missing.
	ErrMissingVideoID = errors.New("required video id missing")
	// ErrMissingFilePath is for when FilePath is required but missing.
	ErrMissingFilePath = errors.New("required file path missing")
	// ErrMissingTusResumable is for when TusResumable is required but missing.
	ErrMissingTusResumable = errors.New("required tus resumable missing")
	// ErrInvalidTusResumable is for when TusResumable is invalid.
	ErrInvalidTusResumable = errors.New("invalid tus resumable")
	// ErrMarshallingTUSMetadata is for when TUS metadata cannot be marshalled.
	ErrMarshallingTUSMetadata = errors.New("error marshalling TUS metadata")
	// ErrMissingUploadLength is for when UploadLength is required but missing.
	ErrMissingUploadLength = errors.New("required upload length missing")
	// ErrInvalidStatusCode is for when the status code is invalid.
	ErrInvalidStatusCode = errors.New("invalid status code")
)
View Source
var (
	ErrSTSFailure               = errors.New("failed to fetch security token")
	ErrSTSHTTPFailure           = errors.New("failed making securtiy token issuer call")
	ErrSTSHTTPResponseError     = errors.New("security token request returned a failure")
	ErrSTSMissingServiceSecret  = errors.New("service secret missing but is required")
	ErrSTSMissingServiceTag     = errors.New("service tag missing but is required")
	ErrSTSMissingIssuerHostname = errors.New("issuer hostname missing but is required")
	ErrSTSMissingServicePath    = errors.New("issuer path missing but is required")
)
View Source
var (
	ErrMissingNetwork      = errors.New("missing required network parameter")
	ErrInvalidNetworkValue = errors.New("invalid IP parameter. Cannot use CIDR ranges for this endpoint.")
)
View Source
var (
	ErrMissingWaitingRoomID     = errors.New("missing required waiting room ID")
	ErrMissingWaitingRoomRuleID = errors.New("missing required waiting room rule ID")
)
View Source
var (
	// ErrMissingIdentifier is for when identifier is required but missing.
	ErrMissingIdentifier = errors.New("identifier required but missing")
	// ErrMissingName is for when name is required but missing.
	ErrMissingName = errors.New("name required but missing")
	// ErrMissingTarget is for when target is required but missing.
	ErrMissingTarget = errors.New("target required but missing")
)
View Source
var (
	ErrMissingWebAnalyticsSiteTag     = errors.New("missing required web analytics site ID")
	ErrMissingWebAnalyticsRulesetID   = errors.New("missing required web analytics ruleset ID")
	ErrMissingWebAnalyticsRuleID      = errors.New("missing required web analytics rule ID")
	ErrMissingWebAnalyticsSiteHost    = errors.New("missing required web analytics host or zone_tag")
	ErrConflictingWebAnalyticSiteHost = errors.New("conflicting web analytics host and zone_tag, only one must be specified")
)
View Source
var (
	ErrMissingHostname    = errors.New("required hostname missing")
	ErrMissingService     = errors.New("required service missing")
	ErrMissingEnvironment = errors.New("required environment missing")
)
View Source
var (
	ErrMissingScriptName = errors.New("required script name missing")
	ErrMissingTailID     = errors.New("required tail id missing")
)
View Source
var ErrMissingASN = errors.New("required asn missing")

ErrMissingASN is for when ASN is required but not set.

View Source
var (
	ErrMissingApplicationID = errors.New("missing required application ID")
)
View Source
var ErrMissingBINDContents = errors.New("required BIND config contents missing")

ErrMissingBINDContents is for when the BIND file contents is required but not set.

View Source
var (
	ErrMissingBucketName = errors.New("require bucket name missing")
)
View Source
var (
	ErrMissingCertificateID = errors.New("missing required certificate ID")
)
View Source
var ErrMissingClusterID = errors.New("missing required cluster ID")
View Source
var ErrMissingDNSRecordID = errors.New("required DNS record ID missing")

ErrMissingDNSRecordID is for when DNS record ID is needed but not given.

View Source
var (
	ErrMissingDatabaseID = fmt.Errorf("required missing database ID")
)
View Source
var (
	ErrMissingDatasetID = errors.New("missing required dataset ID")
)
View Source
var ErrMissingDomain = errors.New("required domain missing")

ErrMissingDomain is for when domain is needed but not given.

View Source
var (
	ErrMissingHostnameTLSSettingName = errors.New("tls setting name required but missing")
)
View Source
var ErrMissingListID = errors.New("required missing list ID")
View Source
var ErrMissingMemberRolesOrPolicies = errors.New(errMissingMemberRolesOrPolicies)
View Source
var ErrMissingPermissionGroupID = errors.New(errMissingPermissionGroupID)
View Source
var (
	ErrMissingProfileID = errors.New("missing required profile ID")
)
View Source
var ErrMissingRuleID = errors.New("required rule id missing")
View Source
var (
	ErrMissingRulesetPhase = errors.New("missing required phase")
)
View Source
var (
	ErrMissingServiceTokenUUID = errors.New("missing required service token UUID")
)
View Source
var (
	// ErrMissingSettingName is for when setting name is required but missing.
	ErrMissingSettingName = errors.New("zone setting name required but missing")
)
View Source
var ErrMissingSiteKey = errors.New("required site key missing")
View Source
var ErrMissingTunnelID = errors.New("required missing tunnel ID")

ErrMissingTunnelID is for when a required tunnel ID is missing from the parameters.

View Source
var ErrMissingUID = errors.New("required UID missing")
View Source
var ErrMissingVnetName = errors.New("required missing virtual network name")
View Source
var ErrMissingWorkerRouteID = errors.New("missing required route ID")
View Source
var ErrNotEnoughFilterIDsProvided = errors.New("at least one filter ID must be provided.")
View Source
var ErrOriginPortInvalid = errors.New("invalid origin port")

ErrOriginPortInvalid is a common error for failing to parse a single port or port range.

View Source
var PageRuleActions = map[string]string{
	"always_online":               "Always Online",
	"always_use_https":            "Always Use HTTPS",
	"automatic_https_rewrites":    "Automatic HTTPS Rewrites",
	"browser_cache_ttl":           "Browser Cache TTL",
	"browser_check":               "Browser Integrity Check",
	"bypass_cache_on_cookie":      "Bypass Cache on Cookie",
	"cache_by_device_type":        "Cache By Device Type",
	"cache_deception_armor":       "Cache Deception Armor",
	"cache_level":                 "Cache Level",
	"cache_key_fields":            "Custom Cache Key",
	"cache_on_cookie":             "Cache On Cookie",
	"disable_apps":                "Disable Apps",
	"disable_performance":         "Disable Performance",
	"disable_railgun":             "Disable Railgun",
	"disable_security":            "Disable Security",
	"edge_cache_ttl":              "Edge Cache TTL",
	"email_obfuscation":           "Email Obfuscation",
	"explicit_cache_control":      "Origin Cache Control",
	"forwarding_url":              "Forwarding URL",
	"host_header_override":        "Host Header Override",
	"ip_geolocation":              "IP Geolocation Header",
	"minify":                      "Minify",
	"mirage":                      "Mirage",
	"opportunistic_encryption":    "Opportunistic Encryption",
	"origin_error_page_pass_thru": "Origin Error Page Pass-thru",
	"polish":                      "Polish",
	"resolve_override":            "Resolve Override",
	"respect_strong_etag":         "Respect Strong ETags",
	"response_buffering":          "Response Buffering",
	"rocket_loader":               "Rocker Loader",
	"security_level":              "Security Level",
	"server_side_exclude":         "Server Side Excludes",
	"sort_query_string_for_cache": "Query String Sort",
	"ssl":                         "SSL",
	"true_client_ip_header":       "True Client IP Header",
	"waf":                         "Web Application Firewall",
}

PageRuleActions maps API action IDs to human-readable strings.

View Source
var (
	Version string = "v4"
)

Functions

func AnyPtr added in v0.35.0

func AnyPtr(v interface{}) interface{}

AnyPtr is a helper routine that allocates a new interface value to store v and returns a pointer to it.

Usage: var _ *Type = AnyPtr(Type(value) | value).(*Type)

var _ *bool = AnyPtr(true).(*bool)
var _ *byte = AnyPtr(byte(1)).(*byte)
var _ *complex64 = AnyPtr(complex64(1.1)).(*complex64)
var _ *complex128 = AnyPtr(complex128(1.1)).(*complex128)
var _ *float32 = AnyPtr(float32(1.1)).(*float32)
var _ *float64 = AnyPtr(float64(1.1)).(*float64)
var _ *int = AnyPtr(int(1)).(*int)
var _ *int8 = AnyPtr(int8(8)).(*int8)
var _ *int16 = AnyPtr(int16(16)).(*int16)
var _ *int32 = AnyPtr(int32(32)).(*int32)
var _ *int64 = AnyPtr(int64(64)).(*int64)
var _ *rune = AnyPtr(rune(1)).(*rune)
var _ *string = AnyPtr("ptr").(*string)
var _ *uint = AnyPtr(uint(1)).(*uint)
var _ *uint8 = AnyPtr(uint8(8)).(*uint8)
var _ *uint16 = AnyPtr(uint16(16)).(*uint16)
var _ *uint32 = AnyPtr(uint32(32)).(*uint32)
var _ *uint64 = AnyPtr(uint64(64)).(*uint64)

func Bool

func Bool(v *bool) bool

Bool is a helper routine that accepts a bool pointer and returns a value to it.

func BoolMap added in v0.36.0

func BoolMap(src map[string]*bool) map[string]bool

BoolMap converts a string map of bool pointers into a string map of bool values.

func BoolPtr added in v0.35.0

func BoolPtr(v bool) *bool

BoolPtr is a helper routine that allocates a new bool value to store v and returns a pointer to it.

func BoolPtrMap added in v0.35.0

func BoolPtrMap(src map[string]bool) map[string]*bool

BoolPtrMap converts a string map of bool values into a string map of bool pointers.

func BoolPtrSlice added in v0.35.0

func BoolPtrSlice(src []bool) []*bool

BoolPtrSlice converts a slice of bool values into a slice of bool pointers.

func BoolSlice added in v0.36.0

func BoolSlice(src []*bool) []bool

BoolSlice converts a slice of bool pointers into a slice of bool values.

func Byte added in v0.36.0

func Byte(v *byte) byte

Byte is a helper routine that accepts a byte pointer and returns a value to it.

func BytePtr added in v0.35.0

func BytePtr(v byte) *byte

BytePtr is a helper routine that allocates a new byte value to store v and returns a pointer to it.

func Complex128 added in v0.36.0

func Complex128(v *complex128) complex128

Complex128 is a helper routine that accepts a complex128 pointer and returns a value to it.

func Complex128Ptr added in v0.35.0

func Complex128Ptr(v complex128) *complex128

Complex128Ptr is a helper routine that allocates a new complex128 value to store v and returns a pointer to it.

func Complex64 added in v0.36.0

func Complex64(v *complex64) complex64

Complex64 is a helper routine that accepts a complex64 pointer and returns a value to it.

func Complex64Ptr added in v0.35.0

func Complex64Ptr(v complex64) *complex64

Complex64Ptr is a helper routine that allocates a new complex64 value to store v and returns a pointer to it.

func DurationPtr added in v0.35.0

func DurationPtr(v time.Duration) *time.Duration

DurationPtr is a helper routine that allocates a new time.Duration value to store v and returns a pointer to it.

func Float32 added in v0.36.0

func Float32(v *float32) float32

Float32 is a helper routine that accepts a float32 pointer and returns a value to it.

func Float32Map added in v0.36.0

func Float32Map(src map[string]*float32) map[string]float32

Float32Map converts a string map of float32 pointers into a string map of float32 values.

func Float32Ptr added in v0.35.0

func Float32Ptr(v float32) *float32

Float32Ptr is a helper routine that allocates a new float32 value to store v and returns a pointer to it.

func Float32PtrMap added in v0.35.0

func Float32PtrMap(src map[string]float32) map[string]*float32

Float32PtrMap converts a string map of float32 values into a string map of float32 pointers.

func Float32PtrSlice added in v0.35.0

func Float32PtrSlice(src []float32) []*float32

Float32PtrSlice converts a slice of float32 values into a slice of float32 pointers.

func Float32Slice added in v0.36.0

func Float32Slice(src []*float32) []float32

Float32Slice converts a slice of float32 pointers into a slice of float32 values.

func Float64 added in v0.36.0

func Float64(v *float64) float64

Float64 is a helper routine that accepts a float64 pointer and returns a value to it.

func Float64Map added in v0.36.0

func Float64Map(src map[string]*float64) map[string]float64

Float64Map converts a string map of float64 pointers into a string map of float64 values.

func Float64Ptr added in v0.35.0

func Float64Ptr(v float64) *float64

Float64Ptr is a helper routine that allocates a new float64 value to store v and returns a pointer to it.

func Float64PtrMap added in v0.35.0

func Float64PtrMap(src map[string]float64) map[string]*float64

Float64PtrMap converts a string map of float64 values into a string map of float64 pointers.

func Float64PtrSlice added in v0.35.0

func Float64PtrSlice(src []float64) []*float64

Float64PtrSlice converts a slice of float64 values into a slice of float64 pointers.

func Float64Slice added in v0.36.0

func Float64Slice(src []*float64) []float64

Float64Slice converts a slice of float64 pointers into a slice of float64 values.

func GetOriginCARootCertificate added in v0.58.0

func GetOriginCARootCertificate(algorithm string) ([]byte, error)

Gets the Cloudflare Origin CA Root Certificate for a given algorithm in PEM format. Algorithm must be one of ['ecc', 'rsa'].

func Int

func Int(v *int) int

Int is a helper routine that accepts a int pointer and returns a value to it.

func Int16 added in v0.36.0

func Int16(v *int16) int16

Int16 is a helper routine that accepts a int16 pointer and returns a value to it.

func Int16Map added in v0.36.0

func Int16Map(src map[string]*int16) map[string]int16

Int16Map converts a string map of int16 pointers into a string map of int16 values.

func Int16Ptr added in v0.35.0

func Int16Ptr(v int16) *int16

Int16Ptr is a helper routine that allocates a new int16 value to store v and returns a pointer to it.

func Int16PtrMap added in v0.35.0

func Int16PtrMap(src map[string]int16) map[string]*int16

Int16PtrMap converts a string map of int16 values into a string map of int16 pointers.

func Int16PtrSlice added in v0.35.0

func Int16PtrSlice(src []int16) []*int16

Int16PtrSlice converts a slice of int16 values into a slice of int16 pointers.

func Int16Slice added in v0.36.0

func Int16Slice(src []*int16) []int16

Int16Slice converts a slice of int16 pointers into a slice of int16 values.

func Int32 added in v0.36.0

func Int32(v *int32) int32

Int32 is a helper routine that accepts a int32 pointer and returns a value to it.

func Int32Map added in v0.36.0

func Int32Map(src map[string]*int32) map[string]int32

Int32Map converts a string map of int32 pointers into a string map of int32 values.

func Int32Ptr added in v0.35.0

func Int32Ptr(v int32) *int32

Int32Ptr is a helper routine that allocates a new int32 value to store v and returns a pointer to it.

func Int32PtrMap added in v0.35.0

func Int32PtrMap(src map[string]int32) map[string]*int32

Int32PtrMap converts a string map of int32 values into a string map of int32 pointers.

func Int32PtrSlice added in v0.35.0

func Int32PtrSlice(src []int32) []*int32

Int32PtrSlice converts a slice of int32 values into a slice of int32 pointers.

func Int32Slice added in v0.36.0

func Int32Slice(src []*int32) []int32

Int32Slice converts a slice of int32 pointers into a slice of int32 values.

func Int64 added in v0.36.0

func Int64(v *int64) int64

Int64 is a helper routine that accepts a int64 pointer and returns a value to it.

func Int64Map added in v0.36.0

func Int64Map(src map[string]*int64) map[string]int64

Int64Map converts a string map of int64 pointers into a string map of int64 values.

func Int64Ptr added in v0.35.0

func Int64Ptr(v int64) *int64

Int64Ptr is a helper routine that allocates a new int64 value to store v and returns a pointer to it.

func Int64PtrMap added in v0.35.0

func Int64PtrMap(src map[string]int64) map[string]*int64

Int64PtrMap converts a string map of int64 values into a string map of int64 pointers.

func Int64PtrSlice added in v0.35.0

func Int64PtrSlice(src []int64) []*int64

Int64PtrSlice converts a slice of int64 values into a slice of int64 pointers.

func Int64Slice added in v0.36.0

func Int64Slice(src []*int64) []int64

Int64Slice converts a slice of int64 pointers into a slice of int64 values.

func Int8 added in v0.36.0

func Int8(v *int8) int8

Int8 is a helper routine that accepts a int8 pointer and returns a value to it.

func Int8Map added in v0.36.0

func Int8Map(src map[string]*int8) map[string]int8

Int8Map converts a string map of int8 pointers into a string map of int8 values.

func Int8Ptr added in v0.35.0

func Int8Ptr(v int8) *int8

Int8Ptr is a helper routine that allocates a new int8 value to store v and returns a pointer to it.

func Int8PtrMap added in v0.35.0

func Int8PtrMap(src map[string]int8) map[string]*int8

Int8PtrMap converts a string map of int8 values into a string map of int8 pointers.

func Int8PtrSlice added in v0.35.0

func Int8PtrSlice(src []int8) []*int8

Int8PtrSlice converts a slice of int8 values into a slice of int8 pointers.

func Int8Slice added in v0.36.0

func Int8Slice(src []*int8) []int8

Int8Slice converts a slice of int8 pointers into a slice of int8 values.

func IntMap added in v0.36.0

func IntMap(src map[string]*int) map[string]int

IntMap converts a string map of int pointers into a string map of int values.

func IntPtr added in v0.35.0

func IntPtr(v int) *int

IntPtr is a helper routine that allocates a new int value to store v and returns a pointer to it.

func IntPtrMap added in v0.35.0

func IntPtrMap(src map[string]int) map[string]*int

IntPtrMap converts a string map of int values into a string map of int pointers.

func IntPtrSlice added in v0.35.0

func IntPtrSlice(src []int) []*int

IntPtrSlice converts a slice of int values into a slice of int pointers.

func IntSlice added in v0.36.0

func IntSlice(src []*int) []int

IntSlice converts a slice of int pointers into a slice of int values.

func RulesetActionParameterProductValues added in v0.19.0

func RulesetActionParameterProductValues() []string

RulesetActionParameterProductValues exposes all the available `RulesetActionParameterProduct` values as a slice of strings.

func RulesetKindValues added in v0.19.0

func RulesetKindValues() []string

RulesetKindValues exposes all the available `RulesetKind` values as a slice of strings.

func RulesetPhaseValues added in v0.19.0

func RulesetPhaseValues() []string

RulesetPhaseValues exposes all the available `RulesetPhase` values as a slice of strings.

func RulesetRuleActionParametersHTTPHeaderOperationValues added in v0.19.0

func RulesetRuleActionParametersHTTPHeaderOperationValues() []string

func RulesetRuleActionValues added in v0.19.0

func RulesetRuleActionValues() []string

RulesetRuleActionValues exposes all the available `RulesetRuleAction` values as a slice of strings.

func Rune added in v0.36.0

func Rune(v *rune) rune

Rune is a helper routine that accepts a rune pointer and returns a value to it.

func RunePtr added in v0.35.0

func RunePtr(v rune) *rune

RunePtr is a helper routine that allocates a new rune value to store v and returns a pointer to it.

func String

func String(v *string) string

String is a helper routine that accepts a string pointer and returns a value to it.

func StringMap added in v0.36.0

func StringMap(src map[string]*string) map[string]string

StringMap converts a string map of string pointers into a string map of string values.

func StringPtr added in v0.35.0

func StringPtr(v string) *string

StringPtr is a helper routine that allocates a new string value to store v and returns a pointer to it.

func StringPtrMap added in v0.35.0

func StringPtrMap(src map[string]string) map[string]*string

StringPtrMap converts a string map of string values into a string map of string pointers.

func StringPtrSlice added in v0.35.0

func StringPtrSlice(src []string) []*string

StringPtrSlice converts a slice of string values into a slice of string pointers.

func StringSlice added in v0.36.0

func StringSlice(src []*string) []string

StringSlice converts a slice of string pointers into a slice of string values.

func TeamsRulesActionValues added in v0.22.0

func TeamsRulesActionValues() []string

func TeamsRulesUntrustedCertActionValues added in v0.62.0

func TeamsRulesUntrustedCertActionValues() []string

func Time added in v0.36.0

func Time(v *time.Time) time.Time

Time is a helper routine that accepts a time pointer value and returns a value to it.

func TimePtr added in v0.35.0

func TimePtr(v time.Time) *time.Time

TimePtr is a helper routine that allocates a new time.Time value to store v and returns a pointer to it.

func Uint added in v0.36.0

func Uint(v *uint) uint

Uint is a helper routine that accepts a uint pointer and returns a value to it.

func Uint16 added in v0.36.0

func Uint16(v *uint16) uint16

Uint16 is a helper routine that accepts a uint16 pointer and returns a value to it.

func Uint16Map added in v0.36.0

func Uint16Map(src map[string]*uint16) map[string]uint16

Uint16Map converts a string map of uint16 pointers into a string map of uint16 values.

func Uint16Ptr added in v0.35.0

func Uint16Ptr(v uint16) *uint16

Uint16Ptr is a helper routine that allocates a new uint16 value to store v and returns a pointer to it.

func Uint16PtrMap added in v0.35.0

func Uint16PtrMap(src map[string]uint16) map[string]*uint16

Uint16PtrMap converts a string map of uint16 values into a string map of uint16 pointers.

func Uint16PtrSlice added in v0.35.0

func Uint16PtrSlice(src []uint16) []*uint16

Uint16PtrSlice converts a slice of uint16 values into a slice of uint16 pointers.

func Uint16Slice added in v0.36.0

func Uint16Slice(src []*uint16) []uint16

Uint16Slice converts a slice of uint16 pointers into a slice of uint16 values.

func Uint32 added in v0.36.0

func Uint32(v *uint32) uint32

Uint32 is a helper routine that accepts a uint32 pointer and returns a value to it.

func Uint32Map added in v0.36.0

func Uint32Map(src map[string]*uint32) map[string]uint32

Uint32Map converts a string map of uint32 pointers into a string map of uint32 values.

func Uint32Ptr added in v0.35.0

func Uint32Ptr(v uint32) *uint32

Uint32Ptr is a helper routine that allocates a new uint32 value to store v and returns a pointer to it.

func Uint32PtrMap added in v0.35.0

func Uint32PtrMap(src map[string]uint32) map[string]*uint32

Uint32PtrMap converts a string map of uint32 values into a string map of uint32 pointers.

func Uint32PtrSlice added in v0.35.0

func Uint32PtrSlice(src []uint32) []*uint32

Uint32PtrSlice converts a slice of uint32 values into a slice of uint32 pointers.

func Uint32Slice added in v0.36.0

func Uint32Slice(src []*uint32) []uint32

Uint32Slice converts a slice of uint32 pointers into a slice of uint32 values.

func Uint64 added in v0.36.0

func Uint64(v *uint64) uint64

Uint64 is a helper routine that accepts a uint64 pointer and returns a value to it.

func Uint64Map added in v0.36.0

func Uint64Map(src map[string]*uint64) map[string]uint64

Uint64Map converts a string map of uint64 pointers into a string map of uint64 values.

func Uint64Ptr added in v0.35.0

func Uint64Ptr(v uint64) *uint64

Uint64Ptr is a helper routine that allocates a new uint64 value to store v and returns a pointer to it.

func Uint64PtrMap added in v0.35.0

func Uint64PtrMap(src map[string]uint64) map[string]*uint64

Uint64PtrMap converts a string map of uint64 values into a string map of uint64 pointers.

func Uint64PtrSlice added in v0.35.0

func Uint64PtrSlice(src []uint64) []*uint64

Uint64PtrSlice converts a slice of uint64 values into a slice of uint64 pointers.

func Uint64Slice added in v0.36.0

func Uint64Slice(src []*uint64) []uint64

Uint64Slice converts a slice of uint64 pointers into a slice of uint64 values.

func Uint8 added in v0.36.0

func Uint8(v *uint8) uint8

Uint8 is a helper routine that accepts a uint8 pointer and returns a value to it.

func Uint8Map added in v0.36.0

func Uint8Map(src map[string]*uint8) map[string]uint8

Uint8Map converts a string map of uint8 pointers into a string map of uint8 values.

func Uint8Ptr added in v0.35.0

func Uint8Ptr(v uint8) *uint8

Uint8Ptr is a helper routine that allocates a new uint8 value to store v and returns a pointer to it.

func Uint8PtrMap added in v0.35.0

func Uint8PtrMap(src map[string]uint8) map[string]*uint8

Uint8PtrMap converts a string map of uint8 values into a string map of uint8 pointers.

func Uint8PtrSlice added in v0.35.0

func Uint8PtrSlice(src []uint8) []*uint8

Uint8PtrSlice converts a slice of uint8 values into a slice of uint8 pointers.

func Uint8Slice added in v0.36.0

func Uint8Slice(src []*uint8) []uint8

Uint8Slice converts a slice of uint8 pointers into a slice of uint8 values.

func UintMap added in v0.36.0

func UintMap(src map[string]*uint) map[string]uint

UintMap converts a string map of uint pointers uinto a string map of uint values.

func UintPtr added in v0.35.0

func UintPtr(v uint) *uint

UintPtr is a helper routine that allocates a new uint value to store v and returns a pointer to it.

func UintPtrMap added in v0.35.0

func UintPtrMap(src map[string]uint) map[string]*uint

UintPtrMap converts a string map of uint values uinto a string map of uint pointers.

func UintPtrSlice added in v0.35.0

func UintPtrSlice(src []uint) []*uint

UintPtrSlice converts a slice of uint values uinto a slice of uint pointers.

func UintSlice added in v0.36.0

func UintSlice(src []*uint) []uint

UintSlice converts a slice of uint pointers uinto a slice of uint values.

Types

type API added in v0.7.2

type API struct {
	APIKey            string
	APIEmail          string
	APIUserServiceKey string
	APIToken          string
	BaseURL           string
	UserAgent         string

	Debug bool
	// contains filtered or unexported fields
}

API holds the configuration for the current API client. A client should not be modified concurrently.

func New added in v0.7.2

func New(key, email string, opts ...Option) (*API, error)

New creates a new Cloudflare v4 API client.

func NewWithAPIToken added in v0.9.3

func NewWithAPIToken(token string, opts ...Option) (*API, error)

NewWithAPIToken creates a new Cloudflare v4 API client using API Tokens.

func NewWithUserServiceKey added in v0.9.0

func NewWithUserServiceKey(key string, opts ...Option) (*API, error)

NewWithUserServiceKey creates a new Cloudflare v4 API client using service key authentication.

func (*API) APITokens added in v0.13.5

func (api *API) APITokens(ctx context.Context) ([]APIToken, error)

APITokens returns all available API tokens.

API reference: https://api.cloudflare.com/#user-api-tokens-list-tokens

func (*API) AccessAuditLogs added in v0.12.1

func (api *API) AccessAuditLogs(ctx context.Context, accountID string, opts AccessAuditLogFilterOptions) ([]AccessAuditLogRecord, error)

AccessAuditLogs retrieves all audit logs for the Access service.

API reference: https://api.cloudflare.com/#access-requests-access-requests-audit

Example
api, err := cloudflare.New("deadbeef", "test@example.org")
if err != nil {
	log.Fatal(err)
}

filterOpts := cloudflare.AccessAuditLogFilterOptions{}
results, _ := api.AccessAuditLogs(context.Background(), "someaccountid", filterOpts)

for _, record := range results {
	b, _ := json.Marshal(record)
	fmt.Println(string(b))
}
Output:

func (*API) AccessBookmark added in v0.36.0

func (api *API) AccessBookmark(ctx context.Context, accountID, bookmarkID string) (AccessBookmark, error)

AccessBookmark returns a single bookmark based on the bookmark ID.

API reference: https://api.cloudflare.com/#access-bookmarks-access-bookmarks-details

func (*API) AccessBookmarks added in v0.36.0

func (api *API) AccessBookmarks(ctx context.Context, accountID string, pageOpts PaginationOptions) ([]AccessBookmark, ResultInfo, error)

AccessBookmarks returns all bookmarks within an account.

API reference: https://api.cloudflare.com/#access-bookmarks-list-access-bookmarks

func (*API) AccessKeysConfig added in v0.23.0

func (api *API) AccessKeysConfig(ctx context.Context, accountID string) (AccessKeysConfig, error)

AccessKeysConfig returns the Access Keys Configuration for an account.

API reference: https://api.cloudflare.com/#access-keys-configuration-get-access-keys-configuration

func (*API) Account added in v0.9.0

func (api *API) Account(ctx context.Context, accountID string) (Account, ResultInfo, error)

Account returns a single account based on the ID.

API reference: https://api.cloudflare.com/#accounts-account-details

func (*API) AccountAccessRule added in v0.10.0

func (api *API) AccountAccessRule(ctx context.Context, accountID string, accessRuleID string) (*AccessRuleResponse, error)

AccountAccessRule returns the details of an account's access rule.

API reference: https://api.cloudflare.com/#account-level-firewall-access-rule-access-rule-details

func (*API) AccountMember added in v0.9.0

func (api *API) AccountMember(ctx context.Context, accountID string, memberID string) (AccountMember, error)

AccountMember returns details of a single account member.

API reference: https://api.cloudflare.com/#account-members-member-details

func (*API) AccountMembers added in v0.9.0

func (api *API) AccountMembers(ctx context.Context, accountID string, pageOpts PaginationOptions) ([]AccountMember, ResultInfo, error)

AccountMembers returns all members of an account.

API reference: https://api.cloudflare.com/#accounts-list-accounts

func (*API) Accounts added in v0.9.0

func (api *API) Accounts(ctx context.Context, params AccountsListParams) ([]Account, ResultInfo, error)

Accounts returns all accounts the logged in user has access to.

API reference: https://api.cloudflare.com/#accounts-list-accounts

func (*API) ArgoSmartRouting added in v0.9.0

func (api *API) ArgoSmartRouting(ctx context.Context, zoneID string) (ArgoFeatureSetting, error)

ArgoSmartRouting returns the current settings for smart routing.

API reference: https://api.cloudflare.com/#argo-smart-routing-get-argo-smart-routing-setting

Example
package main

import (
	"context"
	"fmt"
	"log"

	cloudflare "github.com/cloudflare/cloudflare-go"
)

func main() {
	api, err := cloudflare.New("deadbeef", "test@example.org")
	if err != nil {
		log.Fatal(err)
	}

	smartRoutingSettings, err := api.ArgoSmartRouting(context.Background(), "01a7362d577a6c3019a474fd6f485823")
	if err != nil {
		log.Fatal(err)
	}

	fmt.Printf("smart routing is %s", smartRoutingSettings.Value)
}
Output:

func (*API) ArgoTieredCaching added in v0.9.0

func (api *API) ArgoTieredCaching(ctx context.Context, zoneID string) (ArgoFeatureSetting, error)

ArgoTieredCaching returns the current settings for tiered caching.

API reference: TBA.

Example
package main

import (
	"context"
	"fmt"
	"log"

	cloudflare "github.com/cloudflare/cloudflare-go"
)

func main() {
	api, err := cloudflare.New("deadbeef", "test@example.org")
	if err != nil {
		log.Fatal(err)
	}

	tieredCachingSettings, err := api.ArgoTieredCaching(context.Background(), "01a7362d577a6c3019a474fd6f485823")
	if err != nil {
		log.Fatal(err)
	}

	fmt.Printf("tiered caching is %s", tieredCachingSettings.Value)
}
Output:

func (*API) ArgoTunnel deprecated added in v0.13.7

func (api *API) ArgoTunnel(ctx context.Context, accountID, tunnelUUID string) (ArgoTunnel, error)

ArgoTunnel returns a single Argo tunnel.

API reference: https://api.cloudflare.com/#argo-tunnel-get-argo-tunnel

Deprecated: Use `Tunnel` instead.

func (*API) ArgoTunnels deprecated added in v0.13.7

func (api *API) ArgoTunnels(ctx context.Context, accountID string) ([]ArgoTunnel, error)

ArgoTunnels lists all tunnels.

API reference: https://api.cloudflare.com/#argo-tunnel-list-argo-tunnels

Deprecated: Use `Tunnels` instead.

func (*API) AttachWorkersDomain added in v0.55.0

func (api *API) AttachWorkersDomain(ctx context.Context, rc *ResourceContainer, domain AttachWorkersDomainParams) (WorkersDomain, error)

AttachWorkersDomain attaches a worker to a zone and hostname.

API reference: https://developers.cloudflare.com/api/operations/worker-domain-attach-to-domain

func (*API) AvailableZonePlans added in v0.7.2

func (api *API) AvailableZonePlans(ctx context.Context, zoneID string) ([]ZonePlan, error)

AvailableZonePlans returns information about all plans available to the specified zone.

API reference: https://api.cloudflare.com/#zone-rate-plan-list-available-plans

func (*API) AvailableZoneRatePlans added in v0.7.4

func (api *API) AvailableZoneRatePlans(ctx context.Context, zoneID string) ([]ZoneRatePlan, error)

AvailableZoneRatePlans returns information about all plans available to the specified zone.

API reference: https://api.cloudflare.com/#zone-plan-available-plans

func (*API) CancelRegistrarDomainTransfer added in v0.9.0

func (api *API) CancelRegistrarDomainTransfer(ctx context.Context, accountID, domainName string) ([]RegistrarDomain, error)

CancelRegistrarDomainTransfer cancels a pending domain transfer.

API reference: https://api.cloudflare.com/#registrar-domains-cancel-transfer

Example
api, err := cloudflare.New(apiKey, user)
if err != nil {
	log.Fatal(err)
}

domains, err := api.CancelRegistrarDomainTransfer(context.Background(), "01a7362d577a6c3019a474fd6f485823", "cloudflare.com")
if err != nil {
	log.Fatal(err)
}

fmt.Printf("%+v\n", domains)
Output:

func (*API) CertificatePack added in v0.13.0

func (api *API) CertificatePack(ctx context.Context, zoneID, certificatePackID string) (CertificatePack, error)

CertificatePack returns a single TLS certificate pack on a zone.

API Reference: https://api.cloudflare.com/#certificate-packs-get-certificate-pack

func (*API) ChangePageRule added in v0.7.2

func (api *API) ChangePageRule(ctx context.Context, zoneID, ruleID string, rule PageRule) error

ChangePageRule lets you change individual settings for a Page Rule. This is in contrast to UpdatePageRule which replaces the entire Page Rule.

API reference: https://api.cloudflare.com/#page-rules-for-a-zone-change-a-page-rule

func (*API) ChangeWaitingRoom added in v0.17.0

func (api *API) ChangeWaitingRoom(ctx context.Context, zoneID, waitingRoomID string, waitingRoom WaitingRoom) (WaitingRoom, error)

ChangeWaitingRoom lets you change individual settings for a Waiting room. This is in contrast to UpdateWaitingRoom which replaces the entire Waiting room.

API reference: https://api.cloudflare.com/#waiting-room-update-waiting-room

func (*API) ChangeWaitingRoomEvent added in v0.33.0

func (api *API) ChangeWaitingRoomEvent(ctx context.Context, zoneID, waitingRoomID string, waitingRoomEvent WaitingRoomEvent) (WaitingRoomEvent, error)

ChangeWaitingRoomEvent lets you change individual settings for a Waiting Room Event. This is in contrast to UpdateWaitingRoomEvent which replaces the entire Waiting Room Event.

API reference: https://api.cloudflare.com/#waiting-room-patch-event

func (*API) CheckLogpushDestinationExists added in v0.9.0

func (api *API) CheckLogpushDestinationExists(ctx context.Context, rc *ResourceContainer, destinationConf string) (bool, error)

CheckLogpushDestinationExists returns zone-level destination exists check result.

API reference: https://api.cloudflare.com/#logpush-jobs-check-destination-exists

Example
api, err := cloudflare.New(apiKey, user)
if err != nil {
	log.Fatal(err)
}

zoneID, err := api.ZoneIDByName(domain)
if err != nil {
	log.Fatal(err)
}

exists, err := api.CheckLogpushDestinationExists(context.Background(), cloudflare.ZoneIdentifier(zoneID), "destination_conf")
if err != nil {
	log.Fatal(err)
}

fmt.Printf("%+v\n", exists)
Output:

func (*API) CleanupArgoTunnelConnections deprecated added in v0.13.7

func (api *API) CleanupArgoTunnelConnections(ctx context.Context, accountID, tunnelUUID string) error

CleanupArgoTunnelConnections deletes any inactive connections on a tunnel.

API reference: https://api.cloudflare.com/#argo-tunnel-clean-up-argo-tunnel-connections

Deprecated: Use `CleanupTunnelConnections` instead.

func (*API) CleanupTunnelConnections added in v0.39.0

func (api *API) CleanupTunnelConnections(ctx context.Context, rc *ResourceContainer, tunnelID string) error

CleanupTunnelConnections deletes any inactive connections on a tunnel.

API reference: https://api.cloudflare.com/#cloudflare-tunnel-clean-up-cloudflare-tunnel-connections

func (*API) CreateAPIShieldOperations added in v0.78.0

func (api *API) CreateAPIShieldOperations(ctx context.Context, rc *ResourceContainer, params CreateAPIShieldOperationsParams) ([]APIShieldOperation, error)

CreateAPIShieldOperations add one or more operations to a zone.

API documentation https://developers.cloudflare.com/api/operations/api-shield-endpoint-management-add-operations-to-a-zone

func (*API) CreateAPIShieldSchema added in v0.79.0

func (api *API) CreateAPIShieldSchema(ctx context.Context, rc *ResourceContainer, params CreateAPIShieldSchemaParams) (*APIShieldCreateSchemaResult, error)

CreateAPIShieldSchema uploads a schema to a zone

API documentation: https://developers.cloudflare.com/api/operations/api-shield-schema-validation-post-schema

func (*API) CreateAPIToken added in v0.13.5

func (api *API) CreateAPIToken(ctx context.Context, token APIToken) (APIToken, error)

CreateAPIToken creates a new token. Returns the API token that has been generated.

The token value itself is only shown once (post create) and will present as `Value` from this method. If you fail to capture it at this point, you will need to roll the token in order to get a new value.

API reference: https://api.cloudflare.com/#user-api-tokens-create-token

func (*API) CreateAccessBookmark added in v0.36.0

func (api *API) CreateAccessBookmark(ctx context.Context, accountID string, accessBookmark AccessBookmark) (AccessBookmark, error)

CreateAccessBookmark creates a new access bookmark.

API reference: https://api.cloudflare.com/#access-bookmarks-create-access-bookmark

func (*API) CreateAccessCustomPage added in v0.74.0

func (api *API) CreateAccessCustomPage(ctx context.Context, rc *ResourceContainer, params CreateAccessCustomPageParams) (AccessCustomPage, error)

func (*API) CreateAccessOrganization added in v0.10.1

func (api *API) CreateAccessOrganization(ctx context.Context, rc *ResourceContainer, params CreateAccessOrganizationParams) (AccessOrganization, error)

func (*API) CreateAccessServiceToken added in v0.10.1

func (*API) CreateAccessTag added in v0.78.0

func (api *API) CreateAccessTag(ctx context.Context, rc *ResourceContainer, params CreateAccessTagParams) (AccessTag, error)

func (*API) CreateAccount added in v0.13.8

func (api *API) CreateAccount(ctx context.Context, account Account) (Account, error)

CreateAccount creates a new account. Note: This requires the Tenant entitlement.

API reference: https://developers.cloudflare.com/tenant/tutorial/provisioning-resources#creating-an-account

func (*API) CreateAccountAccessRule added in v0.10.0

func (api *API) CreateAccountAccessRule(ctx context.Context, accountID string, accessRule AccessRule) (*AccessRuleResponse, error)

CreateAccountAccessRule creates a firewall access rule for the given account identifier.

API reference: https://api.cloudflare.com/#account-level-firewall-access-rule-create-access-rule

func (*API) CreateAccountMember added in v0.9.0

func (api *API) CreateAccountMember(ctx context.Context, rc *ResourceContainer, params CreateAccountMemberParams) (AccountMember, error)

CreateAccountMember invites a new member to join an account with roles. The member will be placed into "pending" status and receive an email confirmation. NOTE: If you are currently enrolled in Domain Scoped Roles, your roles will be converted to policies upon member invitation.

API reference: https://api.cloudflare.com/#account-members-add-member

func (*API) CreateAccountMemberWithStatus deprecated added in v0.25.0

func (api *API) CreateAccountMemberWithStatus(ctx context.Context, accountID string, emailAddress string, roles []string, status string) (AccountMember, error)

CreateAccountMemberWithStatus invites a new member to join an account, allowing setting the status.

Refer to the API reference for valid statuses.

Deprecated: Use `CreateAccountMember` with a `Status` field instead.

API reference: https://api.cloudflare.com/#account-members-add-member

func (*API) CreateAddressMap added in v0.63.0

func (api *API) CreateAddressMap(ctx context.Context, rc *ResourceContainer, params CreateAddressMapParams) (AddressMap, error)

CreateAddressMap creates a new address map under the account.

API reference: https://developers.cloudflare.com/api/operations/ip-address-management-address-maps-create-address-map

func (*API) CreateArgoTunnel deprecated added in v0.13.7

func (api *API) CreateArgoTunnel(ctx context.Context, accountID, name, secret string) (ArgoTunnel, error)

CreateArgoTunnel creates a new tunnel for the account.

API reference: https://api.cloudflare.com/#argo-tunnel-create-argo-tunnel

Deprecated: Use `CreateTunnel` instead.

func (*API) CreateCertificatePack added in v0.13.0

func (api *API) CreateCertificatePack(ctx context.Context, zoneID string, cert CertificatePackRequest) (CertificatePack, error)

CreateCertificatePack creates a new certificate pack associated with a zone.

API Reference: https://api.cloudflare.com/#certificate-packs-order-advanced-certificate-manager-certificate-pack

func (*API) CreateCustomHostname added in v0.7.4

func (api *API) CreateCustomHostname(ctx context.Context, zoneID string, ch CustomHostname) (*CustomHostnameResponse, error)

CreateCustomHostname creates a new custom hostname and requests that an SSL certificate be issued for it.

API reference: https://api.cloudflare.com/#custom-hostname-for-a-zone-create-custom-hostname

func (*API) CreateCustomNameservers added in v0.70.0

func (api *API) CreateCustomNameservers(ctx context.Context, rc *ResourceContainer, params CreateCustomNameserversParams) (CustomNameserverResult, error)

CreateCustomNameservers adds a custom nameserver.

API documentation: https://developers.cloudflare.com/api/operations/account-level-custom-nameservers-add-account-custom-nameserver

func (*API) CreateD1Database added in v0.79.0

func (api *API) CreateD1Database(ctx context.Context, rc *ResourceContainer, params CreateD1DatabaseParams) (D1Database, error)

CreateD1Database creates a new database for an account.

API reference: https://developers.cloudflare.com/api/operations/cloudflare-d1-create-database

func (*API) CreateDLPDataset added in v0.87.0

func (api *API) CreateDLPDataset(ctx context.Context, rc *ResourceContainer, params CreateDLPDatasetParams) (CreateDLPDatasetResult, error)

CreateDLPDataset creates a DLP dataset.

API reference: https://developers.cloudflare.com/api/operations/dlp-datasets-create

func (*API) CreateDLPDatasetUpload added in v0.87.0

func (api *API) CreateDLPDatasetUpload(ctx context.Context, rc *ResourceContainer, params CreateDLPDatasetUploadParams) (CreateDLPDatasetUploadResult, error)

CreateDLPDatasetUpload creates a new upload version for the specified DLP dataset.

API reference: https://developers.cloudflare.com/api/operations/dlp-datasets-create-version

func (*API) CreateDLPProfiles added in v0.53.0

func (api *API) CreateDLPProfiles(ctx context.Context, rc *ResourceContainer, params CreateDLPProfilesParams) ([]DLPProfile, error)

CreateDLPProfiles creates a set of DLP Profile.

API reference: https://api.cloudflare.com/#dlp-profiles-create-custom-profiles

func (*API) CreateDNSFirewallCluster added in v0.29.0

func (api *API) CreateDNSFirewallCluster(ctx context.Context, rc *ResourceContainer, params CreateDNSFirewallClusterParams) (*DNSFirewallCluster, error)

CreateDNSFirewallCluster creates a new DNS Firewall cluster.

API reference: https://api.cloudflare.com/#dns-firewall-create-dns-firewall-cluster

func (*API) CreateDNSRecord added in v0.7.2

func (api *API) CreateDNSRecord(ctx context.Context, rc *ResourceContainer, params CreateDNSRecordParams) (DNSRecord, error)

CreateDNSRecord creates a DNS record for the zone identifier.

API reference: https://api.cloudflare.com/#dns-records-for-a-zone-create-dns-record

func (*API) CreateDataLocalizationRegionalHostname added in v0.66.0

func (api *API) CreateDataLocalizationRegionalHostname(ctx context.Context, rc *ResourceContainer, params CreateDataLocalizationRegionalHostnameParams) (RegionalHostname, error)

CreateDataLocalizationRegionalHostname lists all regional hostnames for a zone.

API reference: https://developers.cloudflare.com/data-localization/regional-services/get-started/#configure-regional-services-via-api

func (*API) CreateDeviceDexTest added in v0.62.0

func (api *API) CreateDeviceDexTest(ctx context.Context, rc *ResourceContainer, params CreateDeviceDexTestParams) (DeviceDexTest, error)

CreateDeviceDexTest created a new Device Dex Test

API reference: https://developers.cloudflare.com/api/operations/device-dex-test-create-device-dex-test

func (*API) CreateDeviceManagedNetwork added in v0.57.0

func (api *API) CreateDeviceManagedNetwork(ctx context.Context, rc *ResourceContainer, params CreateDeviceManagedNetworkParams) (DeviceManagedNetwork, error)

CreateDeviceManagedNetwork creates a new Device Managed Network.

API reference: https://api.cloudflare.com/#device-managed-networks-create-device-managed-network

func (*API) CreateDevicePostureIntegration added in v0.29.0

func (api *API) CreateDevicePostureIntegration(ctx context.Context, accountID string, integration DevicePostureIntegration) (DevicePostureIntegration, error)

CreateDevicePostureIntegration creates a device posture integration within an account.

API reference: https://api.cloudflare.com/#device-posture-integrations-create-device-posture-integration

func (*API) CreateDevicePostureRule added in v0.17.0

func (api *API) CreateDevicePostureRule(ctx context.Context, accountID string, rule DevicePostureRule) (DevicePostureRule, error)

CreateDevicePostureRule creates a new device posture rule.

API reference: https://api.cloudflare.com/#device-posture-rules-create-device-posture-rule

func (*API) CreateDeviceSettingsPolicy added in v0.52.0

func (api *API) CreateDeviceSettingsPolicy(ctx context.Context, rc *ResourceContainer, params CreateDeviceSettingsPolicyParams) (DeviceSettingsPolicy, error)

CreateDeviceSettingsPolicy creates a settings policy against devices that match the policy.

API reference: https://api.cloudflare.com/#devices-create-device-settings-policy

func (*API) CreateEmailRoutingDestinationAddress added in v0.47.0

func (api *API) CreateEmailRoutingDestinationAddress(ctx context.Context, rc *ResourceContainer, params CreateEmailRoutingAddressParameters) (EmailRoutingDestinationAddress, error)

CreateEmailRoutingDestinationAddress Create a destination address to forward your emails to. Destination addresses need to be verified before they become active.

API reference: https://api.cloudflare.com/#email-routing-destination-addresses-create-a-destination-address

func (*API) CreateEmailRoutingRule added in v0.47.0

func (api *API) CreateEmailRoutingRule(ctx context.Context, rc *ResourceContainer, params CreateEmailRoutingRuleParameters) (EmailRoutingRule, error)

CreateEmailRoutingRule Rules consist of a set of criteria for matching emails (such as an email being sent to a specific custom email address) plus a set of actions to take on the email (like forwarding it to a specific destination address).

API reference: https://api.cloudflare.com/#email-routing-routing-rules-create-routing-rule

func (*API) CreateFilters added in v0.9.0

func (api *API) CreateFilters(ctx context.Context, rc *ResourceContainer, params []FilterCreateParams) ([]Filter, error)

CreateFilters creates new filters.

API reference: https://developers.cloudflare.com/firewall/api/cf-filters/post/

func (*API) CreateFirewallRules added in v0.9.0

func (api *API) CreateFirewallRules(ctx context.Context, rc *ResourceContainer, params []FirewallRuleCreateParams) ([]FirewallRule, error)

CreateFirewallRules creates new firewall rules.

API reference: https://developers.cloudflare.com/firewall/api/cf-firewall-rules/post/

func (*API) CreateHealthcheck added in v0.11.1

func (api *API) CreateHealthcheck(ctx context.Context, zoneID string, healthcheck Healthcheck) (Healthcheck, error)

CreateHealthcheck creates a new healthcheck in a zone.

API reference: https://api.cloudflare.com/#health-checks-create-health-check

func (*API) CreateHealthcheckPreview added in v0.11.5

func (api *API) CreateHealthcheckPreview(ctx context.Context, zoneID string, healthcheck Healthcheck) (Healthcheck, error)

CreateHealthcheckPreview creates a new preview of a healthcheck in a zone.

API reference: https://api.cloudflare.com/#health-checks-create-preview-health-check

func (*API) CreateHyperdriveConfig added in v0.88.0

func (api *API) CreateHyperdriveConfig(ctx context.Context, rc *ResourceContainer, params CreateHyperdriveConfigParams) (HyperdriveConfig, error)

CreateHyperdriveConfig creates a new Hyperdrive config.

API reference: https://developers.cloudflare.com/api/operations/create-hyperdrive

func (*API) CreateIPAddressToAddressMap added in v0.63.0

func (api *API) CreateIPAddressToAddressMap(ctx context.Context, rc *ResourceContainer, params CreateIPAddressToAddressMapParams) error

CreateIPAddressToAddressMap adds an IP address from a prefix owned by the account to a particular address map.

API reference: https://developers.cloudflare.com/api/operations/ip-address-management-address-maps-add-an-ip-to-an-address-map

func (*API) CreateIPList deprecated added in v0.13.0

func (api *API) CreateIPList(ctx context.Context, accountID, name, description, kind string) (IPList,
	error)

CreateIPList creates a new IP List.

API reference: https://api.cloudflare.com/#rules-lists-create-list

Deprecated: Use `CreateList` instead.

func (*API) CreateIPListItem deprecated added in v0.13.0

func (api *API) CreateIPListItem(ctx context.Context, accountID, ID, ip, comment string) ([]IPListItem, error)

CreateIPListItem creates a new IP List Item synchronously and returns the current set of IP List Items.

Deprecated: Use `CreateListItem` instead.

func (*API) CreateIPListItemAsync deprecated added in v0.13.0

func (api *API) CreateIPListItemAsync(ctx context.Context, accountID, ID, ip, comment string) (IPListItemCreateResponse, error)

CreateIPListItemAsync creates a new IP List Item asynchronously. Users have to poll the operation status by using the operation_id returned by this function.

API reference: https://api.cloudflare.com/#rules-lists-create-list-items

Deprecated: Use `CreateListItemAsync` instead.

func (*API) CreateIPListItems deprecated added in v0.13.0

func (api *API) CreateIPListItems(ctx context.Context, accountID, ID string, items []IPListItemCreateRequest) (
	[]IPListItem, error)

CreateIPListItems bulk creates many IP List Items synchronously and returns the current set of IP List Items.

Deprecated: Use `CreateListItems` instead.

func (*API) CreateIPListItemsAsync deprecated added in v0.13.0

func (api *API) CreateIPListItemsAsync(ctx context.Context, accountID, ID string, items []IPListItemCreateRequest) (
	IPListItemCreateResponse, error)

CreateIPListItemsAsync bulk creates many IP List Items asynchronously. Users have to poll the operation status by using the operation_id returned by this function.

API reference: https://api.cloudflare.com/#rules-lists-create-list-items

Deprecated: Use `CreateListItemsAsync` instead.

func (*API) CreateImageDirectUploadURL added in v0.30.0

func (api *API) CreateImageDirectUploadURL(ctx context.Context, rc *ResourceContainer, params CreateImageDirectUploadURLParams) (ImageDirectUploadURL, error)

CreateImageDirectUploadURL creates an authenticated direct upload url.

API Reference: https://api.cloudflare.com/#cloudflare-images-create-authenticated-direct-upload-url

func (*API) CreateImagesVariant added in v0.88.0

func (api *API) CreateImagesVariant(ctx context.Context, rc *ResourceContainer, params CreateImagesVariantParams) (ImagesVariant, error)

Specify variants that allow you to resize images for different use cases.

API Reference: https://developers.cloudflare.com/api/operations/cloudflare-images-variants-create-a-variant

func (*API) CreateKeylessSSL added in v0.17.0

func (api *API) CreateKeylessSSL(ctx context.Context, zoneID string, keylessSSL KeylessSSLCreateRequest) (KeylessSSL, error)

CreateKeylessSSL creates a new Keyless SSL configuration for the zone.

API reference: https://api.cloudflare.com/#keyless-ssl-for-a-zone-create-keyless-ssl-configuration

func (*API) CreateList added in v0.41.0

func (api *API) CreateList(ctx context.Context, rc *ResourceContainer, params ListCreateParams) (List, error)

CreateList creates a new List.

API reference: https://api.cloudflare.com/#rules-lists-create-list

func (*API) CreateListItem added in v0.41.0

func (api *API) CreateListItem(ctx context.Context, rc *ResourceContainer, params ListCreateItemParams) ([]ListItem, error)

CreateListItem creates a new List Item synchronously and returns the current set of List Items.

func (*API) CreateListItemAsync added in v0.41.0

func (api *API) CreateListItemAsync(ctx context.Context, rc *ResourceContainer, params ListCreateItemParams) (ListItemCreateResponse, error)

CreateListItemAsync creates a new List Item asynchronously. Users have to poll the operation status by using the operation_id returned by this function.

API reference: https://api.cloudflare.com/#rules-lists-create-list-items

func (*API) CreateListItems added in v0.41.0

func (api *API) CreateListItems(ctx context.Context, rc *ResourceContainer, params ListCreateItemsParams) ([]ListItem, error)

CreateListItems bulk creates multiple List Items synchronously and returns the current set of List Items.

func (*API) CreateListItemsAsync added in v0.41.0

func (api *API) CreateListItemsAsync(ctx context.Context, rc *ResourceContainer, params ListCreateItemsParams) (ListItemCreateResponse, error)

CreateListItemsAsync bulk creates multiple List Items asynchronously. Users have to poll the operation status by using the operation_id returned by this function.

API reference: https://api.cloudflare.com/#rules-lists-create-list-items

func (*API) CreateLoadBalancer added in v0.8.0

func (api *API) CreateLoadBalancer(ctx context.Context, rc *ResourceContainer, params CreateLoadBalancerParams) (LoadBalancer, error)

CreateLoadBalancer creates a new load balancer.

API reference: https://api.cloudflare.com/#load-balancers-create-load-balancer

func (*API) CreateLoadBalancerMonitor added in v0.8.0

func (api *API) CreateLoadBalancerMonitor(ctx context.Context, rc *ResourceContainer, params CreateLoadBalancerMonitorParams) (LoadBalancerMonitor, error)

CreateLoadBalancerMonitor creates a new load balancer monitor.

API reference: https://api.cloudflare.com/#load-balancer-monitors-create-monitor

func (*API) CreateLoadBalancerPool added in v0.8.0

func (api *API) CreateLoadBalancerPool(ctx context.Context, rc *ResourceContainer, params CreateLoadBalancerPoolParams) (LoadBalancerPool, error)

CreateLoadBalancerPool creates a new load balancer pool.

API reference: https://api.cloudflare.com/#load-balancer-pools-create-pool

func (*API) CreateLogpushJob added in v0.9.0

func (api *API) CreateLogpushJob(ctx context.Context, rc *ResourceContainer, params CreateLogpushJobParams) (*LogpushJob, error)

CreateLogpushJob creates a new zone-level Logpush Job.

API reference: https://api.cloudflare.com/#logpush-jobs-create-logpush-job

Example
api, err := cloudflare.New(apiKey, user)
if err != nil {
	log.Fatal(err)
}

zoneID, err := api.ZoneIDByName(domain)
if err != nil {
	log.Fatal(err)
}

job, err := api.CreateLogpushJob(context.Background(), cloudflare.ZoneIdentifier(zoneID), cloudflare.CreateLogpushJobParams{
	Enabled:         false,
	Name:            "example.com",
	LogpullOptions:  "fields=RayID,ClientIP,EdgeStartTimestamp&timestamps=rfc3339",
	DestinationConf: "s3://mybucket/logs?region=us-west-2",
})
if err != nil {
	log.Fatal(err)
}

fmt.Printf("%+v\n", job)
Output:

func (*API) CreateMTLSCertificate added in v0.58.0

func (api *API) CreateMTLSCertificate(ctx context.Context, rc *ResourceContainer, params CreateMTLSCertificateParams) (MTLSCertificate, error)

CreateMTLSCertificate will create the provided certificate for use with mTLS enabled Cloudflare services.

API reference: https://api.cloudflare.com/#mtls-certificate-management-upload-mtls-certificate

func (*API) CreateMagicFirewallRuleset deprecated added in v0.13.7

func (api *API) CreateMagicFirewallRuleset(ctx context.Context, accountID, name, description string, rules []MagicFirewallRulesetRule) (MagicFirewallRuleset, error)

CreateMagicFirewallRuleset creates a Magic Firewall ruleset

API reference: https://api.cloudflare.com/#rulesets-list-rulesets

Deprecated: Use `CreateZoneRuleset` or `CreateAccountRuleset` instead.

func (*API) CreateMagicTransitGRETunnels added in v0.32.0

func (api *API) CreateMagicTransitGRETunnels(ctx context.Context, accountID string, tunnels []MagicTransitGRETunnel) ([]MagicTransitGRETunnel, error)

CreateMagicTransitGRETunnels creates one or more GRE tunnels.

API reference: https://api.cloudflare.com/#magic-gre-tunnels-create-gre-tunnels

func (*API) CreateMagicTransitIPsecTunnels added in v0.31.0

func (api *API) CreateMagicTransitIPsecTunnels(ctx context.Context, accountID string, tunnels []MagicTransitIPsecTunnel) ([]MagicTransitIPsecTunnel, error)

CreateMagicTransitIPsecTunnels creates one or more IPsec tunnels

API reference: https://api.cloudflare.com/#magic-ipsec-tunnels-create-ipsec-tunnels

func (*API) CreateMagicTransitStaticRoute added in v0.18.0

func (api *API) CreateMagicTransitStaticRoute(ctx context.Context, accountID string, route MagicTransitStaticRoute) ([]MagicTransitStaticRoute, error)

CreateMagicTransitStaticRoute creates a new static route

API reference: https://api.cloudflare.com/#magic-transit-static-routes-create-routes

func (*API) CreateMiscategorization added in v0.45.0

func (api *API) CreateMiscategorization(ctx context.Context, params MisCategorizationParameters) error

CreateMiscategorization creates a miscatergorization.

API Reference: https://api.cloudflare.com/#miscategorization-create-miscategorization

func (*API) CreateNotificationPolicy added in v0.19.0

func (api *API) CreateNotificationPolicy(ctx context.Context, accountID string, policy NotificationPolicy) (SaveResponse, error)

CreateNotificationPolicy creates a notification policy for an account.

API Reference: https://api.cloudflare.com/#notification-policies-create-notification-policy

func (*API) CreateNotificationWebhooks added in v0.19.0

func (api *API) CreateNotificationWebhooks(ctx context.Context, accountID string, webhooks *NotificationUpsertWebhooks) (SaveResponse, error)

CreateNotificationWebhooks will help connect a webhooks destination. A test message will be sent to the webhooks endpoint during creation. If added successfully, the webhooks can be setup as a destination mechanism while creating policies.

Notifications will be posted to this URL.

API Reference: https://api.cloudflare.com/#notification-webhooks-create-webhook

func (*API) CreateObservatoryPageTest added in v0.78.0

func (api *API) CreateObservatoryPageTest(ctx context.Context, rc *ResourceContainer, params CreateObservatoryPageTestParams) (*ObservatoryPageTest, error)

CreateObservatoryPageTest starts a test for a page in a specific region.

API reference: https://api.cloudflare.com/#speed-create-test

func (*API) CreateObservatoryScheduledPageTest added in v0.78.0

func (api *API) CreateObservatoryScheduledPageTest(ctx context.Context, rc *ResourceContainer, params CreateObservatoryScheduledPageTestParams) (*ObservatoryScheduledPageTest, error)

CreateObservatoryScheduledPageTest creates a scheduled test for a page in a specific region.

API reference: https://api.cloudflare.com/#speed-create-scheduled-test

func (*API) CreateOriginCACertificate added in v0.58.0

func (api *API) CreateOriginCACertificate(ctx context.Context, params CreateOriginCertificateParams) (*OriginCACertificate, error)

CreateOriginCACertificate creates a Cloudflare-signed certificate.

API reference: https://api.cloudflare.com/#cloudflare-ca-create-certificate

func (*API) CreatePageRule added in v0.7.2

func (api *API) CreatePageRule(ctx context.Context, zoneID string, rule PageRule) (*PageRule, error)

CreatePageRule creates a new Page Rule for a zone.

API reference: https://api.cloudflare.com/#page-rules-for-a-zone-create-a-page-rule

Example
api, err := cloudflare.New(apiKey, user)
if err != nil {
	log.Fatal(err)
}

zoneID, err := api.ZoneIDByName(domain)
if err != nil {
	log.Fatal(err)
}

pageRule, err := api.CreatePageRule(context.Background(), zoneID, exampleNewPageRule)
if err != nil {
	log.Fatal(err)
}

fmt.Printf("%+v\n", pageRule)
Output:

func (*API) CreatePageShieldPolicy added in v0.84.0

func (api *API) CreatePageShieldPolicy(ctx context.Context, rc *ResourceContainer, params CreatePageShieldPolicyParams) (*PageShieldPolicy, error)

CreatePageShieldPolicy creates a page shield policy for a zone.

API documentation: https://developers.cloudflare.com/api/operations/page-shield-create-page-shield-policy

func (*API) CreatePagesDeployment added in v0.40.0

func (api *API) CreatePagesDeployment(ctx context.Context, rc *ResourceContainer, params CreatePagesDeploymentParams) (PagesProjectDeployment, error)

CreatePagesDeployment creates a Pages production deployment.

API reference: https://api.cloudflare.com/#pages-deployment-create-deployment

func (*API) CreatePagesProject added in v0.26.0

func (api *API) CreatePagesProject(ctx context.Context, rc *ResourceContainer, params CreatePagesProjectParams) (PagesProject, error)

CreatePagesProject creates a new Pages project in an account.

API reference: https://api.cloudflare.com/#pages-project-create-project

func (*API) CreateQueue added in v0.55.0

func (api *API) CreateQueue(ctx context.Context, rc *ResourceContainer, queue CreateQueueParams) (Queue, error)

CreateQueue creates a new queue.

API reference: https://api.cloudflare.com/#queue-create-queue

func (*API) CreateQueueConsumer added in v0.55.0

func (api *API) CreateQueueConsumer(ctx context.Context, rc *ResourceContainer, params CreateQueueConsumerParams) (QueueConsumer, error)

CreateQueueConsumer creates a new consumer for a queue.

API reference: https://api.cloudflare.com/#queue-create-queue-consumer

func (*API) CreateR2Bucket added in v0.47.0

func (api *API) CreateR2Bucket(ctx context.Context, rc *ResourceContainer, params CreateR2BucketParameters) (R2Bucket, error)

CreateR2Bucket Creates a new R2 bucket.

API reference: https://api.cloudflare.com/#r2-bucket-create-bucket

func (*API) CreateRateLimit added in v0.8.5

func (api *API) CreateRateLimit(ctx context.Context, zoneID string, limit RateLimit) (RateLimit, error)

CreateRateLimit creates a new rate limit for a zone.

API reference: https://api.cloudflare.com/#rate-limits-for-a-zone-create-a-ratelimit

Example
api, err := cloudflare.New(apiKey, user)
if err != nil {
	log.Fatal(err)
}

zoneID, err := api.ZoneIDByName(domain)
if err != nil {
	log.Fatal(err)
}

rateLimit, err := api.CreateRateLimit(context.Background(), zoneID, exampleNewRateLimit)
if err != nil {
	log.Fatal(err)
}

fmt.Printf("%+v\n", rateLimit)
Output:

func (*API) CreateRuleset added in v0.73.0

func (api *API) CreateRuleset(ctx context.Context, rc *ResourceContainer, params CreateRulesetParams) (Ruleset, error)

CreateRuleset creates a new ruleset.

API reference: https://developers.cloudflare.com/api/operations/createAccountRuleset API reference: https://developers.cloudflare.com/api/operations/createZoneRuleset

func (*API) CreateSSL added in v0.7.2

func (api *API) CreateSSL(ctx context.Context, zoneID string, options ZoneCustomSSLOptions) (ZoneCustomSSL, error)

CreateSSL allows you to add a custom SSL certificate to the given zone.

API reference: https://api.cloudflare.com/#custom-ssl-for-a-zone-create-ssl-configuration

func (*API) CreateSecondaryDNSPrimary added in v0.15.0

func (api *API) CreateSecondaryDNSPrimary(ctx context.Context, accountID string, primary SecondaryDNSPrimary) (SecondaryDNSPrimary, error)

CreateSecondaryDNSPrimary creates a secondary DNS primary.

API reference: https://api.cloudflare.com/#secondary-dns-primary--create-primary

func (*API) CreateSecondaryDNSTSIG added in v0.15.0

func (api *API) CreateSecondaryDNSTSIG(ctx context.Context, accountID string, tsig SecondaryDNSTSIG) (SecondaryDNSTSIG, error)

CreateSecondaryDNSTSIG creates a secondary DNS TSIG at the account level.

API reference: https://api.cloudflare.com/#secondary-dns-tsig--create-tsig

func (*API) CreateSecondaryDNSZone added in v0.15.0

func (api *API) CreateSecondaryDNSZone(ctx context.Context, zoneID string, zone SecondaryDNSZone) (SecondaryDNSZone, error)

CreateSecondaryDNSZone creates a secondary DNS zone.

API reference: https://api.cloudflare.com/#secondary-dns-create-secondary-zone-configuration

func (*API) CreateSpectrumApplication added in v0.9.0

func (api *API) CreateSpectrumApplication(ctx context.Context, zoneID string, appDetails SpectrumApplication) (SpectrumApplication, error)

CreateSpectrumApplication creates a new Spectrum application.

API reference: https://developers.cloudflare.com/spectrum/api-reference/#create-a-spectrum-application

func (*API) CreateTeamsList added in v0.17.0

func (api *API) CreateTeamsList(ctx context.Context, rc *ResourceContainer, params CreateTeamsListParams) (TeamsList, error)

CreateTeamsList creates a new teams list.

API reference: https://api.cloudflare.com/#teams-lists-create-teams-list

func (*API) CreateTeamsLocation added in v0.21.0

func (api *API) CreateTeamsLocation(ctx context.Context, accountID string, teamsLocation TeamsLocation) (TeamsLocation, error)

CreateTeamsLocation creates a new teams location.

API reference: https://api.cloudflare.com/#teams-locations-create-teams-location

func (*API) CreateTeamsProxyEndpoint added in v0.35.0

func (api *API) CreateTeamsProxyEndpoint(ctx context.Context, accountID string, proxyEndpoint TeamsProxyEndpoint) (TeamsProxyEndpoint, error)

CreateTeamsProxyEndpoint creates a new proxy endpoint.

API reference: https://api.cloudflare.com/#zero-trust-gateway-proxy-endpoints-create-proxy-endpoint

func (*API) CreateTunnel added in v0.39.0

func (api *API) CreateTunnel(ctx context.Context, rc *ResourceContainer, params TunnelCreateParams) (Tunnel, error)

CreateTunnel creates a new tunnel for the account.

API reference: https://api.cloudflare.com/#cloudflare-tunnel-create-cloudflare-tunnel

func (*API) CreateTunnelRoute added in v0.36.0

func (api *API) CreateTunnelRoute(ctx context.Context, rc *ResourceContainer, params TunnelRoutesCreateParams) (TunnelRoute, error)

CreateTunnelRoute add a new route to the account routing table for the given tunnel.

See: https://api.cloudflare.com/#tunnel-route-create-route

func (*API) CreateTunnelVirtualNetwork added in v0.41.0

func (api *API) CreateTunnelVirtualNetwork(ctx context.Context, rc *ResourceContainer, params TunnelVirtualNetworkCreateParams) (TunnelVirtualNetwork, error)

CreateTunnelVirtualNetwork adds a new virtual network to the account.

API reference: https://api.cloudflare.com/#tunnel-virtual-network-create-virtual-network

func (*API) CreateTurnstileWidget added in v0.66.0

func (api *API) CreateTurnstileWidget(ctx context.Context, rc *ResourceContainer, params CreateTurnstileWidgetParams) (TurnstileWidget, error)

CreateTurnstileWidget creates a new challenge widgets.

API reference: https://api.cloudflare.com/#challenge-widgets-properties

func (*API) CreateUserAccessRule added in v0.8.1

func (api *API) CreateUserAccessRule(ctx context.Context, accessRule AccessRule) (*AccessRuleResponse, error)

CreateUserAccessRule creates a firewall access rule for the logged-in user.

API reference: https://api.cloudflare.com/#user-level-firewall-access-rule-create-access-rule

func (*API) CreateUserAgentRule added in v0.8.0

func (api *API) CreateUserAgentRule(ctx context.Context, zoneID string, ld UserAgentRule) (*UserAgentRuleResponse, error)

CreateUserAgentRule creates a User-Agent Block rule for the given zone ID.

API reference: https://api.cloudflare.com/#user-agent-blocking-rules-create-a-useragent-rule

func (*API) CreateWAFOverride added in v0.11.1

func (api *API) CreateWAFOverride(ctx context.Context, zoneID string, override WAFOverride) (WAFOverride, error)

CreateWAFOverride creates a new WAF override.

API reference: https://api.cloudflare.com/#waf-overrides-create-a-uri-controlled-waf-configuration

func (*API) CreateWaitingRoom added in v0.17.0

func (api *API) CreateWaitingRoom(ctx context.Context, zoneID string, waitingRoom WaitingRoom) (*WaitingRoom, error)

CreateWaitingRoom creates a new Waiting Room for a zone.

API reference: https://api.cloudflare.com/#waiting-room-create-waiting-room

func (*API) CreateWaitingRoomEvent added in v0.33.0

func (api *API) CreateWaitingRoomEvent(ctx context.Context, zoneID string, waitingRoomID string, waitingRoomEvent WaitingRoomEvent) (*WaitingRoomEvent, error)

CreateWaitingRoomEvent creates a new event for a Waiting Room.

API reference: https://api.cloudflare.com/#waiting-room-create-event

func (*API) CreateWaitingRoomRule added in v0.53.0

func (api *API) CreateWaitingRoomRule(ctx context.Context, rc *ResourceContainer, params CreateWaitingRoomRuleParams) ([]WaitingRoomRule, error)

CreateWaitingRoomRule creates a new rule for a Waiting Room.

API reference: https://api.cloudflare.com/#waiting-room-create-waiting-room-rule

func (*API) CreateWeb3Hostname added in v0.45.0

func (api *API) CreateWeb3Hostname(ctx context.Context, params Web3HostnameCreateParameters) (Web3Hostname, error)

CreateWeb3Hostname creates a web3 hostname.

API Reference: https://api.cloudflare.com/#web3-hostname-create-web3-hostname

func (*API) CreateWebAnalyticsRule added in v0.75.0

func (api *API) CreateWebAnalyticsRule(ctx context.Context, rc *ResourceContainer, params CreateWebAnalyticsRuleParams) (*WebAnalyticsRule, error)

CreateWebAnalyticsRule creates a new Web Analytics Rule in a Web Analytics ruleset.

API reference: https://api.cloudflare.com/#web-analytics-create-rule

func (*API) CreateWebAnalyticsSite added in v0.75.0

func (api *API) CreateWebAnalyticsSite(ctx context.Context, rc *ResourceContainer, params CreateWebAnalyticsSiteParams) (*WebAnalyticsSite, error)

CreateWebAnalyticsSite creates a new Web Analytics Site for an Account.

API reference: https://api.cloudflare.com/#web-analytics-create-site

func (*API) CreateWorkerRoute added in v0.9.0

func (api *API) CreateWorkerRoute(ctx context.Context, rc *ResourceContainer, params CreateWorkerRouteParams) (WorkerRouteResponse, error)

CreateWorkerRoute creates worker route for a script.

API reference: https://developers.cloudflare.com/api/operations/worker-routes-create-route

func (*API) CreateWorkersAccountSettings added in v0.47.0

func (api *API) CreateWorkersAccountSettings(ctx context.Context, rc *ResourceContainer, params CreateWorkersAccountSettingsParameters) (WorkersAccountSettings, error)

CreateWorkersAccountSettings sets the account settings for Workers.

API reference: https://developers.cloudflare.com/api/operations/worker-account-settings-create-worker-account-settings

func (*API) CreateWorkersForPlatformsDispatchNamespace added in v0.90.0

CreateWorkersForPlatformsDispatchNamespace creates a new dispatch namespace.

API reference: https://developers.cloudflare.com/api/operations/namespace-worker-create

func (*API) CreateWorkersKVNamespace added in v0.9.0

func (api *API) CreateWorkersKVNamespace(ctx context.Context, rc *ResourceContainer, params CreateWorkersKVNamespaceParams) (WorkersKVNamespaceResponse, error)

CreateWorkersKVNamespace creates a namespace under the given title. A 400 is returned if the account already owns a namespace with this title. A namespace must be explicitly deleted to be replaced.

API reference: https://developers.cloudflare.com/api/operations/workers-kv-namespace-create-a-namespace

Example
api, err := cloudflare.New(apiKey, user)
if err != nil {
	log.Fatal(err)
}

req := cloudflare.CreateWorkersKVNamespaceParams{Title: "test_namespace2"}
response, err := api.CreateWorkersKVNamespace(context.Background(), cloudflare.AccountIdentifier(accountID), req)
if err != nil {
	log.Fatal(err)
}

fmt.Println(response)
Output:

func (*API) CreateZone added in v0.7.2

func (api *API) CreateZone(ctx context.Context, name string, jumpstart bool, account Account, zoneType string) (Zone, error)

CreateZone creates a zone on an account.

Setting jumpstart to true will attempt to automatically scan for existing DNS records. Setting this to false will create the zone with no DNS records.

If account is non-empty, it must have at least the ID field populated. This will add the new zone to the specified multi-user account.

API reference: https://api.cloudflare.com/#zone-create-a-zone

func (*API) CreateZoneAccessRule added in v0.8.1

func (api *API) CreateZoneAccessRule(ctx context.Context, zoneID string, accessRule AccessRule) (*AccessRuleResponse, error)

CreateZoneAccessRule creates a firewall access rule for the given zone identifier.

API reference: https://api.cloudflare.com/#firewall-access-rule-for-a-zone-create-access-rule

func (*API) CreateZoneHold added in v0.75.0

func (api *API) CreateZoneHold(ctx context.Context, rc *ResourceContainer, params CreateZoneHoldParams) (ZoneHold, error)

CreateZoneHold enforces a zone hold on the zone, blocking the creation and activation of zone.

API reference: https://developers.cloudflare.com/api/operations/zones-0-hold-post

func (*API) CreateZoneLevelAccessBookmark added in v0.36.0

func (api *API) CreateZoneLevelAccessBookmark(ctx context.Context, zoneID string, accessBookmark AccessBookmark) (AccessBookmark, error)

CreateZoneLevelAccessBookmark creates a new zone level access bookmark.

API reference: https://api.cloudflare.com/#zone-level-access-bookmarks-create-access-bookmark

func (*API) CreateZoneLockdown added in v0.8.0

func (api *API) CreateZoneLockdown(ctx context.Context, rc *ResourceContainer, params ZoneLockdownCreateParams) (ZoneLockdown, error)

CreateZoneLockdown creates a Zone ZoneLockdown rule for the given zone ID.

API reference: https://api.cloudflare.com/#zone-ZoneLockdown-create-a-ZoneLockdown-rule

Example
package main

import (
	"context"
	"fmt"
	"log"

	cloudflare "github.com/cloudflare/cloudflare-go"
)

func main() {
	api, err := cloudflare.New("deadbeef", "test@example.org")
	if err != nil {
		log.Fatal(err)
	}

	zoneID, err := api.ZoneIDByName("example.org")
	if err != nil {
		log.Fatal(err)
	}

	newZoneLockdown := cloudflare.ZoneLockdownCreateParams{
		Description: "Test Zone Lockdown Rule",
		URLs: []string{
			"*.example.org/test",
		},
		Configurations: []cloudflare.ZoneLockdownConfig{
			{
				Target: "ip",
				Value:  "198.51.100.1",
			},
		},
		Paused: false,
	}

	response, err := api.CreateZoneLockdown(context.Background(), cloudflare.ZoneIdentifier(zoneID), newZoneLockdown)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println("Response: ", response)
}
Output:

func (*API) CustomHostname added in v0.7.4

func (api *API) CustomHostname(ctx context.Context, zoneID string, customHostnameID string) (CustomHostname, error)

CustomHostname inspects the given custom hostname in the given zone.

API reference: https://api.cloudflare.com/#custom-hostname-for-a-zone-custom-hostname-configuration-details

func (*API) CustomHostnameFallbackOrigin added in v0.12.0

func (api *API) CustomHostnameFallbackOrigin(ctx context.Context, zoneID string) (CustomHostnameFallbackOrigin, error)

CustomHostnameFallbackOrigin inspects the Custom Hostname Fallback origin in the given zone.

API reference: https://api.cloudflare.com/#custom-hostname-fallback-origin-for-a-zone-properties

func (*API) CustomHostnameIDByName added in v0.7.4

func (api *API) CustomHostnameIDByName(ctx context.Context, zoneID string, hostname string) (string, error)

CustomHostnameIDByName retrieves the ID for the given hostname in the given zone.

func (*API) CustomHostnames added in v0.7.4

func (api *API) CustomHostnames(ctx context.Context, zoneID string, page int, filter CustomHostname) ([]CustomHostname, ResultInfo, error)

CustomHostnames fetches custom hostnames for the given zone, by applying filter.Hostname if not empty and scoping the result to page'th 50 items.

The returned ResultInfo can be used to implement pagination.

API reference: https://api.cloudflare.com/#custom-hostname-for-a-zone-list-custom-hostnames

func (*API) CustomPage added in v0.9.0

func (api *API) CustomPage(ctx context.Context, options *CustomPageOptions, customPageID string) (CustomPage, error)

CustomPage lists a single custom page based on the ID.

Zone API reference: https://api.cloudflare.com/#custom-pages-for-a-zone-custom-page-details Account API reference: https://api.cloudflare.com/#custom-pages-account--custom-page-details

func (*API) CustomPages added in v0.9.0

func (api *API) CustomPages(ctx context.Context, options *CustomPageOptions) ([]CustomPage, error)

CustomPages lists custom pages for a zone or account.

Zone API reference: https://api.cloudflare.com/#custom-pages-for-a-zone-list-available-custom-pages Account API reference: https://api.cloudflare.com/#custom-pages-account--list-custom-pages

func (*API) DeleteAPIShieldOperation added in v0.78.0

func (api *API) DeleteAPIShieldOperation(ctx context.Context, rc *ResourceContainer, params DeleteAPIShieldOperationParams) error

DeleteAPIShieldOperation deletes a single operation

API documentation https://developers.cloudflare.com/api/operations/api-shield-endpoint-management-delete-an-operation

func (*API) DeleteAPIShieldSchema added in v0.79.0

func (api *API) DeleteAPIShieldSchema(ctx context.Context, rc *ResourceContainer, params DeleteAPIShieldSchemaParams) error

DeleteAPIShieldSchema deletes a single schema

API documentation: https://developers.cloudflare.com/api/operations/api-shield-schema-delete-a-schema

func (*API) DeleteAPIToken added in v0.13.5

func (api *API) DeleteAPIToken(ctx context.Context, tokenID string) error

DeleteAPIToken deletes a single API token.

API reference: https://api.cloudflare.com/#user-api-tokens-delete-token

func (*API) DeleteAccessApplication added in v0.9.0

func (api *API) DeleteAccessApplication(ctx context.Context, rc *ResourceContainer, applicationID string) error

DeleteAccessApplication deletes an access application.

Account API reference: https://developers.cloudflare.com/api/operations/access-applications-delete-an-access-application Zone API reference: https://developers.cloudflare.com/api/operations/zone-level-access-applications-delete-an-access-application

func (*API) DeleteAccessBookmark added in v0.36.0

func (api *API) DeleteAccessBookmark(ctx context.Context, accountID, bookmarkID string) error

DeleteAccessBookmark deletes an access bookmark.

API reference: https://api.cloudflare.com/#access-bookmarks-delete-access-bookmark

func (*API) DeleteAccessCACertificate added in v0.12.1

func (api *API) DeleteAccessCACertificate(ctx context.Context, rc *ResourceContainer, applicationID string) error

DeleteAccessCACertificate deletes an Access CA certificate on a defined AccessApplication.

Account API reference: https://developers.cloudflare.com/api/operations/access-short-lived-certificate-c-as-delete-a-short-lived-certificate-ca Zone API reference: https://developers.cloudflare.com/api/operations/zone-level-access-short-lived-certificate-c-as-delete-a-short-lived-certificate-ca

func (*API) DeleteAccessCustomPage added in v0.74.0

func (api *API) DeleteAccessCustomPage(ctx context.Context, rc *ResourceContainer, id string) error

func (*API) DeleteAccessGroup added in v0.10.5

func (api *API) DeleteAccessGroup(ctx context.Context, rc *ResourceContainer, groupID string) error

DeleteAccessGroup deletes an access group

Account API Reference: https://developers.cloudflare.com/api/operations/access-groups-delete-an-access-group Zone API Reference: https://developers.cloudflare.com/api/operations/zone-level-access-groups-delete-an-access-group

func (*API) DeleteAccessIdentityProvider added in v0.10.1

func (api *API) DeleteAccessIdentityProvider(ctx context.Context, rc *ResourceContainer, identityProviderUUID string) (AccessIdentityProvider, error)

DeleteAccessIdentityProvider deletes an Access Identity Provider.

Account API Reference: https://developers.cloudflare.com/api/operations/access-identity-providers-delete-an-access-identity-provider Zone API Reference: https://developers.cloudflare.com/api/operations/zone-level-access-identity-providers-delete-an-access-identity-provider

func (*API) DeleteAccessMutualTLSCertificate added in v0.13.8

func (api *API) DeleteAccessMutualTLSCertificate(ctx context.Context, rc *ResourceContainer, certificateID string) error

DeleteAccessMutualTLSCertificate destroys an Access Mutual TLS certificate.

Account API Reference: https://developers.cloudflare.com/api/operations/access-mtls-authentication-delete-an-mtls-certificate Zone API Reference: https://developers.cloudflare.com/api/operations/zone-level-access-mtls-authentication-delete-an-mtls-certificate

func (*API) DeleteAccessServiceToken added in v0.10.1

func (api *API) DeleteAccessServiceToken(ctx context.Context, rc *ResourceContainer, uuid string) (AccessServiceTokenUpdateResponse, error)

func (*API) DeleteAccessTag added in v0.78.0

func (api *API) DeleteAccessTag(ctx context.Context, rc *ResourceContainer, tagName string) error

func (*API) DeleteAccount added in v0.13.8

func (api *API) DeleteAccount(ctx context.Context, accountID string) error

DeleteAccount removes an account. Note: This requires the Tenant entitlement.

API reference: https://developers.cloudflare.com/tenant/tutorial/provisioning-resources#optional-deleting-accounts

func (*API) DeleteAccountAccessRule added in v0.10.0

func (api *API) DeleteAccountAccessRule(ctx context.Context, accountID, accessRuleID string) (*AccessRuleResponse, error)

DeleteAccountAccessRule deletes a single access rule for the given account and access rule identifiers.

API reference: https://api.cloudflare.com/#account-level-firewall-access-rule-delete-access-rule

func (*API) DeleteAccountMember added in v0.9.0

func (api *API) DeleteAccountMember(ctx context.Context, accountID string, userID string) error

DeleteAccountMember removes a member from an account.

API reference: https://api.cloudflare.com/#account-members-remove-member

func (*API) DeleteAddressMap added in v0.63.0

func (api *API) DeleteAddressMap(ctx context.Context, rc *ResourceContainer, id string) error

DeleteAddressMap deletes a particular address map owned by the account.

API reference: https://developers.cloudflare.com/api/operations/ip-address-management-address-maps-delete-address-map

func (*API) DeleteArgoTunnel deprecated added in v0.13.7

func (api *API) DeleteArgoTunnel(ctx context.Context, accountID, tunnelUUID string) error

DeleteArgoTunnel removes a single Argo tunnel.

API reference: https://api.cloudflare.com/#argo-tunnel-delete-argo-tunnel

Deprecated: Use `DeleteTunnel` instead.

func (*API) DeleteCertificatePack added in v0.13.0

func (api *API) DeleteCertificatePack(ctx context.Context, zoneID, certificateID string) error

DeleteCertificatePack removes a certificate pack associated with a zone.

API Reference: https://api.cloudflare.com/#certificate-packs-delete-advanced-certificate-manager-certificate-pack

func (*API) DeleteCustomHostname added in v0.7.4

func (api *API) DeleteCustomHostname(ctx context.Context, zoneID string, customHostnameID string) error

DeleteCustomHostname deletes a custom hostname (and any issued SSL certificates).

API reference: https://api.cloudflare.com/#custom-hostname-for-a-zone-delete-a-custom-hostname-and-any-issued-ssl-certificates-

func (*API) DeleteCustomHostnameFallbackOrigin added in v0.13.0

func (api *API) DeleteCustomHostnameFallbackOrigin(ctx context.Context, zoneID string) error

DeleteCustomHostnameFallbackOrigin deletes the Custom Hostname Fallback origin in the given zone.

API reference: https://api.cloudflare.com/#custom-hostname-fallback-origin-for-a-zone-delete-fallback-origin-for-custom-hostnames

func (*API) DeleteCustomNameservers added in v0.70.0

func (api *API) DeleteCustomNameservers(ctx context.Context, rc *ResourceContainer, params DeleteCustomNameserversParams) error

DeleteCustomNameservers removes a custom nameserver.

API documentation: https://developers.cloudflare.com/api/operations/account-level-custom-nameservers-delete-account-custom-nameserver

func (*API) DeleteD1Database added in v0.79.0

func (api *API) DeleteD1Database(ctx context.Context, rc *ResourceContainer, databaseID string) error

DeleteD1Database deletes a database for an account.

API reference: https://developers.cloudflare.com/api/operations/cloudflare-d1-delete-database

func (*API) DeleteDLPDataset added in v0.87.0

func (api *API) DeleteDLPDataset(ctx context.Context, rc *ResourceContainer, datasetID string) error

DeleteDLPDataset deletes a DLP dataset.

API reference: https://developers.cloudflare.com/api/operations/dlp-datasets-delete

func (*API) DeleteDLPProfile added in v0.53.0

func (api *API) DeleteDLPProfile(ctx context.Context, rc *ResourceContainer, profileID string) error

DeleteDLPProfile deletes a DLP profile. Only custom profiles can be deleted.

API reference: https://api.cloudflare.com/#dlp-profiles-delete-custom-profile

func (*API) DeleteDNSFirewallCluster added in v0.29.0

func (api *API) DeleteDNSFirewallCluster(ctx context.Context, rc *ResourceContainer, clusterID string) error

DeleteDNSFirewallCluster deletes a DNS Firewall cluster. Note that this cannot be undone, and will stop all traffic to that cluster.

API reference: https://api.cloudflare.com/#dns-firewall-delete-dns-firewall-cluster

func (*API) DeleteDNSRecord added in v0.7.2

func (api *API) DeleteDNSRecord(ctx context.Context, rc *ResourceContainer, recordID string) error

DeleteDNSRecord deletes a single DNS record for the given zone & record identifiers.

API reference: https://api.cloudflare.com/#dns-records-for-a-zone-delete-dns-record

func (*API) DeleteDataLocalizationRegionalHostname added in v0.66.0

func (api *API) DeleteDataLocalizationRegionalHostname(ctx context.Context, rc *ResourceContainer, hostname string) error

DeleteDataLocalizationRegionalHostname deletes a regional hostname.

API reference: https://developers.cloudflare.com/data-localization/regional-services/get-started/#configure-regional-services-via-api

func (*API) DeleteDevicePostureIntegration added in v0.29.0

func (api *API) DeleteDevicePostureIntegration(ctx context.Context, accountID, ruleID string) error

DeleteDevicePostureIntegration deletes a device posture integration.

API reference: https://api.cloudflare.com/#device-posture-integrations-delete-device-posture-integration

func (*API) DeleteDevicePostureRule added in v0.17.0

func (api *API) DeleteDevicePostureRule(ctx context.Context, accountID, ruleID string) error

DeleteDevicePostureRule deletes a device posture rule.

API reference: https://api.cloudflare.com/#device-posture-rules-delete-device-posture-rule

func (*API) DeleteDeviceSettingsPolicy added in v0.52.0

func (api *API) DeleteDeviceSettingsPolicy(ctx context.Context, rc *ResourceContainer, policyID string) ([]DeviceSettingsPolicy, error)

DeleteDeviceSettingsPolicy deletes a settings policy and returns a list of all of the other policies in the account.

API reference: https://api.cloudflare.com/#devices-delete-device-settings-policy

func (*API) DeleteDexTest added in v0.62.0

func (api *API) DeleteDexTest(ctx context.Context, rc *ResourceContainer, testID string) (DeviceDexTests, error)

DeleteDexTest deletes a Device Dex Test.

API reference: https://developers.cloudflare.com/api/operations/device-dex-test-delete-device-dex-test

func (*API) DeleteEmailRoutingDestinationAddress added in v0.47.0

func (api *API) DeleteEmailRoutingDestinationAddress(ctx context.Context, rc *ResourceContainer, addressID string) (EmailRoutingDestinationAddress, error)

DeleteEmailRoutingDestinationAddress Deletes a specific destination address.

API reference: https://api.cloudflare.com/#email-routing-destination-addresses-delete-destination-address

func (*API) DeleteEmailRoutingRule added in v0.47.0

func (api *API) DeleteEmailRoutingRule(ctx context.Context, rc *ResourceContainer, ruleID string) (EmailRoutingRule, error)

DeleteEmailRoutingRule Delete a specific routing rule.

API reference: https://api.cloudflare.com/#email-routing-routing-rules-delete-routing-rule

func (*API) DeleteFilter added in v0.9.0

func (api *API) DeleteFilter(ctx context.Context, rc *ResourceContainer, filterID string) error

DeleteFilter deletes a single filter.

API reference: https://developers.cloudflare.com/firewall/api/cf-filters/delete/#delete-a-single-filter

func (*API) DeleteFilters added in v0.9.0

func (api *API) DeleteFilters(ctx context.Context, rc *ResourceContainer, filterIDs []string) error

DeleteFilters deletes multiple filters.

API reference: https://developers.cloudflare.com/firewall/api/cf-filters/delete/#delete-multiple-filters

func (*API) DeleteFirewallRule added in v0.9.0

func (api *API) DeleteFirewallRule(ctx context.Context, rc *ResourceContainer, firewallRuleID string) error

DeleteFirewallRule deletes a single firewall rule.

API reference: https://developers.cloudflare.com/firewall/api/cf-firewall-rules/delete/#delete-a-single-rule

func (*API) DeleteFirewallRules added in v0.9.0

func (api *API) DeleteFirewallRules(ctx context.Context, rc *ResourceContainer, firewallRuleIDs []string) error

DeleteFirewallRules deletes multiple firewall rules at once.

API reference: https://developers.cloudflare.com/firewall/api/cf-firewall-rules/delete/#delete-multiple-rules

func (*API) DeleteHealthcheck added in v0.11.1

func (api *API) DeleteHealthcheck(ctx context.Context, zoneID string, healthcheckID string) error

DeleteHealthcheck deletes a healthcheck in a zone.

API reference: https://api.cloudflare.com/#health-checks-delete-health-check

func (*API) DeleteHealthcheckPreview added in v0.11.5

func (api *API) DeleteHealthcheckPreview(ctx context.Context, zoneID string, id string) error

DeleteHealthcheckPreview deletes a healthcheck preview in a zone if it exists.

API reference: https://api.cloudflare.com/#health-checks-delete-preview-health-check

func (*API) DeleteHostnameTLSSetting added in v0.75.0

func (api *API) DeleteHostnameTLSSetting(ctx context.Context, rc *ResourceContainer, params DeleteHostnameTLSSettingParams) (HostnameTLSSetting, error)

DeleteHostnameTLSSetting will delete the specified per-hostname tls setting.

API reference: https://developers.cloudflare.com/api/operations/per-hostname-tls-settings-delete

func (*API) DeleteHostnameTLSSettingCiphers added in v0.75.0

func (api *API) DeleteHostnameTLSSettingCiphers(ctx context.Context, rc *ResourceContainer, params DeleteHostnameTLSSettingCiphersParams) (HostnameTLSSettingCiphers, error)

DeleteHostnameTLSSettingCiphers will delete the specified per-hostname ciphers tls setting value. Ciphers functions are separate due to the API returning a list of strings as the value, rather than a string (as is the case for the other tls settings).

API reference: https://developers.cloudflare.com/api/operations/per-hostname-tls-settings-delete

func (*API) DeleteHyperdriveConfig added in v0.88.0

func (api *API) DeleteHyperdriveConfig(ctx context.Context, rc *ResourceContainer, hyperdriveID string) error

DeleteHyperdriveConfig deletes a Hyperdrive config.

API reference: https://developers.cloudflare.com/api/operations/delete-hyperdrive

func (*API) DeleteIPAddressFromAddressMap added in v0.63.0

func (api *API) DeleteIPAddressFromAddressMap(ctx context.Context, rc *ResourceContainer, params DeleteIPAddressFromAddressMapParams) error

DeleteIPAddressFromAddressMap removes an IP address from a particular address map.

API reference: https://developers.cloudflare.com/api/operations/ip-address-management-address-maps-remove-an-ip-from-an-address-map

func (*API) DeleteIPList deprecated added in v0.13.0

func (api *API) DeleteIPList(ctx context.Context, accountID, ID string) (IPListDeleteResponse, error)

DeleteIPList deletes an IP List.

API reference: https://api.cloudflare.com/#rules-lists-delete-list

Deprecated: Use `DeleteList` instead.

func (*API) DeleteIPListItems deprecated added in v0.13.0

func (api *API) DeleteIPListItems(ctx context.Context, accountID, ID string, items IPListItemDeleteRequest) (
	[]IPListItem, error)

DeleteIPListItems removes specific Items of an IP List by their ID synchronously and returns the current set of IP List Items.

Deprecated: Use `DeleteListItems` instead.

func (*API) DeleteIPListItemsAsync deprecated added in v0.13.0

func (api *API) DeleteIPListItemsAsync(ctx context.Context, accountID, ID string, items IPListItemDeleteRequest) (
	IPListItemDeleteResponse, error)

DeleteIPListItemsAsync removes specific Items of an IP List by their ID asynchronously. Users have to poll the operation status by using the operation_id returned by this function.

API reference: https://api.cloudflare.com/#rules-lists-delete-list-items

Deprecated: Use `DeleteListItemsAsync` instead.

func (*API) DeleteImage added in v0.30.0

func (api *API) DeleteImage(ctx context.Context, rc *ResourceContainer, id string) error

DeleteImage deletes an image.

API Reference: https://api.cloudflare.com/#cloudflare-images-delete-image

func (*API) DeleteImagesVariant added in v0.88.0

func (api *API) DeleteImagesVariant(ctx context.Context, rc *ResourceContainer, variantID string) error

Deleting a variant purges the cache for all images associated with the variant.

API Reference: https://developers.cloudflare.com/api/operations/cloudflare-images-variants-variant-details

func (*API) DeleteKeylessSSL added in v0.17.0

func (api *API) DeleteKeylessSSL(ctx context.Context, zoneID, keylessSSLID string) error

DeleteKeylessSSL deletes an existing Keyless SSL configuration.

API reference: https://api.cloudflare.com/#keyless-ssl-for-a-zone-delete-keyless-ssl-configuration

func (*API) DeleteList added in v0.41.0

func (api *API) DeleteList(ctx context.Context, rc *ResourceContainer, listID string) (ListDeleteResponse, error)

DeleteList deletes a List.

API reference: https://api.cloudflare.com/#rules-lists-delete-list

func (*API) DeleteListItems added in v0.41.0

func (api *API) DeleteListItems(ctx context.Context, rc *ResourceContainer, params ListDeleteItemsParams) ([]ListItem, error)

DeleteListItems removes specific Items of a List by their ID synchronously and returns the current set of List Items.

func (*API) DeleteListItemsAsync added in v0.41.0

func (api *API) DeleteListItemsAsync(ctx context.Context, rc *ResourceContainer, params ListDeleteItemsParams) (ListItemDeleteResponse, error)

DeleteListItemsAsync removes specific Items of a List by their ID asynchronously. Users have to poll the operation status by using the operation_id returned by this function.

API reference: https://api.cloudflare.com/#rules-lists-delete-list-items

func (*API) DeleteLoadBalancer added in v0.8.0

func (api *API) DeleteLoadBalancer(ctx context.Context, rc *ResourceContainer, loadbalancerID string) error

DeleteLoadBalancer disables and deletes a load balancer.

API reference: https://api.cloudflare.com/#load-balancers-delete-load-balancer

func (*API) DeleteLoadBalancerMonitor added in v0.8.0

func (api *API) DeleteLoadBalancerMonitor(ctx context.Context, rc *ResourceContainer, monitorID string) error

DeleteLoadBalancerMonitor disables and deletes a load balancer monitor.

API reference: https://api.cloudflare.com/#load-balancer-monitors-delete-monitor

func (*API) DeleteLoadBalancerPool added in v0.8.0

func (api *API) DeleteLoadBalancerPool(ctx context.Context, rc *ResourceContainer, poolID string) error

DeleteLoadBalancerPool disables and deletes a load balancer pool.

API reference: https://api.cloudflare.com/#load-balancer-pools-delete-pool

func (*API) DeleteLogpushJob added in v0.9.0

func (api *API) DeleteLogpushJob(ctx context.Context, rc *ResourceContainer, jobID int) error

DeleteLogpushJob deletes a Logpush Job for a zone.

API reference: https://api.cloudflare.com/#logpush-jobs-delete-logpush-job

Example
api, err := cloudflare.New(apiKey, user)
if err != nil {
	log.Fatal(err)
}

zoneID, err := api.ZoneIDByName(domain)
if err != nil {
	log.Fatal(err)
}

err = api.DeleteLogpushJob(context.Background(), cloudflare.ZoneIdentifier(zoneID), 1)
if err != nil {
	log.Fatal(err)
}
Output:

func (*API) DeleteMTLSCertificate added in v0.58.0

func (api *API) DeleteMTLSCertificate(ctx context.Context, rc *ResourceContainer, certificateID string) (MTLSCertificate, error)

DeleteMTLSCertificate will delete the specified mTLS certificate.

API reference: https://api.cloudflare.com/#mtls-certificate-management-delete-mtls-certificate

func (*API) DeleteMagicFirewallRuleset deprecated added in v0.13.7

func (api *API) DeleteMagicFirewallRuleset(ctx context.Context, accountID, ID string) error

DeleteMagicFirewallRuleset deletes a Magic Firewall ruleset

API reference: https://api.cloudflare.com/#rulesets-delete-ruleset

Deprecated: Use `DeleteZoneRuleset` or `DeleteAccountRuleset` instead.

func (*API) DeleteMagicTransitGRETunnel added in v0.32.0

func (api *API) DeleteMagicTransitGRETunnel(ctx context.Context, accountID string, id string) (MagicTransitGRETunnel, error)

DeleteMagicTransitGRETunnel deletes a GRE tunnel.

API reference: https://api.cloudflare.com/#magic-gre-tunnels-delete-gre-tunnel

func (*API) DeleteMagicTransitIPsecTunnel added in v0.31.0

func (api *API) DeleteMagicTransitIPsecTunnel(ctx context.Context, accountID string, id string) (MagicTransitIPsecTunnel, error)

DeleteMagicTransitIPsecTunnel deletes an IPsec Tunnel

API reference: https://api.cloudflare.com/#magic-ipsec-tunnels-delete-ipsec-tunnel

func (*API) DeleteMagicTransitStaticRoute added in v0.18.0

func (api *API) DeleteMagicTransitStaticRoute(ctx context.Context, accountID, ID string) (MagicTransitStaticRoute, error)

DeleteMagicTransitStaticRoute deletes a static route

API reference: https://api.cloudflare.com/#magic-transit-static-routes-delete-route

func (*API) DeleteManagedNetworks added in v0.57.0

func (api *API) DeleteManagedNetworks(ctx context.Context, rc *ResourceContainer, networkID string) ([]DeviceManagedNetwork, error)

DeleteManagedNetworks deletes a Device Managed Network.

API reference: https://api.cloudflare.com/#device-managed-networks-delete-device-managed-network

func (*API) DeleteNotificationPolicy added in v0.19.0

func (api *API) DeleteNotificationPolicy(ctx context.Context, accountID, policyID string) (SaveResponse, error)

DeleteNotificationPolicy deletes a notification policy for an account.

API Reference: https://api.cloudflare.com/#notification-policies-delete-notification-policy

func (*API) DeleteNotificationWebhooks added in v0.19.0

func (api *API) DeleteNotificationWebhooks(ctx context.Context, accountID, webhookID string) (SaveResponse, error)

DeleteNotificationWebhooks will delete a webhook, given the account and webhooks ids. Deleting the webhooks will remove it from any connected notification policies.

API Reference: https://api.cloudflare.com/#notification-webhooks-delete-webhook

func (*API) DeleteObservatoryPageTests added in v0.78.0

func (api *API) DeleteObservatoryPageTests(ctx context.Context, rc *ResourceContainer, params DeleteObservatoryPageTestsParams) (*int, error)

DeleteObservatoryPageTests deletes all tests for a page in a specific region.

API reference: https://api.cloudflare.com/#speed-delete-tests

func (*API) DeleteObservatoryScheduledPageTest added in v0.78.0

func (api *API) DeleteObservatoryScheduledPageTest(ctx context.Context, rc *ResourceContainer, params DeleteObservatoryScheduledPageTestParams) (*int, error)

DeleteObservatoryScheduledPageTest deletes the test schedule for a page in a specific region.

API reference: https://api.cloudflare.com/#speed-delete-scheduled-test

func (*API) DeletePageRule added in v0.7.2

func (api *API) DeletePageRule(ctx context.Context, zoneID, ruleID string) error

DeletePageRule deletes a Page Rule for a zone.

API reference: https://api.cloudflare.com/#page-rules-for-a-zone-delete-a-page-rule

Example
api, err := cloudflare.New(apiKey, user)
if err != nil {
	log.Fatal(err)
}

zoneID, err := api.ZoneIDByName(domain)
if err != nil {
	log.Fatal(err)
}

err = api.DeletePageRule(context.Background(), zoneID, "my_page_rule_id")
if err != nil {
	log.Fatal(err)
}
Output:

func (*API) DeletePageShieldPolicy added in v0.84.0

func (api *API) DeletePageShieldPolicy(ctx context.Context, rc *ResourceContainer, policyID string) error

DeletePageShieldPolicy deletes a page shield policy for a zone.

API documentation: https://developers.cloudflare.com/api/operations/page-shield-delete-page-shield-policy

func (*API) DeletePagesDeployment added in v0.40.0

func (api *API) DeletePagesDeployment(ctx context.Context, rc *ResourceContainer, params DeletePagesDeploymentParams) error

DeletePagesDeployment deletes a Pages deployment.

API reference: https://api.cloudflare.com/#pages-deployment-delete-deployment

func (*API) DeletePagesProject added in v0.26.0

func (api *API) DeletePagesProject(ctx context.Context, rc *ResourceContainer, projectName string) error

DeletePagesProject deletes a Pages project by name.

API reference: https://api.cloudflare.com/#pages-project-delete-project

func (*API) DeletePerHostnameAuthenticatedOriginPullsCertificate added in v0.12.2

func (api *API) DeletePerHostnameAuthenticatedOriginPullsCertificate(ctx context.Context, zoneID, certificateID string) (PerHostnameAuthenticatedOriginPullsCertificateDetails, error)

DeletePerHostnameAuthenticatedOriginPullsCertificate will remove the requested Per Hostname certificate from the edge.

API reference: https://api.cloudflare.com/#per-hostname-authenticated-origin-pull-delete-hostname-client-certificate

func (*API) DeletePerZoneAuthenticatedOriginPullsCertificate added in v0.12.2

func (api *API) DeletePerZoneAuthenticatedOriginPullsCertificate(ctx context.Context, zoneID, certificateID string) (PerZoneAuthenticatedOriginPullsCertificateDetails, error)

DeletePerZoneAuthenticatedOriginPullsCertificate removes the specified client certificate from the edge.

API reference: https://api.cloudflare.com/#zone-level-authenticated-origin-pulls-delete-certificate

func (*API) DeleteQueue added in v0.55.0

func (api *API) DeleteQueue(ctx context.Context, rc *ResourceContainer, queueName string) error

DeleteQueue deletes a queue.

API reference: https://api.cloudflare.com/#queue-delete-queue

func (*API) DeleteQueueConsumer added in v0.55.0

func (api *API) DeleteQueueConsumer(ctx context.Context, rc *ResourceContainer, params DeleteQueueConsumerParams) error

DeleteQueueConsumer deletes the consumer for a queue..

API reference: https://api.cloudflare.com/#queue-delete-queue-consumer

func (*API) DeleteR2Bucket added in v0.47.0

func (api *API) DeleteR2Bucket(ctx context.Context, rc *ResourceContainer, bucketName string) error

DeleteR2Bucket Deletes an existing R2 bucket.

API reference: https://api.cloudflare.com/#r2-bucket-delete-bucket

func (*API) DeleteRateLimit added in v0.8.5

func (api *API) DeleteRateLimit(ctx context.Context, zoneID, limitID string) error

DeleteRateLimit deletes a Rate Limit for a zone.

API reference: https://api.cloudflare.com/#rate-limits-for-a-zone-delete-rate-limit

Example
api, err := cloudflare.New(apiKey, user)
if err != nil {
	log.Fatal(err)
}

zoneID, err := api.ZoneIDByName(domain)
if err != nil {
	log.Fatal(err)
}

err = api.DeleteRateLimit(context.Background(), zoneID, "my_rate_limit_id")
if err != nil {
	log.Fatal(err)
}
Output:

func (*API) DeleteRuleset added in v0.73.0

func (api *API) DeleteRuleset(ctx context.Context, rc *ResourceContainer, rulesetID string) error

DeleteRuleset removes a ruleset based on the ruleset ID.

API reference: https://developers.cloudflare.com/api/operations/deleteAccountRuleset API reference: https://developers.cloudflare.com/api/operations/deleteZoneRuleset

func (*API) DeleteSSL added in v0.7.2

func (api *API) DeleteSSL(ctx context.Context, zoneID, certificateID string) error

DeleteSSL deletes a custom SSL certificate from the given zone.

API reference: https://api.cloudflare.com/#custom-ssl-for-a-zone-delete-an-ssl-certificate

func (*API) DeleteSecondaryDNSPrimary added in v0.15.0

func (api *API) DeleteSecondaryDNSPrimary(ctx context.Context, accountID, primaryID string) error

DeleteSecondaryDNSPrimary deletes a secondary DNS primary.

API reference: https://api.cloudflare.com/#secondary-dns-primary--delete-primary

func (*API) DeleteSecondaryDNSTSIG added in v0.15.0

func (api *API) DeleteSecondaryDNSTSIG(ctx context.Context, accountID, tsigID string) error

DeleteSecondaryDNSTSIG deletes a secondary DNS TSIG.

API reference: https://api.cloudflare.com/#secondary-dns-tsig--delete-tsig

func (*API) DeleteSecondaryDNSZone added in v0.15.0

func (api *API) DeleteSecondaryDNSZone(ctx context.Context, zoneID string) error

DeleteSecondaryDNSZone deletes a secondary DNS zone.

API reference: https://api.cloudflare.com/#secondary-dns-delete-secondary-zone-configuration

func (*API) DeleteSpectrumApplication added in v0.9.0

func (api *API) DeleteSpectrumApplication(ctx context.Context, zoneID string, applicationID string) error

DeleteSpectrumApplication removes a Spectrum application based on the ID.

API reference: https://developers.cloudflare.com/spectrum/api-reference/#delete-a-spectrum-application

func (*API) DeleteTeamsList added in v0.17.0

func (api *API) DeleteTeamsList(ctx context.Context, rc *ResourceContainer, teamsListID string) error

DeleteTeamsList deletes a teams list.

API reference: https://api.cloudflare.com/#teams-lists-delete-teams-list

func (*API) DeleteTeamsLocation added in v0.21.0

func (api *API) DeleteTeamsLocation(ctx context.Context, accountID, teamsLocationID string) error

DeleteTeamsLocation deletes a teams location.

API reference: https://api.cloudflare.com/#teams-locations-delete-teams-location

func (*API) DeleteTeamsProxyEndpoint added in v0.35.0

func (api *API) DeleteTeamsProxyEndpoint(ctx context.Context, accountID, proxyEndpointID string) error

DeleteTeamsProxyEndpoint deletes a teams Proxy Endpoint.

API reference: https://api.cloudflare.com/#zero-trust-gateway-proxy-endpoints-delete-proxy-endpoint

func (*API) DeleteTieredCache added in v0.57.1

func (api *API) DeleteTieredCache(ctx context.Context, rc *ResourceContainer) (TieredCache, error)

DeleteTieredCache allows you to delete the tiered cache settings for a zone. This is equivalent to using SetTieredCache with the value of TieredCacheOff.

API Reference: https://api.cloudflare.com/#smart-tiered-cache-delete-smart-tiered-cache-setting API Reference: https://api.cloudflare.com/#tiered-cache-patch-tiered-cache-setting

func (*API) DeleteTunnel added in v0.39.0

func (api *API) DeleteTunnel(ctx context.Context, rc *ResourceContainer, tunnelID string) error

DeleteTunnel removes a single Argo tunnel.

API reference: https://api.cloudflare.com/#cloudflare-tunnel-delete-cloudflare-tunnel

func (*API) DeleteTunnelRoute added in v0.36.0

func (api *API) DeleteTunnelRoute(ctx context.Context, rc *ResourceContainer, params TunnelRoutesDeleteParams) error

DeleteTunnelRoute delete an existing route from the account routing table.

See: https://api.cloudflare.com/#tunnel-route-delete-route

func (*API) DeleteTunnelVirtualNetwork added in v0.41.0

func (api *API) DeleteTunnelVirtualNetwork(ctx context.Context, rc *ResourceContainer, vnetID string) error

DeleteTunnelVirtualNetwork deletes an existing virtual network from the account.

API reference: https://api.cloudflare.com/#tunnel-virtual-network-delete-virtual-network

func (*API) DeleteTurnstileWidget added in v0.66.0

func (api *API) DeleteTurnstileWidget(ctx context.Context, rc *ResourceContainer, siteKey string) error

DeleteTurnstileWidget delete a challenge widget.

API reference: https://api.cloudflare.com/#challenge-widgets-delete-a-challenge-widget

func (*API) DeleteUserAccessRule added in v0.8.1

func (api *API) DeleteUserAccessRule(ctx context.Context, accessRuleID string) (*AccessRuleResponse, error)

DeleteUserAccessRule deletes a single access rule for the logged-in user and access rule identifiers.

API reference: https://api.cloudflare.com/#user-level-firewall-access-rule-update-access-rule

func (*API) DeleteUserAgentRule added in v0.8.0

func (api *API) DeleteUserAgentRule(ctx context.Context, zoneID string, id string) (*UserAgentRuleResponse, error)

DeleteUserAgentRule deletes a User-Agent Block rule (based on the ID) for the given zone ID.

API reference: https://api.cloudflare.com/#user-agent-blocking-rules-delete-useragent-rule

func (*API) DeleteWAFOverride added in v0.11.1

func (api *API) DeleteWAFOverride(ctx context.Context, zoneID, overrideID string) error

DeleteWAFOverride deletes a WAF override for a zone.

API reference: https://api.cloudflare.com/#waf-overrides-delete-lockdown-rule

func (*API) DeleteWaitingRoom added in v0.17.0

func (api *API) DeleteWaitingRoom(ctx context.Context, zoneID, waitingRoomID string) error

DeleteWaitingRoom deletes a Waiting Room for a zone.

API reference: https://api.cloudflare.com/#waiting-room-delete-waiting-room

func (*API) DeleteWaitingRoomEvent added in v0.33.0

func (api *API) DeleteWaitingRoomEvent(ctx context.Context, zoneID string, waitingRoomID string, eventID string) error

DeleteWaitingRoomEvent deletes an event for a Waiting Room.

API reference: https://api.cloudflare.com/#waiting-room-delete-event

func (*API) DeleteWaitingRoomRule added in v0.53.0

func (api *API) DeleteWaitingRoomRule(ctx context.Context, rc *ResourceContainer, params DeleteWaitingRoomRuleParams) ([]WaitingRoomRule, error)

DeleteWaitingRoomRule deletes a rule for a Waiting Room.

API reference: https://api.cloudflare.com/#waiting-room-delete-waiting-room-rule

func (*API) DeleteWeb3Hostname added in v0.45.0

func (api *API) DeleteWeb3Hostname(ctx context.Context, params Web3HostnameDetailsParameters) (Web3HostnameDeleteResult, error)

DeleteWeb3Hostname deletes a web3 hostname.

API Reference: https://api.cloudflare.com/#web3-hostname-delete-web3-hostname

func (*API) DeleteWebAnalyticsRule added in v0.75.0

func (api *API) DeleteWebAnalyticsRule(ctx context.Context, rc *ResourceContainer, params DeleteWebAnalyticsRuleParams) (*string, error)

DeleteWebAnalyticsRule deletes an existing Web Analytics Rule from a Web Analytics ruleset.

API reference: https://api.cloudflare.com/#web-analytics-delete-rule

func (*API) DeleteWebAnalyticsSite added in v0.75.0

func (api *API) DeleteWebAnalyticsSite(ctx context.Context, rc *ResourceContainer, params DeleteWebAnalyticsSiteParams) (*string, error)

DeleteWebAnalyticsSite deletes an existing Web Analytics Site for an Account.

API reference: https://api.cloudflare.com/#web-analytics-delete-site

func (*API) DeleteWorker added in v0.9.0

func (api *API) DeleteWorker(ctx context.Context, rc *ResourceContainer, params DeleteWorkerParams) error

DeleteWorker deletes a single Worker.

API reference: https://developers.cloudflare.com/api/operations/worker-script-delete-worker

func (*API) DeleteWorkerRoute added in v0.9.0

func (api *API) DeleteWorkerRoute(ctx context.Context, rc *ResourceContainer, routeID string) (WorkerRouteResponse, error)

DeleteWorkerRoute deletes worker route for a script.

API reference: https://developers.cloudflare.com/api/operations/worker-routes-delete-route

func (*API) DeleteWorkersForPlatformsDispatchNamespace added in v0.90.0

func (api *API) DeleteWorkersForPlatformsDispatchNamespace(ctx context.Context, rc *ResourceContainer, name string) error

DeleteWorkersForPlatformsDispatchNamespace deletes a dispatch namespace.

API reference: https://developers.cloudflare.com/api/operations/namespace-worker-delete-namespace

func (*API) DeleteWorkersKVEntries added in v0.55.0

func (api *API) DeleteWorkersKVEntries(ctx context.Context, rc *ResourceContainer, params DeleteWorkersKVEntriesParams) (Response, error)

DeleteWorkersKVEntries deletes multiple KVs at once.

API reference: https://developers.cloudflare.com/api/operations/workers-kv-namespace-delete-multiple-key-value-pairs

Example
api, err := cloudflare.New(apiKey, user)
if err != nil {
	log.Fatal(err)
}

keys := []string{"key1", "key2", "key3"}

resp, err := api.DeleteWorkersKVEntries(context.Background(), cloudflare.AccountIdentifier(accountID), cloudflare.DeleteWorkersKVEntriesParams{
	NamespaceID: namespace,
	Keys:        keys,
})
if err != nil {
	log.Fatal(err)
}

fmt.Println(resp)
Output:

func (API) DeleteWorkersKVEntry added in v0.55.0

func (api API) DeleteWorkersKVEntry(ctx context.Context, rc *ResourceContainer, params DeleteWorkersKVEntryParams) (Response, error)

DeleteWorkersKVEntry deletes a key and value for a provided storage namespace.

API reference: https://developers.cloudflare.com/api/operations/workers-kv-namespace-delete-key-value-pair

Example
api, err := cloudflare.New(apiKey, user)
if err != nil {
	log.Fatal(err)
}

key := "test_key"
resp, err := api.DeleteWorkersKVEntry(context.Background(), cloudflare.AccountIdentifier(accountID), cloudflare.DeleteWorkersKVEntryParams{
	NamespaceID: namespace,
	Key:         key,
})
if err != nil {
	log.Fatal(err)
}

fmt.Printf("%+v\n", resp)
Output:

func (*API) DeleteWorkersKVNamespace added in v0.9.0

func (api *API) DeleteWorkersKVNamespace(ctx context.Context, rc *ResourceContainer, namespaceID string) (Response, error)

DeleteWorkersKVNamespace deletes the namespace corresponding to the given ID.

API reference: https://developers.cloudflare.com/api/operations/workers-kv-namespace-remove-a-namespace

Example
api, err := cloudflare.New(apiKey, user)
if err != nil {
	log.Fatal(err)
}

response, err := api.DeleteWorkersKVNamespace(context.Background(), cloudflare.AccountIdentifier(accountID), namespace)
if err != nil {
	log.Fatal(err)
}

fmt.Println(response)
Output:

func (*API) DeleteWorkersSecret added in v0.13.1

func (api *API) DeleteWorkersSecret(ctx context.Context, rc *ResourceContainer, params DeleteWorkersSecretParams) (Response, error)

DeleteWorkersSecret deletes a secret.

API reference: https://api.cloudflare.com/

func (*API) DeleteWorkersTail added in v0.47.0

func (api *API) DeleteWorkersTail(ctx context.Context, rc *ResourceContainer, scriptName, tailID string) error

DeleteWorkersTail Deletes a tail from a Worker.

API reference: https://developers.cloudflare.com/api/operations/worker-tail-logs-delete-tail

func (*API) DeleteZone added in v0.7.2

func (api *API) DeleteZone(ctx context.Context, zoneID string) (ZoneID, error)

DeleteZone deletes the given zone.

API reference: https://api.cloudflare.com/#zone-delete-a-zone

func (*API) DeleteZoneAccessRule added in v0.8.1

func (api *API) DeleteZoneAccessRule(ctx context.Context, zoneID, accessRuleID string) (*AccessRuleResponse, error)

DeleteZoneAccessRule deletes a single access rule for the given zone and access rule identifiers.

API reference: https://api.cloudflare.com/#firewall-access-rule-for-a-zone-delete-access-rule

func (*API) DeleteZoneCacheVariants added in v0.32.0

func (api *API) DeleteZoneCacheVariants(ctx context.Context, zoneID string) error

DeleteZoneCacheVariants deletes cache variants for a given zone.

API reference: https://api.cloudflare.com/#zone-cache-settings-delete-variants-setting

func (*API) DeleteZoneDNSSEC added in v0.13.5

func (api *API) DeleteZoneDNSSEC(ctx context.Context, zoneID string) (string, error)

DeleteZoneDNSSEC deletes DNSSEC for zone

API reference: https://api.cloudflare.com/#dnssec-delete-dnssec-records

func (*API) DeleteZoneHold added in v0.75.0

func (api *API) DeleteZoneHold(ctx context.Context, rc *ResourceContainer, params DeleteZoneHoldParams) (ZoneHold, error)

DeleteZoneHold removes enforcement of a zone hold on the zone, permanently or temporarily, allowing the creation and activation of zones with this hostname.

API reference:https://developers.cloudflare.com/api/operations/zones-0-hold-delete

func (*API) DeleteZoneLevelAccessBookmark added in v0.36.0

func (api *API) DeleteZoneLevelAccessBookmark(ctx context.Context, zoneID, bookmarkID string) error

DeleteZoneLevelAccessBookmark deletes a zone level access bookmark.

API reference: https://api.cloudflare.com/#zone-level-access-bookmarks-delete-access-bookmark

func (*API) DeleteZoneLockdown added in v0.8.0

func (api *API) DeleteZoneLockdown(ctx context.Context, rc *ResourceContainer, id string) (ZoneLockdown, error)

DeleteZoneLockdown deletes a Zone ZoneLockdown rule (based on the ID) for the given zone ID.

API reference: https://api.cloudflare.com/#zone-ZoneLockdown-delete-ZoneLockdown-rule

func (*API) DetachWorkersDomain added in v0.55.0

func (api *API) DetachWorkersDomain(ctx context.Context, rc *ResourceContainer, domainID string) error

DetachWorkersDomain detaches a worker from a zone and hostname.

API reference: https://developers.cloudflare.com/api/operations/worker-domain-detach-from-domain

func (*API) DevicePostureIntegration added in v0.29.0

func (api *API) DevicePostureIntegration(ctx context.Context, accountID, integrationID string) (DevicePostureIntegration, error)

DevicePostureIntegration returns a specific device posture integrations within an account.

API reference: https://api.cloudflare.com/#device-posture-integrations-device-posture-integration-details

func (*API) DevicePostureIntegrations added in v0.29.0

func (api *API) DevicePostureIntegrations(ctx context.Context, accountID string) ([]DevicePostureIntegration, ResultInfo, error)

DevicePostureIntegrations returns all device posture integrations within an account.

API reference: https://api.cloudflare.com/#device-posture-integrations-list-device-posture-integrations

func (*API) DevicePostureRule added in v0.17.0

func (api *API) DevicePostureRule(ctx context.Context, accountID, ruleID string) (DevicePostureRule, error)

DevicePostureRule returns a single device posture rule based on the rule ID.

API reference: https://api.cloudflare.com/#device-posture-rules-device-posture-rules-details

func (*API) DevicePostureRules added in v0.17.0

func (api *API) DevicePostureRules(ctx context.Context, accountID string) ([]DevicePostureRule, ResultInfo, error)

DevicePostureRules returns all device posture rules within an account.

API reference: https://api.cloudflare.com/#device-posture-rules-list-device-posture-rules

func (*API) DisableEmailRouting added in v0.47.0

func (api *API) DisableEmailRouting(ctx context.Context, rc *ResourceContainer) (EmailRoutingSettings, error)

DisableEmailRouting Disable your Email Routing zone. Also removes additional MX records previously required for Email Routing to work.

API reference: https://api.cloudflare.com/#email-routing-settings-disable-email-routing

func (*API) EditPerHostnameAuthenticatedOriginPullsConfig added in v0.12.2

func (api *API) EditPerHostnameAuthenticatedOriginPullsConfig(ctx context.Context, zoneID string, config []PerHostnameAuthenticatedOriginPullsConfig) ([]PerHostnameAuthenticatedOriginPullsDetails, error)

EditPerHostnameAuthenticatedOriginPullsConfig applies the supplied Per Hostname AuthenticatedOriginPulls config onto a hostname(s) in the edge.

API reference: https://api.cloudflare.com/#per-hostname-authenticated-origin-pull-enable-or-disable-a-hostname-for-client-authentication

func (*API) EditUniversalSSLSetting added in v0.9.0

func (api *API) EditUniversalSSLSetting(ctx context.Context, zoneID string, setting UniversalSSLSetting) (UniversalSSLSetting, error)

EditUniversalSSLSetting edits the universal ssl setting for a zone

API reference: https://api.cloudflare.com/#universal-ssl-settings-for-a-zone-edit-universal-ssl-settings

func (*API) EditZone added in v0.7.2

func (api *API) EditZone(ctx context.Context, zoneID string, zoneOpts ZoneOptions) (Zone, error)

EditZone edits the given zone.

This is usually called by ZoneSetPaused, ZoneSetType, or ZoneSetVanityNS.

API reference: https://api.cloudflare.com/#zone-edit-zone-properties

func (*API) EnableEmailRouting added in v0.47.0

func (api *API) EnableEmailRouting(ctx context.Context, rc *ResourceContainer) (EmailRoutingSettings, error)

EnableEmailRouting Enable you Email Routing zone. Add and lock the necessary MX and SPF records.

API reference: https://api.cloudflare.com/#email-routing-settings-enable-email-routing

func (*API) ExportDNSRecords added in v0.66.0

func (api *API) ExportDNSRecords(ctx context.Context, rc *ResourceContainer, params ExportDNSRecordsParams) (string, error)

ExportDNSRecords returns all DNS records for a zone in the BIND format.

API reference: https://developers.cloudflare.com/api/operations/dns-records-for-a-zone-export-dns-records

func (*API) ExportZarazConfig added in v0.86.0

func (api *API) ExportZarazConfig(ctx context.Context, rc *ResourceContainer) error

func (*API) FallbackOrigin added in v0.10.1

func (api *API) FallbackOrigin(ctx context.Context, zoneID string) (FallbackOrigin, error)

FallbackOrigin returns information about the fallback origin for the specified zone.

API reference: https://developers.cloudflare.com/ssl/ssl-for-saas/api-calls/#fallback-origin-configuration

func (*API) Filter added in v0.9.0

func (api *API) Filter(ctx context.Context, rc *ResourceContainer, filterID string) (Filter, error)

Filter returns a single filter in a zone based on the filter ID.

API reference: https://developers.cloudflare.com/firewall/api/cf-filters/get/#get-by-filter-id

func (*API) Filters added in v0.9.0

func (api *API) Filters(ctx context.Context, rc *ResourceContainer, params FilterListParams) ([]Filter, *ResultInfo, error)

Filters returns filters for a zone.

Automatically paginates all results unless `params.PerPage` and `params.Page` is set.

API reference: https://developers.cloudflare.com/firewall/api/cf-filters/get/#get-all-filters

func (*API) FirewallRule added in v0.9.0

func (api *API) FirewallRule(ctx context.Context, rc *ResourceContainer, firewallRuleID string) (FirewallRule, error)

FirewallRule returns a single firewall rule based on the ID.

API reference: https://developers.cloudflare.com/firewall/api/cf-firewall-rules/get/#get-by-rule-id

func (*API) FirewallRules added in v0.9.0

func (api *API) FirewallRules(ctx context.Context, rc *ResourceContainer, params FirewallRuleListParams) ([]FirewallRule, *ResultInfo, error)

FirewallRules returns all firewall rules.

Automatically paginates all results unless `params.PerPage` and `params.Page` is set.

API reference: https://developers.cloudflare.com/firewall/api/cf-firewall-rules/get/#get-all-rules

func (*API) ForceSecondaryDNSZoneAXFR added in v0.15.0

func (api *API) ForceSecondaryDNSZoneAXFR(ctx context.Context, zoneID string) error

ForceSecondaryDNSZoneAXFR requests an immediate AXFR request.

API reference: https://api.cloudflare.com/#secondary-dns-update-secondary-zone-configuration

func (*API) GenerateMagicTransitIPsecTunnelPSK added in v0.41.0

func (api *API) GenerateMagicTransitIPsecTunnelPSK(ctx context.Context, accountID string, id string) (string, *MagicTransitIPsecTunnelPskMetadata, error)

GenerateMagicTransitIPsecTunnelPSK generates a pre shared key (psk) for an IPsec tunnel

API reference: https://api.cloudflare.com/#magic-ipsec-tunnels-generate-pre-shared-key-psk-for-ipsec-tunnels

func (*API) GetAPIShieldConfiguration added in v0.49.0

func (api *API) GetAPIShieldConfiguration(ctx context.Context, rc *ResourceContainer) (APIShield, ResultInfo, error)

GetAPIShieldConfiguration gets a zone API shield configuration.

API documentation: https://api.cloudflare.com/#api-shield-settings-retrieve-information-about-specific-configuration-properties

func (*API) GetAPIShieldOperation added in v0.78.0

func (api *API) GetAPIShieldOperation(ctx context.Context, rc *ResourceContainer, params GetAPIShieldOperationParams) (*APIShieldOperation, error)

GetAPIShieldOperation returns information about an operation

API documentation https://developers.cloudflare.com/api/operations/api-shield-endpoint-management-retrieve-information-about-an-operation

func (*API) GetAPIShieldOperationSchemaValidationSettings added in v0.80.0

func (api *API) GetAPIShieldOperationSchemaValidationSettings(ctx context.Context, rc *ResourceContainer, params GetAPIShieldOperationSchemaValidationSettingsParams) (*APIShieldOperationSchemaValidationSettings, error)

GetAPIShieldOperationSchemaValidationSettings retrieves operation level schema validation settings

API documentation: https://developers.cloudflare.com/api/operations/api-shield-schema-validation-retrieve-operation-level-settings

func (*API) GetAPIShieldSchema added in v0.79.0

func (api *API) GetAPIShieldSchema(ctx context.Context, rc *ResourceContainer, params GetAPIShieldSchemaParams) (*APIShieldSchema, error)

GetAPIShieldSchema retrieves information about a specific schema on a zone

API documentation: https://developers.cloudflare.com/api/operations/api-shield-schema-validation-retrieve-information-about-specific-schema

func (*API) GetAPIShieldSchemaValidationSettings added in v0.80.0

func (api *API) GetAPIShieldSchemaValidationSettings(ctx context.Context, rc *ResourceContainer) (*APIShieldSchemaValidationSettings, error)

GetAPIShieldSchemaValidationSettings retrieves zone level schema validation settings

API documentation: https://developers.cloudflare.com/api/operations/api-shield-schema-validation-retrieve-zone-level-settings

func (*API) GetAPIToken added in v0.13.5

func (api *API) GetAPIToken(ctx context.Context, tokenID string) (APIToken, error)

GetAPIToken returns a single API token based on the ID.

API reference: https://api.cloudflare.com/#user-api-tokens-token-details

func (*API) GetAccessApplication added in v0.71.0

func (api *API) GetAccessApplication(ctx context.Context, rc *ResourceContainer, applicationID string) (AccessApplication, error)

GetAccessApplication returns a single application based on the application ID for either account or zone.

Account API reference: https://developers.cloudflare.com/api/operations/access-applications-get-an-access-application Zone API reference: https://developers.cloudflare.com/api/operations/zone-level-access-applications-get-an-access-application

func (*API) GetAccessCACertificate added in v0.71.0

func (api *API) GetAccessCACertificate(ctx context.Context, rc *ResourceContainer, applicationID string) (AccessCACertificate, error)

GetAccessCACertificate returns a single CA certificate associated within Access.

Account API reference: https://developers.cloudflare.com/api/operations/access-short-lived-certificate-c-as-get-a-short-lived-certificate-ca Zone API reference: https://developers.cloudflare.com/api/operations/zone-level-access-short-lived-certificate-c-as-get-a-short-lived-certificate-ca

func (*API) GetAccessCustomPage added in v0.74.0

func (api *API) GetAccessCustomPage(ctx context.Context, rc *ResourceContainer, id string) (AccessCustomPage, error)

func (*API) GetAccessGroup added in v0.71.0

func (api *API) GetAccessGroup(ctx context.Context, rc *ResourceContainer, groupID string) (AccessGroup, error)

GetAccessGroup returns a single group based on the group ID.

Account API Reference: https://developers.cloudflare.com/api/operations/access-groups-get-an-access-group Zone API Reference: https://developers.cloudflare.com/api/operations/zone-level-access-groups-get-an-access-group

func (*API) GetAccessIdentityProvider added in v0.71.0

func (api *API) GetAccessIdentityProvider(ctx context.Context, rc *ResourceContainer, identityProviderID string) (AccessIdentityProvider, error)

GetAccessIdentityProvider returns a single Access Identity Provider for an account or zone.

Account API Reference: https://developers.cloudflare.com/api/operations/access-identity-providers-get-an-access-identity-provider Zone API Reference: https://developers.cloudflare.com/api/operations/zone-level-access-identity-providers-get-an-access-identity-provider

func (*API) GetAccessMutualTLSCertificate added in v0.71.0

func (api *API) GetAccessMutualTLSCertificate(ctx context.Context, rc *ResourceContainer, certificateID string) (AccessMutualTLSCertificate, error)

GetAccessMutualTLSCertificate returns a single Access Mutual TLS certificate.

Account API Reference: https://developers.cloudflare.com/api/operations/access-mtls-authentication-get-an-mtls-certificate Zone API Reference: https://developers.cloudflare.com/api/operations/zone-level-access-mtls-authentication-get-an-mtls-certificate

func (*API) GetAccessOrganization added in v0.71.0

func (api *API) GetAccessOrganization(ctx context.Context, rc *ResourceContainer, params GetAccessOrganizationParams) (AccessOrganization, ResultInfo, error)

func (*API) GetAccessPolicy added in v0.71.0

func (api *API) GetAccessPolicy(ctx context.Context, rc *ResourceContainer, params GetAccessPolicyParams) (AccessPolicy, error)

GetAccessPolicy returns a single policy based on the policy ID.

Account API reference: https://developers.cloudflare.com/api/operations/access-policies-get-an-access-policy Zone API reference: https://developers.cloudflare.com/api/operations/zone-level-access-policies-get-an-access-policy

func (*API) GetAccessTag added in v0.78.0

func (api *API) GetAccessTag(ctx context.Context, rc *ResourceContainer, tagName string) (AccessTag, error)

func (*API) GetAccessUserActiveSessions added in v0.81.0

func (api *API) GetAccessUserActiveSessions(ctx context.Context, rc *ResourceContainer, userID string) ([]AccessUserActiveSessionResult, error)

GetAccessUserActiveSessions returns a list of active sessions for an user.

API documentation: https://developers.cloudflare.com/api/operations/zero-trust-users-get-active-sessions

func (*API) GetAccessUserFailedLogins added in v0.81.0

func (api *API) GetAccessUserFailedLogins(ctx context.Context, rc *ResourceContainer, userID string) ([]AccessUserFailedLoginResult, error)

GetAccessUserFailedLogins returns a list of failed logins for a user.

API documentation: https://developers.cloudflare.com/api/operations/zero-trust-users-get-failed-logins

func (*API) GetAccessUserLastSeenIdentity added in v0.81.0

func (api *API) GetAccessUserLastSeenIdentity(ctx context.Context, rc *ResourceContainer, userID string) (GetAccessUserLastSeenIdentityResult, error)

GetAccessUserLastSeenIdentity returns the last seen identity for a user.

API documentation: https://developers.cloudflare.com/api/operations/zero-trust-users-get-last-seen-identity

func (*API) GetAccessUserSingleActiveSession added in v0.81.0

func (api *API) GetAccessUserSingleActiveSession(ctx context.Context, rc *ResourceContainer, userID string, sessionID string) (GetAccessUserSingleActiveSessionResult, error)

GetAccessUserSingleActiveSession returns a single active session for a user.

API documentation: https://developers.cloudflare.com/api/operations/zero-trust-users-get-active-session

func (*API) GetAccountRole added in v0.78.0

func (api *API) GetAccountRole(ctx context.Context, rc *ResourceContainer, roleID string) (AccountRole, error)

GetAccountRole returns the details of a single account role.

API reference: https://developers.cloudflare.com/api/operations/account-roles-role-details

func (*API) GetAddressMap added in v0.63.0

func (api *API) GetAddressMap(ctx context.Context, rc *ResourceContainer, id string) (AddressMap, error)

GetAddressMap returns a specific address map.

API reference: https://developers.cloudflare.com/api/operations/ip-address-management-address-maps-address-map-details

func (*API) GetAdvertisementStatus added in v0.11.7

func (api *API) GetAdvertisementStatus(ctx context.Context, accountID, ID string) (AdvertisementStatus, error)

GetAdvertisementStatus returns the BGP status of the IP prefix

API reference: https://api.cloudflare.com/#ip-address-management-prefixes-update-prefix-description

func (*API) GetAuditSSHSettings added in v0.79.0

func (api *API) GetAuditSSHSettings(ctx context.Context, rc *ResourceContainer, params GetAuditSSHSettingsParams) (AuditSSHSettings, ResultInfo, error)

GetAuditSSHSettings returns the accounts zt audit ssh settings.

API reference: https://api.cloudflare.com/#zero-trust-get-audit-ssh-settings

func (*API) GetAuthenticatedOriginPullsStatus added in v0.12.2

func (api *API) GetAuthenticatedOriginPullsStatus(ctx context.Context, zoneID string) (AuthenticatedOriginPulls, error)

GetAuthenticatedOriginPullsStatus returns the configuration details for global AuthenticatedOriginPulls (tls_client_auth).

API reference: https://api.cloudflare.com/#zone-settings-get-tls-client-auth-setting

func (*API) GetAvailableNotificationTypes added in v0.19.0

func (api *API) GetAvailableNotificationTypes(ctx context.Context, accountID string) (NotificationAvailableAlertsResponse, error)

GetAvailableNotificationTypes will return the alert types available for a given account.

API Reference: https://api.cloudflare.com/#notification-mechanism-eligibility-properties

func (*API) GetBaseImage added in v0.71.0

func (api *API) GetBaseImage(ctx context.Context, rc *ResourceContainer, id string) ([]byte, error)

GetBaseImage gets the base image used to derive variants.

API Reference: https://api.cloudflare.com/#cloudflare-images-base-image

func (*API) GetBotManagement added in v0.75.0

func (api *API) GetBotManagement(ctx context.Context, rc *ResourceContainer) (BotManagement, error)

GetBotManagement gets a zone API shield configuration.

API documentation: https://developers.cloudflare.com/api/operations/bot-management-for-a-zone-get-config

func (*API) GetCacheReserve added in v0.68.0

func (api *API) GetCacheReserve(ctx context.Context, rc *ResourceContainer, params GetCacheReserveParams) (CacheReserve, error)

GetCacheReserve returns information about the current cache reserve settings.

API reference: https://developers.cloudflare.com/api/operations/zone-cache-settings-get-cache-reserve-setting

func (*API) GetCustomNameserverZoneMetadata added in v0.70.0

func (api *API) GetCustomNameserverZoneMetadata(ctx context.Context, rc *ResourceContainer, params GetCustomNameserverZoneMetadataParams) (CustomNameserverZoneMetadata, error)

GetCustomNameserverZoneMetadata get metadata for custom nameservers on a zone.

API documentation: https://developers.cloudflare.com/api/operations/account-level-custom-nameservers-usage-for-a-zone-get-account-custom-nameserver-related-zone-metadata

func (*API) GetCustomNameservers added in v0.70.0

func (api *API) GetCustomNameservers(ctx context.Context, rc *ResourceContainer, params GetCustomNameserversParams) ([]CustomNameserverResult, error)

GetCustomNameservers lists custom nameservers.

API documentation: https://developers.cloudflare.com/api/operations/account-level-custom-nameservers-list-account-custom-nameservers

func (*API) GetD1Database added in v0.79.0

func (api *API) GetD1Database(ctx context.Context, rc *ResourceContainer, databaseID string) (D1Database, error)

GetD1Database returns a database for an account.

API reference: https://developers.cloudflare.com/api/operations/cloudflare-d1-get-database

func (*API) GetDCVDelegation added in v0.77.0

func (api *API) GetDCVDelegation(ctx context.Context, rc *ResourceContainer, params GetDCVDelegationParams) (DCVDelegation, ResultInfo, error)

GetDCVDelegation gets a zone DCV Delegation UUID.

API documentation: https://developers.cloudflare.com/api/operations/dcv-delegation-uuid-get

func (*API) GetDLPDataset added in v0.87.0

func (api *API) GetDLPDataset(ctx context.Context, rc *ResourceContainer, datasetID string) (DLPDataset, error)

GetDLPDataset returns a DLP dataset based on the dataset ID.

API reference: https://developers.cloudflare.com/api/operations/dlp-datasets-read

func (*API) GetDLPPayloadLogSettings added in v0.62.0

func (api *API) GetDLPPayloadLogSettings(ctx context.Context, rc *ResourceContainer, params GetDLPPayloadLogSettingsParams) (DLPPayloadLogSettings, error)

GetDLPPayloadLogSettings gets the current DLP payload logging settings.

API reference: https://api.cloudflare.com/#dlp-payload-log-settings-get-settings

func (*API) GetDLPProfile added in v0.53.0

func (api *API) GetDLPProfile(ctx context.Context, rc *ResourceContainer, profileID string) (DLPProfile, error)

GetDLPProfile returns a single DLP profile (custom or predefined) based on the profile ID.

API reference: https://api.cloudflare.com/#dlp-profiles-get-dlp-profile

func (*API) GetDNSFirewallCluster added in v0.70.0

func (api *API) GetDNSFirewallCluster(ctx context.Context, rc *ResourceContainer, params GetDNSFirewallClusterParams) (*DNSFirewallCluster, error)

GetDNSFirewallCluster fetches a single DNS Firewall cluster.

API reference: https://api.cloudflare.com/#dns-firewall-dns-firewall-cluster-details

func (*API) GetDNSFirewallUserAnalytics added in v0.70.0

func (api *API) GetDNSFirewallUserAnalytics(ctx context.Context, rc *ResourceContainer, params GetDNSFirewallUserAnalyticsParams) (DNSFirewallAnalytics, error)

GetDNSFirewallUserAnalytics retrieves analytics report for a specified dimension and time range.

func (*API) GetDNSRecord added in v0.58.0

func (api *API) GetDNSRecord(ctx context.Context, rc *ResourceContainer, recordID string) (DNSRecord, error)

GetDNSRecord returns a single DNS record for the given zone & record identifiers.

API reference: https://api.cloudflare.com/#dns-records-for-a-zone-dns-record-details

func (*API) GetDataLocalizationRegionalHostname added in v0.66.0

func (api *API) GetDataLocalizationRegionalHostname(ctx context.Context, rc *ResourceContainer, hostname string) (RegionalHostname, error)

GetDataLocalizationRegionalHostname returns the details of a specific regional hostname.

API reference: https://developers.cloudflare.com/data-localization/regional-services/get-started/#configure-regional-services-via-api

func (*API) GetDefaultDeviceSettingsPolicy added in v0.52.0

func (api *API) GetDefaultDeviceSettingsPolicy(ctx context.Context, rc *ResourceContainer, params GetDefaultDeviceSettingsPolicyParams) (DeviceSettingsPolicy, error)

GetDefaultDeviceSettings gets the default device settings policy.

API reference: https://api.cloudflare.com/#devices-get-default-device-settings-policy

func (*API) GetDefaultZarazConfig added in v0.86.0

func (api *API) GetDefaultZarazConfig(ctx context.Context, rc *ResourceContainer) (ZarazConfigResponse, error)

func (*API) GetDeviceClientCertificates added in v0.81.0

func (api *API) GetDeviceClientCertificates(ctx context.Context, rc *ResourceContainer, params GetDeviceClientCertificatesParams) (DeviceClientCertificates, error)

GetDeviceClientCertificates controls the zero trust zone used to provision client certificates.

API reference: https://api.cloudflare.com/#device-client-certificates

func (*API) GetDeviceDexTest added in v0.62.0

func (api *API) GetDeviceDexTest(ctx context.Context, rc *ResourceContainer, testID string) (DeviceDexTest, error)

GetDeviceDexTest gets a single Device Dex Test.

API reference: https://developers.cloudflare.com/api/operations/device-dex-test-get-device-dex-test

func (*API) GetDeviceManagedNetwork added in v0.57.0

func (api *API) GetDeviceManagedNetwork(ctx context.Context, rc *ResourceContainer, networkID string) (DeviceManagedNetwork, error)

GetDeviceManagedNetwork gets a single Device Managed Network.

API reference: https://api.cloudflare.com/#device-managed-networks-device-managed-network-details

func (*API) GetDeviceSettingsPolicy added in v0.52.0

func (api *API) GetDeviceSettingsPolicy(ctx context.Context, rc *ResourceContainer, params GetDeviceSettingsPolicyParams) (DeviceSettingsPolicy, error)

GetDefaultDeviceSettings gets the device settings policy by its policyID.

API reference: https://api.cloudflare.com/#devices-get-device-settings-policy-by-id

func (*API) GetEligibleNotificationDestinations added in v0.19.0

func (api *API) GetEligibleNotificationDestinations(ctx context.Context, accountID string) (NotificationEligibilityResponse, error)

GetEligibleNotificationDestinations will return the types of destinations an account is eligible to configure.

API Reference: https://api.cloudflare.com/#notification-mechanism-eligibility-properties

func (*API) GetEligibleZonesAccountCustomNameservers added in v0.70.0

func (api *API) GetEligibleZonesAccountCustomNameservers(ctx context.Context, rc *ResourceContainer, params GetEligibleZonesAccountCustomNameserversParams) ([]string, error)

GetEligibleZonesAccountCustomNameservers lists zones eligible for custom nameservers.

API documentation: https://developers.cloudflare.com/api/operations/account-level-custom-nameservers-get-eligible-zones-for-account-custom-nameservers

func (*API) GetEmailRoutingCatchAllRule added in v0.47.0

func (api *API) GetEmailRoutingCatchAllRule(ctx context.Context, rc *ResourceContainer) (EmailRoutingCatchAllRule, error)

GetEmailRoutingCatchAllRule Get information on the default catch-all routing rule.

API reference: https://api.cloudflare.com/#email-routing-routing-rules-get-catch-all-rule

func (*API) GetEmailRoutingDNSSettings added in v0.47.0

func (api *API) GetEmailRoutingDNSSettings(ctx context.Context, rc *ResourceContainer) ([]DNSRecord, error)

GetEmailRoutingDNSSettings Show the DNS records needed to configure your Email Routing zone.

API reference: https://api.cloudflare.com/#email-routing-settings-email-routing---dns-settings

func (*API) GetEmailRoutingDestinationAddress added in v0.47.0

func (api *API) GetEmailRoutingDestinationAddress(ctx context.Context, rc *ResourceContainer, addressID string) (EmailRoutingDestinationAddress, error)

GetEmailRoutingDestinationAddress Gets information for a specific destination email already created.

API reference: https://api.cloudflare.com/#email-routing-destination-addresses-get-a-destination-address

func (*API) GetEmailRoutingRule added in v0.47.0

func (api *API) GetEmailRoutingRule(ctx context.Context, rc *ResourceContainer, ruleID string) (EmailRoutingRule, error)

GetEmailRoutingRule Get information for a specific routing rule already created.

API reference: https://api.cloudflare.com/#email-routing-routing-rules-get-routing-rule

func (*API) GetEmailRoutingSettings added in v0.47.0

func (api *API) GetEmailRoutingSettings(ctx context.Context, rc *ResourceContainer) (EmailRoutingSettings, error)

GetEmailRoutingSettings Get information about the settings for your Email Routing zone.

API reference: https://api.cloudflare.com/#email-routing-settings-get-email-routing-settings

func (*API) GetEntrypointRuleset added in v0.73.0

func (api *API) GetEntrypointRuleset(ctx context.Context, rc *ResourceContainer, phase string) (Ruleset, error)

GetEntrypointRuleset returns an entry point ruleset base on the phase.

API reference: https://developers.cloudflare.com/api/operations/getAccountEntrypointRuleset API reference: https://developers.cloudflare.com/api/operations/getZoneEntrypointRuleset

func (*API) GetHyperdriveConfig added in v0.88.0

func (api *API) GetHyperdriveConfig(ctx context.Context, rc *ResourceContainer, hyperdriveID string) (HyperdriveConfig, error)

GetHyperdriveConfig returns a single Hyperdrive config based on the ID.

API reference: https://developers.cloudflare.com/api/operations/get-hyperdrive

func (*API) GetIPList deprecated added in v0.13.0

func (api *API) GetIPList(ctx context.Context, accountID, ID string) (IPList, error)

GetIPList returns a single IP List

API reference: https://api.cloudflare.com/#rules-lists-get-list

Deprecated: Use `GetList` instead.

func (*API) GetIPListBulkOperation deprecated added in v0.13.0

func (api *API) GetIPListBulkOperation(ctx context.Context, accountID, ID string) (IPListBulkOperation, error)

GetIPListBulkOperation returns the status of a bulk operation.

API reference: https://api.cloudflare.com/#rules-lists-get-bulk-operation

Deprecated: Use `GetListBulkOperation` instead.

func (*API) GetIPListItem deprecated added in v0.13.0

func (api *API) GetIPListItem(ctx context.Context, accountID, listID, id string) (IPListItem, error)

GetIPListItem returns a single IP List Item.

API reference: https://api.cloudflare.com/#rules-lists-get-list-item

Deprecated: Use `GetListItem` instead.

func (*API) GetImage added in v0.71.0

func (api *API) GetImage(ctx context.Context, rc *ResourceContainer, id string) (Image, error)

GetImage gets the details of an uploaded image.

API Reference: https://api.cloudflare.com/#cloudflare-images-image-details

func (*API) GetImagesStats added in v0.71.0

func (api *API) GetImagesStats(ctx context.Context, rc *ResourceContainer) (ImagesStatsCount, error)

GetImagesStats gets an account's statistics for Cloudflare Images.

API Reference: https://api.cloudflare.com/#cloudflare-images-images-usage-statistics

func (*API) GetImagesVariant added in v0.88.0

func (api *API) GetImagesVariant(ctx context.Context, rc *ResourceContainer, variantID string) (ImagesVariant, error)

Fetch details for a single variant.

API Reference: https://developers.cloudflare.com/api/operations/cloudflare-images-variants-variant-details

func (*API) GetList added in v0.41.0

func (api *API) GetList(ctx context.Context, rc *ResourceContainer, listID string) (List, error)

GetList returns a single List.

API reference: https://api.cloudflare.com/#rules-lists-get-list

func (*API) GetListBulkOperation added in v0.41.0

func (api *API) GetListBulkOperation(ctx context.Context, rc *ResourceContainer, ID string) (ListBulkOperation, error)

GetListBulkOperation returns the status of a bulk operation.

API reference: https://api.cloudflare.com/#rules-lists-get-bulk-operation

func (*API) GetListItem added in v0.41.0

func (api *API) GetListItem(ctx context.Context, rc *ResourceContainer, listID, itemID string) (ListItem, error)

GetListItem returns a single List Item.

API reference: https://api.cloudflare.com/#rules-lists-get-list-item

func (*API) GetLoadBalancer added in v0.51.0

func (api *API) GetLoadBalancer(ctx context.Context, rc *ResourceContainer, loadbalancerID string) (LoadBalancer, error)

GetLoadBalancer returns the details for a load balancer.

API reference: https://api.cloudflare.com/#load-balancers-load-balancer-details

func (*API) GetLoadBalancerMonitor added in v0.51.0

func (api *API) GetLoadBalancerMonitor(ctx context.Context, rc *ResourceContainer, monitorID string) (LoadBalancerMonitor, error)

GetLoadBalancerMonitor returns the details for a load balancer monitor.

API reference: https://api.cloudflare.com/#load-balancer-monitors-monitor-details

func (*API) GetLoadBalancerPool added in v0.51.0

func (api *API) GetLoadBalancerPool(ctx context.Context, rc *ResourceContainer, poolID string) (LoadBalancerPool, error)

GetLoadBalancerPool returns the details for a load balancer pool.

API reference: https://api.cloudflare.com/#load-balancer-pools-pool-details

func (*API) GetLoadBalancerPoolHealth added in v0.51.0

func (api *API) GetLoadBalancerPoolHealth(ctx context.Context, rc *ResourceContainer, poolID string) (LoadBalancerPoolHealth, error)

GetLoadBalancerPoolHealth fetches the latest healtcheck details for a single pool.

API reference: https://api.cloudflare.com/#load-balancer-pools-pool-health-details

Example
package main

import (
	context "context"
	"fmt"
	"log"

	cloudflare "github.com/cloudflare/cloudflare-go"
)

func main() {
	// Construct a new API object.
	api, err := cloudflare.New("deadbeef", "test@example.com")
	if err != nil {
		log.Fatal(err)
	}

	// Fetch pool health details.
	healthInfo, err := api.GetLoadBalancerPoolHealth(context.Background(), cloudflare.AccountIdentifier("01a7362d577a6c3019a474fd6f485823"), "example-pool-id")
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(healthInfo)
}
Output:

func (*API) GetLogpullRetentionFlag added in v0.12.0

func (api *API) GetLogpullRetentionFlag(ctx context.Context, zoneID string) (*LogpullRetentionConfiguration, error)

GetLogpullRetentionFlag gets the current setting flag.

API reference: https://developers.cloudflare.com/logs/logpull-api/enabling-log-retention/

func (*API) GetLogpushFields added in v0.72.0

func (api *API) GetLogpushFields(ctx context.Context, rc *ResourceContainer, params GetLogpushFieldsParams) (LogpushFields, error)

LogpushFields returns fields for a given dataset.

API reference: https://api.cloudflare.com/#logpush-jobs-list-logpush-jobs

func (*API) GetLogpushJob added in v0.72.0

func (api *API) GetLogpushJob(ctx context.Context, rc *ResourceContainer, jobID int) (LogpushJob, error)

LogpushJob fetches detail about one Logpush Job for a zone.

API reference: https://api.cloudflare.com/#logpush-jobs-logpush-job-details

Example
api, err := cloudflare.New(apiKey, user)
if err != nil {
	log.Fatal(err)
}

zoneID, err := api.ZoneIDByName(domain)
if err != nil {
	log.Fatal(err)
}

job, err := api.GetLogpushJob(context.Background(), cloudflare.ZoneIdentifier(zoneID), 1)
if err != nil {
	log.Fatal(err)
}

fmt.Printf("%+v\n", job)
Output:

func (*API) GetLogpushOwnershipChallenge added in v0.9.0

func (api *API) GetLogpushOwnershipChallenge(ctx context.Context, rc *ResourceContainer, params GetLogpushOwnershipChallengeParams) (*LogpushGetOwnershipChallenge, error)

GetLogpushOwnershipChallenge returns ownership challenge.

API reference: https://api.cloudflare.com/#logpush-jobs-get-ownership-challenge

Example
api, err := cloudflare.New(apiKey, user)
if err != nil {
	log.Fatal(err)
}

zoneID, err := api.ZoneIDByName(domain)
if err != nil {
	log.Fatal(err)
}

ownershipChallenge, err := api.GetLogpushOwnershipChallenge(context.Background(), cloudflare.ZoneIdentifier(zoneID), cloudflare.GetLogpushOwnershipChallengeParams{DestinationConf: "destination_conf"})
if err != nil {
	log.Fatal(err)
}

fmt.Printf("%+v\n", ownershipChallenge)
Output:

func (*API) GetMTLSCertificate added in v0.58.0

func (api *API) GetMTLSCertificate(ctx context.Context, rc *ResourceContainer, certificateID string) (MTLSCertificate, error)

GetMTLSCertificate returns the metadata associated with a user-uploaded mTLS certificate.

API reference: https://api.cloudflare.com/#mtls-certificate-management-get-mtls-certificate

func (*API) GetMagicFirewallRuleset deprecated added in v0.13.7

func (api *API) GetMagicFirewallRuleset(ctx context.Context, accountID, ID string) (MagicFirewallRuleset, error)

GetMagicFirewallRuleset returns a specific Magic Firewall Ruleset

API reference: https://api.cloudflare.com/#rulesets-get-a-ruleset

Deprecated: Use `GetZoneRuleset` or `GetAccountRuleset` instead.

func (*API) GetMagicTransitGRETunnel added in v0.32.0

func (api *API) GetMagicTransitGRETunnel(ctx context.Context, accountID string, id string) (MagicTransitGRETunnel, error)

GetMagicTransitGRETunnel returns zero or one GRE tunnel.

API reference: https://api.cloudflare.com/#magic-gre-tunnels-gre-tunnel-details

func (*API) GetMagicTransitIPsecTunnel added in v0.31.0

func (api *API) GetMagicTransitIPsecTunnel(ctx context.Context, accountID string, id string) (MagicTransitIPsecTunnel, error)

GetMagicTransitIPsecTunnel returns zero or one IPsec tunnel

API reference: https://api.cloudflare.com/#magic-ipsec-tunnels-ipsec-tunnel-details

func (*API) GetMagicTransitStaticRoute added in v0.18.0

func (api *API) GetMagicTransitStaticRoute(ctx context.Context, accountID, ID string) (MagicTransitStaticRoute, error)

GetMagicTransitStaticRoute returns exactly one static route

API reference: https://api.cloudflare.com/#magic-transit-static-routes-route-details

func (*API) GetNotificationPolicy added in v0.19.0

func (api *API) GetNotificationPolicy(ctx context.Context, accountID, policyID string) (NotificationPolicyResponse, error)

GetNotificationPolicy returns a specific created by a user, given the account id and the policy id.

API Reference: https://api.cloudflare.com/#notification-policies-properties

func (*API) GetNotificationWebhooks added in v0.19.0

func (api *API) GetNotificationWebhooks(ctx context.Context, accountID, webhookID string) (NotificationWebhookResponse, error)

GetNotificationWebhooks will return a specific webhook destination, given the account and webhooks ids.

API Reference: https://api.cloudflare.com/#notification-webhooks-get-webhook

func (*API) GetObservatoryPageTest added in v0.78.0

func (api *API) GetObservatoryPageTest(ctx context.Context, rc *ResourceContainer, params GetObservatoryPageTestParams) (*ObservatoryPageTest, error)

GetObservatoryPageTest returns a specific test for a page.

API reference: https://api.cloudflare.com/#speed-get-test

func (*API) GetObservatoryPageTrend added in v0.78.0

func (api *API) GetObservatoryPageTrend(ctx context.Context, rc *ResourceContainer, params GetObservatoryPageTrendParams) (*ObservatoryPageTrend, error)

GetObservatoryPageTrend returns a the trend of web vital metrics for a page in a specific region.

API reference: https://api.cloudflare.com/#speed-list-page-trend

func (*API) GetObservatoryScheduledPageTest added in v0.78.0

func (api *API) GetObservatoryScheduledPageTest(ctx context.Context, rc *ResourceContainer, params GetObservatoryScheduledPageTestParams) (*ObservatorySchedule, error)

GetObservatoryScheduledPageTest returns the test schedule for a page in a specific region.

API reference: https://api.cloudflare.com/#speed-get-scheduled-test

func (*API) GetOrganizationAuditLogs added in v0.9.0

func (api *API) GetOrganizationAuditLogs(ctx context.Context, organizationID string, a AuditLogFilter) (AuditLogResponse, error)

GetOrganizationAuditLogs will return the audit logs of a specific organization, based on the ID passed in. The audit logs can be filtered based on any argument in the AuditLogFilter.

API Reference: https://api.cloudflare.com/#audit-logs-list-organization-audit-logs

func (*API) GetOriginCACertificate added in v0.58.0

func (api *API) GetOriginCACertificate(ctx context.Context, certificateID string) (*OriginCACertificate, error)

GetOriginCACertificate returns the details for a Cloudflare-issued certificate.

API reference: https://api.cloudflare.com/#cloudflare-ca-certificate-details

func (*API) GetPageShieldConnection added in v0.84.0

func (api *API) GetPageShieldConnection(ctx context.Context, rc *ResourceContainer, connectionID string) (*PageShieldConnection, error)

GetPageShieldConnection gets a page shield connection for a zone.

API documentation: https://developers.cloudflare.com/api/operations/page-shield-get-a-page-shield-connection

func (*API) GetPageShieldPolicy added in v0.84.0

func (api *API) GetPageShieldPolicy(ctx context.Context, rc *ResourceContainer, policyID string) (*PageShieldPolicy, error)

GetPageShieldPolicy gets a page shield policy for a zone.

API documentation: https://developers.cloudflare.com/api/operations/page-shield-get-page-shield-policy

func (*API) GetPageShieldScript added in v0.84.0

func (api *API) GetPageShieldScript(ctx context.Context, rc *ResourceContainer, scriptID string) (*PageShieldScript, []PageShieldScriptVersion, error)

GetPageShieldScript returns a PageShield Script.

API reference: https://developers.cloudflare.com/api/operations/page-shield-get-a-page-shield-script

func (*API) GetPageShieldSettings added in v0.84.0

func (api *API) GetPageShieldSettings(ctx context.Context, rc *ResourceContainer, params GetPageShieldSettingsParams) (*PageShieldSettingsResponse, error)

GetPageShieldSettings returns the page shield settings for a zone.

API documentation: https://developers.cloudflare.com/api/operations/page-shield-get-page-shield-settings

func (*API) GetPagesDeploymentInfo added in v0.40.0

func (api *API) GetPagesDeploymentInfo(ctx context.Context, rc *ResourceContainer, projectName, deploymentID string) (PagesProjectDeployment, error)

GetPagesDeploymentInfo returns a deployment for a Pages project.

API reference: https://api.cloudflare.com/#pages-deployment-get-deployment-info

func (*API) GetPagesDeploymentLogs added in v0.43.0

func (api *API) GetPagesDeploymentLogs(ctx context.Context, rc *ResourceContainer, params GetPagesDeploymentLogsParams) (PagesDeploymentLogs, error)

GetPagesDeploymentLogs returns the logs for a Pages deployment.

API reference: https://api.cloudflare.com/#pages-deployment-get-deployment-logs

func (*API) GetPagesDomain added in v0.44.0

func (api *API) GetPagesDomain(ctx context.Context, params PagesDomainParameters) (PagesDomain, error)

GetPagesDomain gets a single domain.

API Reference: https://api.cloudflare.com/#pages-domains-get-domains

func (*API) GetPagesDomains added in v0.44.0

func (api *API) GetPagesDomains(ctx context.Context, params PagesDomainsParameters) ([]PagesDomain, error)

GetPagesDomains gets all domains for a pages project.

API Reference: https://api.cloudflare.com/#pages-domains-get-domains

func (*API) GetPagesProject added in v0.73.0

func (api *API) GetPagesProject(ctx context.Context, rc *ResourceContainer, projectName string) (PagesProject, error)

GetPagesProject returns a single Pages project by name.

API reference: https://api.cloudflare.com/#pages-project-get-project

func (*API) GetPerHostnameAuthenticatedOriginPullsCertificate added in v0.12.2

func (api *API) GetPerHostnameAuthenticatedOriginPullsCertificate(ctx context.Context, zoneID, certificateID string) (PerHostnameAuthenticatedOriginPullsCertificateDetails, error)

GetPerHostnameAuthenticatedOriginPullsCertificate retrieves certificate metadata about the requested Per Hostname certificate.

API reference: https://api.cloudflare.com/#per-hostname-authenticated-origin-pull-get-the-hostname-client-certificate

func (*API) GetPerHostnameAuthenticatedOriginPullsConfig added in v0.12.2

func (api *API) GetPerHostnameAuthenticatedOriginPullsConfig(ctx context.Context, zoneID, hostname string) (PerHostnameAuthenticatedOriginPullsDetails, error)

GetPerHostnameAuthenticatedOriginPullsConfig returns the config state of Per Hostname AuthenticatedOriginPulls of the provided hostname within a zone.

API reference: https://api.cloudflare.com/#per-hostname-authenticated-origin-pull-get-the-hostname-status-for-client-authentication

func (*API) GetPerZoneAuthenticatedOriginPullsCertificateDetails added in v0.12.2

func (api *API) GetPerZoneAuthenticatedOriginPullsCertificateDetails(ctx context.Context, zoneID, certificateID string) (PerZoneAuthenticatedOriginPullsCertificateDetails, error)

GetPerZoneAuthenticatedOriginPullsCertificateDetails returns the metadata associated with a user uploaded client certificate to Per Zone AuthenticatedOriginPulls.

API reference: https://api.cloudflare.com/#zone-level-authenticated-origin-pulls-get-certificate-details

func (*API) GetPerZoneAuthenticatedOriginPullsStatus added in v0.12.2

func (api *API) GetPerZoneAuthenticatedOriginPullsStatus(ctx context.Context, zoneID string) (PerZoneAuthenticatedOriginPullsSettings, error)

GetPerZoneAuthenticatedOriginPullsStatus returns whether per zone AuthenticatedOriginPulls is enabled or not. It is false by default.

API reference: https://api.cloudflare.com/#zone-level-authenticated-origin-pulls-get-enablement-setting-for-zone

func (*API) GetPermissionGroup added in v0.53.0

func (api *API) GetPermissionGroup(ctx context.Context, rc *ResourceContainer, permissionGroupId string) (PermissionGroup, error)

GetPermissionGroup returns a specific permission group from the API given the account ID and permission group ID.

func (*API) GetPrefix added in v0.11.7

func (api *API) GetPrefix(ctx context.Context, accountID, ID string) (IPPrefix, error)

GetPrefix returns a specific IP prefix

API reference: https://api.cloudflare.com/#ip-address-management-prefixes-prefix-details

func (*API) GetQueue added in v0.55.0

func (api *API) GetQueue(ctx context.Context, rc *ResourceContainer, queueName string) (Queue, error)

GetQueue returns a single queue based on the name.

API reference: https://api.cloudflare.com/#queue-get-queue

func (*API) GetR2Bucket added in v0.68.0

func (api *API) GetR2Bucket(ctx context.Context, rc *ResourceContainer, bucketName string) (R2Bucket, error)

GetR2Bucket Gets an existing R2 bucket.

API reference: https://api.cloudflare.com/#r2-bucket-get-bucket

func (*API) GetRegionalTieredCache added in v0.73.0

func (api *API) GetRegionalTieredCache(ctx context.Context, rc *ResourceContainer, params GetRegionalTieredCacheParams) (RegionalTieredCache, error)

GetRegionalTieredCache returns information about the current regional tiered cache settings.

API reference: https://developers.cloudflare.com/api/operations/zone-cache-settings-get-regional-tiered-cache-setting

func (*API) GetRuleset added in v0.73.0

func (api *API) GetRuleset(ctx context.Context, rc *ResourceContainer, rulesetID string) (Ruleset, error)

GetRuleset fetches a single ruleset.

API reference: https://developers.cloudflare.com/api/operations/getAccountRuleset API reference: https://developers.cloudflare.com/api/operations/getZoneRuleset

func (*API) GetSecondaryDNSPrimary added in v0.15.0

func (api *API) GetSecondaryDNSPrimary(ctx context.Context, accountID, primaryID string) (SecondaryDNSPrimary, error)

GetSecondaryDNSPrimary returns a single secondary DNS primary.

API reference: https://api.cloudflare.com/#secondary-dns-primary--primary-details

func (*API) GetSecondaryDNSTSIG added in v0.15.0

func (api *API) GetSecondaryDNSTSIG(ctx context.Context, accountID, tsigID string) (SecondaryDNSTSIG, error)

GetSecondaryDNSTSIG gets a single account level TSIG for a secondary DNS configuration.

API reference: https://api.cloudflare.com/#secondary-dns-tsig--tsig-details

func (*API) GetSecondaryDNSZone added in v0.15.0

func (api *API) GetSecondaryDNSZone(ctx context.Context, zoneID string) (SecondaryDNSZone, error)

GetSecondaryDNSZone returns the secondary DNS zone configuration for a single zone.

API reference: https://api.cloudflare.com/#secondary-dns-secondary-zone-configuration-details

func (*API) GetTeamsDeviceDetails added in v0.32.0

func (api *API) GetTeamsDeviceDetails(ctx context.Context, accountID string, deviceID string) (TeamsDeviceListItem, error)

GetTeamsDeviceDetails gets device details.

API reference : https://api.cloudflare.com/#devices-device-details

func (*API) GetTeamsList added in v0.53.0

func (api *API) GetTeamsList(ctx context.Context, rc *ResourceContainer, listID string) (TeamsList, error)

GetTeamsList returns a single list based on the list ID.

API reference: https://api.cloudflare.com/#teams-lists-teams-list-details

func (*API) GetTieredCache added in v0.57.1

func (api *API) GetTieredCache(ctx context.Context, rc *ResourceContainer) (TieredCache, error)

GetTieredCache allows you to retrieve the current Tiered Cache Settings for a Zone. This function does not support custom topologies, only Generic and Smart Tiered Caching.

API Reference: https://api.cloudflare.com/#smart-tiered-cache-get-smart-tiered-cache-setting API Reference: https://api.cloudflare.com/#tiered-cache-get-tiered-cache-setting

func (*API) GetTotalTLS added in v0.53.0

func (api *API) GetTotalTLS(ctx context.Context, rc *ResourceContainer) (TotalTLS, error)

GetTotalTLS Get Total TLS Settings for a Zone.

API Reference: https://api.cloudflare.com/#total-tls-total-tls-settings-details

func (*API) GetTunnel added in v0.63.0

func (api *API) GetTunnel(ctx context.Context, rc *ResourceContainer, tunnelID string) (Tunnel, error)

GetTunnel returns a single Argo tunnel.

API reference: https://api.cloudflare.com/#cloudflare-tunnel-get-cloudflare-tunnel

func (*API) GetTunnelConfiguration added in v0.43.0

func (api *API) GetTunnelConfiguration(ctx context.Context, rc *ResourceContainer, tunnelID string) (TunnelConfigurationResult, error)

GetTunnelConfiguration updates an existing tunnel for the account.

API reference: https://api.cloudflare.com/#cloudflare-tunnel-configuration-properties

func (*API) GetTunnelRouteForIP added in v0.37.0

func (api *API) GetTunnelRouteForIP(ctx context.Context, rc *ResourceContainer, params TunnelRoutesForIPParams) (TunnelRoute, error)

GetTunnelRouteForIP finds the Tunnel Route that encompasses the given IP.

See: https://api.cloudflare.com/#tunnel-route-get-tunnel-route-by-ip

func (*API) GetTunnelToken added in v0.63.0

func (api *API) GetTunnelToken(ctx context.Context, rc *ResourceContainer, tunnelID string) (string, error)

GetTunnelToken that allows to run a tunnel.

API reference: https://api.cloudflare.com/#cloudflare-tunnel-get-cloudflare-tunnel-token

func (*API) GetTurnstileWidget added in v0.66.0

func (api *API) GetTurnstileWidget(ctx context.Context, rc *ResourceContainer, siteKey string) (TurnstileWidget, error)

GetTurnstileWidget shows a single challenge widget configuration.

API reference: https://api.cloudflare.com/#challenge-widgets-challenge-widget-details

func (*API) GetUserAuditLogs added in v0.9.0

func (api *API) GetUserAuditLogs(ctx context.Context, a AuditLogFilter) (AuditLogResponse, error)

GetUserAuditLogs will return your user's audit logs. The audit logs can be filtered based on any argument in the AuditLogFilter.

API Reference: https://api.cloudflare.com/#audit-logs-list-user-audit-logs

func (*API) GetWaitingRoomSettings added in v0.67.0

func (api *API) GetWaitingRoomSettings(ctx context.Context, rc *ResourceContainer) (WaitingRoomSettings, error)

GetWaitingRoomSettings fetches the Waiting Room zone-level settings for a zone.

API reference: https://api.cloudflare.com/#waiting-room-get-zone-settings

func (*API) GetWeb3Hostname added in v0.45.0

func (api *API) GetWeb3Hostname(ctx context.Context, params Web3HostnameDetailsParameters) (Web3Hostname, error)

GetWeb3Hostname gets a single web3 hostname by identifier.

API Reference: https://api.cloudflare.com/#web3-hostname-web3-hostname-details

func (*API) GetWebAnalyticsSite added in v0.75.0

func (api *API) GetWebAnalyticsSite(ctx context.Context, rc *ResourceContainer, params GetWebAnalyticsSiteParams) (*WebAnalyticsSite, error)

GetWebAnalyticsSite fetches detail about one Web Analytics Site for an Account.

API reference: https://api.cloudflare.com/#web-analytics-get-site

func (*API) GetWorker added in v0.57.0

func (api *API) GetWorker(ctx context.Context, rc *ResourceContainer, scriptName string) (WorkerScriptResponse, error)

GetWorker fetch raw script content for your worker returns string containing worker code js.

API reference: https://developers.cloudflare.com/api/operations/worker-script-download-worker

func (*API) GetWorkerRoute added in v0.16.0

func (api *API) GetWorkerRoute(ctx context.Context, rc *ResourceContainer, routeID string) (WorkerRouteResponse, error)

GetWorkerRoute returns a Workers route.

API reference: https://developers.cloudflare.com/api/operations/worker-routes-get-route

func (*API) GetWorkerWithDispatchNamespace added in v0.90.0

func (api *API) GetWorkerWithDispatchNamespace(ctx context.Context, rc *ResourceContainer, scriptName string, dispatchNamespace string) (WorkerScriptResponse, error)

GetWorker fetch raw script content for your worker returns string containing worker code js.

API reference: https://developers.cloudflare.com/api/operations/worker-script-download-worker

func (*API) GetWorkersDomain added in v0.55.0

func (api *API) GetWorkersDomain(ctx context.Context, rc *ResourceContainer, domainID string) (WorkersDomain, error)

GetWorkersDomain gets a single Worker Domain.

API reference: https://developers.cloudflare.com/api/operations/worker-domain-get-a-domain

func (*API) GetWorkersForPlatformsDispatchNamespace added in v0.90.0

func (api *API) GetWorkersForPlatformsDispatchNamespace(ctx context.Context, rc *ResourceContainer, name string) (*GetWorkersForPlatformsDispatchNamespaceResponse, error)

GetWorkersForPlatformsDispatchNamespace gets a specific dispatch namespace.

API reference: https://developers.cloudflare.com/api/operations/namespace-worker-get-namespace

func (API) GetWorkersKV added in v0.55.0

func (api API) GetWorkersKV(ctx context.Context, rc *ResourceContainer, params GetWorkersKVParams) ([]byte, error)

GetWorkersKV returns the value associated with the given key in the given namespace.

API reference: https://developers.cloudflare.com/api/operations/workers-kv-namespace-read-key-value-pair

Example
api, err := cloudflare.New(apiKey, user)
if err != nil {
	log.Fatal(err)
}

key := "test_key"
resp, err := api.GetWorkersKV(context.Background(), cloudflare.AccountIdentifier(accountID), cloudflare.GetWorkersKVParams{NamespaceID: namespace, Key: key})
if err != nil {
	log.Fatal(err)
}

fmt.Printf("%s\n", resp)
Output:

func (*API) GetWorkersScriptContent added in v0.76.0

func (api *API) GetWorkersScriptContent(ctx context.Context, rc *ResourceContainer, scriptName string) (string, error)

GetWorkersScriptContent returns the pure script content of a worker.

API reference: https://developers.cloudflare.com/api/operations/worker-script-get-content

func (*API) GetWorkersScriptSettings added in v0.76.0

func (api *API) GetWorkersScriptSettings(ctx context.Context, rc *ResourceContainer, scriptName string) (WorkerScriptSettingsResponse, error)

GetWorkersScriptSettings returns the metadata of a worker.

API reference: https://developers.cloudflare.com/api/operations/worker-script-get-settings

func (*API) GetZarazConfig added in v0.86.0

func (api *API) GetZarazConfig(ctx context.Context, rc *ResourceContainer) (ZarazConfigResponse, error)

func (*API) GetZarazWorkflow added in v0.86.0

func (api *API) GetZarazWorkflow(ctx context.Context, rc *ResourceContainer) (ZarazWorkflowResponse, error)

func (*API) GetZoneHold added in v0.75.0

func (api *API) GetZoneHold(ctx context.Context, rc *ResourceContainer, params GetZoneHoldParams) (ZoneHold, error)

GetZoneHold retrieves whether the zone is subject to a zone hold, and the metadata about the hold.

API reference: https://developers.cloudflare.com/api/operations/zones-0-hold-get

func (*API) GetZoneSetting added in v0.64.0

func (api *API) GetZoneSetting(ctx context.Context, rc *ResourceContainer, params GetZoneSettingParams) (ZoneSetting, error)

GetZoneSetting returns information about specified setting to the specified zone.

API reference: https://api.cloudflare.com/#zone-settings-get-all-zone-settings

func (*API) Healthcheck added in v0.11.1

func (api *API) Healthcheck(ctx context.Context, zoneID, healthcheckID string) (Healthcheck, error)

Healthcheck returns a single healthcheck by ID.

API reference: https://api.cloudflare.com/#health-checks-health-check-details

func (*API) HealthcheckPreview added in v0.11.5

func (api *API) HealthcheckPreview(ctx context.Context, zoneID, id string) (Healthcheck, error)

HealthcheckPreview returns a single healthcheck preview by its ID.

API reference: https://api.cloudflare.com/#health-checks-health-check-preview-details

func (*API) Healthchecks added in v0.11.1

func (api *API) Healthchecks(ctx context.Context, zoneID string) ([]Healthcheck, error)

Healthchecks returns all healthchecks for a zone.

API reference: https://api.cloudflare.com/#health-checks-list-health-checks

func (*API) ImportDNSRecords added in v0.66.0

func (api *API) ImportDNSRecords(ctx context.Context, rc *ResourceContainer, params ImportDNSRecordsParams) error

ImportDNSRecords takes the contents of a BIND configuration file and imports all records at once.

The current state of the API doesn't allow the proxying field to be automatically set on records where the TTL is 1. Instead you need to explicitly tell the endpoint which records are proxied in the form data. To achieve a simpler abstraction, we do the legwork in the method of making the two separate API calls (one for proxied and one for non-proxied) instead of making the end user know about this detail.

API reference: https://developers.cloudflare.com/api/operations/dns-records-for-a-zone-import-dns-records

func (*API) IntelligenceASNOverview added in v0.44.0

func (api *API) IntelligenceASNOverview(ctx context.Context, params IntelligenceASNOverviewParameters) ([]ASNInfo, error)

IntelligenceASNOverview get overview for an ASN number

API Reference: https://api.cloudflare.com/#asn-intelligence-get-asn-overview

func (*API) IntelligenceASNSubnets added in v0.44.0

func (api *API) IntelligenceASNSubnets(ctx context.Context, params IntelligenceASNSubnetsParameters) (IntelligenceASNSubnetResponse, error)

IntelligenceASNSubnets gets all subnets of an ASN

API Reference: https://api.cloudflare.com/#asn-intelligence-get-asn-subnets

func (*API) IntelligenceBulkDomainDetails added in v0.44.0

func (api *API) IntelligenceBulkDomainDetails(ctx context.Context, params GetBulkDomainDetailsParameters) ([]DomainDetails, error)

IntelligenceBulkDomainDetails gets domain information for a list of domains.

API Reference: https://api.cloudflare.com/#domain-intelligence-get-multiple-domain-details

func (*API) IntelligenceDomainDetails added in v0.44.0

func (api *API) IntelligenceDomainDetails(ctx context.Context, params GetDomainDetailsParameters) (DomainDetails, error)

IntelligenceDomainDetails gets domain information.

API Reference: https://api.cloudflare.com/#domain-intelligence-get-domain-details

func (*API) IntelligenceDomainHistory added in v0.44.0

func (api *API) IntelligenceDomainHistory(ctx context.Context, params GetDomainHistoryParameters) ([]DomainHistory, error)

IntelligenceDomainHistory get domain history for given domain

API Reference: https://api.cloudflare.com/#domain-history-get-domain-history

func (*API) IntelligenceGetIPList added in v0.44.0

func (api *API) IntelligenceGetIPList(ctx context.Context, params IPIntelligenceListParameters) ([]IPIntelligenceItem, error)

IntelligenceGetIPList gets intelligence ip-lists.

API Reference: https://api.cloudflare.com/#ip-list-get-ip-lists

func (*API) IntelligenceGetIPOverview added in v0.44.0

func (api *API) IntelligenceGetIPOverview(ctx context.Context, params IPIntelligenceParameters) ([]IPIntelligence, error)

IntelligenceGetIPOverview gets information about ipv4 or ipv6 address.

API Reference: https://api.cloudflare.com/#ip-intelligence-get-ip-overview

func (*API) IntelligencePassiveDNS added in v0.44.0

func (api *API) IntelligencePassiveDNS(ctx context.Context, params IPIntelligencePassiveDNSParameters) (IPPassiveDNS, error)

IntelligencePassiveDNS gets a history of DNS for an ip.

API Reference: https://api.cloudflare.com/#passive-dns-by-ip-get-passive-dns-by-ip

func (*API) IntelligencePhishingScan added in v0.44.0

func (api *API) IntelligencePhishingScan(ctx context.Context, params PhishingScanParameters) (PhishingScan, error)

IntelligencePhishingScan scans a URL for suspected phishing

API Reference: https://api.cloudflare.com/#phishing-url-scanner-scan-suspicious-url

func (*API) IntelligenceWHOIS added in v0.44.0

func (api *API) IntelligenceWHOIS(ctx context.Context, params WHOISParameters) (WHOIS, error)

IntelligenceWHOIS gets whois information for a domain.

API Reference: https://api.cloudflare.com/#whois-record-get-whois-record

func (*API) KeylessSSL added in v0.17.0

func (api *API) KeylessSSL(ctx context.Context, zoneID, keylessSSLID string) (KeylessSSL, error)

KeylessSSL provides the configuration for a given Keyless SSL identifier.

API reference: https://api.cloudflare.com/#keyless-ssl-for-a-zone-keyless-ssl-details

func (*API) ListAPIShieldDiscoveryOperations added in v0.79.0

func (api *API) ListAPIShieldDiscoveryOperations(ctx context.Context, rc *ResourceContainer, params ListAPIShieldDiscoveryOperationsParams) ([]APIShieldDiscoveryOperation, ResultInfo, error)

ListAPIShieldDiscoveryOperations retrieve the most up to date view of discovered operations.

API documentation: https://developers.cloudflare.com/api/operations/api-shield-api-discovery-retrieve-discovered-operations-on-a-zone

func (*API) ListAPIShieldOperations added in v0.78.0

func (api *API) ListAPIShieldOperations(ctx context.Context, rc *ResourceContainer, params ListAPIShieldOperationsParams) ([]APIShieldOperation, ResultInfo, error)

ListAPIShieldOperations retrieve information about all operations on a zone

API documentation https://developers.cloudflare.com/api/operations/api-shield-endpoint-management-retrieve-information-about-all-operations-on-a-zone

func (*API) ListAPIShieldSchemas added in v0.79.0

func (api *API) ListAPIShieldSchemas(ctx context.Context, rc *ResourceContainer, params ListAPIShieldSchemasParams) ([]APIShieldSchema, ResultInfo, error)

ListAPIShieldSchemas retrieves all schemas for a zone

API documentation: https://developers.cloudflare.com/api/operations/api-shield-schema-validation-retrieve-information-about-all-schemas

func (*API) ListAPITokensPermissionGroups added in v0.13.5

func (api *API) ListAPITokensPermissionGroups(ctx context.Context) ([]APITokenPermissionGroups, error)

ListAPITokensPermissionGroups returns all available API token permission groups.

API reference: https://api.cloudflare.com/#permission-groups-list-permission-groups

func (*API) ListAccessApplications added in v0.71.0

func (api *API) ListAccessApplications(ctx context.Context, rc *ResourceContainer, params ListAccessApplicationsParams) ([]AccessApplication, *ResultInfo, error)

ListAccessApplications returns all applications within an account or zone.

Account API reference: https://developers.cloudflare.com/api/operations/access-applications-list-access-applications Zone API reference: https://developers.cloudflare.com/api/operations/zone-level-access-applications-list-access-applications

func (*API) ListAccessCustomPages added in v0.74.0

func (api *API) ListAccessCustomPages(ctx context.Context, rc *ResourceContainer, params ListAccessCustomPagesParams) ([]AccessCustomPage, error)

func (*API) ListAccessGroups added in v0.71.0

func (api *API) ListAccessGroups(ctx context.Context, rc *ResourceContainer, params ListAccessGroupsParams) ([]AccessGroup, *ResultInfo, error)

ListAccessGroups returns all access groups for an access application.

Account API Reference: https://developers.cloudflare.com/api/operations/access-groups-list-access-groups Zone API Reference: https://developers.cloudflare.com/api/operations/zone-level-access-groups-list-access-groups

func (*API) ListAccessIdentityProviderAuthContexts added in v0.75.0

func (api *API) ListAccessIdentityProviderAuthContexts(ctx context.Context, rc *ResourceContainer, identityProviderID string) ([]AccessAuthContext, error)

ListAccessIdentityProviderAuthContexts returns an identity provider's auth contexts AzureAD only Account API Reference: https://developers.cloudflare.com/api/operations/access-identity-providers-get-an-access-identity-provider Zone API Reference: https://developers.cloudflare.com/api/operations/zone-level-access-identity-providers-get-an-access-identity-provider

func (*API) ListAccessIdentityProviders added in v0.71.0

func (api *API) ListAccessIdentityProviders(ctx context.Context, rc *ResourceContainer, params ListAccessIdentityProvidersParams) ([]AccessIdentityProvider, *ResultInfo, error)

ListAccessIdentityProviders returns all Access Identity Providers for an account or zone.

Account API Reference: https://developers.cloudflare.com/api/operations/access-identity-providers-list-access-identity-providers Zone API Reference: https://developers.cloudflare.com/api/operations/zone-level-access-identity-providers-list-access-identity-providers

func (*API) ListAccessPolicies added in v0.71.0

func (api *API) ListAccessPolicies(ctx context.Context, rc *ResourceContainer, params ListAccessPoliciesParams) ([]AccessPolicy, *ResultInfo, error)

ListAccessPolicies returns all access policies for an access application.

Account API reference: https://developers.cloudflare.com/api/operations/access-policies-list-access-policies Zone API reference: https://developers.cloudflare.com/api/operations/zone-level-access-policies-list-access-policies

func (*API) ListAccessServiceTokens added in v0.71.0

func (api *API) ListAccessServiceTokens(ctx context.Context, rc *ResourceContainer, params ListAccessServiceTokensParams) ([]AccessServiceToken, ResultInfo, error)

func (*API) ListAccessTags added in v0.78.0

func (api *API) ListAccessTags(ctx context.Context, rc *ResourceContainer, params ListAccessTagsParams) ([]AccessTag, error)

func (*API) ListAccessUsers added in v0.81.0

func (api *API) ListAccessUsers(ctx context.Context, rc *ResourceContainer, params AccessUserParams) ([]AccessUser, *ResultInfo, error)

ListAccessUsers returns a list of users for a single cloudflare access/zerotrust account.

API documentation: https://developers.cloudflare.com/api/operations/zero-trust-users-get-users

func (*API) ListAccountAccessRules added in v0.10.0

func (api *API) ListAccountAccessRules(ctx context.Context, accountID string, accessRule AccessRule, page int) (*AccessRuleListResponse, error)

ListAccountAccessRules returns a slice of access rules for the given account identifier.

This takes an AccessRule to allow filtering of the results returned.

API reference: https://api.cloudflare.com/#account-level-firewall-access-rule-list-access-rules

func (*API) ListAccountRoles added in v0.78.0

func (api *API) ListAccountRoles(ctx context.Context, rc *ResourceContainer, params ListAccountRolesParams) ([]AccountRole, error)

ListAccountRoles returns all roles of an account.

API reference: https://developers.cloudflare.com/api/operations/account-roles-list-roles

func (*API) ListAddressMaps added in v0.63.0

func (api *API) ListAddressMaps(ctx context.Context, rc *ResourceContainer, params ListAddressMapsParams) ([]AddressMap, error)

ListAddressMaps lists all address maps owned by the account.

API reference: https://developers.cloudflare.com/api/operations/ip-address-management-address-maps-list-address-maps

func (*API) ListAllRateLimits added in v0.8.5

func (api *API) ListAllRateLimits(ctx context.Context, zoneID string) ([]RateLimit, error)

ListAllRateLimits returns all Rate Limits for a zone.

API reference: https://api.cloudflare.com/#rate-limits-for-a-zone-list-rate-limits

func (*API) ListCertificatePacks added in v0.13.0

func (api *API) ListCertificatePacks(ctx context.Context, zoneID string) ([]CertificatePack, error)

ListCertificatePacks returns all available TLS certificate packs for a zone.

API Reference: https://api.cloudflare.com/#certificate-packs-list-certificate-packs

func (*API) ListD1Databases added in v0.79.0

func (api *API) ListD1Databases(ctx context.Context, rc *ResourceContainer, params ListD1DatabasesParams) ([]D1Database, *ResultInfo, error)

ListD1Databases returns all databases for an account.

API reference: https://developers.cloudflare.com/api/operations/cloudflare-d1-list-databases

func (*API) ListDLPDatasets added in v0.87.0

func (api *API) ListDLPDatasets(ctx context.Context, rc *ResourceContainer, params ListDLPDatasetsParams) ([]DLPDataset, error)

ListDLPDatasets returns all the DLP datasets associated with an account.

API reference: https://developers.cloudflare.com/api/operations/dlp-datasets-read-all

func (*API) ListDLPProfiles added in v0.53.0

func (api *API) ListDLPProfiles(ctx context.Context, rc *ResourceContainer, params ListDLPProfilesParams) ([]DLPProfile, error)

ListDLPProfiles returns all DLP profiles within an account.

API reference: https://api.cloudflare.com/#dlp-profiles-list-all-profiles

func (*API) ListDNSFirewallClusters added in v0.29.0

func (api *API) ListDNSFirewallClusters(ctx context.Context, rc *ResourceContainer, params ListDNSFirewallClustersParams) ([]*DNSFirewallCluster, error)

ListDNSFirewallClusters lists the DNS Firewall clusters associated with an account.

API reference: https://api.cloudflare.com/#dns-firewall-list-dns-firewall-clusters

func (*API) ListDNSRecords added in v0.58.0

func (api *API) ListDNSRecords(ctx context.Context, rc *ResourceContainer, params ListDNSRecordsParams) ([]DNSRecord, *ResultInfo, error)

ListDNSRecords returns a slice of DNS records for the given zone identifier.

API reference: https://api.cloudflare.com/#dns-records-for-a-zone-list-dns-records

Example (All)
api, err := cloudflare.New("deadbeef", "test@example.org")
if err != nil {
	log.Fatal(err)
}

zoneID, err := api.ZoneIDByName("example.com")
if err != nil {
	log.Fatal(err)
}

// Fetch all records for a zone
recs, _, err := api.ListDNSRecords(context.Background(), cloudflare.ZoneIdentifier(zoneID), cloudflare.ListDNSRecordsParams{})
if err != nil {
	log.Fatal(err)
}

for _, r := range recs {
	fmt.Printf("%s: %s\n", r.Name, r.Content)
}
Output:

Example (FilterByContent)
api, err := cloudflare.New("deadbeef", "test@example.org")
if err != nil {
	log.Fatal(err)
}

zoneID, err := api.ZoneIDByName("example.com")
if err != nil {
	log.Fatal(err)
}

recs, _, err := api.ListDNSRecords(context.Background(), cloudflare.ZoneIdentifier(zoneID), cloudflare.ListDNSRecordsParams{Content: "198.51.100.1"})
if err != nil {
	log.Fatal(err)
}

for _, r := range recs {
	fmt.Printf("%s: %s\n", r.Name, r.Content)
}
Output:

Example (FilterByName)
api, err := cloudflare.New("deadbeef", "test@example.org")
if err != nil {
	log.Fatal(err)
}

zoneID, err := api.ZoneIDByName("example.com")
if err != nil {
	log.Fatal(err)
}

recs, _, err := api.ListDNSRecords(context.Background(), cloudflare.ZoneIdentifier(zoneID), cloudflare.ListDNSRecordsParams{Name: "foo.example.com"})
if err != nil {
	log.Fatal(err)
}

for _, r := range recs {
	fmt.Printf("%s: %s\n", r.Name, r.Content)
}
Output:

Example (FilterByType)
api, err := cloudflare.New("deadbeef", "test@example.org")
if err != nil {
	log.Fatal(err)
}

zoneID, err := api.ZoneIDByName("example.com")
if err != nil {
	log.Fatal(err)
}

recs, _, err := api.ListDNSRecords(context.Background(), cloudflare.ZoneIdentifier(zoneID), cloudflare.ListDNSRecordsParams{Type: "AAAA"})
if err != nil {
	log.Fatal(err)
}

for _, r := range recs {
	fmt.Printf("%s: %s\n", r.Name, r.Content)
}
Output:

func (*API) ListDataLocalizationRegionalHostnames added in v0.66.0

func (api *API) ListDataLocalizationRegionalHostnames(ctx context.Context, rc *ResourceContainer, params ListDataLocalizationRegionalHostnamesParams) ([]RegionalHostname, error)

ListDataLocalizationRegionalHostnames lists all regional hostnames for a zone.

API reference: https://developers.cloudflare.com/data-localization/regional-services/get-started/#configure-regional-services-via-api

func (*API) ListDataLocalizationRegions added in v0.66.0

func (api *API) ListDataLocalizationRegions(ctx context.Context, rc *ResourceContainer, params ListDataLocalizationRegionsParams) ([]Region, error)

ListDataLocalizationRegions lists all available regions.

API reference: https://developers.cloudflare.com/data-localization/regional-services/get-started/#configure-regional-services-via-api

func (*API) ListDeviceManagedNetworks added in v0.57.0

func (api *API) ListDeviceManagedNetworks(ctx context.Context, rc *ResourceContainer, params ListDeviceManagedNetworksParams) ([]DeviceManagedNetwork, error)

ListDeviceManagedNetwork returns all Device Managed Networks for a given account.

API reference : https://api.cloudflare.com/#device-managed-networks-list-device-managed-networks

func (*API) ListDeviceSettingsPolicies added in v0.81.0

func (api *API) ListDeviceSettingsPolicies(ctx context.Context, rc *ResourceContainer, params ListDeviceSettingsPoliciesParams) ([]DeviceSettingsPolicy, *ResultInfo, error)

ListDeviceSettingsPolicies returns all device settings policies for an account

API reference: https://api.cloudflare.com/#devices-list-device-settings-policies

func (*API) ListDexTests added in v0.62.0

func (api *API) ListDexTests(ctx context.Context, rc *ResourceContainer, params ListDeviceDexTestParams) (DeviceDexTests, error)

ListDexTests returns all Device Dex Tests for a given account.

API reference : https://developers.cloudflare.com/api/operations/device-dex-test-details

func (*API) ListEmailRoutingDestinationAddresses added in v0.47.0

func (api *API) ListEmailRoutingDestinationAddresses(ctx context.Context, rc *ResourceContainer, params ListEmailRoutingAddressParameters) ([]EmailRoutingDestinationAddress, *ResultInfo, error)

ListEmailRoutingDestinationAddresses Lists existing destination addresses.

API reference: https://api.cloudflare.com/#email-routing-destination-addresses-list-destination-addresses

func (*API) ListEmailRoutingRules added in v0.47.0

func (api *API) ListEmailRoutingRules(ctx context.Context, rc *ResourceContainer, params ListEmailRoutingRulesParameters) ([]EmailRoutingRule, *ResultInfo, error)

ListEmailRoutingRules Lists existing routing rules.

API reference: https://api.cloudflare.com/#email-routing-routing-rules-list-routing-rules

func (*API) ListFallbackDomains added in v0.29.0

func (api *API) ListFallbackDomains(ctx context.Context, accountID string) ([]FallbackDomain, error)

ListFallbackDomains returns all fallback domains within an account.

API reference: https://api.cloudflare.com/#devices-get-local-domain-fallback-list

func (*API) ListFallbackDomainsDeviceSettingsPolicy added in v0.52.0

func (api *API) ListFallbackDomainsDeviceSettingsPolicy(ctx context.Context, accountID, policyID string) ([]FallbackDomain, error)

ListFallbackDomainsDeviceSettingsPolicy returns all fallback domains within an account for a specific device settings policy.

API reference: https://api.cloudflare.com/#devices-get-local-domain-fallback-list

func (*API) ListHostnameTLSSettings added in v0.75.0

func (api *API) ListHostnameTLSSettings(ctx context.Context, rc *ResourceContainer, params ListHostnameTLSSettingsParams) ([]HostnameTLSSetting, ResultInfo, error)

ListHostnameTLSSettings returns a list of all user-created tls setting values for the specified setting and hostnames.

API reference: https://developers.cloudflare.com/api/operations/per-hostname-tls-settings-list

func (*API) ListHostnameTLSSettingsCiphers added in v0.75.0

func (api *API) ListHostnameTLSSettingsCiphers(ctx context.Context, rc *ResourceContainer, params ListHostnameTLSSettingsCiphersParams) ([]HostnameTLSSettingCiphers, ResultInfo, error)

ListHostnameTLSSettingsCiphers returns a list of all user-created tls setting ciphers values for the specified setting and hostnames. Ciphers functions are separate due to the API returning a list of strings as the value, rather than a string (as is the case for the other tls settings).

API reference: https://developers.cloudflare.com/api/operations/per-hostname-tls-settings-list

func (*API) ListHyperdriveConfigs added in v0.88.0

func (api *API) ListHyperdriveConfigs(ctx context.Context, rc *ResourceContainer, params ListHyperdriveConfigParams) ([]HyperdriveConfig, error)

ListHyperdriveConfigs returns the Hyperdrive configs owned by an account.

API reference: https://developers.cloudflare.com/api/operations/list-hyperdrive

func (*API) ListIPListItems deprecated added in v0.13.0

func (api *API) ListIPListItems(ctx context.Context, accountID, ID string) ([]IPListItem, error)

ListIPListItems returns a list with all items in an IP List.

API reference: https://api.cloudflare.com/#rules-lists-list-list-items

Deprecated: Use `ListListItems` instead.

func (*API) ListIPLists deprecated added in v0.13.0

func (api *API) ListIPLists(ctx context.Context, accountID string) ([]IPList, error)

ListIPLists lists all IP Lists.

API reference: https://api.cloudflare.com/#rules-lists-list-lists

Deprecated: Use `ListLists` instead.

func (*API) ListImages added in v0.30.0

func (api *API) ListImages(ctx context.Context, rc *ResourceContainer, params ListImagesParams) ([]Image, error)

ListImages lists all images.

API Reference: https://api.cloudflare.com/#cloudflare-images-list-images

func (*API) ListImagesVariants added in v0.88.0

func (api *API) ListImagesVariants(ctx context.Context, rc *ResourceContainer, params ListImageVariantsParams) (ListImageVariantsResult, error)

Lists existing variants.

API Reference: https://developers.cloudflare.com/api/operations/cloudflare-images-variants-list-variants

func (*API) ListKeylessSSL added in v0.17.0

func (api *API) ListKeylessSSL(ctx context.Context, zoneID string) ([]KeylessSSL, error)

ListKeylessSSL lists Keyless SSL configurations for a zone.

API reference: https://api.cloudflare.com/#keyless-ssl-for-a-zone-list-keyless-ssl-configurations

func (*API) ListListItems added in v0.41.0

func (api *API) ListListItems(ctx context.Context, rc *ResourceContainer, params ListListItemsParams) ([]ListItem, error)

ListListItems returns a list with all items in a List.

API reference: https://api.cloudflare.com/#rules-lists-list-list-items

func (*API) ListLists added in v0.41.0

func (api *API) ListLists(ctx context.Context, rc *ResourceContainer, params ListListsParams) ([]List, error)

ListLists lists all Lists.

API reference: https://api.cloudflare.com/#rules-lists-list-lists

func (*API) ListLoadBalancerMonitors added in v0.8.0

func (api *API) ListLoadBalancerMonitors(ctx context.Context, rc *ResourceContainer, params ListLoadBalancerMonitorParams) ([]LoadBalancerMonitor, error)

ListLoadBalancerMonitors lists load balancer monitors connected to an account.

API reference: https://api.cloudflare.com/#load-balancer-monitors-list-monitors

func (*API) ListLoadBalancerPools added in v0.8.0

func (api *API) ListLoadBalancerPools(ctx context.Context, rc *ResourceContainer, params ListLoadBalancerPoolParams) ([]LoadBalancerPool, error)

ListLoadBalancerPools lists load balancer pools connected to an account.

API reference: https://api.cloudflare.com/#load-balancer-pools-list-pools

func (*API) ListLoadBalancers added in v0.8.0

func (api *API) ListLoadBalancers(ctx context.Context, rc *ResourceContainer, params ListLoadBalancerParams) ([]LoadBalancer, error)

ListLoadBalancers lists load balancers configured on a zone.

API reference: https://api.cloudflare.com/#load-balancers-list-load-balancers

Example
package main

import (
	context "context"
	"fmt"
	"log"

	cloudflare "github.com/cloudflare/cloudflare-go"
)

func main() {
	// Construct a new API object.
	api, err := cloudflare.New("deadbeef", "test@example.com")
	if err != nil {
		log.Fatal(err)
	}

	// List LBs configured in zone.
	lbList, err := api.ListLoadBalancers(context.Background(), cloudflare.ZoneIdentifier("d56084adb405e0b7e32c52321bf07be6"), cloudflare.ListLoadBalancerParams{})
	if err != nil {
		log.Fatal(err)
	}

	for _, lb := range lbList {
		fmt.Println(lb)
	}
}
Output:

func (*API) ListLogpushJobs added in v0.72.0

func (api *API) ListLogpushJobs(ctx context.Context, rc *ResourceContainer, params ListLogpushJobsParams) ([]LogpushJob, error)

ListAccountLogpushJobs returns all Logpush Jobs for all datasets.

API reference: https://api.cloudflare.com/#logpush-jobs-list-logpush-jobs

Example
api, err := cloudflare.New(apiKey, user)
if err != nil {
	log.Fatal(err)
}

zoneID, err := api.ZoneIDByName(domain)
if err != nil {
	log.Fatal(err)
}

jobs, err := api.ListLogpushJobs(context.Background(), cloudflare.ZoneIdentifier(zoneID), cloudflare.ListLogpushJobsParams{})
if err != nil {
	log.Fatal(err)
}

fmt.Printf("%+v\n", jobs)
for _, r := range jobs {
	fmt.Printf("%+v\n", r)
}
Output:

func (*API) ListLogpushJobsForDataset added in v0.72.0

func (api *API) ListLogpushJobsForDataset(ctx context.Context, rc *ResourceContainer, params ListLogpushJobsForDatasetParams) ([]LogpushJob, error)

LogpushJobsForDataset returns all Logpush Jobs for a dataset.

API reference: https://api.cloudflare.com/#logpush-jobs-list-logpush-jobs-for-a-dataset

func (*API) ListMTLSCertificateAssociations added in v0.58.0

func (api *API) ListMTLSCertificateAssociations(ctx context.Context, rc *ResourceContainer, params ListMTLSCertificateAssociationsParams) ([]MTLSAssociation, error)

ListMTLSCertificateAssociations returns a list of all existing associations between the mTLS certificate and Cloudflare services.

API reference: https://api.cloudflare.com/#mtls-certificate-management-list-mtls-certificate-associations

func (*API) ListMTLSCertificates added in v0.58.0

func (api *API) ListMTLSCertificates(ctx context.Context, rc *ResourceContainer, params ListMTLSCertificatesParams) ([]MTLSCertificate, ResultInfo, error)

ListMTLSCertificates returns a list of all user-uploaded mTLS certificates.

API reference: https://api.cloudflare.com/#mtls-certificate-management-list-mtls-certificates

func (*API) ListMagicFirewallRulesets deprecated added in v0.13.7

func (api *API) ListMagicFirewallRulesets(ctx context.Context, accountID string) ([]MagicFirewallRuleset, error)

ListMagicFirewallRulesets lists all Rulesets for a given account

API reference: https://api.cloudflare.com/#rulesets-list-rulesets

Deprecated: Use `ListZoneRuleset` or `ListAccountRuleset` instead.

func (*API) ListMagicTransitGRETunnels added in v0.32.0

func (api *API) ListMagicTransitGRETunnels(ctx context.Context, accountID string) ([]MagicTransitGRETunnel, error)

ListMagicTransitGRETunnels lists all GRE tunnels for a given account.

API reference: https://api.cloudflare.com/#magic-gre-tunnels-list-gre-tunnels

func (*API) ListMagicTransitIPsecTunnels added in v0.31.0

func (api *API) ListMagicTransitIPsecTunnels(ctx context.Context, accountID string) ([]MagicTransitIPsecTunnel, error)

ListMagicTransitIPsecTunnels lists all IPsec tunnels for a given account

API reference: https://api.cloudflare.com/#magic-ipsec-tunnels-list-ipsec-tunnels

func (*API) ListMagicTransitStaticRoutes added in v0.18.0

func (api *API) ListMagicTransitStaticRoutes(ctx context.Context, accountID string) ([]MagicTransitStaticRoute, error)

ListMagicTransitStaticRoutes lists all static routes for a given account

API reference: https://api.cloudflare.com/#magic-transit-static-routes-list-routes

func (*API) ListNotificationHistory added in v0.28.0

func (api *API) ListNotificationHistory(ctx context.Context, accountID string, alertHistoryFilter AlertHistoryFilter) ([]NotificationHistory, ResultInfo, error)

ListNotificationHistory will return the history of alerts sent for a given account. The time period varies based on zone plan. Free, Biz, Pro = 30 days Ent = 90 days

API Reference: https://api.cloudflare.com/#notification-history-list-history

func (*API) ListNotificationPolicies added in v0.19.0

func (api *API) ListNotificationPolicies(ctx context.Context, accountID string) (NotificationPoliciesResponse, error)

ListNotificationPolicies will return the notification policies created by a user for a specific account.

API Reference: https://api.cloudflare.com/#notification-policies-properties

func (*API) ListNotificationWebhooks added in v0.19.0

func (api *API) ListNotificationWebhooks(ctx context.Context, accountID string) (NotificationWebhooksResponse, error)

ListNotificationWebhooks will return the webhook destinations configured for an account.

API Reference: https://api.cloudflare.com/#notification-webhooks-list-webhooks

func (*API) ListObservatoryPageTests added in v0.78.0

func (api *API) ListObservatoryPageTests(ctx context.Context, rc *ResourceContainer, params ListObservatoryPageTestParams) ([]ObservatoryPageTest, *ResultInfo, error)

ListObservatoryPageTests returns a list of tests for a page in a specific region.

API reference: https://api.cloudflare.com/#speed-list-test-history

func (*API) ListObservatoryPages added in v0.78.0

func (api *API) ListObservatoryPages(ctx context.Context, rc *ResourceContainer, params ListObservatoryPagesParams) ([]ObservatoryPage, error)

ListObservatoryPages returns a list of pages which have been tested.

API reference: https://api.cloudflare.com/#speed-list-pages

func (*API) ListOriginCACertificates added in v0.58.0

func (api *API) ListOriginCACertificates(ctx context.Context, params ListOriginCertificatesParams) ([]OriginCACertificate, error)

ListOriginCACertificates lists all Cloudflare-issued certificates.

API reference: https://api.cloudflare.com/#cloudflare-ca-list-certificates

func (*API) ListPageRules added in v0.7.2

func (api *API) ListPageRules(ctx context.Context, zoneID string) ([]PageRule, error)

ListPageRules returns all Page Rules for a zone.

API reference: https://api.cloudflare.com/#page-rules-for-a-zone-list-page-rules

Example
api, err := cloudflare.New(apiKey, user)
if err != nil {
	log.Fatal(err)
}

zoneID, err := api.ZoneIDByName(domain)
if err != nil {
	log.Fatal(err)
}

pageRules, err := api.ListPageRules(context.Background(), zoneID)
if err != nil {
	log.Fatal(err)
}

fmt.Printf("%+v\n", pageRules)
for _, r := range pageRules {
	fmt.Printf("%+v\n", r)
}
Output:

func (*API) ListPageShieldConnections added in v0.84.0

func (api *API) ListPageShieldConnections(ctx context.Context, rc *ResourceContainer, params ListPageShieldConnectionsParams) ([]PageShieldConnection, ResultInfo, error)

ListPageShieldConnections lists all page shield connections for a zone.

API documentation: https://developers.cloudflare.com/api/operations/page-shield-list-page-shield-connections

func (*API) ListPageShieldPolicies added in v0.84.0

func (api *API) ListPageShieldPolicies(ctx context.Context, rc *ResourceContainer, params ListPageShieldPoliciesParams) ([]PageShieldPolicy, ResultInfo, error)

ListPageShieldPolicies lists all page shield policies for a zone.

API documentation: https://developers.cloudflare.com/api/operations/page-shield-list-page-shield-policies

func (*API) ListPageShieldScripts added in v0.84.0

func (api *API) ListPageShieldScripts(ctx context.Context, rc *ResourceContainer, params ListPageShieldScriptsParams) ([]PageShieldScript, ResultInfo, error)

ListPageShieldScripts returns a list of PageShield Scripts.

API reference: https://developers.cloudflare.com/api/operations/page-shield-list-page-shield-scripts

func (*API) ListPagerDutyNotificationDestinations added in v0.19.0

func (api *API) ListPagerDutyNotificationDestinations(ctx context.Context, accountID string) (NotificationPagerDutyResponse, error)

ListPagerDutyNotificationDestinations will return the pagerduty destinations configured for an account.

API Reference: https://api.cloudflare.com/#notification-destinations-with-pagerduty-list-pagerduty-services

func (*API) ListPagesDeployments added in v0.40.0

func (api *API) ListPagesDeployments(ctx context.Context, rc *ResourceContainer, params ListPagesDeploymentsParams) ([]PagesProjectDeployment, *ResultInfo, error)

ListPagesDeployments returns all deployments for a Pages project.

API reference: https://api.cloudflare.com/#pages-deployment-get-deployments

func (*API) ListPagesProjects added in v0.26.0

func (api *API) ListPagesProjects(ctx context.Context, rc *ResourceContainer, params ListPagesProjectsParams) ([]PagesProject, ResultInfo, error)

ListPagesProjects returns all Pages projects for an account.

API reference: https://api.cloudflare.com/#pages-project-get-projects

func (*API) ListPerHostnameAuthenticatedOriginPullsCertificates added in v0.17.0

func (api *API) ListPerHostnameAuthenticatedOriginPullsCertificates(ctx context.Context, zoneID string) ([]PerHostnameAuthenticatedOriginPullsDetails, error)

ListPerHostnameAuthenticatedOriginPullsCertificates will get all certificate under Per Hostname AuthenticatedOriginPulls zone.

API reference: https://api.cloudflare.com/#per-hostname-authenticated-origin-pull-list-certificates

func (*API) ListPerZoneAuthenticatedOriginPullsCertificates added in v0.12.2

func (api *API) ListPerZoneAuthenticatedOriginPullsCertificates(ctx context.Context, zoneID string) ([]PerZoneAuthenticatedOriginPullsCertificateDetails, error)

ListPerZoneAuthenticatedOriginPullsCertificates returns a list of all user uploaded client certificates to Per Zone AuthenticatedOriginPulls.

API reference: https://api.cloudflare.com/#zone-level-authenticated-origin-pulls-list-certificates

func (*API) ListPermissionGroups added in v0.53.0

func (api *API) ListPermissionGroups(ctx context.Context, rc *ResourceContainer, params ListPermissionGroupParams) ([]PermissionGroup, error)

ListPermissionGroups returns all valid permission groups for the provided parameters.

func (*API) ListPrefixes added in v0.11.7

func (api *API) ListPrefixes(ctx context.Context, accountID string) ([]IPPrefix, error)

ListPrefixes lists all IP prefixes for a given account

API reference: https://api.cloudflare.com/#ip-address-management-prefixes-list-prefixes

func (*API) ListQueueConsumers added in v0.55.0

func (api *API) ListQueueConsumers(ctx context.Context, rc *ResourceContainer, params ListQueueConsumersParams) ([]QueueConsumer, *ResultInfo, error)

ListQueueConsumers returns the consumers of a queue.

API reference: https://api.cloudflare.com/#queue-list-queue-consumers

func (*API) ListQueues added in v0.55.0

func (api *API) ListQueues(ctx context.Context, rc *ResourceContainer, params ListQueuesParams) ([]Queue, *ResultInfo, error)

ListQueues returns the queues owned by an account.

API reference: https://api.cloudflare.com/#queue-list-queues

func (*API) ListR2Buckets added in v0.55.0

func (api *API) ListR2Buckets(ctx context.Context, rc *ResourceContainer, params ListR2BucketsParams) ([]R2Bucket, error)

ListR2Buckets Lists R2 buckets.

func (*API) ListRateLimits added in v0.8.5

func (api *API) ListRateLimits(ctx context.Context, zoneID string, pageOpts PaginationOptions) ([]RateLimit, ResultInfo, error)

ListRateLimits returns Rate Limits for a zone, paginated according to the provided options

API reference: https://api.cloudflare.com/#rate-limits-for-a-zone-list-rate-limits

Example
api, err := cloudflare.New(apiKey, user)
if err != nil {
	log.Fatal(err)
}

zoneID, err := api.ZoneIDByName(domain)
if err != nil {
	log.Fatal(err)
}

pageOpts := cloudflare.PaginationOptions{
	PerPage: 5,
	Page:    1,
}
rateLimits, _, err := api.ListRateLimits(context.Background(), zoneID, pageOpts)
if err != nil {
	log.Fatal(err)
}

fmt.Printf("%+v\n", rateLimits)
for _, r := range rateLimits {
	fmt.Printf("%+v\n", r)
}
Output:

func (*API) ListRulesets added in v0.73.0

func (api *API) ListRulesets(ctx context.Context, rc *ResourceContainer, params ListRulesetsParams) ([]Ruleset, error)

ListRulesets lists all Rulesets in a given zone or account depending on the ResourceContainer type provided.

API reference: https://developers.cloudflare.com/api/operations/listAccountRulesets API reference: https://developers.cloudflare.com/api/operations/listZoneRulesets

func (*API) ListSSL added in v0.7.2

func (api *API) ListSSL(ctx context.Context, zoneID string) ([]ZoneCustomSSL, error)

ListSSL lists the custom certificates for the given zone.

API reference: https://api.cloudflare.com/#custom-ssl-for-a-zone-list-ssl-configurations

func (*API) ListSecondaryDNSPrimaries added in v0.15.0

func (api *API) ListSecondaryDNSPrimaries(ctx context.Context, accountID string) ([]SecondaryDNSPrimary, error)

ListSecondaryDNSPrimaries returns all secondary DNS primaries for an account.

API reference: https://api.cloudflare.com/#secondary-dns-primary--list-primaries

func (*API) ListSecondaryDNSTSIGs added in v0.15.0

func (api *API) ListSecondaryDNSTSIGs(ctx context.Context, accountID string) ([]SecondaryDNSTSIG, error)

ListSecondaryDNSTSIGs gets all account level TSIG for a secondary DNS configuration.

API reference: https://api.cloudflare.com/#secondary-dns-tsig--list-tsigs

func (*API) ListSplitTunnels added in v0.25.0

func (api *API) ListSplitTunnels(ctx context.Context, accountID string, mode string) ([]SplitTunnel, error)

ListSplitTunnel returns all include or exclude split tunnel within an account.

API reference for include: https://api.cloudflare.com/#device-policy-get-split-tunnel-include-list API reference for exclude: https://api.cloudflare.com/#device-policy-get-split-tunnel-exclude-list

func (*API) ListSplitTunnelsDeviceSettingsPolicy added in v0.52.0

func (api *API) ListSplitTunnelsDeviceSettingsPolicy(ctx context.Context, accountID, policyID string, mode string) ([]SplitTunnel, error)

ListSplitTunnelDeviceSettingsPolicy returns all include or exclude split tunnel within a device settings policy

API reference for include: https://api.cloudflare.com/#device-policy-get-split-tunnel-include-list API reference for exclude: https://api.cloudflare.com/#device-policy-get-split-tunnel-exclude-list

func (*API) ListTeamsDevices added in v0.32.0

func (api *API) ListTeamsDevices(ctx context.Context, accountID string) ([]TeamsDeviceListItem, error)

ListTeamsDevice returns all devices for a given account.

API reference : https://api.cloudflare.com/#devices-list-devices

func (*API) ListTeamsListItems added in v0.53.0

func (api *API) ListTeamsListItems(ctx context.Context, rc *ResourceContainer, params ListTeamsListItemsParams) ([]TeamsListItem, ResultInfo, error)

ListTeamsListItems returns all list items for a list.

API reference: https://api.cloudflare.com/#teams-lists-teams-list-items

func (*API) ListTeamsLists added in v0.53.0

func (api *API) ListTeamsLists(ctx context.Context, rc *ResourceContainer, params ListTeamListsParams) ([]TeamsList, ResultInfo, error)

ListTeamsLists returns all lists within an account.

API reference: https://api.cloudflare.com/#teams-lists-list-teams-lists

func (*API) ListTunnelConnections added in v0.63.0

func (api *API) ListTunnelConnections(ctx context.Context, rc *ResourceContainer, tunnelID string) ([]Connection, error)

ListTunnelConnections gets all connections on a tunnel.

API reference: https://api.cloudflare.com/#cloudflare-tunnel-list-cloudflare-tunnel-connections

func (*API) ListTunnelRoutes added in v0.37.0

func (api *API) ListTunnelRoutes(ctx context.Context, rc *ResourceContainer, params TunnelRoutesListParams) ([]TunnelRoute, error)

ListTunnelRoutes lists all defined routes for tunnels in the account.

See: https://api.cloudflare.com/#tunnel-route-list-tunnel-routes

func (*API) ListTunnelVirtualNetworks added in v0.41.0

func (api *API) ListTunnelVirtualNetworks(ctx context.Context, rc *ResourceContainer, params TunnelVirtualNetworksListParams) ([]TunnelVirtualNetwork, error)

ListTunnelVirtualNetworks lists all defined virtual networks for tunnels in the account.

API reference: https://api.cloudflare.com/#tunnel-virtual-network-list-virtual-networks

func (*API) ListTunnels added in v0.63.0

func (api *API) ListTunnels(ctx context.Context, rc *ResourceContainer, params TunnelListParams) ([]Tunnel, *ResultInfo, error)

ListTunnels lists all tunnels.

API reference: https://api.cloudflare.com/#cloudflare-tunnel-list-cloudflare-tunnels

func (*API) ListTurnstileWidgets added in v0.66.0

func (api *API) ListTurnstileWidgets(ctx context.Context, rc *ResourceContainer, params ListTurnstileWidgetParams) ([]TurnstileWidget, *ResultInfo, error)

ListTurnstileWidgets lists challenge widgets.

API reference: https://api.cloudflare.com/#challenge-widgets-list-challenge-widgets

func (*API) ListUserAccessRules added in v0.8.1

func (api *API) ListUserAccessRules(ctx context.Context, accessRule AccessRule, page int) (*AccessRuleListResponse, error)

ListUserAccessRules returns a slice of access rules for the logged-in user.

This takes an AccessRule to allow filtering of the results returned.

API reference: https://api.cloudflare.com/#user-level-firewall-access-rule-list-access-rules

func (*API) ListUserAgentRules added in v0.8.0

func (api *API) ListUserAgentRules(ctx context.Context, zoneID string, page int) (*UserAgentRuleListResponse, error)

ListUserAgentRules retrieves a list of User-Agent Block rules for a given zone ID by page number.

API reference: https://api.cloudflare.com/#user-agent-blocking-rules-list-useragent-rules

Example (All)
package main

import (
	"context"
	"fmt"
	"log"

	cloudflare "github.com/cloudflare/cloudflare-go"
)

func main() {
	api, err := cloudflare.New("deadbeef", "test@example.org")
	if err != nil {
		log.Fatal(err)
	}

	zoneID, err := api.ZoneIDByName("example.com")
	if err != nil {
		log.Fatal(err)
	}

	// Fetch all Zone Lockdown rules for a zone, by page.
	rules, err := api.ListUserAgentRules(context.Background(), zoneID, 1)
	if err != nil {
		log.Fatal(err)
	}

	for _, r := range rules.Result {
		fmt.Printf("%s: %s\n", r.Configuration.Target, r.Configuration.Value)
	}
}
Output:

func (*API) ListWAFGroups added in v0.10.0

func (api *API) ListWAFGroups(ctx context.Context, zoneID, packageID string) ([]WAFGroup, error)

ListWAFGroups returns a slice of the WAF groups for the given WAF package.

API Reference: https://api.cloudflare.com/#waf-rule-groups-list-rule-groups

func (*API) ListWAFOverrides added in v0.11.1

func (api *API) ListWAFOverrides(ctx context.Context, zoneID string) ([]WAFOverride, error)

ListWAFOverrides returns a slice of the WAF overrides.

API Reference: https://api.cloudflare.com/#waf-overrides-list-uri-controlled-waf-configurations

func (*API) ListWAFPackages added in v0.7.2

func (api *API) ListWAFPackages(ctx context.Context, zoneID string) ([]WAFPackage, error)

ListWAFPackages returns a slice of the WAF packages for the given zone.

API Reference: https://api.cloudflare.com/#waf-rule-packages-list-firewall-packages

func (*API) ListWAFRules added in v0.7.2

func (api *API) ListWAFRules(ctx context.Context, zoneID, packageID string) ([]WAFRule, error)

ListWAFRules returns a slice of the WAF rules for the given WAF package.

API Reference: https://api.cloudflare.com/#waf-rules-list-rules

func (*API) ListWaitingRoomEvents added in v0.33.0

func (api *API) ListWaitingRoomEvents(ctx context.Context, zoneID string, waitingRoomID string) ([]WaitingRoomEvent, error)

ListWaitingRoomEvents returns all Waiting Room Events for a zone.

API reference: https://api.cloudflare.com/#waiting-room-list-events

func (*API) ListWaitingRoomRules added in v0.53.0

func (api *API) ListWaitingRoomRules(ctx context.Context, rc *ResourceContainer, params ListWaitingRoomRuleParams) ([]WaitingRoomRule, error)

ListWaitingRoomRules lists all rules for a Waiting Room.

API reference: https://api.cloudflare.com/#waiting-room-list-waiting-room-rules

func (*API) ListWaitingRooms added in v0.17.0

func (api *API) ListWaitingRooms(ctx context.Context, zoneID string) ([]WaitingRoom, error)

ListWaitingRooms returns all Waiting Room for a zone.

API reference: https://api.cloudflare.com/#waiting-room-list-waiting-rooms

func (*API) ListWeb3Hostnames added in v0.45.0

func (api *API) ListWeb3Hostnames(ctx context.Context, params Web3HostnameListParameters) ([]Web3Hostname, error)

ListWeb3Hostnames lists all web3 hostnames.

API Reference: https://api.cloudflare.com/#web3-hostname-list-web3-hostnames

func (*API) ListWebAnalyticsRules added in v0.75.0

func (api *API) ListWebAnalyticsRules(ctx context.Context, rc *ResourceContainer, params ListWebAnalyticsRulesParams) (*WebAnalyticsRulesetRules, error)

ListWebAnalyticsRules fetches all Web Analytics Rules in a Web Analytics ruleset.

API reference: https://api.cloudflare.com/#web-analytics-list-rules

func (*API) ListWebAnalyticsSites added in v0.75.0

func (api *API) ListWebAnalyticsSites(ctx context.Context, rc *ResourceContainer, params ListWebAnalyticsSitesParams) ([]WebAnalyticsSite, *ResultInfo, error)

ListWebAnalyticsSites returns all Web Analytics Sites of an Account.

API reference: https://api.cloudflare.com/#web-analytics-list-sites

func (*API) ListWorkerBindings added in v0.10.7

func (api *API) ListWorkerBindings(ctx context.Context, rc *ResourceContainer, params ListWorkerBindingsParams) (WorkerBindingListResponse, error)

ListWorkerBindings returns all the bindings for a particular worker.

func (*API) ListWorkerCronTriggers added in v0.13.8

func (api *API) ListWorkerCronTriggers(ctx context.Context, rc *ResourceContainer, params ListWorkerCronTriggersParams) ([]WorkerCronTrigger, error)

ListWorkerCronTriggers fetches all available cron triggers for a single Worker script.

API reference: https://developers.cloudflare.com/api/operations/worker-cron-trigger-get-cron-triggers

func (*API) ListWorkerRoutes added in v0.9.0

func (api *API) ListWorkerRoutes(ctx context.Context, rc *ResourceContainer, params ListWorkerRoutesParams) (WorkerRoutesResponse, error)

ListWorkerRoutes returns list of Worker routes.

API reference: https://developers.cloudflare.com/api/operations/worker-routes-list-routes

func (*API) ListWorkers added in v0.57.0

func (api *API) ListWorkers(ctx context.Context, rc *ResourceContainer, params ListWorkersParams) (WorkerListResponse, *ResultInfo, error)

ListWorkers returns list of Workers for given account.

API reference: https://developers.cloudflare.com/api/operations/worker-script-list-workers

func (*API) ListWorkersDomains added in v0.55.0

func (api *API) ListWorkersDomains(ctx context.Context, rc *ResourceContainer, params ListWorkersDomainParams) ([]WorkersDomain, error)

ListWorkersDomains lists all Worker Domains.

API reference: https://developers.cloudflare.com/api/operations/worker-domain-list-domains

func (*API) ListWorkersForPlatformsDispatchNamespaces added in v0.90.0

func (api *API) ListWorkersForPlatformsDispatchNamespaces(ctx context.Context, rc *ResourceContainer) (*ListWorkersForPlatformsDispatchNamespaceResponse, error)

ListWorkersForPlatformsDispatchNamespaces lists the dispatch namespaces.

API reference: https://developers.cloudflare.com/api/operations/namespace-worker-list

func (API) ListWorkersKVKeys added in v0.55.0

func (api API) ListWorkersKVKeys(ctx context.Context, rc *ResourceContainer, params ListWorkersKVsParams) (ListStorageKeysResponse, error)

ListWorkersKVKeys lists a namespace's keys.

API Reference: https://developers.cloudflare.com/api/operations/workers-kv-namespace-list-a-namespace'-s-keys

Example
api, err := cloudflare.New(apiKey, user)
if err != nil {
	log.Fatal(err)
}

limit := 50
prefix := "my-prefix"
cursor := "AArAbNSOuYcr4HmzGH02-cfDN8Ck9ejOwkn_Ai5rsn7S9NEqVJBenU9-gYRlrsziyjKLx48hNDLvtYzBAmkPsLGdye8ECr5PqFYcIOfUITdhkyTc1x6bV8nmyjz5DO-XaZH4kYY1KfqT8NRBIe5sic6yYt3FUDttGjafy0ivi-Up-TkVdRB0OxCf3O3OB-svG6DXheV5XTdDNrNx1o_CVqy2l2j0F4iKV1qFe_KhdkjC7Y6QjhUZ1MOb3J_uznNYVCoxZ-bVAAsJmXA"

resp, err := api.ListWorkersKVKeys(context.Background(), cloudflare.AccountIdentifier(accountID), cloudflare.ListWorkersKVsParams{
	NamespaceID: namespace,
	Prefix:      prefix,
	Limit:       limit,
	Cursor:      cursor,
})
if err != nil {
	log.Fatal(err)
}

fmt.Println(resp)
Output:

func (*API) ListWorkersKVNamespaces added in v0.9.0

func (api *API) ListWorkersKVNamespaces(ctx context.Context, rc *ResourceContainer, params ListWorkersKVNamespacesParams) ([]WorkersKVNamespace, *ResultInfo, error)

ListWorkersKVNamespaces lists storage namespaces.

API reference: https://developers.cloudflare.com/api/operations/workers-kv-namespace-list-namespaces

Example
api, err := cloudflare.New(apiKey, user)
if err != nil {
	log.Fatal(err)
}

lsr, _, err := api.ListWorkersKVNamespaces(context.Background(), cloudflare.AccountIdentifier(accountID), cloudflare.ListWorkersKVNamespacesParams{})
if err != nil {
	log.Fatal(err)
}

fmt.Println(lsr)

resp, _, err := api.ListWorkersKVNamespaces(context.Background(), cloudflare.AccountIdentifier(accountID), cloudflare.ListWorkersKVNamespacesParams{ResultInfo: cloudflare.ResultInfo{
	PerPage: 10,
}})
if err != nil {
	log.Fatal(err)
}

fmt.Println(resp)
Output:

func (*API) ListWorkersSecrets added in v0.13.1

func (api *API) ListWorkersSecrets(ctx context.Context, rc *ResourceContainer, params ListWorkersSecretsParams) (WorkersListSecretsResponse, error)

ListWorkersSecrets lists secrets for a given worker API reference: https://api.cloudflare.com/

func (*API) ListWorkersTail added in v0.47.0

func (api *API) ListWorkersTail(ctx context.Context, rc *ResourceContainer, params ListWorkersTailParameters) (WorkersTail, error)

ListWorkersTail Get list of tails currently deployed on a Worker.

API reference: https://developers.cloudflare.com/api/operations/worker-tail-logs-list-tails

func (*API) ListZarazConfigHistory added in v0.86.0

func (api *API) ListZarazConfigHistory(ctx context.Context, rc *ResourceContainer, params ListZarazConfigHistoryParams) ([]ZarazHistoryRecord, *ResultInfo, error)

func (*API) ListZoneAccessRules added in v0.8.1

func (api *API) ListZoneAccessRules(ctx context.Context, zoneID string, accessRule AccessRule, page int) (*AccessRuleListResponse, error)

ListZoneAccessRules returns a slice of access rules for the given zone identifier.

This takes an AccessRule to allow filtering of the results returned.

API reference: https://api.cloudflare.com/#firewall-access-rule-for-a-zone-list-access-rules

Example (All)
package main

import (
	"context"
	"fmt"
	"log"

	cloudflare "github.com/cloudflare/cloudflare-go"
)

func main() {
	api, err := cloudflare.New("deadbeef", "test@example.org")
	if err != nil {
		log.Fatal(err)
	}

	zoneID, err := api.ZoneIDByName("example.com")
	if err != nil {
		log.Fatal(err)
	}

	// Fetch all access rules for a zone
	response, err := api.ListZoneAccessRules(context.Background(), zoneID, cloudflare.AccessRule{}, 1)
	if err != nil {
		log.Fatal(err)
	}

	for _, r := range response.Result {
		fmt.Printf("%s: %s\n", r.Configuration.Value, r.Mode)
	}
}
Output:

Example (FilterByIP)
package main

import (
	"context"
	"fmt"
	"log"

	cloudflare "github.com/cloudflare/cloudflare-go"
)

func main() {
	api, err := cloudflare.New("deadbeef", "test@example.org")
	if err != nil {
		log.Fatal(err)
	}

	zoneID, err := api.ZoneIDByName("example.com")
	if err != nil {
		log.Fatal(err)
	}

	// Fetch only access rules whose target is 198.51.100.1
	localhost := cloudflare.AccessRule{
		Configuration: cloudflare.AccessRuleConfiguration{Target: "198.51.100.1"},
	}
	response, err := api.ListZoneAccessRules(context.Background(), zoneID, localhost, 1)
	if err != nil {
		log.Fatal(err)
	}

	for _, r := range response.Result {
		fmt.Printf("%s: %s\n", r.Configuration.Value, r.Mode)
	}
}
Output:

Example (FilterByMode)
package main

import (
	"context"
	"fmt"
	"log"

	cloudflare "github.com/cloudflare/cloudflare-go"
)

func main() {
	api, err := cloudflare.New("deadbeef", "test@example.org")
	if err != nil {
		log.Fatal(err)
	}

	zoneID, err := api.ZoneIDByName("example.com")
	if err != nil {
		log.Fatal(err)
	}

	// Fetch access rules with an action of "block"
	foo := cloudflare.AccessRule{
		Mode: "block",
	}
	response, err := api.ListZoneAccessRules(context.Background(), zoneID, foo, 1)
	if err != nil {
		log.Fatal(err)
	}

	for _, r := range response.Result {
		fmt.Printf("%s: %s\n", r.Configuration.Value, r.Mode)
	}
}
Output:

Example (FilterByNote)
package main

import (
	"context"
	"fmt"
	"log"

	cloudflare "github.com/cloudflare/cloudflare-go"
)

func main() {
	api, err := cloudflare.New("deadbeef", "test@example.org")
	if err != nil {
		log.Fatal(err)
	}

	zoneID, err := api.ZoneIDByName("example.com")
	if err != nil {
		log.Fatal(err)
	}

	// Fetch only access rules with notes containing "example"
	foo := cloudflare.AccessRule{
		Notes: "example",
	}
	response, err := api.ListZoneAccessRules(context.Background(), zoneID, foo, 1)
	if err != nil {
		log.Fatal(err)
	}

	for _, r := range response.Result {
		fmt.Printf("%s: %s\n", r.Configuration.Value, r.Mode)
	}
}
Output:

func (*API) ListZoneLockdowns added in v0.8.0

func (api *API) ListZoneLockdowns(ctx context.Context, rc *ResourceContainer, params LockdownListParams) ([]ZoneLockdown, *ResultInfo, error)

ListZoneLockdowns retrieves every Zone ZoneLockdown rules for a given zone ID.

Automatically paginates all results unless `params.PerPage` and `params.Page` is set.

API reference: https://api.cloudflare.com/#zone-ZoneLockdown-list-ZoneLockdown-rules

Example (All)
package main

import (
	"context"
	"fmt"
	"log"
	"strings"

	cloudflare "github.com/cloudflare/cloudflare-go"
)

func main() {
	api, err := cloudflare.New("deadbeef", "test@example.org")
	if err != nil {
		log.Fatal(err)
	}

	zoneID, err := api.ZoneIDByName("example.com")
	if err != nil {
		log.Fatal(err)
	}

	// Fetch all Zone Lockdown rules for a zone, by page.
	rules, _, err := api.ListZoneLockdowns(context.Background(), cloudflare.ZoneIdentifier(zoneID), cloudflare.LockdownListParams{})
	if err != nil {
		log.Fatal(err)
	}

	for _, r := range rules {
		fmt.Printf("%s: %s\n", strings.Join(r.URLs, ", "), r.Configurations)
	}
}
Output:

func (*API) ListZoneManagedHeaders added in v0.42.0

func (api *API) ListZoneManagedHeaders(ctx context.Context, rc *ResourceContainer, params ListManagedHeadersParams) (ManagedHeaders, error)

func (*API) ListZones added in v0.7.2

func (api *API) ListZones(ctx context.Context, z ...string) ([]Zone, error)

ListZones lists zones on an account. Optionally takes a list of zone names to filter against.

API reference: https://api.cloudflare.com/#zone-list-zones

Example (All)
package main

import (
	"context"
	"fmt"
	"log"

	cloudflare "github.com/cloudflare/cloudflare-go"
)

func main() {
	api, err := cloudflare.New("deadbeef", "test@example.org")
	if err != nil {
		log.Fatal(err)
	}

	// Fetch all zones available to this user.
	zones, err := api.ListZones(context.Background())
	if err != nil {
		log.Fatal(err)
	}

	for _, z := range zones {
		fmt.Println(z.Name)
	}
}
Output:

Example (Filter)
package main

import (
	"context"
	"fmt"
	"log"

	cloudflare "github.com/cloudflare/cloudflare-go"
)

func main() {
	api, err := cloudflare.New("deadbeef", "test@example.org")
	if err != nil {
		log.Fatal(err)
	}

	// Fetch a slice of zones example.org and example.net.
	zones, err := api.ListZones(context.Background(), "example.org", "example.net")
	if err != nil {
		log.Fatal(err)
	}

	for _, z := range zones {
		fmt.Println(z.Name)
	}
}
Output:

func (*API) ListZonesContext added in v0.9.0

func (api *API) ListZonesContext(ctx context.Context, opts ...ReqOption) (r ZonesResponse, err error)

ListZonesContext lists all zones on an account automatically handling the pagination. Optionally takes a list of ReqOptions.

func (*API) PageRule added in v0.7.2

func (api *API) PageRule(ctx context.Context, zoneID, ruleID string) (PageRule, error)

PageRule fetches detail about one Page Rule for a zone.

API reference: https://api.cloudflare.com/#page-rules-for-a-zone-page-rule-details

Example
api, err := cloudflare.New(apiKey, user)
if err != nil {
	log.Fatal(err)
}

zoneID, err := api.ZoneIDByName(domain)
if err != nil {
	log.Fatal(err)
}

pageRules, err := api.PageRule(context.Background(), zoneID, "my_page_rule_id")
if err != nil {
	log.Fatal(err)
}

fmt.Printf("%+v\n", pageRules)
Output:

func (*API) PagesAddDomain added in v0.44.0

func (api *API) PagesAddDomain(ctx context.Context, params PagesDomainParameters) (PagesDomain, error)

PagesAddDomain adds a domain to a pages project.

API Reference: https://api.cloudflare.com/#pages-domains-add-domain

func (*API) PagesDeleteDomain added in v0.44.0

func (api *API) PagesDeleteDomain(ctx context.Context, params PagesDomainParameters) error

PagesDeleteDomain removes a domain from a pages project.

API Reference: https://api.cloudflare.com/#pages-domains-delete-domain

func (*API) PagesPatchDomain added in v0.44.0

func (api *API) PagesPatchDomain(ctx context.Context, params PagesDomainParameters) (PagesDomain, error)

PagesPatchDomain retries the validation status of a single domain.

API Reference: https://api.cloudflare.com/#pages-domains-patch-domain

func (*API) PatchTeamsList added in v0.17.0

func (api *API) PatchTeamsList(ctx context.Context, rc *ResourceContainer, listPatch PatchTeamsListParams) (TeamsList, error)

PatchTeamsList updates the items in an existing teams list.

API reference: https://api.cloudflare.com/#teams-lists-patch-teams-list

func (*API) PatchWaitingRoomSettings added in v0.67.0

func (api *API) PatchWaitingRoomSettings(ctx context.Context, rc *ResourceContainer, params PatchWaitingRoomSettingsParams) (WaitingRoomSettings, error)

PatchWaitingRoomSettings lets you change individual zone-level Waiting Room settings. This is in contrast to UpdateWaitingRoomSettings which replaces all settings.

API reference: https://api.cloudflare.com/#waiting-room-patch-zone-settings

func (*API) PerformTraceroute added in v0.13.1

func (api *API) PerformTraceroute(ctx context.Context, accountID string, targets, colos []string, tracerouteOptions DiagnosticsTracerouteConfigurationOptions) ([]DiagnosticsTracerouteResponseResult, error)

PerformTraceroute initiates a traceroute from the Cloudflare network to the requested targets.

API documentation: https://api.cloudflare.com/#diagnostics-traceroute

func (*API) PublishZarazConfig added in v0.86.0

func (api *API) PublishZarazConfig(ctx context.Context, rc *ResourceContainer, params PublishZarazConfigParams) (ZarazPublishResponse, error)

func (*API) PurgeCache added in v0.7.2

func (api *API) PurgeCache(ctx context.Context, zoneID string, pcr PurgeCacheRequest) (PurgeCacheResponse, error)

PurgeCache purges the cache using the given PurgeCacheRequest (zone/url/tag).

API reference: https://api.cloudflare.com/#zone-purge-individual-files-by-url-and-cache-tags

func (*API) PurgeCacheContext added in v0.13.1

func (api *API) PurgeCacheContext(ctx context.Context, zoneID string, pcr PurgeCacheRequest) (PurgeCacheResponse, error)

PurgeCacheContext purges the cache using the given PurgeCacheRequest (zone/url/tag).

API reference: https://api.cloudflare.com/#zone-purge-individual-files-by-url-and-cache-tags

func (*API) PurgeEverything added in v0.7.2

func (api *API) PurgeEverything(ctx context.Context, zoneID string) (PurgeCacheResponse, error)

PurgeEverything purges the cache for the given zone.

Note: this will substantially increase load on the origin server for that zone if there is a high cached vs. uncached request ratio.

API reference: https://api.cloudflare.com/#zone-purge-all-files

func (*API) QueryD1Database added in v0.79.0

func (api *API) QueryD1Database(ctx context.Context, rc *ResourceContainer, params QueryD1DatabaseParams) ([]D1Result, error)

QueryD1Database queries a database for an account.

API reference: https://developers.cloudflare.com/api/operations/cloudflare-d1-query-database

func (*API) RateLimit added in v0.8.5

func (api *API) RateLimit(ctx context.Context, zoneID, limitID string) (RateLimit, error)

RateLimit fetches detail about one Rate Limit for a zone.

API reference: https://api.cloudflare.com/#rate-limits-for-a-zone-rate-limit-details

Example
api, err := cloudflare.New(apiKey, user)
if err != nil {
	log.Fatal(err)
}

zoneID, err := api.ZoneIDByName(domain)
if err != nil {
	log.Fatal(err)
}

rateLimits, err := api.RateLimit(context.Background(), zoneID, "my_rate_limit_id")
if err != nil {
	log.Fatal(err)
}

fmt.Printf("%+v\n", rateLimits)
Output:

func (*API) Raw added in v0.8.0

func (api *API) Raw(ctx context.Context, method, endpoint string, data interface{}, headers http.Header) (RawResponse, error)

Raw makes a HTTP request with user provided params and returns the result as a RawResponse, which contains the untouched JSON result.

func (*API) RefreshAccessServiceToken added in v0.49.0

func (api *API) RefreshAccessServiceToken(ctx context.Context, rc *ResourceContainer, id string) (AccessServiceTokenRefreshResponse, error)

RefreshAccessServiceToken updates the expiry of an Access Service Token in place.

API reference: https://api.cloudflare.com/#access-service-tokens-refresh-a-service-token

func (*API) RegistrarDomain added in v0.9.0

func (api *API) RegistrarDomain(ctx context.Context, accountID, domainName string) (RegistrarDomain, error)

RegistrarDomain returns a single domain based on the account ID and domain name.

API reference: https://api.cloudflare.com/#registrar-domains-get-domain

Example
api, err := cloudflare.New(apiKey, user)
if err != nil {
	log.Fatal(err)
}

domain, err := api.RegistrarDomain(context.Background(), "01a7362d577a6c3019a474fd6f485823", "cloudflare.com")
if err != nil {
	log.Fatal(err)
}
if err != nil {
	log.Fatal(err)
}

fmt.Printf("%+v\n", domain)
Output:

func (*API) RegistrarDomains added in v0.9.0

func (api *API) RegistrarDomains(ctx context.Context, accountID string) ([]RegistrarDomain, error)

RegistrarDomains returns all registrar domains based on the account ID.

API reference: https://api.cloudflare.com/#registrar-domains-list-domains

Example
api, err := cloudflare.New(apiKey, user)
if err != nil {
	log.Fatal(err)
}

domains, err := api.RegistrarDomains(context.Background(), "01a7362d577a6c3019a474fd6f485823")
if err != nil {
	log.Fatal(err)
}

fmt.Printf("%+v\n", domains)
Output:

func (*API) ReplaceIPListItems deprecated added in v0.13.0

func (api *API) ReplaceIPListItems(ctx context.Context, accountID, ID string, items []IPListItemCreateRequest) (
	[]IPListItem, error)

ReplaceIPListItems replaces all IP List Items synchronously and returns the current set of IP List Items.

Deprecated: Use `ReplaceListItems` instead.

func (*API) ReplaceIPListItemsAsync deprecated added in v0.13.0

func (api *API) ReplaceIPListItemsAsync(ctx context.Context, accountID, ID string, items []IPListItemCreateRequest) (
	IPListItemCreateResponse, error)

ReplaceIPListItemsAsync replaces all IP List Items asynchronously. Users have to poll the operation status by using the operation_id returned by this function.

API reference: https://api.cloudflare.com/#rules-lists-replace-list-items

Deprecated: Use `ReplaceListItemsAsync` instead.

func (*API) ReplaceListItems added in v0.41.0

func (api *API) ReplaceListItems(ctx context.Context, rc *ResourceContainer, params ListReplaceItemsParams) (
	[]ListItem, error)

ReplaceListItems replaces all List Items synchronously and returns the current set of List Items.

func (*API) ReplaceListItemsAsync added in v0.41.0

func (api *API) ReplaceListItemsAsync(ctx context.Context, rc *ResourceContainer, params ListReplaceItemsParams) (ListItemCreateResponse, error)

ReplaceListItemsAsync replaces all List Items asynchronously. Users have to poll the operation status by using the operation_id returned by this function.

API reference: https://api.cloudflare.com/#rules-lists-replace-list-items

func (*API) ReplaceWaitingRoomRules added in v0.53.0

func (api *API) ReplaceWaitingRoomRules(ctx context.Context, rc *ResourceContainer, params ReplaceWaitingRoomRuleParams) ([]WaitingRoomRule, error)

ReplaceWaitingRoomRules replaces all rules for a Waiting Room.

API reference: https://api.cloudflare.com/#waiting-room-replace-waiting-room-rules

func (*API) ReprioritizeSSL added in v0.7.2

func (api *API) ReprioritizeSSL(ctx context.Context, zoneID string, p []ZoneCustomSSLPriority) ([]ZoneCustomSSL, error)

ReprioritizeSSL allows you to change the priority (which is served for a given request) of custom SSL certificates associated with the given zone.

API reference: https://api.cloudflare.com/#custom-ssl-for-a-zone-re-prioritize-ssl-certificates

func (*API) RestartCertificateValidation added in v0.47.0

func (api *API) RestartCertificateValidation(ctx context.Context, zoneID, certificateID string) (CertificatePack, error)

RestartCertificateValidation kicks off the validation process for a pending certificate pack.

API Reference: https://api.cloudflare.com/#certificate-packs-restart-validation-for-advanced-certificate-manager-certificate-pack

func (*API) RestoreFallbackDomainDefaults added in v0.31.0

func (api *API) RestoreFallbackDomainDefaults(ctx context.Context, accountID string) error

RestoreFallbackDomainDefaultsDeviceSettingsPolicy resets the domain fallback values to the default list for a specific device settings policy.

API reference: TBA.

func (*API) RestoreFallbackDomainDefaultsDeviceSettingsPolicy added in v0.52.0

func (api *API) RestoreFallbackDomainDefaultsDeviceSettingsPolicy(ctx context.Context, accountID, policyID string) error

RestoreFallbackDomainDefaults resets the domain fallback values to the default list.

API reference: TBA.

func (*API) RetryPagesDeployment added in v0.40.0

func (api *API) RetryPagesDeployment(ctx context.Context, rc *ResourceContainer, projectName, deploymentID string) (PagesProjectDeployment, error)

RetryPagesDeployment retries a specific Pages deployment.

API reference: https://api.cloudflare.com/#pages-deployment-retry-deployment

func (*API) RevokeAccessApplicationTokens added in v0.9.0

func (api *API) RevokeAccessApplicationTokens(ctx context.Context, rc *ResourceContainer, applicationID string) error

RevokeAccessApplicationTokens revokes tokens associated with an access application.

Account API reference: https://developers.cloudflare.com/api/operations/access-applications-revoke-service-tokens Zone API reference: https://developers.cloudflare.com/api/operations/zone-level-access-applications-revoke-service-tokens

func (*API) RevokeAccessUserTokens added in v0.31.0

func (api *API) RevokeAccessUserTokens(ctx context.Context, rc *ResourceContainer, params RevokeAccessUserTokensParams) error

RevokeAccessUserTokens revokes any outstanding tokens issued for a specific user Access User.

func (*API) RevokeOriginCACertificate added in v0.58.0

func (api *API) RevokeOriginCACertificate(ctx context.Context, certificateID string) (*OriginCACertificateID, error)

RevokeOriginCACertificate revokes a created certificate for a zone.

API reference: https://api.cloudflare.com/#cloudflare-ca-revoke-certificate

func (*API) RevokeTeamsDevices added in v0.32.0

func (api *API) RevokeTeamsDevices(ctx context.Context, accountID string, deviceIds []string) (Response, error)

RevokeTeamsDevice revokes device with given identifiers.

API reference : https://api.cloudflare.com/#devices-revoke-devices

func (*API) RollAPIToken added in v0.13.5

func (api *API) RollAPIToken(ctx context.Context, tokenID string) (string, error)

RollAPIToken rolls the credential associated with the token.

API reference: https://api.cloudflare.com/#user-api-tokens-roll-token

func (*API) RollbackPagesDeployment added in v0.40.0

func (api *API) RollbackPagesDeployment(ctx context.Context, rc *ResourceContainer, projectName, deploymentID string) (PagesProjectDeployment, error)

RollbackPagesDeployment rollbacks the Pages production deployment to a previous production deployment.

API reference: https://api.cloudflare.com/#pages-deployment-rollback-deployment

func (*API) RotateAccessKeys added in v0.23.0

func (api *API) RotateAccessKeys(ctx context.Context, accountID string) (AccessKeysConfig, error)

RotateAccessKeys rotates the Access Keys for an account and returns the updated Access Keys Configuration

API reference: https://api.cloudflare.com/#access-keys-configuration-rotate-access-keys

func (*API) RotateAccessServiceToken added in v0.54.0

func (api *API) RotateAccessServiceToken(ctx context.Context, rc *ResourceContainer, id string) (AccessServiceTokenRotateResponse, error)

RotateAccessServiceToken rotates the client secret of an Access Service Token in place. API reference: https://api.cloudflare.com/#access-service-tokens-rotate-a-service-token

func (*API) RotateTurnstileWidget added in v0.66.0

func (api *API) RotateTurnstileWidget(ctx context.Context, rc *ResourceContainer, param RotateTurnstileWidgetParams) (TurnstileWidget, error)

RotateTurnstileWidget generates a new secret key for this widget. If invalidate_immediately is set to false, the previous secret remains valid for 2 hours.

Note that secrets cannot be rotated again during the grace period.

API reference: https://api.cloudflare.com/#challenge-widgets-rotate-secret-for-a-challenge-widget

func (*API) SSLDetails added in v0.7.2

func (api *API) SSLDetails(ctx context.Context, zoneID, certificateID string) (ZoneCustomSSL, error)

SSLDetails returns the configuration details for a custom SSL certificate.

API reference: https://api.cloudflare.com/#custom-ssl-for-a-zone-ssl-configuration-details

func (*API) SetAuthType added in v0.7.4

func (api *API) SetAuthType(authType int)

SetAuthType sets the authentication method (AuthKeyEmail, AuthToken, or AuthUserService).

func (*API) SetAuthenticatedOriginPullsStatus added in v0.12.2

func (api *API) SetAuthenticatedOriginPullsStatus(ctx context.Context, zoneID string, enable bool) (AuthenticatedOriginPulls, error)

SetAuthenticatedOriginPullsStatus toggles whether global AuthenticatedOriginPulls is enabled for the zone.

API reference: https://api.cloudflare.com/#zone-settings-change-tls-client-auth-setting

func (*API) SetLogpullRetentionFlag added in v0.12.0

func (api *API) SetLogpullRetentionFlag(ctx context.Context, zoneID string, enabled bool) (*LogpullRetentionConfiguration, error)

SetLogpullRetentionFlag updates the retention flag to the defined boolean.

API reference: https://developers.cloudflare.com/logs/logpull-api/enabling-log-retention/

func (*API) SetPerZoneAuthenticatedOriginPullsStatus added in v0.12.2

func (api *API) SetPerZoneAuthenticatedOriginPullsStatus(ctx context.Context, zoneID string, enable bool) (PerZoneAuthenticatedOriginPullsSettings, error)

SetPerZoneAuthenticatedOriginPullsStatus will update whether Per Zone AuthenticatedOriginPulls is enabled for the zone.

API reference: https://api.cloudflare.com/#zone-level-authenticated-origin-pulls-set-enablement-for-zone

func (*API) SetTieredCache added in v0.57.1

func (api *API) SetTieredCache(ctx context.Context, rc *ResourceContainer, value TieredCacheType) (TieredCache, error)

SetTieredCache allows you to set a zone's tiered cache topology between the available types. Using the value of TieredCacheOff will disable Tiered Cache entirely.

API Reference: https://api.cloudflare.com/#smart-tiered-cache-patch-smart-tiered-cache-setting API Reference: https://api.cloudflare.com/#tiered-cache-patch-tiered-cache-setting

func (*API) SetTotalTLS added in v0.53.0

func (api *API) SetTotalTLS(ctx context.Context, rc *ResourceContainer, params TotalTLS) (TotalTLS, error)

SetTotalTLS Set Total TLS Settings or disable the feature for a Zone.

API Reference: https://api.cloudflare.com/#total-tls-enable-or-disable-total-tls

func (*API) SetWorkersSecret added in v0.13.1

func (api *API) SetWorkersSecret(ctx context.Context, rc *ResourceContainer, params SetWorkersSecretParams) (WorkersPutSecretResponse, error)

SetWorkersSecret creates or updates a secret.

API reference: https://api.cloudflare.com/

func (*API) SpectrumApplication added in v0.9.0

func (api *API) SpectrumApplication(ctx context.Context, zoneID string, applicationID string) (SpectrumApplication, error)

SpectrumApplication fetches a single Spectrum application based on the ID.

API reference: https://developers.cloudflare.com/spectrum/api-reference/#list-spectrum-applications

func (*API) SpectrumApplications added in v0.9.0

func (api *API) SpectrumApplications(ctx context.Context, zoneID string) ([]SpectrumApplication, error)

SpectrumApplications fetches all of the Spectrum applications for a zone.

API reference: https://developers.cloudflare.com/spectrum/api-reference/#list-spectrum-applications

func (*API) StartWorkersTail added in v0.47.0

func (api *API) StartWorkersTail(ctx context.Context, rc *ResourceContainer, scriptName string) (WorkersTail, error)

StartWorkersTail Starts a tail that receives logs and exception from a Worker.

API reference: https://developers.cloudflare.com/api/operations/worker-tail-logs-start-tail

func (*API) StreamAssociateNFT added in v0.44.0

func (api *API) StreamAssociateNFT(ctx context.Context, options StreamVideoNFTParameters) (StreamVideo, error)

StreamAssociateNFT associates a video to a token and contract address.

API Reference: https://api.cloudflare.com/#stream-videos-associate-video-to-an-nft

func (*API) StreamCreateSignedURL added in v0.44.0

func (api *API) StreamCreateSignedURL(ctx context.Context, params StreamSignedURLParameters) (string, error)

StreamCreateSignedURL creates a signed URL token for a video.

API Reference: https://api.cloudflare.com/#stream-videos-associate-video-to-an-nft

func (*API) StreamCreateVideoDirectURL added in v0.44.0

func (api *API) StreamCreateVideoDirectURL(ctx context.Context, params StreamCreateVideoParameters) (StreamVideoCreate, error)

StreamCreateVideoDirectURL creates a video and returns an authenticated URL.

API Reference: https://api.cloudflare.com/#stream-videos-create-a-video-and-get-authenticated-direct-upload-url

func (*API) StreamDeleteVideo added in v0.44.0

func (api *API) StreamDeleteVideo(ctx context.Context, options StreamParameters) error

StreamDeleteVideo deletes a video.

API Reference: https://api.cloudflare.com/#stream-videos-delete-video

func (*API) StreamEmbedHTML added in v0.44.0

func (api *API) StreamEmbedHTML(ctx context.Context, options StreamParameters) (string, error)

StreamEmbedHTML gets an HTML fragment to embed on a web page.

API Reference: https://api.cloudflare.com/#stream-videos-embed-code-html

func (*API) StreamGetVideo added in v0.44.0

func (api *API) StreamGetVideo(ctx context.Context, options StreamParameters) (StreamVideo, error)

StreamGetVideo gets the details for a specific video.

API Reference: https://api.cloudflare.com/#stream-videos-video-details

func (*API) StreamInitiateTUSVideoUpload added in v0.77.0

func (api *API) StreamInitiateTUSVideoUpload(ctx context.Context, rc *ResourceContainer, params StreamInitiateTUSUploadParameters) (StreamInitiateTUSUploadResponse, error)

StreamInitiateTUSVideoUpload generates a direct upload TUS url for a video.

API Reference: https://developers.cloudflare.com/api/operations/stream-videos-initiate-video-uploads-using-tus

func (*API) StreamListVideos added in v0.44.0

func (api *API) StreamListVideos(ctx context.Context, params StreamListParameters) ([]StreamVideo, error)

StreamListVideos list videos currently in stream.

API reference: https://api.cloudflare.com/#stream-videos-list-videos

func (*API) StreamUploadFromURL added in v0.44.0

func (api *API) StreamUploadFromURL(ctx context.Context, params StreamUploadFromURLParameters) (StreamVideo, error)

StreamUploadFromURL send a video URL to it will be downloaded and made available on Stream.

API Reference: https://api.cloudflare.com/#stream-videos-upload-a-video-from-a-url

func (*API) StreamUploadVideoFile added in v0.44.0

func (api *API) StreamUploadVideoFile(ctx context.Context, params StreamUploadFileParameters) (StreamVideo, error)

StreamUploadVideoFile uploads a video from a path to the file.

API Reference: https://api.cloudflare.com/#stream-videos-upload-a-video-using-a-single-http-request

func (*API) TeamsAccount added in v0.21.0

func (api *API) TeamsAccount(ctx context.Context, accountID string) (TeamsAccount, error)

TeamsAccount returns teams account information with internal and external ID.

API reference: TBA.

func (*API) TeamsAccountConfiguration added in v0.21.0

func (api *API) TeamsAccountConfiguration(ctx context.Context, accountID string) (TeamsConfiguration, error)

TeamsAccountConfiguration returns teams account configuration.

API reference: TBA.

func (*API) TeamsAccountDeviceConfiguration added in v0.31.0

func (api *API) TeamsAccountDeviceConfiguration(ctx context.Context, accountID string) (TeamsDeviceSettings, error)

TeamsAccountDeviceConfiguration returns teams account device configuration with udp status.

API reference: TBA.

func (*API) TeamsAccountDeviceUpdateConfiguration added in v0.31.0

func (api *API) TeamsAccountDeviceUpdateConfiguration(ctx context.Context, accountID string, settings TeamsDeviceSettings) (TeamsDeviceSettings, error)

TeamsAccountDeviceUpdateConfiguration updates teams account device configuration including udp filtering status.

API reference: TBA.

func (*API) TeamsAccountLoggingConfiguration added in v0.30.0

func (api *API) TeamsAccountLoggingConfiguration(ctx context.Context, accountID string) (TeamsLoggingSettings, error)

TeamsAccountLoggingConfiguration returns teams account logging configuration.

API reference: TBA.

func (*API) TeamsAccountUpdateConfiguration added in v0.21.0

func (api *API) TeamsAccountUpdateConfiguration(ctx context.Context, accountID string, config TeamsConfiguration) (TeamsConfiguration, error)

TeamsAccountUpdateConfiguration updates a teams account configuration.

API reference: TBA.

func (*API) TeamsAccountUpdateLoggingConfiguration added in v0.30.0

func (api *API) TeamsAccountUpdateLoggingConfiguration(ctx context.Context, accountID string, config TeamsLoggingSettings) (TeamsLoggingSettings, error)

TeamsAccountUpdateLoggingConfiguration updates the log settings and returns new teams account logging configuration.

API reference: TBA.

func (*API) TeamsCreateRule added in v0.21.0

func (api *API) TeamsCreateRule(ctx context.Context, accountID string, rule TeamsRule) (TeamsRule, error)

TeamsCreateRule creates a rule with wirefilter expression.

API reference: https://api.cloudflare.com/#teams-rules-properties

func (*API) TeamsDeleteRule added in v0.21.0

func (api *API) TeamsDeleteRule(ctx context.Context, accountID string, ruleId string) error

TeamsDeleteRule deletes a rule.

API reference: https://api.cloudflare.com/#teams-rules-properties

func (*API) TeamsLocation added in v0.21.0

func (api *API) TeamsLocation(ctx context.Context, accountID, locationID string) (TeamsLocation, error)

TeamsLocation returns a single location based on the ID.

API reference: https://api.cloudflare.com/#teams-locations-teams-location-details

func (*API) TeamsLocations added in v0.21.0

func (api *API) TeamsLocations(ctx context.Context, accountID string) ([]TeamsLocation, ResultInfo, error)

TeamsLocations returns all locations within an account.

API reference: https://api.cloudflare.com/#teams-locations-list-teams-locations

func (*API) TeamsPatchRule added in v0.21.0

func (api *API) TeamsPatchRule(ctx context.Context, accountID string, ruleId string, rule TeamsRulePatchRequest) (TeamsRule, error)

TeamsPatchRule patches a rule associated values.

API reference: https://api.cloudflare.com/#teams-rules-properties

func (*API) TeamsProxyEndpoint added in v0.35.0

func (api *API) TeamsProxyEndpoint(ctx context.Context, accountID, proxyEndpointID string) (TeamsProxyEndpoint, error)

TeamsProxyEndpoint returns a single proxy endpoints within an account.

API reference: https://api.cloudflare.com/#zero-trust-gateway-proxy-endpoints-proxy-endpoint-details

func (*API) TeamsProxyEndpoints added in v0.35.0

func (api *API) TeamsProxyEndpoints(ctx context.Context, accountID string) ([]TeamsProxyEndpoint, ResultInfo, error)

TeamsProxyEndpoints returns all proxy endpoints within an account.

API reference: https://api.cloudflare.com/#zero-trust-gateway-proxy-endpoints-list-proxy-endpoints

func (*API) TeamsRule added in v0.21.0

func (api *API) TeamsRule(ctx context.Context, accountID string, ruleId string) (TeamsRule, error)

TeamsRule returns the rule with rule ID in the URL.

API reference: https://api.cloudflare.com/#teams-rules-properties

func (*API) TeamsRules added in v0.21.0

func (api *API) TeamsRules(ctx context.Context, accountID string) ([]TeamsRule, error)

TeamsRules returns all rules within an account.

API reference: https://api.cloudflare.com/#teams-rules-properties

func (*API) TeamsUpdateRule added in v0.21.0

func (api *API) TeamsUpdateRule(ctx context.Context, accountID string, ruleId string, rule TeamsRule) (TeamsRule, error)

TeamsUpdateRule updates a rule with wirefilter expression.

API reference: https://api.cloudflare.com/#teams-rules-properties

func (*API) TransferRegistrarDomain added in v0.9.0

func (api *API) TransferRegistrarDomain(ctx context.Context, accountID, domainName string) ([]RegistrarDomain, error)

TransferRegistrarDomain initiates the transfer from another registrar to Cloudflare Registrar.

API reference: https://api.cloudflare.com/#registrar-domains-transfer-domain

Example
api, err := cloudflare.New(apiKey, user)
if err != nil {
	log.Fatal(err)
}

domain, err := api.TransferRegistrarDomain(context.Background(), "01a7362d577a6c3019a474fd6f485823", "cloudflare.com")
if err != nil {
	log.Fatal(err)
}

fmt.Printf("%+v\n", domain)
Output:

func (*API) URLNormalizationSettings added in v0.49.0

func (api *API) URLNormalizationSettings(ctx context.Context, rc *ResourceContainer) (URLNormalizationSettings, error)

URLNormalizationSettings API reference: https://api.cloudflare.com/#url-normalization-get-url-normalization-settings

func (*API) UniversalSSLSettingDetails added in v0.9.0

func (api *API) UniversalSSLSettingDetails(ctx context.Context, zoneID string) (UniversalSSLSetting, error)

UniversalSSLSettingDetails returns the details for a universal ssl setting

API reference: https://api.cloudflare.com/#universal-ssl-settings-for-a-zone-universal-ssl-settings-details

func (*API) UniversalSSLVerificationDetails added in v0.10.0

func (api *API) UniversalSSLVerificationDetails(ctx context.Context, zoneID string) ([]UniversalSSLVerificationDetails, error)

UniversalSSLVerificationDetails returns the details for a universal ssl verification

API reference: https://api.cloudflare.com/#ssl-verification-ssl-verification-details

func (*API) UpdateAPIShieldConfiguration added in v0.49.0

func (api *API) UpdateAPIShieldConfiguration(ctx context.Context, rc *ResourceContainer, params UpdateAPIShieldParams) (Response, error)

UpdateAPIShieldConfiguration sets a zone API shield configuration.

API documentation: https://api.cloudflare.com/#api-shield-settings-set-configuration-properties

func (*API) UpdateAPIShieldDiscoveryOperation added in v0.79.0

func (api *API) UpdateAPIShieldDiscoveryOperation(ctx context.Context, rc *ResourceContainer, params UpdateAPIShieldDiscoveryOperationParams) (*UpdateAPIShieldDiscoveryOperation, error)

UpdateAPIShieldDiscoveryOperation updates certain fields on a discovered operation.

API Documentation: https://developers.cloudflare.com/api/operations/api-shield-api-patch-discovered-operation

func (*API) UpdateAPIShieldDiscoveryOperations added in v0.79.0

UpdateAPIShieldDiscoveryOperations bulk updates certain fields on multiple discovered operations

API documentation: https://developers.cloudflare.com/api/operations/api-shield-api-patch-discovered-operations

func (*API) UpdateAPIShieldOperationSchemaValidationSettings added in v0.80.0

func (api *API) UpdateAPIShieldOperationSchemaValidationSettings(ctx context.Context, rc *ResourceContainer, params UpdateAPIShieldOperationSchemaValidationSettings) (*UpdateAPIShieldOperationSchemaValidationSettings, error)

UpdateAPIShieldOperationSchemaValidationSettings update multiple operation level schema validation settings

API documentation: https://developers.cloudflare.com/api/operations/api-shield-schema-validation-update-multiple-operation-level-settings

func (*API) UpdateAPIShieldSchema added in v0.79.0

func (api *API) UpdateAPIShieldSchema(ctx context.Context, rc *ResourceContainer, params UpdateAPIShieldSchemaParams) (*APIShieldSchema, error)

UpdateAPIShieldSchema updates certain fields on an existing schema.

API documentation: https://developers.cloudflare.com/api/operations/api-shield-schema-validation-enable-validation-for-a-schema

func (*API) UpdateAPIShieldSchemaValidationSettings added in v0.80.0

func (api *API) UpdateAPIShieldSchemaValidationSettings(ctx context.Context, rc *ResourceContainer, params UpdateAPIShieldSchemaValidationSettingsParams) (*APIShieldSchemaValidationSettings, error)

UpdateAPIShieldSchemaValidationSettings updates certain fields on zone level schema validation settings

API documentation: https://developers.cloudflare.com/api/operations/api-shield-schema-validation-patch-zone-level-settings

func (*API) UpdateAPIToken added in v0.13.5

func (api *API) UpdateAPIToken(ctx context.Context, tokenID string, token APIToken) (APIToken, error)

UpdateAPIToken updates an existing API token.

API reference: https://api.cloudflare.com/#user-api-tokens-update-token

func (*API) UpdateAccessBookmark added in v0.36.0

func (api *API) UpdateAccessBookmark(ctx context.Context, accountID string, accessBookmark AccessBookmark) (AccessBookmark, error)

UpdateAccessBookmark updates an existing access bookmark.

API reference: https://api.cloudflare.com/#access-bookmarks-update-access-bookmark

func (*API) UpdateAccessCustomPage added in v0.74.0

func (api *API) UpdateAccessCustomPage(ctx context.Context, rc *ResourceContainer, params UpdateAccessCustomPageParams) (AccessCustomPage, error)

func (*API) UpdateAccessGroup added in v0.10.5

func (api *API) UpdateAccessGroup(ctx context.Context, rc *ResourceContainer, params UpdateAccessGroupParams) (AccessGroup, error)

UpdateAccessGroup updates an existing access group.

Account API Reference: https://developers.cloudflare.com/api/operations/access-groups-update-an-access-group Zone API Reference: https://developers.cloudflare.com/api/operations/zone-level-access-groups-update-an-access-group

func (*API) UpdateAccessIdentityProviderAuthContexts added in v0.75.0

func (api *API) UpdateAccessIdentityProviderAuthContexts(ctx context.Context, rc *ResourceContainer, identityProviderID string) (AccessIdentityProvider, error)

UpdateAccessIdentityProviderAuthContexts updates an existing Access Identity Provider. AzureAD only Account API Reference: https://developers.cloudflare.com/api/operations/access-identity-providers-refresh-an-access-identity-provider-auth-contexts Zone API Reference: https://developers.cloudflare.com/api/operations/zone-level-access-identity-providers-update-an-access-identity-provider

func (*API) UpdateAccessKeysConfig added in v0.23.0

func (api *API) UpdateAccessKeysConfig(ctx context.Context, accountID string, request AccessKeysConfigUpdateRequest) (AccessKeysConfig, error)

UpdateAccessKeysConfig updates the Access Keys Configuration for an account.

API reference: https://api.cloudflare.com/#access-keys-configuration-update-access-keys-configuration

func (*API) UpdateAccessMutualTLSCertificate added in v0.13.8

func (api *API) UpdateAccessMutualTLSCertificate(ctx context.Context, rc *ResourceContainer, params UpdateAccessMutualTLSCertificateParams) (AccessMutualTLSCertificate, error)

UpdateAccessMutualTLSCertificate updates an account level Access TLS Mutual certificate.

Account API Reference: https://developers.cloudflare.com/api/operations/access-mtls-authentication-update-an-mtls-certificate Zone API Reference: https://developers.cloudflare.com/api/operations/zone-level-access-mtls-authentication-update-an-mtls-certificate

func (*API) UpdateAccessOrganization added in v0.10.1

func (api *API) UpdateAccessOrganization(ctx context.Context, rc *ResourceContainer, params UpdateAccessOrganizationParams) (AccessOrganization, error)

UpdateAccessOrganization updates the Access organisation details.

Account API reference: https://api.cloudflare.com/#access-organizations-update-access-organization Zone API reference: https://api.cloudflare.com/#zone-level-access-organizations-update-access-organization

func (*API) UpdateAccessPolicy added in v0.9.0

func (api *API) UpdateAccessPolicy(ctx context.Context, rc *ResourceContainer, params UpdateAccessPolicyParams) (AccessPolicy, error)

UpdateAccessPolicy updates an existing access policy.

Account API reference: https://developers.cloudflare.com/api/operations/access-policies-update-an-access-policy Zone API reference: https://developers.cloudflare.com/api/operations/zone-level-access-policies-update-an-access-policy

func (*API) UpdateAccessServiceToken added in v0.10.1

func (*API) UpdateAccessUserSeat added in v0.81.0

UpdateAccessUserSeat updates a single Access User Seat.

API documentation: https://developers.cloudflare.com/api/operations/zero-trust-seats-update-a-user-seat

func (*API) UpdateAccessUsersSeats added in v0.87.0

func (api *API) UpdateAccessUsersSeats(ctx context.Context, rc *ResourceContainer, params UpdateAccessUsersSeatsParams) ([]AccessUpdateAccessUserSeatResult, error)

UpdateAccessUsersSeats updates many Access User Seats.

API documentation: https://developers.cloudflare.com/api/operations/zero-trust-seats-update-a-user-seat

func (*API) UpdateAccount added in v0.9.0

func (api *API) UpdateAccount(ctx context.Context, accountID string, account Account) (Account, error)

UpdateAccount allows management of an account using the account ID.

API reference: https://api.cloudflare.com/#accounts-update-account

func (*API) UpdateAccountAccessRule added in v0.10.0

func (api *API) UpdateAccountAccessRule(ctx context.Context, accountID, accessRuleID string, accessRule AccessRule) (*AccessRuleResponse, error)

UpdateAccountAccessRule updates a single access rule for the given account & access rule identifiers.

API reference: https://api.cloudflare.com/#account-level-firewall-access-rule-update-access-rule

func (*API) UpdateAccountMember added in v0.9.0

func (api *API) UpdateAccountMember(ctx context.Context, accountID string, userID string, member AccountMember) (AccountMember, error)

UpdateAccountMember modifies an existing account member.

API reference: https://api.cloudflare.com/#account-members-update-member

func (*API) UpdateAddressMap added in v0.63.0

func (api *API) UpdateAddressMap(ctx context.Context, rc *ResourceContainer, params UpdateAddressMapParams) (AddressMap, error)

UpdateAddressMap modifies properties of an address map owned by the account.

API reference: https://developers.cloudflare.com/api/operations/ip-address-management-address-maps-update-address-map

func (*API) UpdateAdvertisementStatus added in v0.11.7

func (api *API) UpdateAdvertisementStatus(ctx context.Context, accountID, ID string, advertised bool) (AdvertisementStatus, error)

UpdateAdvertisementStatus changes the BGP status of an IP prefix

API reference: https://api.cloudflare.com/#ip-address-management-prefixes-update-prefix-description

func (*API) UpdateArgoSmartRouting added in v0.9.0

func (api *API) UpdateArgoSmartRouting(ctx context.Context, zoneID, settingValue string) (ArgoFeatureSetting, error)

UpdateArgoSmartRouting updates the setting for smart routing.

API reference: https://api.cloudflare.com/#argo-smart-routing-patch-argo-smart-routing-setting

Example
package main

import (
	"context"
	"fmt"
	"log"

	cloudflare "github.com/cloudflare/cloudflare-go"
)

func main() {
	api, err := cloudflare.New("deadbeef", "test@example.org")
	if err != nil {
		log.Fatal(err)
	}

	smartRoutingSettings, err := api.UpdateArgoSmartRouting(context.Background(), "01a7362d577a6c3019a474fd6f485823", "on")
	if err != nil {
		log.Fatal(err)
	}

	fmt.Printf("smart routing is %s", smartRoutingSettings.Value)
}
Output:

func (*API) UpdateArgoTieredCaching added in v0.9.0

func (api *API) UpdateArgoTieredCaching(ctx context.Context, zoneID, settingValue string) (ArgoFeatureSetting, error)

UpdateArgoTieredCaching updates the setting for tiered caching.

API reference: TBA.

Example
package main

import (
	"context"
	"fmt"
	"log"

	cloudflare "github.com/cloudflare/cloudflare-go"
)

func main() {
	api, err := cloudflare.New("deadbeef", "test@example.org")
	if err != nil {
		log.Fatal(err)
	}

	tieredCachingSettings, err := api.UpdateArgoTieredCaching(context.Background(), "01a7362d577a6c3019a474fd6f485823", "on")
	if err != nil {
		log.Fatal(err)
	}

	fmt.Printf("tiered caching is %s", tieredCachingSettings.Value)
}
Output:

func (*API) UpdateAuditSSHSettings added in v0.79.0

func (api *API) UpdateAuditSSHSettings(ctx context.Context, rc *ResourceContainer, params UpdateAuditSSHSettingsParams) (AuditSSHSettings, error)

UpdateAuditSSHSettings updates an existing zt audit ssh setting.

API reference: https://api.cloudflare.com/#zero-trust-update-audit-ssh-settings

func (*API) UpdateBotManagement added in v0.75.0

func (api *API) UpdateBotManagement(ctx context.Context, rc *ResourceContainer, params UpdateBotManagementParams) (BotManagement, error)

UpdateBotManagement sets a zone API shield configuration.

API documentation: https://developers.cloudflare.com/api/operations/bot-management-for-a-zone-update-config

func (*API) UpdateCacheReserve added in v0.68.0

func (api *API) UpdateCacheReserve(ctx context.Context, rc *ResourceContainer, params UpdateCacheReserveParams) (CacheReserve, error)

UpdateCacheReserve updates the cache reserve setting for a zone

API reference: https://developers.cloudflare.com/api/operations/zone-cache-settings-change-cache-reserve-setting

func (*API) UpdateCustomHostname added in v0.12.0

func (api *API) UpdateCustomHostname(ctx context.Context, zoneID string, customHostnameID string, ch CustomHostname) (*CustomHostnameResponse, error)

UpdateCustomHostname modifies configuration for the given custom hostname in the given zone.

API reference: https://api.cloudflare.com/#custom-hostname-for-a-zone-update-custom-hostname-configuration

func (*API) UpdateCustomHostnameFallbackOrigin added in v0.12.0

func (api *API) UpdateCustomHostnameFallbackOrigin(ctx context.Context, zoneID string, chfo CustomHostnameFallbackOrigin) (*CustomHostnameFallbackOriginResponse, error)

UpdateCustomHostnameFallbackOrigin modifies the Custom Hostname Fallback origin in the given zone.

API reference: https://api.cloudflare.com/#custom-hostname-fallback-origin-for-a-zone-update-fallback-origin-for-custom-hostnames

func (*API) UpdateCustomHostnameSSL added in v0.7.4

func (api *API) UpdateCustomHostnameSSL(ctx context.Context, zoneID string, customHostnameID string, ssl *CustomHostnameSSL) (*CustomHostnameResponse, error)

UpdateCustomHostnameSSL modifies SSL configuration for the given custom hostname in the given zone.

API reference: https://api.cloudflare.com/#custom-hostname-for-a-zone-update-custom-hostname-configuration

func (*API) UpdateCustomNameserverZoneMetadata added in v0.70.0

func (api *API) UpdateCustomNameserverZoneMetadata(ctx context.Context, rc *ResourceContainer, params UpdateCustomNameserverZoneMetadataParams) error

UpdateCustomNameserverZoneMetadata set metadata for custom nameservers on a zone.

API documentation: https://developers.cloudflare.com/api/operations/account-level-custom-nameservers-usage-for-a-zone-set-account-custom-nameserver-related-zone-metadata

func (*API) UpdateCustomPage added in v0.9.0

func (api *API) UpdateCustomPage(ctx context.Context, options *CustomPageOptions, customPageID string, pageParameters CustomPageParameters) (CustomPage, error)

UpdateCustomPage updates a single custom page setting.

Zone API reference: https://api.cloudflare.com/#custom-pages-for-a-zone-update-custom-page-url Account API reference: https://api.cloudflare.com/#custom-pages-account--update-custom-page

func (*API) UpdateDLPDataset added in v0.87.0

func (api *API) UpdateDLPDataset(ctx context.Context, rc *ResourceContainer, params UpdateDLPDatasetParams) (DLPDataset, error)

UpdateDLPDataset updates the details of a DLP dataset.

API reference: https://developers.cloudflare.com/api/operations/dlp-datasets-update

func (*API) UpdateDLPPayloadLogSettings added in v0.62.0

func (api *API) UpdateDLPPayloadLogSettings(ctx context.Context, rc *ResourceContainer, settings DLPPayloadLogSettings) (DLPPayloadLogSettings, error)

UpdateDLPPayloadLogSettings sets the current DLP payload logging settings to new values.

API reference: https://api.cloudflare.com/#dlp-payload-log-settings-update-settings

func (*API) UpdateDLPProfile added in v0.53.0

func (api *API) UpdateDLPProfile(ctx context.Context, rc *ResourceContainer, params UpdateDLPProfileParams) (DLPProfile, error)

UpdateDLPProfile updates a DLP profile.

API reference: https://api.cloudflare.com/#dlp-profiles-update-custom-profile API reference: https://api.cloudflare.com/#dlp-profiles-update-predefined-profile

func (*API) UpdateDNSFirewallCluster added in v0.29.0

func (api *API) UpdateDNSFirewallCluster(ctx context.Context, rc *ResourceContainer, params UpdateDNSFirewallClusterParams) error

UpdateDNSFirewallCluster updates a DNS Firewall cluster.

API reference: https://api.cloudflare.com/#dns-firewall-update-dns-firewall-cluster

func (*API) UpdateDNSRecord added in v0.7.2

func (api *API) UpdateDNSRecord(ctx context.Context, rc *ResourceContainer, params UpdateDNSRecordParams) (DNSRecord, error)

UpdateDNSRecord updates a single DNS record for the given zone & record identifiers.

API reference: https://api.cloudflare.com/#dns-records-for-a-zone-update-dns-record

func (*API) UpdateDataLocalizationRegionalHostname added in v0.66.0

func (api *API) UpdateDataLocalizationRegionalHostname(ctx context.Context, rc *ResourceContainer, params UpdateDataLocalizationRegionalHostnameParams) (RegionalHostname, error)

UpdateDataLocalizationRegionalHostname returns the details of a specific regional hostname.

API reference: https://developers.cloudflare.com/data-localization/regional-services/get-started/#configure-regional-services-via-api

func (*API) UpdateDefaultDeviceSettingsPolicy added in v0.52.0

func (api *API) UpdateDefaultDeviceSettingsPolicy(ctx context.Context, rc *ResourceContainer, params UpdateDefaultDeviceSettingsPolicyParams) (DeviceSettingsPolicy, error)

UpdateDefaultDeviceSettingsPolicy updates the default settings policy for an account

API reference: https://api.cloudflare.com/#devices-update-default-device-settings-policy

func (*API) UpdateDeviceClientCertificates added in v0.81.0

func (api *API) UpdateDeviceClientCertificates(ctx context.Context, rc *ResourceContainer, params UpdateDeviceClientCertificatesParams) (DeviceClientCertificates, error)

UpdateDeviceClientCertificates controls the zero trust zone used to provision client certificates.

API reference: https://api.cloudflare.com/#device-client-certificates

func (*API) UpdateDeviceDexTest added in v0.62.0

func (api *API) UpdateDeviceDexTest(ctx context.Context, rc *ResourceContainer, params UpdateDeviceDexTestParams) (DeviceDexTest, error)

UpdateDeviceDexTest Updates a Device Dex Test.

API reference: https://developers.cloudflare.com/api/operations/device-dex-test-update-device-dex-test

func (*API) UpdateDeviceManagedNetwork added in v0.57.0

func (api *API) UpdateDeviceManagedNetwork(ctx context.Context, rc *ResourceContainer, params UpdateDeviceManagedNetworkParams) (DeviceManagedNetwork, error)

UpdateDeviceManagedNetwork Update a Device Managed Network.

API reference: https://api.cloudflare.com/#device-managed-networks-update-device-managed-network

func (*API) UpdateDevicePostureIntegration added in v0.29.0

func (api *API) UpdateDevicePostureIntegration(ctx context.Context, accountID string, integration DevicePostureIntegration) (DevicePostureIntegration, error)

UpdateDevicePostureIntegration updates a device posture integration within an account.

API reference: https://api.cloudflare.com/#device-posture-integrations-update-device-posture-integration

func (*API) UpdateDevicePostureRule added in v0.17.0

func (api *API) UpdateDevicePostureRule(ctx context.Context, accountID string, rule DevicePostureRule) (DevicePostureRule, error)

UpdateDevicePostureRule updates an existing device posture rule.

API reference: https://api.cloudflare.com/#device-posture-rules-update-device-posture-rule

func (*API) UpdateDeviceSettingsPolicy added in v0.52.0

func (api *API) UpdateDeviceSettingsPolicy(ctx context.Context, rc *ResourceContainer, params UpdateDeviceSettingsPolicyParams) (DeviceSettingsPolicy, error)

UpdateDeviceSettingsPolicy updates a settings policy

API reference: https://api.cloudflare.com/#devices-update-device-settings-policy

func (*API) UpdateEmailRoutingCatchAllRule added in v0.47.0

func (api *API) UpdateEmailRoutingCatchAllRule(ctx context.Context, rc *ResourceContainer, params EmailRoutingCatchAllRule) (EmailRoutingCatchAllRule, error)

UpdateEmailRoutingCatchAllRule Enable or disable catch-all routing rule, or change action to forward to specific destination address.

API reference: https://api.cloudflare.com/#email-routing-routing-rules-update-catch-all-rule

func (*API) UpdateEmailRoutingRule added in v0.47.0

func (api *API) UpdateEmailRoutingRule(ctx context.Context, rc *ResourceContainer, params UpdateEmailRoutingRuleParameters) (EmailRoutingRule, error)

UpdateEmailRoutingRule Update actions, matches, or enable/disable specific routing rules

API reference: https://api.cloudflare.com/#email-routing-routing-rules-update-routing-rule

func (*API) UpdateEntrypointRuleset added in v0.73.0

func (api *API) UpdateEntrypointRuleset(ctx context.Context, rc *ResourceContainer, params UpdateEntrypointRulesetParams) (Ruleset, error)

UpdateEntrypointRuleset updates an entry point ruleset phase based on the phase.

API reference: https://developers.cloudflare.com/api/operations/updateAccountEntrypointRuleset API reference: https://developers.cloudflare.com/api/operations/updateZoneEntrypointRuleset

func (*API) UpdateFallbackDomain added in v0.29.0

func (api *API) UpdateFallbackDomain(ctx context.Context, accountID string, domains []FallbackDomain) ([]FallbackDomain, error)

UpdateFallbackDomain updates the existing fallback domain policy.

API reference: https://api.cloudflare.com/#devices-set-local-domain-fallback-list

func (*API) UpdateFallbackDomainDeviceSettingsPolicy added in v0.52.0

func (api *API) UpdateFallbackDomainDeviceSettingsPolicy(ctx context.Context, accountID, policyID string, domains []FallbackDomain) ([]FallbackDomain, error)

UpdateFallbackDomainDeviceSettingsPolicy updates the existing fallback domain policy for a specific device settings policy.

API reference: https://api.cloudflare.com/#devices-set-local-domain-fallback-list

func (*API) UpdateFallbackOrigin added in v0.10.1

func (api *API) UpdateFallbackOrigin(ctx context.Context, zoneID string, fbo FallbackOrigin) (*FallbackOriginResponse, error)

UpdateFallbackOrigin updates the fallback origin for a given zone.

API reference: https://developers.cloudflare.com/ssl/ssl-for-saas/api-calls/#4-example-patch-to-change-fallback-origin

func (*API) UpdateFilter added in v0.9.0

func (api *API) UpdateFilter(ctx context.Context, rc *ResourceContainer, params FilterUpdateParams) (Filter, error)

UpdateFilter updates a single filter.

API reference: https://developers.cloudflare.com/firewall/api/cf-filters/put/#update-a-single-filter

func (*API) UpdateFilters added in v0.9.0

func (api *API) UpdateFilters(ctx context.Context, rc *ResourceContainer, params []FilterUpdateParams) ([]Filter, error)

UpdateFilters updates many filters at once.

API reference: https://developers.cloudflare.com/firewall/api/cf-filters/put/#update-multiple-filters

func (*API) UpdateFirewallRule added in v0.9.0

func (api *API) UpdateFirewallRule(ctx context.Context, rc *ResourceContainer, params FirewallRuleUpdateParams) (FirewallRule, error)

UpdateFirewallRule updates a single firewall rule.

API reference: https://developers.cloudflare.com/firewall/api/cf-firewall-rules/put/#update-a-single-rule

func (*API) UpdateFirewallRules added in v0.9.0

func (api *API) UpdateFirewallRules(ctx context.Context, rc *ResourceContainer, params []FirewallRuleUpdateParams) ([]FirewallRule, error)

UpdateFirewallRules updates a single firewall rule.

API reference: https://developers.cloudflare.com/firewall/api/cf-firewall-rules/put/#update-multiple-rules

func (*API) UpdateHealthcheck added in v0.11.1

func (api *API) UpdateHealthcheck(ctx context.Context, zoneID string, healthcheckID string, healthcheck Healthcheck) (Healthcheck, error)

UpdateHealthcheck updates an existing healthcheck.

API reference: https://api.cloudflare.com/#health-checks-update-health-check

func (*API) UpdateHostnameTLSSetting added in v0.75.0

func (api *API) UpdateHostnameTLSSetting(ctx context.Context, rc *ResourceContainer, params UpdateHostnameTLSSettingParams) (HostnameTLSSetting, error)

UpdateHostnameTLSSetting will update the per-hostname tls setting for the specified hostname.

API reference: https://developers.cloudflare.com/api/operations/per-hostname-tls-settings-put

func (*API) UpdateHostnameTLSSettingCiphers added in v0.75.0

func (api *API) UpdateHostnameTLSSettingCiphers(ctx context.Context, rc *ResourceContainer, params UpdateHostnameTLSSettingCiphersParams) (HostnameTLSSettingCiphers, error)

UpdateHostnameTLSSettingCiphers will update the per-hostname ciphers tls setting for the specified hostname. Ciphers functions are separate due to the API returning a list of strings as the value, rather than a string (as is the case for the other tls settings).

API reference: https://developers.cloudflare.com/api/operations/per-hostname-tls-settings-put

func (*API) UpdateHyperdriveConfig added in v0.88.0

func (api *API) UpdateHyperdriveConfig(ctx context.Context, rc *ResourceContainer, params UpdateHyperdriveConfigParams) (HyperdriveConfig, error)

UpdateHyperdriveConfig updates a Hyperdrive config.

API reference: https://developers.cloudflare.com/api/operations/update-hyperdrive

func (*API) UpdateIPList deprecated added in v0.13.0

func (api *API) UpdateIPList(ctx context.Context, accountID, ID, description string) (IPList, error)

UpdateIPList updates the description of an existing IP List.

API reference: https://api.cloudflare.com/#rules-lists-update-list

Deprecated: Use `UpdateList` instead.

func (*API) UpdateImage added in v0.30.0

func (api *API) UpdateImage(ctx context.Context, rc *ResourceContainer, params UpdateImageParams) (Image, error)

UpdateImage updates an existing image's metadata.

API Reference: https://api.cloudflare.com/#cloudflare-images-update-image

func (*API) UpdateImagesVariant added in v0.88.0

func (api *API) UpdateImagesVariant(ctx context.Context, rc *ResourceContainer, params UpdateImagesVariantParams) (ImagesVariant, error)

Updating a variant purges the cache for all images associated with the variant.

API Reference: https://developers.cloudflare.com/api/operations/cloudflare-images-variants-variant-details

func (*API) UpdateKeylessSSL added in v0.17.0

func (api *API) UpdateKeylessSSL(ctx context.Context, zoneID, kelessSSLID string, keylessSSL KeylessSSLUpdateRequest) (KeylessSSL, error)

UpdateKeylessSSL updates an existing Keyless SSL configuration.

API reference: https://api.cloudflare.com/#keyless-ssl-for-a-zone-edit-keyless-ssl-configuration

func (*API) UpdateList added in v0.41.0

func (api *API) UpdateList(ctx context.Context, rc *ResourceContainer, params ListUpdateParams) (List, error)

UpdateList updates the description of an existing List.

API reference: https://api.cloudflare.com/#rules-lists-update-list

func (*API) UpdateLoadBalancer added in v0.51.0

func (api *API) UpdateLoadBalancer(ctx context.Context, rc *ResourceContainer, params UpdateLoadBalancerParams) (LoadBalancer, error)

UpdateLoadBalancer modifies a configured load balancer.

API reference: https://api.cloudflare.com/#load-balancers-update-load-balancer

func (*API) UpdateLoadBalancerMonitor added in v0.51.0

func (api *API) UpdateLoadBalancerMonitor(ctx context.Context, rc *ResourceContainer, params UpdateLoadBalancerMonitorParams) (LoadBalancerMonitor, error)

UpdateLoadBalancerMonitor modifies a configured load balancer monitor.

API reference: https://api.cloudflare.com/#load-balancer-monitors-update-monitor

func (*API) UpdateLoadBalancerPool added in v0.51.0

func (api *API) UpdateLoadBalancerPool(ctx context.Context, rc *ResourceContainer, params UpdateLoadBalancerPoolParams) (LoadBalancerPool, error)

UpdateLoadBalancerPool modifies a configured load balancer pool.

API reference: https://api.cloudflare.com/#load-balancer-pools-update-pool

func (*API) UpdateLogpushJob added in v0.9.0

func (api *API) UpdateLogpushJob(ctx context.Context, rc *ResourceContainer, params UpdateLogpushJobParams) error

UpdateLogpushJob lets you update a Logpush Job.

API reference: https://api.cloudflare.com/#logpush-jobs-update-logpush-job

Example
api, err := cloudflare.New(apiKey, user)
if err != nil {
	log.Fatal(err)
}

zoneID, err := api.ZoneIDByName(domain)
if err != nil {
	log.Fatal(err)
}

err = api.UpdateLogpushJob(context.Background(), cloudflare.ZoneIdentifier(zoneID), cloudflare.UpdateLogpushJobParams{
	ID:              1,
	Enabled:         true,
	Name:            "updated.com",
	LogpullOptions:  "fields=RayID,ClientIP,EdgeStartTimestamp",
	DestinationConf: "gs://mybucket/logs",
})
if err != nil {
	log.Fatal(err)
}
Output:

func (*API) UpdateMagicFirewallRuleset deprecated added in v0.13.7

func (api *API) UpdateMagicFirewallRuleset(ctx context.Context, accountID, ID string, description string, rules []MagicFirewallRulesetRule) (MagicFirewallRuleset, error)

UpdateMagicFirewallRuleset updates a Magic Firewall ruleset

API reference: https://api.cloudflare.com/#rulesets-update-ruleset

Deprecated: Use `UpdateZoneRuleset` or `UpdateAccountRuleset` instead.

func (*API) UpdateMagicTransitGRETunnel added in v0.32.0

func (api *API) UpdateMagicTransitGRETunnel(ctx context.Context, accountID string, id string, tunnel MagicTransitGRETunnel) (MagicTransitGRETunnel, error)

UpdateMagicTransitGRETunnel updates a GRE tunnel.

API reference: https://api.cloudflare.com/#magic-gre-tunnels-update-gre-tunnel

func (*API) UpdateMagicTransitIPsecTunnel added in v0.31.0

func (api *API) UpdateMagicTransitIPsecTunnel(ctx context.Context, accountID string, id string, tunnel MagicTransitIPsecTunnel) (MagicTransitIPsecTunnel, error)

UpdateMagicTransitIPsecTunnel updates an IPsec tunnel

API reference: https://api.cloudflare.com/#magic-ipsec-tunnels-update-ipsec-tunnel

func (*API) UpdateMagicTransitStaticRoute added in v0.18.0

func (api *API) UpdateMagicTransitStaticRoute(ctx context.Context, accountID, ID string, route MagicTransitStaticRoute) (MagicTransitStaticRoute, error)

UpdateMagicTransitStaticRoute updates a static route

API reference: https://api.cloudflare.com/#magic-transit-static-routes-update-route

func (*API) UpdateNotificationPolicy added in v0.19.0

func (api *API) UpdateNotificationPolicy(ctx context.Context, accountID string, policy *NotificationPolicy) (SaveResponse, error)

UpdateNotificationPolicy updates a notification policy, given the account id and the policy id and returns the policy id.

API Reference: https://api.cloudflare.com/#notification-policies-update-notification-policy

func (*API) UpdateNotificationWebhooks added in v0.19.0

func (api *API) UpdateNotificationWebhooks(ctx context.Context, accountID, webhookID string, webhooks *NotificationUpsertWebhooks) (SaveResponse, error)

UpdateNotificationWebhooks will update a particular webhook's name, given the account and webhooks ids.

The webhook url and secret cannot be updated.

API Reference: https://api.cloudflare.com/#notification-webhooks-update-webhook

func (*API) UpdatePageRule added in v0.7.2

func (api *API) UpdatePageRule(ctx context.Context, zoneID, ruleID string, rule PageRule) error

UpdatePageRule lets you replace a Page Rule. This is in contrast to ChangePageRule which lets you change individual settings.

API reference: https://api.cloudflare.com/#page-rules-for-a-zone-update-a-page-rule

func (*API) UpdatePageShieldPolicy added in v0.84.0

func (api *API) UpdatePageShieldPolicy(ctx context.Context, rc *ResourceContainer, params UpdatePageShieldPolicyParams) (*PageShieldPolicy, error)

UpdatePageShieldPolicy updates a page shield policy for a zone.

API documentation: https://developers.cloudflare.com/api/operations/page-shield-update-page-shield-policy

func (*API) UpdatePageShieldSettings added in v0.84.0

func (api *API) UpdatePageShieldSettings(ctx context.Context, rc *ResourceContainer, params UpdatePageShieldSettingsParams) (*PageShieldSettingsResponse, error)

UpdatePageShieldSettings updates the page shield settings for a zone.

API documentation: https://developers.cloudflare.com/api/operations/page-shield-update-page-shield-settings

func (*API) UpdatePagesProject added in v0.26.0

func (api *API) UpdatePagesProject(ctx context.Context, rc *ResourceContainer, params UpdatePagesProjectParams) (PagesProject, error)

UpdatePagesProject updates an existing Pages project.

API reference: https://api.cloudflare.com/#pages-project-update-project

func (*API) UpdatePrefixDescription added in v0.11.7

func (api *API) UpdatePrefixDescription(ctx context.Context, accountID, ID string, description string) (IPPrefix, error)

UpdatePrefixDescription edits the description of the IP prefix

API reference: https://api.cloudflare.com/#ip-address-management-prefixes-update-prefix-description

func (*API) UpdateQueue added in v0.55.0

func (api *API) UpdateQueue(ctx context.Context, rc *ResourceContainer, params UpdateQueueParams) (Queue, error)

UpdateQueue updates a queue.

API reference: https://api.cloudflare.com/#queue-update-queue

func (*API) UpdateQueueConsumer added in v0.55.0

func (api *API) UpdateQueueConsumer(ctx context.Context, rc *ResourceContainer, params UpdateQueueConsumerParams) (QueueConsumer, error)

UpdateQueueConsumer updates the consumer for a queue, or creates one if it does not exist..

API reference: https://api.cloudflare.com/#queue-update-queue-consumer

func (*API) UpdateRateLimit added in v0.8.5

func (api *API) UpdateRateLimit(ctx context.Context, zoneID, limitID string, limit RateLimit) (RateLimit, error)

UpdateRateLimit lets you replace a Rate Limit for a zone.

API reference: https://api.cloudflare.com/#rate-limits-for-a-zone-update-rate-limit

func (*API) UpdateRegionalTieredCache added in v0.73.0

func (api *API) UpdateRegionalTieredCache(ctx context.Context, rc *ResourceContainer, params UpdateRegionalTieredCacheParams) (RegionalTieredCache, error)

UpdateRegionalTieredCache updates the regional tiered cache setting for a zone.

API reference: https://developers.cloudflare.com/api/operations/zone-cache-settings-change-regional-tiered-cache-setting

func (*API) UpdateRegistrarDomain added in v0.9.0

func (api *API) UpdateRegistrarDomain(ctx context.Context, accountID, domainName string, domainConfiguration RegistrarDomainConfiguration) (RegistrarDomain, error)

UpdateRegistrarDomain updates an existing Registrar Domain configuration.

API reference: https://api.cloudflare.com/#registrar-domains-update-domain

Example
api, err := cloudflare.New(apiKey, user)
if err != nil {
	log.Fatal(err)
}

domain, err := api.UpdateRegistrarDomain(context.Background(), "01a7362d577a6c3019a474fd6f485823", "cloudflare.com", cloudflare.RegistrarDomainConfiguration{
	NameServers: []string{"ns1.cloudflare.com", "ns2.cloudflare.com"},
	Locked:      false,
})
if err != nil {
	log.Fatal(err)
}

fmt.Printf("%+v\n", domain)
Output:

func (*API) UpdateRuleset added in v0.73.0

func (api *API) UpdateRuleset(ctx context.Context, rc *ResourceContainer, params UpdateRulesetParams) (Ruleset, error)

UpdateRuleset updates a ruleset based on the ruleset ID.

API reference: https://developers.cloudflare.com/api/operations/updateAccountRuleset API reference: https://developers.cloudflare.com/api/operations/updateZoneRuleset

func (*API) UpdateSSL added in v0.7.2

func (api *API) UpdateSSL(ctx context.Context, zoneID, certificateID string, options ZoneCustomSSLOptions) (ZoneCustomSSL, error)

UpdateSSL updates (replaces) a custom SSL certificate.

API reference: https://api.cloudflare.com/#custom-ssl-for-a-zone-update-ssl-configuration

func (*API) UpdateSecondaryDNSPrimary added in v0.15.0

func (api *API) UpdateSecondaryDNSPrimary(ctx context.Context, accountID string, primary SecondaryDNSPrimary) (SecondaryDNSPrimary, error)

UpdateSecondaryDNSPrimary creates a secondary DNS primary.

API reference: https://api.cloudflare.com/#secondary-dns-primary--update-primary

func (*API) UpdateSecondaryDNSTSIG added in v0.15.0

func (api *API) UpdateSecondaryDNSTSIG(ctx context.Context, accountID string, tsig SecondaryDNSTSIG) (SecondaryDNSTSIG, error)

UpdateSecondaryDNSTSIG updates an existing secondary DNS TSIG at the account level.

API reference: https://api.cloudflare.com/#secondary-dns-tsig--update-tsig

func (*API) UpdateSecondaryDNSZone added in v0.15.0

func (api *API) UpdateSecondaryDNSZone(ctx context.Context, zoneID string, zone SecondaryDNSZone) (SecondaryDNSZone, error)

UpdateSecondaryDNSZone updates an existing secondary DNS zone.

API reference: https://api.cloudflare.com/#secondary-dns-update-secondary-zone-configuration

func (*API) UpdateSpectrumApplication added in v0.9.0

func (api *API) UpdateSpectrumApplication(ctx context.Context, zoneID, appID string, appDetails SpectrumApplication) (SpectrumApplication, error)

UpdateSpectrumApplication updates an existing Spectrum application.

API reference: https://developers.cloudflare.com/spectrum/api-reference/#update-a-spectrum-application

func (*API) UpdateSplitTunnel added in v0.25.0

func (api *API) UpdateSplitTunnel(ctx context.Context, accountID string, mode string, tunnels []SplitTunnel) ([]SplitTunnel, error)

UpdateSplitTunnel updates the existing split tunnel policy.

API reference for include: https://api.cloudflare.com/#device-policy-set-split-tunnel-include-list API reference for exclude: https://api.cloudflare.com/#device-policy-set-split-tunnel-exclude-list

func (*API) UpdateSplitTunnelDeviceSettingsPolicy added in v0.52.0

func (api *API) UpdateSplitTunnelDeviceSettingsPolicy(ctx context.Context, accountID, policyID string, mode string, tunnels []SplitTunnel) ([]SplitTunnel, error)

UpdateSplitTunnelDeviceSettingsPolicy updates the existing split tunnel policy within a device settings policy

API reference for include: https://api.cloudflare.com/#device-policy-set-split-tunnel-include-list API reference for exclude: https://api.cloudflare.com/#device-policy-set-split-tunnel-exclude-list

func (*API) UpdateTeamsList added in v0.17.0

func (api *API) UpdateTeamsList(ctx context.Context, rc *ResourceContainer, params UpdateTeamsListParams) (TeamsList, error)

UpdateTeamsList updates an existing teams list.

API reference: https://api.cloudflare.com/#teams-lists-update-teams-list

func (*API) UpdateTeamsLocation added in v0.21.0

func (api *API) UpdateTeamsLocation(ctx context.Context, accountID string, teamsLocation TeamsLocation) (TeamsLocation, error)

UpdateTeamsLocation updates an existing teams location.

API reference: https://api.cloudflare.com/#teams-locations-update-teams-location

func (*API) UpdateTeamsProxyEndpoint added in v0.35.0

func (api *API) UpdateTeamsProxyEndpoint(ctx context.Context, accountID string, proxyEndpoint TeamsProxyEndpoint) (TeamsProxyEndpoint, error)

UpdateTeamsProxyEndpoint updates an existing teams Proxy Endpoint.

API reference: https://api.cloudflare.com/#zero-trust-gateway-proxy-endpoints-update-proxy-endpoint

func (*API) UpdateTunnel added in v0.39.0

func (api *API) UpdateTunnel(ctx context.Context, rc *ResourceContainer, params TunnelUpdateParams) (Tunnel, error)

UpdateTunnel updates an existing tunnel for the account.

API reference: https://api.cloudflare.com/#cloudflare-tunnel-update-cloudflare-tunnel

func (*API) UpdateTunnelConfiguration added in v0.43.0

func (api *API) UpdateTunnelConfiguration(ctx context.Context, rc *ResourceContainer, params TunnelConfigurationParams) (TunnelConfigurationResult, error)

UpdateTunnelConfiguration updates an existing tunnel for the account.

API reference: https://api.cloudflare.com/#cloudflare-tunnel-configuration-properties

func (*API) UpdateTunnelRoute added in v0.36.0

func (api *API) UpdateTunnelRoute(ctx context.Context, rc *ResourceContainer, params TunnelRoutesUpdateParams) (TunnelRoute, error)

UpdateTunnelRoute updates an existing route in the account routing table for the given tunnel.

See: https://api.cloudflare.com/#tunnel-route-update-route

func (*API) UpdateTunnelVirtualNetwork added in v0.41.0

func (api *API) UpdateTunnelVirtualNetwork(ctx context.Context, rc *ResourceContainer, params TunnelVirtualNetworkUpdateParams) (TunnelVirtualNetwork, error)

UpdateTunnelRoute updates an existing virtual network in the account.

API reference: https://api.cloudflare.com/#tunnel-virtual-network-update-virtual-network

func (*API) UpdateTurnstileWidget added in v0.66.0

func (api *API) UpdateTurnstileWidget(ctx context.Context, rc *ResourceContainer, params UpdateTurnstileWidgetParams) (TurnstileWidget, error)

UpdateTurnstileWidget update the configuration of a widget.

API reference: https://api.cloudflare.com/#challenge-widgets-update-a-challenge-widget

func (*API) UpdateUniversalSSLCertificatePackValidationMethod added in v0.20.0

func (api *API) UpdateUniversalSSLCertificatePackValidationMethod(ctx context.Context, zoneID string, certPackUUID string, setting UniversalSSLCertificatePackValidationMethodSetting) (UniversalSSLCertificatePackValidationMethodSetting, error)

UpdateUniversalSSLCertificatePackValidationMethod changes the validation method for a certificate pack

API reference: https://api.cloudflare.com/#ssl-verification-ssl-verification-details

func (*API) UpdateUser added in v0.7.2

func (api *API) UpdateUser(ctx context.Context, user *User) (User, error)

UpdateUser updates the properties of the given user.

API reference: https://api.cloudflare.com/#user-update-user

func (*API) UpdateUserAccessRule added in v0.8.1

func (api *API) UpdateUserAccessRule(ctx context.Context, accessRuleID string, accessRule AccessRule) (*AccessRuleResponse, error)

UpdateUserAccessRule updates a single access rule for the logged-in user & given access rule identifier.

API reference: https://api.cloudflare.com/#user-level-firewall-access-rule-update-access-rule

func (*API) UpdateUserAgentRule added in v0.8.0

func (api *API) UpdateUserAgentRule(ctx context.Context, zoneID string, id string, ld UserAgentRule) (*UserAgentRuleResponse, error)

UpdateUserAgentRule updates a User-Agent Block rule (based on the ID) for the given zone ID.

API reference: https://api.cloudflare.com/#user-agent-blocking-rules-update-useragent-rule

func (*API) UpdateWAFGroup added in v0.10.1

func (api *API) UpdateWAFGroup(ctx context.Context, zoneID, packageID, groupID, mode string) (WAFGroup, error)

UpdateWAFGroup lets you update the mode of a WAF Group.

API Reference: https://api.cloudflare.com/#waf-rule-groups-edit-rule-group

func (*API) UpdateWAFOverride added in v0.11.1

func (api *API) UpdateWAFOverride(ctx context.Context, zoneID, overrideID string, override WAFOverride) (WAFOverride, error)

UpdateWAFOverride updates an existing WAF override.

API reference: https://api.cloudflare.com/#waf-overrides-update-uri-controlled-waf-configuration

func (*API) UpdateWAFPackage added in v0.10.0

func (api *API) UpdateWAFPackage(ctx context.Context, zoneID, packageID string, opts WAFPackageOptions) (WAFPackage, error)

UpdateWAFPackage lets you update the a WAF Package.

API Reference: https://api.cloudflare.com/#waf-rule-packages-edit-firewall-package

func (*API) UpdateWAFRule added in v0.9.0

func (api *API) UpdateWAFRule(ctx context.Context, zoneID, packageID, ruleID, mode string) (WAFRule, error)

UpdateWAFRule lets you update the mode of a WAF Rule.

API Reference: https://api.cloudflare.com/#waf-rules-edit-rule

func (*API) UpdateWaitingRoom added in v0.17.0

func (api *API) UpdateWaitingRoom(ctx context.Context, zoneID string, waitingRoom WaitingRoom) (WaitingRoom, error)

UpdateWaitingRoom lets you replace a Waiting Room. This is in contrast to ChangeWaitingRoom which lets you change individual settings.

API reference: https://api.cloudflare.com/#waiting-room-update-waiting-room

func (*API) UpdateWaitingRoomEvent added in v0.33.0

func (api *API) UpdateWaitingRoomEvent(ctx context.Context, zoneID string, waitingRoomID string, waitingRoomEvent WaitingRoomEvent) (WaitingRoomEvent, error)

UpdateWaitingRoomEvent lets you replace a Waiting Room Event. This is in contrast to ChangeWaitingRoomEvent which lets you change individual settings.

API reference: https://api.cloudflare.com/#waiting-room-update-event

func (*API) UpdateWaitingRoomRule added in v0.53.0

func (api *API) UpdateWaitingRoomRule(ctx context.Context, rc *ResourceContainer, params UpdateWaitingRoomRuleParams) ([]WaitingRoomRule, error)

UpdateWaitingRoomRule updates a rule for a Waiting Room.

API reference: https://api.cloudflare.com/#waiting-room-patch-waiting-room-rule

func (*API) UpdateWaitingRoomSettings added in v0.67.0

func (api *API) UpdateWaitingRoomSettings(ctx context.Context, rc *ResourceContainer, params UpdateWaitingRoomSettingsParams) (WaitingRoomSettings, error)

UpdateWaitingRoomSettings lets you replace all zone-level Waiting Room settings. This is in contrast to PatchWaitingRoomSettings which lets you change individual settings.

API reference: https://api.cloudflare.com/#waiting-room-update-zone-settings

func (*API) UpdateWeb3Hostname added in v0.45.0

func (api *API) UpdateWeb3Hostname(ctx context.Context, params Web3HostnameUpdateParameters) (Web3Hostname, error)

UpdateWeb3Hostname edits a web3 hostname.

API Reference: https://api.cloudflare.com/#web3-hostname-edit-web3-hostname

func (*API) UpdateWebAnalyticsRule added in v0.75.0

func (api *API) UpdateWebAnalyticsRule(ctx context.Context, rc *ResourceContainer, params UpdateWebAnalyticsRuleParams) (*WebAnalyticsRule, error)

UpdateWebAnalyticsRule updates a Web Analytics Rule in a Web Analytics ruleset.

API reference: https://api.cloudflare.com/#web-analytics-update-rule

func (*API) UpdateWebAnalyticsSite added in v0.75.0

func (api *API) UpdateWebAnalyticsSite(ctx context.Context, rc *ResourceContainer, params UpdateWebAnalyticsSiteParams) (*WebAnalyticsSite, error)

UpdateWebAnalyticsSite updates an existing Web Analytics Site for an Account.

API reference: https://api.cloudflare.com/#web-analytics-update-site

func (*API) UpdateWorkerCronTriggers added in v0.13.8

func (api *API) UpdateWorkerCronTriggers(ctx context.Context, rc *ResourceContainer, params UpdateWorkerCronTriggersParams) ([]WorkerCronTrigger, error)

UpdateWorkerCronTriggers updates a single schedule for a Worker cron trigger.

API reference: https://developers.cloudflare.com/api/operations/worker-cron-trigger-update-cron-triggers

func (*API) UpdateWorkerRoute added in v0.9.0

func (api *API) UpdateWorkerRoute(ctx context.Context, rc *ResourceContainer, params UpdateWorkerRouteParams) (WorkerRouteResponse, error)

UpdateWorkerRoute updates worker route for a script.

API reference: https://developers.cloudflare.com/api/operations/worker-routes-update-route

func (*API) UpdateWorkersKVNamespace added in v0.9.0

func (api *API) UpdateWorkersKVNamespace(ctx context.Context, rc *ResourceContainer, params UpdateWorkersKVNamespaceParams) (Response, error)

UpdateWorkersKVNamespace modifies a KV namespace based on the ID.

API reference: https://developers.cloudflare.com/api/operations/workers-kv-namespace-rename-a-namespace

Example
api, err := cloudflare.New(apiKey, user)
if err != nil {
	log.Fatal(err)
}

resp, err := api.UpdateWorkersKVNamespace(context.Background(), cloudflare.AccountIdentifier(accountID), cloudflare.UpdateWorkersKVNamespaceParams{
	NamespaceID: namespace,
	Title:       "test_title",
})
if err != nil {
	log.Fatal(err)
}

fmt.Println(resp)
Output:

func (*API) UpdateWorkersScriptContent added in v0.76.0

func (api *API) UpdateWorkersScriptContent(ctx context.Context, rc *ResourceContainer, params UpdateWorkersScriptContentParams) (WorkerScriptResponse, error)

UpdateWorkersScriptContent pushes only script content, no metadata.

API reference: https://developers.cloudflare.com/api/operations/worker-script-put-content

func (*API) UpdateWorkersScriptSettings added in v0.76.0

func (api *API) UpdateWorkersScriptSettings(ctx context.Context, rc *ResourceContainer, params UpdateWorkersScriptSettingsParams) (WorkerScriptSettingsResponse, error)

UpdateWorkersScriptSettings pushes only script metadata.

API reference: https://developers.cloudflare.com/api/operations/worker-script-patch-settings

func (*API) UpdateZarazConfig added in v0.86.0

func (api *API) UpdateZarazConfig(ctx context.Context, rc *ResourceContainer, params UpdateZarazConfigParams) (ZarazConfigResponse, error)

func (*API) UpdateZarazWorkflow added in v0.86.0

func (api *API) UpdateZarazWorkflow(ctx context.Context, rc *ResourceContainer, params UpdateZarazWorkflowParams) (ZarazWorkflowResponse, error)

func (*API) UpdateZoneAccessRule added in v0.8.1

func (api *API) UpdateZoneAccessRule(ctx context.Context, zoneID, accessRuleID string, accessRule AccessRule) (*AccessRuleResponse, error)

UpdateZoneAccessRule updates a single access rule for the given zone & access rule identifiers.

API reference: https://api.cloudflare.com/#firewall-access-rule-for-a-zone-update-access-rule

func (*API) UpdateZoneCacheVariants added in v0.32.0

func (api *API) UpdateZoneCacheVariants(ctx context.Context, zoneID string, variants ZoneCacheVariantsValues) (ZoneCacheVariants, error)

UpdateZoneCacheVariants updates the cache variants for a given zone.

API reference: https://api.cloudflare.com/#zone-cache-settings-change-variants-setting

func (*API) UpdateZoneDNSSEC added in v0.13.5

func (api *API) UpdateZoneDNSSEC(ctx context.Context, zoneID string, options ZoneDNSSECUpdateOptions) (ZoneDNSSEC, error)

UpdateZoneDNSSEC updates DNSSEC for a zone

API reference: https://api.cloudflare.com/#dnssec-edit-dnssec-status

func (*API) UpdateZoneLevelAccessBookmark added in v0.36.0

func (api *API) UpdateZoneLevelAccessBookmark(ctx context.Context, zoneID string, accessBookmark AccessBookmark) (AccessBookmark, error)

UpdateZoneLevelAccessBookmark updates an existing zone level access bookmark.

API reference: https://api.cloudflare.com/#zone-level-access-bookmarks-update-access-bookmark

func (*API) UpdateZoneLockdown added in v0.8.0

func (api *API) UpdateZoneLockdown(ctx context.Context, rc *ResourceContainer, params ZoneLockdownUpdateParams) (ZoneLockdown, error)

UpdateZoneLockdown updates a Zone ZoneLockdown rule (based on the ID) for the given zone ID.

API reference: https://api.cloudflare.com/#zone-ZoneLockdown-update-ZoneLockdown-rule

func (*API) UpdateZoneManagedHeaders added in v0.42.0

func (api *API) UpdateZoneManagedHeaders(ctx context.Context, rc *ResourceContainer, params UpdateManagedHeadersParams) (ManagedHeaders, error)

func (*API) UpdateZoneSSLSettings added in v0.25.0

func (api *API) UpdateZoneSSLSettings(ctx context.Context, zoneID string, sslValue string) (ZoneSSLSetting, error)

UpdateZoneSSLSettings update information about SSL setting to the specified zone.

API reference: https://api.cloudflare.com/#zone-settings-change-ssl-setting

func (*API) UpdateZoneSetting added in v0.64.0

func (api *API) UpdateZoneSetting(ctx context.Context, rc *ResourceContainer, params UpdateZoneSettingParams) (ZoneSetting, error)

UpdateZoneSetting updates the specified setting for a given zone.

API reference: https://api.cloudflare.com/#zone-settings-edit-zone-settings-info

func (*API) UpdateZoneSettings added in v0.8.5

func (api *API) UpdateZoneSettings(ctx context.Context, zoneID string, settings []ZoneSetting) (*ZoneSettingResponse, error)

UpdateZoneSettings updates the settings for a given zone.

API reference: https://api.cloudflare.com/#zone-settings-edit-zone-settings-info

func (*API) UploadDLPDatasetVersion added in v0.87.0

func (api *API) UploadDLPDatasetVersion(ctx context.Context, rc *ResourceContainer, params UploadDLPDatasetVersionParams) (DLPDataset, error)

UploadDLPDatasetVersion uploads a new version of the specified DLP dataset.

API reference: https://developers.cloudflare.com/api/operations/dlp-datasets-upload-version

func (*API) UploadImage added in v0.30.0

func (api *API) UploadImage(ctx context.Context, rc *ResourceContainer, params UploadImageParams) (Image, error)

UploadImage uploads a single image.

API Reference: https://api.cloudflare.com/#cloudflare-images-upload-an-image-using-a-single-http-request

func (*API) UploadPerHostnameAuthenticatedOriginPullsCertificate added in v0.12.2

func (api *API) UploadPerHostnameAuthenticatedOriginPullsCertificate(ctx context.Context, zoneID string, params PerHostnameAuthenticatedOriginPullsCertificateParams) (PerHostnameAuthenticatedOriginPullsCertificateDetails, error)

UploadPerHostnameAuthenticatedOriginPullsCertificate will upload the provided certificate and private key to the edge under Per Hostname AuthenticatedOriginPulls.

API reference: https://api.cloudflare.com/#per-hostname-authenticated-origin-pull-upload-a-hostname-client-certificate

func (*API) UploadPerZoneAuthenticatedOriginPullsCertificate added in v0.12.2

func (api *API) UploadPerZoneAuthenticatedOriginPullsCertificate(ctx context.Context, zoneID string, params PerZoneAuthenticatedOriginPullsCertificateParams) (PerZoneAuthenticatedOriginPullsCertificateDetails, error)

UploadPerZoneAuthenticatedOriginPullsCertificate will upload a provided client certificate and enable it to be used in all AuthenticatedOriginPulls requests for the zone.

API reference: https://api.cloudflare.com/#zone-level-authenticated-origin-pulls-upload-certificate

func (*API) UploadWorker added in v0.9.0

func (api *API) UploadWorker(ctx context.Context, rc *ResourceContainer, params CreateWorkerParams) (WorkerScriptResponse, error)

UploadWorker pushes raw script content for your Worker.

API reference: https://developers.cloudflare.com/api/operations/worker-script-upload-worker-module

func (*API) UserAccessRule added in v0.9.0

func (api *API) UserAccessRule(ctx context.Context, accessRuleID string) (*AccessRuleResponse, error)

UserAccessRule returns the details of a user's account access rule.

API reference: https://api.cloudflare.com/#user-level-firewall-access-rule-list-access-rules

func (*API) UserAgentRule added in v0.8.0

func (api *API) UserAgentRule(ctx context.Context, zoneID string, id string) (*UserAgentRuleResponse, error)

UserAgentRule retrieves a User-Agent Block rule (based on the ID) for the given zone ID.

API reference: https://api.cloudflare.com/#user-agent-blocking-rules-useragent-rule-details

func (*API) UserBillingHistory added in v0.43.0

func (api *API) UserBillingHistory(ctx context.Context, pageOpts UserBillingOptions) ([]UserBillingHistory, error)

UserBillingHistory return the billing history of the user

API reference: https://api.cloudflare.com/#user-billing-history-billing-history-details

func (*API) UserBillingProfile added in v0.7.3

func (api *API) UserBillingProfile(ctx context.Context) (UserBillingProfile, error)

UserBillingProfile returns the billing profile of the user.

API reference: https://api.cloudflare.com/#user-billing-profile

func (*API) UserDetails added in v0.7.2

func (api *API) UserDetails(ctx context.Context) (User, error)

UserDetails provides information about the logged-in user.

API reference: https://api.cloudflare.com/#user-user-details

func (*API) ValidateFilterExpression added in v0.9.0

func (api *API) ValidateFilterExpression(ctx context.Context, expression string) error

ValidateFilterExpression checks correctness of a filter expression.

API reference: https://developers.cloudflare.com/firewall/api/cf-filters/validation/

func (*API) ValidateLogpushOwnershipChallenge added in v0.9.0

func (api *API) ValidateLogpushOwnershipChallenge(ctx context.Context, rc *ResourceContainer, params ValidateLogpushOwnershipChallengeParams) (bool, error)

ValidateLogpushOwnershipChallenge returns zone-level ownership challenge validation result.

API reference: https://api.cloudflare.com/#logpush-jobs-validate-ownership-challenge

Example
api, err := cloudflare.New(apiKey, user)
if err != nil {
	log.Fatal(err)
}

zoneID, err := api.ZoneIDByName(domain)
if err != nil {
	log.Fatal(err)
}

isValid, err := api.ValidateLogpushOwnershipChallenge(context.Background(), cloudflare.ZoneIdentifier(zoneID), cloudflare.ValidateLogpushOwnershipChallengeParams{
	DestinationConf:    "destination_conf",
	OwnershipChallenge: "ownership_challenge",
})
if err != nil {
	log.Fatal(err)
}

fmt.Printf("%+v\n", isValid)
Output:

func (*API) VerifyAPIToken added in v0.13.5

func (api *API) VerifyAPIToken(ctx context.Context) (APITokenVerifyBody, error)

VerifyAPIToken tests the validity of the token.

API reference: https://api.cloudflare.com/#user-api-tokens-verify-token

func (*API) WAFGroup added in v0.10.1

func (api *API) WAFGroup(ctx context.Context, zoneID, packageID, groupID string) (WAFGroup, error)

WAFGroup returns a WAF rule group from the given WAF package.

API Reference: https://api.cloudflare.com/#waf-rule-groups-rule-group-details

func (*API) WAFOverride added in v0.11.1

func (api *API) WAFOverride(ctx context.Context, zoneID, overrideID string) (WAFOverride, error)

WAFOverride returns a WAF override from the given override ID.

API Reference: https://api.cloudflare.com/#waf-overrides-uri-controlled-waf-configuration-details

func (*API) WAFPackage added in v0.10.0

func (api *API) WAFPackage(ctx context.Context, zoneID, packageID string) (WAFPackage, error)

WAFPackage returns a WAF package for the given zone.

API Reference: https://api.cloudflare.com/#waf-rule-packages-firewall-package-details

func (*API) WAFRule added in v0.9.0

func (api *API) WAFRule(ctx context.Context, zoneID, packageID, ruleID string) (WAFRule, error)

WAFRule returns a WAF rule from the given WAF package.

API Reference: https://api.cloudflare.com/#waf-rules-rule-details

func (*API) WaitingRoom added in v0.17.0

func (api *API) WaitingRoom(ctx context.Context, zoneID, waitingRoomID string) (WaitingRoom, error)

WaitingRoom fetches detail about one Waiting room for a zone.

API reference: https://api.cloudflare.com/#waiting-room-waiting-room-details

func (*API) WaitingRoomEvent added in v0.33.0

func (api *API) WaitingRoomEvent(ctx context.Context, zoneID string, waitingRoomID string, eventID string) (WaitingRoomEvent, error)

WaitingRoomEvent fetches detail about one Waiting Room Event for a zone.

API reference: https://api.cloudflare.com/#waiting-room-event-details

func (*API) WaitingRoomEventPreview added in v0.33.0

func (api *API) WaitingRoomEventPreview(ctx context.Context, zoneID string, waitingRoomID string, eventID string) (WaitingRoomEvent, error)

WaitingRoomEventPreview returns an event's configuration as if it was active. Inherited fields from the waiting room will be displayed with their current values.

API reference: https://api.cloudflare.com/#waiting-room-preview-active-event-details

func (*API) WaitingRoomPagePreview added in v0.34.0

func (api *API) WaitingRoomPagePreview(ctx context.Context, zoneID, customHTML string) (WaitingRoomPagePreviewURL, error)

WaitingRoomPagePreview uploads a custom waiting room page for preview and returns a preview URL.

API reference: https://api.cloudflare.com/#waiting-room-create-a-custom-waiting-room-page-preview

func (*API) WaitingRoomStatus added in v0.33.0

func (api *API) WaitingRoomStatus(ctx context.Context, zoneID, waitingRoomID string) (WaitingRoomStatus, error)

WaitingRoomStatus returns the status of one Waiting Room for a zone.

API reference: https://api.cloudflare.com/#waiting-room-get-waiting-room-status

func (*API) WorkersAccountSettings added in v0.47.0

func (api *API) WorkersAccountSettings(ctx context.Context, rc *ResourceContainer, params WorkersAccountSettingsParameters) (WorkersAccountSettings, error)

WorkersAccountSettings returns the current account settings for Workers.

API reference: https://developers.cloudflare.com/api/operations/worker-account-settings-fetch-worker-account-settings

func (*API) WorkersCreateSubdomain added in v0.47.0

func (api *API) WorkersCreateSubdomain(ctx context.Context, rc *ResourceContainer, params WorkersSubdomain) (WorkersSubdomain, error)

WorkersCreateSubdomain Creates a Workers subdomain for an account.

API reference: https://developers.cloudflare.com/api/operations/worker-subdomain-create-subdomain

func (*API) WorkersGetSubdomain added in v0.47.0

func (api *API) WorkersGetSubdomain(ctx context.Context, rc *ResourceContainer) (WorkersSubdomain, error)

WorkersGetSubdomain Creates a Workers subdomain for an account.

API reference: https://developers.cloudflare.com/api/operations/worker-subdomain-get-subdomain

func (*API) WriteWorkersKVEntries added in v0.55.0

func (api *API) WriteWorkersKVEntries(ctx context.Context, rc *ResourceContainer, params WriteWorkersKVEntriesParams) (Response, error)

WriteWorkersKVEntries writes multiple KVs at once.

API reference: https://developers.cloudflare.com/api/operations/workers-kv-namespace-write-multiple-key-value-pairs

Example
api, err := cloudflare.New(apiKey, user)
if err != nil {
	log.Fatal(err)
}

payload := []*cloudflare.WorkersKVPair{
	{
		Key:   "key1",
		Value: "value1",
	},
	{
		Key:      "key2",
		Value:    base64.StdEncoding.EncodeToString([]byte("value2")),
		Base64:   true,
		Metadata: "key2's value will be decoded in base64 before it is stored",
	},
}

resp, err := api.WriteWorkersKVEntries(context.Background(), cloudflare.AccountIdentifier(accountID), cloudflare.WriteWorkersKVEntriesParams{
	NamespaceID: namespace,
	KVs:         payload,
})
if err != nil {
	log.Fatal(err)
}

fmt.Println(resp)
Output:

func (*API) WriteWorkersKVEntry added in v0.55.0

func (api *API) WriteWorkersKVEntry(ctx context.Context, rc *ResourceContainer, params WriteWorkersKVEntryParams) (Response, error)

WriteWorkersKVEntry writes a single KV value based on the key.

API reference: https://developers.cloudflare.com/api/operations/workers-kv-namespace-write-key-value-pair-with-metadata

Example
api, err := cloudflare.New(apiKey, user)
if err != nil {
	log.Fatal(err)
}

payload := []byte("test payload")
key := "test_key"

resp, err := api.WriteWorkersKVEntry(context.Background(), cloudflare.AccountIdentifier(accountID), cloudflare.WriteWorkersKVEntryParams{
	NamespaceID: namespace,
	Key:         key,
	Value:       payload,
})
if err != nil {
	log.Fatal(err)
}

fmt.Println(resp)
Output:

func (*API) ZoneAccessRule added in v0.9.0

func (api *API) ZoneAccessRule(ctx context.Context, zoneID string, accessRuleID string) (*AccessRuleResponse, error)

ZoneAccessRule returns the details of a zone's access rule.

API reference: https://api.cloudflare.com/#firewall-access-rule-for-a-zone-list-access-rules

func (*API) ZoneActivationCheck added in v0.7.2

func (api *API) ZoneActivationCheck(ctx context.Context, zoneID string) (Response, error)

ZoneActivationCheck initiates another zone activation check for newly-created zones.

API reference: https://api.cloudflare.com/#zone-initiate-another-zone-activation-check

func (*API) ZoneAnalyticsByColocation added in v0.7.2

func (api *API) ZoneAnalyticsByColocation(ctx context.Context, zoneID string, options ZoneAnalyticsOptions) ([]ZoneAnalyticsColocation, error)

ZoneAnalyticsByColocation returns zone analytics information by datacenter.

API reference: https://api.cloudflare.com/#zone-analytics-analytics-by-co-locations

func (*API) ZoneAnalyticsDashboard added in v0.7.2

func (api *API) ZoneAnalyticsDashboard(ctx context.Context, zoneID string, options ZoneAnalyticsOptions) (ZoneAnalyticsData, error)

ZoneAnalyticsDashboard returns zone analytics information.

API reference: https://api.cloudflare.com/#zone-analytics-dashboard

func (*API) ZoneCacheVariants added in v0.32.0

func (api *API) ZoneCacheVariants(ctx context.Context, zoneID string) (ZoneCacheVariants, error)

ZoneCacheVariants returns information about the current cache variants

API reference: https://api.cloudflare.com/#zone-cache-settings-get-variants-setting

func (*API) ZoneDNSSECSetting added in v0.13.5

func (api *API) ZoneDNSSECSetting(ctx context.Context, zoneID string) (ZoneDNSSEC, error)

ZoneDNSSECSetting returns the DNSSEC details of a zone

API reference: https://api.cloudflare.com/#dnssec-dnssec-details

func (*API) ZoneDetails added in v0.7.2

func (api *API) ZoneDetails(ctx context.Context, zoneID string) (Zone, error)

ZoneDetails fetches information about a zone.

API reference: https://api.cloudflare.com/#zone-zone-details

func (*API) ZoneExport added in v0.10.9

func (api *API) ZoneExport(ctx context.Context, zoneID string) (string, error)

ZoneExport returns the text BIND config for the given zone

API reference: https://api.cloudflare.com/#dns-records-for-a-zone-export-dns-records

func (*API) ZoneIDByName added in v0.7.2

func (api *API) ZoneIDByName(zoneName string) (string, error)

ZoneIDByName retrieves a zone's ID from the name.

func (*API) ZoneLevelAccessBookmark added in v0.36.0

func (api *API) ZoneLevelAccessBookmark(ctx context.Context, zoneID, bookmarkID string) (AccessBookmark, error)

ZoneLevelAccessBookmark returns a single zone level bookmark based on the bookmark ID.

API reference: https://api.cloudflare.com/#zone-level-access-bookmarks-access-bookmarks-details

func (*API) ZoneLevelAccessBookmarks added in v0.36.0

func (api *API) ZoneLevelAccessBookmarks(ctx context.Context, zoneID string, pageOpts PaginationOptions) ([]AccessBookmark, ResultInfo, error)

ZoneLevelAccessBookmarks returns all bookmarks within a zone.

API reference: https://api.cloudflare.com/#zone-level-access-bookmarks-list-access-bookmarks

func (*API) ZoneLockdown added in v0.8.0

func (api *API) ZoneLockdown(ctx context.Context, rc *ResourceContainer, id string) (ZoneLockdown, error)

ZoneLockdown retrieves a Zone ZoneLockdown rule (based on the ID) for the given zone ID.

API reference: https://api.cloudflare.com/#zone-ZoneLockdown-ZoneLockdown-rule-details

func (*API) ZoneSSLSettings added in v0.7.4

func (api *API) ZoneSSLSettings(ctx context.Context, zoneID string) (ZoneSSLSetting, error)

ZoneSSLSettings returns information about SSL setting to the specified zone.

API reference: https://api.cloudflare.com/#zone-settings-get-ssl-setting

func (*API) ZoneSetPaused added in v0.7.2

func (api *API) ZoneSetPaused(ctx context.Context, zoneID string, paused bool) (Zone, error)

ZoneSetPaused pauses Cloudflare service for the entire zone, sending all traffic direct to the origin.

func (*API) ZoneSetPlan added in v0.7.2

func (api *API) ZoneSetPlan(ctx context.Context, zoneID string, planType string) error

ZoneSetPlan sets the rate plan of an existing zone.

Valid values for `planType` are "CF_FREE", "CF_PRO", "CF_BIZ" and "CF_ENT".

API reference: https://api.cloudflare.com/#zone-subscription-create-zone-subscription

func (*API) ZoneSetType added in v0.27.0

func (api *API) ZoneSetType(ctx context.Context, zoneID string, zoneType string) (Zone, error)

ZoneSetType toggles the type for an existing zone.

Valid values for `type` are "full" and "partial"

API reference: https://api.cloudflare.com/#zone-edit-zone

func (*API) ZoneSetVanityNS added in v0.7.2

func (api *API) ZoneSetVanityNS(ctx context.Context, zoneID string, ns []string) (Zone, error)

ZoneSetVanityNS sets custom nameservers for the zone. These names must be within the same zone.

func (*API) ZoneSettings added in v0.8.5

func (api *API) ZoneSettings(ctx context.Context, zoneID string) (*ZoneSettingResponse, error)

ZoneSettings returns all of the settings for a given zone.

API reference: https://api.cloudflare.com/#zone-settings-get-all-zone-settings

func (*API) ZoneUpdatePlan added in v0.10.6

func (api *API) ZoneUpdatePlan(ctx context.Context, zoneID string, planType string) error

ZoneUpdatePlan updates the rate plan of an existing zone.

Valid values for `planType` are "CF_FREE", "CF_PRO", "CF_BIZ" and "CF_ENT".

API reference: https://api.cloudflare.com/#zone-subscription-update-zone-subscription

type APIResponse added in v0.49.0

type APIResponse struct {
	Body       []byte
	Status     string
	StatusCode int
	Headers    http.Header
}

APIResponse holds the structure for a response from the API. It looks alot like `http.Response` however, uses a `[]byte` for the `Body` instead of a `io.ReadCloser`.

This may go away in the experimental client in favour of `http.Response`.

type APIShield added in v0.49.0

type APIShield struct {
	AuthIdCharacteristics []AuthIdCharacteristics `json:"auth_id_characteristics"`
}

APIShield is all the available options under configuration?properties=auth_id_characteristics.

type APIShieldBasicOperation added in v0.78.0

type APIShieldBasicOperation struct {
	Method   string `json:"method"`
	Host     string `json:"host"`
	Endpoint string `json:"endpoint"`
}

APIShieldBasicOperation should be used when creating an operation in API Shield Endpoint Management.

type APIShieldCreateSchemaEvent added in v0.79.0

type APIShieldCreateSchemaEvent struct {
	// Code identifies the event that occurred
	Code uint `json:"code"`
	// Message describes the event that occurred
	Message string `json:"message"`
}

APIShieldCreateSchemaEvent is an event log that occurred during processing.

type APIShieldCreateSchemaEventWithLocation added in v0.79.0

type APIShieldCreateSchemaEventWithLocation struct {
	APIShieldCreateSchemaEvent

	// Location is where the event occurred
	// See https://goessner.net/articles/JsonPath/ for JSONPath specification.
	Location string `json:"location,omitempty"`
}

APIShieldCreateSchemaEventWithLocation is an event log that occurred during processing, with the location in the schema where the event occurred.

type APIShieldCreateSchemaEventWithLocations added in v0.79.0

type APIShieldCreateSchemaEventWithLocations struct {
	APIShieldCreateSchemaEvent

	// Locations lists JSONPath locations where the event occurred
	// See https://goessner.net/articles/JsonPath/ for JSONPath specification
	Locations []string `json:"locations"`
}

APIShieldCreateSchemaEventWithLocations is an event log that occurred during processing, with the location(s) in the schema where the event occurred.

func (APIShieldCreateSchemaEventWithLocations) String added in v0.79.0

type APIShieldCreateSchemaEvents added in v0.79.0

type APIShieldCreateSchemaEvents struct {
	Critical *APIShieldCreateSchemaEventWithLocation   `json:"critical,omitempty"`
	Errors   []APIShieldCreateSchemaEventWithLocations `json:"errors,omitempty"`
	Warnings []APIShieldCreateSchemaEventWithLocations `json:"warnings,omitempty"`
}

APIShieldCreateSchemaEvents are event logs that occurred during processing.

The logs are separated into levels of severity.

type APIShieldCreateSchemaResponse added in v0.79.0

type APIShieldCreateSchemaResponse struct {
	Result APIShieldCreateSchemaResult `json:"result"`
	Response
}

APIShieldCreateSchemaResponse represents the response from the POST api_gateway/user_schemas endpoint.

type APIShieldCreateSchemaResult added in v0.79.0

type APIShieldCreateSchemaResult struct {
	// APIShieldSchema is the schema that was created
	Schema APIShieldSchema `json:"schema"`
	// APIShieldCreateSchemaEvents are non-critical event logs that occurred during processing.
	Events APIShieldCreateSchemaEvents `json:"upload_details"`
}

APIShieldCreateSchemaResult represents the successful result of creating a schema in Schema Validation 2.0.

type APIShieldDeleteOperationResponse added in v0.78.0

type APIShieldDeleteOperationResponse struct {
	Result interface{} `json:"result"`
	Response
}

APIShieldDeleteOperationResponse represents the response from the api_gateway/operations/{id} endpoint (DELETE).

type APIShieldDeleteSchemaResponse added in v0.79.0

type APIShieldDeleteSchemaResponse struct {
	Result interface{} `json:"result"`
	Response
}

APIShieldDeleteSchemaResponse represents the response from the DELETE api_gateway/user_schemas/{id} endpoint.

type APIShieldDiscoveryOperation added in v0.79.0

type APIShieldDiscoveryOperation struct {
	// ID represents the ID of the operation, formatted as UUID
	ID string `json:"id"`
	// Origin represents the API discovery engine(s) that discovered this operation
	Origin []APIShieldDiscoveryOrigin `json:"origin"`
	// State represents the state of operation in API Discovery
	State APIShieldDiscoveryState `json:"state"`
	// LastUpdated timestamp of when this operation was last updated
	LastUpdated *time.Time `json:"last_updated"`
	// Features are additional data about the operation
	Features map[string]any `json:"features,omitempty"`

	Method   string `json:"method"`
	Host     string `json:"host"`
	Endpoint string `json:"endpoint"`
}

APIShieldDiscoveryOperation is an operation that was discovered by API Discovery.

type APIShieldDiscoveryOrigin added in v0.79.0

type APIShieldDiscoveryOrigin string

APIShieldDiscoveryOrigin is an enumeration on what discovery engine an operation was discovered by.

const (

	// APIShieldDiscoveryOriginML discovered operations that were sourced using ML API Discovery.
	APIShieldDiscoveryOriginML APIShieldDiscoveryOrigin = "ML"
	// APIShieldDiscoveryOriginSessionIdentifier discovered operations that were sourced using Session Identifier
	// API Discovery.
	APIShieldDiscoveryOriginSessionIdentifier APIShieldDiscoveryOrigin = "SessionIdentifier"
)

type APIShieldDiscoveryState added in v0.79.0

type APIShieldDiscoveryState string

APIShieldDiscoveryState is an enumeration on states a discovery operation can be in.

const (
	// APIShieldDiscoveryStateReview discovered operations that are not saved into API Shield Endpoint Management.
	APIShieldDiscoveryStateReview APIShieldDiscoveryState = "review"
	// APIShieldDiscoveryStateSaved discovered operations that are already saved into API Shield Endpoint Management.
	APIShieldDiscoveryStateSaved APIShieldDiscoveryState = "saved"
	// APIShieldDiscoveryStateIgnored discovered operations that have been marked as ignored.
	APIShieldDiscoveryStateIgnored APIShieldDiscoveryState = "ignored"
)

type APIShieldGetOperationResponse added in v0.78.0

type APIShieldGetOperationResponse struct {
	Result APIShieldOperation `json:"result"`
	Response
}

APIShieldGetOperationResponse represents the response from the api_gateway/operations/{id} endpoint.

type APIShieldGetOperationsResponse added in v0.78.0

type APIShieldGetOperationsResponse struct {
	Result     []APIShieldOperation `json:"result"`
	ResultInfo `json:"result_info"`
	Response
}

APIShieldGetOperationsResponse represents the response from the api_gateway/operations endpoint.

type APIShieldGetSchemaResponse added in v0.79.0

type APIShieldGetSchemaResponse struct {
	Result APIShieldSchema `json:"result"`
	Response
}

APIShieldGetSchemaResponse represents the response from the GET api_gateway/user_schemas/{id} endpoint.

type APIShieldListDiscoveryOperationsResponse added in v0.79.0

type APIShieldListDiscoveryOperationsResponse struct {
	Result     []APIShieldDiscoveryOperation `json:"result"`
	ResultInfo `json:"result_info"`
	Response
}

APIShieldListDiscoveryOperationsResponse represents the response from the api_gateway/discovery/operations endpoint.

type APIShieldListOperationsFilters added in v0.78.0

type APIShieldListOperationsFilters struct {
	// Hosts filters results to only include the specified hosts.
	Hosts []string `url:"host,omitempty"`
	// Methods filters results to only include the specified methods.
	Methods []string `url:"method,omitempty"`
	// Endpoint filter results to only include endpoints containing this pattern.
	Endpoint string `url:"endpoint,omitempty"`
}

APIShieldListOperationsFilters represents the filtering query parameters to set when retrieving operations

API documentation: https://developers.cloudflare.com/api/operations/api-shield-endpoint-management-retrieve-information-about-all-operations-on-a-zone

type APIShieldListSchemasResponse added in v0.79.0

type APIShieldListSchemasResponse struct {
	Result     []APIShieldSchema `json:"result"`
	ResultInfo `json:"result_info"`
	Response
}

APIShieldListSchemasResponse represents the response from the GET api_gateway/user_schemas endpoint.

type APIShieldOperation added in v0.78.0

type APIShieldOperation struct {
	APIShieldBasicOperation
	ID          string         `json:"operation_id"`
	LastUpdated *time.Time     `json:"last_updated"`
	Features    map[string]any `json:"features,omitempty"`
}

APIShieldOperation represents an operation stored in API Shield Endpoint Management.

type APIShieldOperationSchemaValidationSettings added in v0.80.0

type APIShieldOperationSchemaValidationSettings struct {
	// MitigationAction is the mitigation to apply to the operation
	MitigationAction *string `json:"mitigation_action" url:"-"`
}

APIShieldOperationSchemaValidationSettings represents operation level schema validation settings for API Shield Schema Validation 2.0.

type APIShieldOperationSchemaValidationSettingsResponse added in v0.80.0

type APIShieldOperationSchemaValidationSettingsResponse struct {
	Result APIShieldOperationSchemaValidationSettings `json:"result"`
	Response
}

APIShieldOperationSchemaValidationSettingsResponse represents the response from the GET api_gateway/operation/{operationID}/schema_validation endpoint.

type APIShieldPatchDiscoveryOperationResponse added in v0.79.0

type APIShieldPatchDiscoveryOperationResponse struct {
	Result UpdateAPIShieldDiscoveryOperation `json:"result"`
	Response
}

APIShieldPatchDiscoveryOperationResponse represents the response from the PATCH api_gateway/discovery/operations/{id} endpoint.

type APIShieldPatchDiscoveryOperationsResponse added in v0.79.0

type APIShieldPatchDiscoveryOperationsResponse struct {
	Result UpdateAPIShieldDiscoveryOperationsParams `json:"result"`
	Response
}

APIShieldPatchDiscoveryOperationsResponse represents the response from the PATCH api_gateway/discovery/operations endpoint.

type APIShieldPatchSchemaResponse added in v0.79.0

type APIShieldPatchSchemaResponse struct {
	Result APIShieldSchema `json:"result"`
	Response
}

APIShieldPatchSchemaResponse represents the response from the PATCH api_gateway/user_schemas/{id} endpoint.

type APIShieldResponse added in v0.49.0

type APIShieldResponse struct {
	Result APIShield `json:"result"`
	Response
	ResultInfo `json:"result_info"`
}

APIShieldResponse represents the response from the api_gateway/configuration endpoint.

type APIShieldSchema added in v0.79.0

type APIShieldSchema struct {
	// ID represents the ID of the schema
	ID string `json:"schema_id"`
	// Name represents the name of the schema
	Name string `json:"name"`
	// Kind of the schema
	Kind string `json:"kind"`
	// Source is the contents of the schema
	Source string `json:"source,omitempty"`
	// CreatedAt is the time the schema was created
	CreatedAt *time.Time `json:"created_at,omitempty"`
	// ValidationEnabled controls if schema is used for validation
	ValidationEnabled bool `json:"validation_enabled,omitempty"`
}

APIShieldSchema represents a schema stored in API Shield Schema Validation 2.0.

type APIShieldSchemaValidationSettings added in v0.80.0

type APIShieldSchemaValidationSettings struct {
	// DefaultMitigationAction is the mitigation to apply when there is no operation-level
	// mitigation action defined
	DefaultMitigationAction string `json:"validation_default_mitigation_action" url:"-"`
	// OverrideMitigationAction when set, will apply to all requests regardless of
	// zone-level/operation-level setting
	OverrideMitigationAction *string `json:"validation_override_mitigation_action" url:"-"`
}

APIShieldSchemaValidationSettings represents zone level schema validation settings for API Shield Schema Validation 2.0.

type APIShieldSchemaValidationSettingsResponse added in v0.80.0

type APIShieldSchemaValidationSettingsResponse struct {
	Result APIShieldSchemaValidationSettings `json:"result"`
	Response
}

APIShieldSchemaValidationSettingsResponse represents the response from the GET api_gateway/settings/schema_validation endpoint.

type APIToken added in v0.13.5

type APIToken struct {
	ID         string             `json:"id,omitempty"`
	Name       string             `json:"name,omitempty"`
	Status     string             `json:"status,omitempty"`
	IssuedOn   *time.Time         `json:"issued_on,omitempty"`
	ModifiedOn *time.Time         `json:"modified_on,omitempty"`
	NotBefore  *time.Time         `json:"not_before,omitempty"`
	ExpiresOn  *time.Time         `json:"expires_on,omitempty"`
	Policies   []APITokenPolicies `json:"policies,omitempty"`
	Condition  *APITokenCondition `json:"condition,omitempty"`
	Value      string             `json:"value,omitempty"`
}

APIToken is the full API token.

type APITokenCondition added in v0.13.5

type APITokenCondition struct {
	RequestIP *APITokenRequestIPCondition `json:"request.ip,omitempty"`
}

APITokenCondition is the outer structure for request conditions (currently only IPs).

type APITokenListResponse added in v0.13.5

type APITokenListResponse struct {
	Response
	Result []APIToken `json:"result"`
}

APITokenListResponse is the API response for multiple API tokens.

type APITokenPermissionGroups added in v0.13.5

type APITokenPermissionGroups struct {
	ID     string   `json:"id"`
	Name   string   `json:"name,omitempty"`
	Scopes []string `json:"scopes,omitempty"`
}

APITokenPermissionGroups is the permission groups associated with API tokens.

type APITokenPermissionGroupsResponse added in v0.13.5

type APITokenPermissionGroupsResponse struct {
	Response
	Result []APITokenPermissionGroups `json:"result"`
}

APITokenPermissionGroupsResponse is the API response for the available permission groups.

type APITokenPolicies added in v0.13.5

type APITokenPolicies struct {
	ID               string                     `json:"id,omitempty"`
	Effect           string                     `json:"effect"`
	Resources        map[string]interface{}     `json:"resources"`
	PermissionGroups []APITokenPermissionGroups `json:"permission_groups"`
}

APITokenPolicies are policies attached to an API token.

type APITokenRequestIPCondition added in v0.13.5

type APITokenRequestIPCondition struct {
	In    []string `json:"in,omitempty"`
	NotIn []string `json:"not_in,omitempty"`
}

APITokenRequestIPCondition is the struct for adding an IP restriction to an API token.

type APITokenResponse added in v0.13.5

type APITokenResponse struct {
	Response
	Result APIToken `json:"result"`
}

APITokenResponse is the API response for a single API token.

type APITokenRollResponse added in v0.13.5

type APITokenRollResponse struct {
	Response
	Result string `json:"result"`
}

APITokenRollResponse is the API response when rolling the token.

type APITokenVerifyBody added in v0.13.5

type APITokenVerifyBody struct {
	ID        string    `json:"id"`
	Status    string    `json:"status"`
	NotBefore time.Time `json:"not_before"`
	ExpiresOn time.Time `json:"expires_on"`
}

APITokenVerifyBody is the API body for verifying a token.

type APITokenVerifyResponse added in v0.13.5

type APITokenVerifyResponse struct {
	Response
	Result APITokenVerifyBody `json:"result"`
}

APITokenVerifyResponse is the API response for verifying a token.

type ASNInfo added in v0.44.0

type ASNInfo struct {
	ASN         int      `json:"asn"`
	Description string   `json:"description"`
	Country     string   `json:"country"`
	Type        string   `json:"type"`
	DomainCount int      `json:"domain_count"`
	TopDomains  []string `json:"top_domains"`
}

ASNInfo represents ASN information.

type AccessAppLauncherCustomization added in v0.80.0

type AccessAppLauncherCustomization struct {
	LandingPageDesign     AccessLandingPageDesign `json:"landing_page_design"`
	LogoURL               string                  `json:"app_launcher_logo_url"`
	HeaderBackgroundColor string                  `json:"header_bg_color"`
	BackgroundColor       string                  `json:"bg_color"`
	FooterLinks           []AccessFooterLink      `json:"footer_links"`
}

type AccessApplication added in v0.9.0

type AccessApplication struct {
	GatewayRules             []AccessApplicationGatewayRule `json:"gateway_rules,omitempty"`
	AllowedIdps              []string                       `json:"allowed_idps,omitempty"`
	CustomDenyMessage        string                         `json:"custom_deny_message,omitempty"`
	LogoURL                  string                         `json:"logo_url,omitempty"`
	AUD                      string                         `json:"aud,omitempty"`
	Domain                   string                         `json:"domain"`
	SelfHostedDomains        []string                       `json:"self_hosted_domains"`
	Type                     AccessApplicationType          `json:"type,omitempty"`
	SessionDuration          string                         `json:"session_duration,omitempty"`
	SameSiteCookieAttribute  string                         `json:"same_site_cookie_attribute,omitempty"`
	CustomDenyURL            string                         `json:"custom_deny_url,omitempty"`
	CustomNonIdentityDenyURL string                         `json:"custom_non_identity_deny_url,omitempty"`
	Name                     string                         `json:"name"`
	ID                       string                         `json:"id,omitempty"`
	PrivateAddress           string                         `json:"private_address"`
	CorsHeaders              *AccessApplicationCorsHeaders  `json:"cors_headers,omitempty"`
	CreatedAt                *time.Time                     `json:"created_at,omitempty"`
	UpdatedAt                *time.Time                     `json:"updated_at,omitempty"`
	SaasApplication          *SaasApplication               `json:"saas_app,omitempty"`
	AutoRedirectToIdentity   *bool                          `json:"auto_redirect_to_identity,omitempty"`
	SkipInterstitial         *bool                          `json:"skip_interstitial,omitempty"`
	AppLauncherVisible       *bool                          `json:"app_launcher_visible,omitempty"`
	EnableBindingCookie      *bool                          `json:"enable_binding_cookie,omitempty"`
	HttpOnlyCookieAttribute  *bool                          `json:"http_only_cookie_attribute,omitempty"`
	ServiceAuth401Redirect   *bool                          `json:"service_auth_401_redirect,omitempty"`
	PathCookieAttribute      *bool                          `json:"path_cookie_attribute,omitempty"`
	AllowAuthenticateViaWarp *bool                          `json:"allow_authenticate_via_warp,omitempty"`
	CustomPages              []string                       `json:"custom_pages,omitempty"`
	Tags                     []string                       `json:"tags,omitempty"`
	AccessAppLauncherCustomization
}

AccessApplication represents an Access application.

type AccessApplicationCorsHeaders added in v0.12.1

type AccessApplicationCorsHeaders struct {
	AllowedMethods   []string `json:"allowed_methods,omitempty"`
	AllowedOrigins   []string `json:"allowed_origins,omitempty"`
	AllowedHeaders   []string `json:"allowed_headers,omitempty"`
	AllowAllMethods  bool     `json:"allow_all_methods,omitempty"`
	AllowAllHeaders  bool     `json:"allow_all_headers,omitempty"`
	AllowAllOrigins  bool     `json:"allow_all_origins,omitempty"`
	AllowCredentials bool     `json:"allow_credentials,omitempty"`
	MaxAge           int      `json:"max_age,omitempty"`
}

AccessApplicationCorsHeaders represents the CORS HTTP headers for an Access Application.

type AccessApplicationDetailResponse added in v0.9.0

type AccessApplicationDetailResponse struct {
	Success  bool              `json:"success"`
	Errors   []string          `json:"errors"`
	Messages []string          `json:"messages"`
	Result   AccessApplication `json:"result"`
}

AccessApplicationDetailResponse is the API response, containing a single access application.

type AccessApplicationGatewayRule added in v0.30.0

type AccessApplicationGatewayRule struct {
	ID string `json:"id,omitempty"`
}

type AccessApplicationListResponse added in v0.9.0

type AccessApplicationListResponse struct {
	Result []AccessApplication `json:"result"`
	Response
	ResultInfo `json:"result_info"`
}

AccessApplicationListResponse represents the response from the list access applications endpoint.

type AccessApplicationType added in v0.18.0

type AccessApplicationType string

AccessApplicationType represents the application type.

const (
	SelfHosted  AccessApplicationType = "self_hosted"
	SSH         AccessApplicationType = "ssh"
	VNC         AccessApplicationType = "vnc"
	Biso        AccessApplicationType = "biso"
	AppLauncher AccessApplicationType = "app_launcher"
	Warp        AccessApplicationType = "warp"
	Bookmark    AccessApplicationType = "bookmark"
	Saas        AccessApplicationType = "saas"
)

These constants represent all valid application types.

type AccessApprovalGroup added in v0.23.0

type AccessApprovalGroup struct {
	EmailListUuid   string   `json:"email_list_uuid,omitempty"`
	EmailAddresses  []string `json:"email_addresses,omitempty"`
	ApprovalsNeeded int      `json:"approvals_needed,omitempty"`
}

type AccessAuditLogFilterOptions added in v0.12.1

type AccessAuditLogFilterOptions struct {
	Direction string
	Since     *time.Time
	Until     *time.Time
	Limit     int
}

AccessAuditLogFilterOptions provides the structure of available audit log filters.

func (AccessAuditLogFilterOptions) Encode added in v0.12.1

Encode is a custom method for encoding the filter options into a usable HTTP query parameter string.

type AccessAuditLogListResponse added in v0.12.1

type AccessAuditLogListResponse struct {
	Result []AccessAuditLogRecord `json:"result"`
	Response
	ResultInfo `json:"result_info"`
}

AccessAuditLogListResponse represents the response from the list access applications endpoint.

type AccessAuditLogRecord added in v0.12.1

type AccessAuditLogRecord struct {
	UserEmail  string     `json:"user_email"`
	IPAddress  string     `json:"ip_address"`
	AppUID     string     `json:"app_uid"`
	AppDomain  string     `json:"app_domain"`
	Action     string     `json:"action"`
	Connection string     `json:"connection"`
	Allowed    bool       `json:"allowed"`
	CreatedAt  *time.Time `json:"created_at"`
	RayID      string     `json:"ray_id"`
}

AccessAuditLogRecord is the structure of a single Access Audit Log entry.

type AccessAuthContext added in v0.75.0

type AccessAuthContext struct {
	ID          string `json:"id"`
	UID         string `json:"uid"`
	ACID        string `json:"ac_id"`
	DisplayName string `json:"display_name"`
	Description string `json:"description"`
}

AccessAuthContext represents an Access Azure Identity Provider Auth Context.

type AccessAuthContextsListResponse added in v0.75.0

type AccessAuthContextsListResponse struct {
	Result []AccessAuthContext `json:"result"`
	Response
}

AccessAuthContextsListResponse represents the response from the list Access Auth Contexts endpoint.

type AccessBookmark added in v0.36.0

type AccessBookmark struct {
	ID                 string     `json:"id,omitempty"`
	Domain             string     `json:"domain"`
	Name               string     `json:"name"`
	LogoURL            string     `json:"logo_url,omitempty"`
	AppLauncherVisible *bool      `json:"app_launcher_visible,omitempty"`
	CreatedAt          *time.Time `json:"created_at,omitempty"`
	UpdatedAt          *time.Time `json:"updated_at,omitempty"`
}

AccessBookmark represents an Access bookmark application.

type AccessBookmarkDetailResponse added in v0.36.0

type AccessBookmarkDetailResponse struct {
	Response
	Result AccessBookmark `json:"result"`
}

AccessBookmarkDetailResponse is the API response, containing a single access bookmark.

type AccessBookmarkListResponse added in v0.36.0

type AccessBookmarkListResponse struct {
	Result []AccessBookmark `json:"result"`
	Response
	ResultInfo `json:"result_info"`
}

AccessBookmarkListResponse represents the response from the list access bookmarks endpoint.

type AccessCACertificate added in v0.12.1

type AccessCACertificate struct {
	ID        string `json:"id"`
	Aud       string `json:"aud"`
	PublicKey string `json:"public_key"`
}

AccessCACertificate is the structure of the CA certificate used for short-lived certificates.

type AccessCACertificateListResponse added in v0.12.1

type AccessCACertificateListResponse struct {
	Response
	Result []AccessCACertificate `json:"result"`
	ResultInfo
}

AccessCACertificateListResponse represents the response of all CA certificates within Access.

type AccessCACertificateResponse added in v0.12.1

type AccessCACertificateResponse struct {
	Response
	Result AccessCACertificate `json:"result"`
}

AccessCACertificateResponse represents the response of a single CA certificate.

type AccessConfig added in v0.68.0

type AccessConfig struct {
	// Required when set to true will fail every request that does not arrive
	// through an access authenticated endpoint.
	Required bool `yaml:"required" json:"required,omitempty"`
	// TeamName is the organization team name to get the public key certificates for.
	TeamName string `yaml:"teamName" json:"teamName"`
	// AudTag is the AudTag to verify access JWT against.
	AudTag []string `yaml:"audTag" json:"audTag"`
}

type AccessCustomPage added in v0.74.0

type AccessCustomPage struct {
	// The HTML content of the custom page.
	CustomHTML string               `json:"custom_html,omitempty"`
	Name       string               `json:"name,omitempty"`
	AppCount   int                  `json:"app_count,omitempty"`
	Type       AccessCustomPageType `json:"type,omitempty"`
	UID        string               `json:"uid,omitempty"`
}

type AccessCustomPageListResponse added in v0.74.0

type AccessCustomPageListResponse struct {
	Response
	Result     []AccessCustomPage `json:"result"`
	ResultInfo `json:"result_info"`
}

type AccessCustomPageResponse added in v0.74.0

type AccessCustomPageResponse struct {
	Response
	Result AccessCustomPage `json:"result"`
}

type AccessCustomPageType added in v0.74.0

type AccessCustomPageType string
const (
	Forbidden      AccessCustomPageType = "forbidden"
	IdentityDenied AccessCustomPageType = "identity_denied"
)
type AccessFooterLink struct {
	Name string `json:"name"`
	URL  string `json:"url"`
}

type AccessGroup added in v0.10.5

type AccessGroup struct {
	ID        string     `json:"id,omitempty"`
	CreatedAt *time.Time `json:"created_at"`
	UpdatedAt *time.Time `json:"updated_at"`
	Name      string     `json:"name"`

	// The include group works like an OR logical operator. The user must
	// satisfy one of the rules.
	Include []interface{} `json:"include"`

	// The exclude group works like a NOT logical operator. The user must
	// not satisfy all the rules in exclude.
	Exclude []interface{} `json:"exclude"`

	// The require group works like a AND logical operator. The user must
	// satisfy all the rules in require.
	Require []interface{} `json:"require"`
}

AccessGroup defines a group for allowing or disallowing access to one or more Access applications.

type AccessGroupAccessGroup added in v0.10.5

type AccessGroupAccessGroup struct {
	Group struct {
		ID string `json:"id"`
	} `json:"group"`
}

AccessGroupAccessGroup is used for managing access based on an access group.

type AccessGroupAnyValidServiceToken added in v0.11.2

type AccessGroupAnyValidServiceToken struct {
	AnyValidServiceToken struct{} `json:"any_valid_service_token"`
}

AccessGroupAnyValidServiceToken is used for managing access for all valid service tokens (not restricted).

type AccessGroupAuthMethod added in v0.13.1

type AccessGroupAuthMethod struct {
	AuthMethod struct {
		AuthMethod string `json:"auth_method"`
	} `json:"auth_method"`
}

AccessGroupAuthMethod is used for managing access by the "amr" (Authentication Methods References) identifier. For example, an application may want to require that users authenticate using a hardware key by setting the "auth_method" to "swk". A list of values are listed here: https://tools.ietf.org/html/rfc8176#section-2. Custom values are supported as well.

type AccessGroupAzure added in v0.11.5

type AccessGroupAzure struct {
	AzureAD struct {
		ID                 string `json:"id"`
		IdentityProviderID string `json:"identity_provider_id"`
	} `json:"azureAD"`
}

AccessGroupAzure is used to configure access based on a Azure group.

type AccessGroupAzureAuthContext added in v0.75.0

type AccessGroupAzureAuthContext struct {
	AuthContext struct {
		ID                 string `json:"id"`
		IdentityProviderID string `json:"identity_provider_id"`
		ACID               string `json:"ac_id"`
	} `json:"auth_context"`
}

AccessGroupAzureAuthContext is used to configure access based on Azure auth contexts.

type AccessGroupCertificate added in v0.11.5

type AccessGroupCertificate struct {
	Certificate struct{} `json:"certificate"`
}

AccessGroupCertificate is used for managing access to based on a valid mTLS certificate being presented.

type AccessGroupCertificateCommonName added in v0.11.5

type AccessGroupCertificateCommonName struct {
	CommonName struct {
		CommonName string `json:"common_name"`
	} `json:"common_name"`
}

AccessGroupCertificateCommonName is used for managing access based on a common name within a certificate.

type AccessGroupDetailResponse added in v0.10.5

type AccessGroupDetailResponse struct {
	Success  bool        `json:"success"`
	Errors   []string    `json:"errors"`
	Messages []string    `json:"messages"`
	Result   AccessGroup `json:"result"`
}

AccessGroupDetailResponse is the API response, containing a single access group.

type AccessGroupDevicePosture added in v0.17.0

type AccessGroupDevicePosture struct {
	DevicePosture struct {
		ID string `json:"integration_uid"`
	} `json:"device_posture"`
}

AccessGroupDevicePosture restricts the application to specific devices.

type AccessGroupEmail added in v0.10.5

type AccessGroupEmail struct {
	Email struct {
		Email string `json:"email"`
	} `json:"email"`
}

AccessGroupEmail is used for managing access based on the email. For example, restrict access to users with the email addresses `test@example.com` or `someone@example.com`.

type AccessGroupEmailDomain added in v0.10.5

type AccessGroupEmailDomain struct {
	EmailDomain struct {
		Domain string `json:"domain"`
	} `json:"email_domain"`
}

AccessGroupEmailDomain is used for managing access based on an email domain such as `example.com` instead of individual addresses.

type AccessGroupEmailList added in v0.84.0

type AccessGroupEmailList struct {
	EmailList struct {
		ID string `json:"id"`
	} `json:"email_list"`
}

AccessGroupEmailList is used for managing access based on the email list. For example, restrict access to users with the email addresses in the email list with the ID `1234567890abcdef1234567890abcdef`.

type AccessGroupEveryone added in v0.10.5

type AccessGroupEveryone struct {
	Everyone struct{} `json:"everyone"`
}

AccessGroupEveryone is used for managing access to everyone.

type AccessGroupExternalEvaluation added in v0.40.0

type AccessGroupExternalEvaluation struct {
	ExternalEvaluation struct {
		EvaluateURL string `json:"evaluate_url"`
		KeysURL     string `json:"keys_url"`
	} `json:"external_evaluation"`
}

AccessGroupExternalEvaluation is used for passing user identity to an external url.

type AccessGroupGSuite added in v0.11.5

type AccessGroupGSuite struct {
	Gsuite struct {
		Email              string `json:"email"`
		IdentityProviderID string `json:"identity_provider_id"`
	} `json:"gsuite"`
}

AccessGroupGSuite is used to configure access based on GSuite group.

type AccessGroupGeo added in v0.13.3

type AccessGroupGeo struct {
	Geo struct {
		CountryCode string `json:"country_code"`
	} `json:"geo"`
}

AccessGroupGeo is used for managing access based on the country code.

type AccessGroupGitHub added in v0.11.5

type AccessGroupGitHub struct {
	GitHubOrganization struct {
		Name               string `json:"name"`
		Team               string `json:"team,omitempty"`
		IdentityProviderID string `json:"identity_provider_id"`
	} `json:"github-organization"`
}

AccessGroupGitHub is used to configure access based on a GitHub organisation.

type AccessGroupIP added in v0.10.5

type AccessGroupIP struct {
	IP struct {
		IP string `json:"ip"`
	} `json:"ip"`
}

AccessGroupIP is used for managing access based in the IP. It accepts individual IPs or CIDRs.

type AccessGroupIPList added in v0.44.0

type AccessGroupIPList struct {
	IPList struct {
		ID string `json:"id"`
	} `json:"ip_list"`
}

AccessGroupIPList restricts the application to specific teams_list of ips.

type AccessGroupListResponse added in v0.10.5

type AccessGroupListResponse struct {
	Result []AccessGroup `json:"result"`
	Response
	ResultInfo `json:"result_info"`
}

AccessGroupListResponse represents the response from the list access group endpoint.

type AccessGroupLoginMethod added in v0.16.0

type AccessGroupLoginMethod struct {
	LoginMethod struct {
		ID string `json:"id"`
	} `json:"login_method"`
}

AccessGroupLoginMethod restricts the application to specific IdP instances.

type AccessGroupOkta added in v0.11.5

type AccessGroupOkta struct {
	Okta struct {
		Name               string `json:"name"`
		IdentityProviderID string `json:"identity_provider_id"`
	} `json:"okta"`
}

AccessGroupOkta is used to configure access based on a Okta group.

type AccessGroupSAML added in v0.11.5

type AccessGroupSAML struct {
	Saml struct {
		AttributeName      string `json:"attribute_name"`
		AttributeValue     string `json:"attribute_value"`
		IdentityProviderID string `json:"identity_provider_id"`
	} `json:"saml"`
}

AccessGroupSAML is used to allow SAML users with a specific attribute configuration.

type AccessGroupServiceToken added in v0.11.2

type AccessGroupServiceToken struct {
	ServiceToken struct {
		ID string `json:"token_id"`
	} `json:"service_token"`
}

AccessGroupServiceToken is used for managing access based on a specific service token.

type AccessIdentityProvider added in v0.10.1

type AccessIdentityProvider struct {
	ID         string                                  `json:"id,omitempty"`
	Name       string                                  `json:"name"`
	Type       string                                  `json:"type"`
	Config     AccessIdentityProviderConfiguration     `json:"config"`
	ScimConfig AccessIdentityProviderScimConfiguration `json:"scim_config"`
}

AccessIdentityProvider is the structure of the provider object.

type AccessIdentityProviderConfiguration added in v0.11.2

type AccessIdentityProviderConfiguration struct {
	APIToken                  string   `json:"api_token,omitempty"`
	AppsDomain                string   `json:"apps_domain,omitempty"`
	Attributes                []string `json:"attributes,omitempty"`
	AuthURL                   string   `json:"auth_url,omitempty"`
	CentrifyAccount           string   `json:"centrify_account,omitempty"`
	CentrifyAppID             string   `json:"centrify_app_id,omitempty"`
	CertsURL                  string   `json:"certs_url,omitempty"`
	ClientID                  string   `json:"client_id,omitempty"`
	ClientSecret              string   `json:"client_secret,omitempty"`
	Claims                    []string `json:"claims,omitempty"`
	Scopes                    []string `json:"scopes,omitempty"`
	DirectoryID               string   `json:"directory_id,omitempty"`
	EmailAttributeName        string   `json:"email_attribute_name,omitempty"`
	EmailClaimName            string   `json:"email_claim_name,omitempty"`
	IdpPublicCert             string   `json:"idp_public_cert,omitempty"`
	IssuerURL                 string   `json:"issuer_url,omitempty"`
	OktaAccount               string   `json:"okta_account,omitempty"`
	OktaAuthorizationServerID string   `json:"authorization_server_id,omitempty"`
	OneloginAccount           string   `json:"onelogin_account,omitempty"`
	PingEnvID                 string   `json:"ping_env_id,omitempty"`
	RedirectURL               string   `json:"redirect_url,omitempty"`
	SignRequest               bool     `json:"sign_request,omitempty"`
	SsoTargetURL              string   `json:"sso_target_url,omitempty"`
	SupportGroups             bool     `json:"support_groups,omitempty"`
	TokenURL                  string   `json:"token_url,omitempty"`
	PKCEEnabled               *bool    `json:"pkce_enabled,omitempty"`
	ConditionalAccessEnabled  bool     `json:"conditional_access_enabled,omitempty"`
}

AccessIdentityProviderConfiguration is the combined structure of *all* identity provider configuration fields. This is done to simplify the use of Access products and their relationship to each other.

API reference: https://developers.cloudflare.com/access/configuring-identity-providers/

type AccessIdentityProviderResponse added in v0.71.0

type AccessIdentityProviderResponse struct {
	Response
	Result AccessIdentityProvider `json:"result"`
}

AccessIdentityProviderResponse is the API response for a single Access Identity Provider.

type AccessIdentityProviderScimConfiguration added in v0.64.0

type AccessIdentityProviderScimConfiguration struct {
	Enabled                bool   `json:"enabled,omitempty"`
	Secret                 string `json:"secret,omitempty"`
	UserDeprovision        bool   `json:"user_deprovision,omitempty"`
	SeatDeprovision        bool   `json:"seat_deprovision,omitempty"`
	GroupMemberDeprovision bool   `json:"group_member_deprovision,omitempty"`
}

type AccessIdentityProvidersListResponse added in v0.10.1

type AccessIdentityProvidersListResponse struct {
	Response
	Result     []AccessIdentityProvider `json:"result"`
	ResultInfo `json:"result_info"`
}

AccessIdentityProvidersListResponse is the API response for multiple Access Identity Providers.

type AccessKeysConfig added in v0.23.0

type AccessKeysConfig struct {
	KeyRotationIntervalDays int       `json:"key_rotation_interval_days"`
	LastKeyRotationAt       time.Time `json:"last_key_rotation_at"`
	DaysUntilNextRotation   int       `json:"days_until_next_rotation"`
}

type AccessKeysConfigUpdateRequest added in v0.23.0

type AccessKeysConfigUpdateRequest struct {
	KeyRotationIntervalDays int `json:"key_rotation_interval_days"`
}

type AccessLandingPageDesign added in v0.80.0

type AccessLandingPageDesign struct {
	Title           string `json:"title"`
	Message         string `json:"message"`
	ImageURL        string `json:"image_url"`
	ButtonColor     string `json:"button_color"`
	ButtonTextColor string `json:"button_text_color"`
}

type AccessMutualTLSCertificate added in v0.13.8

type AccessMutualTLSCertificate struct {
	ID                  string    `json:"id,omitempty"`
	CreatedAt           time.Time `json:"created_at,omitempty"`
	UpdatedAt           time.Time `json:"updated_at,omitempty"`
	ExpiresOn           time.Time `json:"expires_on,omitempty"`
	Name                string    `json:"name,omitempty"`
	Fingerprint         string    `json:"fingerprint,omitempty"`
	Certificate         string    `json:"certificate,omitempty"`
	AssociatedHostnames []string  `json:"associated_hostnames,omitempty"`
}

AccessMutualTLSCertificate is the structure of a single Access Mutual TLS certificate.

type AccessMutualTLSCertificateDetailResponse added in v0.13.8

type AccessMutualTLSCertificateDetailResponse struct {
	Response
	Result AccessMutualTLSCertificate `json:"result"`
}

AccessMutualTLSCertificateDetailResponse is the API response for a single Access Mutual TLS certificate.

type AccessMutualTLSCertificateListResponse added in v0.13.8

type AccessMutualTLSCertificateListResponse struct {
	Response
	Result     []AccessMutualTLSCertificate `json:"result"`
	ResultInfo `json:"result_info"`
}

AccessMutualTLSCertificateListResponse is the API response for all Access Mutual TLS certificates.

type AccessMutualTLSHostnameSettings added in v0.90.0

type AccessMutualTLSHostnameSettings struct {
	ChinaNetwork                *bool  `json:"china_network,omitempty"`
	ClientCertificateForwarding *bool  `json:"client_certificate_forwarding,omitempty"`
	Hostname                    string `json:"hostname,omitempty"`
}

type AccessOrganization added in v0.10.1

type AccessOrganization struct {
	CreatedAt                      *time.Time                    `json:"created_at"`
	UpdatedAt                      *time.Time                    `json:"updated_at"`
	Name                           string                        `json:"name"`
	AuthDomain                     string                        `json:"auth_domain"`
	LoginDesign                    AccessOrganizationLoginDesign `json:"login_design"`
	IsUIReadOnly                   *bool                         `json:"is_ui_read_only,omitempty"`
	UIReadOnlyToggleReason         string                        `json:"ui_read_only_toggle_reason,omitempty"`
	UserSeatExpirationInactiveTime string                        `json:"user_seat_expiration_inactive_time,omitempty"`
	AutoRedirectToIdentity         *bool                         `json:"auto_redirect_to_identity,omitempty"`
	SessionDuration                *string                       `json:"session_duration,omitempty"`
	CustomPages                    AccessOrganizationCustomPages `json:"custom_pages,omitempty"`
	WarpAuthSessionDuration        *string                       `json:"warp_auth_session_duration,omitempty"`
	AllowAuthenticateViaWarp       *bool                         `json:"allow_authenticate_via_warp,omitempty"`
}

AccessOrganization represents an Access organization.

type AccessOrganizationCustomPages added in v0.74.0

type AccessOrganizationCustomPages struct {
	Forbidden      AccessCustomPageType `json:"forbidden,omitempty"`
	IdentityDenied AccessCustomPageType `json:"identity_denied,omitempty"`
}

type AccessOrganizationDetailResponse added in v0.10.1

type AccessOrganizationDetailResponse struct {
	Success  bool               `json:"success"`
	Errors   []string           `json:"errors"`
	Messages []string           `json:"messages"`
	Result   AccessOrganization `json:"result"`
}

AccessOrganizationDetailResponse is the API response, containing a single access organization.

type AccessOrganizationListResponse added in v0.10.1

type AccessOrganizationListResponse struct {
	Result AccessOrganization `json:"result"`
	Response
	ResultInfo `json:"result_info"`
}

AccessOrganizationListResponse represents the response from the list access organization endpoint.

type AccessOrganizationLoginDesign added in v0.10.1

type AccessOrganizationLoginDesign struct {
	BackgroundColor string `json:"background_color"`
	LogoPath        string `json:"logo_path"`
	TextColor       string `json:"text_color"`
	HeaderText      string `json:"header_text"`
	FooterText      string `json:"footer_text"`
}

AccessOrganizationLoginDesign represents the login design options.

type AccessPolicy added in v0.9.0

type AccessPolicy struct {
	ID         string     `json:"id,omitempty"`
	Precedence int        `json:"precedence"`
	Decision   string     `json:"decision"`
	CreatedAt  *time.Time `json:"created_at"`
	UpdatedAt  *time.Time `json:"updated_at"`
	Name       string     `json:"name"`

	IsolationRequired            *bool                 `json:"isolation_required,omitempty"`
	SessionDuration              *string               `json:"session_duration,omitempty"`
	PurposeJustificationRequired *bool                 `json:"purpose_justification_required,omitempty"`
	PurposeJustificationPrompt   *string               `json:"purpose_justification_prompt,omitempty"`
	ApprovalRequired             *bool                 `json:"approval_required,omitempty"`
	ApprovalGroups               []AccessApprovalGroup `json:"approval_groups"`

	// The include policy works like an OR logical operator. The user must
	// satisfy one of the rules.
	Include []interface{} `json:"include"`

	// The exclude policy works like a NOT logical operator. The user must
	// not satisfy all the rules in exclude.
	Exclude []interface{} `json:"exclude"`

	// The require policy works like a AND logical operator. The user must
	// satisfy all the rules in require.
	Require []interface{} `json:"require"`
}

AccessPolicy defines a policy for allowing or disallowing access to one or more Access applications.

type AccessPolicyDetailResponse added in v0.9.0

type AccessPolicyDetailResponse struct {
	Success  bool         `json:"success"`
	Errors   []string     `json:"errors"`
	Messages []string     `json:"messages"`
	Result   AccessPolicy `json:"result"`
}

AccessPolicyDetailResponse is the API response, containing a single access policy.

type AccessPolicyListResponse added in v0.9.0

type AccessPolicyListResponse struct {
	Result []AccessPolicy `json:"result"`
	Response
	ResultInfo `json:"result_info"`
}

AccessPolicyListResponse represents the response from the list access policies endpoint.

type AccessRule added in v0.8.1

type AccessRule struct {
	ID            string                  `json:"id,omitempty"`
	Notes         string                  `json:"notes,omitempty"`
	AllowedModes  []string                `json:"allowed_modes,omitempty"`
	Mode          string                  `json:"mode,omitempty"`
	Configuration AccessRuleConfiguration `json:"configuration,omitempty"`
	Scope         AccessRuleScope         `json:"scope,omitempty"`
	CreatedOn     time.Time               `json:"created_on,omitempty"`
	ModifiedOn    time.Time               `json:"modified_on,omitempty"`
}

AccessRule represents a firewall access rule.

type AccessRuleConfiguration added in v0.8.1

type AccessRuleConfiguration struct {
	Target string `json:"target,omitempty"`
	Value  string `json:"value,omitempty"`
}

AccessRuleConfiguration represents the configuration of a firewall access rule.

type AccessRuleListResponse added in v0.8.1

type AccessRuleListResponse struct {
	Result []AccessRule `json:"result"`
	Response
	ResultInfo `json:"result_info"`
}

AccessRuleListResponse represents the response from the list access rules endpoint.

type AccessRuleResponse added in v0.8.1

type AccessRuleResponse struct {
	Result AccessRule `json:"result"`
	Response
	ResultInfo `json:"result_info"`
}

AccessRuleResponse represents the response from the firewall access rule endpoint.

type AccessRuleScope added in v0.8.1

type AccessRuleScope struct {
	ID    string `json:"id,omitempty"`
	Email string `json:"email,omitempty"`
	Name  string `json:"name,omitempty"`
	Type  string `json:"type,omitempty"`
}

AccessRuleScope represents the scope of a firewall access rule.

type AccessServiceToken added in v0.10.1

type AccessServiceToken struct {
	ClientID  string     `json:"client_id"`
	CreatedAt *time.Time `json:"created_at"`
	ExpiresAt *time.Time `json:"expires_at"`
	ID        string     `json:"id"`
	Name      string     `json:"name"`
	UpdatedAt *time.Time `json:"updated_at"`
	Duration  string     `json:"duration,omitempty"`
}

AccessServiceToken represents an Access Service Token.

type AccessServiceTokenCreateResponse added in v0.10.1

type AccessServiceTokenCreateResponse struct {
	CreatedAt    *time.Time `json:"created_at"`
	UpdatedAt    *time.Time `json:"updated_at"`
	ExpiresAt    *time.Time `json:"expires_at"`
	ID           string     `json:"id"`
	Name         string     `json:"name"`
	ClientID     string     `json:"client_id"`
	ClientSecret string     `json:"client_secret"`
	Duration     string     `json:"duration,omitempty"`
}

AccessServiceTokenCreateResponse is the same API response as the Update operation with the exception that the `ClientSecret` is present in a Create operation.

type AccessServiceTokenRefreshResponse added in v0.49.0

type AccessServiceTokenRefreshResponse struct {
	CreatedAt *time.Time `json:"created_at"`
	UpdatedAt *time.Time `json:"updated_at"`
	ExpiresAt *time.Time `json:"expires_at"`
	ID        string     `json:"id"`
	Name      string     `json:"name"`
	ClientID  string     `json:"client_id"`
	Duration  string     `json:"duration,omitempty"`
}

AccessServiceTokenRefreshResponse represents the response from the API when an existing service token is refreshed to last longer.

type AccessServiceTokenRotateResponse added in v0.54.0

type AccessServiceTokenRotateResponse struct {
	CreatedAt    *time.Time `json:"created_at"`
	UpdatedAt    *time.Time `json:"updated_at"`
	ExpiresAt    *time.Time `json:"expires_at"`
	ID           string     `json:"id"`
	Name         string     `json:"name"`
	ClientID     string     `json:"client_id"`
	ClientSecret string     `json:"client_secret"`
	Duration     string     `json:"duration,omitempty"`
}

AccessServiceTokenRotateResponse is the same API response as the Create operation.

type AccessServiceTokenUpdateResponse added in v0.10.1

type AccessServiceTokenUpdateResponse struct {
	CreatedAt *time.Time `json:"created_at"`
	UpdatedAt *time.Time `json:"updated_at"`
	ExpiresAt *time.Time `json:"expires_at"`
	ID        string     `json:"id"`
	Name      string     `json:"name"`
	ClientID  string     `json:"client_id"`
	Duration  string     `json:"duration,omitempty"`
}

AccessServiceTokenUpdateResponse represents the response from the API when a new Service Token is updated. This base struct is also used in the Create as they are very similar responses.

type AccessServiceTokensCreationDetailResponse added in v0.10.1

type AccessServiceTokensCreationDetailResponse struct {
	Success  bool                             `json:"success"`
	Errors   []string                         `json:"errors"`
	Messages []string                         `json:"messages"`
	Result   AccessServiceTokenCreateResponse `json:"result"`
}

AccessServiceTokensCreationDetailResponse is the API response, containing a single Access Service Token.

type AccessServiceTokensDetailResponse added in v0.10.1

type AccessServiceTokensDetailResponse struct {
	Success  bool               `json:"success"`
	Errors   []string           `json:"errors"`
	Messages []string           `json:"messages"`
	Result   AccessServiceToken `json:"result"`
}

AccessServiceTokensDetailResponse is the API response, containing a single Access Service Token.

type AccessServiceTokensListResponse added in v0.10.1

type AccessServiceTokensListResponse struct {
	Result []AccessServiceToken `json:"result"`
	Response
	ResultInfo `json:"result_info"`
}

AccessServiceTokensListResponse represents the response from the list Access Service Tokens endpoint.

type AccessServiceTokensRefreshDetailResponse added in v0.49.0

type AccessServiceTokensRefreshDetailResponse struct {
	Success  bool                              `json:"success"`
	Errors   []string                          `json:"errors"`
	Messages []string                          `json:"messages"`
	Result   AccessServiceTokenRefreshResponse `json:"result"`
}

AccessServiceTokensRefreshDetailResponse is the API response, containing a single Access Service Token.

type AccessServiceTokensRotateSecretDetailResponse added in v0.54.0

type AccessServiceTokensRotateSecretDetailResponse struct {
	Success  bool                             `json:"success"`
	Errors   []string                         `json:"errors"`
	Messages []string                         `json:"messages"`
	Result   AccessServiceTokenRotateResponse `json:"result"`
}

AccessServiceTokensRotateSecretDetailResponse is the API response, containing a single Access Service Token.

type AccessServiceTokensUpdateDetailResponse added in v0.10.1

type AccessServiceTokensUpdateDetailResponse struct {
	Success  bool                             `json:"success"`
	Errors   []string                         `json:"errors"`
	Messages []string                         `json:"messages"`
	Result   AccessServiceTokenUpdateResponse `json:"result"`
}

AccessServiceTokensUpdateDetailResponse is the API response, containing a single Access Service Token.

type AccessTag added in v0.78.0

type AccessTag struct {
	Name     string `json:"name,omitempty"`
	AppCount int    `json:"app_count,omitempty"`
}

type AccessTagListResponse added in v0.78.0

type AccessTagListResponse struct {
	Response
	Result     []AccessTag `json:"result"`
	ResultInfo `json:"result_info"`
}

type AccessTagResponse added in v0.78.0

type AccessTagResponse struct {
	Response
	Result AccessTag `json:"result"`
}

type AccessUpdateAccessUserSeatResult added in v0.81.0

type AccessUpdateAccessUserSeatResult struct {
	AccessSeat  *bool      `json:"access_seat"`
	CreatedAt   *time.Time `json:"created_at"`
	UpdatedAt   *time.Time `json:"updated_at"`
	GatewaySeat *bool      `json:"gateway_seat"`
	SeatUID     string     `json:"seat_uid,omitempty"`
}

AccessUpdateAccessUserSeatResult represents a Access User Seat.

type AccessUser added in v0.81.0

type AccessUser struct {
	ID                  string `json:"id"`
	AccessSeat          *bool  `json:"access_seat"`
	ActiveDeviceCount   int    `json:"active_device_count"`
	CreatedAt           string `json:"created_at"`
	Email               string `json:"email"`
	GatewaySeat         *bool  `json:"gateway_seat"`
	LastSuccessfulLogin string `json:"last_successful_login"`
	Name                string `json:"name"`
	SeatUID             string `json:"seat_uid"`
	UID                 string `json:"uid"`
	UpdatedAt           string `json:"updated_at"`
}

type AccessUserActiveSessionMetadata added in v0.81.0

type AccessUserActiveSessionMetadata struct {
	Apps    map[string]AccessUserActiveSessionMetadataApp `json:"apps"`
	Expires int64                                         `json:"expires"`
	IAT     int64                                         `json:"iat"`
	Nonce   string                                        `json:"nonce"`
	TTL     int64                                         `json:"ttl"`
}

type AccessUserActiveSessionMetadataApp added in v0.81.0

type AccessUserActiveSessionMetadataApp struct {
	Hostname string `json:"hostname"`
	Name     string `json:"name"`
	Type     string `json:"type"`
	UID      string `json:"uid"`
}

type AccessUserActiveSessionResult added in v0.81.0

type AccessUserActiveSessionResult struct {
	Expiration int64                           `json:"expiration"`
	Metadata   AccessUserActiveSessionMetadata `json:"metadata"`
	Name       string                          `json:"name"`
}

type AccessUserActiveSessionsResponse added in v0.81.0

type AccessUserActiveSessionsResponse struct {
	Result     []AccessUserActiveSessionResult `json:"result"`
	ResultInfo `json:"result_info"`
	Response
}

type AccessUserDevicePosture added in v0.81.0

type AccessUserDevicePosture struct {
	Check       AccessUserDevicePostureCheck `json:"check"`
	Data        map[string]interface{}       `json:"data"`
	Description string                       `json:"description"`
	Error       string                       `json:"error"`
	ID          string                       `json:"id"`
	RuleName    string                       `json:"rule_name"`
	Success     *bool                        `json:"success"`
	Timestamp   string                       `json:"timestamp"`
	Type        string                       `json:"type"`
}

type AccessUserDevicePostureCheck added in v0.81.0

type AccessUserDevicePostureCheck struct {
	Exists *bool  `json:"exists"`
	Path   string `json:"path"`
}

type AccessUserDeviceSession added in v0.81.0

type AccessUserDeviceSession struct {
	LastAuthenticated int64 `json:"last_authenticated"`
}

type AccessUserFailedLoginMetadata added in v0.81.0

type AccessUserFailedLoginMetadata struct {
	AppName   string `json:"app_name"`
	Aud       string `json:"aud"`
	Datetime  string `json:"datetime"`
	RayID     string `json:"ray_id"`
	UserEmail string `json:"user_email"`
	UserUUID  string `json:"user_uuid"`
}

type AccessUserFailedLoginResult added in v0.81.0

type AccessUserFailedLoginResult struct {
	Expiration int64                         `json:"expiration"`
	Metadata   AccessUserFailedLoginMetadata `json:"metadata"`
}

type AccessUserFailedLoginsResponse added in v0.81.0

type AccessUserFailedLoginsResponse struct {
	Result     []AccessUserFailedLoginResult `json:"result"`
	ResultInfo `json:"result_info"`
	Response
}

type AccessUserIDP added in v0.81.0

type AccessUserIDP struct {
	ID   string `json:"id"`
	Type string `json:"type"`
}

type AccessUserIdentityGeo added in v0.81.0

type AccessUserIdentityGeo struct {
	Country string `json:"country"`
}

type AccessUserLastSeenIdentityResponse added in v0.81.0

type AccessUserLastSeenIdentityResponse struct {
	Result     AccessUserLastSeenIdentityResult `json:"result"`
	ResultInfo ResultInfo                       `json:"result_info"`
	Response
}

type AccessUserLastSeenIdentityResult added in v0.81.0

type AccessUserLastSeenIdentityResult struct {
	AccountID          string                             `json:"account_id"`
	AuthStatus         string                             `json:"auth_status"`
	CommonName         string                             `json:"common_name"`
	DeviceID           string                             `json:"device_id"`
	DevicePosture      map[string]AccessUserDevicePosture `json:"devicePosture"`
	DeviceSessions     map[string]AccessUserDeviceSession `json:"device_sessions"`
	Email              string                             `json:"email"`
	Geo                AccessUserIdentityGeo              `json:"geo"`
	IAT                int64                              `json:"iat"`
	IDP                AccessUserIDP                      `json:"idp"`
	IP                 string                             `json:"ip"`
	IsGateway          *bool                              `json:"is_gateway"`
	IsWarp             *bool                              `json:"is_warp"`
	MtlsAuth           AccessUserMTLSAuth                 `json:"mtls_auth"`
	ServiceTokenID     string                             `json:"service_token_id"`
	ServiceTokenStatus *bool                              `json:"service_token_status"`
	UserUUID           string                             `json:"user_uuid"`
	Version            int                                `json:"version"`
}

type AccessUserLastSeenIdentitySessionResponse added in v0.81.0

type AccessUserLastSeenIdentitySessionResponse struct {
	Result     GetAccessUserLastSeenIdentityResult `json:"result"`
	ResultInfo ResultInfo                          `json:"result_info"`
	Response
}

type AccessUserListResponse added in v0.81.0

type AccessUserListResponse struct {
	Result     []AccessUser `json:"result"`
	ResultInfo `json:"result_info"`
	Response
}

type AccessUserMTLSAuth added in v0.81.0

type AccessUserMTLSAuth struct {
	AuthStatus    string `json:"auth_status"`
	CertIssuerDN  string `json:"cert_issuer_dn"`
	CertIssuerSKI string `json:"cert_issuer_ski"`
	CertPresented *bool  `json:"cert_presented"`
	CertSerial    string `json:"cert_serial"`
}

type AccessUserParams added in v0.81.0

type AccessUserParams struct {
	ResultInfo
}

type Account

type Account struct {
	ID        string           `json:"id,omitempty"`
	Name      string           `json:"name,omitempty"`
	Type      string           `json:"type,omitempty"`
	CreatedOn time.Time        `json:"created_on,omitempty"`
	Settings  *AccountSettings `json:"settings,omitempty"`
}

Account represents the root object that owns resources.

type AccountDetailResponse added in v0.9.0

type AccountDetailResponse struct {
	Success  bool     `json:"success"`
	Errors   []string `json:"errors"`
	Messages []string `json:"messages"`
	Result   Account  `json:"result"`
}

AccountDetailResponse is the API response, containing a single Account.

type AccountListResponse

type AccountListResponse struct {
	Result []Account `json:"result"`
	Response
	ResultInfo `json:"result_info"`
}

AccountListResponse represents the response from the list accounts endpoint.

type AccountMember

type AccountMember struct {
	ID       string                   `json:"id"`
	Code     string                   `json:"code"`
	User     AccountMemberUserDetails `json:"user"`
	Status   string                   `json:"status"`
	Roles    []AccountRole            `json:"roles,omitempty"`
	Policies []Policy                 `json:"policies,omitempty"`
}

AccountMember is the definition of a member of an account.

type AccountMemberDetailResponse added in v0.9.0

type AccountMemberDetailResponse struct {
	Success  bool          `json:"success"`
	Errors   []string      `json:"errors"`
	Messages []string      `json:"messages"`
	Result   AccountMember `json:"result"`
}

AccountMemberDetailResponse is the API response, containing a single account member.

type AccountMemberInvitation added in v0.9.0

type AccountMemberInvitation struct {
	Email    string   `json:"email"`
	Roles    []string `json:"roles,omitempty"`
	Policies []Policy `json:"policies,omitempty"`
	Status   string   `json:"status,omitempty"`
}

AccountMemberInvitation represents the invitation for a new member to the account.

type AccountMemberUserDetails added in v0.9.0

type AccountMemberUserDetails struct {
	ID                             string `json:"id"`
	FirstName                      string `json:"first_name"`
	LastName                       string `json:"last_name"`
	Email                          string `json:"email"`
	TwoFactorAuthenticationEnabled bool   `json:"two_factor_authentication_enabled"`
}

AccountMemberUserDetails outlines all the personal information about a member.

type AccountMembersListResponse added in v0.9.0

type AccountMembersListResponse struct {
	Result []AccountMember `json:"result"`
	Response
	ResultInfo `json:"result_info"`
}

AccountMembersListResponse represents the response from the list account members endpoint.

type AccountResponse added in v0.9.0

type AccountResponse struct {
	Result Account `json:"result"`
	Response
	ResultInfo `json:"result_info"`
}

AccountResponse represents the response from the accounts endpoint for a single account ID.

type AccountRole added in v0.9.0

type AccountRole struct {
	ID          string                           `json:"id"`
	Name        string                           `json:"name"`
	Description string                           `json:"description"`
	Permissions map[string]AccountRolePermission `json:"permissions"`
}

AccountRole defines the roles that a member can have attached.

type AccountRoleDetailResponse added in v0.9.0

type AccountRoleDetailResponse struct {
	Success  bool        `json:"success"`
	Errors   []string    `json:"errors"`
	Messages []string    `json:"messages"`
	Result   AccountRole `json:"result"`
}

AccountRoleDetailResponse is the API response, containing a single account role.

type AccountRolePermission added in v0.9.0

type AccountRolePermission struct {
	Read bool `json:"read"`
	Edit bool `json:"edit"`
}

AccountRolePermission is the shared structure for all permissions that can be assigned to a member.

type AccountRolesListResponse added in v0.9.0

type AccountRolesListResponse struct {
	Result []AccountRole `json:"result"`
	Response
	ResultInfo `json:"result_info"`
}

AccountRolesListResponse represents the list response from the account roles.

type AccountSettings

type AccountSettings struct {
	EnforceTwoFactor bool `json:"enforce_twofactor"`
}

AccountSettings outlines the available options for an account.

type AccountsListParams added in v0.40.0

type AccountsListParams struct {
	Name string `url:"name,omitempty"`

	PaginationOptions
}

AccountsListParams holds the filterable options for Accounts.

type AdaptiveRouting added in v0.51.0

type AdaptiveRouting struct {
	// FailoverAcrossPools extends zero-downtime failover of requests to healthy origins
	// from alternate pools, when no healthy alternate exists in the same pool, according
	// to the failover order defined by traffic and origin steering.
	// When set false (the default) zero-downtime failover will only occur between origins
	// within the same pool. See SessionAffinityAttributes for control over when sessions
	// are broken or reassigned.
	FailoverAcrossPools *bool `json:"failover_across_pools,omitempty"`
}

AdaptiveRouting controls features that modify the routing of requests to pools and origins in response to dynamic conditions, such as during the interval between active health monitoring requests. For example, zero-downtime failover occurs immediately when an origin becomes unavailable due to HTTP 521, 522, or 523 response codes. If there is another healthy origin in the same pool, the request is retried once against this alternate origin.

type AdditionalInformation added in v0.44.0

type AdditionalInformation struct {
	SuspectedMalwareFamily string `json:"suspected_malware_family"`
}

AdditionalInformation represents any additional information for a domain.

type AddressMap added in v0.63.0

type AddressMap struct {
	ID           string                 `json:"id"`
	Description  *string                `json:"description,omitempty"`
	DefaultSNI   *string                `json:"default_sni"`
	Enabled      *bool                  `json:"enabled"`
	Deletable    *bool                  `json:"can_delete"`
	CanModifyIPs *bool                  `json:"can_modify_ips"`
	Memberships  []AddressMapMembership `json:"memberships"`
	IPs          []AddressMapIP         `json:"ips"`
	CreatedAt    time.Time              `json:"created_at"`
	ModifiedAt   time.Time              `json:"modified_at"`
}

AddressMap contains information about an address map.

type AddressMapIP added in v0.63.0

type AddressMapIP struct {
	IP        string    `json:"ip"`
	CreatedAt time.Time `json:"created_at"`
}

type AddressMapMembership added in v0.63.0

type AddressMapMembership struct {
	Identifier string                   `json:"identifier"`
	Kind       AddressMapMembershipKind `json:"kind"`
	Deletable  *bool                    `json:"can_delete"`
	CreatedAt  time.Time                `json:"created_at"`
}

type AddressMapMembershipContainer added in v0.63.0

type AddressMapMembershipContainer struct {
	Identifier string                   `json:"identifier"`
	Kind       AddressMapMembershipKind `json:"kind"`
}

func (*AddressMapMembershipContainer) URLFragment added in v0.63.0

func (ammb *AddressMapMembershipContainer) URLFragment() string

type AddressMapMembershipKind added in v0.63.0

type AddressMapMembershipKind string
const (
	AddressMapMembershipZone    AddressMapMembershipKind = "zone"
	AddressMapMembershipAccount AddressMapMembershipKind = "account"
)

type AdvertisementStatus added in v0.11.7

type AdvertisementStatus struct {
	Advertised           bool       `json:"advertised"`
	AdvertisedModifiedAt *time.Time `json:"advertised_modified_at"`
}

AdvertisementStatus contains information about the BGP status of an IP prefix.

type AdvertisementStatusUpdateRequest added in v0.11.7

type AdvertisementStatusUpdateRequest struct {
	Advertised bool `json:"advertised"`
}

AdvertisementStatusUpdateRequest contains information about bgp status updates.

type AlertHistoryFilter added in v0.40.0

type AlertHistoryFilter struct {
	TimeRange
	PaginationOptions
}

AlertHistoryFilter is an object for filtering the alert history response from the api.

type Application added in v0.44.0

type Application struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

type ArgoDetailsResponse added in v0.9.0

type ArgoDetailsResponse struct {
	Result ArgoFeatureSetting `json:"result"`
	Response
}

ArgoDetailsResponse is the API response for the argo smart routing and tiered caching response.

type ArgoFeatureSetting added in v0.9.0

type ArgoFeatureSetting struct {
	Editable   bool      `json:"editable,omitempty"`
	ID         string    `json:"id,omitempty"`
	ModifiedOn time.Time `json:"modified_on,omitempty"`
	Value      string    `json:"value"`
}

ArgoFeatureSetting is the structure of the API object for the argo smart routing and tiered caching settings.

type ArgoTunnel added in v0.13.7

type ArgoTunnel struct {
	ID          string                 `json:"id,omitempty"`
	Name        string                 `json:"name,omitempty"`
	Secret      string                 `json:"tunnel_secret,omitempty"`
	CreatedAt   *time.Time             `json:"created_at,omitempty"`
	DeletedAt   *time.Time             `json:"deleted_at,omitempty"`
	Connections []ArgoTunnelConnection `json:"connections,omitempty"`
}

ArgoTunnel is the struct definition of a tunnel.

type ArgoTunnelConnection added in v0.13.7

type ArgoTunnelConnection struct {
	ColoName           string `json:"colo_name"`
	UUID               string `json:"uuid"`
	IsPendingReconnect bool   `json:"is_pending_reconnect"`
}

ArgoTunnelConnection represents the connections associated with a tunnel.

type ArgoTunnelDetailResponse added in v0.13.7

type ArgoTunnelDetailResponse struct {
	Result ArgoTunnel `json:"result"`
	Response
}

ArgoTunnelDetailResponse is used for representing the API response payload for a single tunnel.

type ArgoTunnelsDetailResponse added in v0.13.7

type ArgoTunnelsDetailResponse struct {
	Result []ArgoTunnel `json:"result"`
	Response
}

ArgoTunnelsDetailResponse is used for representing the API response payload for multiple tunnels.

type AttachWorkersDomainParams added in v0.55.0

type AttachWorkersDomainParams struct {
	ID          string `json:"id,omitempty"`
	ZoneID      string `json:"zone_id,omitempty"`
	ZoneName    string `json:"zone_name,omitempty"`
	Hostname    string `json:"hostname,omitempty"`
	Service     string `json:"service,omitempty"`
	Environment string `json:"environment,omitempty"`
}

type AuditLog added in v0.9.0

type AuditLog struct {
	Action       AuditLogAction         `json:"action"`
	Actor        AuditLogActor          `json:"actor"`
	ID           string                 `json:"id"`
	Metadata     map[string]interface{} `json:"metadata"`
	NewValue     string                 `json:"newValue"`
	NewValueJSON map[string]interface{} `json:"newValueJson"`
	OldValue     string                 `json:"oldValue"`
	OldValueJSON map[string]interface{} `json:"oldValueJson"`
	Owner        AuditLogOwner          `json:"owner"`
	Resource     AuditLogResource       `json:"resource"`
	When         time.Time              `json:"when"`
}

AuditLog is an resource that represents an update in the cloudflare dash.

type AuditLogAction added in v0.9.0

type AuditLogAction struct {
	Result bool   `json:"result"`
	Type   string `json:"type"`
}

AuditLogAction is a member of AuditLog, the action that was taken.

type AuditLogActor added in v0.9.0

type AuditLogActor struct {
	Email string `json:"email"`
	ID    string `json:"id"`
	IP    string `json:"ip"`
	Type  string `json:"type"`
}

AuditLogActor is a member of AuditLog, who performed the action.

type AuditLogFilter added in v0.9.0

type AuditLogFilter struct {
	ID           string
	ActorIP      string
	ActorEmail   string
	HideUserLogs bool
	Direction    string
	ZoneName     string
	Since        string
	Before       string
	PerPage      int
	Page         int
}

AuditLogFilter is an object for filtering the audit log response from the api.

func (AuditLogFilter) ToQuery added in v0.11.2

func (a AuditLogFilter) ToQuery() url.Values

ToQuery turns an audit log filter in to an HTTP Query Param list, suitable for use in a url.URL.RawQuery. It will not include empty members of the struct in the query parameters.

type AuditLogOwner added in v0.9.0

type AuditLogOwner struct {
	ID string `json:"id"`
}

AuditLogOwner is a member of AuditLog, who owns this audit log.

type AuditLogResource added in v0.9.0

type AuditLogResource struct {
	ID   string `json:"id"`
	Type string `json:"type"`
}

AuditLogResource is a member of AuditLog, what was the action performed on.

type AuditLogResponse added in v0.9.0

type AuditLogResponse struct {
	Response   Response
	Result     []AuditLog `json:"result"`
	ResultInfo `json:"result_info"`
}

AuditLogResponse is the response returned from the cloudflare v4 api.

type AuditSSHRuleSettings added in v0.63.0

type AuditSSHRuleSettings struct {
	CommandLogging bool `json:"command_logging"`
}

type AuditSSHSettings added in v0.79.0

type AuditSSHSettings struct {
	PublicKey string     `json:"public_key"`
	SeedUUID  string     `json:"seed_id"`
	CreatedAt *time.Time `json:"created_at"`
	UpdatedAt *time.Time `json:"updated_at"`
}

TeamsList represents a Teams List.

type AuditSSHSettingsResponse added in v0.79.0

type AuditSSHSettingsResponse struct {
	Result AuditSSHSettings `json:"result"`
	Response
	ResultInfo `json:"result_info"`
}

type AuthIdCharacteristics added in v0.49.0

type AuthIdCharacteristics struct {
	Type string `json:"type"`
	Name string `json:"name"`
}

AuthIdCharacteristics a single option from configuration?properties=auth_id_characteristics.

type AuthenticatedOriginPulls added in v0.12.2

type AuthenticatedOriginPulls struct {
	ID         string    `json:"id"`
	Value      string    `json:"value"`
	Editable   bool      `json:"editable"`
	ModifiedOn time.Time `json:"modified_on"`
}

AuthenticatedOriginPulls represents global AuthenticatedOriginPulls (tls_client_auth) metadata.

type AuthenticatedOriginPullsResponse added in v0.12.2

type AuthenticatedOriginPullsResponse struct {
	Response
	Result AuthenticatedOriginPulls `json:"result"`
}

AuthenticatedOriginPullsResponse represents the response from the global AuthenticatedOriginPulls (tls_client_auth) details endpoint.

type AuthenticationError added in v0.36.0

type AuthenticationError struct {
	// contains filtered or unexported fields
}

AuthenticationError is for HTTP 401 responses.

func NewAuthenticationError added in v0.48.0

func NewAuthenticationError(e *Error) AuthenticationError

func (AuthenticationError) Error added in v0.36.0

func (e AuthenticationError) Error() string

func (AuthenticationError) ErrorCodes added in v0.36.0

func (e AuthenticationError) ErrorCodes() []int

func (AuthenticationError) ErrorMessages added in v0.36.0

func (e AuthenticationError) ErrorMessages() []string

func (AuthenticationError) Errors added in v0.36.0

func (e AuthenticationError) Errors() []ResponseInfo

func (AuthenticationError) InternalErrorCodeIs added in v0.48.0

func (e AuthenticationError) InternalErrorCodeIs(code int) bool

func (AuthenticationError) RayID added in v0.36.0

func (e AuthenticationError) RayID() string

func (AuthenticationError) Type added in v0.36.0

func (e AuthenticationError) Type() ErrorType

type AuthorizationError added in v0.36.0

type AuthorizationError struct {
	// contains filtered or unexported fields
}

AuthorizationError is for HTTP 403 responses.

func NewAuthorizationError added in v0.48.0

func NewAuthorizationError(e *Error) AuthorizationError

func (AuthorizationError) Error added in v0.36.0

func (e AuthorizationError) Error() string

func (AuthorizationError) ErrorCodes added in v0.36.0

func (e AuthorizationError) ErrorCodes() []int

func (AuthorizationError) ErrorMessages added in v0.36.0

func (e AuthorizationError) ErrorMessages() []string

func (AuthorizationError) Errors added in v0.36.0

func (e AuthorizationError) Errors() []ResponseInfo

func (AuthorizationError) InternalErrorCodeIs added in v0.48.0

func (e AuthorizationError) InternalErrorCodeIs(code int) bool

func (AuthorizationError) RayID added in v0.36.0

func (e AuthorizationError) RayID() string

func (AuthorizationError) Type added in v0.36.0

func (e AuthorizationError) Type() ErrorType

type AvailableZonePlansResponse added in v0.7.2

type AvailableZonePlansResponse struct {
	Response
	Result []ZonePlan `json:"result"`
	ResultInfo
}

AvailableZonePlansResponse represents the response from the Available Plans endpoint.

type AvailableZoneRatePlansResponse added in v0.7.4

type AvailableZoneRatePlansResponse struct {
	Response
	Result     []ZoneRatePlan `json:"result"`
	ResultInfo `json:"result_info"`
}

AvailableZoneRatePlansResponse represents the response from the Available Rate Plans endpoint.

type BelongsToRef added in v0.44.0

type BelongsToRef struct {
	ID          string `json:"id"`
	Value       int    `json:"value"`
	Type        string `json:"type"`
	Country     string `json:"country"`
	Description string `json:"description"`
}

BelongsToRef represents information about who owns an IP address.

type BotManagement added in v0.75.0

type BotManagement struct {
	EnableJS                     *bool   `json:"enable_js,omitempty"`
	FightMode                    *bool   `json:"fight_mode,omitempty"`
	SBFMDefinitelyAutomated      *string `json:"sbfm_definitely_automated,omitempty"`
	SBFMLikelyAutomated          *string `json:"sbfm_likely_automated,omitempty"`
	SBFMVerifiedBots             *string `json:"sbfm_verified_bots,omitempty"`
	SBFMStaticResourceProtection *bool   `json:"sbfm_static_resource_protection,omitempty"`
	OptimizeWordpress            *bool   `json:"optimize_wordpress,omitempty"`
	SuppressSessionScore         *bool   `json:"suppress_session_score,omitempty"`
	AutoUpdateModel              *bool   `json:"auto_update_model,omitempty"`
	UsingLatestModel             *bool   `json:"using_latest_model,omitempty"`
}

BotManagement represents the bots config for a zone.

type BotManagementResponse added in v0.75.0

type BotManagementResponse struct {
	Result BotManagement `json:"result"`
	Response
}

BotManagementResponse represents the response from the bot_management endpoint.

type BrowserIsolation added in v0.30.0

type BrowserIsolation struct {
	UrlBrowserIsolationEnabled *bool `json:"url_browser_isolation_enabled,omitempty"`
	NonIdentityEnabled         *bool `json:"non_identity_enabled,omitempty"`
}

type CacheReserve added in v0.68.0

type CacheReserve struct {
	ID         string    `json:"id,omitempty"`
	ModifiedOn time.Time `json:"modified_on,omitempty"`
	Value      string    `json:"value"`
}

CacheReserve is the structure of the API object for the cache reserve setting.

type CacheReserveDetailsResponse added in v0.68.0

type CacheReserveDetailsResponse struct {
	Result CacheReserve `json:"result"`
	Response
}

CacheReserveDetailsResponse is the API response for the cache reserve setting.

type Categories added in v0.44.0

type Categories struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

Categories represents categories for a domain.

type Categorizations added in v0.44.0

type Categorizations struct {
	Categories []Categories `json:"categories"`
	Start      string       `json:"start"`
	End        string       `json:"end"`
}

Categorizations represents the categories and when those categories were set.

type CertificatePack added in v0.13.0

type CertificatePack struct {
	ID                   string                       `json:"id"`
	Type                 string                       `json:"type"`
	Hosts                []string                     `json:"hosts"`
	Certificates         []CertificatePackCertificate `json:"certificates"`
	PrimaryCertificate   string                       `json:"primary_certificate"`
	Status               string                       `json:"status"`
	ValidationRecords    []SSLValidationRecord        `json:"validation_records,omitempty"`
	ValidationErrors     []SSLValidationError         `json:"validation_errors,omitempty"`
	ValidationMethod     string                       `json:"validation_method"`
	ValidityDays         int                          `json:"validity_days"`
	CertificateAuthority string                       `json:"certificate_authority"`
	CloudflareBranding   bool                         `json:"cloudflare_branding"`
}

CertificatePack is the overarching structure of a certificate pack response.

type CertificatePackCertificate added in v0.13.0

type CertificatePackCertificate struct {
	ID              string                         `json:"id"`
	Hosts           []string                       `json:"hosts"`
	Issuer          string                         `json:"issuer"`
	Signature       string                         `json:"signature"`
	Status          string                         `json:"status"`
	BundleMethod    string                         `json:"bundle_method"`
	GeoRestrictions CertificatePackGeoRestrictions `json:"geo_restrictions"`
	ZoneID          string                         `json:"zone_id"`
	UploadedOn      time.Time                      `json:"uploaded_on"`
	ModifiedOn      time.Time                      `json:"modified_on"`
	ExpiresOn       time.Time                      `json:"expires_on"`
	Priority        int                            `json:"priority"`
}

CertificatePackCertificate is the base structure of a TLS certificate that is contained within a certificate pack.

type CertificatePackGeoRestrictions added in v0.13.0

type CertificatePackGeoRestrictions struct {
	Label string `json:"label"`
}

CertificatePackGeoRestrictions is for the structure of the geographic restrictions for a TLS certificate.

type CertificatePackRequest added in v0.13.0

type CertificatePackRequest struct {
	Type                 string   `json:"type"`
	Hosts                []string `json:"hosts"`
	ValidationMethod     string   `json:"validation_method"`
	ValidityDays         int      `json:"validity_days"`
	CertificateAuthority string   `json:"certificate_authority"`
	CloudflareBranding   bool     `json:"cloudflare_branding"`
}

CertificatePackRequest is used for requesting a new certificate.

type CertificatePacksDetailResponse added in v0.13.0

type CertificatePacksDetailResponse struct {
	Response
	Result CertificatePack `json:"result"`
}

CertificatePacksDetailResponse contains a single certificate pack in the response.

type CertificatePacksResponse added in v0.13.0

type CertificatePacksResponse struct {
	Response
	Result []CertificatePack `json:"result"`
}

CertificatePacksResponse is for responses where multiple certificates are expected.

type Client

type Client struct {
	*ClientParams

	Zones *ZonesService
	// contains filtered or unexported fields
}

A Client manages communication with the Cloudflare API.

func NewExperimental added in v0.36.0

func NewExperimental(config *ClientParams) (*Client, error)

New creates a new instance of the API client by merging ClientParams with the default values.

func (*Client) Call added in v0.36.0

func (c *Client) Call(ctx context.Context, method, path string, payload interface{}) ([]byte, error)

Call is the entrypoint to making API calls with the correct request setup.

func (*Client) CallWithHeaders added in v0.36.0

func (c *Client) CallWithHeaders(ctx context.Context, method, path string, payload interface{}, headers http.Header) ([]byte, error)

CallWithHeaders is the entrypoint to making API calls with the correct request setup (like `Call`) but allows passing in additional HTTP headers with the request.

func (*Client) Client added in v0.36.0

func (c *Client) Client() *http.Client

Client returns the http.Client used by this Cloudflare client.

type ClientParams added in v0.36.0

type ClientParams struct {
	Key            string
	Email          string
	UserServiceKey string
	Token          string
	STS            *SecurityTokenConfiguration
	BaseURL        *url.URL
	UserAgent      string
	Headers        http.Header
	HTTPClient     *http.Client
	RetryPolicy    RetryPolicy
	Logger         LeveledLoggerInterface
	Debug          bool
}

type Config added in v0.57.0

type Config struct {
	TlsSockAddr string `json:"tls_sockaddr,omitempty"`
	Sha256      string `json:"sha256,omitempty"`
}

type Connection added in v0.45.0

type Connection struct {
	ID            string             `json:"id,omitempty"`
	Features      []string           `json:"features,omitempty"`
	Version       string             `json:"version,omitempty"`
	Arch          string             `json:"arch,omitempty"`
	Connections   []TunnelConnection `json:"conns,omitempty"`
	RunAt         *time.Time         `json:"run_at,omitempty"`
	ConfigVersion int                `json:"config_version,omitempty"`
}

Connection is the struct definition of a connection.

type ContentCategories added in v0.44.0

type ContentCategories struct {
	ID              int    `json:"id"`
	SuperCategoryID int    `json:"super_category_id"`
	Name            string `json:"name"`
}

ContentCategories represents the categories for a domain.

type CreateAPIShieldOperationsParams added in v0.78.0

type CreateAPIShieldOperationsParams struct {
	// Operations are a slice of operations to be created in API Shield Endpoint Management
	Operations []APIShieldBasicOperation `url:"-"`
}

CreateAPIShieldOperationsParams represents the parameters to pass when adding one or more operations.

API documentation: https://developers.cloudflare.com/api/operations/api-shield-endpoint-management-add-operations-to-a-zone

type CreateAPIShieldSchemaParams added in v0.79.0

type CreateAPIShieldSchemaParams struct {
	// Source is a io.Reader containing the contents of the schema
	Source io.Reader
	// Name represents the name of the schema.
	Name string
	// Kind of the schema. This is always set to openapi_v3.
	Kind string
	// ValidationEnabled controls if schema is used for validation
	ValidationEnabled *bool
}

CreateAPIShieldSchemaParams represents the parameters to pass when creating a schema in Schema Validation 2.0.

API documentation: https://developers.cloudflare.com/api/operations/api-shield-schema-validation-post-schema

type CreateAccessApplicationParams added in v0.71.0

type CreateAccessApplicationParams struct {
	AllowedIdps              []string                       `json:"allowed_idps,omitempty"`
	AppLauncherVisible       *bool                          `json:"app_launcher_visible,omitempty"`
	AUD                      string                         `json:"aud,omitempty"`
	AutoRedirectToIdentity   *bool                          `json:"auto_redirect_to_identity,omitempty"`
	CorsHeaders              *AccessApplicationCorsHeaders  `json:"cors_headers,omitempty"`
	CustomDenyMessage        string                         `json:"custom_deny_message,omitempty"`
	CustomDenyURL            string                         `json:"custom_deny_url,omitempty"`
	CustomNonIdentityDenyURL string                         `json:"custom_non_identity_deny_url,omitempty"`
	Domain                   string                         `json:"domain"`
	EnableBindingCookie      *bool                          `json:"enable_binding_cookie,omitempty"`
	GatewayRules             []AccessApplicationGatewayRule `json:"gateway_rules,omitempty"`
	HttpOnlyCookieAttribute  *bool                          `json:"http_only_cookie_attribute,omitempty"`
	LogoURL                  string                         `json:"logo_url,omitempty"`
	Name                     string                         `json:"name"`
	PathCookieAttribute      *bool                          `json:"path_cookie_attribute,omitempty"`
	PrivateAddress           string                         `json:"private_address"`
	SaasApplication          *SaasApplication               `json:"saas_app,omitempty"`
	SameSiteCookieAttribute  string                         `json:"same_site_cookie_attribute,omitempty"`
	SelfHostedDomains        []string                       `json:"self_hosted_domains"`
	ServiceAuth401Redirect   *bool                          `json:"service_auth_401_redirect,omitempty"`
	SessionDuration          string                         `json:"session_duration,omitempty"`
	SkipInterstitial         *bool                          `json:"skip_interstitial,omitempty"`
	Type                     AccessApplicationType          `json:"type,omitempty"`
	AllowAuthenticateViaWarp *bool                          `json:"allow_authenticate_via_warp,omitempty"`
	CustomPages              []string                       `json:"custom_pages,omitempty"`
	Tags                     []string                       `json:"tags,omitempty"`
	AccessAppLauncherCustomization
}

type CreateAccessCACertificateParams added in v0.71.0

type CreateAccessCACertificateParams struct {
	ApplicationID string
}

type CreateAccessCustomPageParams added in v0.74.0

type CreateAccessCustomPageParams struct {
	CustomHTML string               `json:"custom_html,omitempty"`
	Name       string               `json:"name,omitempty"`
	Type       AccessCustomPageType `json:"type,omitempty"`
}

type CreateAccessGroupParams added in v0.71.0

type CreateAccessGroupParams struct {
	Name string `json:"name"`

	// The include group works like an OR logical operator. The user must
	// satisfy one of the rules.
	Include []interface{} `json:"include"`

	// The exclude group works like a NOT logical operator. The user must
	// not satisfy all the rules in exclude.
	Exclude []interface{} `json:"exclude"`

	// The require group works like a AND logical operator. The user must
	// satisfy all the rules in require.
	Require []interface{} `json:"require"`
}

type CreateAccessIdentityProviderParams added in v0.71.0

type CreateAccessIdentityProviderParams struct {
	Name       string                                  `json:"name"`
	Type       string                                  `json:"type"`
	Config     AccessIdentityProviderConfiguration     `json:"config"`
	ScimConfig AccessIdentityProviderScimConfiguration `json:"scim_config"`
}

type CreateAccessMutualTLSCertificateParams added in v0.71.0

type CreateAccessMutualTLSCertificateParams struct {
	ExpiresOn           time.Time `json:"expires_on,omitempty"`
	Name                string    `json:"name,omitempty"`
	Fingerprint         string    `json:"fingerprint,omitempty"`
	Certificate         string    `json:"certificate,omitempty"`
	AssociatedHostnames []string  `json:"associated_hostnames,omitempty"`
}

type CreateAccessOrganizationParams added in v0.71.0

type CreateAccessOrganizationParams struct {
	Name                           string                        `json:"name"`
	AuthDomain                     string                        `json:"auth_domain"`
	LoginDesign                    AccessOrganizationLoginDesign `json:"login_design"`
	IsUIReadOnly                   *bool                         `json:"is_ui_read_only,omitempty"`
	UIReadOnlyToggleReason         string                        `json:"ui_read_only_toggle_reason,omitempty"`
	UserSeatExpirationInactiveTime string                        `json:"user_seat_expiration_inactive_time,omitempty"`
	AutoRedirectToIdentity         *bool                         `json:"auto_redirect_to_identity,omitempty"`
	SessionDuration                *string                       `json:"session_duration,omitempty"`
	CustomPages                    AccessOrganizationCustomPages `json:"custom_pages,omitempty"`
	WarpAuthSessionDuration        *string                       `json:"warp_auth_session_duration,omitempty"`
	AllowAuthenticateViaWarp       *bool                         `json:"allow_authenticate_via_warp,omitempty"`
}

type CreateAccessPolicyParams added in v0.71.0

type CreateAccessPolicyParams struct {
	ApplicationID string `json:"-"`

	Precedence int    `json:"precedence"`
	Decision   string `json:"decision"`
	Name       string `json:"name"`

	IsolationRequired            *bool                 `json:"isolation_required,omitempty"`
	SessionDuration              *string               `json:"session_duration,omitempty"`
	PurposeJustificationRequired *bool                 `json:"purpose_justification_required,omitempty"`
	PurposeJustificationPrompt   *string               `json:"purpose_justification_prompt,omitempty"`
	ApprovalRequired             *bool                 `json:"approval_required,omitempty"`
	ApprovalGroups               []AccessApprovalGroup `json:"approval_groups"`

	// The include policy works like an OR logical operator. The user must
	// satisfy one of the rules.
	Include []interface{} `json:"include"`

	// The exclude policy works like a NOT logical operator. The user must
	// not satisfy all the rules in exclude.
	Exclude []interface{} `json:"exclude"`

	// The require policy works like a AND logical operator. The user must
	// satisfy all the rules in require.
	Require []interface{} `json:"require"`
}

type CreateAccessServiceTokenParams added in v0.71.0

type CreateAccessServiceTokenParams struct {
	Name     string `json:"name"`
	Duration string `json:"duration,omitempty"`
}

type CreateAccessTagParams added in v0.78.0

type CreateAccessTagParams struct {
	Name string `json:"name,omitempty"`
}

type CreateAccountMemberParams added in v0.53.0

type CreateAccountMemberParams struct {
	EmailAddress string
	Roles        []string
	Policies     []Policy
	Status       string
}

type CreateAddressMapParams added in v0.63.0

type CreateAddressMapParams struct {
	Description *string                         `json:"description"`
	Enabled     *bool                           `json:"enabled"`
	IPs         []string                        `json:"ips"`
	Memberships []AddressMapMembershipContainer `json:"memberships"`
}

CreateAddressMapParams contains information about an address map to be created.

type CreateCustomNameserversParams added in v0.70.0

type CreateCustomNameserversParams struct {
	NSName string `json:"ns_name"`
	NSSet  int    `json:"ns_set"`
}

type CreateD1DatabaseParams added in v0.79.0

type CreateD1DatabaseParams struct {
	Name string `json:"name"`
}

type CreateDLPDatasetParams added in v0.87.0

type CreateDLPDatasetParams struct {
	Description string `json:"description,omitempty"`
	Name        string `json:"name"`
	Secret      *bool  `json:"secret,omitempty"`
}

type CreateDLPDatasetResponse added in v0.87.0

type CreateDLPDatasetResponse struct {
	Result CreateDLPDatasetResult `json:"result"`
	Response
}

type CreateDLPDatasetResult added in v0.87.0

type CreateDLPDatasetResult struct {
	MaxCells int        `json:"max_cells"`
	Secret   string     `json:"secret"`
	Version  int        `json:"version"`
	Dataset  DLPDataset `json:"dataset"`
}

type CreateDLPDatasetUploadParams added in v0.87.0

type CreateDLPDatasetUploadParams struct {
	DatasetID string
}

type CreateDLPDatasetUploadResponse added in v0.87.0

type CreateDLPDatasetUploadResponse struct {
	Result CreateDLPDatasetUploadResult `json:"result"`
	Response
}

type CreateDLPDatasetUploadResult added in v0.87.0

type CreateDLPDatasetUploadResult struct {
	MaxCells int    `json:"max_cells"`
	Secret   string `json:"secret"`
	Version  int    `json:"version"`
}

type CreateDLPProfilesParams added in v0.53.0

type CreateDLPProfilesParams struct {
	Profiles []DLPProfile `json:"profiles"`
	Type     string
}

type CreateDNSFirewallClusterParams added in v0.70.0

type CreateDNSFirewallClusterParams struct {
	Name                 string   `json:"name"`
	UpstreamIPs          []string `json:"upstream_ips"`
	DNSFirewallIPs       []string `json:"dns_firewall_ips,omitempty"`
	MinimumCacheTTL      uint     `json:"minimum_cache_ttl,omitempty"`
	MaximumCacheTTL      uint     `json:"maximum_cache_ttl,omitempty"`
	DeprecateAnyRequests bool     `json:"deprecate_any_requests"`
}

type CreateDNSRecordParams added in v0.58.0

type CreateDNSRecordParams struct {
	CreatedOn  time.Time   `json:"created_on,omitempty" url:"created_on,omitempty"`
	ModifiedOn time.Time   `json:"modified_on,omitempty" url:"modified_on,omitempty"`
	Type       string      `json:"type,omitempty" url:"type,omitempty"`
	Name       string      `json:"name,omitempty" url:"name,omitempty"`
	Content    string      `json:"content,omitempty" url:"content,omitempty"`
	Meta       interface{} `json:"meta,omitempty"`
	Data       interface{} `json:"data,omitempty"` // data returned by: SRV, LOC
	ID         string      `json:"id,omitempty"`
	ZoneID     string      `json:"zone_id,omitempty"`
	ZoneName   string      `json:"zone_name,omitempty"`
	Priority   *uint16     `json:"priority,omitempty"`
	TTL        int         `json:"ttl,omitempty"`
	Proxied    *bool       `json:"proxied,omitempty" url:"proxied,omitempty"`
	Proxiable  bool        `json:"proxiable,omitempty"`
	Comment    string      `json:"comment,omitempty" url:"comment,omitempty"` // to the server, there's no difference between "no comment" and "empty comment"
	Tags       []string    `json:"tags,omitempty"`
}

type CreateDataLocalizationRegionalHostnameParams added in v0.66.0

type CreateDataLocalizationRegionalHostnameParams struct {
	Hostname  string `json:"hostname"`
	RegionKey string `json:"region_key"`
}

type CreateDeviceDexTestParams added in v0.62.0

type CreateDeviceDexTestParams struct {
	TestID      string             `json:"test_id,omitempty"`
	Name        string             `json:"name"`
	Description string             `json:"description,omitempty"`
	Interval    string             `json:"interval"`
	Enabled     bool               `json:"enabled"`
	Data        *DeviceDexTestData `json:"data"`
}

type CreateDeviceManagedNetworkParams added in v0.57.0

type CreateDeviceManagedNetworkParams struct {
	NetworkID string  `json:"network_id,omitempty"`
	Type      string  `json:"type"`
	Name      string  `json:"name"`
	Config    *Config `json:"config"`
}

type CreateDeviceSettingsPolicyParams added in v0.81.0

type CreateDeviceSettingsPolicyParams struct {
	DisableAutoFallback *bool          `json:"disable_auto_fallback,omitempty"`
	CaptivePortal       *int           `json:"captive_portal,omitempty"`
	AllowModeSwitch     *bool          `json:"allow_mode_switch,omitempty"`
	SwitchLocked        *bool          `json:"switch_locked,omitempty"`
	AllowUpdates        *bool          `json:"allow_updates,omitempty"`
	AutoConnect         *int           `json:"auto_connect,omitempty"`
	AllowedToLeave      *bool          `json:"allowed_to_leave,omitempty"`
	SupportURL          *string        `json:"support_url,omitempty"`
	ServiceModeV2       *ServiceModeV2 `json:"service_mode_v2,omitempty"`
	Precedence          *int           `json:"precedence,omitempty"`
	Name                *string        `json:"name,omitempty"`
	Match               *string        `json:"match,omitempty"`
	Enabled             *bool          `json:"enabled,omitempty"`
	ExcludeOfficeIps    *bool          `json:"exclude_office_ips"`
	Description         *string        `json:"description,omitempty"`
	LANAllowMinutes     *uint          `json:"lan_allow_minutes,omitempty"`
	LANAllowSubnetSize  *uint          `json:"lan_allow_subnet_size,omitempty"`
}

type CreateEmailRoutingAddressParameters added in v0.47.0

type CreateEmailRoutingAddressParameters struct {
	Email string `json:"email,omitempty"`
}

type CreateEmailRoutingAddressResponse added in v0.47.0

type CreateEmailRoutingAddressResponse struct {
	Result EmailRoutingDestinationAddress `json:"result,omitempty"`
	Response
}

type CreateEmailRoutingRuleParameters added in v0.47.0

type CreateEmailRoutingRuleParameters struct {
	Matchers []EmailRoutingRuleMatcher `json:"matchers,omitempty"`
	Actions  []EmailRoutingRuleAction  `json:"actions,omitempty"`
	Name     string                    `json:"name,omitempty"`
	Enabled  *bool                     `json:"enabled,omitempty"`
	Priority int                       `json:"priority,omitempty"`
}

type CreateEmailRoutingRuleResponse added in v0.47.0

type CreateEmailRoutingRuleResponse struct {
	Result EmailRoutingRule `json:"result"`
	Response
}

type CreateHyperdriveConfigParams added in v0.88.0

type CreateHyperdriveConfigParams struct {
	Name    string                  `json:"name"`
	Origin  HyperdriveConfigOrigin  `json:"origin"`
	Caching HyperdriveConfigCaching `json:"caching,omitempty"`
}

type CreateIPAddressToAddressMapParams added in v0.63.0

type CreateIPAddressToAddressMapParams struct {
	// ID represents the target address map for adding the IP address.
	ID string
	// The IP address.
	IP string
}

CreateIPAddressToAddressMapParams contains request parameters to add/remove IP address to/from an address map.

type CreateImageDirectUploadURLParams added in v0.71.0

type CreateImageDirectUploadURLParams struct {
	Version           ImagesAPIVersion       `json:"-"`
	Expiry            *time.Time             `json:"expiry,omitempty"`
	Metadata          map[string]interface{} `json:"metadata,omitempty"`
	RequireSignedURLs *bool                  `json:"requireSignedURLs,omitempty"`
}

CreateImageDirectUploadURLParams is the data required for a CreateImageDirectUploadURL request.

type CreateImagesVariantParams added in v0.88.0

type CreateImagesVariantParams struct {
	ID                     string                `json:"id,omitempty"`
	NeverRequireSignedURLs *bool                 `json:"neverRequireSignedURLs,omitempty"`
	Options                ImagesVariantsOptions `json:"options,omitempty"`
}

type CreateLoadBalancerMonitorParams added in v0.51.0

type CreateLoadBalancerMonitorParams struct {
	LoadBalancerMonitor LoadBalancerMonitor
}

type CreateLoadBalancerParams added in v0.51.0

type CreateLoadBalancerParams struct {
	LoadBalancer LoadBalancer
}

type CreateLoadBalancerPoolParams added in v0.51.0

type CreateLoadBalancerPoolParams struct {
	LoadBalancerPool LoadBalancerPool
}

type CreateLogpushJobParams added in v0.72.0

type CreateLogpushJobParams struct {
	Dataset                  string                `json:"dataset"`
	Enabled                  bool                  `json:"enabled"`
	Kind                     string                `json:"kind,omitempty"`
	Name                     string                `json:"name"`
	LogpullOptions           string                `json:"logpull_options,omitempty"`
	OutputOptions            *LogpushOutputOptions `json:"output_options,omitempty"`
	DestinationConf          string                `json:"destination_conf"`
	OwnershipChallenge       string                `json:"ownership_challenge,omitempty"`
	ErrorMessage             string                `json:"error_message,omitempty"`
	Frequency                string                `json:"frequency,omitempty"`
	Filter                   *LogpushJobFilters    `json:"filter,omitempty"`
	MaxUploadBytes           int                   `json:"max_upload_bytes,omitempty"`
	MaxUploadRecords         int                   `json:"max_upload_records,omitempty"`
	MaxUploadIntervalSeconds int                   `json:"max_upload_interval_seconds,omitempty"`
}

func (CreateLogpushJobParams) MarshalJSON added in v0.72.0

func (f CreateLogpushJobParams) MarshalJSON() ([]byte, error)

func (*CreateLogpushJobParams) UnmarshalJSON added in v0.72.0

func (f *CreateLogpushJobParams) UnmarshalJSON(data []byte) error

Custom Unmarshaller for CreateLogpushJobParams filter key.

type CreateMTLSCertificateParams added in v0.58.0

type CreateMTLSCertificateParams struct {
	Name         string `json:"name"`
	Certificates string `json:"certificates"`
	PrivateKey   string `json:"private_key"`
	CA           bool   `json:"ca"`
}

MTLSCertificateParams represents the data related to the mTLS certificate being uploaded. Name is an optional field.

type CreateMagicFirewallRulesetRequest added in v0.13.7

type CreateMagicFirewallRulesetRequest struct {
	Name        string                     `json:"name"`
	Description string                     `json:"description"`
	Kind        string                     `json:"kind"`
	Phase       string                     `json:"phase"`
	Rules       []MagicFirewallRulesetRule `json:"rules"`
}

CreateMagicFirewallRulesetRequest contains data for a new Firewall ruleset.

type CreateMagicFirewallRulesetResponse added in v0.13.7

type CreateMagicFirewallRulesetResponse struct {
	Response
	Result MagicFirewallRuleset `json:"result"`
}

CreateMagicFirewallRulesetResponse contains response data when creating a new Magic Firewall ruleset.

type CreateMagicTransitGRETunnelsRequest added in v0.32.0

type CreateMagicTransitGRETunnelsRequest struct {
	GRETunnels []MagicTransitGRETunnel `json:"gre_tunnels"`
}

CreateMagicTransitGRETunnelsRequest is an array of GRE tunnels to create.

type CreateMagicTransitIPsecTunnelsRequest added in v0.31.0

type CreateMagicTransitIPsecTunnelsRequest struct {
	IPsecTunnels []MagicTransitIPsecTunnel `json:"ipsec_tunnels"`
}

CreateMagicTransitIPsecTunnelsRequest is an array of IPsec tunnels to create.

type CreateMagicTransitStaticRoutesRequest added in v0.18.0

type CreateMagicTransitStaticRoutesRequest struct {
	Routes []MagicTransitStaticRoute `json:"routes"`
}

CreateMagicTransitStaticRoutesRequest is an array of static routes to create.

type CreateMembershipToAddressMapParams added in v0.63.0

type CreateMembershipToAddressMapParams struct {
	// ID represents the target address map for adding the membershp.
	ID         string
	Membership AddressMapMembershipContainer
}

CreateMembershipToAddressMapParams contains request parameters to add/remove membership from an address map.

type CreateObservatoryPageTestParams added in v0.78.0

type CreateObservatoryPageTestParams struct {
	URL      string
	Settings CreateObservatoryPageTestSettings
}

type CreateObservatoryPageTestSettings added in v0.78.0

type CreateObservatoryPageTestSettings struct {
	Region string `json:"region"`
}

type CreateObservatoryScheduledPageTestParams added in v0.78.0

type CreateObservatoryScheduledPageTestParams struct {
	URL       string `url:"-" json:"-"`
	Region    string `url:"region" json:"-"`
	Frequency string `url:"frequency" json:"-"`
}

type CreateObservatoryScheduledPageTestResponse added in v0.78.0

type CreateObservatoryScheduledPageTestResponse struct {
	Response
	Result ObservatoryScheduledPageTest `json:"result"`
}

type CreateOriginCertificateParams added in v0.58.0

type CreateOriginCertificateParams struct {
	ID              string    `json:"id"`
	Certificate     string    `json:"certificate"`
	Hostnames       []string  `json:"hostnames"`
	ExpiresOn       time.Time `json:"expires_on"`
	RequestType     string    `json:"request_type"`
	RequestValidity int       `json:"requested_validity"`
	RevokedAt       time.Time `json:"revoked_at,omitempty"`
	CSR             string    `json:"csr"`
}

type CreatePageShieldPolicyParams added in v0.84.0

type CreatePageShieldPolicyParams struct {
	Action      string `json:"action"`
	Description string `json:"description"`
	Enabled     *bool  `json:"enabled,omitempty"`
	Expression  string `json:"expression"`
	ID          string `json:"id"`
	Value       string `json:"value"`
}

type CreatePagesDeploymentParams added in v0.40.0

type CreatePagesDeploymentParams struct {
	ProjectName string `json:"-"`
	Branch      string `json:"branch,omitempty"`
}

type CreatePagesProjectParams added in v0.73.0

type CreatePagesProjectParams struct {
	Name                string                        `json:"name,omitempty"`
	SubDomain           string                        `json:"subdomain"`
	Domains             []string                      `json:"domains,omitempty"`
	Source              *PagesProjectSource           `json:"source,omitempty"`
	BuildConfig         PagesProjectBuildConfig       `json:"build_config"`
	DeploymentConfigs   PagesProjectDeploymentConfigs `json:"deployment_configs"`
	LatestDeployment    PagesProjectDeployment        `json:"latest_deployment"`
	CanonicalDeployment PagesProjectDeployment        `json:"canonical_deployment"`
	ProductionBranch    string                        `json:"production_branch,omitempty"`
}

type CreateQueueConsumerParams added in v0.55.0

type CreateQueueConsumerParams struct {
	QueueName string `json:"-"`
	Consumer  QueueConsumer
}

type CreateQueueParams added in v0.55.0

type CreateQueueParams struct {
	Name string `json:"queue_name"`
}

type CreateR2BucketParameters added in v0.48.0

type CreateR2BucketParameters struct {
	Name         string `json:"name,omitempty"`
	LocationHint string `json:"locationHint,omitempty"`
}

type CreateRulesetParams added in v0.73.0

type CreateRulesetParams struct {
	Name        string        `json:"name,omitempty"`
	Description string        `json:"description,omitempty"`
	Kind        string        `json:"kind,omitempty"`
	Phase       string        `json:"phase,omitempty"`
	Rules       []RulesetRule `json:"rules"`
}

type CreateRulesetResponse added in v0.19.0

type CreateRulesetResponse struct {
	Response
	Result Ruleset `json:"result"`
}

CreateRulesetResponse contains response data when creating a new Ruleset.

type CreateTeamsListParams added in v0.53.0

type CreateTeamsListParams struct {
	ID          string          `json:"id,omitempty"`
	Name        string          `json:"name"`
	Type        string          `json:"type"`
	Description string          `json:"description,omitempty"`
	Items       []TeamsListItem `json:"items,omitempty"`
	Count       uint64          `json:"count,omitempty"`
	CreatedAt   *time.Time      `json:"created_at,omitempty"`
	UpdatedAt   *time.Time      `json:"updated_at,omitempty"`
}

type CreateTurnstileWidgetParams added in v0.66.0

type CreateTurnstileWidgetParams struct {
	Name         string   `json:"name,omitempty"`
	Domains      []string `json:"domains,omitempty"`
	Mode         string   `json:"mode,omitempty"`
	BotFightMode bool     `json:"bot_fight_mode,omitempty"`
	Region       string   `json:"region,omitempty"`
	OffLabel     bool     `json:"offlabel,omitempty"`
}

type CreateWaitingRoomRuleParams added in v0.53.0

type CreateWaitingRoomRuleParams struct {
	WaitingRoomID string
	Rule          WaitingRoomRule
}

type CreateWebAnalyticsRule added in v0.75.0

type CreateWebAnalyticsRule struct {
	ID    string   `json:"id,omitempty"`
	Host  string   `json:"host"`
	Paths []string `json:"paths"`
	// Inclusive defines whether the rule includes or excludes the matched traffic from being measured in web analytics.
	Inclusive bool `json:"inclusive"`
	IsPaused  bool `json:"is_paused"`
}

CreateWebAnalyticsRule describes the properties required to create or update a Web Analytics Rule object.

type CreateWebAnalyticsRuleParams added in v0.75.0

type CreateWebAnalyticsRuleParams struct {
	RulesetID string
	Rule      CreateWebAnalyticsRule
}

type CreateWebAnalyticsSiteParams added in v0.75.0

type CreateWebAnalyticsSiteParams struct {
	// Host is the host to measure traffic for.
	Host string `json:"host,omitempty"`
	// ZoneTag is the zone tag to measure traffic for.
	ZoneTag string `json:"zone_tag,omitempty"`
	// AutoInstall defines whether Cloudflare will inject the JS snippet automatically for orange-clouded sites.
	AutoInstall *bool `json:"auto_install"`
}

type CreateWorkerParams added in v0.57.0

type CreateWorkerParams struct {
	ScriptName string
	Script     string

	// DispatchNamespaceName uploads the worker to a WFP dispatch namespace if provided
	DispatchNamespaceName *string

	// Module changes the Content-Type header to specify the script is an
	// ES Module syntax script.
	Module bool

	// Logpush opts the worker into Workers Logpush logging. A nil value leaves
	// the current setting unchanged.
	//
	// Documentation: https://developers.cloudflare.com/workers/platform/logpush/
	Logpush *bool

	// TailConsumers specifies a list of Workers that will consume the logs of
	// the attached Worker.
	// Documentation: https://developers.cloudflare.com/workers/platform/tail-workers/
	TailConsumers *[]WorkersTailConsumer

	// Bindings should be a map where the keys are the binding name, and the
	// values are the binding content
	Bindings map[string]WorkerBinding

	// CompatibilityDate is a date in the form yyyy-mm-dd,
	// which will be used to determine which version of the Workers runtime is used.
	//  https://developers.cloudflare.com/workers/platform/compatibility-dates/
	CompatibilityDate string

	// CompatibilityFlags are the names of features of the Workers runtime to be enabled or disabled,
	// usually used together with CompatibilityDate.
	//  https://developers.cloudflare.com/workers/platform/compatibility-dates/#compatibility-flags
	CompatibilityFlags []string

	Placement *Placement

	// Tags are used to better manage CRUD operations at scale.
	//  https://developers.cloudflare.com/cloudflare-for-platforms/workers-for-platforms/platform/tags/
	Tags []string
}

func (CreateWorkerParams) RequiresMultipart added in v0.75.0

func (p CreateWorkerParams) RequiresMultipart() bool

type CreateWorkerRouteParams added in v0.57.0

type CreateWorkerRouteParams struct {
	Pattern string `json:"pattern"`
	Script  string `json:"script,omitempty"`
}

type CreateWorkersAccountSettingsParameters added in v0.47.0

type CreateWorkersAccountSettingsParameters struct {
	DefaultUsageModel string `json:"default_usage_model,omitempty"`
	GreenCompute      bool   `json:"green_compute,omitempty"`
}

type CreateWorkersAccountSettingsResponse added in v0.47.0

type CreateWorkersAccountSettingsResponse struct {
	Response
	Result WorkersAccountSettings
}

type CreateWorkersForPlatformsDispatchNamespaceParams added in v0.90.0

type CreateWorkersForPlatformsDispatchNamespaceParams struct {
	Name string `json:"name"`
}

type CreateWorkersKVNamespaceParams added in v0.55.0

type CreateWorkersKVNamespaceParams struct {
	Title string `json:"title"`
}

CreateWorkersKVNamespaceParams provides parameters for creating and updating storage namespaces.

type CreateZoneHoldParams added in v0.75.0

type CreateZoneHoldParams struct {
	IncludeSubdomains *bool `url:"include_subdomains,omitempty"`
}

CreateZoneHoldParams represents params for the Create Zone Hold endpoint.

type CustomHostname added in v0.7.4

type CustomHostname struct {
	ID                        string                                  `json:"id,omitempty"`
	Hostname                  string                                  `json:"hostname,omitempty"`
	CustomOriginServer        string                                  `json:"custom_origin_server,omitempty"`
	CustomOriginSNI           string                                  `json:"custom_origin_sni,omitempty"`
	SSL                       *CustomHostnameSSL                      `json:"ssl,omitempty"`
	CustomMetadata            *CustomMetadata                         `json:"custom_metadata,omitempty"`
	Status                    CustomHostnameStatus                    `json:"status,omitempty"`
	VerificationErrors        []string                                `json:"verification_errors,omitempty"`
	OwnershipVerification     CustomHostnameOwnershipVerification     `json:"ownership_verification,omitempty"`
	OwnershipVerificationHTTP CustomHostnameOwnershipVerificationHTTP `json:"ownership_verification_http,omitempty"`
	CreatedAt                 *time.Time                              `json:"created_at,omitempty"`
}

CustomHostname represents a custom hostname in a zone.

type CustomHostnameFallbackOrigin added in v0.12.0

type CustomHostnameFallbackOrigin struct {
	Origin string   `json:"origin,omitempty"`
	Status string   `json:"status,omitempty"`
	Errors []string `json:"errors,omitempty"`
}

CustomHostnameFallbackOrigin represents a Custom Hostnames Fallback Origin.

type CustomHostnameFallbackOriginResponse added in v0.12.0

type CustomHostnameFallbackOriginResponse struct {
	Result CustomHostnameFallbackOrigin `json:"result"`
	Response
}

CustomHostnameFallbackOriginResponse represents a response from the Custom Hostnames Fallback Origin endpoint.

type CustomHostnameListResponse

type CustomHostnameListResponse struct {
	Result []CustomHostname `json:"result"`
	Response
	ResultInfo `json:"result_info"`
}

CustomHostnameListResponse represents a response from the Custom Hostnames endpoints.

type CustomHostnameOwnershipVerification added in v0.11.7

type CustomHostnameOwnershipVerification struct {
	Type  string `json:"type,omitempty"`
	Name  string `json:"name,omitempty"`
	Value string `json:"value,omitempty"`
}

CustomHostnameOwnershipVerification represents ownership verification status of a given custom hostname.

type CustomHostnameOwnershipVerificationHTTP added in v0.12.0

type CustomHostnameOwnershipVerificationHTTP struct {
	HTTPUrl  string `json:"http_url,omitempty"`
	HTTPBody string `json:"http_body,omitempty"`
}

CustomHostnameOwnershipVerificationHTTP represents a response from the Custom Hostnames endpoints.

type CustomHostnameResponse added in v0.7.4

type CustomHostnameResponse struct {
	Result CustomHostname `json:"result"`
	Response
}

CustomHostnameResponse represents a response from the Custom Hostnames endpoints.

type CustomHostnameSSL added in v0.7.4

type CustomHostnameSSL struct {
	ID                   string                          `json:"id,omitempty"`
	Status               string                          `json:"status,omitempty"`
	Method               string                          `json:"method,omitempty"`
	Type                 string                          `json:"type,omitempty"`
	Wildcard             *bool                           `json:"wildcard,omitempty"`
	CustomCertificate    string                          `json:"custom_certificate,omitempty"`
	CustomKey            string                          `json:"custom_key,omitempty"`
	CertificateAuthority string                          `json:"certificate_authority,omitempty"`
	Issuer               string                          `json:"issuer,omitempty"`
	SerialNumber         string                          `json:"serial_number,omitempty"`
	Settings             CustomHostnameSSLSettings       `json:"settings,omitempty"`
	Certificates         []CustomHostnameSSLCertificates `json:"certificates,omitempty"`
	// Deprecated: use ValidationRecords.
	// If there a single validation record, this will equal ValidationRecords[0] for backwards compatibility.
	SSLValidationRecord
	ValidationRecords []SSLValidationRecord `json:"validation_records,omitempty"`
	ValidationErrors  []SSLValidationError  `json:"validation_errors,omitempty"`
	BundleMethod      string                `json:"bundle_method,omitempty"`
}

CustomHostnameSSL represents the SSL section in a given custom hostname.

type CustomHostnameSSLCertificates added in v0.31.0

type CustomHostnameSSLCertificates struct {
	Issuer            string     `json:"issuer"`
	SerialNumber      string     `json:"serial_number"`
	Signature         string     `json:"signature"`
	ExpiresOn         *time.Time `json:"expires_on"`
	IssuedOn          *time.Time `json:"issued_on"`
	FingerprintSha256 string     `json:"fingerprint_sha256"`
	ID                string     `json:"id"`
}

CustomHostnameSSLCertificates represent certificate properties like issuer, expires date and etc.

type CustomHostnameSSLSettings added in v0.9.0

type CustomHostnameSSLSettings struct {
	HTTP2         string   `json:"http2,omitempty"`
	HTTP3         string   `json:"http3,omitempty"`
	TLS13         string   `json:"tls_1_3,omitempty"`
	MinTLSVersion string   `json:"min_tls_version,omitempty"`
	Ciphers       []string `json:"ciphers,omitempty"`
	EarlyHints    string   `json:"early_hints,omitempty"`
}

CustomHostnameSSLSettings represents the SSL settings for a custom hostname.

type CustomHostnameStatus added in v0.11.7

type CustomHostnameStatus string

CustomHostnameStatus is the enumeration of valid state values in the CustomHostnameSSL.

const (
	// PENDING status represents state of CustomHostname is pending.
	PENDING CustomHostnameStatus = "pending"
	// ACTIVE status represents state of CustomHostname is active.
	ACTIVE CustomHostnameStatus = "active"
	// MOVED status represents state of CustomHostname is moved.
	MOVED CustomHostnameStatus = "moved"
	// DELETED status represents state of CustomHostname is deleted.
	DELETED CustomHostnameStatus = "deleted"
	// BLOCKED status represents state of CustomHostname is blocked from going active.
	BLOCKED CustomHostnameStatus = "blocked"
)

type CustomMetadata added in v0.7.4

type CustomMetadata map[string]interface{}

CustomMetadata defines custom metadata for the hostname. This requires logic to be implemented by Cloudflare to act on the data provided.

type CustomNameserver added in v0.70.0

type CustomNameserver struct {
	NSName string `json:"ns_name"`
	NSSet  int    `json:"ns_set"`
}

type CustomNameserverRecord added in v0.70.0

type CustomNameserverRecord struct {
	Type  string `json:"type"`
	Value string `json:"value"`
}

type CustomNameserverResult added in v0.70.0

type CustomNameserverResult struct {
	DNSRecords []CustomNameserverRecord `json:"dns_records"`
	NSName     string                   `json:"ns_name"`
	NSSet      int                      `json:"ns_set"`
	Status     string                   `json:"status"`
	ZoneTag    string                   `json:"zone_tag"`
}

type CustomNameserverZoneMetadata added in v0.70.0

type CustomNameserverZoneMetadata struct {
	NSSet   int  `json:"ns_set"`
	Enabled bool `json:"enabled"`
}

type CustomPage added in v0.7.2

type CustomPage struct {
	CreatedOn      time.Time   `json:"created_on"`
	ModifiedOn     time.Time   `json:"modified_on"`
	URL            interface{} `json:"url"`
	State          string      `json:"state"`
	RequiredTokens []string    `json:"required_tokens"`
	PreviewTarget  string      `json:"preview_target"`
	Description    string      `json:"description"`
	ID             string      `json:"id"`
}

CustomPage represents a custom page configuration.

type CustomPageDetailResponse added in v0.9.0

type CustomPageDetailResponse struct {
	Response
	Result CustomPage `json:"result"`
}

CustomPageDetailResponse represents the response from the custom page endpoint.

type CustomPageOptions added in v0.9.0

type CustomPageOptions struct {
	AccountID string
	ZoneID    string
}

CustomPageOptions is used to determine whether or not the operation should take place on an account or zone level based on which is provided to the function.

A non-empty value denotes desired use.

type CustomPageParameters added in v0.9.0

type CustomPageParameters struct {
	URL   interface{} `json:"url"`
	State string      `json:"state"`
}

CustomPageParameters is used to update a particular custom page with the values provided.

type CustomPageResponse added in v0.7.2

type CustomPageResponse struct {
	Response
	Result []CustomPage `json:"result"`
}

CustomPageResponse represents the response from the custom pages endpoint.

type D1Binding added in v0.49.0

type D1Binding struct {
	ID string `json:"id"`
}

type D1BindingMap added in v0.49.0

type D1BindingMap map[string]*D1Binding

type D1Database added in v0.79.0

type D1Database struct {
	Name      string     `json:"name"`
	NumTables int        `json:"num_tables"`
	UUID      string     `json:"uuid"`
	Version   string     `json:"version"`
	CreatedAt *time.Time `json:"created_at"`
	FileSize  int64      `json:"file_size"`
}

type D1DatabaseMetadata added in v0.79.0

type D1DatabaseMetadata struct {
	ChangedDB   *bool   `json:"changed_db,omitempty"`
	Changes     int     `json:"changes"`
	Duration    float64 `json:"duration"`
	LastRowID   int     `json:"last_row_id"`
	RowsRead    int     `json:"rows_read"`
	RowsWritten int     `json:"rows_written"`
	SizeAfter   int     `json:"size_after"`
}

type D1DatabaseResponse added in v0.79.0

type D1DatabaseResponse struct {
	Result D1Database `json:"result"`
	Response
}

type D1Result added in v0.79.0

type D1Result struct {
	Success *bool              `json:"success"`
	Results []map[string]any   `json:"results"`
	Meta    D1DatabaseMetadata `json:"meta"`
}

type DCVDelegation added in v0.77.0

type DCVDelegation struct {
	UUID string `json:"uuid"`
}

type DCVDelegationResponse added in v0.77.0

type DCVDelegationResponse struct {
	Result DCVDelegation `json:"result"`
	Response
	ResultInfo `json:"result_info"`
}

DCVDelegationResponse represents the response from the dcv_delegation/uuid endpoint.

type DLPContextAwareness added in v0.90.0

type DLPContextAwareness struct {
	Enabled *bool                   `json:"enabled,omitempty"`
	Skip    DLPContextAwarenessSkip `json:"skip"`
}

Scan the context of predefined entries to only return matches surrounded by keywords.

type DLPContextAwarenessSkip added in v0.90.0

type DLPContextAwarenessSkip struct {
	// Return all matches, regardless of context analysis result, if the data is a file.
	Files *bool `json:"files,omitempty"`
}

Content types to exclude from context analysis and return all matches.

type DLPDataset added in v0.87.0

type DLPDataset struct {
	CreatedAt   *time.Time         `json:"created_at,omitempty"`
	Description string             `json:"description,omitempty"`
	ID          string             `json:"id,omitempty"`
	Name        string             `json:"name,omitempty"`
	NumCells    int                `json:"num_cells"`
	Secret      *bool              `json:"secret,omitempty"`
	Status      string             `json:"status,omitempty"`
	UpdatedAt   *time.Time         `json:"updated_at,omitempty"`
	Uploads     []DLPDatasetUpload `json:"uploads"`
}

DLPDataset represents a DLP Exact Data Match dataset or Custom Word List.

type DLPDatasetGetResponse added in v0.87.0

type DLPDatasetGetResponse struct {
	Result DLPDataset `json:"result"`
	Response
}

type DLPDatasetListResponse added in v0.87.0

type DLPDatasetListResponse struct {
	Result []DLPDataset `json:"result"`
	Response
}

type DLPDatasetUpload added in v0.87.0

type DLPDatasetUpload struct {
	NumCells int    `json:"num_cells"`
	Status   string `json:"status,omitempty"`
	Version  int    `json:"version"`
}

DLPDatasetUpload represents a single upload version attached to a DLP dataset.

type DLPEntry added in v0.53.0

type DLPEntry struct {
	ID        string `json:"id,omitempty"`
	Name      string `json:"name,omitempty"`
	ProfileID string `json:"profile_id,omitempty"`
	Enabled   *bool  `json:"enabled,omitempty"`
	Type      string `json:"type,omitempty"`

	Pattern   *DLPPattern `json:"pattern,omitempty"`
	CreatedAt *time.Time  `json:"created_at,omitempty"`
	UpdatedAt *time.Time  `json:"updated_at,omitempty"`
}

DLPEntry represents a DLP Entry, which can be matched in HTTP bodies or files.

type DLPPattern added in v0.53.0

type DLPPattern struct {
	Regex      string `json:"regex,omitempty"`
	Validation string `json:"validation,omitempty"`
}

DLPPattern represents a DLP Pattern that matches an entry.

type DLPPayloadLogSettings added in v0.62.0

type DLPPayloadLogSettings struct {
	PublicKey string `json:"public_key,omitempty"`

	// Only present in responses
	UpdatedAt *time.Time `json:"updated_at,omitempty"`
}

type DLPPayloadLogSettingsResponse added in v0.62.0

type DLPPayloadLogSettingsResponse struct {
	Response
	Result DLPPayloadLogSettings `json:"result"`
}

type DLPProfile added in v0.53.0

type DLPProfile struct {
	ID                string `json:"id,omitempty"`
	Name              string `json:"name,omitempty"`
	Type              string `json:"type,omitempty"`
	Description       string `json:"description,omitempty"`
	AllowedMatchCount int    `json:"allowed_match_count"`
	OCREnabled        *bool  `json:"ocr_enabled,omitempty"`

	ContextAwareness *DLPContextAwareness `json:"context_awareness,omitempty"`

	// The following fields are omitted for predefined DLP
	// profiles.
	Entries   []DLPEntry `json:"entries,omitempty"`
	CreatedAt *time.Time `json:"created_at,omitempty"`
	UpdatedAt *time.Time `json:"updated_at,omitempty"`
}

DLPProfile represents a DLP Profile, which contains a set of entries.

type DLPProfileListResponse added in v0.53.0

type DLPProfileListResponse struct {
	Result []DLPProfile `json:"result"`
	Response
}

DLPProfileListResponse represents the response from the list dlp profiles endpoint.

type DLPProfileResponse added in v0.53.0

type DLPProfileResponse struct {
	Success  bool       `json:"success"`
	Errors   []string   `json:"errors"`
	Messages []string   `json:"messages"`
	Result   DLPProfile `json:"result"`
}

DLPProfileResponse is the API response, containing a single access application.

type DLPProfilesCreateRequest added in v0.53.0

type DLPProfilesCreateRequest struct {
	Profiles []DLPProfile `json:"profiles"`
}

DLPProfilesCreateRequest represents a request to create a set of profiles.

type DNSFirewallAnalytics added in v0.29.0

type DNSFirewallAnalytics struct {
	Totals DNSFirewallAnalyticsMetrics `json:"totals"`
	Min    DNSFirewallAnalyticsMetrics `json:"min"`
	Max    DNSFirewallAnalyticsMetrics `json:"max"`
}

DNSFirewallAnalytics represents a set of aggregated DNS Firewall metrics. TODO: Add the queried data and not only the aggregated values.

type DNSFirewallAnalyticsMetrics added in v0.29.0

type DNSFirewallAnalyticsMetrics struct {
	QueryCount         *int64   `json:"queryCount"`
	UncachedCount      *int64   `json:"uncachedCount"`
	StaleCount         *int64   `json:"staleCount"`
	ResponseTimeAvg    *float64 `json:"responseTimeAvg"`
	ResponseTimeMedian *float64 `json:"responseTimeMedian"`
	ResponseTime90th   *float64 `json:"responseTime90th"`
	ResponseTime99th   *float64 `json:"responseTime99th"`
}

DNSFirewallAnalyticsMetrics represents a group of aggregated DNS Firewall metrics.

type DNSFirewallCluster added in v0.29.0

type DNSFirewallCluster struct {
	ID                   string   `json:"id,omitempty"`
	Name                 string   `json:"name"`
	UpstreamIPs          []string `json:"upstream_ips"`
	DNSFirewallIPs       []string `json:"dns_firewall_ips,omitempty"`
	MinimumCacheTTL      uint     `json:"minimum_cache_ttl,omitempty"`
	MaximumCacheTTL      uint     `json:"maximum_cache_ttl,omitempty"`
	DeprecateAnyRequests bool     `json:"deprecate_any_requests"`
	ModifiedOn           string   `json:"modified_on,omitempty"`
}

DNSFirewallCluster represents a DNS Firewall configuration.

type DNSFirewallUserAnalyticsOptions added in v0.29.0

type DNSFirewallUserAnalyticsOptions struct {
	Metrics []string   `url:"metrics,omitempty" del:","`
	Since   *time.Time `url:"since,omitempty"`
	Until   *time.Time `url:"until,omitempty"`
}

DNSFirewallUserAnalyticsOptions represents range and dimension selection on analytics endpoint.

type DNSListResponse added in v0.7.2

type DNSListResponse struct {
	Result []DNSRecord `json:"result"`
	Response
	ResultInfo `json:"result_info"`
}

DNSListResponse represents the response from the list DNS records endpoint.

type DNSRecord added in v0.7.2

type DNSRecord struct {
	CreatedOn  time.Time   `json:"created_on,omitempty"`
	ModifiedOn time.Time   `json:"modified_on,omitempty"`
	Type       string      `json:"type,omitempty"`
	Name       string      `json:"name,omitempty"`
	Content    string      `json:"content,omitempty"`
	Meta       interface{} `json:"meta,omitempty"`
	Data       interface{} `json:"data,omitempty"` // data returned by: SRV, LOC
	ID         string      `json:"id,omitempty"`
	ZoneID     string      `json:"zone_id,omitempty"`
	ZoneName   string      `json:"zone_name,omitempty"`
	Priority   *uint16     `json:"priority,omitempty"`
	TTL        int         `json:"ttl,omitempty"`
	Proxied    *bool       `json:"proxied,omitempty"`
	Proxiable  bool        `json:"proxiable,omitempty"`
	Comment    string      `json:"comment,omitempty"` // the server will omit the comment field when the comment is empty
	Tags       []string    `json:"tags,omitempty"`
}

DNSRecord represents a DNS record in a zone.

type DNSRecordResponse added in v0.7.2

type DNSRecordResponse struct {
	Result DNSRecord `json:"result"`
	Response
	ResultInfo `json:"result_info"`
}

DNSRecordResponse represents the response from the DNS endpoint.

type DeleteAPIShieldOperationParams added in v0.78.0

type DeleteAPIShieldOperationParams struct {
	// OperationID is the operation to be deleted
	OperationID string `url:"-"`
}

DeleteAPIShieldOperationParams represents the parameters to pass to delete an operation.

API documentation: https://developers.cloudflare.com/api/operations/api-shield-endpoint-management-delete-an-operation

type DeleteAPIShieldSchemaParams added in v0.79.0

type DeleteAPIShieldSchemaParams struct {
	// SchemaID is the schema to be deleted
	SchemaID string `url:"-"`
}

DeleteAPIShieldSchemaParams represents the parameters to pass to delete a schema.

API documentation: https://developers.cloudflare.com/api/operations/api-shield-schema-delete-a-schema

type DeleteAccessPolicyParams added in v0.71.0

type DeleteAccessPolicyParams struct {
	ApplicationID string `json:"-"`
	PolicyID      string `json:"-"`
}

type DeleteCustomNameserversParams added in v0.70.0

type DeleteCustomNameserversParams struct {
	NSName string
}

type DeleteDeviceSettingsPolicyResponse added in v0.52.0

type DeleteDeviceSettingsPolicyResponse struct {
	Response
	Result []DeviceSettingsPolicy
}

type DeleteHostnameTLSSettingCiphersParams added in v0.75.0

type DeleteHostnameTLSSettingCiphersParams struct {
	Hostname string
}

DeleteHostnameTLSSettingCiphersParams represents the data related to the per-hostname ciphers tls setting being deleted.

type DeleteHostnameTLSSettingParams added in v0.75.0

type DeleteHostnameTLSSettingParams struct {
	Setting  string
	Hostname string
}

DeleteHostnameTLSSettingParams represents the data related to the per-hostname tls setting being deleted.

type DeleteIPAddressFromAddressMapParams added in v0.63.0

type DeleteIPAddressFromAddressMapParams struct {
	// ID represents the target address map for adding the membershp.
	ID string
	IP string
}

type DeleteMagicTransitGRETunnelResponse added in v0.32.0

type DeleteMagicTransitGRETunnelResponse struct {
	Response
	Result struct {
		Deleted          bool                  `json:"deleted"`
		DeletedGRETunnel MagicTransitGRETunnel `json:"deleted_gre_tunnel"`
	} `json:"result"`
}

DeleteMagicTransitGRETunnelResponse contains a response after deleting a GRE Tunnel.

type DeleteMagicTransitIPsecTunnelResponse added in v0.31.0

type DeleteMagicTransitIPsecTunnelResponse struct {
	Response
	Result struct {
		Deleted            bool                    `json:"deleted"`
		DeletedIPsecTunnel MagicTransitIPsecTunnel `json:"deleted_ipsec_tunnel"`
	} `json:"result"`
}

DeleteMagicTransitIPsecTunnelResponse contains a response after deleting an IPsec Tunnel.

type DeleteMagicTransitStaticRouteResponse added in v0.18.0

type DeleteMagicTransitStaticRouteResponse struct {
	Response
	Result struct {
		Deleted      bool                    `json:"deleted"`
		DeletedRoute MagicTransitStaticRoute `json:"deleted_route"`
	} `json:"result"`
}

DeleteMagicTransitStaticRouteResponse contains a static route deletion response.

type DeleteMembershipFromAddressMapParams added in v0.63.0

type DeleteMembershipFromAddressMapParams struct {
	// ID represents the target address map for removing the IP address.
	ID         string
	Membership AddressMapMembershipContainer
}

type DeleteObservatoryPageTestsParams added in v0.78.0

type DeleteObservatoryPageTestsParams struct {
	URL    string `url:"-"`
	Region string `url:"region"`
}

type DeleteObservatoryScheduledPageTestParams added in v0.78.0

type DeleteObservatoryScheduledPageTestParams struct {
	URL    string `url:"-"`
	Region string `url:"region"`
}

type DeletePagesDeploymentParams added in v0.40.0

type DeletePagesDeploymentParams struct {
	ProjectName  string `url:"-"`
	DeploymentID string `url:"-"`
	Force        bool   `url:"force,omitempty"`
}

type DeleteQueueConsumerParams added in v0.55.0

type DeleteQueueConsumerParams struct {
	QueueName, ConsumerName string
}

type DeleteWaitingRoomRuleParams added in v0.53.0

type DeleteWaitingRoomRuleParams struct {
	WaitingRoomID string
	RuleID        string
}

type DeleteWebAnalyticsRuleParams added in v0.75.0

type DeleteWebAnalyticsRuleParams struct {
	RulesetID string
	RuleID    string
}

type DeleteWebAnalyticsSiteParams added in v0.75.0

type DeleteWebAnalyticsSiteParams struct {
	SiteTag string
}

type DeleteWorkerParams added in v0.57.0

type DeleteWorkerParams struct {
	ScriptName string
}

type DeleteWorkersKVEntriesParams added in v0.55.0

type DeleteWorkersKVEntriesParams struct {
	NamespaceID string
	Keys        []string
}

type DeleteWorkersKVEntryParams added in v0.55.0

type DeleteWorkersKVEntryParams struct {
	NamespaceID string
	Key         string
}

type DeleteWorkersSecretParams added in v0.57.0

type DeleteWorkersSecretParams struct {
	ScriptName string
	SecretName string
}

type DeleteZoneHoldParams added in v0.75.0

type DeleteZoneHoldParams struct {
	HoldAfter *time.Time `url:"hold_after,omitempty"`
}

DeleteZoneHoldParams represents params for the Delete Zone Hold endpoint.

type DeviceClientCertificates added in v0.81.0

type DeviceClientCertificates struct {
	Response
	Result Enabled
}

DeviceClientCertificates identifies if the zero trust zone is configured for an account.

type DeviceDexTest added in v0.62.0

type DeviceDexTest struct {
	TestID      string             `json:"test_id"`
	Name        string             `json:"name"`
	Description string             `json:"description,omitempty"`
	Interval    string             `json:"interval"`
	Enabled     bool               `json:"enabled"`
	Updated     time.Time          `json:"updated"`
	Created     time.Time          `json:"created"`
	Data        *DeviceDexTestData `json:"data"`
}

type DeviceDexTestData added in v0.62.0

type DeviceDexTestData map[string]interface{}

type DeviceDexTestListResponse added in v0.62.0

type DeviceDexTestListResponse struct {
	Response
	Result DeviceDexTests `json:"result"`
}

type DeviceDexTestResponse added in v0.62.0

type DeviceDexTestResponse struct {
	Response
	Result DeviceDexTest `json:"result"`
}

type DeviceDexTests added in v0.62.0

type DeviceDexTests struct {
	DexTests []DeviceDexTest `json:"dex_tests"`
}

type DeviceManagedNetwork added in v0.57.0

type DeviceManagedNetwork struct {
	NetworkID string  `json:"network_id,omitempty"`
	Type      string  `json:"type"`
	Name      string  `json:"name"`
	Config    *Config `json:"config"`
}

type DeviceManagedNetworkListResponse added in v0.57.0

type DeviceManagedNetworkListResponse struct {
	Response
	Result []DeviceManagedNetwork `json:"result"`
}

type DeviceManagedNetworkResponse added in v0.57.0

type DeviceManagedNetworkResponse struct {
	Response
	Result DeviceManagedNetwork `json:"result"`
}

type DevicePostureIntegration added in v0.29.0

type DevicePostureIntegration struct {
	IntegrationID string                         `json:"id,omitempty"`
	Name          string                         `json:"name,omitempty"`
	Type          string                         `json:"type,omitempty"`
	Interval      string                         `json:"interval,omitempty"`
	Config        DevicePostureIntegrationConfig `json:"config,omitempty"`
}

DevicePostureIntegration represents a device posture integration.

type DevicePostureIntegrationConfig added in v0.29.0

type DevicePostureIntegrationConfig struct {
	ClientID           string `json:"client_id,omitempty"`
	ClientSecret       string `json:"client_secret,omitempty"`
	AuthUrl            string `json:"auth_url,omitempty"`
	ApiUrl             string `json:"api_url,omitempty"`
	ClientKey          string `json:"client_key,omitempty"`
	CustomerID         string `json:"customer_id,omitempty"`
	AccessClientID     string `json:"access_client_id,omitempty"`
	AccessClientSecret string `json:"access_client_secret,omitempty"`
}

DevicePostureIntegrationConfig contains authentication information for a device posture integration.

type DevicePostureIntegrationListResponse added in v0.29.0

type DevicePostureIntegrationListResponse struct {
	Result []DevicePostureIntegration `json:"result"`
	Response
	ResultInfo `json:"result_info"`
}

DevicePostureIntegrationListResponse represents the response from the list device posture integrations endpoint.

type DevicePostureIntegrationResponse added in v0.29.0

type DevicePostureIntegrationResponse struct {
	Result DevicePostureIntegration `json:"result"`
	Response
	ResultInfo `json:"result_info"`
}

DevicePostureIntegrationResponse represents the response from the get device posture integrations endpoint.

type DevicePostureRule added in v0.17.0

type DevicePostureRule struct {
	ID          string                   `json:"id,omitempty"`
	Type        string                   `json:"type"`
	Name        string                   `json:"name"`
	Description string                   `json:"description,omitempty"`
	Schedule    string                   `json:"schedule,omitempty"`
	Match       []DevicePostureRuleMatch `json:"match,omitempty"`
	Input       DevicePostureRuleInput   `json:"input,omitempty"`
	Expiration  string                   `json:"expiration,omitempty"`
}

DevicePostureRule represents a device posture rule.

type DevicePostureRuleDetailResponse added in v0.17.0

type DevicePostureRuleDetailResponse struct {
	Response
	Result DevicePostureRule `json:"result"`
}

DevicePostureRuleDetailResponse is the API response, containing a single device posture rule.

type DevicePostureRuleInput added in v0.17.0

type DevicePostureRuleInput struct {
	ID               string   `json:"id,omitempty"`
	Path             string   `json:"path,omitempty"`
	Exists           bool     `json:"exists,omitempty"`
	Thumbprint       string   `json:"thumbprint,omitempty"`
	Sha256           string   `json:"sha256,omitempty"`
	Running          bool     `json:"running,omitempty"`
	RequireAll       bool     `json:"requireAll,omitempty"`
	CheckDisks       []string `json:"checkDisks,omitempty"`
	Enabled          bool     `json:"enabled,omitempty"`
	Version          string   `json:"version,omitempty"`
	VersionOperator  string   `json:"versionOperator,omitempty"`
	Overall          string   `json:"overall,omitempty"`
	SensorConfig     string   `json:"sensor_config,omitempty"`
	Os               string   `json:"os,omitempty"`
	OsDistroName     string   `json:"os_distro_name,omitempty"`
	OsDistroRevision string   `json:"os_distro_revision,omitempty"`
	OSVersionExtra   string   `json:"os_version_extra,omitempty"`
	Operator         string   `json:"operator,omitempty"`
	Domain           string   `json:"domain,omitempty"`
	ComplianceStatus string   `json:"compliance_status,omitempty"`
	ConnectionID     string   `json:"connection_id,omitempty"`
	IssueCount       string   `json:"issue_count,omitempty"`
	CountOperator    string   `json:"countOperator,omitempty"`
	TotalScore       int      `json:"total_score,omitempty"`
	ScoreOperator    string   `json:"scoreOperator,omitempty"`
	CertificateID    string   `json:"certificate_id,omitempty"`
	CommonName       string   `json:"cn,omitempty"`
	ActiveThreats    int      `json:"active_threats,omitempty"`
	NetworkStatus    string   `json:"network_status,omitempty"`
	Infected         bool     `json:"infected,omitempty"`
	IsActive         bool     `json:"is_active,omitempty"`
	EidLastSeen      string   `json:"eid_last_seen,omitempty"`
	RiskLevel        string   `json:"risk_level,omitempty"`
	State            string   `json:"state,omitempty"`
	LastSeen         string   `json:"last_seen,omitempty"`
}

DevicePostureRuleInput represents the value to be checked against.

type DevicePostureRuleListResponse added in v0.17.0

type DevicePostureRuleListResponse struct {
	Result []DevicePostureRule `json:"result"`
	Response
	ResultInfo `json:"result_info"`
}

DevicePostureRuleListResponse represents the response from the list device posture rules endpoint.

type DevicePostureRuleMatch added in v0.17.0

type DevicePostureRuleMatch struct {
	Platform string `json:"platform,omitempty"`
}

DevicePostureRuleMatch represents the conditions that the client must match to run the rule.

type DeviceSettingsPolicy added in v0.52.0

type DeviceSettingsPolicy struct {
	ServiceModeV2       *ServiceModeV2    `json:"service_mode_v2"`
	DisableAutoFallback *bool             `json:"disable_auto_fallback"`
	FallbackDomains     *[]FallbackDomain `json:"fallback_domains"`
	Include             *[]SplitTunnel    `json:"include"`
	Exclude             *[]SplitTunnel    `json:"exclude"`
	GatewayUniqueID     *string           `json:"gateway_unique_id"`
	SupportURL          *string           `json:"support_url"`
	CaptivePortal       *int              `json:"captive_portal"`
	AllowModeSwitch     *bool             `json:"allow_mode_switch"`
	SwitchLocked        *bool             `json:"switch_locked"`
	AllowUpdates        *bool             `json:"allow_updates"`
	AutoConnect         *int              `json:"auto_connect"`
	AllowedToLeave      *bool             `json:"allowed_to_leave"`
	PolicyID            *string           `json:"policy_id"`
	Enabled             *bool             `json:"enabled"`
	Name                *string           `json:"name"`
	Match               *string           `json:"match"`
	Precedence          *int              `json:"precedence"`
	Default             bool              `json:"default"`
	ExcludeOfficeIps    *bool             `json:"exclude_office_ips"`
	Description         *string           `json:"description"`
	LANAllowMinutes     *uint             `json:"lan_allow_minutes"`
	LANAllowSubnetSize  *uint             `json:"lan_allow_subnet_size"`
}

type DeviceSettingsPolicyResponse added in v0.52.0

type DeviceSettingsPolicyResponse struct {
	Response
	Result DeviceSettingsPolicy
}

type DiagnosticsTracerouteConfiguration added in v0.13.1

type DiagnosticsTracerouteConfiguration struct {
	Targets []string                                  `json:"targets"`
	Colos   []string                                  `json:"colos,omitempty"`
	Options DiagnosticsTracerouteConfigurationOptions `json:"options,omitempty"`
}

DiagnosticsTracerouteConfiguration is the overarching structure of the diagnostics traceroute requests.

type DiagnosticsTracerouteConfigurationOptions added in v0.13.1

type DiagnosticsTracerouteConfigurationOptions struct {
	PacketsPerTTL int    `json:"packets_per_ttl"`
	PacketType    string `json:"packet_type"`
	MaxTTL        int    `json:"max_ttl"`
	WaitTime      int    `json:"wait_time"`
}

DiagnosticsTracerouteConfigurationOptions contains the options for performing traceroutes.

type DiagnosticsTracerouteResponse added in v0.13.1

type DiagnosticsTracerouteResponse struct {
	Response
	Result []DiagnosticsTracerouteResponseResult `json:"result"`
}

DiagnosticsTracerouteResponse is the outer response of the API response.

type DiagnosticsTracerouteResponseColo added in v0.13.1

type DiagnosticsTracerouteResponseColo struct {
	Name string `json:"name"`
	City string `json:"city"`
}

DiagnosticsTracerouteResponseColo contains the Name and City of a colocation.

type DiagnosticsTracerouteResponseColos added in v0.13.1

type DiagnosticsTracerouteResponseColos struct {
	Error            string                              `json:"error"`
	Colo             DiagnosticsTracerouteResponseColo   `json:"colo"`
	TracerouteTimeMs int                                 `json:"traceroute_time_ms"`
	TargetSummary    DiagnosticsTracerouteResponseNodes  `json:"target_summary"`
	Hops             []DiagnosticsTracerouteResponseHops `json:"hops"`
}

DiagnosticsTracerouteResponseColos is the summary struct of a colocation test.

type DiagnosticsTracerouteResponseHops added in v0.13.1

type DiagnosticsTracerouteResponseHops struct {
	PacketsTTL  int                                  `json:"packets_ttl"`
	PacketsSent int                                  `json:"packets_sent"`
	PacketsLost int                                  `json:"packets_lost"`
	Nodes       []DiagnosticsTracerouteResponseNodes `json:"nodes"`
}

DiagnosticsTracerouteResponseHops holds packet and node information of the hops.

type DiagnosticsTracerouteResponseNodes added in v0.13.1

type DiagnosticsTracerouteResponseNodes struct {
	Asn         string  `json:"asn"`
	IP          string  `json:"ip"`
	Name        string  `json:"name"`
	PacketCount int     `json:"packet_count"`
	MeanRttMs   float64 `json:"mean_rtt_ms"`
	StdDevRttMs float64 `json:"std_dev_rtt_ms"`
	MinRttMs    float64 `json:"min_rtt_ms"`
	MaxRttMs    float64 `json:"max_rtt_ms"`
}

DiagnosticsTracerouteResponseNodes holds a summary of nodes contacted in the traceroute.

type DiagnosticsTracerouteResponseResult added in v0.13.1

type DiagnosticsTracerouteResponseResult struct {
	Target string                               `json:"target"`
	Colos  []DiagnosticsTracerouteResponseColos `json:"colos"`
}

DiagnosticsTracerouteResponseResult is the inner API response for the traceroute request.

type DispatchNamespaceBinding added in v0.74.0

type DispatchNamespaceBinding struct {
	Binding   string
	Namespace string
	Outbound  *NamespaceOutboundOptions
}

DispatchNamespaceBinding is a binding to a Workers for Platforms namespace

https://developers.cloudflare.com/workers/platform/bindings/#dispatch-namespace-bindings-workers-for-platforms

func (DispatchNamespaceBinding) Type added in v0.74.0

Type returns the type of the binding.

type DomainDetails added in v0.44.0

type DomainDetails struct {
	Domain                string                `json:"domain"`
	ResolvesToRefs        []ResolvesToRefs      `json:"resolves_to_refs"`
	PopularityRank        int                   `json:"popularity_rank"`
	Application           Application           `json:"application"`
	RiskTypes             []interface{}         `json:"risk_types"`
	ContentCategories     []ContentCategories   `json:"content_categories"`
	AdditionalInformation AdditionalInformation `json:"additional_information"`
}

DomainDetails represents details for a domain.

type DomainDetailsResponse added in v0.44.0

type DomainDetailsResponse struct {
	Response
	Result DomainDetails `json:"result,omitempty"`
}

DomainDetailsResponse represents an API response for domain details.

type DomainHistory added in v0.44.0

type DomainHistory struct {
	Domain          string            `json:"domain"`
	Categorizations []Categorizations `json:"categorizations"`
}

DomainHistory represents the history for a domain.

type Duration added in v0.9.0

type Duration struct {
	time.Duration
}

Duration implements json.Marshaler and json.Unmarshaler for time.Duration using the fmt.Stringer interface of time.Duration and time.ParseDuration.

Example
d := Duration{1 * time.Second}
fmt.Println(d)

buf, err := json.Marshal(d)
fmt.Println(string(buf), err)

err = json.Unmarshal([]byte(`"5s"`), &d)
fmt.Println(d, err)

d.Duration += time.Second
fmt.Println(d, err)
Output:

1s
"1s" <nil>
5s <nil>
6s <nil>

func (Duration) MarshalJSON added in v0.9.0

func (d Duration) MarshalJSON() ([]byte, error)

MarshalJSON encodes a Duration as a JSON string formatted using String.

func (*Duration) UnmarshalJSON added in v0.9.0

func (d *Duration) UnmarshalJSON(buf []byte) error

UnmarshalJSON decodes a Duration from a JSON string parsed using time.ParseDuration.

type EgressSettings added in v0.59.0

type EgressSettings struct {
	Ipv6Range    string `json:"ipv6"`
	Ipv4         string `json:"ipv4"`
	Ipv4Fallback string `json:"ipv4_fallback"`
}

type EmailRoutingCatchAllRule added in v0.47.0

type EmailRoutingCatchAllRule struct {
	Tag      string                    `json:"tag,omitempty"`
	Name     string                    `json:"name,omitempty"`
	Enabled  *bool                     `json:"enabled,omitempty"`
	Matchers []EmailRoutingRuleMatcher `json:"matchers,omitempty"`
	Actions  []EmailRoutingRuleAction  `json:"actions,omitempty"`
}

type EmailRoutingCatchAllRuleResponse added in v0.49.0

type EmailRoutingCatchAllRuleResponse struct {
	Result EmailRoutingCatchAllRule `json:"result"`
	Response
}

type EmailRoutingDNSSettingsResponse added in v0.47.0

type EmailRoutingDNSSettingsResponse struct {
	Result []DNSRecord `json:"result,omitempty"`
	Response
}

type EmailRoutingDestinationAddress added in v0.47.0

type EmailRoutingDestinationAddress struct {
	Tag      string     `json:"tag,omitempty"`
	Email    string     `json:"email,omitempty"`
	Verified *time.Time `json:"verified,omitempty"`
	Created  *time.Time `json:"created,omitempty"`
	Modified *time.Time `json:"modified,omitempty"`
}

type EmailRoutingRule added in v0.47.0

type EmailRoutingRule struct {
	Tag      string                    `json:"tag,omitempty"`
	Name     string                    `json:"name,omitempty"`
	Priority int                       `json:"priority,omitempty"`
	Enabled  *bool                     `json:"enabled,omitempty"`
	Matchers []EmailRoutingRuleMatcher `json:"matchers,omitempty"`
	Actions  []EmailRoutingRuleAction  `json:"actions,omitempty"`
}

type EmailRoutingRuleAction added in v0.47.0

type EmailRoutingRuleAction struct {
	Type  string   `json:"type,omitempty"`
	Value []string `json:"value,omitempty"`
}

type EmailRoutingRuleMatcher added in v0.47.0

type EmailRoutingRuleMatcher struct {
	Type  string `json:"type,omitempty"`
	Field string `json:"field,omitempty"`
	Value string `json:"value,omitempty"`
}

type EmailRoutingSettings added in v0.47.0

type EmailRoutingSettings struct {
	Tag        string     `json:"tag,omitempty"`
	Name       string     `json:"name,omitempty"`
	Enabled    bool       `json:"enabled,omitempty"`
	Created    *time.Time `json:"created,omitempty"`
	Modified   *time.Time `json:"modified,omitempty"`
	SkipWizard *bool      `json:"skip_wizard,omitempty"`
	Status     string     `json:"status,omitempty"`
}

type EmailRoutingSettingsResponse added in v0.47.0

type EmailRoutingSettingsResponse struct {
	Result EmailRoutingSettings `json:"result,omitempty"`
	Response
}

type Enabled added in v0.33.0

type Enabled struct {
	Enabled bool `json:"enabled"`
}

type EnvVarType added in v0.56.0

type EnvVarType string
const (
	PlainText  EnvVarType = "plain_text"
	SecretText EnvVarType = "secret_text"
)

type EnvironmentVariable added in v0.56.0

type EnvironmentVariable struct {
	Value string     `json:"value"`
	Type  EnvVarType `json:"type"`
}

PagesProjectDeploymentVar represents a deployment environment variable.

type EnvironmentVariableMap added in v0.56.0

type EnvironmentVariableMap map[string]*EnvironmentVariable

type Error

type Error struct {
	// The classification of error encountered.
	Type ErrorType

	// StatusCode is the HTTP status code from the response.
	StatusCode int

	// Errors is all of the error messages and codes, combined.
	Errors []ResponseInfo

	// ErrorCodes is a list of all the error codes.
	ErrorCodes []int

	// ErrorMessages is a list of all the error codes.
	ErrorMessages []string

	// Messages is a list of informational messages provided by the endpoint.
	Messages []ResponseInfo

	// RayID is the internal identifier for the request that was made.
	RayID string
}

func (*Error) ClientError added in v0.36.0

func (e *Error) ClientError() bool

ClientError returns a boolean whether or not the raised error was caused by something client side.

func (*Error) ClientRateLimited added in v0.36.0

func (e *Error) ClientRateLimited() bool

ClientRateLimited returns a boolean whether or not the raised error was caused by too many requests from the client.

func (Error) Error added in v0.36.0

func (e Error) Error() string

func (*Error) ErrorMessageContains added in v0.36.0

func (e *Error) ErrorMessageContains(s string) bool

ErrorMessageContains returns a boolean whether or not a substring exists in any of the `e.ErrorMessages` slice entries.

func (*Error) InternalErrorCodeIs added in v0.36.0

func (e *Error) InternalErrorCodeIs(code int) bool

InternalErrorCodeIs returns a boolean whether or not the desired internal error code is present in `e.InternalErrorCodes`.

type ErrorType added in v0.36.0

type ErrorType string
const (
	ErrorTypeRequest        ErrorType = "request"
	ErrorTypeAuthentication ErrorType = "authentication"
	ErrorTypeAuthorization  ErrorType = "authorization"
	ErrorTypeNotFound       ErrorType = "not_found"
	ErrorTypeRateLimit      ErrorType = "rate_limit"
	ErrorTypeService        ErrorType = "service"
)

type ExportDNSRecordsParams added in v0.66.0

type ExportDNSRecordsParams struct{}

type FallbackDomain added in v0.29.0

type FallbackDomain struct {
	Suffix      string   `json:"suffix,omitempty"`
	Description string   `json:"description,omitempty"`
	DNSServer   []string `json:"dns_server,omitempty"`
}

FallbackDomain represents the individual domain struct.

type FallbackDomainResponse added in v0.29.0

type FallbackDomainResponse struct {
	Response
	Result []FallbackDomain `json:"result"`
}

FallbackDomainResponse represents the response from the get fallback domain endpoints.

type FallbackOrigin added in v0.10.1

type FallbackOrigin struct {
	Value string `json:"value"`
	ID    string `json:"id,omitempty"`
}

FallbackOrigin describes a fallback origin.

type FallbackOriginResponse added in v0.10.1

type FallbackOriginResponse struct {
	Response
	Result FallbackOrigin `json:"result"`
}

FallbackOriginResponse represents the response from the fallback_origin endpoint.

type Filter added in v0.9.0

type Filter struct {
	ID          string `json:"id,omitempty"`
	Expression  string `json:"expression"`
	Paused      bool   `json:"paused"`
	Description string `json:"description"`

	// Property is mentioned in documentation however isn't populated in
	// any of the API requests. For now, let's just omit it unless it's
	// provided.
	Ref string `json:"ref,omitempty"`
}

Filter holds the structure of the filter type.

type FilterCreateParams added in v0.47.0

type FilterCreateParams struct {
	ID          string `json:"id,omitempty"`
	Expression  string `json:"expression"`
	Paused      bool   `json:"paused"`
	Description string `json:"description"`
	Ref         string `json:"ref,omitempty"`
}

FilterCreateParams contains required and optional params for creating a filter.

type FilterDetailResponse added in v0.9.0

type FilterDetailResponse struct {
	Result     Filter `json:"result"`
	ResultInfo `json:"result_info"`
	Response
}

FilterDetailResponse is the API response that is returned for requesting a single filter on a zone.

type FilterListParams

type FilterListParams struct {
	ResultInfo
}

type FilterUpdateParams

type FilterUpdateParams struct {
	ID          string `json:"id"`
	Expression  string `json:"expression"`
	Paused      bool   `json:"paused"`
	Description string `json:"description"`
	Ref         string `json:"ref,omitempty"`
}

FilterUpdateParams contains required and optional params for updating a filter.

type FilterValidateExpression added in v0.9.0

type FilterValidateExpression struct {
	Expression string `json:"expression"`
}

FilterValidateExpression represents the JSON payload for checking an expression.

type FilterValidateExpressionResponse added in v0.9.0

type FilterValidateExpressionResponse struct {
	Success bool                                `json:"success"`
	Errors  []FilterValidationExpressionMessage `json:"errors"`
}

FilterValidateExpressionResponse represents the API response for checking the expression. It conforms to the JSON API approach however we don't need all of the fields exposed.

type FilterValidationExpressionMessage added in v0.9.0

type FilterValidationExpressionMessage struct {
	Message string `json:"message"`
}

FilterValidationExpressionMessage represents the API error message.

type FiltersDetailResponse added in v0.9.0

type FiltersDetailResponse struct {
	Result     []Filter `json:"result"`
	ResultInfo `json:"result_info"`
	Response
}

FiltersDetailResponse is the API response that is returned for requesting all filters on a zone.

type FirewallRule added in v0.9.0

type FirewallRule struct {
	ID          string      `json:"id,omitempty"`
	Paused      bool        `json:"paused"`
	Description string      `json:"description"`
	Action      string      `json:"action"`
	Priority    interface{} `json:"priority"`
	Filter      Filter      `json:"filter"`
	Products    []string    `json:"products,omitempty"`
	Ref         string      `json:"ref,omitempty"`
	CreatedOn   time.Time   `json:"created_on,omitempty"`
	ModifiedOn  time.Time   `json:"modified_on,omitempty"`
}

FirewallRule is the struct of the firewall rule.

type FirewallRuleCreateParams added in v0.47.0

type FirewallRuleCreateParams struct {
	ID          string      `json:"id,omitempty"`
	Paused      bool        `json:"paused"`
	Description string      `json:"description"`
	Action      string      `json:"action"`
	Priority    interface{} `json:"priority"`
	Filter      Filter      `json:"filter"`
	Products    []string    `json:"products,omitempty"`
	Ref         string      `json:"ref,omitempty"`
}

FirewallRuleCreateParams contains required and optional params for creating a firewall rule.

type FirewallRuleListParams

type FirewallRuleListParams struct {
	ResultInfo
}

type FirewallRuleResponse added in v0.9.0

type FirewallRuleResponse struct {
	Result     FirewallRule `json:"result"`
	ResultInfo `json:"result_info"`
	Response
}

FirewallRuleResponse is the API response that is returned for requesting a single firewall rule on a zone.

type FirewallRuleUpdateParams

type FirewallRuleUpdateParams struct {
	ID          string      `json:"id"`
	Paused      bool        `json:"paused"`
	Description string      `json:"description"`
	Action      string      `json:"action"`
	Priority    interface{} `json:"priority"`
	Filter      Filter      `json:"filter"`
	Products    []string    `json:"products,omitempty"`
	Ref         string      `json:"ref,omitempty"`
}

FirewallRuleUpdateParams contains required and optional params for updating a firewall rule.

type FirewallRulesDetailResponse added in v0.9.0

type FirewallRulesDetailResponse struct {
	Result     []FirewallRule `json:"result"`
	ResultInfo `json:"result_info"`
	Response
}

FirewallRulesDetailResponse is the API response for the firewall rules.

type GenerateMagicTransitIPsecTunnelPSKResponse added in v0.41.0

type GenerateMagicTransitIPsecTunnelPSKResponse struct {
	Response
	Result struct {
		Psk         string                              `json:"psk"`
		PskMetadata *MagicTransitIPsecTunnelPskMetadata `json:"psk_metadata"`
	} `json:"result"`
}

GenerateMagicTransitIPsecTunnelPSKResponse contains a response after generating IPsec Tunnel.

type GetAPIShieldOperationParams added in v0.78.0

type GetAPIShieldOperationParams struct {
	// The Operation ID to retrieve
	OperationID string `url:"-"`
	// Features represents a set of features to return in `features` object when
	// performing making read requests against an Operation or listing operations.
	Features []string `url:"feature,omitempty"`
}

GetAPIShieldOperationParams represents the parameters to pass when retrieving an operation.

API documentation: https://developers.cloudflare.com/api/operations/api-shield-endpoint-management-retrieve-information-about-an-operation

type GetAPIShieldOperationSchemaValidationSettingsParams added in v0.80.0

type GetAPIShieldOperationSchemaValidationSettingsParams struct {
	// The Operation ID to apply the mitigation action to
	OperationID string `url:"-"`
}

GetAPIShieldOperationSchemaValidationSettingsParams represents the parameters to pass to retrieve the schema validation settings set on the operation.

API documentation: https://developers.cloudflare.com/api/operations/api-shield-schema-validation-retrieve-operation-level-settings

type GetAPIShieldSchemaParams added in v0.79.0

type GetAPIShieldSchemaParams struct {
	// SchemaID is the ID of the schema to retrieve
	SchemaID string `url:"-"`

	// OmitSource specifies whether the contents of the schema should be returned in the "Source" field.
	OmitSource *bool `url:"omit_source,omitempty"`
}

GetAPIShieldSchemaParams represents the parameters to pass when retrieving a schema with a given schema ID.

API documentation: https://developers.cloudflare.com/api/operations/api-shield-schema-validation-retrieve-information-about-specific-schema

type GetAccessMutualTLSHostnameSettingsResponse added in v0.90.0

type GetAccessMutualTLSHostnameSettingsResponse struct {
	Response
	Result []AccessMutualTLSHostnameSettings `json:"result"`
}

type GetAccessOrganizationParams added in v0.71.0

type GetAccessOrganizationParams struct{}

type GetAccessPolicyParams added in v0.71.0

type GetAccessPolicyParams struct {
	ApplicationID string `json:"-"`
	PolicyID      string `json:"-"`
}

type GetAccessUserLastSeenIdentityResult added in v0.81.0

type GetAccessUserLastSeenIdentityResult struct {
	AccountID          string                             `json:"account_id"`
	AuthStatus         string                             `json:"auth_status"`
	CommonName         string                             `json:"common_name"`
	DevicePosture      map[string]AccessUserDevicePosture `json:"devicePosture"`
	DeviceSessions     map[string]AccessUserDeviceSession `json:"device_sessions"`
	DeviceID           string                             `json:"device_id"`
	Email              string                             `json:"email"`
	Geo                AccessUserIdentityGeo              `json:"geo"`
	IAT                int64                              `json:"iat"`
	IDP                AccessUserIDP                      `json:"idp"`
	IP                 string                             `json:"ip"`
	IsGateway          *bool                              `json:"is_gateway"`
	IsWarp             *bool                              `json:"is_warp"`
	MtlsAuth           AccessUserMTLSAuth                 `json:"mtls_auth"`
	ServiceTokenID     string                             `json:"service_token_id"`
	ServiceTokenStatus *bool                              `json:"service_token_status"`
	UserUUID           string                             `json:"user_uuid"`
	Version            int                                `json:"version"`
}

type GetAccessUserSingleActiveSessionResponse added in v0.81.0

type GetAccessUserSingleActiveSessionResponse struct {
	Result     GetAccessUserSingleActiveSessionResult `json:"result"`
	ResultInfo `json:"result_info"`
	Response
}

type GetAccessUserSingleActiveSessionResult added in v0.81.0

type GetAccessUserSingleActiveSessionResult struct {
	AccountID          string                             `json:"account_id"`
	AuthStatus         string                             `json:"auth_status"`
	CommonName         string                             `json:"common_name"`
	DevicePosture      map[string]AccessUserDevicePosture `json:"devicePosture"`
	DeviceSessions     map[string]AccessUserDeviceSession `json:"device_sessions"`
	DeviceID           string                             `json:"device_id"`
	Email              string                             `json:"email"`
	Geo                AccessUserIdentityGeo              `json:"geo"`
	IAT                int64                              `json:"iat"`
	IDP                AccessUserIDP                      `json:"idp"`
	IP                 string                             `json:"ip"`
	IsGateway          *bool                              `json:"is_gateway"`
	IsWarp             *bool                              `json:"is_warp"`
	MtlsAuth           AccessUserMTLSAuth                 `json:"mtls_auth"`
	ServiceTokenID     string                             `json:"service_token_id"`
	ServiceTokenStatus *bool                              `json:"service_token_status"`
	UserUUID           string                             `json:"user_uuid"`
	Version            int                                `json:"version"`
	IsActive           *bool                              `json:"isActive"`
}

type GetAddressMapResponse added in v0.63.0

type GetAddressMapResponse struct {
	Response
	Result AddressMap `json:"result"`
}

GetAddressMapResponse contains a specific address map's API Response.

type GetAdvertisementStatusResponse added in v0.11.7

type GetAdvertisementStatusResponse struct {
	Response
	Result AdvertisementStatus `json:"result"`
}

GetAdvertisementStatusResponse contains an API Response for the BGP status of the IP Prefix.

type GetAuditSSHSettingsParams added in v0.79.0

type GetAuditSSHSettingsParams struct{}

type GetBulkDomainDetailsParameters added in v0.44.0

type GetBulkDomainDetailsParameters struct {
	AccountID string   `url:"-"`
	Domains   []string `url:"domain"`
}

GetBulkDomainDetailsParameters represents the parameters for bulk domain details request.

type GetBulkDomainDetailsResponse added in v0.44.0

type GetBulkDomainDetailsResponse struct {
	Response
	Result []DomainDetails `json:"result,omitempty"`
}

GetBulkDomainDetailsResponse represents an API response for bulk domain details.

type GetCacheReserveParams added in v0.68.0

type GetCacheReserveParams struct{}

type GetCustomNameserverZoneMetadataParams added in v0.70.0

type GetCustomNameserverZoneMetadataParams struct{}

type GetCustomNameserversParams added in v0.70.0

type GetCustomNameserversParams struct{}

type GetDCVDelegationParams added in v0.77.0

type GetDCVDelegationParams struct{}

type GetDLPPayloadLogSettingsParams added in v0.62.0

type GetDLPPayloadLogSettingsParams struct{}

type GetDNSFirewallClusterParams added in v0.70.0

type GetDNSFirewallClusterParams struct {
	ClusterID string `json:"-"`
}

type GetDNSFirewallUserAnalyticsParams added in v0.70.0

type GetDNSFirewallUserAnalyticsParams struct {
	ClusterID string `json:"-"`
	DNSFirewallUserAnalyticsOptions
}

type GetDefaultDeviceSettingsPolicyParams added in v0.81.0

type GetDefaultDeviceSettingsPolicyParams struct{}

type GetDeviceClientCertificatesParams added in v0.81.0

type GetDeviceClientCertificatesParams struct{}

type GetDeviceSettingsPolicyParams added in v0.81.0

type GetDeviceSettingsPolicyParams struct {
	PolicyID *string `json:"-"`
}

type GetDomainDetailsParameters added in v0.44.0

type GetDomainDetailsParameters struct {
	AccountID string `url:"-"`
	Domain    string `url:"domain,omitempty"`
}

GetDomainDetailsParameters represent the parameters for a domain details request.

type GetDomainHistoryParameters added in v0.44.0

type GetDomainHistoryParameters struct {
	AccountID string `url:"-"`
	Domain    string `url:"domain,omitempty"`
}

GetDomainHistoryParameters represents the parameters for domain history request.

type GetDomainHistoryResponse added in v0.44.0

type GetDomainHistoryResponse struct {
	Response
	Result []DomainHistory `json:"result,omitempty"`
}

GetDomainHistoryResponse represents an API response for domain history.

type GetEligibleZonesAccountCustomNameserversParams added in v0.70.0

type GetEligibleZonesAccountCustomNameserversParams struct{}

type GetEmailRoutingRuleResponse added in v0.47.0

type GetEmailRoutingRuleResponse struct {
	Result EmailRoutingRule `json:"result"`
	Response
}

type GetIPPrefixResponse added in v0.11.7

type GetIPPrefixResponse struct {
	Response
	Result IPPrefix `json:"result"`
}

GetIPPrefixResponse contains a specific IP prefix's API Response.

type GetLogpushFieldsParams added in v0.72.0

type GetLogpushFieldsParams struct {
	Dataset string `json:"-"`
}

type GetLogpushOwnershipChallengeParams added in v0.72.0

type GetLogpushOwnershipChallengeParams struct {
	DestinationConf string `json:"destination_conf"`
}

type GetMagicFirewallRulesetResponse added in v0.13.7

type GetMagicFirewallRulesetResponse struct {
	Response
	Result MagicFirewallRuleset `json:"result"`
}

GetMagicFirewallRulesetResponse contains a single Magic Firewall Ruleset.

type GetMagicTransitGRETunnelResponse added in v0.32.0

type GetMagicTransitGRETunnelResponse struct {
	Response
	Result struct {
		GRETunnel MagicTransitGRETunnel `json:"gre_tunnel"`
	} `json:"result"`
}

GetMagicTransitGRETunnelResponse contains a response including zero or one GRE tunnels.

type GetMagicTransitIPsecTunnelResponse added in v0.31.0

type GetMagicTransitIPsecTunnelResponse struct {
	Response
	Result struct {
		IPsecTunnel MagicTransitIPsecTunnel `json:"ipsec_tunnel"`
	} `json:"result"`
}

GetMagicTransitIPsecTunnelResponse contains a response including zero or one IPsec tunnels.

type GetMagicTransitStaticRouteResponse added in v0.18.0

type GetMagicTransitStaticRouteResponse struct {
	Response
	Result struct {
		Route MagicTransitStaticRoute `json:"route"`
	} `json:"result"`
}

GetMagicTransitStaticRouteResponse contains a response including exactly one static route.

type GetObservatoryPageTestParams added in v0.78.0

type GetObservatoryPageTestParams struct {
	URL    string
	TestID string
}

type GetObservatoryPageTrendParams added in v0.78.0

type GetObservatoryPageTrendParams struct {
	URL        string     `url:"-"`
	Region     string     `url:"region"`
	DeviceType string     `url:"deviceType"`
	Start      *time.Time `url:"start"`
	End        *time.Time `url:"end,omitempty"`
	Timezone   string     `url:"tz"`
	Metrics    []string   `url:"metrics"`
}

type GetObservatoryScheduledPageTestParams added in v0.78.0

type GetObservatoryScheduledPageTestParams struct {
	URL    string `url:"-"`
	Region string `url:"region"`
}

type GetPageShieldSettingsParams added in v0.84.0

type GetPageShieldSettingsParams struct{}

type GetPagesDeploymentInfoParams added in v0.40.0

type GetPagesDeploymentInfoParams struct {
	ProjectName  string
	DeploymentID string
}

type GetPagesDeploymentLogsParams added in v0.43.0

type GetPagesDeploymentLogsParams struct {
	ProjectName  string
	DeploymentID string

	SizeOptions
}

type GetPagesDeploymentStageLogsParams added in v0.40.0

type GetPagesDeploymentStageLogsParams struct {
	ProjectName  string
	DeploymentID string
	StageName    string

	SizeOptions
}

type GetRegionalTieredCacheParams added in v0.73.0

type GetRegionalTieredCacheParams struct{}

type GetRulesetResponse added in v0.19.0

type GetRulesetResponse struct {
	Response
	Result Ruleset `json:"result"`
}

GetRulesetResponse contains a single Ruleset.

type GetWebAnalyticsSiteParams added in v0.75.0

type GetWebAnalyticsSiteParams struct {
	SiteTag string
}

type GetWorkersForPlatformsDispatchNamespaceResponse added in v0.90.0

type GetWorkersForPlatformsDispatchNamespaceResponse struct {
	Response
	Result WorkersForPlatformsDispatchNamespace `json:"result"`
}

type GetWorkersKVParams added in v0.55.0

type GetWorkersKVParams struct {
	NamespaceID string
	Key         string
}

type GetZarazConfigsByIdResponse added in v0.86.0

type GetZarazConfigsByIdResponse = map[string]interface{}

type GetZoneHoldParams added in v0.75.0

type GetZoneHoldParams struct{}

type GetZoneSettingParams added in v0.64.0

type GetZoneSettingParams struct {
	Name       string `json:"-"`
	PathPrefix string `json:"-"`
}

type Healthcheck added in v0.11.1

type Healthcheck struct {
	ID                   string                 `json:"id,omitempty"`
	CreatedOn            *time.Time             `json:"created_on,omitempty"`
	ModifiedOn           *time.Time             `json:"modified_on,omitempty"`
	Name                 string                 `json:"name"`
	Description          string                 `json:"description"`
	Suspended            bool                   `json:"suspended"`
	Address              string                 `json:"address"`
	Retries              int                    `json:"retries,omitempty"`
	Timeout              int                    `json:"timeout,omitempty"`
	Interval             int                    `json:"interval,omitempty"`
	ConsecutiveSuccesses int                    `json:"consecutive_successes,omitempty"`
	ConsecutiveFails     int                    `json:"consecutive_fails,omitempty"`
	Type                 string                 `json:"type,omitempty"`
	CheckRegions         []string               `json:"check_regions"`
	HTTPConfig           *HealthcheckHTTPConfig `json:"http_config,omitempty"`
	TCPConfig            *HealthcheckTCPConfig  `json:"tcp_config,omitempty"`
	Status               string                 `json:"status"`
	FailureReason        string                 `json:"failure_reason"`
}

Healthcheck describes a Healthcheck object.

type HealthcheckHTTPConfig added in v0.11.1

type HealthcheckHTTPConfig struct {
	Method          string              `json:"method"`
	Port            uint16              `json:"port,omitempty"`
	Path            string              `json:"path"`
	ExpectedCodes   []string            `json:"expected_codes"`
	ExpectedBody    string              `json:"expected_body"`
	FollowRedirects bool                `json:"follow_redirects"`
	AllowInsecure   bool                `json:"allow_insecure"`
	Header          map[string][]string `json:"header"`
}

HealthcheckHTTPConfig describes configuration for a HTTP healthcheck.

type HealthcheckListResponse

type HealthcheckListResponse struct {
	Response
	Result     []Healthcheck `json:"result"`
	ResultInfo `json:"result_info"`
}

HealthcheckListResponse is the API response, containing an array of healthchecks.

type HealthcheckResponse added in v0.11.1

type HealthcheckResponse struct {
	Response
	Result Healthcheck `json:"result"`
}

HealthcheckResponse is the API response, containing a single healthcheck.

type HealthcheckTCPConfig added in v0.11.5

type HealthcheckTCPConfig struct {
	Method string `json:"method"`
	Port   uint16 `json:"port,omitempty"`
}

HealthcheckTCPConfig describes configuration for a TCP healthcheck.

type Hostname added in v0.68.0

type Hostname struct {
	UrlHostname string `json:"url_hostname"`
}

type HostnameTLSSetting added in v0.75.0

type HostnameTLSSetting struct {
	Hostname  string     `json:"hostname"`
	Value     string     `json:"value"`
	Status    string     `json:"status"`
	CreatedAt *time.Time `json:"created_at"`
	UpdatedAt *time.Time `json:"updated_at"`
}

HostnameTLSSetting represents the metadata for a user-created tls setting.

type HostnameTLSSettingCiphers added in v0.75.0

type HostnameTLSSettingCiphers struct {
	Hostname  string     `json:"hostname"`
	Value     []string   `json:"value"`
	Status    string     `json:"status"`
	CreatedAt *time.Time `json:"created_at"`
	UpdatedAt *time.Time `json:"updated_at"`
}

HostnameTLSSettingCiphers represents the metadata for a user-created ciphers tls setting.

type HostnameTLSSettingCiphersResponse added in v0.75.0

type HostnameTLSSettingCiphersResponse struct {
	Response
	Result HostnameTLSSettingCiphers `json:"result"`
}

HostnameTLSSettingCiphersResponse represents the response from the PUT and DELETE endpoints for per-hostname ciphers tls settings.

type HostnameTLSSettingResponse added in v0.75.0

type HostnameTLSSettingResponse struct {
	Response
	Result HostnameTLSSetting `json:"result"`
}

HostnameTLSSettingResponse represents the response from the PUT and DELETE endpoints for per-hostname tls settings.

type HostnameTLSSettingsCiphersResponse added in v0.75.0

type HostnameTLSSettingsCiphersResponse struct {
	Response
	Result     []HostnameTLSSettingCiphers `json:"result"`
	ResultInfo `json:"result_info"`
}

HostnameTLSSettingsCiphersResponse represents the response from the retrieval endpoint for per-hostname ciphers tls settings.

type HostnameTLSSettingsResponse added in v0.75.0

type HostnameTLSSettingsResponse struct {
	Response
	Result     []HostnameTLSSetting `json:"result"`
	ResultInfo `json:"result_info"`
}

HostnameTLSSettingsResponse represents the response from the retrieval endpoint for per-hostname tls settings.

type HyperdriveConfig added in v0.88.0

type HyperdriveConfig struct {
	ID      string                  `json:"id,omitempty"`
	Name    string                  `json:"name,omitempty"`
	Origin  HyperdriveConfigOrigin  `json:"origin,omitempty"`
	Caching HyperdriveConfigCaching `json:"caching,omitempty"`
}

type HyperdriveConfigCaching added in v0.88.0

type HyperdriveConfigCaching struct {
	Disabled             *bool `json:"disabled,omitempty"`
	MaxAge               int   `json:"max_age,omitempty"`
	StaleWhileRevalidate int   `json:"stale_while_revalidate,omitempty"`
}

type HyperdriveConfigListResponse

type HyperdriveConfigListResponse struct {
	Response
	Result []HyperdriveConfig `json:"result"`
}

type HyperdriveConfigOrigin added in v0.88.0

type HyperdriveConfigOrigin struct {
	Database string `json:"database,omitempty"`
	Password string `json:"password"`
	Host     string `json:"host,omitempty"`
	Port     int    `json:"port,omitempty"`
	Scheme   string `json:"scheme,omitempty"`
	User     string `json:"user,omitempty"`
}

type HyperdriveConfigResponse added in v0.88.0

type HyperdriveConfigResponse struct {
	Response
	Result HyperdriveConfig `json:"result"`
}

type IPAccessRule added in v0.82.0

type IPAccessRule struct {
	AllowedModes  []IPAccessRulesModeOption `json:"allowed_modes"`
	Configuration IPAccessRuleConfiguration `json:"configuration"`
	CreatedOn     string                    `json:"created_on"`
	ID            string                    `json:"id"`
	Mode          IPAccessRulesModeOption   `json:"mode"`
	ModifiedOn    string                    `json:"modified_on"`
	Notes         string                    `json:"notes"`
}

type IPAccessRuleConfiguration added in v0.82.0

type IPAccessRuleConfiguration struct {
	Target string `json:"target,omitempty"`
	Value  string `json:"value,omitempty"`
}

type IPAccessRulesModeOption added in v0.82.0

type IPAccessRulesModeOption string

type IPIntelligence added in v0.44.0

type IPIntelligence struct {
	IP           string       `json:"ip"`
	BelongsToRef BelongsToRef `json:"belongs_to_ref"`
	RiskTypes    []RiskTypes  `json:"risk_types"`
}

IPIntelligence represents IP intelligence information.

type IPIntelligenceItem added in v0.44.0

type IPIntelligenceItem struct {
	ID   int    `json:"id,omitempty"`
	Name string `json:"name,omitempty"`
}

IPIntelligenceItem represents an item in an IP list.

type IPIntelligenceListParameters added in v0.44.0

type IPIntelligenceListParameters struct {
	AccountID string
}

IPIntelligenceListParameters represents the parameters for an IP list request.

type IPIntelligenceListResponse added in v0.44.0

type IPIntelligenceListResponse struct {
	Response
	Result []IPIntelligenceItem `json:"result,omitempty"`
}

IPIntelligenceListResponse represents the response for an IP list API response.

type IPIntelligenceParameters added in v0.44.0

type IPIntelligenceParameters struct {
	AccountID string `url:"-"`
	IPv4      string `url:"ipv4,omitempty"`
	IPv6      string `url:"ipv6,omitempty"`
}

IPIntelligenceParameters represents parameters for an IP Intelligence request.

type IPIntelligencePassiveDNSParameters added in v0.44.0

type IPIntelligencePassiveDNSParameters struct {
	AccountID string `url:"-"`
	IPv4      string `url:"ipv4,omitempty"`
	Start     string `url:"start,omitempty"`
	End       string `url:"end,omitempty"`
	Page      int    `url:"page,omitempty"`
	PerPage   int    `url:"per_page,omitempty"`
}

IPIntelligencePassiveDNSParameters represents the parameters for a passive DNS request.

type IPIntelligencePassiveDNSResponse added in v0.44.0

type IPIntelligencePassiveDNSResponse struct {
	Response
	Result IPPassiveDNS `json:"result,omitempty"`
}

IPIntelligencePassiveDNSResponse represents a passive API response.

type IPIntelligenceResponse added in v0.44.0

type IPIntelligenceResponse struct {
	Response
	Result []IPIntelligence `json:"result,omitempty"`
}

IPIntelligenceResponse represents an IP Intelligence API response.

type IPList added in v0.13.0

type IPList struct {
	ID                    string     `json:"id"`
	Name                  string     `json:"name"`
	Description           string     `json:"description"`
	Kind                  string     `json:"kind"`
	NumItems              int        `json:"num_items"`
	NumReferencingFilters int        `json:"num_referencing_filters"`
	CreatedOn             *time.Time `json:"created_on"`
	ModifiedOn            *time.Time `json:"modified_on"`
}

IPList contains information about an IP List.

type IPListBulkOperation added in v0.13.0

type IPListBulkOperation struct {
	ID        string     `json:"id"`
	Status    string     `json:"status"`
	Error     string     `json:"error"`
	Completed *time.Time `json:"completed"`
}

IPListBulkOperation contains information about a Bulk Operation.

type IPListBulkOperationResponse added in v0.13.0

type IPListBulkOperationResponse struct {
	Response
	Result IPListBulkOperation `json:"result"`
}

IPListBulkOperationResponse contains information about a Bulk Operation.

type IPListCreateRequest added in v0.13.0

type IPListCreateRequest struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Kind        string `json:"kind"`
}

IPListCreateRequest contains data for a new IP List.

type IPListDeleteResponse added in v0.13.0

type IPListDeleteResponse struct {
	Response
	Result struct {
		ID string `json:"id"`
	} `json:"result"`
}

IPListDeleteResponse contains information about the deletion of an IP List.

type IPListItem added in v0.13.0

type IPListItem struct {
	ID         string     `json:"id"`
	IP         string     `json:"ip"`
	Comment    string     `json:"comment"`
	CreatedOn  *time.Time `json:"created_on"`
	ModifiedOn *time.Time `json:"modified_on"`
}

IPListItem contains information about a single IP List Item.

type IPListItemCreateRequest added in v0.13.0

type IPListItemCreateRequest struct {
	IP      string `json:"ip"`
	Comment string `json:"comment"`
}

IPListItemCreateRequest contains data for a new IP List Item.

type IPListItemCreateResponse added in v0.13.0

type IPListItemCreateResponse struct {
	Response
	Result struct {
		OperationID string `json:"operation_id"`
	} `json:"result"`
}

IPListItemCreateResponse contains information about the creation of an IP List Item.

type IPListItemDeleteItemRequest added in v0.13.0

type IPListItemDeleteItemRequest struct {
	ID string `json:"id"`
}

IPListItemDeleteItemRequest contains single IP List Items that shall be deleted.

type IPListItemDeleteRequest added in v0.13.0

type IPListItemDeleteRequest struct {
	Items []IPListItemDeleteItemRequest `json:"items"`
}

IPListItemDeleteRequest wraps IP List Items that shall be deleted.

type IPListItemDeleteResponse added in v0.13.0

type IPListItemDeleteResponse struct {
	Response
	Result struct {
		OperationID string `json:"operation_id"`
	} `json:"result"`
}

IPListItemDeleteResponse contains information about the deletion of an IP List Item.

type IPListItemsGetResponse added in v0.13.0

type IPListItemsGetResponse struct {
	Response
	Result IPListItem `json:"result"`
}

IPListItemsGetResponse contains information about a single IP List Item.

type IPListItemsListResponse added in v0.13.0

type IPListItemsListResponse struct {
	Response
	ResultInfo `json:"result_info"`
	Result     []IPListItem `json:"result"`
}

IPListItemsListResponse contains information about IP List Items.

type IPListListResponse added in v0.13.0

type IPListListResponse struct {
	Response
	Result []IPList `json:"result"`
}

IPListListResponse contains a slice of IP Lists.

type IPListResponse

type IPListResponse struct {
	Response
	Result IPList `json:"result"`
}

IPListResponse contains a single IP List.

type IPListUpdateRequest added in v0.13.0

type IPListUpdateRequest struct {
	Description string `json:"description"`
}

IPListUpdateRequest contains data for an IP List update.

type IPPassiveDNS added in v0.44.0

type IPPassiveDNS struct {
	ReverseRecords []ReverseRecords `json:"reverse_records,omitempty"`
	Count          int              `json:"count,omitempty"`
	Page           int              `json:"page,omitempty"`
	PerPage        int              `json:"per_page,omitempty"`
}

IPPassiveDNS represent DNS response.

type IPPrefix added in v0.11.7

type IPPrefix struct {
	ID                   string     `json:"id"`
	CreatedAt            *time.Time `json:"created_at"`
	ModifiedAt           *time.Time `json:"modified_at"`
	CIDR                 string     `json:"cidr"`
	AccountID            string     `json:"account_id"`
	Description          string     `json:"description"`
	Approved             string     `json:"approved"`
	OnDemandEnabled      bool       `json:"on_demand_enabled"`
	OnDemandLocked       bool       `json:"on_demand_locked"`
	Advertised           bool       `json:"advertised"`
	AdvertisedModifiedAt *time.Time `json:"advertised_modified_at"`
}

IPPrefix contains information about an IP prefix.

type IPPrefixUpdateRequest added in v0.11.7

type IPPrefixUpdateRequest struct {
	Description string `json:"description"`
}

IPPrefixUpdateRequest contains information about prefix updates.

type IPRanges added in v0.7.2

type IPRanges struct {
	IPv4CIDRs      []string `json:"ipv4_cidrs"`
	IPv6CIDRs      []string `json:"ipv6_cidrs"`
	ChinaIPv4CIDRs []string `json:"china_ipv4_cidrs"`
	ChinaIPv6CIDRs []string `json:"china_ipv6_cidrs"`
}

IPRanges contains lists of IPv4 and IPv6 CIDRs.

func IPs

func IPs() (IPRanges, error)

IPs gets a list of Cloudflare's IP ranges.

This does not require logging in to the API.

API reference: https://api.cloudflare.com/#cloudflare-ips

type IPRangesResponse added in v0.13.4

type IPRangesResponse struct {
	IPv4CIDRs  []string `json:"ipv4_cidrs"`
	IPv6CIDRs  []string `json:"ipv6_cidrs"`
	ChinaColos []string `json:"china_colos"`
}

IPRangesResponse contains the structure for the API response, not modified.

type IPsResponse added in v0.7.2

type IPsResponse struct {
	Response
	Result IPRangesResponse `json:"result"`
}

IPsResponse is the API response containing a list of IPs.

type Image added in v0.30.0

type Image struct {
	ID                string                 `json:"id"`
	Filename          string                 `json:"filename"`
	Meta              map[string]interface{} `json:"meta,omitempty"`
	RequireSignedURLs bool                   `json:"requireSignedURLs"`
	Variants          []string               `json:"variants"`
	Uploaded          time.Time              `json:"uploaded"`
}

Image represents a Cloudflare Image.

type ImageDetailsResponse added in v0.30.0

type ImageDetailsResponse struct {
	Result Image `json:"result"`
	Response
}

ImageDetailsResponse is the API response for getting an image's details.

type ImageDirectUploadURL added in v0.30.0

type ImageDirectUploadURL struct {
	ID        string `json:"id"`
	UploadURL string `json:"uploadURL"`
}

ImageDirectUploadURL .

type ImageDirectUploadURLResponse added in v0.30.0

type ImageDirectUploadURLResponse struct {
	Result ImageDirectUploadURL `json:"result"`
	Response
}

ImageDirectUploadURLResponse is the API response for a direct image upload url.

type ImagesAPIVersion added in v0.71.0

type ImagesAPIVersion string
const (
	ImagesAPIVersionV1 ImagesAPIVersion = "v1"
	ImagesAPIVersionV2 ImagesAPIVersion = "v2"
)

type ImagesListResponse added in v0.30.0

type ImagesListResponse struct {
	Result struct {
		Images []Image `json:"images"`
	} `json:"result"`
	Response
}

ImagesListResponse is the API response for listing all images.

type ImagesStatsCount added in v0.30.0

type ImagesStatsCount struct {
	Current int64 `json:"current"`
	Allowed int64 `json:"allowed"`
}

ImagesStatsCount is the stats attached to a ImagesStatsResponse.

type ImagesStatsResponse added in v0.30.0

type ImagesStatsResponse struct {
	Result struct {
		Count ImagesStatsCount `json:"count"`
	} `json:"result"`
	Response
}

ImagesStatsResponse is the API response for image stats.

type ImagesVariant added in v0.88.0

type ImagesVariant struct {
	ID                     string                `json:"id,omitempty"`
	NeverRequireSignedURLs *bool                 `json:"neverRequireSignedURLs,omitempty"`
	Options                ImagesVariantsOptions `json:"options,omitempty"`
}

type ImagesVariantResponse added in v0.88.0

type ImagesVariantResponse struct {
	Result ImagesVariantResult `json:"result,omitempty"`
	Response
}

type ImagesVariantResult added in v0.88.0

type ImagesVariantResult struct {
	Variant ImagesVariant `json:"variant,omitempty"`
}

type ImagesVariantsOptions added in v0.88.0

type ImagesVariantsOptions struct {
	Fit      string `json:"fit,omitempty"`
	Height   int    `json:"height,omitempty"`
	Metadata string `json:"metadata,omitempty"`
	Width    int    `json:"width,omitempty"`
}

type ImportDNSRecordsParams added in v0.66.0

type ImportDNSRecordsParams struct {
	BINDContents string
}

type IngressIPRule added in v0.43.0

type IngressIPRule struct {
	Prefix *string `json:"prefix,omitempty"`
	Ports  []int   `json:"ports,omitempty"`
	Allow  bool    `json:"allow,omitempty"`
}

type IntelligenceASNOverviewParameters added in v0.44.0

type IntelligenceASNOverviewParameters struct {
	AccountID string
	ASN       int
}

IntelligenceASNOverviewParameters represents parameters for an ASN request.

type IntelligenceASNResponse added in v0.44.0

type IntelligenceASNResponse struct {
	Response
	Result []ASNInfo `json:"result,omitempty"`
}

IntelligenceASNResponse represents an API response for ASN info.

type IntelligenceASNSubnetResponse added in v0.44.0

type IntelligenceASNSubnetResponse struct {
	ASN          int      `json:"asn,omitempty"`
	IPCountTotal int      `json:"ip_count_total,omitempty"`
	Subnets      []string `json:"subnets,omitempty"`
	Count        int      `json:"count,omitempty"`
	Page         int      `json:"page,omitempty"`
	PerPage      int      `json:"per_page,omitempty"`
}

IntelligenceASNSubnetResponse represents an ASN subnet API response.

type IntelligenceASNSubnetsParameters added in v0.44.0

type IntelligenceASNSubnetsParameters struct {
	AccountID string
	ASN       int
}

IntelligenceASNSubnetsParameters represents parameters for an ASN subnet request.

type IssuerConfiguration added in v0.45.0

type IssuerConfiguration struct {
	Hostname string
	Path     string
}

IssuerConfiguration allows the configuration of the issuance provider.

type KeylessSSL added in v0.7.2

type KeylessSSL struct {
	ID          string    `json:"id"`
	Name        string    `json:"name"`
	Host        string    `json:"host"`
	Port        int       `json:"port"`
	Status      string    `json:"status"`
	Enabled     bool      `json:"enabled"`
	Permissions []string  `json:"permissions"`
	CreatedOn   time.Time `json:"created_on"`
	ModifiedOn  time.Time `json:"modified_on"`
}

KeylessSSL represents Keyless SSL configuration.

type KeylessSSLCreateRequest added in v0.17.0

type KeylessSSLCreateRequest struct {
	Host         string `json:"host"`
	Port         int    `json:"port"`
	Certificate  string `json:"certificate"`
	Name         string `json:"name,omitempty"`
	BundleMethod string `json:"bundle_method,omitempty"`
}

KeylessSSLCreateRequest represents the request format made for creating KeylessSSL.

type KeylessSSLDetailResponse added in v0.17.0

type KeylessSSLDetailResponse struct {
	Response
	Result KeylessSSL `json:"result"`
}

KeylessSSLDetailResponse is the API response, containing a single Keyless SSL.

type KeylessSSLListResponse added in v0.17.0

type KeylessSSLListResponse struct {
	Response
	Result []KeylessSSL `json:"result"`
}

KeylessSSLListResponse represents the response from the Keyless SSL list endpoint.

type KeylessSSLUpdateRequest added in v0.17.0

type KeylessSSLUpdateRequest struct {
	Host    string `json:"host,omitempty"`
	Name    string `json:"name,omitempty"`
	Port    int    `json:"port,omitempty"`
	Enabled *bool  `json:"enabled,omitempty"`
}

KeylessSSLUpdateRequest represents the request for updating KeylessSSL.

type Level added in v0.36.0

type Level uint32

Level represents a logging level.

const (
	// LevelNull sets a logger to show no messages at all.
	LevelNull Level = 0

	// LevelError sets a logger to show error messages only.
	LevelError Level = 1

	// LevelWarn sets a logger to show warning messages or anything more
	// severe.
	LevelWarn Level = 2

	// LevelInfo sets a logger to show informational messages or anything more
	// severe.
	LevelInfo Level = 3

	// LevelDebug sets a logger to show informational messages or anything more
	// severe.
	LevelDebug Level = 4
)

type LeveledLogger added in v0.36.0

type LeveledLogger struct {
	// Level is the minimum logging level that will be emitted by this logger.
	//
	// For example, a Level set to LevelWarn will emit warnings and errors, but
	// not informational or debug messages.
	//
	// Always set this with a constant like LevelWarn because the individual
	// values are not guaranteed to be stable.
	Level Level
	// contains filtered or unexported fields
}

LeveledLogger is a leveled logger implementation.

It prints warnings and errors to `os.Stderr` and other messages to `os.Stdout`.

func (*LeveledLogger) Debugf added in v0.36.0

func (l *LeveledLogger) Debugf(format string, v ...interface{})

Debugf logs a debug message using Printf conventions.

func (*LeveledLogger) Errorf added in v0.36.0

func (l *LeveledLogger) Errorf(format string, v ...interface{})

Errorf logs a warning message using Printf conventions.

func (*LeveledLogger) Infof added in v0.36.0

func (l *LeveledLogger) Infof(format string, v ...interface{})

Infof logs an informational message using Printf conventions.

func (*LeveledLogger) Warnf added in v0.36.0

func (l *LeveledLogger) Warnf(format string, v ...interface{})

Warnf logs a warning message using Printf conventions.

type LeveledLoggerInterface added in v0.36.0

type LeveledLoggerInterface interface {
	// Debugf logs a debug message using Printf conventions.
	Debugf(format string, v ...interface{})

	// Errorf logs a warning message using Printf conventions.
	Errorf(format string, v ...interface{})

	// Infof logs an informational message using Printf conventions.
	Infof(format string, v ...interface{})

	// Warnf logs a warning message using Printf conventions.
	Warnf(format string, v ...interface{})
}

LeveledLoggerInterface provides a basic leveled logging interface for printing debug, informational, warning, and error messages.

It's implemented by LeveledLogger and also provides out-of-the-box compatibility with a Logrus Logger, but may require a thin shim for use with other logging libraries that you use less standard conventions like Zap.

var DefaultLeveledLogger LeveledLoggerInterface = &LeveledLogger{
	Level: LevelError,
}

DefaultLeveledLogger is the default logger that the library will use to log errors, warnings, and informational messages.

var SilentLeveledLogger LeveledLoggerInterface = &LeveledLogger{
	Level: LevelNull,
}

SilentLeveledLogger is a logger for disregarding all logs written.

type List added in v0.41.0

type List struct {
	ID                    string     `json:"id"`
	Name                  string     `json:"name"`
	Description           string     `json:"description"`
	Kind                  string     `json:"kind"`
	NumItems              int        `json:"num_items"`
	NumReferencingFilters int        `json:"num_referencing_filters"`
	CreatedOn             *time.Time `json:"created_on"`
	ModifiedOn            *time.Time `json:"modified_on"`
}

List contains information about a List.

type ListAPIShieldDiscoveryOperationsParams added in v0.79.0

type ListAPIShieldDiscoveryOperationsParams struct {
	// Direction to order results.
	Direction string `url:"direction,omitempty"`
	// OrderBy when requesting a feature, the feature keys are available for ordering as well, e.g., thresholds.suggested_threshold.
	OrderBy string `url:"order,omitempty"`
	// Hosts filters results to only include the specified hosts.
	Hosts []string `url:"host,omitempty"`
	// Methods filters results to only include the specified methods.
	Methods []string `url:"method,omitempty"`
	// Endpoint filters results to only include endpoints containing this pattern.
	Endpoint string `url:"endpoint,omitempty"`
	// Diff when true, only return API Discovery results that are not saved into API Shield Endpoint Management
	Diff bool `url:"diff,omitempty"`
	// Origin filters results to only include discovery results sourced from a particular discovery engine
	// See APIShieldDiscoveryOrigin for valid values.
	Origin APIShieldDiscoveryOrigin `url:"origin,omitempty"`
	// State filters results to only include discovery results in a particular state
	// See APIShieldDiscoveryState for valid values.
	State APIShieldDiscoveryState `url:"state,omitempty"`

	// Pagination options to apply to the request.
	PaginationOptions
}

ListAPIShieldDiscoveryOperationsParams represents the parameters to pass when retrieving discovered operations.

API documentation: https://developers.cloudflare.com/api/operations/api-shield-api-discovery-retrieve-discovered-operations-on-a-zone

type ListAPIShieldOperationsParams added in v0.78.0

type ListAPIShieldOperationsParams struct {
	// Features represents a set of features to return in `features` object when
	// performing making read requests against an Operation or listing operations.
	Features []string `url:"feature,omitempty"`
	// Direction to order results.
	Direction string `url:"direction,omitempty"`
	// OrderBy when requesting a feature, the feature keys are available for ordering as well, e.g., thresholds.suggested_threshold.
	OrderBy string `url:"order,omitempty"`
	// Filters to only return operations that match filtering criteria, see APIShieldGetOperationsFilters
	APIShieldListOperationsFilters
	// Pagination options to apply to the request.
	PaginationOptions
}

ListAPIShieldOperationsParams represents the parameters to pass when retrieving operations

API documentation: https://developers.cloudflare.com/api/operations/api-shield-endpoint-management-retrieve-information-about-all-operations-on-a-zone

type ListAPIShieldSchemasParams added in v0.79.0

type ListAPIShieldSchemasParams struct {
	// OmitSource specifies whether the contents of the schema should be returned in the "Source" field.
	OmitSource *bool `url:"omit_source,omitempty"`

	// ValidationEnabled specifies whether to return only schemas that have validation enabled.
	ValidationEnabled *bool `url:"validation_enabled,omitempty"`

	// PaginationOptions to apply to the request.
	PaginationOptions
}

ListAPIShieldSchemasParams represents the parameters to pass when retrieving all schemas.

API documentation: https://developers.cloudflare.com/api/operations/api-shield-schema-validation-retrieve-information-about-all-schemas

type ListAccessApplicationsParams added in v0.71.0

type ListAccessApplicationsParams struct {
	ResultInfo
}

type ListAccessCACertificatesParams added in v0.71.0

type ListAccessCACertificatesParams struct {
	ResultInfo
}

type ListAccessCustomPagesParams added in v0.74.0

type ListAccessCustomPagesParams struct{}

type ListAccessGroupsParams added in v0.71.0

type ListAccessGroupsParams struct {
	ResultInfo
}

type ListAccessIdentityProvidersParams added in v0.71.0

type ListAccessIdentityProvidersParams struct {
	ResultInfo
}

type ListAccessMutualTLSCertificatesParams added in v0.71.0

type ListAccessMutualTLSCertificatesParams struct {
	ResultInfo
}

type ListAccessPoliciesParams added in v0.71.0

type ListAccessPoliciesParams struct {
	ApplicationID string `json:"-"`
	ResultInfo
}

type ListAccessServiceTokensParams added in v0.71.0

type ListAccessServiceTokensParams struct{}

type ListAccessTagsParams added in v0.78.0

type ListAccessTagsParams struct{}

type ListAccountRolesParams added in v0.78.0

type ListAccountRolesParams struct {
	ResultInfo
}

type ListAddressMapResponse added in v0.63.0

type ListAddressMapResponse struct {
	Response
	Result []AddressMap `json:"result"`
}

ListAddressMapResponse contains a slice of address maps.

type ListAddressMapsParams added in v0.63.0

type ListAddressMapsParams struct {
	IP   *string `url:"ip,omitempty"`
	CIDR *string `url:"cidr,omitempty"`
}

AddressMapFilter contains filter parameters for finding a list of address maps.

type ListBulkOperation added in v0.41.0

type ListBulkOperation struct {
	ID        string     `json:"id"`
	Status    string     `json:"status"`
	Error     string     `json:"error"`
	Completed *time.Time `json:"completed"`
}

ListBulkOperation contains information about a Bulk Operation.

type ListBulkOperationResponse added in v0.41.0

type ListBulkOperationResponse struct {
	Response
	Result ListBulkOperation `json:"result"`
}

ListBulkOperationResponse contains information about a Bulk Operation.

type ListCreateItemParams added in v0.41.0

type ListCreateItemParams struct {
	ID   string
	Item ListItemCreateRequest
}

type ListCreateItemsParams added in v0.41.0

type ListCreateItemsParams struct {
	ID    string
	Items []ListItemCreateRequest
}

type ListCreateParams added in v0.41.0

type ListCreateParams struct {
	Name        string
	Description string
	Kind        string
}

type ListCreateRequest added in v0.41.0

type ListCreateRequest struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Kind        string `json:"kind"`
}

ListCreateRequest contains data for a new List.

type ListD1DatabasesParams added in v0.79.0

type ListD1DatabasesParams struct {
	Name string `url:"name,omitempty"`
	ResultInfo
}

type ListD1Response added in v0.79.0

type ListD1Response struct {
	Result []D1Database `json:"result"`
	Response
	ResultInfo `json:"result_info"`
}

type ListDLPDatasetsParams added in v0.87.0

type ListDLPDatasetsParams struct{}

type ListDLPProfilesParams added in v0.53.0

type ListDLPProfilesParams struct{}

type ListDNSFirewallClustersParams added in v0.70.0

type ListDNSFirewallClustersParams struct{}

type ListDNSRecordsParams added in v0.58.0

type ListDNSRecordsParams struct {
	Type      string        `url:"type,omitempty"`
	Name      string        `url:"name,omitempty"`
	Content   string        `url:"content,omitempty"`
	Proxied   *bool         `url:"proxied,omitempty"`
	Comment   string        `url:"comment,omitempty"` // currently, the server does not support searching for records with an empty comment
	Tags      []string      `url:"tag,omitempty"`     // potentially multiple `tag=`
	TagMatch  string        `url:"tag-match,omitempty"`
	Order     string        `url:"order,omitempty"`
	Direction ListDirection `url:"direction,omitempty"`
	Match     string        `url:"match,omitempty"`
	Priority  *uint16       `url:"-"`

	ResultInfo
}

type ListDataLocalizationRegionalHostnamesParams added in v0.66.0

type ListDataLocalizationRegionalHostnamesParams struct{}

type ListDataLocalizationRegionsParams added in v0.66.0

type ListDataLocalizationRegionsParams struct{}

type ListDeleteItemsParams added in v0.41.0

type ListDeleteItemsParams struct {
	ID    string
	Items ListItemDeleteRequest
}

type ListDeleteParams added in v0.41.0

type ListDeleteParams struct {
	ID string
}

type ListDeleteResponse added in v0.41.0

type ListDeleteResponse struct {
	Response
	Result struct {
		ID string `json:"id"`
	} `json:"result"`
}

ListDeleteResponse contains information about the deletion of a List.

type ListDeviceDexTestParams added in v0.62.0

type ListDeviceDexTestParams struct{}

type ListDeviceManagedNetworksParams added in v0.57.0

type ListDeviceManagedNetworksParams struct{}

type ListDeviceSettingsPoliciesParams added in v0.81.0

type ListDeviceSettingsPoliciesParams struct {
	ResultInfo
}

type ListDeviceSettingsPoliciesResponse added in v0.81.0

type ListDeviceSettingsPoliciesResponse struct {
	Response
	ResultInfo ResultInfo             `json:"result_info"`
	Result     []DeviceSettingsPolicy `json:"result"`
}

type ListDirection added in v0.58.0

type ListDirection string
const (
	ListDirectionAsc  ListDirection = "asc"
	ListDirectionDesc ListDirection = "desc"
)

type ListEmailRoutingAddressParameters added in v0.47.0

type ListEmailRoutingAddressParameters struct {
	ResultInfo
	Direction string `url:"direction,omitempty"`
	Verified  *bool  `url:"verified,omitempty"`
}

type ListEmailRoutingAddressResponse added in v0.47.0

type ListEmailRoutingAddressResponse struct {
	Result     []EmailRoutingDestinationAddress `json:"result"`
	ResultInfo `json:"result_info"`
	Response
}

type ListEmailRoutingRuleResponse added in v0.47.0

type ListEmailRoutingRuleResponse struct {
	Result     []EmailRoutingRule `json:"result"`
	ResultInfo `json:"result_info,omitempty"`
	Response
}

type ListEmailRoutingRulesParameters added in v0.47.0

type ListEmailRoutingRulesParameters struct {
	Enabled *bool `url:"enabled,omitempty"`
	ResultInfo
}

type ListGetBulkOperationParams added in v0.41.0

type ListGetBulkOperationParams struct {
	ID string
}

type ListGetItemParams added in v0.41.0

type ListGetItemParams struct {
	ListID string
	ID     string
}

type ListGetParams added in v0.41.0

type ListGetParams struct {
	ID string
}

type ListHostnameTLSSettingsCiphersParams added in v0.75.0

type ListHostnameTLSSettingsCiphersParams struct {
	PaginationOptions
	Limit    int      `json:"-" url:"limit,omitempty"`
	Offset   int      `json:"-" url:"offset,omitempty"`
	Hostname []string `json:"-" url:"hostname,omitempty"`
}

ListHostnameTLSSettingsCiphersParams represents the data related to per-hostname ciphers tls settings being retrieved.

type ListHostnameTLSSettingsParams added in v0.75.0

type ListHostnameTLSSettingsParams struct {
	Setting           string `json:"-" url:"setting,omitempty"`
	PaginationOptions `json:"-"`
	Limit             int      `json:"-" url:"limit,omitempty"`
	Offset            int      `json:"-" url:"offset,omitempty"`
	Hostname          []string `json:"-" url:"hostname,omitempty"`
}

ListHostnameTLSSettingsParams represents the data related to per-hostname tls settings being retrieved.

type ListHyperdriveConfigParams added in v0.88.0

type ListHyperdriveConfigParams struct{}

type ListIPAccessRulesFilters added in v0.82.0

type ListIPAccessRulesFilters struct {
	Configuration IPAccessRuleConfiguration    `json:"configuration,omitempty"`
	Match         ListIPAccessRulesMatchOption `json:"match,omitempty"`
	Mode          IPAccessRulesModeOption      `json:"mode,omitempty"`
	Notes         string                       `json:"notes,omitempty"`
}

type ListIPAccessRulesMatchOption added in v0.82.0

type ListIPAccessRulesMatchOption string

type ListIPAccessRulesOrderOption added in v0.82.0

type ListIPAccessRulesOrderOption string

type ListIPAccessRulesParams added in v0.82.0

type ListIPAccessRulesParams struct {
	Direction string                       `url:"direction,omitempty"`
	Filters   ListIPAccessRulesFilters     `url:"filters,omitempty"`
	Order     ListIPAccessRulesOrderOption `url:"order,omitempty"`
	PaginationOptions
}

type ListIPAccessRulesResponse added in v0.82.0

type ListIPAccessRulesResponse struct {
	Result     []IPAccessRule `json:"result"`
	ResultInfo `json:"result_info"`
	Response
}

type ListIPPrefixResponse added in v0.11.7

type ListIPPrefixResponse struct {
	Response
	Result []IPPrefix `json:"result"`
}

ListIPPrefixResponse contains a slice of IP prefixes.

type ListImageVariantsParams added in v0.88.0

type ListImageVariantsParams struct{}

type ListImageVariantsResult added in v0.88.0

type ListImageVariantsResult struct {
	ImagesVariants map[string]ImagesVariant `json:"variants,omitempty"`
}

type ListImagesParams added in v0.71.0

type ListImagesParams struct {
	ResultInfo
}

type ListImagesVariantsResponse added in v0.88.0

type ListImagesVariantsResponse struct {
	Result ListImageVariantsResult `json:"result,omitempty"`
	Response
}

type ListItem added in v0.41.0

type ListItem struct {
	ID         string     `json:"id"`
	IP         *string    `json:"ip,omitempty"`
	Redirect   *Redirect  `json:"redirect,omitempty"`
	Hostname   *Hostname  `json:"hostname,omitempty"`
	ASN        *uint32    `json:"asn,omitempty"`
	Comment    string     `json:"comment"`
	CreatedOn  *time.Time `json:"created_on"`
	ModifiedOn *time.Time `json:"modified_on"`
}

ListItem contains information about a single List Item.

type ListItemCreateRequest added in v0.41.0

type ListItemCreateRequest struct {
	IP       *string   `json:"ip,omitempty"`
	Redirect *Redirect `json:"redirect,omitempty"`
	Hostname *Hostname `json:"hostname,omitempty"`
	ASN      *uint32   `json:"asn,omitempty"`
	Comment  string    `json:"comment"`
}

ListItemCreateRequest contains data for a new List Item.

type ListItemCreateResponse added in v0.41.0

type ListItemCreateResponse struct {
	Response
	Result struct {
		OperationID string `json:"operation_id"`
	} `json:"result"`
}

ListItemCreateResponse contains information about the creation of a List Item.

type ListItemDeleteItemRequest added in v0.41.0

type ListItemDeleteItemRequest struct {
	ID string `json:"id"`
}

ListItemDeleteItemRequest contains single List Items that shall be deleted.

type ListItemDeleteRequest added in v0.41.0

type ListItemDeleteRequest struct {
	Items []ListItemDeleteItemRequest `json:"items"`
}

ListItemDeleteRequest wraps List Items that shall be deleted.

type ListItemDeleteResponse added in v0.41.0

type ListItemDeleteResponse struct {
	Response
	Result struct {
		OperationID string `json:"operation_id"`
	} `json:"result"`
}

ListItemDeleteResponse contains information about the deletion of a List Item.

type ListItemsGetResponse added in v0.41.0

type ListItemsGetResponse struct {
	Response
	Result ListItem `json:"result"`
}

ListItemsGetResponse contains information about a single List Item.

type ListItemsListResponse added in v0.41.0

type ListItemsListResponse struct {
	Response
	ResultInfo `json:"result_info"`
	Result     []ListItem `json:"result"`
}

ListItemsListResponse contains information about List Items.

type ListListItemsParams added in v0.41.0

type ListListItemsParams struct {
	ID      string `url:"-"`
	Search  string `url:"search,omitempty"`
	PerPage int    `url:"per_page,omitempty"`
	Cursor  string `url:"cursor,omitempty"`
}

type ListListResponse added in v0.41.0

type ListListResponse struct {
	Response
	Result []List `json:"result"`
}

ListListResponse contains a slice of Lists.

type ListListsParams added in v0.41.0

type ListListsParams struct {
}

type ListLoadBalancerMonitorParams added in v0.51.0

type ListLoadBalancerMonitorParams struct {
	PaginationOptions
}

type ListLoadBalancerParams added in v0.51.0

type ListLoadBalancerParams struct {
	PaginationOptions
}

type ListLoadBalancerPoolParams added in v0.51.0

type ListLoadBalancerPoolParams struct {
	PaginationOptions
}

type ListLogpushJobsForDatasetParams added in v0.72.0

type ListLogpushJobsForDatasetParams struct {
	Dataset string `json:"-"`
}

type ListLogpushJobsParams added in v0.72.0

type ListLogpushJobsParams struct{}

type ListMTLSCertificateAssociationsParams added in v0.58.0

type ListMTLSCertificateAssociationsParams struct {
	CertificateID string
}

type ListMTLSCertificatesParams added in v0.58.0

type ListMTLSCertificatesParams struct {
	PaginationOptions
	Limit  int    `url:"limit,omitempty"`
	Offset int    `url:"offset,omitempty"`
	Name   string `url:"name,omitempty"`
	CA     bool   `url:"ca,omitempty"`
}

type ListMagicFirewallRulesetResponse added in v0.13.7

type ListMagicFirewallRulesetResponse struct {
	Response
	Result []MagicFirewallRuleset `json:"result"`
}

ListMagicFirewallRulesetResponse contains a list of Magic Firewall rulesets.

type ListMagicTransitGRETunnelsResponse added in v0.32.0

type ListMagicTransitGRETunnelsResponse struct {
	Response
	Result struct {
		GRETunnels []MagicTransitGRETunnel `json:"gre_tunnels"`
	} `json:"result"`
}

ListMagicTransitGRETunnelsResponse contains a response including GRE tunnels.

type ListMagicTransitIPsecTunnelsResponse added in v0.31.0

type ListMagicTransitIPsecTunnelsResponse struct {
	Response
	Result struct {
		IPsecTunnels []MagicTransitIPsecTunnel `json:"ipsec_tunnels"`
	} `json:"result"`
}

ListMagicTransitIPsecTunnelsResponse contains a response including IPsec tunnels.

type ListMagicTransitStaticRoutesResponse added in v0.18.0

type ListMagicTransitStaticRoutesResponse struct {
	Response
	Result struct {
		Routes []MagicTransitStaticRoute `json:"routes"`
	} `json:"result"`
}

ListMagicTransitStaticRoutesResponse contains a response including Magic Transit static routes.

type ListManagedHeadersParams added in v0.42.0

type ListManagedHeadersParams struct {
	Status string `url:"status,omitempty"`
}

type ListManagedHeadersResponse added in v0.42.0

type ListManagedHeadersResponse struct {
	Response
	Result ManagedHeaders `json:"result"`
}

type ListObservatoryPageTestParams added in v0.78.0

type ListObservatoryPageTestParams struct {
	URL    string `url:"-"`
	Region string `url:"region"`
	ResultInfo
}

type ListObservatoryPagesParams added in v0.78.0

type ListObservatoryPagesParams struct {
}

type ListOriginCertificatesParams added in v0.58.0

type ListOriginCertificatesParams struct {
	ZoneID string `url:"zone_id,omitempty"`
}

ListOriginCertificatesParams represents the parameters used to list Cloudflare-issued certificates.

type ListPageShieldConnectionsParams added in v0.84.0

type ListPageShieldConnectionsParams struct {
	Direction           string `url:"direction"`
	ExcludeCdnCgi       *bool  `url:"exclude_cdn_cgi,omitempty"`
	ExcludeUrls         string `url:"exclude_urls"`
	Export              string `url:"export"`
	Hosts               string `url:"hosts"`
	OrderBy             string `url:"order_by"`
	Page                string `url:"page"`
	PageURL             string `url:"page_url"`
	PerPage             int    `url:"per_page"`
	PrioritizeMalicious *bool  `url:"prioritize_malicious,omitempty"`
	Status              string `url:"status"`
	URLs                string `url:"urls"`
}

ListPageShieldConnectionsParams represents parameters for a page shield connection request.

type ListPageShieldConnectionsResponse added in v0.84.0

type ListPageShieldConnectionsResponse struct {
	Result []PageShieldConnection `json:"result"`
	Response
	ResultInfo `json:"result_info"`
}

ListPageShieldConnectionsResponse represents the response from the list page shield connections endpoint.

type ListPageShieldPoliciesParams added in v0.84.0

type ListPageShieldPoliciesParams struct{}

type ListPageShieldPoliciesResponse added in v0.84.0

type ListPageShieldPoliciesResponse struct {
	Result []PageShieldPolicy `json:"result"`
	Response
	ResultInfo `json:"result_info"`
}

ListPageShieldPoliciesResponse represents the response from the list page shield policies endpoint.

type ListPageShieldScriptsParams added in v0.84.0

type ListPageShieldScriptsParams struct {
	Direction           string `url:"direction"`
	ExcludeCdnCgi       *bool  `url:"exclude_cdn_cgi,omitempty"`
	ExcludeDuplicates   *bool  `url:"exclude_duplicates,omitempty"`
	ExcludeUrls         string `url:"exclude_urls"`
	Export              string `url:"export"`
	Hosts               string `url:"hosts"`
	OrderBy             string `url:"order_by"`
	Page                string `url:"page"`
	PageURL             string `url:"page_url"`
	PerPage             int    `url:"per_page"`
	PrioritizeMalicious *bool  `url:"prioritize_malicious,omitempty"`
	Status              string `url:"status"`
	URLs                string `url:"urls"`
}

ListPageShieldScriptsParams represents a PageShield Script request parameters.

API reference: https://developers.cloudflare.com/api/operations/page-shield-list-page-shield-scripts#Query-Parameters

type ListPagesDeploymentsParams added in v0.40.0

type ListPagesDeploymentsParams struct {
	ProjectName string `url:"-"`

	ResultInfo
}

type ListPagesProjectsParams added in v0.73.0

type ListPagesProjectsParams struct {
	PaginationOptions
}

type ListPermissionGroupParams added in v0.53.0

type ListPermissionGroupParams struct {
	Depth    int    `url:"depth,omitempty"`
	RoleName string `url:"name,omitempty"`
}

type ListQueueConsumersParams added in v0.55.0

type ListQueueConsumersParams struct {
	QueueName string `url:"-"`
	ResultInfo
}

type ListQueueConsumersResponse added in v0.55.0

type ListQueueConsumersResponse struct {
	Response
	ResultInfo `json:"result_info"`
	Result     []QueueConsumer `json:"result"`
}

type ListQueuesParams added in v0.55.0

type ListQueuesParams struct {
	ResultInfo
}

type ListR2BucketsParams added in v0.55.0

type ListR2BucketsParams struct {
	Name       string `url:"name_contains,omitempty"`
	StartAfter string `url:"start_after,omitempty"`
	PerPage    int64  `url:"per_page,omitempty"`
	Order      string `url:"order,omitempty"`
	Direction  string `url:"direction,omitempty"`
	Cursor     string `url:"cursor,omitempty"`
}

type ListReplaceItemsParams added in v0.41.0

type ListReplaceItemsParams struct {
	ID    string
	Items []ListItemCreateRequest
}

type ListResponse added in v0.41.0

type ListResponse struct {
	Response
	Result List `json:"result"`
}

ListResponse contains a single List.

type ListRulesetResponse added in v0.19.0

type ListRulesetResponse struct {
	Response
	Result []Ruleset `json:"result"`
}

ListRulesetResponse contains all Rulesets.

type ListRulesetsParams added in v0.73.0

type ListRulesetsParams struct{}

type ListStorageKeysResponse added in v0.9.0

type ListStorageKeysResponse struct {
	Response
	Result     []StorageKey `json:"result"`
	ResultInfo `json:"result_info"`
}

ListStorageKeysResponse contains a slice of keys belonging to a storage namespace, pagination information, and an embedded response struct.

type ListTeamListsParams added in v0.53.0

type ListTeamListsParams struct{}

type ListTeamsListItemsParams added in v0.53.0

type ListTeamsListItemsParams struct {
	ListID string `url:"-"`

	ResultInfo
}

type ListTurnstileWidgetParams added in v0.66.0

type ListTurnstileWidgetParams struct {
	ResultInfo
	Direction string         `url:"direction,omitempty"`
	Order     OrderDirection `url:"order,omitempty"`
}

type ListTurnstileWidgetResponse added in v0.66.0

type ListTurnstileWidgetResponse struct {
	Response
	ResultInfo `json:"result_info"`
	Result     []TurnstileWidget `json:"result"`
}

type ListUpdateParams added in v0.41.0

type ListUpdateParams struct {
	ID          string
	Description string
}

type ListUpdateRequest added in v0.41.0

type ListUpdateRequest struct {
	Description string `json:"description"`
}

ListUpdateRequest contains data for a List update.

type ListWaitingRoomRuleParams added in v0.53.0

type ListWaitingRoomRuleParams struct {
	WaitingRoomID string
}

type ListWebAnalyticsRulesParams added in v0.75.0

type ListWebAnalyticsRulesParams struct {
	RulesetID string
}

type ListWebAnalyticsSitesParams added in v0.75.0

type ListWebAnalyticsSitesParams struct {
	ResultInfo
	// Property to order Sites by, "host" or "created".
	OrderBy string `url:"order_by,omitempty"`
}

type ListWorkerBindingsParams added in v0.57.0

type ListWorkerBindingsParams struct {
	ScriptName        string
	DispatchNamespace *string
}

type ListWorkerCronTriggersParams added in v0.57.0

type ListWorkerCronTriggersParams struct {
	ScriptName string
}

type ListWorkerRoutes added in v0.57.0

type ListWorkerRoutes struct{}

type ListWorkerRoutesParams added in v0.57.0

type ListWorkerRoutesParams struct{}

type ListWorkersDomainParams added in v0.55.0

type ListWorkersDomainParams struct {
	ZoneID      string `url:"zone_id,omitempty"`
	ZoneName    string `url:"zone_name,omitempty"`
	Hostname    string `url:"hostname,omitempty"`
	Service     string `url:"service,omitempty"`
	Environment string `url:"environment,omitempty"`
}

type ListWorkersForPlatformsDispatchNamespaceResponse added in v0.90.0

type ListWorkersForPlatformsDispatchNamespaceResponse struct {
	Response
	Result []WorkersForPlatformsDispatchNamespace `json:"result"`
}

type ListWorkersKVNamespacesParams added in v0.55.0

type ListWorkersKVNamespacesParams struct {
	ResultInfo
}

type ListWorkersKVNamespacesResponse added in v0.9.0

type ListWorkersKVNamespacesResponse struct {
	Response
	Result     []WorkersKVNamespace `json:"result"`
	ResultInfo `json:"result_info"`
}

ListWorkersKVNamespacesResponse contains a slice of storage namespaces associated with an account, pagination information, and an embedded response struct.

type ListWorkersKVsParams added in v0.55.0

type ListWorkersKVsParams struct {
	NamespaceID string `url:"-"`
	Limit       int    `url:"limit,omitempty"`
	Cursor      string `url:"cursor,omitempty"`
	Prefix      string `url:"prefix,omitempty"`
}

type ListWorkersParams added in v0.57.0

type ListWorkersParams struct{}

type ListWorkersSecretsParams added in v0.57.0

type ListWorkersSecretsParams struct {
	ScriptName string
}

type ListWorkersTailParameters added in v0.47.0

type ListWorkersTailParameters struct {
	AccountID  string
	ScriptName string
}

type ListWorkersTailResponse added in v0.47.0

type ListWorkersTailResponse struct {
	Response
	Result WorkersTail
}

type ListZarazConfigHistoryParams added in v0.86.0

type ListZarazConfigHistoryParams struct {
	ResultInfo
}

type LoadBalancer

type LoadBalancer struct {
	ID                        string                     `json:"id,omitempty"`
	CreatedOn                 *time.Time                 `json:"created_on,omitempty"`
	ModifiedOn                *time.Time                 `json:"modified_on,omitempty"`
	Description               string                     `json:"description"`
	Name                      string                     `json:"name"`
	TTL                       int                        `json:"ttl,omitempty"`
	FallbackPool              string                     `json:"fallback_pool"`
	DefaultPools              []string                   `json:"default_pools"`
	RegionPools               map[string][]string        `json:"region_pools"`
	PopPools                  map[string][]string        `json:"pop_pools"`
	CountryPools              map[string][]string        `json:"country_pools"`
	Proxied                   bool                       `json:"proxied"`
	Enabled                   *bool                      `json:"enabled,omitempty"`
	Persistence               string                     `json:"session_affinity,omitempty"`
	PersistenceTTL            int                        `json:"session_affinity_ttl,omitempty"`
	SessionAffinityAttributes *SessionAffinityAttributes `json:"session_affinity_attributes,omitempty"`
	Rules                     []*LoadBalancerRule        `json:"rules,omitempty"`
	RandomSteering            *RandomSteering            `json:"random_steering,omitempty"`
	AdaptiveRouting           *AdaptiveRouting           `json:"adaptive_routing,omitempty"`
	LocationStrategy          *LocationStrategy          `json:"location_strategy,omitempty"`

	// SteeringPolicy controls pool selection logic.
	//
	// "off": Select pools in DefaultPools order.
	//
	// "geo": Select pools based on RegionPools/PopPools/CountryPools.
	// For non-proxied requests, the country for CountryPools is determined by LocationStrategy.
	//
	// "dynamic_latency": Select pools based on RTT (requires health checks).
	//
	// "random": Selects pools in a random order.
	//
	// "proximity": Use the pools' latitude and longitude to select the closest pool using
	// the Cloudflare PoP location for proxied requests or the location determined by
	// LocationStrategy for non-proxied requests.
	//
	// "least_outstanding_requests": Select a pool by taking into consideration
	// RandomSteering weights, as well as each pool's number of outstanding requests.
	// Pools with more pending requests are weighted proportionately less relative to others.
	//
	// "least_connections": Select a pool by taking into consideration
	// RandomSteering weights, as well as each pool's number of open connections.
	// Pools with more open connections are weighted proportionately less relative to others.
	// Supported for HTTP/1 and HTTP/2 connections.
	//
	// "": Maps to "geo" if RegionPools or PopPools or CountryPools have entries otherwise "off".
	SteeringPolicy string `json:"steering_policy,omitempty"`
}

LoadBalancer represents a load balancer's properties.

type LoadBalancerFixedResponseData added in v0.14.0

type LoadBalancerFixedResponseData struct {
	// MessageBody data to write into the http body
	MessageBody string `json:"message_body,omitempty"`
	// StatusCode the http status code to response with
	StatusCode int `json:"status_code,omitempty"`
	// ContentType value of the http 'content-type' header
	ContentType string `json:"content_type,omitempty"`
	// Location value of the http 'location' header
	Location string `json:"location,omitempty"`
}

LoadBalancerFixedResponseData contains all the data needed to generate a fixed response from a Load Balancer. This behavior can be enabled via Rules.

type LoadBalancerLoadShedding added in v0.19.0

type LoadBalancerLoadShedding struct {
	DefaultPercent float32 `json:"default_percent,omitempty"`
	DefaultPolicy  string  `json:"default_policy,omitempty"`
	SessionPercent float32 `json:"session_percent,omitempty"`
	SessionPolicy  string  `json:"session_policy,omitempty"`
}

LoadBalancerLoadShedding contains the settings for controlling load shedding.

type LoadBalancerMonitor added in v0.8.0

type LoadBalancerMonitor struct {
	ID              string              `json:"id,omitempty"`
	CreatedOn       *time.Time          `json:"created_on,omitempty"`
	ModifiedOn      *time.Time          `json:"modified_on,omitempty"`
	Type            string              `json:"type"`
	Description     string              `json:"description"`
	Method          string              `json:"method"`
	Path            string              `json:"path"`
	Header          map[string][]string `json:"header"`
	Timeout         int                 `json:"timeout"`
	Retries         int                 `json:"retries"`
	Interval        int                 `json:"interval"`
	ConsecutiveUp   int                 `json:"consecutive_up"`
	ConsecutiveDown int                 `json:"consecutive_down"`
	Port            uint16              `json:"port,omitempty"`
	ExpectedBody    string              `json:"expected_body"`
	ExpectedCodes   string              `json:"expected_codes"`
	FollowRedirects bool                `json:"follow_redirects"`
	AllowInsecure   bool                `json:"allow_insecure"`
	ProbeZone       string              `json:"probe_zone"`
}

LoadBalancerMonitor represents a load balancer monitor's properties.

type LoadBalancerOrigin added in v0.8.0

type LoadBalancerOrigin struct {
	Name    string `json:"name"`
	Address string `json:"address"`
	Enabled bool   `json:"enabled"`
	// Weight of this origin relative to other origins in the pool.
	// Based on the configured weight the total traffic is distributed
	// among origins within the pool.
	//
	// When LoadBalancerOriginSteering.Policy="least_outstanding_requests", this
	// weight is used to scale the origin's outstanding requests.
	// When LoadBalancerOriginSteering.Policy="least_connections", this
	// weight is used to scale the origin's open connections.
	Weight float64             `json:"weight"`
	Header map[string][]string `json:"header"`
	// The virtual network subnet ID the origin belongs in.
	// Virtual network must also belong to the account.
	VirtualNetworkID string `json:"virtual_network_id,omitempty"`
}

LoadBalancerOrigin represents a Load Balancer origin's properties.

type LoadBalancerOriginHealth added in v0.9.0

type LoadBalancerOriginHealth struct {
	Healthy       bool     `json:"healthy,omitempty"`
	RTT           Duration `json:"rtt,omitempty"`
	FailureReason string   `json:"failure_reason,omitempty"`
	ResponseCode  int      `json:"response_code,omitempty"`
}

LoadBalancerOriginHealth represents the health of the origin.

type LoadBalancerOriginSteering added in v0.25.0

type LoadBalancerOriginSteering struct {
	// Policy determines the type of origin steering policy to use.
	// It defaults to "random" (weighted) when empty or unspecified.
	//
	// "random": Select an origin randomly.
	//
	// "hash": Select an origin by computing a hash over the CF-Connecting-IP address.
	//
	// "least_outstanding_requests": Select an origin by taking into consideration origin weights,
	// as well as each origin's number of outstanding requests. Origins with more pending requests
	// are weighted proportionately less relative to others.
	//
	// "least_connections": Select an origin by taking into consideration origin weights,
	// as well as each origin's number of open connections. Origins with more open connections
	// are weighted proportionately less relative to others. Supported for HTTP/1 and HTTP/2 connections.
	Policy string `json:"policy,omitempty"`
}

LoadBalancerOriginSteering controls origin selection for new sessions and traffic without session affinity.

type LoadBalancerPool added in v0.8.0

type LoadBalancerPool struct {
	ID                string                      `json:"id,omitempty"`
	CreatedOn         *time.Time                  `json:"created_on,omitempty"`
	ModifiedOn        *time.Time                  `json:"modified_on,omitempty"`
	Description       string                      `json:"description"`
	Name              string                      `json:"name"`
	Enabled           bool                        `json:"enabled"`
	MinimumOrigins    *int                        `json:"minimum_origins,omitempty"`
	Monitor           string                      `json:"monitor,omitempty"`
	Origins           []LoadBalancerOrigin        `json:"origins"`
	NotificationEmail string                      `json:"notification_email,omitempty"`
	Latitude          *float32                    `json:"latitude,omitempty"`
	Longitude         *float32                    `json:"longitude,omitempty"`
	LoadShedding      *LoadBalancerLoadShedding   `json:"load_shedding,omitempty"`
	OriginSteering    *LoadBalancerOriginSteering `json:"origin_steering,omitempty"`
	Healthy           *bool                       `json:"healthy,omitempty"`

	// CheckRegions defines the geographic region(s) from where to run health-checks from - e.g. "WNAM", "WEU", "SAF", "SAM".
	// Providing a null/empty value means "all regions", which may not be available to all plan types.
	CheckRegions []string `json:"check_regions"`
}

LoadBalancerPool represents a load balancer pool's properties.

type LoadBalancerPoolHealth added in v0.9.0

type LoadBalancerPoolHealth struct {
	ID        string                               `json:"pool_id,omitempty"`
	PopHealth map[string]LoadBalancerPoolPopHealth `json:"pop_health,omitempty"`
}

LoadBalancerPoolHealth represents the healthchecks from different PoPs for a pool.

type LoadBalancerPoolPopHealth added in v0.9.0

type LoadBalancerPoolPopHealth struct {
	Healthy bool                                  `json:"healthy,omitempty"`
	Origins []map[string]LoadBalancerOriginHealth `json:"origins,omitempty"`
}

LoadBalancerPoolPopHealth represents the health of the pool for given PoP.

type LoadBalancerRule

type LoadBalancerRule struct {
	Overrides LoadBalancerRuleOverrides `json:"overrides"`

	// Name is required but is only used for human readability
	Name string `json:"name"`

	Condition string `json:"condition"`

	// Priority controls the order of rule execution the lowest value will be invoked first
	Priority int `json:"priority"`

	// FixedResponse if set and the condition is true we will not run
	// routing logic but rather directly respond with the provided fields.
	// FixedResponse implies terminates.
	FixedResponse *LoadBalancerFixedResponseData `json:"fixed_response,omitempty"`

	Disabled bool `json:"disabled"`

	// Terminates flag this rule as 'terminating'. No further rules will
	// be executed after this one.
	Terminates bool `json:"terminates,omitempty"`
}

LoadBalancerRule represents a single rule entry for a Load Balancer. Each rules is run one after the other in priority order. Disabled rules are skipped.

type LoadBalancerRuleOverrides added in v0.14.0

type LoadBalancerRuleOverrides struct {
	// session affinity
	Persistence    string `json:"session_affinity,omitempty"`
	PersistenceTTL *uint  `json:"session_affinity_ttl,omitempty"`

	SessionAffinityAttrs *LoadBalancerRuleOverridesSessionAffinityAttrs `json:"session_affinity_attributes,omitempty"`

	TTL uint `json:"ttl,omitempty"`

	SteeringPolicy string `json:"steering_policy,omitempty"`
	FallbackPool   string `json:"fallback_pool,omitempty"`

	DefaultPools []string            `json:"default_pools,omitempty"`
	PoPPools     map[string][]string `json:"pop_pools,omitempty"`
	RegionPools  map[string][]string `json:"region_pools,omitempty"`
	CountryPools map[string][]string `json:"country_pools,omitempty"`

	RandomSteering   *RandomSteering   `json:"random_steering,omitempty"`
	AdaptiveRouting  *AdaptiveRouting  `json:"adaptive_routing,omitempty"`
	LocationStrategy *LocationStrategy `json:"location_strategy,omitempty"`
}

LoadBalancerRuleOverrides are the set of field overridable by the rules system.

type LoadBalancerRuleOverridesSessionAffinityAttrs added in v0.14.0

type LoadBalancerRuleOverridesSessionAffinityAttrs struct {
	SameSite             string   `json:"samesite,omitempty"`
	Secure               string   `json:"secure,omitempty"`
	ZeroDowntimeFailover string   `json:"zero_downtime_failover,omitempty"`
	Headers              []string `json:"headers,omitempty"`
	RequireAllHeaders    *bool    `json:"require_all_headers,omitempty"`
}

LoadBalancerRuleOverridesSessionAffinityAttrs mimics SessionAffinityAttributes without the DrainDuration field as that field can not be overwritten via rules.

type LocationStrategy added in v0.51.0

type LocationStrategy struct {
	// PreferECS determines whether the EDNS Client Subnet (ECS) GeoIP should
	// be preferred as the authoritative location.
	//
	// "always": Always prefer ECS.
	//
	// "never": Never prefer ECS.
	//
	// "proximity": (default) Prefer ECS only when SteeringPolicy="proximity".
	//
	// "geo": Prefer ECS only when SteeringPolicy="geo".
	PreferECS string `json:"prefer_ecs,omitempty"`
	// Mode determines the authoritative location when ECS is not preferred,
	// does not exist in the request, or its GeoIP lookup is unsuccessful.
	//
	// "pop": (default) Use the Cloudflare PoP location.
	//
	// "resolver_ip": Use the DNS resolver GeoIP location.
	// If the GeoIP lookup is unsuccessful, use the Cloudflare PoP location.
	Mode string `json:"mode,omitempty"`
}

LocationStrategy controls location-based steering for non-proxied requests. See SteeringPolicy to learn how steering is affected.

type LockdownListParams added in v0.47.0

type LockdownListParams struct {
	ResultInfo
}

type Logger added in v0.8.5

type Logger interface {
	Printf(format string, v ...interface{})
}

Logger defines the interface this library needs to use logging This is a subset of the methods implemented in the log package.

type LogpullRetentionConfiguration added in v0.12.0

type LogpullRetentionConfiguration struct {
	Flag bool `json:"flag"`
}

LogpullRetentionConfiguration describes a the structure of a Logpull Retention payload.

type LogpullRetentionConfigurationResponse added in v0.12.0

type LogpullRetentionConfigurationResponse struct {
	Response
	Result LogpullRetentionConfiguration `json:"result"`
}

LogpullRetentionConfigurationResponse is the API response, containing the Logpull retention result.

type LogpushDestinationExistsRequest added in v0.9.0

type LogpushDestinationExistsRequest struct {
	DestinationConf string `json:"destination_conf"`
}

LogpushDestinationExistsRequest is the API request for check destination exists.

type LogpushDestinationExistsResponse added in v0.9.0

type LogpushDestinationExistsResponse struct {
	Response
	Result struct {
		Exists bool `json:"exists"`
	}
}

LogpushDestinationExistsResponse is the API response, containing a destination exists check result.

type LogpushFields added in v0.11.1

type LogpushFields map[string]string

LogpushFields is a map of available Logpush field names & descriptions.

type LogpushFieldsResponse added in v0.11.1

type LogpushFieldsResponse struct {
	Response
	Result LogpushFields `json:"result"`
}

LogpushFieldsResponse is the API response for a datasets fields.

type LogpushGetOwnershipChallenge added in v0.9.0

type LogpushGetOwnershipChallenge struct {
	Filename string `json:"filename"`
	Valid    bool   `json:"valid"`
	Message  string `json:"message"`
}

LogpushGetOwnershipChallenge describes a ownership validation.

type LogpushGetOwnershipChallengeRequest added in v0.9.0

type LogpushGetOwnershipChallengeRequest struct {
	DestinationConf string `json:"destination_conf"`
}

LogpushGetOwnershipChallengeRequest is the API request for get ownership challenge.

type LogpushGetOwnershipChallengeResponse added in v0.9.0

type LogpushGetOwnershipChallengeResponse struct {
	Response
	Result LogpushGetOwnershipChallenge `json:"result"`
}

LogpushGetOwnershipChallengeResponse is the API response, containing a ownership challenge.

type LogpushJob added in v0.9.0

type LogpushJob struct {
	ID                       int                   `json:"id,omitempty"`
	Dataset                  string                `json:"dataset"`
	Enabled                  bool                  `json:"enabled"`
	Kind                     string                `json:"kind,omitempty"`
	Name                     string                `json:"name"`
	LogpullOptions           string                `json:"logpull_options,omitempty"`
	OutputOptions            *LogpushOutputOptions `json:"output_options,omitempty"`
	DestinationConf          string                `json:"destination_conf"`
	OwnershipChallenge       string                `json:"ownership_challenge,omitempty"`
	LastComplete             *time.Time            `json:"last_complete,omitempty"`
	LastError                *time.Time            `json:"last_error,omitempty"`
	ErrorMessage             string                `json:"error_message,omitempty"`
	Frequency                string                `json:"frequency,omitempty"`
	Filter                   *LogpushJobFilters    `json:"filter,omitempty"`
	MaxUploadBytes           int                   `json:"max_upload_bytes,omitempty"`
	MaxUploadRecords         int                   `json:"max_upload_records,omitempty"`
	MaxUploadIntervalSeconds int                   `json:"max_upload_interval_seconds,omitempty"`
}

LogpushJob describes a Logpush job.

func (LogpushJob) MarshalJSON added in v0.41.0

func (f LogpushJob) MarshalJSON() ([]byte, error)

Custom Marshaller for LogpushJob filter key.

Example
job := cloudflare.LogpushJob{
	Name:            "example.com static assets",
	LogpullOptions:  "fields=RayID,ClientIP,EdgeStartTimestamp&timestamps=rfc3339&CVE-2021-44228=true",
	Dataset:         "http_requests",
	DestinationConf: "s3://<BUCKET_PATH>?region=us-west-2/",
	Filter: &cloudflare.LogpushJobFilters{
		Where: cloudflare.LogpushJobFilter{
			And: []cloudflare.LogpushJobFilter{
				{Key: "ClientRequestPath", Operator: cloudflare.Contains, Value: "/static\\"},
				{Key: "ClientRequestHost", Operator: cloudflare.Equal, Value: "example.com"},
			},
		},
	},
}

jobstring, err := json.Marshal(job)
if err != nil {
	log.Fatal(err)
}

fmt.Printf("%s", jobstring)
Output:

{"filter":"{\"where\":{\"and\":[{\"key\":\"ClientRequestPath\",\"operator\":\"contains\",\"value\":\"/static\\\\\"},{\"key\":\"ClientRequestHost\",\"operator\":\"eq\",\"value\":\"example.com\"}]}}","dataset":"http_requests","enabled":false,"name":"example.com static assets","logpull_options":"fields=RayID,ClientIP,EdgeStartTimestamp\u0026timestamps=rfc3339\u0026CVE-2021-44228=true","destination_conf":"s3://\u003cBUCKET_PATH\u003e?region=us-west-2/"}

func (*LogpushJob) UnmarshalJSON added in v0.41.0

func (f *LogpushJob) UnmarshalJSON(data []byte) error

Custom Unmarshaller for LogpushJob filter key.

type LogpushJobDetailsResponse added in v0.9.0

type LogpushJobDetailsResponse struct {
	Response
	Result LogpushJob `json:"result"`
}

LogpushJobDetailsResponse is the API response, containing a single Logpush Job.

type LogpushJobFilter added in v0.41.0

type LogpushJobFilter struct {
	// either this
	And []LogpushJobFilter `json:"and,omitempty"`
	Or  []LogpushJobFilter `json:"or,omitempty"`
	// or this
	Key      string      `json:"key,omitempty"`
	Operator Operator    `json:"operator,omitempty"`
	Value    interface{} `json:"value,omitempty"`
}

func (*LogpushJobFilter) Validate added in v0.41.0

func (filter *LogpushJobFilter) Validate() error

type LogpushJobFilters added in v0.41.0

type LogpushJobFilters struct {
	Where LogpushJobFilter `json:"where"`
}

type LogpushJobsResponse added in v0.9.0

type LogpushJobsResponse struct {
	Response
	Result []LogpushJob `json:"result"`
}

LogpushJobsResponse is the API response, containing an array of Logpush Jobs.

type LogpushOutputOptions added in v0.87.0

type LogpushOutputOptions struct {
	FieldNames      []string `json:"field_names"`
	OutputType      string   `json:"output_type,omitempty"`
	BatchPrefix     string   `json:"batch_prefix,omitempty"`
	BatchSuffix     string   `json:"batch_suffix,omitempty"`
	RecordPrefix    string   `json:"record_prefix,omitempty"`
	RecordSuffix    string   `json:"record_suffix,omitempty"`
	RecordTemplate  string   `json:"record_template,omitempty"`
	RecordDelimiter string   `json:"record_delimiter,omitempty"`
	FieldDelimiter  string   `json:"field_delimiter,omitempty"`
	TimestampFormat string   `json:"timestamp_format,omitempty"`
	SampleRate      float64  `json:"sample_rate,omitempty"`
	CVE202144228    *bool    `json:"CVE-2021-44228,omitempty"`
}

type LogpushOwnershipChallengeValidationResponse added in v0.12.1

type LogpushOwnershipChallengeValidationResponse struct {
	Response
	Result struct {
		Valid bool `json:"valid"`
	}
}

LogpushOwnershipChallengeValidationResponse is the API response, containing a ownership challenge validation result.

type LogpushValidateOwnershipChallengeRequest added in v0.9.0

type LogpushValidateOwnershipChallengeRequest struct {
	DestinationConf    string `json:"destination_conf"`
	OwnershipChallenge string `json:"ownership_challenge"`
}

LogpushValidateOwnershipChallengeRequest is the API request for validate ownership challenge.

type MTLSAssociation added in v0.58.0

type MTLSAssociation struct {
	Service string `json:"service"`
	Status  string `json:"status"`
}

MTLSAssociation represents the metadata for an existing association between a user-uploaded mTLS certificate and a Cloudflare service.

type MTLSAssociationResponse added in v0.58.0

type MTLSAssociationResponse struct {
	Response
	Result []MTLSAssociation `json:"result"`
}

MTLSAssociationResponse represents the response from the retrieval endpoint for mTLS certificate associations.

type MTLSCertificate added in v0.58.0

type MTLSCertificate struct {
	ID           string    `json:"id"`
	Name         string    `json:"name"`
	Issuer       string    `json:"issuer"`
	Signature    string    `json:"signature"`
	SerialNumber string    `json:"serial_number"`
	Certificates string    `json:"certificates"`
	CA           bool      `json:"ca"`
	UploadedOn   time.Time `json:"uploaded_on"`
	UpdatedAt    time.Time `json:"updated_at"`
	ExpiresOn    time.Time `json:"expires_on"`
}

MTLSCertificate represents the metadata for a user-uploaded mTLS certificate.

type MTLSCertificateResponse added in v0.58.0

type MTLSCertificateResponse struct {
	Response
	Result MTLSCertificate `json:"result"`
}

MTLSCertificateResponse represents the response from endpoints relating to retrieving, creating, and deleting an mTLS certificate.

type MTLSCertificatesResponse added in v0.58.0

type MTLSCertificatesResponse struct {
	Response
	Result     []MTLSCertificate `json:"result"`
	ResultInfo `json:"result_info"`
}

MTLSCertificatesResponse represents the response from the mTLS certificate list endpoint.

type MagicFirewallRuleset added in v0.13.7

type MagicFirewallRuleset struct {
	ID          string                     `json:"id"`
	Name        string                     `json:"name"`
	Description string                     `json:"description"`
	Kind        string                     `json:"kind"`
	Version     string                     `json:"version,omitempty"`
	LastUpdated *time.Time                 `json:"last_updated,omitempty"`
	Phase       string                     `json:"phase"`
	Rules       []MagicFirewallRulesetRule `json:"rules"`
}

MagicFirewallRuleset contains information about a Firewall Ruleset.

type MagicFirewallRulesetRule added in v0.13.7

type MagicFirewallRulesetRule struct {
	ID               string                                    `json:"id,omitempty"`
	Version          string                                    `json:"version,omitempty"`
	Action           MagicFirewallRulesetRuleAction            `json:"action"`
	ActionParameters *MagicFirewallRulesetRuleActionParameters `json:"action_parameters,omitempty"`
	Expression       string                                    `json:"expression"`
	Description      string                                    `json:"description"`
	LastUpdated      *time.Time                                `json:"last_updated,omitempty"`
	Ref              string                                    `json:"ref,omitempty"`
	Enabled          bool                                      `json:"enabled"`
}

MagicFirewallRulesetRule contains information about a single Magic Firewall rule.

type MagicFirewallRulesetRuleAction added in v0.13.7

type MagicFirewallRulesetRuleAction string

MagicFirewallRulesetRuleAction specifies the action for a Firewall rule.

type MagicFirewallRulesetRuleActionParameters added in v0.13.7

type MagicFirewallRulesetRuleActionParameters struct {
	Ruleset string `json:"ruleset,omitempty"`
}

MagicFirewallRulesetRuleActionParameters specifies the action parameters for a Firewall rule.

type MagicTransitGRETunnel added in v0.32.0

type MagicTransitGRETunnel struct {
	ID                    string                            `json:"id,omitempty"`
	CreatedOn             *time.Time                        `json:"created_on,omitempty"`
	ModifiedOn            *time.Time                        `json:"modified_on,omitempty"`
	Name                  string                            `json:"name"`
	CustomerGREEndpoint   string                            `json:"customer_gre_endpoint"`
	CloudflareGREEndpoint string                            `json:"cloudflare_gre_endpoint"`
	InterfaceAddress      string                            `json:"interface_address"`
	Description           string                            `json:"description,omitempty"`
	TTL                   uint8                             `json:"ttl,omitempty"`
	MTU                   uint16                            `json:"mtu,omitempty"`
	HealthCheck           *MagicTransitGRETunnelHealthcheck `json:"health_check,omitempty"`
}

MagicTransitGRETunnel contains information about a GRE tunnel.

type MagicTransitGRETunnelHealthcheck added in v0.32.0

type MagicTransitGRETunnelHealthcheck struct {
	Enabled bool   `json:"enabled"`
	Target  string `json:"target,omitempty"`
	Type    string `json:"type,omitempty"`
}

MagicTransitGRETunnelHealthcheck contains information about a GRE tunnel health check.

type MagicTransitIPsecTunnel added in v0.31.0

type MagicTransitIPsecTunnel struct {
	ID                 string                              `json:"id,omitempty"`
	CreatedOn          *time.Time                          `json:"created_on,omitempty"`
	ModifiedOn         *time.Time                          `json:"modified_on,omitempty"`
	Name               string                              `json:"name"`
	CustomerEndpoint   string                              `json:"customer_endpoint,omitempty"`
	CloudflareEndpoint string                              `json:"cloudflare_endpoint"`
	InterfaceAddress   string                              `json:"interface_address"`
	Description        string                              `json:"description,omitempty"`
	HealthCheck        *MagicTransitTunnelHealthcheck      `json:"health_check,omitempty"`
	Psk                string                              `json:"psk,omitempty"`
	PskMetadata        *MagicTransitIPsecTunnelPskMetadata `json:"psk_metadata,omitempty"`
	RemoteIdentities   *RemoteIdentities                   `json:"remote_identities,omitempty"`
	AllowNullCipher    bool                                `json:"allow_null_cipher"`
	ReplayProtection   *bool                               `json:"replay_protection,omitempty"`
}

MagicTransitIPsecTunnel contains information about an IPsec tunnel.

type MagicTransitIPsecTunnelPskMetadata added in v0.41.0

type MagicTransitIPsecTunnelPskMetadata struct {
	LastGeneratedOn *time.Time `json:"last_generated_on,omitempty"`
}

MagicTransitIPsecTunnelPskMetadata contains metadata associated with PSK.

type MagicTransitStaticRoute added in v0.18.0

type MagicTransitStaticRoute struct {
	ID          string                       `json:"id,omitempty"`
	Prefix      string                       `json:"prefix"`
	CreatedOn   *time.Time                   `json:"created_on,omitempty"`
	ModifiedOn  *time.Time                   `json:"modified_on,omitempty"`
	Nexthop     string                       `json:"nexthop"`
	Priority    int                          `json:"priority,omitempty"`
	Description string                       `json:"description,omitempty"`
	Weight      int                          `json:"weight,omitempty"`
	Scope       MagicTransitStaticRouteScope `json:"scope,omitempty"`
}

MagicTransitStaticRoute contains information about a static route.

type MagicTransitStaticRouteScope added in v0.18.0

type MagicTransitStaticRouteScope struct {
	ColoRegions []string `json:"colo_regions,omitempty"`
	ColoNames   []string `json:"colo_names,omitempty"`
}

MagicTransitStaticRouteScope contains information about a static route's scope.

type MagicTransitTunnelHealthcheck added in v0.41.0

type MagicTransitTunnelHealthcheck struct {
	Enabled   bool   `json:"enabled"`
	Target    string `json:"target,omitempty"`
	Type      string `json:"type,omitempty"`
	Rate      string `json:"rate,omitempty"`
	Direction string `json:"direction,omitempty"`
}

MagicTransitTunnelHealthcheck contains information about a tunnel health check.

type ManagedHeader added in v0.42.0

type ManagedHeader struct {
	ID            string   `json:"id"`
	Enabled       bool     `json:"enabled"`
	HasCoflict    bool     `json:"has_conflict,omitempty"`
	ConflictsWith []string `json:"conflicts_with,omitempty"`
}

type ManagedHeaders added in v0.42.0

type ManagedHeaders struct {
	ManagedRequestHeaders  []ManagedHeader `json:"managed_request_headers"`
	ManagedResponseHeaders []ManagedHeader `json:"managed_response_headers"`
}

type MisCategorizationParameters added in v0.45.0

type MisCategorizationParameters struct {
	AccountID       string
	IndicatorType   string `json:"indicator_type,omitempty"`
	IP              string `json:"ip,omitempty"`
	URL             string `json:"url,omitempty"`
	ContentAdds     []int  `json:"content_adds,omitempty"`
	ContentRemoves  []int  `json:"content_removes,omitempty"`
	SecurityAdds    []int  `json:"security_adds,omitempty"`
	SecurityRemoves []int  `json:"security_removes,omitempty"`
}

MisCategorizationParameters represents the parameters for a miscategorization request.

type NamespaceBindingMap added in v0.49.0

type NamespaceBindingMap map[string]*NamespaceBindingValue

type NamespaceBindingValue added in v0.49.0

type NamespaceBindingValue struct {
	Value string `json:"namespace_id"`
}

type NamespaceOutboundOptions added in v0.74.0

type NamespaceOutboundOptions struct {
	Worker WorkerReference
	Params []OutboundParamSchema
}

type NotFoundError added in v0.36.0

type NotFoundError struct {
	// contains filtered or unexported fields
}

NotFoundError is for HTTP 404 responses.

func NewNotFoundError added in v0.48.0

func NewNotFoundError(e *Error) NotFoundError

func (NotFoundError) Error added in v0.36.0

func (e NotFoundError) Error() string

func (NotFoundError) ErrorCodes added in v0.36.0

func (e NotFoundError) ErrorCodes() []int

func (NotFoundError) ErrorMessages added in v0.36.0

func (e NotFoundError) ErrorMessages() []string

func (NotFoundError) Errors added in v0.36.0

func (e NotFoundError) Errors() []ResponseInfo

func (NotFoundError) InternalErrorCodeIs added in v0.48.0

func (e NotFoundError) InternalErrorCodeIs(code int) bool

func (NotFoundError) RayID added in v0.36.0

func (e NotFoundError) RayID() string

func (NotFoundError) Type added in v0.36.0

func (e NotFoundError) Type() ErrorType

type NotificationAlertWithDescription added in v0.19.0

type NotificationAlertWithDescription struct {
	DisplayName string `json:"display_name"`
	Type        string `json:"type"`
	Description string `json:"description"`
}

NotificationAlertWithDescription represents the alert/notification available.

type NotificationAvailableAlertsResponse added in v0.19.0

type NotificationAvailableAlertsResponse struct {
	Response
	Result NotificationsGroupedByProduct
}

NotificationAvailableAlertsResponse describes the available alerts/notifications grouped by products.

type NotificationEligibilityResponse added in v0.19.0

type NotificationEligibilityResponse struct {
	Response
	Result NotificationMechanisms
}

NotificationEligibilityResponse describes the eligible mechanisms that can be configured for a notification.

type NotificationHistory added in v0.28.0

type NotificationHistory struct {
	ID            string    `json:"id"`
	Name          string    `json:"name"`
	Description   string    `json:"description"`
	AlertBody     string    `json:"alert_body"`
	AlertType     string    `json:"alert_type"`
	Mechanism     string    `json:"mechanism"`
	MechanismType string    `json:"mechanism_type"`
	Sent          time.Time `json:"sent"`
}

NotificationHistory describes the history of notifications sent for an account.

type NotificationHistoryResponse added in v0.28.0

type NotificationHistoryResponse struct {
	Response
	ResultInfo `json:"result_info"`
	Result     []NotificationHistory
}

NotificationHistoryResponse describes the notification history response for an account for a specific time period.

type NotificationMechanismData added in v0.19.0

type NotificationMechanismData struct {
	Name string `json:"name"`
	ID   string `json:"id"`
}

NotificationMechanismData holds a single public facing mechanism data integation.

type NotificationMechanismIntegrations added in v0.19.0

type NotificationMechanismIntegrations []NotificationMechanismData

NotificationMechanismIntegrations is a list of all the integrations of a certain mechanism type e.g. all email integrations.

type NotificationMechanismMetaData added in v0.19.0

type NotificationMechanismMetaData struct {
	Eligible bool   `json:"eligible"`
	Ready    bool   `json:"ready"`
	Type     string `json:"type"`
}

NotificationMechanismMetaData represents the state of the delivery mechanism.

type NotificationMechanisms added in v0.19.0

type NotificationMechanisms struct {
	Email     NotificationMechanismMetaData `json:"email"`
	PagerDuty NotificationMechanismMetaData `json:"pagerduty"`
	Webhooks  NotificationMechanismMetaData `json:"webhooks,omitempty"`
}

NotificationMechanisms are the different possible delivery mechanisms.

type NotificationPagerDutyResource added in v0.19.0

type NotificationPagerDutyResource struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

NotificationPagerDutyResource describes a PagerDuty integration.

type NotificationPagerDutyResponse added in v0.19.0

type NotificationPagerDutyResponse struct {
	Response
	ResultInfo
	Result NotificationPagerDutyResource
}

NotificationPagerDutyResponse describes the PagerDuty integration retrieved.

type NotificationPoliciesResponse added in v0.19.0

type NotificationPoliciesResponse struct {
	Response
	ResultInfo
	Result []NotificationPolicy
}

NotificationPoliciesResponse holds the response for listing all notification policies for an account.

type NotificationPolicy added in v0.19.0

type NotificationPolicy struct {
	ID          string                                       `json:"id"`
	Name        string                                       `json:"name"`
	Description string                                       `json:"description"`
	Enabled     bool                                         `json:"enabled"`
	AlertType   string                                       `json:"alert_type"`
	Mechanisms  map[string]NotificationMechanismIntegrations `json:"mechanisms"`
	Created     time.Time                                    `json:"created"`
	Modified    time.Time                                    `json:"modified"`
	Conditions  map[string]interface{}                       `json:"conditions"`
	Filters     map[string][]string                          `json:"filters"`
}

NotificationPolicy represents the notification policy created along with the destinations.

type NotificationPolicyResponse added in v0.19.0

type NotificationPolicyResponse struct {
	Response
	Result NotificationPolicy
}

NotificationPolicyResponse holds the response type when a single policy is retrieved.

type NotificationResource added in v0.19.0

type NotificationResource struct {
	ID string
}

NotificationResource describes the id of an inserted/updated/deleted resource.

type NotificationUpsertWebhooks added in v0.19.0

type NotificationUpsertWebhooks struct {
	Name   string `json:"name"`
	URL    string `json:"url"`
	Secret string `json:"secret"`
}

NotificationUpsertWebhooks describes a valid webhook request.

type NotificationWebhookIntegration added in v0.19.0

type NotificationWebhookIntegration struct {
	ID          string     `json:"id"`
	Name        string     `json:"name"`
	Type        string     `json:"type"`
	URL         string     `json:"url"`
	CreatedAt   time.Time  `json:"created_at"`
	LastSuccess *time.Time `json:"last_success"`
	LastFailure *time.Time `json:"last_failure"`
}

NotificationWebhookIntegration describes the webhook information along with its status.

type NotificationWebhookResponse added in v0.19.0

type NotificationWebhookResponse struct {
	Response
	ResultInfo
	Result NotificationWebhookIntegration
}

NotificationWebhookResponse describes a single webhook retrieved.

type NotificationWebhooksResponse added in v0.19.0

type NotificationWebhooksResponse struct {
	Response
	ResultInfo
	Result []NotificationWebhookIntegration
}

NotificationWebhooksResponse describes a list of webhooks retrieved.

type NotificationsGroupedByProduct added in v0.19.0

type NotificationsGroupedByProduct map[string][]NotificationAlertWithDescription

NotificationsGroupedByProduct are grouped by products.

type ObservatoryCountResponse added in v0.78.0

type ObservatoryCountResponse struct {
	Response
	Result struct {
		Count int `json:"count"`
	} `json:"result"`
}

type ObservatoryLighthouseReport added in v0.78.0

type ObservatoryLighthouseReport struct {
	PerformanceScore int    `json:"performanceScore"`
	State            string `json:"state"`
	DeviceType       string `json:"deviceType"`
	// TTFB is time to first byte
	TTFB int `json:"ttfb"`
	// FCP is first contentful paint
	FCP int `json:"fcp"`
	// LCP is largest contentful pain
	LCP int `json:"lcp"`
	// TTI is time to interactive
	TTI int `json:"tti"`
	// TBT is total blocking time
	TBT int `json:"tbt"`
	// SI is speed index
	SI int `json:"si"`
	// CLS is cumulative layout shift
	CLS   float64          `json:"cls"`
	Error *lighthouseError `json:"error,omitempty"`
}

ObservatoryLighthouseReport describes the web vital metrics result.

type ObservatoryPage added in v0.78.0

type ObservatoryPage struct {
	URL               string                `json:"url"`
	Region            labeledRegion         `json:"region"`
	ScheduleFrequency string                `json:"scheduleFrequency"`
	Tests             []ObservatoryPageTest `json:"tests"`
}

ObservatoryPage describes all the tests for a web page.

type ObservatoryPageTest added in v0.78.0

type ObservatoryPageTest struct {
	ID                string                      `json:"id"`
	Date              *time.Time                  `json:"date"`
	URL               string                      `json:"url"`
	Region            labeledRegion               `json:"region"`
	ScheduleFrequency *string                     `json:"scheduleFrequency"`
	MobileReport      ObservatoryLighthouseReport `json:"mobileReport"`
	DesktopReport     ObservatoryLighthouseReport `json:"desktopReport"`
}

ObservatoryPageTest describes a single test for a web page.

type ObservatoryPageTestResponse added in v0.78.0

type ObservatoryPageTestResponse struct {
	Response
	Result ObservatoryPageTest `json:"result"`
}

type ObservatoryPageTestsResponse added in v0.78.0

type ObservatoryPageTestsResponse struct {
	Response
	Result     []ObservatoryPageTest `json:"result"`
	ResultInfo `json:"result_info"`
}

type ObservatoryPageTrend added in v0.78.0

type ObservatoryPageTrend struct {
	PerformanceScore []*int     `json:"performanceScore"`
	TTFB             []*int     `json:"ttfb"`
	FCP              []*int     `json:"fcp"`
	LCP              []*int     `json:"lcp"`
	TTI              []*int     `json:"tti"`
	TBT              []*int     `json:"tbt"`
	SI               []*int     `json:"si"`
	CLS              []*float64 `json:"cls"`
}

ObservatoryPageTrend describes the web vital metrics trend.

type ObservatoryPageTrendResponse added in v0.78.0

type ObservatoryPageTrendResponse struct {
	Response
	Result ObservatoryPageTrend `json:"result"`
}

type ObservatoryPagesResponse added in v0.78.0

type ObservatoryPagesResponse struct {
	Response
	Result []ObservatoryPage `json:"result"`
}

ObservatoryPagesResponse is the API response, containing a list of ObservatoryPage.

type ObservatorySchedule added in v0.78.0

type ObservatorySchedule struct {
	URL       string `json:"url"`
	Region    string `json:"region"`
	Frequency string `json:"frequency"`
}

ObservatorySchedule describe a test schedule.

type ObservatoryScheduleResponse added in v0.78.0

type ObservatoryScheduleResponse struct {
	Response
	Result ObservatorySchedule `json:"result"`
}

type ObservatoryScheduledPageTest added in v0.78.0

type ObservatoryScheduledPageTest struct {
	Schedule ObservatorySchedule `json:"schedule"`
	Test     ObservatoryPageTest `json:"test"`
}

type Operator added in v0.41.0

type Operator string
const (
	Equal              Operator = "eq"
	NotEqual           Operator = "!eq"
	LessThan           Operator = "lt"
	LessThanOrEqual    Operator = "leq"
	GreaterThan        Operator = "gt"
	GreaterThanOrEqual Operator = "geq"
	StartsWith         Operator = "startsWith"
	EndsWith           Operator = "endsWith"
	NotStartsWith      Operator = "!startsWith"
	NotEndsWith        Operator = "!endsWith"
	Contains           Operator = "contains"
	NotContains        Operator = "!contains"
	ValueIsIn          Operator = "in"
	ValueIsNotIn       Operator = "!in"
)

type Option added in v0.7.2

type Option func(*API) error

Option is a functional option for configuring the API client.

func BaseURL added in v0.15.0

func BaseURL(baseURL string) Option

BaseURL allows you to override the default HTTP base URL used for API calls.

func Debug added in v0.36.0

func Debug(debug bool) Option

func HTTPClient added in v0.7.2

func HTTPClient(client *http.Client) Option

HTTPClient accepts a custom *http.Client for making API calls.

func Headers added in v0.7.2

func Headers(headers http.Header) Option

Headers allows you to set custom HTTP headers when making API calls (e.g. for satisfying HTTP proxies, or for debugging).

func UserAgent added in v0.9.0

func UserAgent(userAgent string) Option

UserAgent can be set if you want to send a software name and version for HTTP access logs. It is recommended to set it in order to help future Customer Support diagnostics and prevent collateral damage by sharing generic User-Agent string with abusive users. E.g. "my-software/1.2.3". By default generic Go User-Agent is used.

func UsingLogger added in v0.8.5

func UsingLogger(logger Logger) Option

UsingLogger can be set if you want to get log output from this API instance By default no log output is emitted.

func UsingRateLimit added in v0.8.5

func UsingRateLimit(rps float64) Option

UsingRateLimit applies a non-default rate limit to client API requests If not specified the default of 4rps will be applied.

func UsingRetryPolicy added in v0.8.5

func UsingRetryPolicy(maxRetries int, minRetryDelaySecs int, maxRetryDelaySecs int) Option

UsingRetryPolicy applies a non-default number of retries and min/max retry delays This will be used when the client exponentially backs off after errored requests.

type OrderDirection added in v0.66.0

type OrderDirection string
const (
	OrderDirectionAsc  OrderDirection = "asc"
	OrderDirectionDesc OrderDirection = "desc"
)

type OriginCACertificate

type OriginCACertificate struct {
	ID              string    `json:"id"`
	Certificate     string    `json:"certificate"`
	Hostnames       []string  `json:"hostnames"`
	ExpiresOn       time.Time `json:"expires_on"`
	RequestType     string    `json:"request_type"`
	RequestValidity int       `json:"requested_validity"`
	RevokedAt       time.Time `json:"revoked_at,omitempty"`
	CSR             string    `json:"csr"`
}

OriginCACertificate represents a Cloudflare-issued certificate.

API reference: https://api.cloudflare.com/#cloudflare-ca

func (*OriginCACertificate) UnmarshalJSON

func (c *OriginCACertificate) UnmarshalJSON(data []byte) error

UnmarshalJSON handles custom parsing from an API response to an OriginCACertificate http://choly.ca/post/go-json-marshalling/

type OriginCACertificateID added in v0.7.4

type OriginCACertificateID struct {
	ID string `json:"id"`
}

OriginCACertificateID represents the ID of the revoked certificate from the Revoke Certificate endpoint.

type OriginRequestConfig added in v0.43.0

type OriginRequestConfig struct {
	// HTTP proxy timeout for establishing a new connection
	ConnectTimeout *TunnelDuration `json:"connectTimeout,omitempty"`
	// HTTP proxy timeout for completing a TLS handshake
	TLSTimeout *TunnelDuration `json:"tlsTimeout,omitempty"`
	// HTTP proxy TCP keepalive duration
	TCPKeepAlive *TunnelDuration `json:"tcpKeepAlive,omitempty"`
	// HTTP proxy should disable "happy eyeballs" for IPv4/v6 fallback
	NoHappyEyeballs *bool `json:"noHappyEyeballs,omitempty"`
	// HTTP proxy maximum keepalive connection pool size
	KeepAliveConnections *int `json:"keepAliveConnections,omitempty"`
	// HTTP proxy timeout for closing an idle connection
	KeepAliveTimeout *TunnelDuration `json:"keepAliveTimeout,omitempty"`
	// Sets the HTTP Host header for the local webserver.
	HTTPHostHeader *string `json:"httpHostHeader,omitempty"`
	// Hostname on the origin server certificate.
	OriginServerName *string `json:"originServerName,omitempty"`
	// Path to the CA for the certificate of your origin.
	// This option should be used only if your certificate is not signed by Cloudflare.
	CAPool *string `json:"caPool,omitempty"`
	// Disables TLS verification of the certificate presented by your origin.
	// Will allow any certificate from the origin to be accepted.
	// Note: The connection from your machine to Cloudflare's Edge is still encrypted.
	NoTLSVerify *bool `json:"noTLSVerify,omitempty"`
	// Disables chunked transfer encoding.
	// Useful if you are running a WSGI server.
	DisableChunkedEncoding *bool `json:"disableChunkedEncoding,omitempty"`
	// Runs as jump host
	BastionMode *bool `json:"bastionMode,omitempty"`
	// Listen address for the proxy.
	ProxyAddress *string `json:"proxyAddress,omitempty"`
	// Listen port for the proxy.
	ProxyPort *uint `json:"proxyPort,omitempty"`
	// Valid options are 'socks' or empty.
	ProxyType *string `json:"proxyType,omitempty"`
	// IP rules for the proxy service
	IPRules []IngressIPRule `json:"ipRules,omitempty"`
	// Attempt to connect to origin with HTTP/2
	Http2Origin *bool `json:"http2Origin,omitempty"`
	// Access holds all access related configs
	Access *AccessConfig `json:"access,omitempty"`
}

OriginRequestConfig is a set of optional fields that users may set to customize how cloudflared sends requests to origin services. It is used to set up general config that apply to all rules, and also, specific per-rule config.

type OutboundParamSchema added in v0.74.0

type OutboundParamSchema struct {
	Name string
}

type Owner added in v0.7.2

type Owner struct {
	ID        string `json:"id"`
	Email     string `json:"email"`
	Name      string `json:"name"`
	OwnerType string `json:"type"`
}

Owner describes the resource owner.

type PageRule added in v0.7.2

type PageRule struct {
	ID         string           `json:"id,omitempty"`
	Targets    []PageRuleTarget `json:"targets"`
	Actions    []PageRuleAction `json:"actions"`
	Priority   int              `json:"priority"`
	Status     string           `json:"status"`
	ModifiedOn time.Time        `json:"modified_on,omitempty"`
	CreatedOn  time.Time        `json:"created_on,omitempty"`
}

PageRule describes a Page Rule.

type PageRuleAction added in v0.7.2

type PageRuleAction struct {
	ID    string      `json:"id"`
	Value interface{} `json:"value"`
}

PageRuleAction is the action to take when the target is matched.

Valid IDs are:

always_online
always_use_https
automatic_https_rewrites
browser_cache_ttl
browser_check
bypass_cache_on_cookie
cache_by_device_type
cache_deception_armor
cache_level
cache_key_fields
cache_on_cookie
disable_apps
disable_performance
disable_railgun
disable_security
edge_cache_ttl
email_obfuscation
explicit_cache_control
forwarding_url
host_header_override
ip_geolocation
minify
mirage
opportunistic_encryption
origin_error_page_pass_thru
polish
resolve_override
respect_strong_etag
response_buffering
rocket_loader
security_level
server_side_exclude
sort_query_string_for_cache
ssl
true_client_ip_header
waf

type PageRuleDetailResponse added in v0.7.2

type PageRuleDetailResponse struct {
	Success  bool     `json:"success"`
	Errors   []string `json:"errors"`
	Messages []string `json:"messages"`
	Result   PageRule `json:"result"`
}

PageRuleDetailResponse is the API response, containing a single PageRule.

type PageRuleTarget added in v0.7.2

type PageRuleTarget struct {
	Target     string `json:"target"`
	Constraint struct {
		Operator string `json:"operator"`
		Value    string `json:"value"`
	} `json:"constraint"`
}

PageRuleTarget is the target to evaluate on a request.

Currently Target must always be "url" and Operator must be "matches". Value is the URL pattern to match against.

type PageRulesResponse added in v0.7.2

type PageRulesResponse struct {
	Success  bool       `json:"success"`
	Errors   []string   `json:"errors"`
	Messages []string   `json:"messages"`
	Result   []PageRule `json:"result"`
}

PageRulesResponse is the API response, containing an array of PageRules.

type PageShield added in v0.84.0

type PageShield struct {
	Enabled                        *bool `json:"enabled,omitempty"`
	UseCloudflareReportingEndpoint *bool `json:"use_cloudflare_reporting_endpoint,omitempty"`
	UseConnectionURLPath           *bool `json:"use_connection_url_path,omitempty"`
}

PageShield represents the page shield object minus any timestamps.

type PageShieldConnection added in v0.84.0

type PageShieldConnection struct {
	AddedAt                 string   `json:"added_at"`
	DomainReportedMalicious *bool    `json:"domain_reported_malicious,omitempty"`
	FirstPageURL            string   `json:"first_page_url"`
	FirstSeenAt             string   `json:"first_seen_at"`
	Host                    string   `json:"host"`
	ID                      string   `json:"id"`
	LastSeenAt              string   `json:"last_seen_at"`
	PageURLs                []string `json:"page_urls"`
	URL                     string   `json:"url"`
	URLContainsCdnCgiPath   *bool    `json:"url_contains_cdn_cgi_path,omitempty"`
}

PageShieldConnection represents a page shield connection.

type PageShieldPolicy added in v0.84.0

type PageShieldPolicy struct {
	Action      string `json:"action"`
	Description string `json:"description"`
	Enabled     *bool  `json:"enabled,omitempty"`
	Expression  string `json:"expression"`
	ID          string `json:"id"`
	Value       string `json:"value"`
}

PageShieldPolicy represents a page shield policy.

type PageShieldScript added in v0.84.0

type PageShieldScript struct {
	AddedAt                 string   `json:"added_at"`
	DomainReportedMalicious *bool    `json:"domain_reported_malicious,omitempty"`
	FetchedAt               string   `json:"fetched_at"`
	FirstPageURL            string   `json:"first_page_url"`
	FirstSeenAt             string   `json:"first_seen_at"`
	Hash                    string   `json:"hash"`
	Host                    string   `json:"host"`
	ID                      string   `json:"id"`
	JSIntegrityScore        int      `json:"js_integrity_score"`
	LastSeenAt              string   `json:"last_seen_at"`
	PageURLs                []string `json:"page_urls"`
	URL                     string   `json:"url"`
	URLContainsCdnCgiPath   *bool    `json:"url_contains_cdn_cgi_path,omitempty"`
}

PageShieldScript represents a Page Shield script.

type PageShieldScriptResponse added in v0.84.0

type PageShieldScriptResponse struct {
	Result   PageShieldScript          `json:"result"`
	Versions []PageShieldScriptVersion `json:"versions"`
}

PageShieldScriptResponse represents the response from the PageShield Script API.

type PageShieldScriptVersion added in v0.84.0

type PageShieldScriptVersion struct {
	FetchedAt        string `json:"fetched_at"`
	Hash             string `json:"hash"`
	JSIntegrityScore int    `json:"js_integrity_score"`
}

PageShieldScriptVersion represents a Page Shield script version.

type PageShieldScriptsResponse added in v0.84.0

type PageShieldScriptsResponse struct {
	Results []PageShieldScript `json:"result"`
	Response
	ResultInfo `json:"result_info"`
}

PageShieldScriptsResponse represents the response from the PageShield Script API.

type PageShieldSettings added in v0.84.0

type PageShieldSettings struct {
	PageShield
	UpdatedAt string `json:"updated_at"`
}

PageShieldSettings represents the page shield settings for a zone.

type PageShieldSettingsResponse added in v0.84.0

type PageShieldSettingsResponse struct {
	PageShield PageShieldSettings `json:"result"`
	Response
}

PageShieldSettingsResponse represents the response from the page shield settings endpoint.

type PagesDeploymentLogEntry added in v0.43.0

type PagesDeploymentLogEntry struct {
	Timestamp *time.Time `json:"ts"`
	Line      string     `json:"line"`
}

PagesDeploymentLogEntry represents a single log entry in a Pages deployment.

type PagesDeploymentLogs added in v0.43.0

type PagesDeploymentLogs struct {
	Total                 int                       `json:"total"`
	IncludesContainerLogs bool                      `json:"includes_container_logs"`
	Data                  []PagesDeploymentLogEntry `json:"data"`
}

PagesDeploymentLogs represents the logs for a Pages deployment.

type PagesDeploymentStageLogEntry added in v0.40.0

type PagesDeploymentStageLogEntry struct {
	ID        int        `json:"id"`
	Timestamp *time.Time `json:"timestamp"`
	Message   string     `json:"message"`
}

PagesDeploymentStageLogEntry represents a single log entry in a Pages deployment stage.

type PagesDeploymentStageLogs added in v0.40.0

type PagesDeploymentStageLogs struct {
	Name      string                         `json:"name"`
	StartedOn *time.Time                     `json:"started_on"`
	EndedOn   *time.Time                     `json:"ended_on"`
	Status    string                         `json:"status"`
	Start     int                            `json:"start"`
	End       int                            `json:"end"`
	Total     int                            `json:"total"`
	Data      []PagesDeploymentStageLogEntry `json:"data"`
}

PagesDeploymentStageLogs represents the logs for a Pages deployment stage.

type PagesDomain added in v0.44.0

type PagesDomain struct {
	ID               string           `json:"id"`
	Name             string           `json:"name"`
	Status           string           `json:"status"`
	VerificationData VerificationData `json:"verification_data"`
	ValidationData   ValidationData   `json:"validation_data"`
	ZoneTag          string           `json:"zone_tag"`
	CreatedOn        *time.Time       `json:"created_on"`
}

PagesDomain represents a pages domain.

type PagesDomainParameters added in v0.44.0

type PagesDomainParameters struct {
	AccountID   string `json:"-"`
	ProjectName string `json:"-"`
	DomainName  string `json:"name,omitempty"`
}

PagesDomainParameters represents parameters for a pages domain request.

type PagesDomainResponse added in v0.44.0

type PagesDomainResponse struct {
	Response
	Result PagesDomain `json:"result,omitempty"`
}

PagesDomainResponse represents an API response for a pages domain request.

type PagesDomainsParameters added in v0.44.0

type PagesDomainsParameters struct {
	AccountID   string
	ProjectName string
}

PagesDomainsParameters represents parameters for a pages domains request.

type PagesDomainsResponse added in v0.44.0

type PagesDomainsResponse struct {
	Response
	Result []PagesDomain `json:"result,omitempty"`
}

PagesDomainsResponse represents an API response for a pages domains request.

type PagesPreviewDeploymentSetting added in v0.49.0

type PagesPreviewDeploymentSetting string
const (
	PagesPreviewAllBranches    PagesPreviewDeploymentSetting = "all"
	PagesPreviewNoBranches     PagesPreviewDeploymentSetting = "none"
	PagesPreviewCustomBranches PagesPreviewDeploymentSetting = "custom"
)

type PagesProject added in v0.26.0

type PagesProject struct {
	Name                string                        `json:"name,omitempty"`
	ID                  string                        `json:"id"`
	CreatedOn           *time.Time                    `json:"created_on"`
	SubDomain           string                        `json:"subdomain"`
	Domains             []string                      `json:"domains,omitempty"`
	Source              *PagesProjectSource           `json:"source,omitempty"`
	BuildConfig         PagesProjectBuildConfig       `json:"build_config"`
	DeploymentConfigs   PagesProjectDeploymentConfigs `json:"deployment_configs"`
	LatestDeployment    PagesProjectDeployment        `json:"latest_deployment"`
	CanonicalDeployment PagesProjectDeployment        `json:"canonical_deployment"`
	ProductionBranch    string                        `json:"production_branch,omitempty"`
}

PagesProject represents a Pages project.

type PagesProjectBuildConfig added in v0.26.0

type PagesProjectBuildConfig struct {
	BuildCaching      *bool  `json:"build_caching,omitempty"`
	BuildCommand      string `json:"build_command"`
	DestinationDir    string `json:"destination_dir"`
	RootDir           string `json:"root_dir"`
	WebAnalyticsTag   string `json:"web_analytics_tag"`
	WebAnalyticsToken string `json:"web_analytics_token"`
}

PagesProjectBuildConfig represents the configuration of a Pages project build process.

type PagesProjectDeployment added in v0.26.0

type PagesProjectDeployment struct {
	ID                 string                        `json:"id"`
	ShortID            string                        `json:"short_id"`
	ProjectID          string                        `json:"project_id"`
	ProjectName        string                        `json:"project_name"`
	Environment        string                        `json:"environment"`
	URL                string                        `json:"url"`
	CreatedOn          *time.Time                    `json:"created_on"`
	ModifiedOn         *time.Time                    `json:"modified_on"`
	Aliases            []string                      `json:"aliases,omitempty"`
	LatestStage        PagesProjectDeploymentStage   `json:"latest_stage"`
	EnvVars            EnvironmentVariableMap        `json:"env_vars"`
	KvNamespaces       NamespaceBindingMap           `json:"kv_namespaces,omitempty"`
	DoNamespaces       NamespaceBindingMap           `json:"durable_object_namespaces,omitempty"`
	D1Databases        D1BindingMap                  `json:"d1_databases,omitempty"`
	R2Bindings         R2BindingMap                  `json:"r2_buckets,omitempty"`
	ServiceBindings    ServiceBindingMap             `json:"services,omitempty"`
	Placement          *Placement                    `json:"placement,omitempty"`
	DeploymentTrigger  PagesProjectDeploymentTrigger `json:"deployment_trigger"`
	Stages             []PagesProjectDeploymentStage `json:"stages"`
	BuildConfig        PagesProjectBuildConfig       `json:"build_config"`
	Source             PagesProjectSource            `json:"source"`
	CompatibilityDate  string                        `json:"compatibility_date,omitempty"`
	CompatibilityFlags []string                      `json:"compatibility_flags,omitempty"`
	UsageModel         UsageModel                    `json:"usage_model,omitempty"`
	IsSkipped          bool                          `json:"is_skipped"`
	ProductionBranch   string                        `json:"production_branch,omitempty"`
}

PagesProjectDeployment represents a deployment to a Pages project.

type PagesProjectDeploymentConfigEnvironment added in v0.26.0

type PagesProjectDeploymentConfigEnvironment struct {
	EnvVars                          EnvironmentVariableMap `json:"env_vars,omitempty"`
	KvNamespaces                     NamespaceBindingMap    `json:"kv_namespaces,omitempty"`
	DoNamespaces                     NamespaceBindingMap    `json:"durable_object_namespaces,omitempty"`
	D1Databases                      D1BindingMap           `json:"d1_databases,omitempty"`
	R2Bindings                       R2BindingMap           `json:"r2_buckets,omitempty"`
	ServiceBindings                  ServiceBindingMap      `json:"services,omitempty"`
	CompatibilityDate                string                 `json:"compatibility_date,omitempty"`
	CompatibilityFlags               []string               `json:"compatibility_flags,omitempty"`
	FailOpen                         bool                   `json:"fail_open"`
	AlwaysUseLatestCompatibilityDate bool                   `json:"always_use_latest_compatibility_date"`
	UsageModel                       UsageModel             `json:"usage_model,omitempty"`
	Placement                        *Placement             `json:"placement,omitempty"`
}

PagesProjectDeploymentConfigEnvironment represents the configuration for preview or production deploys.

type PagesProjectDeploymentConfigs added in v0.26.0

type PagesProjectDeploymentConfigs struct {
	Preview    PagesProjectDeploymentConfigEnvironment `json:"preview"`
	Production PagesProjectDeploymentConfigEnvironment `json:"production"`
}

PagesProjectDeploymentConfigs represents the configuration for deployments in a Pages project.

type PagesProjectDeploymentStage added in v0.26.0

type PagesProjectDeploymentStage struct {
	Name      string     `json:"name"`
	StartedOn *time.Time `json:"started_on,omitempty"`
	EndedOn   *time.Time `json:"ended_on,omitempty"`
	Status    string     `json:"status"`
}

PagesProjectDeploymentStage represents an individual stage in a Pages project deployment.

type PagesProjectDeploymentTrigger added in v0.26.0

type PagesProjectDeploymentTrigger struct {
	Type     string                                 `json:"type"`
	Metadata *PagesProjectDeploymentTriggerMetadata `json:"metadata"`
}

PagesProjectDeploymentTrigger represents information about what caused a deployment.

type PagesProjectDeploymentTriggerMetadata added in v0.26.0

type PagesProjectDeploymentTriggerMetadata struct {
	Branch        string `json:"branch"`
	CommitHash    string `json:"commit_hash"`
	CommitMessage string `json:"commit_message"`
}

PagesProjectDeploymentTriggerMetadata represents additional information about the cause of a deployment.

type PagesProjectSource added in v0.26.0

type PagesProjectSource struct {
	Type   string                    `json:"type"`
	Config *PagesProjectSourceConfig `json:"config"`
}

PagesProjectSource represents the configuration of a Pages project source.

type PagesProjectSourceConfig added in v0.26.0

type PagesProjectSourceConfig struct {
	Owner                        string                        `json:"owner"`
	RepoName                     string                        `json:"repo_name"`
	ProductionBranch             string                        `json:"production_branch"`
	PRCommentsEnabled            bool                          `json:"pr_comments_enabled"`
	DeploymentsEnabled           bool                          `json:"deployments_enabled"`
	ProductionDeploymentsEnabled bool                          `json:"production_deployments_enabled"`
	PreviewDeploymentSetting     PagesPreviewDeploymentSetting `json:"preview_deployment_setting"`
	PreviewBranchIncludes        []string                      `json:"preview_branch_includes"`
	PreviewBranchExcludes        []string                      `json:"preview_branch_excludes"`
}

PagesProjectSourceConfig represents the properties use to configure a Pages project source.

type PaginationOptions added in v0.8.5

type PaginationOptions struct {
	Page    int `json:"page,omitempty" url:"page,omitempty"`
	PerPage int `json:"per_page,omitempty" url:"per_page,omitempty"`
}

PaginationOptions can be passed to a list request to configure paging These values will be defaulted if omitted, and PerPage has min/max limits set by resource.

type PatchTeamsList added in v0.17.0

type PatchTeamsList struct {
	ID     string          `json:"id"`
	Append []TeamsListItem `json:"append"`
	Remove []string        `json:"remove"`
}

PatchTeamsList represents a patch request for appending/removing list items.

type PatchTeamsListParams added in v0.53.0

type PatchTeamsListParams struct {
	ID     string          `json:"id"`
	Append []TeamsListItem `json:"append"`
	Remove []string        `json:"remove"`
}

type PatchWaitingRoomSettingsParams added in v0.67.0

type PatchWaitingRoomSettingsParams struct {
	SearchEngineCrawlerBypass *bool `json:"search_engine_crawler_bypass,omitempty"`
}

type PerHostnameAuthenticatedOriginPullsCertificateDetails added in v0.12.2

type PerHostnameAuthenticatedOriginPullsCertificateDetails struct {
	ID           string    `json:"id"`
	Certificate  string    `json:"certificate"`
	Issuer       string    `json:"issuer"`
	Signature    string    `json:"signature"`
	SerialNumber string    `json:"serial_number"`
	ExpiresOn    time.Time `json:"expires_on"`
	Status       string    `json:"status"`
	UploadedOn   time.Time `json:"uploaded_on"`
}

PerHostnameAuthenticatedOriginPullsCertificateDetails represents the metadata for a Per Hostname AuthenticatedOriginPulls certificate.

type PerHostnameAuthenticatedOriginPullsCertificateParams added in v0.12.2

type PerHostnameAuthenticatedOriginPullsCertificateParams struct {
	Certificate string `json:"certificate"`
	PrivateKey  string `json:"private_key"`
}

PerHostnameAuthenticatedOriginPullsCertificateParams represents the required data related to the client certificate being uploaded to be used in Per Hostname AuthenticatedOriginPulls.

type PerHostnameAuthenticatedOriginPullsCertificateResponse added in v0.12.2

type PerHostnameAuthenticatedOriginPullsCertificateResponse struct {
	Response
	Result PerHostnameAuthenticatedOriginPullsCertificateDetails `json:"result"`
}

PerHostnameAuthenticatedOriginPullsCertificateResponse represents the response from endpoints relating to creating and deleting a Per Hostname AuthenticatedOriginPulls certificate.

type PerHostnameAuthenticatedOriginPullsConfig added in v0.12.2

type PerHostnameAuthenticatedOriginPullsConfig struct {
	Hostname string `json:"hostname"`
	CertID   string `json:"cert_id"`
	Enabled  bool   `json:"enabled"`
}

PerHostnameAuthenticatedOriginPullsConfig represents the config state for Per Hostname AuthenticatedOriginPulls applied on a hostname.

type PerHostnameAuthenticatedOriginPullsConfigParams added in v0.13.0

type PerHostnameAuthenticatedOriginPullsConfigParams struct {
	Config []PerHostnameAuthenticatedOriginPullsConfig `json:"config"`
}

PerHostnameAuthenticatedOriginPullsConfigParams represents the expected config param format for Per Hostname AuthenticatedOriginPulls applied on a hostname.

type PerHostnameAuthenticatedOriginPullsDetails added in v0.12.2

type PerHostnameAuthenticatedOriginPullsDetails struct {
	Hostname       string    `json:"hostname"`
	CertID         string    `json:"cert_id"`
	Enabled        bool      `json:"enabled"`
	Status         string    `json:"status"`
	CreatedAt      time.Time `json:"created_at"`
	UpdatedAt      time.Time `json:"updated_at"`
	CertStatus     string    `json:"cert_status"`
	Issuer         string    `json:"issuer"`
	Signature      string    `json:"signature"`
	SerialNumber   string    `json:"serial_number"`
	Certificate    string    `json:"certificate"`
	CertUploadedOn time.Time `json:"cert_uploaded_on"`
	CertUpdatedAt  time.Time `json:"cert_updated_at"`
	ExpiresOn      time.Time `json:"expires_on"`
}

PerHostnameAuthenticatedOriginPullsDetails contains metadata about the Per Hostname AuthenticatedOriginPulls configuration on a hostname.

type PerHostnameAuthenticatedOriginPullsDetailsResponse added in v0.12.2

type PerHostnameAuthenticatedOriginPullsDetailsResponse struct {
	Response
	Result PerHostnameAuthenticatedOriginPullsDetails `json:"result"`
}

PerHostnameAuthenticatedOriginPullsDetailsResponse represents Per Hostname AuthenticatedOriginPulls configuration metadata for a single hostname.

type PerHostnamesAuthenticatedOriginPullsDetailsResponse added in v0.12.2

type PerHostnamesAuthenticatedOriginPullsDetailsResponse struct {
	Response
	Result []PerHostnameAuthenticatedOriginPullsDetails `json:"result"`
}

PerHostnamesAuthenticatedOriginPullsDetailsResponse represents Per Hostname AuthenticatedOriginPulls configuration metadata for multiple hostnames.

type PerZoneAuthenticatedOriginPullsCertificateDetails added in v0.12.2

type PerZoneAuthenticatedOriginPullsCertificateDetails struct {
	ID          string    `json:"id"`
	Certificate string    `json:"certificate"`
	Issuer      string    `json:"issuer"`
	Signature   string    `json:"signature"`
	ExpiresOn   time.Time `json:"expires_on"`
	Status      string    `json:"status"`
	UploadedOn  time.Time `json:"uploaded_on"`
}

PerZoneAuthenticatedOriginPullsCertificateDetails represents the metadata for a Per Zone AuthenticatedOriginPulls client certificate.

type PerZoneAuthenticatedOriginPullsCertificateParams added in v0.12.2

type PerZoneAuthenticatedOriginPullsCertificateParams struct {
	Certificate string `json:"certificate"`
	PrivateKey  string `json:"private_key"`
}

PerZoneAuthenticatedOriginPullsCertificateParams represents the required data related to the client certificate being uploaded to be used in Per Zone AuthenticatedOriginPulls.

type PerZoneAuthenticatedOriginPullsCertificateResponse added in v0.12.2

type PerZoneAuthenticatedOriginPullsCertificateResponse struct {
	Response
	Result PerZoneAuthenticatedOriginPullsCertificateDetails `json:"result"`
}

PerZoneAuthenticatedOriginPullsCertificateResponse represents the response from endpoints relating to creating and deleting a per zone AuthenticatedOriginPulls certificate.

type PerZoneAuthenticatedOriginPullsCertificatesResponse added in v0.12.2

type PerZoneAuthenticatedOriginPullsCertificatesResponse struct {
	Response
	Result []PerZoneAuthenticatedOriginPullsCertificateDetails `json:"result"`
}

PerZoneAuthenticatedOriginPullsCertificatesResponse represents the response from the per zone AuthenticatedOriginPulls certificate list endpoint.

type PerZoneAuthenticatedOriginPullsSettings added in v0.12.2

type PerZoneAuthenticatedOriginPullsSettings struct {
	Enabled bool `json:"enabled"`
}

PerZoneAuthenticatedOriginPullsSettings represents the settings for Per Zone AuthenticatedOriginPulls.

type PerZoneAuthenticatedOriginPullsSettingsResponse added in v0.12.2

type PerZoneAuthenticatedOriginPullsSettingsResponse struct {
	Response
	Result PerZoneAuthenticatedOriginPullsSettings `json:"result"`
}

PerZoneAuthenticatedOriginPullsSettingsResponse represents the response from the Per Zone AuthenticatedOriginPulls settings endpoint.

type Permission added in v0.53.0

type Permission struct {
	ID         string            `json:"id"`
	Key        string            `json:"key"`
	Attributes map[string]string `json:"attributes,omitempty"` // same as Meta in other structs
}

type PermissionGroup added in v0.53.0

type PermissionGroup struct {
	ID          string            `json:"id"`
	Name        string            `json:"name"`
	Meta        map[string]string `json:"meta"`
	Permissions []Permission      `json:"permissions"`
}

type PermissionGroupDetailResponse added in v0.53.0

type PermissionGroupDetailResponse struct {
	Success  bool            `json:"success"`
	Errors   []string        `json:"errors"`
	Messages []string        `json:"messages"`
	Result   PermissionGroup `json:"result"`
}

type PermissionGroupListResponse added in v0.53.0

type PermissionGroupListResponse struct {
	Success  bool              `json:"success"`
	Errors   []string          `json:"errors"`
	Messages []string          `json:"messages"`
	Result   []PermissionGroup `json:"result"`
}

type PhishingScan added in v0.44.0

type PhishingScan struct {
	URL        string  `json:"url"`
	Phishing   bool    `json:"phishing"`
	Verified   bool    `json:"verified"`
	Score      float64 `json:"score"`
	Classifier string  `json:"classifier"`
}

PhishingScan represent information about a phishing scan.

type PhishingScanParameters added in v0.44.0

type PhishingScanParameters struct {
	AccountID string `url:"-"`
	URL       string `url:"url,omitempty"`
	Skip      bool   `url:"skip,omitempty"`
}

PhishingScanParameters represent parameters for a phishing scan request.

type PhishingScanResponse added in v0.44.0

type PhishingScanResponse struct {
	Response
	Result PhishingScan `json:"result,omitempty"`
}

PhishingScanResponse represent an API response for a phishing scan.

type Placement added in v0.68.0

type Placement struct {
	Mode PlacementMode `json:"mode"`
}

type PlacementMode added in v0.68.0

type PlacementMode string
const (
	PlacementModeOff   PlacementMode = ""
	PlacementModeSmart PlacementMode = "smart"
)

type Policy added in v0.53.0

type Policy struct {
	ID               string            `json:"id"`
	PermissionGroups []PermissionGroup `json:"permission_groups"`
	ResourceGroups   []ResourceGroup   `json:"resource_groups"`
	Access           string            `json:"access"`
}

type Polish added in v0.47.0

type Polish int
const (
	PolishOff Polish
	PolishLossless
	PolishLossy
)

func PolishFromString added in v0.47.0

func PolishFromString(s string) (*Polish, error)

func (Polish) IntoRef added in v0.47.0

func (p Polish) IntoRef() *Polish

func (Polish) MarshalJSON added in v0.47.0

func (p Polish) MarshalJSON() ([]byte, error)

func (Polish) String added in v0.47.0

func (p Polish) String() string

func (*Polish) UnmarshalJSON added in v0.47.0

func (p *Polish) UnmarshalJSON(data []byte) error

type ProxyProtocol added in v0.11.0

type ProxyProtocol string

ProxyProtocol implements json.Unmarshaler in order to support deserializing of the deprecated boolean value for `proxy_protocol`.

func (*ProxyProtocol) UnmarshalJSON added in v0.11.0

func (p *ProxyProtocol) UnmarshalJSON(data []byte) error

UnmarshalJSON handles deserializing of both the deprecated boolean value and the current string value for the `proxy_protocol` field.

type PublishZarazConfigParams added in v0.86.0

type PublishZarazConfigParams struct {
	Description string `json:"description"`
}

type PurgeCacheRequest added in v0.7.2

type PurgeCacheRequest struct {
	Everything bool `json:"purge_everything,omitempty"`
	// Purge by filepath (exact match). Limit of 30
	Files []string `json:"files,omitempty"`
	// Purge by Tag (Enterprise only):
	// https://support.cloudflare.com/hc/en-us/articles/206596608-How-to-Purge-Cache-Using-Cache-Tags-Enterprise-only-
	Tags []string `json:"tags,omitempty"`
	// Purge by hostname - e.g. "assets.example.com"
	Hosts []string `json:"hosts,omitempty"`
	// Purge by prefix - e.g. "example.com/css"
	Prefixes []string `json:"prefixes,omitempty"`
}

PurgeCacheRequest represents the request format made to the purge endpoint.

type PurgeCacheResponse added in v0.7.2

type PurgeCacheResponse struct {
	Response
	Result struct {
		ID string `json:"id"`
	} `json:"result"`
}

PurgeCacheResponse represents the response from the purge endpoint.

type QueryD1DatabaseParams added in v0.79.0

type QueryD1DatabaseParams struct {
	DatabaseID string   `json:"-"`
	SQL        string   `json:"sql"`
	Parameters []string `json:"params"`
}

type QueryD1Response added in v0.79.0

type QueryD1Response struct {
	Result []D1Result `json:"result"`
	Response
}

type Queue added in v0.55.0

type Queue struct {
	ID                  string          `json:"queue_id,omitempty"`
	Name                string          `json:"queue_name,omitempty"`
	CreatedOn           *time.Time      `json:"created_on,omitempty"`
	ModifiedOn          *time.Time      `json:"modified_on,omitempty"`
	ProducersTotalCount int             `json:"producers_total_count,omitempty"`
	Producers           []QueueProducer `json:"producers,omitempty"`
	ConsumersTotalCount int             `json:"consumers_total_count,omitempty"`
	Consumers           []QueueConsumer `json:"consumers,omitempty"`
}

type QueueConsumer added in v0.55.0

type QueueConsumer struct {
	Name            string                `json:"-"`
	Service         string                `json:"service,omitempty"`
	ScriptName      string                `json:"script_name,omitempty"`
	Environment     string                `json:"environment,omitempty"`
	Settings        QueueConsumerSettings `json:"settings,omitempty"`
	QueueName       string                `json:"queue_name,omitempty"`
	CreatedOn       *time.Time            `json:"created_on,omitempty"`
	DeadLetterQueue string                `json:"dead_letter_queue,omitempty"`
}

type QueueConsumerResponse added in v0.55.0

type QueueConsumerResponse struct {
	Response
	Result QueueConsumer `json:"result"`
}

type QueueConsumerSettings added in v0.55.0

type QueueConsumerSettings struct {
	BatchSize   int `json:"batch_size,omitempty"`
	MaxRetires  int `json:"max_retries,omitempty"`
	MaxWaitTime int `json:"max_wait_time_ms,omitempty"`
}

type QueueListResponse

type QueueListResponse struct {
	Response
	ResultInfo `json:"result_info"`
	Result     []Queue `json:"result"`
}

type QueueProducer added in v0.55.0

type QueueProducer struct {
	Service     string `json:"service,omitempty"`
	Environment string `json:"environment,omitempty"`
}

type QueueResponse added in v0.55.0

type QueueResponse struct {
	Response
	Result Queue `json:"result"`
}

type R2BindingMap added in v0.49.0

type R2BindingMap map[string]*R2BindingValue

type R2BindingValue added in v0.49.0

type R2BindingValue struct {
	Name string `json:"name"`
}

type R2Bucket added in v0.55.0

type R2Bucket struct {
	Name         string     `json:"name"`
	CreationDate *time.Time `json:"creation_date,omitempty"`
	Location     string     `json:"location,omitempty"`
}

R2Bucket defines a container for objects stored in R2 Storage.

type R2BucketListResponse

type R2BucketListResponse struct {
	Result R2Buckets `json:"result"`
	Response
}

R2BucketListResponse represents the response from the list R2 buckets endpoint.

type R2BucketResponse added in v0.68.0

type R2BucketResponse struct {
	Result R2Bucket `json:"result"`
	Response
}

type R2Buckets added in v0.55.0

type R2Buckets struct {
	Buckets []R2Bucket `json:"buckets"`
}

R2Buckets represents the map of buckets response from the R2 buckets endpoint.

type RandomSteering added in v0.42.0

type RandomSteering struct {
	DefaultWeight float64            `json:"default_weight,omitempty"`
	PoolWeights   map[string]float64 `json:"pool_weights,omitempty"`
}

RandomSteering configures pool weights.

SteeringPolicy="random": A random pool is selected with probability proportional to pool weights.

SteeringPolicy="least_outstanding_requests": Use pool weights to scale each pool's outstanding requests.

SteeringPolicy="least_connections": Use pool weights to scale each pool's open connections.

type RateLimit added in v0.8.5

type RateLimit struct {
	ID          string                  `json:"id,omitempty"`
	Disabled    bool                    `json:"disabled,omitempty"`
	Description string                  `json:"description,omitempty"`
	Match       RateLimitTrafficMatcher `json:"match"`
	Bypass      []RateLimitKeyValue     `json:"bypass,omitempty"`
	Threshold   int                     `json:"threshold"`
	Period      int                     `json:"period"`
	Action      RateLimitAction         `json:"action"`
	Correlate   *RateLimitCorrelate     `json:"correlate,omitempty"`
}

RateLimit is a policy than can be applied to limit traffic within a customer domain.

type RateLimitAction added in v0.8.5

type RateLimitAction struct {
	Mode     string                   `json:"mode"`
	Timeout  int                      `json:"timeout"`
	Response *RateLimitActionResponse `json:"response"`
}

RateLimitAction is the action that will be taken when the rate limit threshold is reached.

type RateLimitActionResponse added in v0.8.5

type RateLimitActionResponse struct {
	ContentType string `json:"content_type"`
	Body        string `json:"body"`
}

RateLimitActionResponse is the response that will be returned when rate limit action is triggered.

type RateLimitCorrelate added in v0.9.0

type RateLimitCorrelate struct {
	By string `json:"by"`
}

RateLimitCorrelate pertainings to NAT support.

type RateLimitKeyValue added in v0.8.5

type RateLimitKeyValue struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

RateLimitKeyValue is k-v formatted as expected in the rate limit description.

type RateLimitRequestMatcher added in v0.8.5

type RateLimitRequestMatcher struct {
	Methods    []string `json:"methods,omitempty"`
	Schemes    []string `json:"schemes,omitempty"`
	URLPattern string   `json:"url,omitempty"`
}

RateLimitRequestMatcher contains the matching rules pertaining to requests.

type RateLimitResponseMatcher added in v0.8.5

type RateLimitResponseMatcher struct {
	Statuses      []int                            `json:"status,omitempty"`
	OriginTraffic *bool                            `json:"origin_traffic,omitempty"` // api defaults to true so we need an explicit empty value
	Headers       []RateLimitResponseMatcherHeader `json:"headers,omitempty"`
}

RateLimitResponseMatcher contains the matching rules pertaining to responses.

type RateLimitResponseMatcherHeader added in v0.9.0

type RateLimitResponseMatcherHeader struct {
	Name  string `json:"name"`
	Op    string `json:"op"`
	Value string `json:"value"`
}

RateLimitResponseMatcherHeader contains the structure of the origin HTTP headers used in request matcher checks.

type RateLimitTrafficMatcher added in v0.8.5

type RateLimitTrafficMatcher struct {
	Request  RateLimitRequestMatcher  `json:"request"`
	Response RateLimitResponseMatcher `json:"response"`
}

RateLimitTrafficMatcher contains the rules that will be used to apply a rate limit to traffic.

type RatelimitError added in v0.36.0

type RatelimitError struct {
	// contains filtered or unexported fields
}

RatelimitError is for HTTP 429s where the service is telling the client to slow down.

func NewRatelimitError added in v0.48.0

func NewRatelimitError(e *Error) RatelimitError

func (RatelimitError) Error added in v0.36.0

func (e RatelimitError) Error() string

func (RatelimitError) ErrorCodes added in v0.36.0

func (e RatelimitError) ErrorCodes() []int

func (RatelimitError) ErrorMessages added in v0.36.0

func (e RatelimitError) ErrorMessages() []string

func (RatelimitError) Errors added in v0.36.0

func (e RatelimitError) Errors() []ResponseInfo

func (RatelimitError) InternalErrorCodeIs added in v0.48.0

func (e RatelimitError) InternalErrorCodeIs(code int) bool

func (RatelimitError) RayID added in v0.36.0

func (e RatelimitError) RayID() string

func (RatelimitError) Type added in v0.36.0

func (e RatelimitError) Type() ErrorType

type RawResponse added in v0.8.0

type RawResponse struct {
	Response
	Result     json.RawMessage `json:"result"`
	ResultInfo *ResultInfo     `json:"result_info,omitempty"`
}

RawResponse keeps the result as JSON form.

type Redirect added in v0.42.0

type Redirect struct {
	SourceUrl           string `json:"source_url"`
	IncludeSubdomains   *bool  `json:"include_subdomains,omitempty"`
	TargetUrl           string `json:"target_url"`
	StatusCode          *int   `json:"status_code,omitempty"`
	PreserveQueryString *bool  `json:"preserve_query_string,omitempty"`
	SubpathMatching     *bool  `json:"subpath_matching,omitempty"`
	PreservePathSuffix  *bool  `json:"preserve_path_suffix,omitempty"`
}

Redirect represents a redirect item in a List.

type Region added in v0.66.0

type Region struct {
	Key   string `json:"key"`
	Label string `json:"label"`
}

type RegionalHostname added in v0.66.0

type RegionalHostname struct {
	Hostname  string     `json:"hostname"`
	RegionKey string     `json:"region_key"`
	CreatedOn *time.Time `json:"created_on,omitempty"`
}

type RegionalTieredCache added in v0.73.0

type RegionalTieredCache struct {
	ID         string    `json:"id,omitempty"`
	ModifiedOn time.Time `json:"modified_on,omitempty"`
	Value      string    `json:"value"`
}

RegionalTieredCache is the structure of the API object for the regional tiered cache setting.

type RegionalTieredCacheDetailsResponse added in v0.73.0

type RegionalTieredCacheDetailsResponse struct {
	Result RegionalTieredCache `json:"result"`
	Response
}

RegionalTieredCacheDetailsResponse is the API response for the regional tiered cache setting.

type RegistrantContact added in v0.9.0

type RegistrantContact struct {
	ID           string `json:"id"`
	FirstName    string `json:"first_name"`
	LastName     string `json:"last_name"`
	Organization string `json:"organization"`
	Address      string `json:"address"`
	Address2     string `json:"address2"`
	City         string `json:"city"`
	State        string `json:"state"`
	Zip          string `json:"zip"`
	Country      string `json:"country"`
	Phone        string `json:"phone"`
	Email        string `json:"email"`
	Fax          string `json:"fax"`
}

RegistrantContact is the contact details for the domain registration.

type RegistrarDomain added in v0.9.0

type RegistrarDomain struct {
	ID                string              `json:"id"`
	Available         bool                `json:"available"`
	SupportedTLD      bool                `json:"supported_tld"`
	CanRegister       bool                `json:"can_register"`
	TransferIn        RegistrarTransferIn `json:"transfer_in"`
	CurrentRegistrar  string              `json:"current_registrar"`
	ExpiresAt         time.Time           `json:"expires_at"`
	RegistryStatuses  string              `json:"registry_statuses"`
	Locked            bool                `json:"locked"`
	CreatedAt         time.Time           `json:"created_at"`
	UpdatedAt         time.Time           `json:"updated_at"`
	RegistrantContact RegistrantContact   `json:"registrant_contact"`
}

RegistrarDomain is the structure of the API response for a new Cloudflare Registrar domain.

type RegistrarDomainConfiguration added in v0.9.0

type RegistrarDomainConfiguration struct {
	NameServers []string `json:"name_servers"`
	Privacy     bool     `json:"privacy"`
	Locked      bool     `json:"locked"`
	AutoRenew   bool     `json:"auto_renew"`
}

RegistrarDomainConfiguration is the structure for making updates to and existing domain.

type RegistrarDomainDetailResponse added in v0.9.0

type RegistrarDomainDetailResponse struct {
	Response
	Result RegistrarDomain `json:"result"`
}

RegistrarDomainDetailResponse is the structure of the detailed response from the API for a single domain.

type RegistrarDomainsDetailResponse added in v0.9.0

type RegistrarDomainsDetailResponse struct {
	Response
	Result []RegistrarDomain `json:"result"`
}

RegistrarDomainsDetailResponse is the structure of the detailed response from the API.

type RegistrarTransferIn added in v0.9.0

type RegistrarTransferIn struct {
	UnlockDomain      string `json:"unlock_domain"`
	DisablePrivacy    string `json:"disable_privacy"`
	EnterAuthCode     string `json:"enter_auth_code"`
	ApproveTransfer   string `json:"approve_transfer"`
	AcceptFoa         string `json:"accept_foa"`
	CanCancelTransfer bool   `json:"can_cancel_transfer"`
}

RegistrarTransferIn contains the structure for a domain transfer in request.

type RemoteIdentities added in v0.41.0

type RemoteIdentities struct {
	HexID  string `json:"hex_id"`
	FQDNID string `json:"fqdn_id"`
	UserID string `json:"user_id"`
}

type ReplaceWaitingRoomRuleParams added in v0.53.0

type ReplaceWaitingRoomRuleParams struct {
	WaitingRoomID string
	Rules         []WaitingRoomRule
}

type ReqOption added in v0.9.0

type ReqOption func(opt *reqOption)

ReqOption is a functional option for configuring API requests.

func WithPagination added in v0.9.0

func WithPagination(opts PaginationOptions) ReqOption

WithPagination configures the pagination for a response.

func WithZoneFilters added in v0.12.0

func WithZoneFilters(zoneName, accountID, status string) ReqOption

WithZoneFilters applies a filter based on zone properties.

type RequestError added in v0.36.0

type RequestError struct {
	// contains filtered or unexported fields
}

RequestError is for 4xx errors that we encounter not covered elsewhere (generally bad payloads).

func NewRequestError added in v0.48.0

func NewRequestError(e *Error) RequestError

func (RequestError) Error added in v0.36.0

func (e RequestError) Error() string

func (RequestError) ErrorCodes added in v0.36.0

func (e RequestError) ErrorCodes() []int

func (RequestError) ErrorMessages added in v0.36.0

func (e RequestError) ErrorMessages() []string

func (RequestError) Errors added in v0.36.0

func (e RequestError) Errors() []ResponseInfo

func (RequestError) InternalErrorCodeIs added in v0.48.0

func (e RequestError) InternalErrorCodeIs(code int) bool

func (RequestError) Messages added in v0.53.0

func (e RequestError) Messages() []ResponseInfo

func (RequestError) RayID added in v0.36.0

func (e RequestError) RayID() string

func (RequestError) Type added in v0.36.0

func (e RequestError) Type() ErrorType

type ResolvesToRefs added in v0.44.0

type ResolvesToRefs struct {
	ID    string `json:"id"`
	Value string `json:"value"`
}

ResolvesToRefs what a domain resolves to.

type ResourceContainer added in v0.45.0

type ResourceContainer struct {
	Level      RouteLevel
	Identifier string
	Type       ResourceType
}

ResourceContainer defines an API resource you wish to target. Should not be used directly, use `UserIdentifier`, `ZoneIdentifier` and `AccountIdentifier` instead.

func AccountIdentifier added in v0.45.0

func AccountIdentifier(id string) *ResourceContainer

AccountIdentifier returns an account level *ResourceContainer.

func ResourceIdentifier added in v0.45.0

func ResourceIdentifier(id string) *ResourceContainer

ResourceIdentifier returns a generic *ResourceContainer.

func UserIdentifier added in v0.45.0

func UserIdentifier(id string) *ResourceContainer

UserIdentifier returns a user level *ResourceContainer.

func ZoneIdentifier added in v0.36.0

func ZoneIdentifier(id string) *ResourceContainer

ZoneIdentifier returns a zone level *ResourceContainer.

func (*ResourceContainer) URLFragment added in v0.63.0

func (rc *ResourceContainer) URLFragment() string

Returns a URL fragment of the endpoint scoped by the container.

For example, a zone identifier would have a fragment like "zones/foobar" while an account identifier would generate "accounts/foobar".

type ResourceGroup added in v0.53.0

type ResourceGroup struct {
	ID    string            `json:"id"`
	Name  string            `json:"name"`
	Meta  map[string]string `json:"meta"`
	Scope Scope             `json:"scope"`
}

func NewResourceGroup added in v0.53.0

func NewResourceGroup(key string) ResourceGroup

NewResourceGroup takes a Cloudflare-formatted key (e.g. 'com.cloudflare.api.%s') and returns a resource group to be used within a Policy to allow access to that resource.

func NewResourceGroupForAccount added in v0.53.0

func NewResourceGroupForAccount(account Account) ResourceGroup

NewResourceGroupForAccount takes an existing zone and provides a resource group to be used within a Policy that allows access to that account.

func NewResourceGroupForZone added in v0.53.0

func NewResourceGroupForZone(zone Zone) ResourceGroup

NewResourceGroupForZone takes an existing zone and provides a resource group to be used within a Policy that allows access to that zone.

type ResourceType added in v0.72.0

type ResourceType string

ResourceType holds the type of the resource. This is similar to `RouteLevel` however this is the singular version of `RouteLevel` and isn't suitable for use in routing.

func (ResourceType) String added in v0.72.0

func (r ResourceType) String() string

type Response added in v0.7.2

type Response struct {
	Success  bool           `json:"success"`
	Errors   []ResponseInfo `json:"errors"`
	Messages []ResponseInfo `json:"messages"`
}

Response is a template. There will also be a result struct. There will be a unique response type for each response, which will include this type.

type ResponseInfo added in v0.7.2

type ResponseInfo struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

ResponseInfo contains a code and message returned by the API as errors or informational messages inside the response.

type ResultInfo added in v0.7.2

type ResultInfo struct {
	Page       int               `json:"page" url:"page,omitempty"`
	PerPage    int               `json:"per_page" url:"per_page,omitempty"`
	TotalPages int               `json:"total_pages" url:"-"`
	Count      int               `json:"count" url:"-"`
	Total      int               `json:"total_count" url:"-"`
	Cursor     string            `json:"cursor" url:"cursor,omitempty"`
	Cursors    ResultInfoCursors `json:"cursors" url:"cursors,omitempty"`
}

ResultInfo contains metadata about the Response.

func (ResultInfo) Done added in v0.45.0

func (p ResultInfo) Done() bool

Done returns true for the last page and false otherwise.

func (ResultInfo) HasMorePages added in v0.45.0

func (p ResultInfo) HasMorePages() bool

HasMorePages returns whether there is another page of results after the current one.

func (ResultInfo) Next added in v0.45.0

func (p ResultInfo) Next() ResultInfo

Next advances the page of a paginated API response, but does not fetch the next page of results.

type ResultInfoCursors added in v0.13.0

type ResultInfoCursors struct {
	Before string `json:"before" url:"before,omitempty"`
	After  string `json:"after" url:"after,omitempty"`
}

ResultInfoCursors contains information about cursors.

type RetryPagesDeploymentParams added in v0.40.0

type RetryPagesDeploymentParams struct {
	ProjectName  string
	DeploymentID string
}

type RetryPolicy added in v0.8.5

type RetryPolicy struct {
	MaxRetries    int
	MinRetryDelay time.Duration
	MaxRetryDelay time.Duration
}

RetryPolicy specifies number of retries and min/max retry delays This config is used when the client exponentially backs off after errored requests.

type ReverseRecords added in v0.44.0

type ReverseRecords struct {
	FirstSeen string `json:"first_seen,omitempty"`
	LastSeen  string `json:"last_seen,omitempty"`
	Hostname  string `json:"hostname,omitempty"`
}

ReverseRecords represent records for passive DNS.

type RevokeAccessUserTokensParams added in v0.71.0

type RevokeAccessUserTokensParams struct {
	Email string `json:"email"`
}

type RiskTypes added in v0.44.0

type RiskTypes struct {
	ID              int    `json:"id"`
	SuperCategoryID int    `json:"super_category_id"`
	Name            string `json:"name"`
}

RiskTypes represent risk types for an IP.

type RollbackPagesDeploymentParams added in v0.40.0

type RollbackPagesDeploymentParams struct {
	ProjectName  string
	DeploymentID string
}

type RotateTurnstileWidgetParams added in v0.66.0

type RotateTurnstileWidgetParams struct {
	SiteKey               string `json:"-"`
	InvalidateImmediately bool   `json:"invalidate_immediately,omitempty"`
}

type RouteLevel added in v0.45.0

type RouteLevel string

RouteLevel holds the "level" where the resource resides. Commonly used in routing configurations or builders.

func (RouteLevel) String added in v0.72.0

func (r RouteLevel) String() string

type RouteRoot added in v0.13.4

type RouteRoot string

RouteRoot represents the name of the route namespace.

const (

	// AccountRouteRoot is the accounts route namespace.
	AccountRouteRoot RouteRoot = "accounts"

	// ZoneRouteRoot is the zones route namespace.
	ZoneRouteRoot RouteRoot = "zones"
)

type Ruleset added in v0.19.0

type Ruleset struct {
	ID                       string        `json:"id,omitempty"`
	Name                     string        `json:"name,omitempty"`
	Description              string        `json:"description,omitempty"`
	Kind                     string        `json:"kind,omitempty"`
	Version                  *string       `json:"version,omitempty"`
	LastUpdated              *time.Time    `json:"last_updated,omitempty"`
	Phase                    string        `json:"phase,omitempty"`
	Rules                    []RulesetRule `json:"rules"`
	ShareableEntitlementName string        `json:"shareable_entitlement_name,omitempty"`
}

Ruleset contains the structure of a Ruleset. Using `string` for Kind and Phase is a developer nicety to support downstream clients like Terraform who don't really have a strong and expansive type system. As always, the recommendation is to use the types provided where possible to avoid surprises.

type RulesetActionParameterProduct added in v0.19.0

type RulesetActionParameterProduct string

RulesetActionParameterProduct is the custom type for defining what products can be used within the action parameters of a ruleset.

type RulesetActionParametersLogCustomField added in v0.40.0

type RulesetActionParametersLogCustomField struct {
	Name string `json:"name,omitempty"`
}

RulesetActionParametersLogCustomField wraps an object that is part of request_fields, response_fields or cookie_fields.

type RulesetKind added in v0.19.0

type RulesetKind string

RulesetKind is the custom type for allowed variances of rulesets.

type RulesetPhase added in v0.19.0

type RulesetPhase string

RulesetPhase is the custom type for defining at what point the ruleset will be applied in the request pipeline.

type RulesetRule added in v0.19.0

type RulesetRule struct {
	ID                     string                             `json:"id,omitempty"`
	Version                *string                            `json:"version,omitempty"`
	Action                 string                             `json:"action"`
	ActionParameters       *RulesetRuleActionParameters       `json:"action_parameters,omitempty"`
	Expression             string                             `json:"expression"`
	Description            string                             `json:"description,omitempty"`
	LastUpdated            *time.Time                         `json:"last_updated,omitempty"`
	Ref                    string                             `json:"ref,omitempty"`
	Enabled                *bool                              `json:"enabled,omitempty"`
	ScoreThreshold         int                                `json:"score_threshold,omitempty"`
	RateLimit              *RulesetRuleRateLimit              `json:"ratelimit,omitempty"`
	ExposedCredentialCheck *RulesetRuleExposedCredentialCheck `json:"exposed_credential_check,omitempty"`
	Logging                *RulesetRuleLogging                `json:"logging,omitempty"`
}

RulesetRule contains information about a single Ruleset Rule.

type RulesetRuleAction added in v0.19.0

type RulesetRuleAction string

RulesetRuleAction defines a custom type that is used to express allowed values for the rule action.

type RulesetRuleActionParameters added in v0.19.0

type RulesetRuleActionParameters struct {
	ID                       string                                            `json:"id,omitempty"`
	Ruleset                  string                                            `json:"ruleset,omitempty"`
	Rulesets                 []string                                          `json:"rulesets,omitempty"`
	Rules                    map[string][]string                               `json:"rules,omitempty"`
	Increment                int                                               `json:"increment,omitempty"`
	URI                      *RulesetRuleActionParametersURI                   `json:"uri,omitempty"`
	Headers                  map[string]RulesetRuleActionParametersHTTPHeader  `json:"headers,omitempty"`
	Products                 []string                                          `json:"products,omitempty"`
	Phases                   []string                                          `json:"phases,omitempty"`
	Overrides                *RulesetRuleActionParametersOverrides             `json:"overrides,omitempty"`
	MatchedData              *RulesetRuleActionParametersMatchedData           `json:"matched_data,omitempty"`
	Version                  *string                                           `json:"version,omitempty"`
	Response                 *RulesetRuleActionParametersBlockResponse         `json:"response,omitempty"`
	HostHeader               string                                            `json:"host_header,omitempty"`
	Origin                   *RulesetRuleActionParametersOrigin                `json:"origin,omitempty"`
	SNI                      *RulesetRuleActionParametersSni                   `json:"sni,omitempty"`
	RequestFields            []RulesetActionParametersLogCustomField           `json:"request_fields,omitempty"`
	ResponseFields           []RulesetActionParametersLogCustomField           `json:"response_fields,omitempty"`
	CookieFields             []RulesetActionParametersLogCustomField           `json:"cookie_fields,omitempty"`
	Cache                    *bool                                             `json:"cache,omitempty"`
	AdditionalCacheablePorts []int                                             `json:"additional_cacheable_ports,omitempty"`
	EdgeTTL                  *RulesetRuleActionParametersEdgeTTL               `json:"edge_ttl,omitempty"`
	BrowserTTL               *RulesetRuleActionParametersBrowserTTL            `json:"browser_ttl,omitempty"`
	ServeStale               *RulesetRuleActionParametersServeStale            `json:"serve_stale,omitempty"`
	Content                  string                                            `json:"content,omitempty"`
	ContentType              string                                            `json:"content_type,omitempty"`
	StatusCode               uint16                                            `json:"status_code,omitempty"`
	RespectStrongETags       *bool                                             `json:"respect_strong_etags,omitempty"`
	CacheKey                 *RulesetRuleActionParametersCacheKey              `json:"cache_key,omitempty"`
	OriginCacheControl       *bool                                             `json:"origin_cache_control,omitempty"`
	OriginErrorPagePassthru  *bool                                             `json:"origin_error_page_passthru,omitempty"`
	CacheReserve             *RulesetRuleActionParametersCacheReserve          `json:"cache_reserve,omitempty"`
	FromList                 *RulesetRuleActionParametersFromList              `json:"from_list,omitempty"`
	FromValue                *RulesetRuleActionParametersFromValue             `json:"from_value,omitempty"`
	AutomaticHTTPSRewrites   *bool                                             `json:"automatic_https_rewrites,omitempty"`
	AutoMinify               *RulesetRuleActionParametersAutoMinify            `json:"autominify,omitempty"`
	BrowserIntegrityCheck    *bool                                             `json:"bic,omitempty"`
	DisableApps              *bool                                             `json:"disable_apps,omitempty"`
	DisableZaraz             *bool                                             `json:"disable_zaraz,omitempty"`
	DisableRailgun           *bool                                             `json:"disable_railgun,omitempty"`
	EmailObfuscation         *bool                                             `json:"email_obfuscation,omitempty"`
	Mirage                   *bool                                             `json:"mirage,omitempty"`
	OpportunisticEncryption  *bool                                             `json:"opportunistic_encryption,omitempty"`
	Polish                   *Polish                                           `json:"polish,omitempty"`
	ReadTimeout              *uint                                             `json:"read_timeout,omitempty"`
	RocketLoader             *bool                                             `json:"rocket_loader,omitempty"`
	SecurityLevel            *SecurityLevel                                    `json:"security_level,omitempty"`
	ServerSideExcludes       *bool                                             `json:"server_side_excludes,omitempty"`
	SSL                      *SSL                                              `json:"ssl,omitempty"`
	SXG                      *bool                                             `json:"sxg,omitempty"`
	HotLinkProtection        *bool                                             `json:"hotlink_protection,omitempty"`
	Algorithms               []RulesetRuleActionParametersCompressionAlgorithm `json:"algorithms,omitempty"`
}

RulesetRuleActionParameters specifies the action parameters for a Ruleset rule.

type RulesetRuleActionParametersAutoMinify added in v0.47.0

type RulesetRuleActionParametersAutoMinify struct {
	HTML bool `json:"html"`
	CSS  bool `json:"css"`
	JS   bool `json:"js"`
}

type RulesetRuleActionParametersBlockResponse added in v0.35.1

type RulesetRuleActionParametersBlockResponse struct {
	StatusCode  uint16 `json:"status_code"`
	ContentType string `json:"content_type"`
	Content     string `json:"content"`
}

RulesetRuleActionParametersBlockResponse holds the BlockResponse struct for an action parameter.

type RulesetRuleActionParametersBrowserTTL added in v0.42.0

type RulesetRuleActionParametersBrowserTTL struct {
	Mode    string `json:"mode"`
	Default *uint  `json:"default,omitempty"`
}

type RulesetRuleActionParametersCacheKey added in v0.42.0

type RulesetRuleActionParametersCacheKey struct {
	CacheByDeviceType       *bool                                 `json:"cache_by_device_type,omitempty"`
	IgnoreQueryStringsOrder *bool                                 `json:"ignore_query_strings_order,omitempty"`
	CacheDeceptionArmor     *bool                                 `json:"cache_deception_armor,omitempty"`
	CustomKey               *RulesetRuleActionParametersCustomKey `json:"custom_key,omitempty"`
}

type RulesetRuleActionParametersCacheReserve added in v0.77.0

type RulesetRuleActionParametersCacheReserve struct {
	Eligible        *bool `json:"eligible,omitempty"`
	MinimumFileSize *uint `json:"minimum_file_size,omitempty"`
}

type RulesetRuleActionParametersCategories added in v0.20.0

type RulesetRuleActionParametersCategories struct {
	Category string `json:"category"`
	Action   string `json:"action,omitempty"`
	Enabled  *bool  `json:"enabled,omitempty"`
}

type RulesetRuleActionParametersCompressionAlgorithm added in v0.65.0

type RulesetRuleActionParametersCompressionAlgorithm struct {
	Name string `json:"name"`
}

RulesetRuleActionParametersCompressionAlgorithm defines a compression algorithm for the compress_response action.

type RulesetRuleActionParametersCustomKey added in v0.42.0

type RulesetRuleActionParametersCustomKey struct {
	Query  *RulesetRuleActionParametersCustomKeyQuery  `json:"query_string,omitempty"`
	Header *RulesetRuleActionParametersCustomKeyHeader `json:"header,omitempty"`
	Cookie *RulesetRuleActionParametersCustomKeyCookie `json:"cookie,omitempty"`
	User   *RulesetRuleActionParametersCustomKeyUser   `json:"user,omitempty"`
	Host   *RulesetRuleActionParametersCustomKeyHost   `json:"host,omitempty"`
}

type RulesetRuleActionParametersCustomKeyCookie added in v0.42.0

type RulesetRuleActionParametersCustomKeyCookie RulesetRuleActionParametersCustomKeyFields

type RulesetRuleActionParametersCustomKeyFields added in v0.42.0

type RulesetRuleActionParametersCustomKeyFields struct {
	Include       []string `json:"include,omitempty"`
	CheckPresence []string `json:"check_presence,omitempty"`
}

type RulesetRuleActionParametersCustomKeyHeader added in v0.42.0

type RulesetRuleActionParametersCustomKeyHeader struct {
	RulesetRuleActionParametersCustomKeyFields
	ExcludeOrigin *bool `json:"exclude_origin,omitempty"`
}

type RulesetRuleActionParametersCustomKeyHost added in v0.42.0

type RulesetRuleActionParametersCustomKeyHost struct {
	Resolved *bool `json:"resolved,omitempty"`
}

type RulesetRuleActionParametersCustomKeyList added in v0.42.0

type RulesetRuleActionParametersCustomKeyList struct {
	List []string
	All  bool
}

func (RulesetRuleActionParametersCustomKeyList) MarshalJSON added in v0.42.0

func (*RulesetRuleActionParametersCustomKeyList) UnmarshalJSON added in v0.42.0

func (s *RulesetRuleActionParametersCustomKeyList) UnmarshalJSON(data []byte) error

type RulesetRuleActionParametersCustomKeyQuery added in v0.42.0

type RulesetRuleActionParametersCustomKeyQuery struct {
	Include *RulesetRuleActionParametersCustomKeyList `json:"include,omitempty"`
	Exclude *RulesetRuleActionParametersCustomKeyList `json:"exclude,omitempty"`
	Ignore  *bool                                     `json:"ignore,omitempty"`
}

type RulesetRuleActionParametersCustomKeyUser added in v0.42.0

type RulesetRuleActionParametersCustomKeyUser struct {
	DeviceType *bool `json:"device_type,omitempty"`
	Geo        *bool `json:"geo,omitempty"`
	Lang       *bool `json:"lang,omitempty"`
}

type RulesetRuleActionParametersEdgeTTL added in v0.42.0

type RulesetRuleActionParametersEdgeTTL struct {
	Mode          string                                     `json:"mode,omitempty"`
	Default       *uint                                      `json:"default,omitempty"`
	StatusCodeTTL []RulesetRuleActionParametersStatusCodeTTL `json:"status_code_ttl,omitempty"`
}

type RulesetRuleActionParametersFromList added in v0.42.0

type RulesetRuleActionParametersFromList struct {
	Name string `json:"name"`
	Key  string `json:"key"`
}

RulesetRuleActionParametersFromList holds the FromList struct for actions which pull data from a list.

type RulesetRuleActionParametersFromValue added in v0.45.0

type RulesetRuleActionParametersFromValue struct {
	StatusCode          uint16                               `json:"status_code,omitempty"`
	TargetURL           RulesetRuleActionParametersTargetURL `json:"target_url"`
	PreserveQueryString *bool                                `json:"preserve_query_string,omitempty"`
}

type RulesetRuleActionParametersHTTPHeader added in v0.19.0

type RulesetRuleActionParametersHTTPHeader struct {
	Operation  string `json:"operation,omitempty"`
	Value      string `json:"value,omitempty"`
	Expression string `json:"expression,omitempty"`
}

RulesetRuleActionParametersHTTPHeader is the definition for define action parameters that involve HTTP headers.

type RulesetRuleActionParametersHTTPHeaderOperation added in v0.19.0

type RulesetRuleActionParametersHTTPHeaderOperation string

RulesetRuleActionParametersHTTPHeaderOperation defines available options for HTTP header operations in actions.

type RulesetRuleActionParametersMatchedData added in v0.22.0

type RulesetRuleActionParametersMatchedData struct {
	PublicKey string `json:"public_key,omitempty"`
}

RulesetRuleActionParametersMatchedData holds the structure for WAF based payload logging.

type RulesetRuleActionParametersOrigin added in v0.39.0

type RulesetRuleActionParametersOrigin struct {
	Host string `json:"host,omitempty"`
	Port uint16 `json:"port,omitempty"`
}

RulesetRuleActionParametersOrigin is the definition for route action parameters that involve origin overrides.

type RulesetRuleActionParametersOverrides added in v0.20.0

type RulesetRuleActionParametersOverrides struct {
	Enabled          *bool                                   `json:"enabled,omitempty"`
	Action           string                                  `json:"action,omitempty"`
	SensitivityLevel string                                  `json:"sensitivity_level,omitempty"`
	Categories       []RulesetRuleActionParametersCategories `json:"categories,omitempty"`
	Rules            []RulesetRuleActionParametersRules      `json:"rules,omitempty"`
}

type RulesetRuleActionParametersRules added in v0.20.0

type RulesetRuleActionParametersRules struct {
	ID               string `json:"id"`
	Action           string `json:"action,omitempty"`
	Enabled          *bool  `json:"enabled,omitempty"`
	ScoreThreshold   int    `json:"score_threshold,omitempty"`
	SensitivityLevel string `json:"sensitivity_level,omitempty"`
}

type RulesetRuleActionParametersServeStale added in v0.42.0

type RulesetRuleActionParametersServeStale struct {
	DisableStaleWhileUpdating *bool `json:"disable_stale_while_updating,omitempty"`
}

type RulesetRuleActionParametersSni added in v0.46.0

type RulesetRuleActionParametersSni struct {
	Value string `json:"value"`
}

RulesetRuleActionParametersSni is the definition for the route action parameters that involve SNI overrides.

type RulesetRuleActionParametersStatusCodeRange added in v0.42.0

type RulesetRuleActionParametersStatusCodeRange struct {
	From *uint `json:"from,omitempty"`
	To   *uint `json:"to,omitempty"`
}

type RulesetRuleActionParametersStatusCodeTTL added in v0.42.0

type RulesetRuleActionParametersStatusCodeTTL struct {
	StatusCodeRange *RulesetRuleActionParametersStatusCodeRange `json:"status_code_range,omitempty"`
	StatusCodeValue *uint                                       `json:"status_code,omitempty"`
	Value           *int                                        `json:"value,omitempty"`
}

type RulesetRuleActionParametersTargetURL added in v0.45.0

type RulesetRuleActionParametersTargetURL struct {
	Value      string `json:"value,omitempty"`
	Expression string `json:"expression,omitempty"`
}

type RulesetRuleActionParametersURI added in v0.19.0

type RulesetRuleActionParametersURI struct {
	Path   *RulesetRuleActionParametersURIPath  `json:"path,omitempty"`
	Query  *RulesetRuleActionParametersURIQuery `json:"query,omitempty"`
	Origin *bool                                `json:"origin,omitempty"`
}

RulesetRuleActionParametersURI holds the URI struct for an action parameter.

type RulesetRuleActionParametersURIPath added in v0.19.0

type RulesetRuleActionParametersURIPath struct {
	Value      string `json:"value,omitempty"`
	Expression string `json:"expression,omitempty"`
}

RulesetRuleActionParametersURIPath holds the path specific portion of a URI action parameter.

type RulesetRuleActionParametersURIQuery added in v0.19.0

type RulesetRuleActionParametersURIQuery struct {
	Value      *string `json:"value,omitempty"`
	Expression string  `json:"expression,omitempty"`
}

RulesetRuleActionParametersURIQuery holds the query specific portion of a URI action parameter.

type RulesetRuleExposedCredentialCheck added in v0.27.0

type RulesetRuleExposedCredentialCheck struct {
	UsernameExpression string `json:"username_expression,omitempty"`
	PasswordExpression string `json:"password_expression,omitempty"`
}

RulesetRuleExposedCredentialCheck contains the structure of an exposed credential check Ruleset Rule.

type RulesetRuleLogging added in v0.37.0

type RulesetRuleLogging struct {
	Enabled *bool `json:"enabled,omitempty"`
}

RulesetRuleLogging contains the logging configuration for the rule.

type RulesetRuleRateLimit added in v0.22.0

type RulesetRuleRateLimit struct {
	Characteristics         []string `json:"characteristics,omitempty"`
	RequestsPerPeriod       int      `json:"requests_per_period,omitempty"`
	ScorePerPeriod          int      `json:"score_per_period,omitempty"`
	ScoreResponseHeaderName string   `json:"score_response_header_name,omitempty"`
	Period                  int      `json:"period,omitempty"`
	MitigationTimeout       int      `json:"mitigation_timeout,omitempty"`
	CountingExpression      string   `json:"counting_expression,omitempty"`
	RequestsToOrigin        bool     `json:"requests_to_origin,omitempty"`
}

RulesetRuleRateLimit contains the structure of a HTTP rate limit Ruleset Rule.

type SAMLAttributeConfig added in v0.41.0

type SAMLAttributeConfig struct {
	Name         string       `json:"name,omitempty"`
	NameFormat   string       `json:"name_format,omitempty"`
	FriendlyName string       `json:"friendly_name,omitempty"`
	Required     bool         `json:"required,omitempty"`
	Source       SourceConfig `json:"source"`
}

type SSL added in v0.47.0

type SSL int
const (
	SSLOff SSL
	SSLFlexible
	SSLFull
	SSLStrict
	SSLOriginPull
)

func SSLFromString added in v0.47.0

func SSLFromString(s string) (*SSL, error)

func (SSL) IntoRef added in v0.47.0

func (p SSL) IntoRef() *SSL

func (SSL) MarshalJSON added in v0.47.0

func (p SSL) MarshalJSON() ([]byte, error)

func (SSL) String added in v0.47.0

func (p SSL) String() string

func (*SSL) UnmarshalJSON added in v0.47.0

func (p *SSL) UnmarshalJSON(data []byte) error

type SSLValidationError added in v0.32.0

type SSLValidationError struct {
	Message string `json:"message,omitempty"`
}

SSLValidationError represents errors that occurred during SSL validation.

type SSLValidationRecord added in v0.32.0

type SSLValidationRecord struct {
	CnameTarget string `json:"cname_target,omitempty"`
	CnameName   string `json:"cname,omitempty"`

	TxtName  string `json:"txt_name,omitempty"`
	TxtValue string `json:"txt_value,omitempty"`

	HTTPUrl  string `json:"http_url,omitempty"`
	HTTPBody string `json:"http_body,omitempty"`

	Emails []string `json:"emails,omitempty"`
}

SSLValidationRecord displays Domain Control Validation tokens.

type SaasApplication added in v0.41.0

type SaasApplication struct {
	// Items common to both SAML and OIDC
	AppID     string     `json:"app_id,omitempty"`
	UpdatedAt *time.Time `json:"updated_at,omitempty"`
	CreatedAt *time.Time `json:"created_at,omitempty"`
	PublicKey string     `json:"public_key,omitempty"`
	AuthType  string     `json:"auth_type,omitempty"`

	// SAML saas app
	ConsumerServiceUrl            string                `json:"consumer_service_url,omitempty"`
	SPEntityID                    string                `json:"sp_entity_id,omitempty"`
	IDPEntityID                   string                `json:"idp_entity_id,omitempty"`
	NameIDFormat                  string                `json:"name_id_format,omitempty"`
	SSOEndpoint                   string                `json:"sso_endpoint,omitempty"`
	DefaultRelayState             string                `json:"default_relay_state,omitempty"`
	CustomAttributes              []SAMLAttributeConfig `json:"custom_attributes,omitempty"`
	NameIDTransformJsonata        string                `json:"name_id_transform_jsonata,omitempty"`
	SamlAttributeTransformJsonata string                `json:"saml_attribute_transform_jsonata"`

	// OIDC saas app
	ClientID         string   `json:"client_id,omitempty"`
	ClientSecret     string   `json:"client_secret,omitempty"`
	RedirectURIs     []string `json:"redirect_uris,omitempty"`
	GrantTypes       []string `json:"grant_types,omitempty"`
	Scopes           []string `json:"scopes,omitempty"`
	AppLauncherURL   string   `json:"app_launcher_url,omitempty"`
	GroupFilterRegex string   `json:"group_filter_regex,omitempty"`
}

type SaveResponse added in v0.19.0

type SaveResponse struct {
	Response
	Result NotificationResource
}

SaveResponse is returned when a resource is inserted/updated/deleted.

type Scope added in v0.53.0

type Scope struct {
	Key          string        `json:"key"`
	ScopeObjects []ScopeObject `json:"objects"`
}

type ScopeObject added in v0.53.0

type ScopeObject struct {
	Key string `json:"key"`
}

type SecondaryDNSPrimary added in v0.15.0

type SecondaryDNSPrimary struct {
	ID         string `json:"id,omitempty"`
	IP         string `json:"ip"`
	Port       int    `json:"port"`
	IxfrEnable bool   `json:"ixfr_enable"`
	TsigID     string `json:"tsig_id"`
	Name       string `json:"name"`
}

SecondaryDNSPrimary is the representation of the DNS Primary.

type SecondaryDNSPrimaryDetailResponse added in v0.15.0

type SecondaryDNSPrimaryDetailResponse struct {
	Response
	Result SecondaryDNSPrimary `json:"result"`
}

SecondaryDNSPrimaryDetailResponse is the API representation of a single secondary DNS primary response.

type SecondaryDNSPrimaryListResponse added in v0.15.0

type SecondaryDNSPrimaryListResponse struct {
	Response
	Result []SecondaryDNSPrimary `json:"result"`
}

SecondaryDNSPrimaryListResponse is the API representation of all secondary DNS primaries.

type SecondaryDNSTSIG added in v0.15.0

type SecondaryDNSTSIG struct {
	ID     string `json:"id,omitempty"`
	Name   string `json:"name"`
	Secret string `json:"secret"`
	Algo   string `json:"algo"`
}

SecondaryDNSTSIG contains the structure for a secondary DNS TSIG.

type SecondaryDNSTSIGDetailResponse added in v0.15.0

type SecondaryDNSTSIGDetailResponse struct {
	Response
	Result SecondaryDNSTSIG `json:"result"`
}

SecondaryDNSTSIGDetailResponse is the API response for a single secondary DNS TSIG.

type SecondaryDNSTSIGListResponse added in v0.15.0

type SecondaryDNSTSIGListResponse struct {
	Response
	Result []SecondaryDNSTSIG `json:"result"`
}

SecondaryDNSTSIGListResponse is the API response for all secondary DNS TSIGs.

type SecondaryDNSZone added in v0.15.0

type SecondaryDNSZone struct {
	ID                 string    `json:"id,omitempty"`
	Name               string    `json:"name,omitempty"`
	Primaries          []string  `json:"primaries,omitempty"`
	AutoRefreshSeconds int       `json:"auto_refresh_seconds,omitempty"`
	SoaSerial          int       `json:"soa_serial,omitempty"`
	CreatedTime        time.Time `json:"created_time,omitempty"`
	CheckedTime        time.Time `json:"checked_time,omitempty"`
	ModifiedTime       time.Time `json:"modified_time,omitempty"`
}

SecondaryDNSZone contains the high level structure of a secondary DNS zone.

type SecondaryDNSZoneAXFRResponse added in v0.15.0

type SecondaryDNSZoneAXFRResponse struct {
	Response
	Result string `json:"result"`
}

SecondaryDNSZoneAXFRResponse is the API response for a single secondary DNS AXFR response.

type SecondaryDNSZoneDetailResponse added in v0.15.0

type SecondaryDNSZoneDetailResponse struct {
	Response
	Result SecondaryDNSZone `json:"result"`
}

SecondaryDNSZoneDetailResponse is the API response for a single secondary DNS zone.

type SecurityLevel added in v0.47.0

type SecurityLevel int
const (
	SecurityLevelOff SecurityLevel
	SecurityLevelEssentiallyOff
	SecurityLevelLow
	SecurityLevelMedium
	SecurityLevelHigh
	SecurityLevelHelp
)

func SecurityLevelFromString added in v0.47.0

func SecurityLevelFromString(s string) (*SecurityLevel, error)

func (SecurityLevel) IntoRef added in v0.47.0

func (p SecurityLevel) IntoRef() *SecurityLevel

func (SecurityLevel) MarshalJSON added in v0.47.0

func (p SecurityLevel) MarshalJSON() ([]byte, error)

func (SecurityLevel) String added in v0.47.0

func (p SecurityLevel) String() string

func (*SecurityLevel) UnmarshalJSON added in v0.47.0

func (p *SecurityLevel) UnmarshalJSON(data []byte) error

type SecurityTokenConfiguration added in v0.45.0

type SecurityTokenConfiguration struct {
	Issuer     *IssuerConfiguration
	ServiceTag string
	Secret     string
}

SecurityTokenConfiguration holds the configuration for requesting a security token from the service.

type ServiceBinding added in v0.56.0

type ServiceBinding struct {
	Service     string `json:"service"`
	Environment string `json:"environment"`
}

type ServiceBindingMap added in v0.56.0

type ServiceBindingMap map[string]*ServiceBinding

type ServiceError added in v0.36.0

type ServiceError struct {
	// contains filtered or unexported fields
}

ServiceError is a handler for 5xx errors returned to the client.

func NewServiceError added in v0.48.0

func NewServiceError(e *Error) ServiceError

func (ServiceError) Error added in v0.36.0

func (e ServiceError) Error() string

func (ServiceError) ErrorCodes added in v0.36.0

func (e ServiceError) ErrorCodes() []int

func (ServiceError) ErrorMessages added in v0.36.0

func (e ServiceError) ErrorMessages() []string

func (ServiceError) Errors added in v0.36.0

func (e ServiceError) Errors() []ResponseInfo

func (ServiceError) InternalErrorCodeIs added in v0.48.0

func (e ServiceError) InternalErrorCodeIs(code int) bool

func (ServiceError) RayID added in v0.36.0

func (e ServiceError) RayID() string

func (ServiceError) Type added in v0.36.0

func (e ServiceError) Type() ErrorType

type ServiceMode added in v0.64.0

type ServiceMode string

type ServiceModeV2 added in v0.52.0

type ServiceModeV2 struct {
	Mode ServiceMode `json:"mode,omitempty"`
	Port int         `json:"port,omitempty"`
}

type SessionAffinityAttributes added in v0.12.0

type SessionAffinityAttributes struct {
	SameSite             string   `json:"samesite,omitempty"`
	Secure               string   `json:"secure,omitempty"`
	DrainDuration        int      `json:"drain_duration,omitempty"`
	ZeroDowntimeFailover string   `json:"zero_downtime_failover,omitempty"`
	Headers              []string `json:"headers,omitempty"`
	RequireAllHeaders    bool     `json:"require_all_headers,omitempty"`
}

SessionAffinityAttributes represents additional configuration options for session affinity.

type SetWorkersSecretParams added in v0.57.0

type SetWorkersSecretParams struct {
	ScriptName string
	Secret     *WorkersPutSecretRequest
}

type SizeOptions added in v0.40.0

type SizeOptions struct {
	Size   int  `json:"size,omitempty" url:"size,omitempty"`
	Before *int `json:"before,omitempty" url:"before,omitempty"`
	After  *int `json:"after,omitempty" url:"after,omitempty"`
}

SizeOptions can be passed to a list request to configure size and cursor location. These values will be defaulted if omitted.

This should be swapped to ResultInfoCursors once the types are corrected.

type SourceConfig added in v0.41.0

type SourceConfig struct {
	Name      string            `json:"name,omitempty"`
	NameByIDP map[string]string `json:"name_by_idp,omitempty"`
}

type SpectrumApplication added in v0.9.0

type SpectrumApplication struct {
	DNS              SpectrumApplicationDNS         `json:"dns,omitempty"`
	OriginDirect     []string                       `json:"origin_direct,omitempty"`
	ID               string                         `json:"id,omitempty"`
	Protocol         string                         `json:"protocol,omitempty"`
	TrafficType      string                         `json:"traffic_type,omitempty"`
	TLS              string                         `json:"tls,omitempty"`
	ProxyProtocol    ProxyProtocol                  `json:"proxy_protocol,omitempty"`
	ModifiedOn       *time.Time                     `json:"modified_on,omitempty"`
	OriginDNS        *SpectrumApplicationOriginDNS  `json:"origin_dns,omitempty"`
	OriginPort       *SpectrumApplicationOriginPort `json:"origin_port,omitempty"`
	CreatedOn        *time.Time                     `json:"created_on,omitempty"`
	EdgeIPs          *SpectrumApplicationEdgeIPs    `json:"edge_ips,omitempty"`
	ArgoSmartRouting bool                           `json:"argo_smart_routing,omitempty"`
	IPv4             bool                           `json:"ipv4,omitempty"`
	IPFirewall       bool                           `json:"ip_firewall,omitempty"`
}

SpectrumApplication defines a single Spectrum Application.

func (*SpectrumApplication) UnmarshalJSON added in v0.11.0

func (a *SpectrumApplication) UnmarshalJSON(data []byte) error

UnmarshalJSON handles setting the `ProxyProtocol` field based on the value of the deprecated `spp` field.

type SpectrumApplicationConnectivity added in v0.11.5

type SpectrumApplicationConnectivity string

SpectrumApplicationConnectivity specifies IP address type on the edge configuration.

const (
	// SpectrumConnectivityAll specifies IPv4/6 edge IP.
	SpectrumConnectivityAll SpectrumApplicationConnectivity = "all"
	// SpectrumConnectivityIPv4 specifies IPv4 edge IP.
	SpectrumConnectivityIPv4 SpectrumApplicationConnectivity = "ipv4"
	// SpectrumConnectivityIPv6 specifies IPv6 edge IP.
	SpectrumConnectivityIPv6 SpectrumApplicationConnectivity = "ipv6"
	// SpectrumConnectivityStatic specifies static edge IP configuration.
	SpectrumConnectivityStatic SpectrumApplicationConnectivity = "static"
)

func (SpectrumApplicationConnectivity) Dynamic added in v0.11.5

Dynamic checks if address family is specified as dynamic config.

func (SpectrumApplicationConnectivity) Static added in v0.11.5

Static checks if address family is specified as static config.

func (SpectrumApplicationConnectivity) String added in v0.11.5

func (*SpectrumApplicationConnectivity) UnmarshalJSON added in v0.11.5

func (c *SpectrumApplicationConnectivity) UnmarshalJSON(b []byte) error

UnmarshalJSON function for SpectrumApplicationConnectivity enum.

type SpectrumApplicationDNS added in v0.9.0

type SpectrumApplicationDNS struct {
	Type string `json:"type"`
	Name string `json:"name"`
}

SpectrumApplicationDNS holds the external DNS configuration for a Spectrum Application.

type SpectrumApplicationDetailResponse added in v0.9.0

type SpectrumApplicationDetailResponse struct {
	Response
	Result SpectrumApplication `json:"result"`
}

SpectrumApplicationDetailResponse is the structure of the detailed response from the API.

type SpectrumApplicationEdgeIPs added in v0.11.5

type SpectrumApplicationEdgeIPs struct {
	Type         SpectrumApplicationEdgeType      `json:"type"`
	Connectivity *SpectrumApplicationConnectivity `json:"connectivity,omitempty"`
	IPs          []net.IP                         `json:"ips,omitempty"`
}

SpectrumApplicationEdgeIPs represents configuration for Bring-Your-Own-IP https://developers.cloudflare.com/spectrum/getting-started/byoip/

type SpectrumApplicationEdgeType added in v0.11.5

type SpectrumApplicationEdgeType string

SpectrumApplicationEdgeType for possible Edge configurations.

const (
	// SpectrumEdgeTypeDynamic IP config.
	SpectrumEdgeTypeDynamic SpectrumApplicationEdgeType = "dynamic"
	// SpectrumEdgeTypeStatic IP config.
	SpectrumEdgeTypeStatic SpectrumApplicationEdgeType = "static"
)

func (SpectrumApplicationEdgeType) String added in v0.11.5

func (*SpectrumApplicationEdgeType) UnmarshalJSON added in v0.11.5

func (t *SpectrumApplicationEdgeType) UnmarshalJSON(b []byte) error

UnmarshalJSON function for SpectrumApplicationEdgeType enum.

type SpectrumApplicationOriginDNS added in v0.9.0

type SpectrumApplicationOriginDNS struct {
	Name string `json:"name"`
}

SpectrumApplicationOriginDNS holds the origin DNS configuration for a Spectrum Application.

type SpectrumApplicationOriginPort added in v0.13.0

type SpectrumApplicationOriginPort struct {
	Port, Start, End uint16
}

SpectrumApplicationOriginPort defines a union of a single port or range of ports.

func (*SpectrumApplicationOriginPort) MarshalJSON added in v0.13.0

func (p *SpectrumApplicationOriginPort) MarshalJSON() ([]byte, error)

MarshalJSON converts a single port or port range to a suitable byte slice.

func (*SpectrumApplicationOriginPort) UnmarshalJSON added in v0.13.0

func (p *SpectrumApplicationOriginPort) UnmarshalJSON(b []byte) error

UnmarshalJSON converts a byte slice into a single port or port range.

type SpectrumApplicationsDetailResponse added in v0.9.0

type SpectrumApplicationsDetailResponse struct {
	Response
	Result []SpectrumApplication `json:"result"`
}

SpectrumApplicationsDetailResponse is the structure of the detailed response from the API.

type SplitTunnel added in v0.25.0

type SplitTunnel struct {
	Address     string `json:"address,omitempty"`
	Host        string `json:"host,omitempty"`
	Description string `json:"description,omitempty"`
}

SplitTunnel represents the individual tunnel struct.

type SplitTunnelResponse added in v0.25.0

type SplitTunnelResponse struct {
	Response
	Result []SplitTunnel `json:"result"`
}

SplitTunnelResponse represents the response from the get split tunnel endpoints.

type StartWorkersTailResponse added in v0.47.0

type StartWorkersTailResponse struct {
	Response
	Result WorkersTail
}

type StorageKey added in v0.9.0

type StorageKey struct {
	Name       string      `json:"name"`
	Expiration int         `json:"expiration"`
	Metadata   interface{} `json:"metadata"`
}

StorageKey is a key name used to identify a storage value.

type StreamAccessRule added in v0.44.0

type StreamAccessRule struct {
	Type    string   `json:"type"`
	Country []string `json:"country,omitempty"`
	Action  string   `json:"action"`
	IP      []string `json:"ip,omitempty"`
}

StreamAccessRule represents the accessRules when creating a signed URL.

type StreamCreateVideoParameters added in v0.44.0

type StreamCreateVideoParameters struct {
	AccountID             string
	MaxDurationSeconds    int                     `json:"maxDurationSeconds,omitempty"`
	Expiry                *time.Time              `json:"expiry,omitempty"`
	Creator               string                  `json:"creator,omitempty"`
	ThumbnailTimestampPct float64                 `json:"thumbnailTimestampPct,omitempty"`
	AllowedOrigins        []string                `json:"allowedOrigins,omitempty"`
	RequireSignedURLs     bool                    `json:"requireSignedURLs,omitempty"`
	Watermark             UploadVideoURLWatermark `json:"watermark,omitempty"`
	Meta                  map[string]interface{}  `json:"meta,omitempty"`
	ScheduledDeletion     *time.Time              `json:"scheduledDeletion,omitempty"`
}

StreamCreateVideoParameters are parameters used when creating a video.

type StreamInitiateTUSUploadParameters added in v0.77.0

type StreamInitiateTUSUploadParameters struct {
	DirectUserUpload bool               `url:"direct_user,omitempty"`
	TusResumable     TusProtocolVersion `url:"-"`
	UploadLength     int64              `url:"-"`
	UploadCreator    string             `url:"-"`
	Metadata         TUSUploadMetadata  `url:"-"`
}

type StreamInitiateTUSUploadResponse added in v0.77.0

type StreamInitiateTUSUploadResponse struct {
	ResponseHeaders http.Header
}

type StreamListParameters added in v0.44.0

type StreamListParameters struct {
	AccountID     string
	VideoID       string
	After         *time.Time `url:"after,omitempty"`
	Before        *time.Time `url:"before,omitempty"`
	Creator       string     `url:"creator,omitempty"`
	IncludeCounts bool       `url:"include_counts,omitempty"`
	Search        string     `url:"search,omitempty"`
	Limit         int        `url:"limit,omitempty"`
	Asc           bool       `url:"asc,omitempty"`
	Status        string     `url:"status,omitempty"`
}

StreamListParameters represents parameters used when listing stream videos.

type StreamListResponse

type StreamListResponse struct {
	Response
	Result []StreamVideo `json:"result,omitempty"`
	Total  string        `json:"total,omitempty"`
	Range  string        `json:"range,omitempty"`
}

StreamListResponse represents the API response from a StreamListRequest.

type StreamParameters added in v0.44.0

type StreamParameters struct {
	AccountID string
	VideoID   string
}

StreamParameters are the basic parameters needed.

type StreamSignedURLParameters added in v0.44.0

type StreamSignedURLParameters struct {
	AccountID    string
	VideoID      string
	ID           string             `json:"id,omitempty"`
	PEM          string             `json:"pem,omitempty"`
	EXP          int                `json:"exp,omitempty"`
	NBF          int                `json:"nbf,omitempty"`
	Downloadable bool               `json:"downloadable,omitempty"`
	AccessRules  []StreamAccessRule `json:"accessRules,omitempty"`
}

StreamSignedURLParameters represent parameters used when creating a signed URL.

type StreamSignedURLResponse added in v0.44.0

type StreamSignedURLResponse struct {
	Response
	Result struct {
		Token string `json:"token,omitempty"`
	}
}

StreamSignedURLResponse represents an API response for a signed URL.

type StreamUploadFileParameters added in v0.44.0

type StreamUploadFileParameters struct {
	AccountID         string
	VideoID           string
	FilePath          string
	ScheduledDeletion *time.Time
}

StreamUploadFileParameters are parameters needed for file upload of a video.

type StreamUploadFromURLParameters added in v0.44.0

type StreamUploadFromURLParameters struct {
	AccountID             string
	VideoID               string
	URL                   string                  `json:"url"`
	Creator               string                  `json:"creator,omitempty"`
	ThumbnailTimestampPct float64                 `json:"thumbnailTimestampPct,omitempty"`
	AllowedOrigins        []string                `json:"allowedOrigins,omitempty"`
	RequireSignedURLs     bool                    `json:"requireSignedURLs,omitempty"`
	Watermark             UploadVideoURLWatermark `json:"watermark,omitempty"`
	Meta                  map[string]interface{}  `json:"meta,omitempty"`
	ScheduledDeletion     *time.Time              `json:"scheduledDeletion,omitempty"`
}

StreamUploadFromURLParameters are the parameters used when uploading a video from URL.

type StreamVideo added in v0.44.0

type StreamVideo struct {
	AllowedOrigins        []string                 `json:"allowedOrigins,omitempty"`
	Created               *time.Time               `json:"created,omitempty"`
	Duration              float64                  `json:"duration,omitempty"`
	Input                 StreamVideoInput         `json:"input,omitempty"`
	MaxDurationSeconds    int                      `json:"maxDurationSeconds,omitempty"`
	Meta                  map[string]interface{}   `json:"meta,omitempty"`
	Modified              *time.Time               `json:"modified,omitempty"`
	UploadExpiry          *time.Time               `json:"uploadExpiry,omitempty"`
	Playback              StreamVideoPlayback      `json:"playback,omitempty"`
	Preview               string                   `json:"preview,omitempty"`
	ReadyToStream         bool                     `json:"readyToStream,omitempty"`
	RequireSignedURLs     bool                     `json:"requireSignedURLs,omitempty"`
	Size                  int                      `json:"size,omitempty"`
	Status                StreamVideoStatus        `json:"status,omitempty"`
	Thumbnail             string                   `json:"thumbnail,omitempty"`
	ThumbnailTimestampPct float64                  `json:"thumbnailTimestampPct,omitempty"`
	UID                   string                   `json:"uid,omitempty"`
	Creator               string                   `json:"creator,omitempty"`
	LiveInput             string                   `json:"liveInput,omitempty"`
	Uploaded              *time.Time               `json:"uploaded,omitempty"`
	ScheduledDeletion     *time.Time               `json:"scheduledDeletion,omitempty"`
	Watermark             StreamVideoWatermark     `json:"watermark,omitempty"`
	NFT                   StreamVideoNFTParameters `json:"nft,omitempty"`
}

StreamVideo represents a stream video.

type StreamVideoCreate added in v0.44.0

type StreamVideoCreate struct {
	UploadURL         string               `json:"uploadURL,omitempty"`
	UID               string               `json:"uid,omitempty"`
	Watermark         StreamVideoWatermark `json:"watermark,omitempty"`
	ScheduledDeletion *time.Time           `json:"scheduledDeletion,omitempty"`
}

StreamVideoCreate represents parameters returned after creating a video.

type StreamVideoCreateResponse added in v0.44.0

type StreamVideoCreateResponse struct {
	Response
	Result StreamVideoCreate `json:"result,omitempty"`
}

StreamVideoCreateResponse represents an API response of creating a stream video.

type StreamVideoInput added in v0.44.0

type StreamVideoInput struct {
	Height int `json:"height,omitempty"`
	Width  int `json:"width,omitempty"`
}

StreamVideoInput represents the video input values of a stream video.

type StreamVideoNFTParameters added in v0.44.0

type StreamVideoNFTParameters struct {
	AccountID string
	VideoID   string
	Contract  string `json:"contract,omitempty"`
	Token     int    `json:"token,omitempty"`
}

StreamVideoNFTParameters represents a NFT for a stream video.

type StreamVideoPlayback added in v0.44.0

type StreamVideoPlayback struct {
	HLS  string `json:"hls,omitempty"`
	Dash string `json:"dash,omitempty"`
}

StreamVideoPlayback represents the playback URLs for a video.

type StreamVideoResponse added in v0.44.0

type StreamVideoResponse struct {
	Response
	Result StreamVideo `json:"result,omitempty"`
}

StreamVideoResponse represents an API response of a stream video.

type StreamVideoStatus added in v0.44.0

type StreamVideoStatus struct {
	State           string `json:"state,omitempty"`
	PctComplete     string `json:"pctComplete,omitempty"`
	ErrorReasonCode string `json:"errorReasonCode,omitempty"`
	ErrorReasonText string `json:"errorReasonText,omitempty"`
}

StreamVideoStatus represents the status of a stream video.

type StreamVideoWatermark added in v0.44.0

type StreamVideoWatermark struct {
	UID            string     `json:"uid,omitempty"`
	Size           int        `json:"size,omitempty"`
	Height         int        `json:"height,omitempty"`
	Width          int        `json:"width,omitempty"`
	Created        *time.Time `json:"created,omitempty"`
	DownloadedFrom string     `json:"downloadedFrom,omitempty"`
	Name           string     `json:"name,omitempty"`
	Opacity        float64    `json:"opacity,omitempty"`
	Padding        float64    `json:"padding,omitempty"`
	Scale          float64    `json:"scale,omitempty"`
	Position       string     `json:"position,omitempty"`
}

StreamVideoWatermark represents a watermark for a stream video.

type TUSUploadMetadata added in v0.77.0

type TUSUploadMetadata struct {
	Name                  string     `json:"name,omitempty"`
	MaxDurationSeconds    int        `json:"maxDurationSeconds,omitempty"`
	RequireSignedURLs     bool       `json:"requiresignedurls,omitempty"`
	AllowedOrigins        string     `json:"allowedorigins,omitempty"`
	ThumbnailTimestampPct float64    `json:"thumbnailtimestamppct,omitempty"`
	ScheduledDeletion     *time.Time `json:"scheduledDeletion,omitempty"`
	Expiry                *time.Time `json:"expiry,omitempty"`
	Watermark             string     `json:"watermark,omitempty"`
}

func (TUSUploadMetadata) ToTUSCsv added in v0.77.0

func (t TUSUploadMetadata) ToTUSCsv() (string, error)

type TeamsAccount added in v0.21.0

type TeamsAccount struct {
	GatewayTag   string `json:"gateway_tag"`   // Internal teams ID
	ProviderName string `json:"provider_name"` // Auth provider
	ID           string `json:"id"`            // cloudflare account ID
}

type TeamsAccountLoggingConfiguration added in v0.30.0

type TeamsAccountLoggingConfiguration struct {
	LogAll    bool `json:"log_all"`
	LogBlocks bool `json:"log_blocks"`
}

type TeamsAccountResponse added in v0.21.0

type TeamsAccountResponse struct {
	Response
	Result TeamsAccount `json:"result"`
}

TeamsAccountResponse is the API response, containing information on teams account.

type TeamsAccountSettings added in v0.21.0

type TeamsAccountSettings struct {
	Antivirus             *TeamsAntivirus             `json:"antivirus,omitempty"`
	TLSDecrypt            *TeamsTLSDecrypt            `json:"tls_decrypt,omitempty"`
	ActivityLog           *TeamsActivityLog           `json:"activity_log,omitempty"`
	BlockPage             *TeamsBlockPage             `json:"block_page,omitempty"`
	BrowserIsolation      *BrowserIsolation           `json:"browser_isolation,omitempty"`
	FIPS                  *TeamsFIPS                  `json:"fips,omitempty"`
	ProtocolDetection     *TeamsProtocolDetection     `json:"protocol_detection,omitempty"`
	BodyScanning          *TeamsBodyScanning          `json:"body_scanning,omitempty"`
	ExtendedEmailMatching *TeamsExtendedEmailMatching `json:"extended_email_matching,omitempty"`
}

type TeamsActivityLog added in v0.21.0

type TeamsActivityLog struct {
	Enabled bool `json:"enabled"`
}

type TeamsAntivirus added in v0.21.0

type TeamsAntivirus struct {
	EnabledDownloadPhase bool                       `json:"enabled_download_phase"`
	EnabledUploadPhase   bool                       `json:"enabled_upload_phase"`
	FailClosed           bool                       `json:"fail_closed"`
	NotificationSettings *TeamsNotificationSettings `json:"notification_settings"`
}

type TeamsBISOAdminControlSettings added in v0.21.0

type TeamsBISOAdminControlSettings struct {
	DisablePrinting             bool `json:"dp"`
	DisableCopyPaste            bool `json:"dcp"`
	DisableDownload             bool `json:"dd"`
	DisableUpload               bool `json:"du"`
	DisableKeyboard             bool `json:"dk"`
	DisableClipboardRedirection bool `json:"dcr"`
}

type TeamsBlockPage added in v0.21.0

type TeamsBlockPage struct {
	Enabled         *bool  `json:"enabled,omitempty"`
	FooterText      string `json:"footer_text,omitempty"`
	HeaderText      string `json:"header_text,omitempty"`
	LogoPath        string `json:"logo_path,omitempty"`
	BackgroundColor string `json:"background_color,omitempty"`
	Name            string `json:"name,omitempty"`
	MailtoAddress   string `json:"mailto_address,omitempty"`
	MailtoSubject   string `json:"mailto_subject,omitempty"`
	SuppressFooter  *bool  `json:"suppress_footer,omitempty"`
}

type TeamsBodyScanning added in v0.80.0

type TeamsBodyScanning struct {
	InspectionMode TeamsInspectionMode `json:"inspection_mode,omitempty"`
}

type TeamsCheckSessionSettings added in v0.31.0

type TeamsCheckSessionSettings struct {
	Enforce  bool     `json:"enforce"`
	Duration Duration `json:"duration"`
}

type TeamsConfigResponse added in v0.21.0

type TeamsConfigResponse struct {
	Response
	Result TeamsConfiguration `json:"result"`
}

TeamsConfigResponse is the API response, containing information on teams account config.

type TeamsConfiguration added in v0.21.0

type TeamsConfiguration struct {
	Settings  TeamsAccountSettings `json:"settings"`
	CreatedAt time.Time            `json:"created_at,omitempty"`
	UpdatedAt time.Time            `json:"updated_at,omitempty"`
}

TeamsConfiguration data model.

type TeamsDeviceDetail added in v0.32.0

type TeamsDeviceDetail struct {
	Response
	Result TeamsDeviceListItem `json:"result"`
}

type TeamsDeviceListItem added in v0.32.0

type TeamsDeviceListItem struct {
	User             UserItem `json:"user,omitempty"`
	ID               string   `json:"id,omitempty"`
	Key              string   `json:"key,omitempty"`
	DeviceType       string   `json:"device_type,omitempty"`
	Name             string   `json:"name,omitempty"`
	Model            string   `json:"model,omitempty"`
	Manufacturer     string   `json:"manufacturer,omitempty"`
	Deleted          bool     `json:"deleted,omitempty"`
	Version          string   `json:"version,omitempty"`
	SerialNumber     string   `json:"serial_number,omitempty"`
	OSVersion        string   `json:"os_version,omitempty"`
	OSDistroName     string   `json:"os_distro_name,omitempty"`
	OsDistroRevision string   `json:"os_distro_revision,omitempty"`
	OSVersionExtra   string   `json:"os_version_extra,omitempty"`
	MacAddress       string   `json:"mac_address,omitempty"`
	IP               string   `json:"ip,omitempty"`
	Created          string   `json:"created,omitempty"`
	Updated          string   `json:"updated,omitempty"`
	LastSeen         string   `json:"last_seen,omitempty"`
	RevokedAt        string   `json:"revoked_at,omitempty"`
}

type TeamsDeviceSettings added in v0.31.0

type TeamsDeviceSettings struct {
	GatewayProxyEnabled                bool `json:"gateway_proxy_enabled"`
	GatewayProxyUDPEnabled             bool `json:"gateway_udp_proxy_enabled"`
	RootCertificateInstallationEnabled bool `json:"root_certificate_installation_enabled"`
}

type TeamsDeviceSettingsResponse added in v0.31.0

type TeamsDeviceSettingsResponse struct {
	Response
	Result TeamsDeviceSettings `json:"result"`
}

type TeamsDevicesList added in v0.32.0

type TeamsDevicesList struct {
	Response
	Result []TeamsDeviceListItem `json:"result"`
}

type TeamsDlpPayloadLogSettings added in v0.62.0

type TeamsDlpPayloadLogSettings struct {
	Enabled bool `json:"enabled"`
}

type TeamsDnsResolverAddress added in v0.81.0

type TeamsDnsResolverAddress struct {
	IP                         string `json:"ip"`
	Port                       *int   `json:"port,omitempty"`
	VnetID                     string `json:"vnet_id,omitempty"`
	RouteThroughPrivateNetwork *bool  `json:"route_through_private_network,omitempty"`
}

type TeamsDnsResolverAddressV4 added in v0.81.0

type TeamsDnsResolverAddressV4 struct {
	TeamsDnsResolverAddress
}

type TeamsDnsResolverAddressV6 added in v0.81.0

type TeamsDnsResolverAddressV6 struct {
	TeamsDnsResolverAddress
}

type TeamsDnsResolverSettings added in v0.81.0

type TeamsDnsResolverSettings struct {
	V4Resolvers []TeamsDnsResolverAddressV4 `json:"ipv4,omitempty"`
	V6Resolvers []TeamsDnsResolverAddressV6 `json:"ipv6,omitempty"`
}

type TeamsExtendedEmailMatching added in v0.87.0

type TeamsExtendedEmailMatching struct {
	Enabled *bool `json:"enabled,omitempty"`
}

type TeamsFIPS added in v0.28.0

type TeamsFIPS struct {
	TLS bool `json:"tls"`
}

type TeamsFilterType added in v0.21.0

type TeamsFilterType string
const (
	HttpFilter        TeamsFilterType = "http"
	DnsFilter         TeamsFilterType = "dns"
	L4Filter          TeamsFilterType = "l4"
	EgressFilter      TeamsFilterType = "egress"
	DnsResolverFilter TeamsFilterType = "dns_resolver"
)

type TeamsGatewayAction added in v0.21.0

type TeamsGatewayAction string
const (
	Allow        TeamsGatewayAction = "allow"        // dns|http|l4
	Block        TeamsGatewayAction = "block"        // dns|http|l4
	SafeSearch   TeamsGatewayAction = "safesearch"   // dns
	YTRestricted TeamsGatewayAction = "ytrestricted" // dns
	On           TeamsGatewayAction = "on"           // http
	Off          TeamsGatewayAction = "off"          // http
	Scan         TeamsGatewayAction = "scan"         // http
	NoScan       TeamsGatewayAction = "noscan"       // http
	Isolate      TeamsGatewayAction = "isolate"      // http
	NoIsolate    TeamsGatewayAction = "noisolate"    // http
	Override     TeamsGatewayAction = "override"     // http
	L4Override   TeamsGatewayAction = "l4_override"  // l4
	Egress       TeamsGatewayAction = "egress"       // egress
	AuditSSH     TeamsGatewayAction = "audit_ssh"    // l4
	Resolve      TeamsGatewayAction = "resolve"      // resolve
)

type TeamsGatewayUntrustedCertAction added in v0.62.0

type TeamsGatewayUntrustedCertAction string
const (
	UntrustedCertPassthrough TeamsGatewayUntrustedCertAction = "pass_through"
	UntrustedCertBlock       TeamsGatewayUntrustedCertAction = "block"
	UntrustedCertError       TeamsGatewayUntrustedCertAction = "error"
)

type TeamsInspectionMode added in v0.80.0

type TeamsInspectionMode = string
const (
	TeamsShallowInspectionMode TeamsInspectionMode = "shallow"
	TeamsDeepInspectionMode    TeamsInspectionMode = "deep"
)

type TeamsL4OverrideSettings added in v0.21.0

type TeamsL4OverrideSettings struct {
	IP   string `json:"ip,omitempty"`
	Port int    `json:"port,omitempty"`
}

TeamsL4OverrideSettings used in l4 filter type rule with action set to override.

type TeamsList added in v0.17.0

type TeamsList struct {
	ID          string          `json:"id,omitempty"`
	Name        string          `json:"name"`
	Type        string          `json:"type"`
	Description string          `json:"description,omitempty"`
	Items       []TeamsListItem `json:"items,omitempty"`
	Count       uint64          `json:"count,omitempty"`
	CreatedAt   *time.Time      `json:"created_at,omitempty"`
	UpdatedAt   *time.Time      `json:"updated_at,omitempty"`
}

TeamsList represents a Teams List.

type TeamsListDetailResponse added in v0.17.0

type TeamsListDetailResponse struct {
	Response
	Result TeamsList `json:"result"`
}

TeamsListDetailResponse is the API response, containing a single teams list.

type TeamsListItem added in v0.17.0

type TeamsListItem struct {
	Value     string     `json:"value"`
	CreatedAt *time.Time `json:"created_at,omitempty"`
}

TeamsListItem represents a single list item.

type TeamsListItemsListResponse added in v0.17.0

type TeamsListItemsListResponse struct {
	Result []TeamsListItem `json:"result"`
	Response
	ResultInfo `json:"result_info"`
}

TeamsListItemsListResponse represents the response from the list teams list items endpoint.

type TeamsListListResponse added in v0.17.0

type TeamsListListResponse struct {
	Result []TeamsList `json:"result"`
	Response
	ResultInfo `json:"result_info"`
}

TeamsListListResponse represents the response from the list teams lists endpoint.

type TeamsLocation added in v0.21.0

type TeamsLocation struct {
	ID                    string                 `json:"id"`
	Name                  string                 `json:"name"`
	Networks              []TeamsLocationNetwork `json:"networks"`
	PolicyIDs             []string               `json:"policy_ids"`
	Ip                    string                 `json:"ip,omitempty"`
	Subdomain             string                 `json:"doh_subdomain"`
	AnonymizedLogsEnabled bool                   `json:"anonymized_logs_enabled"`
	IPv4Destination       string                 `json:"ipv4_destination"`
	ClientDefault         bool                   `json:"client_default"`

	CreatedAt *time.Time `json:"created_at,omitempty"`
	UpdatedAt *time.Time `json:"updated_at,omitempty"`
}

type TeamsLocationDetailResponse added in v0.21.0

type TeamsLocationDetailResponse struct {
	Response
	Result TeamsLocation `json:"result"`
}

type TeamsLocationNetwork added in v0.21.0

type TeamsLocationNetwork struct {
	ID      string `json:"id"`
	Network string `json:"network"`
}

type TeamsLocationsListResponse added in v0.21.0

type TeamsLocationsListResponse struct {
	Response
	ResultInfo `json:"result_info"`
	Result     []TeamsLocation `json:"result"`
}

type TeamsLoggingSettings added in v0.30.0

type TeamsLoggingSettings struct {
	LoggingSettingsByRuleType map[TeamsRuleType]TeamsAccountLoggingConfiguration `json:"settings_by_rule_type"`
	RedactPii                 bool                                               `json:"redact_pii,omitempty"`
}

type TeamsLoggingSettingsResponse added in v0.30.0

type TeamsLoggingSettingsResponse struct {
	Response
	Result TeamsLoggingSettings `json:"result"`
}

type TeamsNotificationSettings added in v0.84.0

type TeamsNotificationSettings struct {
	Enabled    *bool  `json:"enabled,omitempty"`
	Message    string `json:"msg"`
	SupportURL string `json:"support_url"`
}

type TeamsProtocolDetection added in v0.74.0

type TeamsProtocolDetection struct {
	Enabled bool `json:"enabled"`
}

type TeamsProxyEndpoint added in v0.35.0

type TeamsProxyEndpoint struct {
	ID        string     `json:"id"`
	Name      string     `json:"name"`
	IPs       []string   `json:"ips"`
	Subdomain string     `json:"subdomain"`
	CreatedAt *time.Time `json:"created_at,omitempty"`
	UpdatedAt *time.Time `json:"updated_at,omitempty"`
}

type TeamsProxyEndpointDetailResponse added in v0.35.0

type TeamsProxyEndpointDetailResponse struct {
	Response
	Result TeamsProxyEndpoint `json:"result"`
}

type TeamsProxyEndpointListResponse added in v0.35.0

type TeamsProxyEndpointListResponse struct {
	Response
	ResultInfo `json:"result_info"`
	Result     []TeamsProxyEndpoint `json:"result"`
}

type TeamsRule added in v0.21.0

type TeamsRule struct {
	ID            string             `json:"id,omitempty"`
	CreatedAt     *time.Time         `json:"created_at,omitempty"`
	UpdatedAt     *time.Time         `json:"updated_at,omitempty"`
	DeletedAt     *time.Time         `json:"deleted_at,omitempty"`
	Name          string             `json:"name"`
	Description   string             `json:"description"`
	Precedence    uint64             `json:"precedence"`
	Enabled       bool               `json:"enabled"`
	Action        TeamsGatewayAction `json:"action"`
	Filters       []TeamsFilterType  `json:"filters"`
	Traffic       string             `json:"traffic"`
	Identity      string             `json:"identity"`
	DevicePosture string             `json:"device_posture"`
	Version       uint64             `json:"version"`
	RuleSettings  TeamsRuleSettings  `json:"rule_settings,omitempty"`
}

TeamsRule represents an Teams wirefilter rule.

type TeamsRulePatchRequest added in v0.21.0

type TeamsRulePatchRequest struct {
	ID           string             `json:"id"`
	Name         string             `json:"name"`
	Description  string             `json:"description"`
	Precedence   uint64             `json:"precedence"`
	Enabled      bool               `json:"enabled"`
	Action       TeamsGatewayAction `json:"action"`
	RuleSettings TeamsRuleSettings  `json:"rule_settings,omitempty"`
}

TeamsRulePatchRequest is used to patch an existing rule.

type TeamsRuleResponse added in v0.21.0

type TeamsRuleResponse struct {
	Response
	Result TeamsRule `json:"result"`
}

TeamsRuleResponse is the API response, containing a single rule.

type TeamsRuleSettings added in v0.21.0

type TeamsRuleSettings struct {
	// list of ipv4 or ipv6 ips to override with, when action is set to dns override
	OverrideIPs []string `json:"override_ips"`

	// show this string at block page caused by this rule
	BlockReason string `json:"block_reason"`

	// host name to override with when action is set to dns override. Can not be used with OverrideIPs
	OverrideHost string `json:"override_host"`

	// settings for browser isolation actions
	BISOAdminControls *TeamsBISOAdminControlSettings `json:"biso_admin_controls"`

	// settings for l4(network) level overrides
	L4Override *TeamsL4OverrideSettings `json:"l4override"`

	// settings for adding headers to http requests
	AddHeaders http.Header `json:"add_headers"`

	// settings for session check in allow action
	CheckSession *TeamsCheckSessionSettings `json:"check_session"`

	// Enable block page on rules with action block
	BlockPageEnabled bool `json:"block_page_enabled"`

	// whether to disable dnssec validation for allow action
	InsecureDisableDNSSECValidation bool `json:"insecure_disable_dnssec_validation"`

	// settings for rules with egress action
	EgressSettings *EgressSettings `json:"egress"`

	// DLP payload logging configuration
	PayloadLog *TeamsDlpPayloadLogSettings `json:"payload_log"`

	//AuditSsh Settings
	AuditSSH *AuditSSHRuleSettings `json:"audit_ssh"`

	// Turns on ip category based filter on dns if the rule contains dns category checks
	IPCategories bool `json:"ip_categories"`

	// Allow parent MSP accounts to enable bypass their children's rules. Do not set them for non MSP accounts.
	AllowChildBypass *bool `json:"allow_child_bypass,omitempty"`

	// Allow child MSP accounts to bypass their parent's rules. Do not set them for non MSP accounts.
	BypassParentRule *bool `json:"bypass_parent_rule,omitempty"`

	// Action taken when an untrusted origin certificate error occurs in a http allow rule
	UntrustedCertSettings *UntrustedCertSettings `json:"untrusted_cert"`

	// Specifies that a resolver policy should use Cloudflare's DNS Resolver.
	ResolveDnsThroughCloudflare *bool `json:"resolve_dns_through_cloudflare,omitempty"`

	// Resolver policy settings.
	DnsResolverSettings *TeamsDnsResolverSettings `json:"dns_resolvers,omitempty"`

	NotificationSettings *TeamsNotificationSettings `json:"notification_settings"`
}

type TeamsRuleType added in v0.30.0

type TeamsRuleType = string
const (
	TeamsHttpRuleType TeamsRuleType = "http"
	TeamsDnsRuleType  TeamsRuleType = "dns"
	TeamsL4RuleType   TeamsRuleType = "l4"
)

type TeamsRulesResponse added in v0.21.0

type TeamsRulesResponse struct {
	Response
	Result []TeamsRule `json:"result"`
}

TeamsRuleResponse is the API response, containing an array of rules.

type TeamsTLSDecrypt added in v0.21.0

type TeamsTLSDecrypt struct {
	Enabled bool `json:"enabled"`
}

type TieredCache added in v0.57.1

type TieredCache struct {
	Type         TieredCacheType
	LastModified time.Time
}

type TieredCacheType added in v0.57.1

type TieredCacheType int
const (
	TieredCacheOff     TieredCacheType = 0
	TieredCacheGeneric TieredCacheType = 1
	TieredCacheSmart   TieredCacheType = 2
)

func (TieredCacheType) String added in v0.57.1

func (e TieredCacheType) String() string

type TimeRange added in v0.40.0

type TimeRange struct {
	Since  string `json:"since,omitempty" url:"since,omitempty"`
	Before string `json:"before,omitempty" url:"before,omitempty"`
}

TimeRange is an object for filtering the alert history based on timestamp.

type TotalTLS added in v0.53.0

type TotalTLS struct {
	Enabled              *bool  `json:"enabled,omitempty"`
	CertificateAuthority string `json:"certificate_authority,omitempty"`
	ValidityDays         int    `json:"validity_days,omitempty"`
}

type TotalTLSResponse added in v0.53.0

type TotalTLSResponse struct {
	Response
	Result TotalTLS `json:"result"`
}

type Tunnel added in v0.39.0

type Tunnel struct {
	ID             string             `json:"id,omitempty"`
	Name           string             `json:"name,omitempty"`
	Secret         string             `json:"tunnel_secret,omitempty"`
	CreatedAt      *time.Time         `json:"created_at,omitempty"`
	DeletedAt      *time.Time         `json:"deleted_at,omitempty"`
	Connections    []TunnelConnection `json:"connections,omitempty"`
	ConnsActiveAt  *time.Time         `json:"conns_active_at,omitempty"`
	ConnInactiveAt *time.Time         `json:"conns_inactive_at,omitempty"`
	TunnelType     string             `json:"tun_type,omitempty"`
	Status         string             `json:"status,omitempty"`
	RemoteConfig   bool               `json:"remote_config,omitempty"`
}

Tunnel is the struct definition of a tunnel.

type TunnelConfiguration added in v0.43.0

type TunnelConfiguration struct {
	Ingress       []UnvalidatedIngressRule `json:"ingress,omitempty"`
	WarpRouting   *WarpRoutingConfig       `json:"warp-routing,omitempty"`
	OriginRequest OriginRequestConfig      `json:"originRequest,omitempty"`
}

type TunnelConfigurationParams added in v0.43.0

type TunnelConfigurationParams struct {
	TunnelID string              `json:"-"`
	Config   TunnelConfiguration `json:"config,omitempty"`
}

type TunnelConfigurationResponse added in v0.43.0

type TunnelConfigurationResponse struct {
	Result TunnelConfigurationResult `json:"result"`
	Response
}

TunnelConfigurationResponse is used for representing the API response payload for a single tunnel.

type TunnelConfigurationResult added in v0.43.0

type TunnelConfigurationResult struct {
	TunnelID string              `json:"tunnel_id,omitempty"`
	Config   TunnelConfiguration `json:"config,omitempty"`
	Version  int                 `json:"version,omitempty"`
}

type TunnelConnection added in v0.39.0

type TunnelConnection struct {
	ColoName           string `json:"colo_name"`
	ID                 string `json:"id"`
	IsPendingReconnect bool   `json:"is_pending_reconnect"`
	ClientID           string `json:"client_id"`
	ClientVersion      string `json:"client_version"`
	OpenedAt           string `json:"opened_at"`
	OriginIP           string `json:"origin_ip"`
}

TunnelConnection represents the connections associated with a tunnel.

type TunnelConnectionResponse added in v0.45.0

type TunnelConnectionResponse struct {
	Result []Connection `json:"result"`
	Response
}

TunnelConnectionResponse is used for representing the API response payload for connections of a single tunnel.

type TunnelCreateParams added in v0.39.0

type TunnelCreateParams struct {
	Name      string `json:"name,omitempty"`
	Secret    string `json:"tunnel_secret,omitempty"`
	ConfigSrc string `json:"config_src,omitempty"`
}

type TunnelDetailResponse added in v0.39.0

type TunnelDetailResponse struct {
	Result Tunnel `json:"result"`
	Response
}

TunnelDetailResponse is used for representing the API response payload for a single tunnel.

type TunnelDuration added in v0.70.0

type TunnelDuration struct {
	time.Duration
}

A TunnelDuration is a Duration that has custom serialization for JSON. JSON in Javascript assumes that int fields are 32 bits and Duration fields are deserialized assuming that numbers are in nanoseconds, which in 32bit integers limits to just 2 seconds. This type assumes that when serializing/deserializing from JSON, that the number is in seconds, while it maintains the YAML serde assumptions.

func (TunnelDuration) MarshalJSON added in v0.70.0

func (s TunnelDuration) MarshalJSON() ([]byte, error)

func (*TunnelDuration) UnmarshalJSON added in v0.70.0

func (s *TunnelDuration) UnmarshalJSON(data []byte) error

type TunnelListParams added in v0.39.0

type TunnelListParams struct {
	Name          string     `url:"name,omitempty"`
	UUID          string     `url:"uuid,omitempty"` // the tunnel ID
	IsDeleted     *bool      `url:"is_deleted,omitempty"`
	ExistedAt     *time.Time `url:"existed_at,omitempty"`
	IncludePrefix string     `url:"include_prefix,omitempty"`
	ExcludePrefix string     `url:"exclude_prefix,omitempty"`

	ResultInfo
}

type TunnelRoute added in v0.36.0

type TunnelRoute struct {
	Network          string     `json:"network"`
	TunnelID         string     `json:"tunnel_id"`
	TunnelName       string     `json:"tunnel_name"`
	Comment          string     `json:"comment"`
	CreatedAt        *time.Time `json:"created_at"`
	DeletedAt        *time.Time `json:"deleted_at"`
	VirtualNetworkID string     `json:"virtual_network_id"`
}

TunnelRoute is the full record for a route.

type TunnelRoutesCreateParams added in v0.36.0

type TunnelRoutesCreateParams struct {
	Network          string `json:"-"`
	TunnelID         string `json:"tunnel_id"`
	Comment          string `json:"comment,omitempty"`
	VirtualNetworkID string `json:"virtual_network_id,omitempty"`
}

type TunnelRoutesDeleteParams added in v0.36.0

type TunnelRoutesDeleteParams struct {
	Network          string `url:"-"`
	VirtualNetworkID string `url:"virtual_network_id,omitempty"`
}

type TunnelRoutesForIPParams added in v0.36.0

type TunnelRoutesForIPParams struct {
	Network          string `url:"-"`
	VirtualNetworkID string `url:"virtual_network_id,omitempty"`
}

type TunnelRoutesListParams added in v0.36.0

type TunnelRoutesListParams struct {
	TunnelID         string     `url:"tunnel_id,omitempty"`
	Comment          string     `url:"comment,omitempty"`
	IsDeleted        *bool      `url:"is_deleted,omitempty"`
	NetworkSubset    string     `url:"network_subset,omitempty"`
	NetworkSuperset  string     `url:"network_superset,omitempty"`
	ExistedAt        *time.Time `url:"existed_at,omitempty"`
	VirtualNetworkID string     `url:"virtual_network_id,omitempty"`
	PaginationOptions
}

type TunnelRoutesUpdateParams added in v0.36.0

type TunnelRoutesUpdateParams struct {
	Network          string `json:"network"`
	TunnelID         string `json:"tunnel_id"`
	Comment          string `json:"comment,omitempty"`
	VirtualNetworkID string `json:"virtual_network_id,omitempty"`
}

type TunnelTokenResponse added in v0.40.0

type TunnelTokenResponse struct {
	Result string `json:"result"`
	Response
}

TunnelTokenResponse is the API response for a tunnel token.

type TunnelUpdateParams added in v0.39.0

type TunnelUpdateParams struct {
	Name   string `json:"name,omitempty"`
	Secret string `json:"tunnel_secret,omitempty"`
}

type TunnelVirtualNetwork added in v0.41.0

type TunnelVirtualNetwork struct {
	ID               string     `json:"id"`
	Name             string     `json:"name"`
	IsDefaultNetwork bool       `json:"is_default_network"`
	Comment          string     `json:"comment"`
	CreatedAt        *time.Time `json:"created_at"`
	DeletedAt        *time.Time `json:"deleted_at"`
}

TunnelVirtualNetwork is segregation of Tunnel IP Routes via Virtualized Networks to handle overlapping private IPs in your origins.

type TunnelVirtualNetworkCreateParams added in v0.41.0

type TunnelVirtualNetworkCreateParams struct {
	Name      string `json:"name"`
	Comment   string `json:"comment"`
	IsDefault bool   `json:"is_default"`
}

type TunnelVirtualNetworkUpdateParams added in v0.41.0

type TunnelVirtualNetworkUpdateParams struct {
	VnetID           string `json:"-"`
	Name             string `json:"name,omitempty"`
	Comment          string `json:"comment,omitempty"`
	IsDefaultNetwork *bool  `json:"is_default_network,omitempty"`
}

type TunnelVirtualNetworksListParams added in v0.41.0

type TunnelVirtualNetworksListParams struct {
	ID        string `url:"id,omitempty"`
	Name      string `url:"name,omitempty"`
	IsDefault *bool  `url:"is_default,omitempty"`
	IsDeleted *bool  `url:"is_deleted,omitempty"`

	PaginationOptions
}

type TunnelsDetailResponse added in v0.39.0

type TunnelsDetailResponse struct {
	Result []Tunnel `json:"result"`
	Response
	ResultInfo `json:"result_info"`
}

TunnelsDetailResponse is used for representing the API response payload for multiple tunnels.

type TurnstileWidget added in v0.66.0

type TurnstileWidget struct {
	SiteKey      string     `json:"sitekey,omitempty"`
	Secret       string     `json:"secret,omitempty"`
	CreatedOn    *time.Time `json:"created_on,omitempty"`
	ModifiedOn   *time.Time `json:"modified_on,omitempty"`
	Name         string     `json:"name,omitempty"`
	Domains      []string   `json:"domains,omitempty"`
	Mode         string     `json:"mode,omitempty"`
	BotFightMode bool       `json:"bot_fight_mode,omitempty"`
	Region       string     `json:"region,omitempty"`
	OffLabel     bool       `json:"offlabel,omitempty"`
}

type TurnstileWidgetResponse added in v0.66.0

type TurnstileWidgetResponse struct {
	Response
	Result TurnstileWidget `json:"result"`
}

type TusProtocolVersion added in v0.77.0

type TusProtocolVersion string
const (
	TusProtocolVersion1_0_0 TusProtocolVersion = "1.0.0"
)

type URLNormalizationSettings added in v0.49.0

type URLNormalizationSettings struct {
	Type  string `json:"type"`
	Scope string `json:"scope"`
}

type URLNormalizationSettingsResponse added in v0.49.0

type URLNormalizationSettingsResponse struct {
	Result URLNormalizationSettings `json:"result"`
	Response
}

type URLNormalizationSettingsUpdateParams added in v0.49.0

type URLNormalizationSettingsUpdateParams struct {
	Type  string `json:"type"`
	Scope string `json:"scope"`
}

type UniversalSSLCertificatePackValidationMethodSetting added in v0.20.0

type UniversalSSLCertificatePackValidationMethodSetting struct {
	ValidationMethod string `json:"validation_method"`
}

type UniversalSSLSetting added in v0.9.0

type UniversalSSLSetting struct {
	Enabled bool `json:"enabled"`
}

UniversalSSLSetting represents a universal ssl setting's properties.

type UniversalSSLVerificationDetails added in v0.10.0

type UniversalSSLVerificationDetails struct {
	CertificateStatus  string                `json:"certificate_status"`
	VerificationType   string                `json:"verification_type"`
	ValidationMethod   string                `json:"validation_method"`
	CertPackUUID       string                `json:"cert_pack_uuid"`
	VerificationStatus bool                  `json:"verification_status"`
	BrandCheck         bool                  `json:"brand_check"`
	VerificationInfo   []SSLValidationRecord `json:"verification_info"`
}

UniversalSSLVerificationDetails represents a universal ssl verification's properties.

type UnsafeBinding added in v0.74.0

type UnsafeBinding map[string]interface{}

UnsafeBinding is for experimental or deprecated bindings, and allows specifying any binding type or property.

Example
pretty := func(meta workerBindingMeta) string {
	buf := bytes.NewBufferString("")
	encoder := json.NewEncoder(buf)
	encoder.SetIndent("", "  ")
	if err := encoder.Encode(meta); err != nil {
		fmt.Println("error:", err)
	}
	return buf.String()
}

binding_a := WorkerServiceBinding{
	Service: "foo",
}
meta_a, _, _ := binding_a.serialize("my_binding")
meta_a_json := pretty(meta_a)
fmt.Println(meta_a_json)

binding_b := UnsafeBinding{
	"type":    "service",
	"service": "foo",
}
meta_b, _, _ := binding_b.serialize("my_binding")
meta_b_json := pretty(meta_b)
fmt.Println(meta_b_json)

fmt.Println(meta_a_json == meta_b_json)
Output:

{
  "name": "my_binding",
  "service": "foo",
  "type": "service"
}

{
  "name": "my_binding",
  "service": "foo",
  "type": "service"
}

true

func (UnsafeBinding) Type added in v0.74.0

Type returns the type of the binding.

type UntrustedCertSettings added in v0.62.0

type UntrustedCertSettings struct {
	Action TeamsGatewayUntrustedCertAction `json:"action"`
}

type UnvalidatedIngressRule added in v0.43.0

type UnvalidatedIngressRule struct {
	Hostname      string               `json:"hostname,omitempty"`
	Path          string               `json:"path,omitempty"`
	Service       string               `json:"service,omitempty"`
	OriginRequest *OriginRequestConfig `json:"originRequest,omitempty"`
}

type UpdateAPIShieldDiscoveryOperation added in v0.79.0

type UpdateAPIShieldDiscoveryOperation struct {
	// State is the state to set on the operation
	State APIShieldDiscoveryState `json:"state" url:"-"`
}

UpdateAPIShieldDiscoveryOperation represents the state to set on a discovery operation.

type UpdateAPIShieldDiscoveryOperationParams added in v0.79.0

type UpdateAPIShieldDiscoveryOperationParams struct {
	// OperationID is the ID, formatted as UUID, of the operation to be updated
	OperationID string                  `json:"-" url:"-"`
	State       APIShieldDiscoveryState `json:"state" url:"-"`
}

UpdateAPIShieldDiscoveryOperationParams represents the parameters to pass to patch a discovery operation

API documentation: https://developers.cloudflare.com/api/operations/api-shield-api-patch-discovered-operation

type UpdateAPIShieldDiscoveryOperationsParams added in v0.79.0

type UpdateAPIShieldDiscoveryOperationsParams map[string]UpdateAPIShieldDiscoveryOperation

UpdateAPIShieldDiscoveryOperationsParams maps discovery operation IDs to PatchAPIShieldDiscoveryOperation structs

Example:

UpdateAPIShieldDiscoveryOperations{
		"99522293-a505-45e5-bbad-bbc339f5dc40": PatchAPIShieldDiscoveryOperation{ State: "review" },
}

API documentation: https://developers.cloudflare.com/api/operations/api-shield-api-patch-discovered-operations

type UpdateAPIShieldOperationSchemaValidationSettings added in v0.80.0

type UpdateAPIShieldOperationSchemaValidationSettings map[string]APIShieldOperationSchemaValidationSettings

UpdateAPIShieldOperationSchemaValidationSettings maps operation IDs to APIShieldOperationSchemaValidationSettings

This can be used to bulk update operations in one call

Example:

UpdateAPIShieldOperationSchemaValidationSettings{
		"99522293-a505-45e5-bbad-bbc339f5dc40": APIShieldOperationSchemaValidationSettings{ MitigationAction: nil },
}

API documentation: https://developers.cloudflare.com/api/operations/api-shield-schema-validation-update-multiple-operation-level-settings

type UpdateAPIShieldOperationSchemaValidationSettingsResponse added in v0.80.0

type UpdateAPIShieldOperationSchemaValidationSettingsResponse struct {
	Result UpdateAPIShieldOperationSchemaValidationSettings `json:"result"`
	Response
}

UpdateAPIShieldOperationSchemaValidationSettingsResponse represents the response from the PATCH api_gateway/operations/schema_validation endpoint.

type UpdateAPIShieldParams added in v0.49.0

type UpdateAPIShieldParams struct {
	AuthIdCharacteristics []AuthIdCharacteristics `json:"auth_id_characteristics"`
}

type UpdateAPIShieldSchemaParams added in v0.79.0

type UpdateAPIShieldSchemaParams struct {
	// SchemaID is the schema to be patched
	SchemaID string `json:"-" url:"-"`

	// ValidationEnabled controls if schema is used for validation
	ValidationEnabled *bool `json:"validation_enabled" url:"-"`
}

UpdateAPIShieldSchemaParams represents the parameters to pass to patch certain fields on an existing schema

API documentation: https://developers.cloudflare.com/api/operations/api-shield-schema-validation-enable-validation-for-a-schema

type UpdateAPIShieldSchemaValidationSettingsParams added in v0.80.0

type UpdateAPIShieldSchemaValidationSettingsParams struct {
	// DefaultMitigationAction is the mitigation to apply when there is no operation-level
	// mitigation action defined
	//
	// passing a `nil` value will have no effect on this setting
	DefaultMitigationAction *string `json:"validation_default_mitigation_action" url:"-"`

	// OverrideMitigationAction when set, will apply to all requests regardless of
	// zone-level/operation-level setting
	//
	// passing a `nil` value will have no effect on this setting
	OverrideMitigationAction *string `json:"validation_override_mitigation_action" url:"-"`
}

UpdateAPIShieldSchemaValidationSettingsParams represents the parameters to pass to update certain fields on schema validation settings on the zone

API documentation: https://developers.cloudflare.com/api/operations/api-shield-schema-validation-patch-zone-level-settings

type UpdateAccessApplicationParams added in v0.71.0

type UpdateAccessApplicationParams struct {
	ID                       string                         `json:"id,omitempty"`
	AllowedIdps              []string                       `json:"allowed_idps,omitempty"`
	AppLauncherVisible       *bool                          `json:"app_launcher_visible,omitempty"`
	AUD                      string                         `json:"aud,omitempty"`
	AutoRedirectToIdentity   *bool                          `json:"auto_redirect_to_identity,omitempty"`
	CorsHeaders              *AccessApplicationCorsHeaders  `json:"cors_headers,omitempty"`
	CustomDenyMessage        string                         `json:"custom_deny_message,omitempty"`
	CustomDenyURL            string                         `json:"custom_deny_url,omitempty"`
	CustomNonIdentityDenyURL string                         `json:"custom_non_identity_deny_url,omitempty"`
	Domain                   string                         `json:"domain"`
	EnableBindingCookie      *bool                          `json:"enable_binding_cookie,omitempty"`
	GatewayRules             []AccessApplicationGatewayRule `json:"gateway_rules,omitempty"`
	HttpOnlyCookieAttribute  *bool                          `json:"http_only_cookie_attribute,omitempty"`
	LogoURL                  string                         `json:"logo_url,omitempty"`
	Name                     string                         `json:"name"`
	PathCookieAttribute      *bool                          `json:"path_cookie_attribute,omitempty"`
	PrivateAddress           string                         `json:"private_address"`
	SaasApplication          *SaasApplication               `json:"saas_app,omitempty"`
	SameSiteCookieAttribute  string                         `json:"same_site_cookie_attribute,omitempty"`
	SelfHostedDomains        []string                       `json:"self_hosted_domains"`
	ServiceAuth401Redirect   *bool                          `json:"service_auth_401_redirect,omitempty"`
	SessionDuration          string                         `json:"session_duration,omitempty"`
	SkipInterstitial         *bool                          `json:"skip_interstitial,omitempty"`
	Type                     AccessApplicationType          `json:"type,omitempty"`
	AllowAuthenticateViaWarp *bool                          `json:"allow_authenticate_via_warp,omitempty"`
	CustomPages              []string                       `json:"custom_pages,omitempty"`
	Tags                     []string                       `json:"tags,omitempty"`
	AccessAppLauncherCustomization
}

type UpdateAccessCustomPageParams added in v0.74.0

type UpdateAccessCustomPageParams struct {
	CustomHTML string               `json:"custom_html,omitempty"`
	Name       string               `json:"name,omitempty"`
	Type       AccessCustomPageType `json:"type,omitempty"`
	UID        string               `json:"uid,omitempty"`
}

type UpdateAccessGroupParams added in v0.71.0

type UpdateAccessGroupParams struct {
	ID   string `json:"id,omitempty"`
	Name string `json:"name"`

	// The include group works like an OR logical operator. The user must
	// satisfy one of the rules.
	Include []interface{} `json:"include"`

	// The exclude group works like a NOT logical operator. The user must
	// not satisfy all the rules in exclude.
	Exclude []interface{} `json:"exclude"`

	// The require group works like a AND logical operator. The user must
	// satisfy all the rules in require.
	Require []interface{} `json:"require"`
}

type UpdateAccessIdentityProviderParams added in v0.71.0

type UpdateAccessIdentityProviderParams struct {
	ID         string                                  `json:"-"`
	Name       string                                  `json:"name"`
	Type       string                                  `json:"type"`
	Config     AccessIdentityProviderConfiguration     `json:"config"`
	ScimConfig AccessIdentityProviderScimConfiguration `json:"scim_config"`
}

type UpdateAccessMutualTLSCertificateParams added in v0.71.0

type UpdateAccessMutualTLSCertificateParams struct {
	ID                  string    `json:"-"`
	ExpiresOn           time.Time `json:"expires_on,omitempty"`
	Name                string    `json:"name,omitempty"`
	Fingerprint         string    `json:"fingerprint,omitempty"`
	Certificate         string    `json:"certificate,omitempty"`
	AssociatedHostnames []string  `json:"associated_hostnames,omitempty"`
}

type UpdateAccessMutualTLSHostnameSettingsParams added in v0.90.0

type UpdateAccessMutualTLSHostnameSettingsParams struct {
	Settings []AccessMutualTLSHostnameSettings `json:"settings,omitempty"`
}

type UpdateAccessOrganizationParams added in v0.71.0

type UpdateAccessOrganizationParams struct {
	Name                           string                        `json:"name"`
	AuthDomain                     string                        `json:"auth_domain"`
	LoginDesign                    AccessOrganizationLoginDesign `json:"login_design"`
	IsUIReadOnly                   *bool                         `json:"is_ui_read_only,omitempty"`
	UIReadOnlyToggleReason         string                        `json:"ui_read_only_toggle_reason,omitempty"`
	UserSeatExpirationInactiveTime string                        `json:"user_seat_expiration_inactive_time,omitempty"`
	AutoRedirectToIdentity         *bool                         `json:"auto_redirect_to_identity,omitempty"`
	SessionDuration                *string                       `json:"session_duration,omitempty"`
	CustomPages                    AccessOrganizationCustomPages `json:"custom_pages,omitempty"`
	WarpAuthSessionDuration        *string                       `json:"warp_auth_session_duration,omitempty"`
	AllowAuthenticateViaWarp       *bool                         `json:"allow_authenticate_via_warp,omitempty"`
}

type UpdateAccessPolicyParams added in v0.72.0

type UpdateAccessPolicyParams struct {
	ApplicationID string `json:"-"`
	PolicyID      string `json:"-"`

	Precedence int    `json:"precedence"`
	Decision   string `json:"decision"`
	Name       string `json:"name"`

	IsolationRequired            *bool                 `json:"isolation_required,omitempty"`
	SessionDuration              *string               `json:"session_duration,omitempty"`
	PurposeJustificationRequired *bool                 `json:"purpose_justification_required,omitempty"`
	PurposeJustificationPrompt   *string               `json:"purpose_justification_prompt,omitempty"`
	ApprovalRequired             *bool                 `json:"approval_required,omitempty"`
	ApprovalGroups               []AccessApprovalGroup `json:"approval_groups"`

	// The include policy works like an OR logical operator. The user must
	// satisfy one of the rules.
	Include []interface{} `json:"include"`

	// The exclude policy works like a NOT logical operator. The user must
	// not satisfy all the rules in exclude.
	Exclude []interface{} `json:"exclude"`

	// The require policy works like a AND logical operator. The user must
	// satisfy all the rules in require.
	Require []interface{} `json:"require"`
}

type UpdateAccessServiceTokenParams added in v0.71.0

type UpdateAccessServiceTokenParams struct {
	Name     string `json:"name"`
	UUID     string `json:"-"`
	Duration string `json:"duration,omitempty"`
}

type UpdateAccessUserSeatParams added in v0.81.0

type UpdateAccessUserSeatParams struct {
	SeatUID     string `json:"seat_uid,omitempty"`
	AccessSeat  *bool  `json:"access_seat"`
	GatewaySeat *bool  `json:"gateway_seat"`
}

UpdateAccessUserSeatParams represents the update payload for access seats.

type UpdateAccessUserSeatResponse added in v0.81.0

type UpdateAccessUserSeatResponse struct {
	Response
	Result     []AccessUpdateAccessUserSeatResult `json:"result"`
	ResultInfo `json:"result_info"`
}

AccessUserSeatResponse represents the response from the access user seat endpoints.

type UpdateAccessUsersSeatsParams added in v0.87.0

type UpdateAccessUsersSeatsParams []struct {
	SeatUID     string `json:"seat_uid,omitempty"`
	AccessSeat  *bool  `json:"access_seat"`
	GatewaySeat *bool  `json:"gateway_seat"`
}

UpdateAccessUsersSeatsParams represents the update payload for multiple access seats.

type UpdateAddressMapParams added in v0.63.0

type UpdateAddressMapParams struct {
	ID          string  `json:"-"`
	Description *string `json:"description,omitempty"`
	Enabled     *bool   `json:"enabled,omitempty"`
	DefaultSNI  *string `json:"default_sni,omitempty"`
}

UpdateAddressMapParams contains information about an address map to be updated.

type UpdateAuditSSHSettingsParams added in v0.79.0

type UpdateAuditSSHSettingsParams struct {
	PublicKey string `json:"public_key"`
}

type UpdateBotManagementParams added in v0.75.0

type UpdateBotManagementParams struct {
	EnableJS                     *bool   `json:"enable_js,omitempty"`
	FightMode                    *bool   `json:"fight_mode,omitempty"`
	SBFMDefinitelyAutomated      *string `json:"sbfm_definitely_automated,omitempty"`
	SBFMLikelyAutomated          *string `json:"sbfm_likely_automated,omitempty"`
	SBFMVerifiedBots             *string `json:"sbfm_verified_bots,omitempty"`
	SBFMStaticResourceProtection *bool   `json:"sbfm_static_resource_protection,omitempty"`
	OptimizeWordpress            *bool   `json:"optimize_wordpress,omitempty"`
	SuppressSessionScore         *bool   `json:"suppress_session_score,omitempty"`
	AutoUpdateModel              *bool   `json:"auto_update_model,omitempty"`
}

type UpdateCacheReserveParams added in v0.68.0

type UpdateCacheReserveParams struct {
	Value string `json:"value"`
}

type UpdateCustomNameserverZoneMetadataParams added in v0.70.0

type UpdateCustomNameserverZoneMetadataParams struct {
	NSSet   int  `json:"ns_set"`
	Enabled bool `json:"enabled"`
}

type UpdateDLPDatasetParams added in v0.87.0

type UpdateDLPDatasetParams struct {
	DatasetID   string
	Description *string `json:"description,omitempty"` // nil to leave descrption as-is
	Name        *string `json:"name,omitempty"`        // nil to leave name as-is
}

type UpdateDLPDatasetResponse added in v0.87.0

type UpdateDLPDatasetResponse struct {
	Result DLPDataset `json:"result"`
	Response
}

type UpdateDLPProfileParams added in v0.53.0

type UpdateDLPProfileParams struct {
	ProfileID string
	Profile   DLPProfile
	Type      string
}

type UpdateDNSFirewallClusterParams added in v0.70.0

type UpdateDNSFirewallClusterParams struct {
	ClusterID            string   `json:"-"`
	Name                 string   `json:"name"`
	UpstreamIPs          []string `json:"upstream_ips"`
	DNSFirewallIPs       []string `json:"dns_firewall_ips,omitempty"`
	MinimumCacheTTL      uint     `json:"minimum_cache_ttl,omitempty"`
	MaximumCacheTTL      uint     `json:"maximum_cache_ttl,omitempty"`
	DeprecateAnyRequests bool     `json:"deprecate_any_requests"`
}

type UpdateDNSRecordParams added in v0.58.0

type UpdateDNSRecordParams struct {
	Type     string      `json:"type,omitempty"`
	Name     string      `json:"name,omitempty"`
	Content  string      `json:"content,omitempty"`
	Data     interface{} `json:"data,omitempty"` // data for: SRV, LOC
	ID       string      `json:"-"`
	Priority *uint16     `json:"priority,omitempty"`
	TTL      int         `json:"ttl,omitempty"`
	Proxied  *bool       `json:"proxied,omitempty"`
	Comment  *string     `json:"comment,omitempty"` // nil will keep the current comment, while StringPtr("") will empty it
	Tags     []string    `json:"tags"`
}

type UpdateDataLocalizationRegionalHostnameParams added in v0.66.0

type UpdateDataLocalizationRegionalHostnameParams struct {
	Hostname  string `json:"-"`
	RegionKey string `json:"region_key"`
}

type UpdateDefaultDeviceSettingsPolicyParams added in v0.81.0

type UpdateDefaultDeviceSettingsPolicyParams struct {
	DisableAutoFallback *bool          `json:"disable_auto_fallback,omitempty"`
	CaptivePortal       *int           `json:"captive_portal,omitempty"`
	AllowModeSwitch     *bool          `json:"allow_mode_switch,omitempty"`
	SwitchLocked        *bool          `json:"switch_locked,omitempty"`
	AllowUpdates        *bool          `json:"allow_updates,omitempty"`
	AutoConnect         *int           `json:"auto_connect,omitempty"`
	AllowedToLeave      *bool          `json:"allowed_to_leave,omitempty"`
	SupportURL          *string        `json:"support_url,omitempty"`
	ServiceModeV2       *ServiceModeV2 `json:"service_mode_v2,omitempty"`
	Precedence          *int           `json:"precedence,omitempty"`
	Name                *string        `json:"name,omitempty"`
	Match               *string        `json:"match,omitempty"`
	Enabled             *bool          `json:"enabled,omitempty"`
	ExcludeOfficeIps    *bool          `json:"exclude_office_ips"`
	Description         *string        `json:"description,omitempty"`
	LANAllowMinutes     *uint          `json:"lan_allow_minutes,omitempty"`
	LANAllowSubnetSize  *uint          `json:"lan_allow_subnet_size,omitempty"`
}

type UpdateDeviceClientCertificatesParams added in v0.81.0

type UpdateDeviceClientCertificatesParams struct {
	Enabled *bool `json:"enabled"`
}

type UpdateDeviceDexTestParams added in v0.62.0

type UpdateDeviceDexTestParams struct {
	TestID      string             `json:"test_id,omitempty"`
	Name        string             `json:"name"`
	Description string             `json:"description,omitempty"`
	Interval    string             `json:"interval"`
	Enabled     bool               `json:"enabled"`
	Data        *DeviceDexTestData `json:"data"`
}

type UpdateDeviceManagedNetworkParams added in v0.57.0

type UpdateDeviceManagedNetworkParams struct {
	NetworkID string  `json:"network_id,omitempty"`
	Type      string  `json:"type"`
	Name      string  `json:"name"`
	Config    *Config `json:"config"`
}

type UpdateDeviceSettingsPolicyParams added in v0.81.0

type UpdateDeviceSettingsPolicyParams struct {
	PolicyID            *string        `json:"-"`
	DisableAutoFallback *bool          `json:"disable_auto_fallback,omitempty"`
	CaptivePortal       *int           `json:"captive_portal,omitempty"`
	AllowModeSwitch     *bool          `json:"allow_mode_switch,omitempty"`
	SwitchLocked        *bool          `json:"switch_locked,omitempty"`
	AllowUpdates        *bool          `json:"allow_updates,omitempty"`
	AutoConnect         *int           `json:"auto_connect,omitempty"`
	AllowedToLeave      *bool          `json:"allowed_to_leave,omitempty"`
	SupportURL          *string        `json:"support_url,omitempty"`
	ServiceModeV2       *ServiceModeV2 `json:"service_mode_v2,omitempty"`
	Precedence          *int           `json:"precedence,omitempty"`
	Name                *string        `json:"name,omitempty"`
	Match               *string        `json:"match,omitempty"`
	Enabled             *bool          `json:"enabled,omitempty"`
	ExcludeOfficeIps    *bool          `json:"exclude_office_ips"`
	Description         *string        `json:"description,omitempty"`
	LANAllowMinutes     *uint          `json:"lan_allow_minutes,omitempty"`
	LANAllowSubnetSize  *uint          `json:"lan_allow_subnet_size,omitempty"`
}

type UpdateEmailRoutingRuleParameters added in v0.47.0

type UpdateEmailRoutingRuleParameters struct {
	Matchers []EmailRoutingRuleMatcher `json:"matchers,omitempty"`
	Actions  []EmailRoutingRuleAction  `json:"actions,omitempty"`
	Name     string                    `json:"name,omitempty"`
	Enabled  *bool                     `json:"enabled,omitempty"`
	Priority int                       `json:"priority,omitempty"`
	RuleID   string
}

type UpdateEntrypointRulesetParams added in v0.73.0

type UpdateEntrypointRulesetParams struct {
	Phase       string        `json:"-"`
	Description string        `json:"description,omitempty"`
	Rules       []RulesetRule `json:"rules"`
}

type UpdateHostnameTLSSettingCiphersParams added in v0.75.0

type UpdateHostnameTLSSettingCiphersParams struct {
	Hostname string
	Value    []string `json:"value"`
}

UpdateHostnameTLSSettingCiphersParams represents the data related to the per-hostname ciphers tls setting being updated.

type UpdateHostnameTLSSettingParams added in v0.75.0

type UpdateHostnameTLSSettingParams struct {
	Setting  string
	Hostname string
	Value    string `json:"value"`
}

UpdateHostnameTLSSettingParams represents the data related to the per-hostname tls setting being updated.

type UpdateHyperdriveConfigParams added in v0.88.0

type UpdateHyperdriveConfigParams struct {
	HyperdriveID string                  `json:"-"`
	Name         string                  `json:"name"`
	Origin       HyperdriveConfigOrigin  `json:"origin"`
	Caching      HyperdriveConfigCaching `json:"caching,omitempty"`
}

type UpdateImageParams added in v0.71.0

type UpdateImageParams struct {
	ID                string                 `json:"-"`
	RequireSignedURLs bool                   `json:"requireSignedURLs"`
	Metadata          map[string]interface{} `json:"metadata,omitempty"`
}

UpdateImageParams is the data required for an UpdateImage request.

type UpdateImagesVariantParams added in v0.88.0

type UpdateImagesVariantParams struct {
	ID                     string                `json:"-"`
	NeverRequireSignedURLs *bool                 `json:"neverRequireSignedURLs,omitempty"`
	Options                ImagesVariantsOptions `json:"options,omitempty"`
}

type UpdateLoadBalancerMonitorParams added in v0.51.0

type UpdateLoadBalancerMonitorParams struct {
	LoadBalancerMonitor LoadBalancerMonitor
}

type UpdateLoadBalancerParams added in v0.51.0

type UpdateLoadBalancerParams struct {
	LoadBalancer LoadBalancer
}

type UpdateLoadBalancerPoolParams added in v0.51.0

type UpdateLoadBalancerPoolParams struct {
	LoadBalancer LoadBalancerPool
}

type UpdateLogpushJobParams added in v0.72.0

type UpdateLogpushJobParams struct {
	ID                       int                   `json:"-"`
	Dataset                  string                `json:"dataset"`
	Enabled                  bool                  `json:"enabled"`
	Kind                     string                `json:"kind,omitempty"`
	Name                     string                `json:"name"`
	LogpullOptions           string                `json:"logpull_options,omitempty"`
	OutputOptions            *LogpushOutputOptions `json:"output_options,omitempty"`
	DestinationConf          string                `json:"destination_conf"`
	OwnershipChallenge       string                `json:"ownership_challenge,omitempty"`
	LastComplete             *time.Time            `json:"last_complete,omitempty"`
	LastError                *time.Time            `json:"last_error,omitempty"`
	ErrorMessage             string                `json:"error_message,omitempty"`
	Frequency                string                `json:"frequency,omitempty"`
	Filter                   *LogpushJobFilters    `json:"filter,omitempty"`
	MaxUploadBytes           int                   `json:"max_upload_bytes,omitempty"`
	MaxUploadRecords         int                   `json:"max_upload_records,omitempty"`
	MaxUploadIntervalSeconds int                   `json:"max_upload_interval_seconds,omitempty"`
}

func (UpdateLogpushJobParams) MarshalJSON added in v0.72.0

func (f UpdateLogpushJobParams) MarshalJSON() ([]byte, error)

func (*UpdateLogpushJobParams) UnmarshalJSON added in v0.72.0

func (f *UpdateLogpushJobParams) UnmarshalJSON(data []byte) error

Custom Unmarshaller for UpdateLogpushJobParams filter key.

type UpdateMagicFirewallRulesetRequest added in v0.13.7

type UpdateMagicFirewallRulesetRequest struct {
	Description string                     `json:"description"`
	Rules       []MagicFirewallRulesetRule `json:"rules"`
}

UpdateMagicFirewallRulesetRequest contains data for a Magic Firewall ruleset update.

type UpdateMagicFirewallRulesetResponse added in v0.13.7

type UpdateMagicFirewallRulesetResponse struct {
	Response
	Result MagicFirewallRuleset `json:"result"`
}

UpdateMagicFirewallRulesetResponse contains response data when updating an existing Magic Firewall ruleset.

type UpdateMagicTransitGRETunnelResponse added in v0.32.0

type UpdateMagicTransitGRETunnelResponse struct {
	Response
	Result struct {
		Modified          bool                  `json:"modified"`
		ModifiedGRETunnel MagicTransitGRETunnel `json:"modified_gre_tunnel"`
	} `json:"result"`
}

UpdateMagicTransitGRETunnelResponse contains a response after updating a GRE Tunnel.

type UpdateMagicTransitIPsecTunnelResponse added in v0.31.0

type UpdateMagicTransitIPsecTunnelResponse struct {
	Response
	Result struct {
		Modified            bool                    `json:"modified"`
		ModifiedIPsecTunnel MagicTransitIPsecTunnel `json:"modified_ipsec_tunnel"`
	} `json:"result"`
}

UpdateMagicTransitIPsecTunnelResponse contains a response after updating an IPsec Tunnel.

type UpdateMagicTransitStaticRouteResponse added in v0.18.0

type UpdateMagicTransitStaticRouteResponse struct {
	Response
	Result struct {
		Modified      bool                    `json:"modified"`
		ModifiedRoute MagicTransitStaticRoute `json:"modified_route"`
	} `json:"result"`
}

UpdateMagicTransitStaticRouteResponse contains a static route update response.

type UpdateManagedHeadersParams added in v0.42.0

type UpdateManagedHeadersParams struct {
	ManagedHeaders
}

type UpdatePageShieldPolicyParams added in v0.84.0

type UpdatePageShieldPolicyParams struct {
	Action      string `json:"action"`
	Description string `json:"description"`
	Enabled     *bool  `json:"enabled,omitempty"`
	Expression  string `json:"expression"`
	ID          string `json:"id"`
	Value       string `json:"value"`
}

type UpdatePageShieldSettingsParams added in v0.84.0

type UpdatePageShieldSettingsParams struct {
	Enabled                        *bool `json:"enabled,omitempty"`
	UseCloudflareReportingEndpoint *bool `json:"use_cloudflare_reporting_endpoint,omitempty"`
	UseConnectionURLPath           *bool `json:"use_connection_url_path,omitempty"`
}

type UpdatePagesProjectParams added in v0.73.0

type UpdatePagesProjectParams struct {
	// `ID` is used for addressing the resource via the UI or a stable
	// anchor whereas `Name` is used for updating the value.
	ID                  string                        `json:"-"`
	Name                string                        `json:"name,omitempty"`
	SubDomain           string                        `json:"subdomain"`
	Domains             []string                      `json:"domains,omitempty"`
	Source              *PagesProjectSource           `json:"source,omitempty"`
	BuildConfig         PagesProjectBuildConfig       `json:"build_config"`
	DeploymentConfigs   PagesProjectDeploymentConfigs `json:"deployment_configs"`
	LatestDeployment    PagesProjectDeployment        `json:"latest_deployment"`
	CanonicalDeployment PagesProjectDeployment        `json:"canonical_deployment"`
	ProductionBranch    string                        `json:"production_branch,omitempty"`
}

type UpdateQueueConsumerParams added in v0.55.0

type UpdateQueueConsumerParams struct {
	QueueName string `json:"-"`
	Consumer  QueueConsumer
}

type UpdateQueueParams added in v0.55.0

type UpdateQueueParams struct {
	Name        string `json:"-"`
	UpdatedName string `json:"queue_name,omitempty"`
}

type UpdateRegionalTieredCacheParams added in v0.73.0

type UpdateRegionalTieredCacheParams struct {
	Value string `json:"value"`
}

type UpdateRulesetParams added in v0.73.0

type UpdateRulesetParams struct {
	ID          string        `json:"-"`
	Description string        `json:"description"`
	Rules       []RulesetRule `json:"rules"`
}

type UpdateRulesetRequest added in v0.19.0

type UpdateRulesetRequest struct {
	Description string        `json:"description"`
	Rules       []RulesetRule `json:"rules"`
}

UpdateRulesetRequest is the representation of a Ruleset update.

type UpdateRulesetResponse added in v0.19.0

type UpdateRulesetResponse struct {
	Response
	Result Ruleset `json:"result"`
}

UpdateRulesetResponse contains response data when updating an existing Ruleset.

type UpdateTeamsListParams added in v0.53.0

type UpdateTeamsListParams struct {
	ID          string          `json:"id,omitempty"`
	Name        string          `json:"name"`
	Type        string          `json:"type"`
	Description string          `json:"description,omitempty"`
	Items       []TeamsListItem `json:"items,omitempty"`
	Count       uint64          `json:"count,omitempty"`
	CreatedAt   *time.Time      `json:"created_at,omitempty"`
	UpdatedAt   *time.Time      `json:"updated_at,omitempty"`
}

type UpdateTurnstileWidgetParams added in v0.66.0

type UpdateTurnstileWidgetParams struct {
	SiteKey      string   `json:"-"`
	Name         string   `json:"name,omitempty"`
	Domains      []string `json:"domains,omitempty"`
	Mode         string   `json:"mode,omitempty"`
	BotFightMode bool     `json:"bot_fight_mode,omitempty"`
	Region       string   `json:"region,omitempty"`
	OffLabel     bool     `json:"offlabel,omitempty"`
}

type UpdateWaitingRoomRuleParams added in v0.53.0

type UpdateWaitingRoomRuleParams struct {
	WaitingRoomID string
	Rule          WaitingRoomRule
}

type UpdateWaitingRoomSettingsParams added in v0.67.0

type UpdateWaitingRoomSettingsParams struct {
	SearchEngineCrawlerBypass *bool `json:"search_engine_crawler_bypass,omitempty"`
}

type UpdateWebAnalyticsRuleParams added in v0.75.0

type UpdateWebAnalyticsRuleParams struct {
	RulesetID string
	RuleID    string
	Rule      CreateWebAnalyticsRule
}

type UpdateWebAnalyticsSiteParams added in v0.75.0

type UpdateWebAnalyticsSiteParams struct {
	SiteTag string `json:"-"`
	// Host is the host to measure traffic for.
	Host string `json:"host,omitempty"`
	// ZoneTag is the zone tag to measure traffic for.
	ZoneTag string `json:"zone_tag,omitempty"`
	// AutoInstall defines whether Cloudflare will inject the JS snippet automatically for orange-clouded sites.
	AutoInstall *bool `json:"auto_install"`
}

type UpdateWorkerCronTriggersParams added in v0.57.0

type UpdateWorkerCronTriggersParams struct {
	ScriptName string
	Crons      []WorkerCronTrigger
}

type UpdateWorkerRouteParams added in v0.57.0

type UpdateWorkerRouteParams struct {
	ID      string `json:"id,omitempty"`
	Pattern string `json:"pattern"`
	Script  string `json:"script,omitempty"`
}

type UpdateWorkersKVNamespaceParams added in v0.55.0

type UpdateWorkersKVNamespaceParams struct {
	NamespaceID string `json:"-"`
	Title       string `json:"title"`
}

type UpdateWorkersScriptContentParams added in v0.76.0

type UpdateWorkersScriptContentParams struct {
	ScriptName string
	Script     string

	// DispatchNamespaceName uploads the worker to a WFP dispatch namespace if provided
	DispatchNamespaceName *string

	// Module changes the Content-Type header to specify the script is an
	// ES Module syntax script.
	Module bool
}

type UpdateWorkersScriptSettingsParams added in v0.76.0

type UpdateWorkersScriptSettingsParams struct {
	ScriptName string

	// Logpush opts the worker into Workers Logpush logging. A nil value leaves
	// the current setting unchanged.
	//
	// Documentation: https://developers.cloudflare.com/workers/platform/logpush/
	Logpush *bool

	// TailConsumers specifies a list of Workers that will consume the logs of
	// the attached Worker.
	// Documentation: https://developers.cloudflare.com/workers/platform/tail-workers/
	TailConsumers *[]WorkersTailConsumer

	// Bindings should be a map where the keys are the binding name, and the
	// values are the binding content
	Bindings map[string]WorkerBinding

	// CompatibilityDate is a date in the form yyyy-mm-dd,
	// which will be used to determine which version of the Workers runtime is used.
	//  https://developers.cloudflare.com/workers/platform/compatibility-dates/
	CompatibilityDate string

	// CompatibilityFlags are the names of features of the Workers runtime to be enabled or disabled,
	// usually used together with CompatibilityDate.
	//  https://developers.cloudflare.com/workers/platform/compatibility-dates/#compatibility-flags
	CompatibilityFlags []string

	Placement *Placement
}

type UpdateZarazConfigParams added in v0.86.0

type UpdateZarazConfigParams struct {
	DebugKey      string                   `json:"debugKey"`
	Tools         map[string]ZarazTool     `json:"tools"`
	Triggers      map[string]ZarazTrigger  `json:"triggers"`
	ZarazVersion  int64                    `json:"zarazVersion"`
	Consent       ZarazConsent             `json:"consent,omitempty"`
	DataLayer     *bool                    `json:"dataLayer,omitempty"`
	Dlp           []any                    `json:"dlp,omitempty"`
	HistoryChange *bool                    `json:"historyChange,omitempty"`
	Settings      ZarazConfigSettings      `json:"settings,omitempty"`
	Variables     map[string]ZarazVariable `json:"variables,omitempty"`
}

type UpdateZarazWorkflowParams added in v0.86.0

type UpdateZarazWorkflowParams struct {
	Workflow string `json:"workflow"`
}

type UpdateZoneSettingParams added in v0.64.0

type UpdateZoneSettingParams struct {
	Name       string      `json:"-"`
	PathPrefix string      `json:"-"`
	Value      interface{} `json:"value"`
}

type UploadDLPDatasetVersionParams added in v0.87.0

type UploadDLPDatasetVersionParams struct {
	DatasetID string
	Version   int
	Body      interface{}
}

type UploadDLPDatasetVersionResponse added in v0.87.0

type UploadDLPDatasetVersionResponse struct {
	Result DLPDataset `json:"result"`
	Response
}

type UploadImageParams added in v0.71.0

type UploadImageParams struct {
	File              io.ReadCloser
	URL               string
	Name              string
	RequireSignedURLs bool
	Metadata          map[string]interface{}
}

UploadImageParams is the data required for an Image Upload request.

type UploadVideoURLWatermark added in v0.44.0

type UploadVideoURLWatermark struct {
	UID string `json:"uid,omitempty"`
}

UploadVideoURLWatermark represents UID of an existing watermark.

type UsageModel added in v0.56.0

type UsageModel string
const (
	Bundled  UsageModel = "bundled"
	Unbound  UsageModel = "unbound"
	Standard UsageModel = "standard"
)

type User added in v0.7.2

type User struct {
	ID         string     `json:"id,omitempty"`
	Email      string     `json:"email,omitempty"`
	FirstName  string     `json:"first_name,omitempty"`
	LastName   string     `json:"last_name,omitempty"`
	Username   string     `json:"username,omitempty"`
	Telephone  string     `json:"telephone,omitempty"`
	Country    string     `json:"country,omitempty"`
	Zipcode    string     `json:"zipcode,omitempty"`
	CreatedOn  *time.Time `json:"created_on,omitempty"`
	ModifiedOn *time.Time `json:"modified_on,omitempty"`
	APIKey     string     `json:"api_key,omitempty"`
	TwoFA      bool       `json:"two_factor_authentication_enabled,omitempty"`
	Betas      []string   `json:"betas,omitempty"`
	Accounts   []Account  `json:"organizations,omitempty"`
}

User describes a user account.

type UserAgentRule added in v0.8.0

type UserAgentRule struct {
	ID            string              `json:"id"`
	Description   string              `json:"description"`
	Mode          string              `json:"mode"`
	Configuration UserAgentRuleConfig `json:"configuration"`
	Paused        bool                `json:"paused"`
}

UserAgentRule represents a User-Agent Block. These rules can be used to challenge, block or whitelist specific User-Agents for a given zone.

type UserAgentRuleConfig added in v0.8.0

type UserAgentRuleConfig ZoneLockdownConfig

UserAgentRuleConfig represents a Zone Lockdown config, which comprises a Target ("ip" or "ip_range") and a Value (an IP address or IP+mask, respectively.)

type UserAgentRuleListResponse added in v0.8.0

type UserAgentRuleListResponse struct {
	Result []UserAgentRule `json:"result"`
	Response
	ResultInfo `json:"result_info"`
}

UserAgentRuleListResponse represents a response from the List Zone Lockdown endpoint.

type UserAgentRuleResponse added in v0.8.0

type UserAgentRuleResponse struct {
	Result UserAgentRule `json:"result"`
	Response
	ResultInfo `json:"result_info"`
}

UserAgentRuleResponse represents a response from the Zone Lockdown endpoint.

type UserBillingHistory added in v0.43.0

type UserBillingHistory struct {
	ID          string                 `json:"id,omitempty"`
	Type        string                 `json:"type,omitempty"`
	Action      string                 `json:"action,omitempty"`
	Description string                 `json:"description,omitempty"`
	OccurredAt  *time.Time             `json:"occurred_at,omitempty"`
	Amount      float32                `json:"amount,omitempty"`
	Currency    string                 `json:"currency,omitempty"`
	Zone        userBillingHistoryZone `json:"zone"`
}

type UserBillingHistoryResponse added in v0.43.0

type UserBillingHistoryResponse struct {
	Response
	Result     []UserBillingHistory `json:"result"`
	ResultInfo ResultInfo           `json:"result_info"`
}

type UserBillingOptions added in v0.43.0

type UserBillingOptions struct {
	PaginationOptions
	Order      string     `url:"order,omitempty"`
	Type       string     `url:"type,omitempty"`
	OccurredAt *time.Time `url:"occurred_at,omitempty"`
	Action     string     `url:"action,omitempty"`
}

type UserBillingProfile added in v0.7.3

type UserBillingProfile struct {
	ID              string     `json:"id,omitempty"`
	FirstName       string     `json:"first_name,omitempty"`
	LastName        string     `json:"last_name,omitempty"`
	Address         string     `json:"address,omitempty"`
	Address2        string     `json:"address2,omitempty"`
	Company         string     `json:"company,omitempty"`
	City            string     `json:"city,omitempty"`
	State           string     `json:"state,omitempty"`
	ZipCode         string     `json:"zipcode,omitempty"`
	Country         string     `json:"country,omitempty"`
	Telephone       string     `json:"telephone,omitempty"`
	CardNumber      string     `json:"card_number,omitempty"`
	CardExpiryYear  int        `json:"card_expiry_year,omitempty"`
	CardExpiryMonth int        `json:"card_expiry_month,omitempty"`
	VAT             string     `json:"vat,omitempty"`
	CreatedOn       *time.Time `json:"created_on,omitempty"`
	EditedOn        *time.Time `json:"edited_on,omitempty"`
}

UserBillingProfile contains Billing Profile information.

type UserItem added in v0.32.0

type UserItem struct {
	ID    string `json:"id,omitempty"`
	Name  string `json:"name,omitempty"`
	Email string `json:"email,omitempty"`
}

type UserResponse added in v0.7.2

type UserResponse struct {
	Response
	Result User `json:"result"`
}

UserResponse wraps a response containing User accounts.

type ValidateLogpushOwnershipChallengeParams added in v0.72.0

type ValidateLogpushOwnershipChallengeParams struct {
	DestinationConf    string `json:"destination_conf"`
	OwnershipChallenge string `json:"ownership_challenge"`
}

type ValidationData added in v0.44.0

type ValidationData struct {
	Status string `json:"status"`
	Method string `json:"method"`
}

ValidationData represents validation data for a domain.

type VerificationData added in v0.44.0

type VerificationData struct {
	Status string `json:"status"`
}

VerificationData represents verification data for a domain.

type WAFGroup added in v0.10.0

type WAFGroup struct {
	ID                 string   `json:"id"`
	Name               string   `json:"name"`
	Description        string   `json:"description"`
	RulesCount         int      `json:"rules_count"`
	ModifiedRulesCount int      `json:"modified_rules_count"`
	PackageID          string   `json:"package_id"`
	Mode               string   `json:"mode"`
	AllowedModes       []string `json:"allowed_modes"`
}

WAFGroup represents a WAF rule group.

type WAFGroupResponse added in v0.10.1

type WAFGroupResponse struct {
	Response
	Result     WAFGroup   `json:"result"`
	ResultInfo ResultInfo `json:"result_info"`
}

WAFGroupResponse represents the response from the WAF group endpoint.

type WAFGroupsResponse added in v0.10.0

type WAFGroupsResponse struct {
	Response
	Result     []WAFGroup `json:"result"`
	ResultInfo ResultInfo `json:"result_info"`
}

WAFGroupsResponse represents the response from the WAF groups endpoint.

type WAFOverride added in v0.11.1

type WAFOverride struct {
	ID            string            `json:"id,omitempty"`
	Description   string            `json:"description"`
	URLs          []string          `json:"urls"`
	Priority      int               `json:"priority"`
	Groups        map[string]string `json:"groups"`
	RewriteAction map[string]string `json:"rewrite_action"`
	Rules         map[string]string `json:"rules"`
	Paused        bool              `json:"paused"`
}

WAFOverride represents a WAF override.

type WAFOverrideResponse added in v0.11.1

type WAFOverrideResponse struct {
	Response
	Result     WAFOverride `json:"result"`
	ResultInfo ResultInfo  `json:"result_info"`
}

WAFOverrideResponse represents the response form the WAF override endpoint.

type WAFOverridesResponse added in v0.11.1

type WAFOverridesResponse struct {
	Response
	Result     []WAFOverride `json:"result"`
	ResultInfo ResultInfo    `json:"result_info"`
}

WAFOverridesResponse represents the response form the WAF overrides endpoint.

type WAFPackage added in v0.7.2

type WAFPackage struct {
	ID            string `json:"id"`
	Name          string `json:"name"`
	Description   string `json:"description"`
	ZoneID        string `json:"zone_id"`
	DetectionMode string `json:"detection_mode"`
	Sensitivity   string `json:"sensitivity"`
	ActionMode    string `json:"action_mode"`
}

WAFPackage represents a WAF package configuration.

type WAFPackageOptions added in v0.10.0

type WAFPackageOptions struct {
	Sensitivity string `json:"sensitivity,omitempty"`
	ActionMode  string `json:"action_mode,omitempty"`
}

WAFPackageOptions represents options to edit a WAF package.

type WAFPackageResponse added in v0.10.0

type WAFPackageResponse struct {
	Response
	Result     WAFPackage `json:"result"`
	ResultInfo ResultInfo `json:"result_info"`
}

WAFPackageResponse represents the response from the WAF package endpoint.

type WAFPackagesResponse added in v0.7.2

type WAFPackagesResponse struct {
	Response
	Result     []WAFPackage `json:"result"`
	ResultInfo ResultInfo   `json:"result_info"`
}

WAFPackagesResponse represents the response from the WAF packages endpoint.

type WAFRule added in v0.7.2

type WAFRule struct {
	ID          string `json:"id"`
	Description string `json:"description"`
	Priority    string `json:"priority"`
	PackageID   string `json:"package_id"`
	Group       struct {
		ID   string `json:"id"`
		Name string `json:"name"`
	} `json:"group"`
	Mode         string   `json:"mode"`
	DefaultMode  string   `json:"default_mode"`
	AllowedModes []string `json:"allowed_modes"`
}

WAFRule represents a WAF rule.

type WAFRuleOptions added in v0.9.0

type WAFRuleOptions struct {
	Mode string `json:"mode"`
}

WAFRuleOptions is a subset of WAFRule, for editable options.

type WAFRuleResponse added in v0.9.0

type WAFRuleResponse struct {
	Response
	Result     WAFRule    `json:"result"`
	ResultInfo ResultInfo `json:"result_info"`
}

WAFRuleResponse represents the response from the WAF rule endpoint.

type WAFRulesResponse added in v0.7.2

type WAFRulesResponse struct {
	Response
	Result     []WAFRule  `json:"result"`
	ResultInfo ResultInfo `json:"result_info"`
}

WAFRulesResponse represents the response from the WAF rules endpoint.

type WHOIS added in v0.44.0

type WHOIS struct {
	Domain            string   `json:"domain,omitempty"`
	CreatedDate       string   `json:"created_date,omitempty"`
	UpdatedDate       string   `json:"updated_date,omitempty"`
	Registrant        string   `json:"registrant,omitempty"`
	RegistrantOrg     string   `json:"registrant_org,omitempty"`
	RegistrantCountry string   `json:"registrant_country,omitempty"`
	RegistrantEmail   string   `json:"registrant_email,omitempty"`
	Registrar         string   `json:"registrar,omitempty"`
	Nameservers       []string `json:"nameservers,omitempty"`
}

WHOIS represents whois information.

type WHOISParameters added in v0.44.0

type WHOISParameters struct {
	AccountID string `url:"-"`
	Domain    string `url:"domain"`
}

WHOISParameters represents parameters for a who is request.

type WHOISResponse added in v0.44.0

type WHOISResponse struct {
	Response
	Result WHOIS `json:"result,omitempty"`
}

WHOISResponse represents an API response for a whois request.

type WaitingRoom added in v0.17.0

type WaitingRoom struct {
	CreatedOn                  time.Time           `json:"created_on,omitempty"`
	ModifiedOn                 time.Time           `json:"modified_on,omitempty"`
	Path                       string              `json:"path"`
	Name                       string              `json:"name"`
	Description                string              `json:"description,omitempty"`
	QueueingMethod             string              `json:"queueing_method,omitempty"`
	CustomPageHTML             string              `json:"custom_page_html,omitempty"`
	DefaultTemplateLanguage    string              `json:"default_template_language,omitempty"`
	Host                       string              `json:"host"`
	ID                         string              `json:"id,omitempty"`
	NewUsersPerMinute          int                 `json:"new_users_per_minute"`
	TotalActiveUsers           int                 `json:"total_active_users"`
	SessionDuration            int                 `json:"session_duration"`
	QueueAll                   bool                `json:"queue_all"`
	DisableSessionRenewal      bool                `json:"disable_session_renewal"`
	Suspended                  bool                `json:"suspended"`
	JsonResponseEnabled        bool                `json:"json_response_enabled"`
	NextEventPrequeueStartTime *time.Time          `json:"next_event_prequeue_start_time,omitempty"`
	NextEventStartTime         *time.Time          `json:"next_event_start_time,omitempty"`
	CookieSuffix               string              `json:"cookie_suffix"`
	AdditionalRoutes           []*WaitingRoomRoute `json:"additional_routes,omitempty"`
	QueueingStatusCode         int                 `json:"queueing_status_code"`
}

WaitingRoom describes a WaitingRoom object.

type WaitingRoomDetailResponse added in v0.17.0

type WaitingRoomDetailResponse struct {
	Response
	Result WaitingRoom `json:"result"`
}

WaitingRoomDetailResponse is the API response, containing a single WaitingRoom.

type WaitingRoomEvent added in v0.33.0

type WaitingRoomEvent struct {
	EventEndTime          time.Time  `json:"event_end_time"`
	CreatedOn             time.Time  `json:"created_on,omitempty"`
	ModifiedOn            time.Time  `json:"modified_on,omitempty"`
	PrequeueStartTime     *time.Time `json:"prequeue_start_time,omitempty"`
	EventStartTime        time.Time  `json:"event_start_time"`
	Name                  string     `json:"name"`
	Description           string     `json:"description,omitempty"`
	QueueingMethod        string     `json:"queueing_method,omitempty"`
	ID                    string     `json:"id,omitempty"`
	CustomPageHTML        string     `json:"custom_page_html,omitempty"`
	NewUsersPerMinute     int        `json:"new_users_per_minute,omitempty"`
	TotalActiveUsers      int        `json:"total_active_users,omitempty"`
	SessionDuration       int        `json:"session_duration,omitempty"`
	DisableSessionRenewal *bool      `json:"disable_session_renewal,omitempty"`
	Suspended             bool       `json:"suspended"`
	ShuffleAtEventStart   bool       `json:"shuffle_at_event_start"`
}

WaitingRoomEvent describes a WaitingRoomEvent object.

type WaitingRoomEventDetailResponse added in v0.33.0

type WaitingRoomEventDetailResponse struct {
	Response
	Result WaitingRoomEvent `json:"result"`
}

WaitingRoomEventDetailResponse is the API response, containing a single WaitingRoomEvent.

type WaitingRoomEventsResponse added in v0.33.0

type WaitingRoomEventsResponse struct {
	Response
	Result []WaitingRoomEvent `json:"result"`
}

WaitingRoomEventsResponse is the API response, containing an array of WaitingRoomEvents.

type WaitingRoomPagePreviewCustomHTML added in v0.34.0

type WaitingRoomPagePreviewCustomHTML struct {
	CustomHTML string `json:"custom_html"`
}

WaitingRoomPagePreviewCustomHTML describes a WaitingRoomPagePreviewCustomHTML object.

type WaitingRoomPagePreviewResponse added in v0.34.0

type WaitingRoomPagePreviewResponse struct {
	Response
	Result WaitingRoomPagePreviewURL `json:"result"`
}

WaitingRoomPagePreviewResponse is the API response, containing the URL to a custom waiting room preview.

type WaitingRoomPagePreviewURL added in v0.34.0

type WaitingRoomPagePreviewURL struct {
	PreviewURL string `json:"preview_url"`
}

WaitingRoomPagePreviewURL describes a WaitingRoomPagePreviewURL object.

type WaitingRoomRoute added in v0.70.0

type WaitingRoomRoute struct {
	Host string `json:"host"`
	Path string `json:"path"`
}

WaitingRoomRoute describes a WaitingRoomRoute object.

type WaitingRoomRule added in v0.53.0

type WaitingRoomRule struct {
	ID          string     `json:"id,omitempty"`
	Version     string     `json:"version,omitempty"`
	Action      string     `json:"action"`
	Expression  string     `json:"expression"`
	Description string     `json:"description"`
	LastUpdated *time.Time `json:"last_updated,omitempty"`
	Enabled     *bool      `json:"enabled"`
}

type WaitingRoomRulesResponse added in v0.53.0

type WaitingRoomRulesResponse struct {
	Response
	Result []WaitingRoomRule `json:"result"`
}

WaitingRoomRulesResponse is the API response, containing an array of WaitingRoomRule.

type WaitingRoomSettings added in v0.67.0

type WaitingRoomSettings struct {
	// Whether to allow verified search engine crawlers to bypass all waiting rooms on this zone
	SearchEngineCrawlerBypass bool `json:"search_engine_crawler_bypass"`
}

WaitingRoomSettings describes zone-level waiting room settings.

type WaitingRoomSettingsResponse added in v0.67.0

type WaitingRoomSettingsResponse struct {
	Response
	Result WaitingRoomSettings `json:"result"`
}

WaitingRoomSettingsResponse is the API response, containing zone-level Waiting Room settings.

type WaitingRoomStatus added in v0.33.0

type WaitingRoomStatus struct {
	Status                    string `json:"status"`
	EventID                   string `json:"event_id"`
	EstimatedQueuedUsers      int    `json:"estimated_queued_users"`
	EstimatedTotalActiveUsers int    `json:"estimated_total_active_users"`
	MaxEstimatedTimeMinutes   int    `json:"max_estimated_time_minutes"`
}

WaitingRoomStatus describes the status of a waiting room.

type WaitingRoomStatusResponse added in v0.33.0

type WaitingRoomStatusResponse struct {
	Response
	Result WaitingRoomStatus `json:"result"`
}

WaitingRoomStatusResponse is the API response, containing the status of a waiting room.

type WaitingRoomsResponse added in v0.17.0

type WaitingRoomsResponse struct {
	Response
	Result []WaitingRoom `json:"result"`
}

WaitingRoomsResponse is the API response, containing an array of WaitingRooms.

type WarpRoutingConfig added in v0.43.0

type WarpRoutingConfig struct {
	Enabled bool `json:"enabled,omitempty"`
}

type Web3Hostname added in v0.45.0

type Web3Hostname struct {
	ID          string     `json:"id,omitempty"`
	Name        string     `json:"name,omitempty"`
	Description string     `json:"description,omitempty"`
	Status      string     `json:"status,omitempty"`
	Target      string     `json:"target,omitempty"`
	Dnslink     string     `json:"dnslink,omitempty"`
	CreatedOn   *time.Time `json:"created_on,omitempty"`
	ModifiedOn  *time.Time `json:"modified_on,omitempty"`
}

Web3Hostname represents a web3 hostname.

type Web3HostnameCreateParameters added in v0.45.0

type Web3HostnameCreateParameters struct {
	ZoneID      string
	Name        string `json:"name,omitempty"`
	Target      string `json:"target,omitempty"`
	Description string `json:"description,omitempty"`
	DNSLink     string `json:"dnslink,omitempty"`
}

Web3HostnameCreateParameters represents the parameters for creating a web3 hostname.

type Web3HostnameDeleteResponse

type Web3HostnameDeleteResponse struct {
	Response
	Result Web3HostnameDeleteResult `json:"result,omitempty"`
}

Web3HostnameDeleteResponse represents the API response body for deleting a web3 hostname.

type Web3HostnameDeleteResult added in v0.45.0

type Web3HostnameDeleteResult struct {
	ID string `json:"id,omitempty"`
}

Web3HostnameDeleteResult represents the result of deleting a web3 hostname.

type Web3HostnameDetailsParameters added in v0.45.0

type Web3HostnameDetailsParameters struct {
	ZoneID     string
	Identifier string
}

Web3HostnameDetailsParameters represents the parameters for getting a single web3 hostname.

type Web3HostnameListParameters added in v0.45.0

type Web3HostnameListParameters struct {
	ZoneID string
}

Web3HostnameListParameters represents the parameters for listing web3 hostnames.

type Web3HostnameListResponse

type Web3HostnameListResponse struct {
	Response
	Result []Web3Hostname `json:"result"`
}

Web3HostnameListResponse represents the API response body for listing web3 hostnames.

type Web3HostnameResponse added in v0.45.0

type Web3HostnameResponse struct {
	Response
	Result Web3Hostname `json:"result,omitempty"`
}

Web3HostnameResponse represents an API response body for a web3 hostname.

type Web3HostnameUpdateParameters added in v0.45.0

type Web3HostnameUpdateParameters struct {
	ZoneID      string
	Identifier  string
	Description string `json:"description,omitempty"`
	DNSLink     string `json:"dnslink,omitempty"`
}

Web3HostnameUpdateParameters represents the parameters for editing a web3 hostname.

type WebAnalyticsIDResponse added in v0.75.0

type WebAnalyticsIDResponse struct {
	Response
	Result struct {
		ID string `json:"id"`
	} `json:"result"`
}

WebAnalyticsIDResponse is the API response, containing a single ID.

type WebAnalyticsRule added in v0.75.0

type WebAnalyticsRule struct {
	ID    string   `json:"id,omitempty"`
	Host  string   `json:"host"`
	Paths []string `json:"paths"`
	// Inclusive defines whether the rule includes or excludes the matched traffic from being measured in web analytics.
	Inclusive bool       `json:"inclusive"`
	Created   *time.Time `json:"created,omitempty"`
	// IsPaused defines whether the rule is paused (inactive) or not.
	IsPaused bool `json:"is_paused"`
	Priority int  `json:"priority,omitempty"`
}

WebAnalyticsRule describes a Web Analytics Rule object.

type WebAnalyticsRuleResponse added in v0.75.0

type WebAnalyticsRuleResponse struct {
	Response
	Result WebAnalyticsRule `json:"result"`
}

WebAnalyticsRuleResponse is the API response, containing a single WebAnalyticsRule.

type WebAnalyticsRulesResponse added in v0.75.0

type WebAnalyticsRulesResponse struct {
	Response
	Result WebAnalyticsRulesetRules `json:"result"`
}

WebAnalyticsRulesResponse is the API response, containing a WebAnalyticsRuleset and array of WebAnalyticsRule.

type WebAnalyticsRuleset added in v0.75.0

type WebAnalyticsRuleset struct {
	ID       string `json:"id"`
	ZoneTag  string `json:"zone_tag"`
	ZoneName string `json:"zone_name"`
	Enabled  bool   `json:"enabled"`
}

WebAnalyticsRuleset describes a Web Analytics Ruleset object.

type WebAnalyticsRulesetRules added in v0.75.0

type WebAnalyticsRulesetRules struct {
	Ruleset WebAnalyticsRuleset `json:"ruleset"`
	Rules   []WebAnalyticsRule  `json:"rules"`
}

type WebAnalyticsSite added in v0.75.0

type WebAnalyticsSite struct {
	SiteTag   string     `json:"site_tag"`
	SiteToken string     `json:"site_token"`
	Created   *time.Time `json:"created,omitempty"`
	// Snippet is an encoded JS script to insert into your site HTML.
	Snippet string `json:"snippet"`
	// AutoInstall defines whether Cloudflare will inject the JS snippet automatically for orange-clouded sites.
	AutoInstall bool                `json:"auto_install"`
	Ruleset     WebAnalyticsRuleset `json:"ruleset"`
	Rules       []WebAnalyticsRule  `json:"rules"`
}

WebAnalyticsSite describes a Web Analytics Site object.

type WebAnalyticsSiteResponse added in v0.75.0

type WebAnalyticsSiteResponse struct {
	Response
	Result WebAnalyticsSite `json:"result"`
}

WebAnalyticsSiteResponse is the API response, containing a single WebAnalyticsSite.

type WebAnalyticsSiteTagResponse added in v0.75.0

type WebAnalyticsSiteTagResponse struct {
	Response
	Result struct {
		SiteTag string `json:"site_tag"`
	} `json:"result"`
}

WebAnalyticsSiteTagResponse is the API response, containing a single ID.

type WebAnalyticsSitesResponse added in v0.75.0

type WebAnalyticsSitesResponse struct {
	Response
	ResultInfo ResultInfo         `json:"result_info"`
	Result     []WebAnalyticsSite `json:"result"`
}

WebAnalyticsSitesResponse is the API response, containing an array of WebAnalyticsSite.

type WorkerAnalyticsEngineBinding added in v0.56.0

type WorkerAnalyticsEngineBinding struct {
	Dataset string
}

WorkerAnalyticsEngineBinding is a binding to an Analytics Engine dataset.

func (WorkerAnalyticsEngineBinding) Type added in v0.56.0

Type returns the type of the binding.

type WorkerBinding added in v0.10.7

type WorkerBinding interface {
	Type() WorkerBindingType
	// contains filtered or unexported methods
}

WorkerBinding is the generic interface implemented by all of the various binding types.

type WorkerBindingListItem added in v0.10.7

type WorkerBindingListItem struct {
	Name    string `json:"name"`
	Binding WorkerBinding
}

WorkerBindingListItem a struct representing an individual binding in a list of bindings.

type WorkerBindingListResponse added in v0.10.7

type WorkerBindingListResponse struct {
	Response
	BindingList []WorkerBindingListItem
}

WorkerBindingListResponse wrapper struct for API response to worker binding list API call.

type WorkerBindingType added in v0.10.7

type WorkerBindingType string

WorkerBindingType represents a particular type of binding.

const (
	// WorkerDurableObjectBindingType is the type for Durable Object bindings.
	WorkerDurableObjectBindingType WorkerBindingType = "durable_object_namespace"
	// WorkerInheritBindingType is the type for inherited bindings.
	WorkerInheritBindingType WorkerBindingType = "inherit"
	// WorkerKvNamespaceBindingType is the type for KV Namespace bindings.
	WorkerKvNamespaceBindingType WorkerBindingType = "kv_namespace"
	// WorkerWebAssemblyBindingType is the type for Web Assembly module bindings.
	WorkerWebAssemblyBindingType WorkerBindingType = "wasm_module"
	// WorkerSecretTextBindingType is the type for secret text bindings.
	WorkerSecretTextBindingType WorkerBindingType = "secret_text"
	// WorkerPlainTextBindingType is the type for plain text bindings.
	WorkerPlainTextBindingType WorkerBindingType = "plain_text"
	// WorkerServiceBindingType is the type for service bindings.
	WorkerServiceBindingType WorkerBindingType = "service"
	// WorkerR2BucketBindingType is the type for R2 bucket bindings.
	WorkerR2BucketBindingType WorkerBindingType = "r2_bucket"
	// WorkerAnalyticsEngineBindingType is the type for Analytics Engine dataset bindings.
	WorkerAnalyticsEngineBindingType WorkerBindingType = "analytics_engine"
	// WorkerQueueBindingType is the type for queue bindings.
	WorkerQueueBindingType WorkerBindingType = "queue"
	// DispatchNamespaceBindingType is the type for WFP namespace bindings.
	DispatchNamespaceBindingType WorkerBindingType = "dispatch_namespace"
	// WorkerD1DataseBindingType is for D1 databases.
	WorkerD1DataseBindingType WorkerBindingType = "d1"
)

func (WorkerBindingType) String added in v0.10.7

func (b WorkerBindingType) String() string

type WorkerCronTrigger added in v0.13.8

type WorkerCronTrigger struct {
	Cron       string     `json:"cron"`
	CreatedOn  *time.Time `json:"created_on,omitempty"`
	ModifiedOn *time.Time `json:"modified_on,omitempty"`
}

WorkerCronTrigger holds an individual cron schedule for a worker.

type WorkerCronTriggerResponse added in v0.13.8

type WorkerCronTriggerResponse struct {
	Response
	Result WorkerCronTriggerSchedules `json:"result"`
}

WorkerCronTriggerResponse represents the response from the Worker cron trigger API endpoint.

type WorkerCronTriggerSchedules added in v0.13.8

type WorkerCronTriggerSchedules struct {
	Schedules []WorkerCronTrigger `json:"schedules"`
}

WorkerCronTriggerSchedules contains the schedule of Worker cron triggers.

type WorkerD1DatabaseBinding added in v0.83.0

type WorkerD1DatabaseBinding struct {
	DatabaseID string
}

WorkerD1DatabaseBinding is a binding to a D1 instance.

func (WorkerD1DatabaseBinding) Type added in v0.83.0

Type returns the type of the binding.

type WorkerDurableObjectBinding added in v0.43.0

type WorkerDurableObjectBinding struct {
	ClassName  string
	ScriptName string
}

WorkerDurableObjectBinding is a binding to a Workers Durable Object.

https://api.cloudflare.com/#durable-objects-namespace-properties

func (WorkerDurableObjectBinding) Type added in v0.43.0

Type returns the type of the binding.

type WorkerInheritBinding added in v0.10.7

type WorkerInheritBinding struct {
	// Optional parameter that allows for renaming a binding without changing
	// its contents. If `OldName` is empty, the binding name will not be changed.
	OldName string
}

WorkerInheritBinding will just persist whatever binding content was previously uploaded.

func (WorkerInheritBinding) Type added in v0.10.7

Type returns the type of the binding.

type WorkerKvNamespaceBinding added in v0.10.7

type WorkerKvNamespaceBinding struct {
	NamespaceID string
}

WorkerKvNamespaceBinding is a binding to a Workers KV Namespace.

https://developers.cloudflare.com/workers/archive/api/resource-bindings/kv-namespaces/

func (WorkerKvNamespaceBinding) Type added in v0.10.7

Type returns the type of the binding.

type WorkerListResponse added in v0.9.0

type WorkerListResponse struct {
	Response
	ResultInfo
	WorkerList []WorkerMetaData `json:"result"`
}

WorkerListResponse wrapper struct for API response to worker script list API call.

type WorkerMetaData added in v0.9.0

type WorkerMetaData struct {
	ID               string                 `json:"id,omitempty"`
	ETAG             string                 `json:"etag,omitempty"`
	Size             int                    `json:"size,omitempty"`
	CreatedOn        time.Time              `json:"created_on,omitempty"`
	ModifiedOn       time.Time              `json:"modified_on,omitempty"`
	Logpush          *bool                  `json:"logpush,omitempty"`
	TailConsumers    *[]WorkersTailConsumer `json:"tail_consumers,omitempty"`
	LastDeployedFrom *string                `json:"last_deployed_from,omitempty"`
	DeploymentId     *string                `json:"deployment_id,omitempty"`
	PlacementMode    *PlacementMode         `json:"placement_mode,omitempty"`
	PipelineHash     *string                `json:"pipeline_hash,omitempty"`
}

WorkerMetaData contains worker script information such as size, creation & modification dates.

type WorkerPlainTextBinding added in v0.12.0

type WorkerPlainTextBinding struct {
	Text string
}

WorkerPlainTextBinding is a binding to plain text.

https://developers.cloudflare.com/workers/tooling/api/scripts/#add-a-plain-text-binding

func (WorkerPlainTextBinding) Type added in v0.12.0

Type returns the type of the binding.

type WorkerQueueBinding added in v0.59.0

type WorkerQueueBinding struct {
	Binding string
	Queue   string
}

WorkerQueueBinding is a binding to a Workers Queue.

https://developers.cloudflare.com/workers/platform/bindings/#queue-bindings

func (WorkerQueueBinding) Type added in v0.59.0

Type returns the type of the binding.

type WorkerR2BucketBinding added in v0.44.0

type WorkerR2BucketBinding struct {
	BucketName string
}

WorkerR2BucketBinding is a binding to an R2 bucket.

func (WorkerR2BucketBinding) Type added in v0.44.0

Type returns the type of the binding.

type WorkerReference added in v0.74.0

type WorkerReference struct {
	Service     string
	Environment *string
}

type WorkerRequestParams added in v0.9.0

type WorkerRequestParams struct {
	ZoneID     string
	ScriptName string
}

WorkerRequestParams provides parameters for worker requests for both enterprise and standard requests.

type WorkerRoute added in v0.9.0

type WorkerRoute struct {
	ID         string `json:"id,omitempty"`
	Pattern    string `json:"pattern"`
	ScriptName string `json:"script,omitempty"`
}

WorkerRoute is used to map traffic matching a URL pattern to a workers

API reference: https://api.cloudflare.com/#worker-routes-properties

type WorkerRouteResponse added in v0.9.0

type WorkerRouteResponse struct {
	Response
	WorkerRoute `json:"result"`
}

WorkerRouteResponse embeds Response struct and a single WorkerRoute.

type WorkerRoutesResponse added in v0.9.0

type WorkerRoutesResponse struct {
	Response
	Routes []WorkerRoute `json:"result"`
}

WorkerRoutesResponse embeds Response struct and slice of WorkerRoutes.

type WorkerScript added in v0.9.0

type WorkerScript struct {
	WorkerMetaData
	Script     string `json:"script"`
	UsageModel string `json:"usage_model,omitempty"`
}

WorkerScript Cloudflare Worker struct with metadata.

type WorkerScriptParams added in v0.10.7

type WorkerScriptParams struct {
	ScriptName string

	// Module changes the Content-Type header to specify the script is an
	// ES Module syntax script.
	Module bool

	// Bindings should be a map where the keys are the binding name, and the
	// values are the binding content
	Bindings map[string]WorkerBinding
}

WorkerScriptParams provides a worker script and the associated bindings.

type WorkerScriptResponse added in v0.9.0

type WorkerScriptResponse struct {
	Response
	Module       bool
	WorkerScript `json:"result"`
}

WorkerScriptResponse wrapper struct for API response to worker script calls.

type WorkerScriptSettingsResponse added in v0.76.0

type WorkerScriptSettingsResponse struct {
	Response
	WorkerMetaData
}

WorkerScriptSettingsResponse wrapper struct for API response to worker script settings calls.

type WorkerSecretTextBinding added in v0.12.0

type WorkerSecretTextBinding struct {
	Text string
}

WorkerSecretTextBinding is a binding to secret text.

https://developers.cloudflare.com/workers/tooling/api/scripts/#add-a-secret-text-binding

func (WorkerSecretTextBinding) Type added in v0.12.0

Type returns the type of the binding.

type WorkerServiceBinding added in v0.43.0

type WorkerServiceBinding struct {
	Service     string
	Environment *string
}

func (WorkerServiceBinding) Type added in v0.43.0

type WorkerWebAssemblyBinding added in v0.10.7

type WorkerWebAssemblyBinding struct {
	Module io.Reader
}

WorkerWebAssemblyBinding is a binding to a WebAssembly module.

https://developers.cloudflare.com/workers/archive/api/resource-bindings/webassembly-modules/

func (WorkerWebAssemblyBinding) Type added in v0.10.7

Type returns the type of the binding.

type WorkersAccountSettings added in v0.47.0

type WorkersAccountSettings struct {
	DefaultUsageModel string `json:"default_usage_model,omitempty"`
	GreenCompute      bool   `json:"green_compute,omitempty"`
}

type WorkersAccountSettingsParameters added in v0.47.0

type WorkersAccountSettingsParameters struct{}

type WorkersAccountSettingsResponse added in v0.47.0

type WorkersAccountSettingsResponse struct {
	Response
	Result WorkersAccountSettings
}

type WorkersDomain added in v0.55.0

type WorkersDomain struct {
	ID          string `json:"id,omitempty"`
	ZoneID      string `json:"zone_id,omitempty"`
	ZoneName    string `json:"zone_name,omitempty"`
	Hostname    string `json:"hostname,omitempty"`
	Service     string `json:"service,omitempty"`
	Environment string `json:"environment,omitempty"`
}

type WorkersDomainListResponse added in v0.55.0

type WorkersDomainListResponse struct {
	Response
	Result []WorkersDomain `json:"result"`
}

type WorkersDomainResponse added in v0.55.0

type WorkersDomainResponse struct {
	Response
	Result WorkersDomain `json:"result"`
}

type WorkersForPlatformsDispatchNamespace added in v0.90.0

type WorkersForPlatformsDispatchNamespace struct {
	NamespaceId   string     `json:"namespace_id"`
	NamespaceName string     `json:"namespace_name"`
	CreatedOn     *time.Time `json:"created_on,omitempty"`
	CreatedBy     string     `json:"created_by"`
	ModifiedOn    *time.Time `json:"modified_on,omitempty"`
	ModifiedBy    string     `json:"modified_by"`
}

type WorkersKVNamespace added in v0.9.0

type WorkersKVNamespace struct {
	ID    string `json:"id"`
	Title string `json:"title"`
}

WorkersKVNamespace contains the unique identifier and title of a storage namespace.

type WorkersKVNamespaceResponse added in v0.9.0

type WorkersKVNamespaceResponse struct {
	Response
	Result WorkersKVNamespace `json:"result"`
}

WorkersKVNamespaceResponse is the response received when creating storage namespaces.

type WorkersKVPair added in v0.10.7

type WorkersKVPair struct {
	Key           string      `json:"key"`
	Value         string      `json:"value"`
	Expiration    int         `json:"expiration,omitempty"`
	ExpirationTTL int         `json:"expiration_ttl,omitempty"`
	Metadata      interface{} `json:"metadata,omitempty"`
	Base64        bool        `json:"base64,omitempty"`
}

WorkersKVPair is used in an array in the request to the bulk KV api.

type WorkersListSecretsResponse added in v0.13.1

type WorkersListSecretsResponse struct {
	Response
	Result []WorkersSecret `json:"result"`
}

WorkersListSecretsResponse is the response received when listing secrets.

type WorkersPutSecretRequest added in v0.13.1

type WorkersPutSecretRequest struct {
	Name string            `json:"name"`
	Text string            `json:"text"`
	Type WorkerBindingType `json:"type"`
}

WorkersPutSecretRequest provides parameters for creating and updating secrets.

type WorkersPutSecretResponse added in v0.13.1

type WorkersPutSecretResponse struct {
	Response
	Result WorkersSecret `json:"result"`
}

WorkersPutSecretResponse is the response received when creating or updating a secret.

type WorkersSecret added in v0.13.1

type WorkersSecret struct {
	Name string `json:"name"`
	Type string `json:"secret_text"`
}

WorkersSecret contains the name and type of the secret.

type WorkersSubdomain added in v0.47.0

type WorkersSubdomain struct {
	Name string `json:"name,omitempty"`
}

type WorkersSubdomainResponse added in v0.47.0

type WorkersSubdomainResponse struct {
	Response
	Result WorkersSubdomain
}

type WorkersTail added in v0.47.0

type WorkersTail struct {
	ID        string     `json:"id"`
	URL       string     `json:"url"`
	ExpiresAt *time.Time `json:"expires_at"`
}

type WorkersTailConsumer added in v0.71.0

type WorkersTailConsumer struct {
	Service     string  `json:"service"`
	Environment *string `json:"environment,omitempty"`
	Namespace   *string `json:"namespace,omitempty"`
}

type WriteWorkersKVEntriesParams added in v0.55.0

type WriteWorkersKVEntriesParams struct {
	NamespaceID string
	KVs         []*WorkersKVPair
}

type WriteWorkersKVEntryParams added in v0.55.0

type WriteWorkersKVEntryParams struct {
	NamespaceID string
	Key         string
	Value       []byte
}

type ZarazAction added in v0.89.0

type ZarazAction struct {
	BlockingTriggers []string       `json:"blockingTriggers"`
	FiringTriggers   []string       `json:"firingTriggers"`
	Data             map[string]any `json:"data"`
	ActionType       string         `json:"actionType,omitempty"`
}

type ZarazButtonTextTranslations added in v0.86.0

type ZarazButtonTextTranslations struct {
	AcceptAll        map[string]string `json:"accept_all"`
	RejectAll        map[string]string `json:"reject_all"`
	ConfirmMyChoices map[string]string `json:"confirm_my_choices"`
}

type ZarazConfig added in v0.86.0

type ZarazConfig struct {
	DebugKey      string                   `json:"debugKey"`
	Tools         map[string]ZarazTool     `json:"tools"`
	Triggers      map[string]ZarazTrigger  `json:"triggers"`
	ZarazVersion  int64                    `json:"zarazVersion"`
	Consent       ZarazConsent             `json:"consent,omitempty"`
	DataLayer     *bool                    `json:"dataLayer,omitempty"`
	Dlp           []any                    `json:"dlp,omitempty"`
	HistoryChange *bool                    `json:"historyChange,omitempty"`
	Settings      ZarazConfigSettings      `json:"settings,omitempty"`
	Variables     map[string]ZarazVariable `json:"variables,omitempty"`
}

type ZarazConfigHistoryListResponse added in v0.86.0

type ZarazConfigHistoryListResponse struct {
	Result []ZarazHistoryRecord `json:"result"`
	Response
	ResultInfo `json:"result_info"`
}

type ZarazConfigResponse added in v0.86.0

type ZarazConfigResponse struct {
	Result ZarazConfig `json:"result"`
	Response
}

type ZarazConfigSettings added in v0.86.0

type ZarazConfigSettings struct {
	AutoInjectScript    *bool       `json:"autoInjectScript"`
	InjectIframes       *bool       `json:"injectIframes,omitempty"`
	Ecommerce           *bool       `json:"ecommerce,omitempty"`
	HideQueryParams     *bool       `json:"hideQueryParams,omitempty"`
	HideIpAddress       *bool       `json:"hideIPAddress,omitempty"`
	HideUserAgent       *bool       `json:"hideUserAgent,omitempty"`
	HideExternalReferer *bool       `json:"hideExternalReferer,omitempty"`
	CookieDomain        string      `json:"cookieDomain,omitempty"`
	InitPath            string      `json:"initPath,omitempty"`
	ScriptPath          string      `json:"scriptPath,omitempty"`
	TrackPath           string      `json:"trackPath,omitempty"`
	EventsApiPath       string      `json:"eventsApiPath,omitempty"`
	McRootPath          string      `json:"mcRootPath,omitempty"`
	ContextEnricher     ZarazWorker `json:"contextEnricher,omitempty"`
}

type ZarazConsent added in v0.86.0

type ZarazConsent struct {
	Enabled                               *bool                                   `json:"enabled"`
	ButtonTextTranslations                ZarazButtonTextTranslations             `json:"buttonTextTranslations,omitempty"`
	CompanyEmail                          string                                  `json:"companyEmail,omitempty"`
	CompanyName                           string                                  `json:"companyName,omitempty"`
	CompanyStreetAddress                  string                                  `json:"companyStreetAddress,omitempty"`
	ConsentModalIntroHTML                 string                                  `json:"consentModalIntroHTML,omitempty"`
	ConsentModalIntroHTMLWithTranslations map[string]string                       `json:"consentModalIntroHTMLWithTranslations,omitempty"`
	CookieName                            string                                  `json:"cookieName,omitempty"`
	CustomCSS                             string                                  `json:"customCSS,omitempty"`
	CustomIntroDisclaimerDismissed        *bool                                   `json:"customIntroDisclaimerDismissed,omitempty"`
	DefaultLanguage                       string                                  `json:"defaultLanguage,omitempty"`
	HideModal                             *bool                                   `json:"hideModal,omitempty"`
	Purposes                              map[string]ZarazPurpose                 `json:"purposes,omitempty"`
	PurposesWithTranslations              map[string]ZarazPurposeWithTranslations `json:"purposesWithTranslations,omitempty"`
}

type ZarazHistoryRecord added in v0.86.0

type ZarazHistoryRecord struct {
	ID          int64      `json:"id,omitempty"`
	UserID      string     `json:"userId,omitempty"`
	Description string     `json:"description,omitempty"`
	CreatedAt   *time.Time `json:"createdAt,omitempty"`
	UpdatedAt   *time.Time `json:"updatedAt,omitempty"`
}

type ZarazLoadRuleOp added in v0.86.0

type ZarazLoadRuleOp string

type ZarazNeoEvent deprecated added in v0.86.0

type ZarazNeoEvent struct {
	BlockingTriggers []string       `json:"blockingTriggers"`
	FiringTriggers   []string       `json:"firingTriggers"`
	Data             map[string]any `json:"data"`
	ActionType       string         `json:"actionType,omitempty"`
}

Deprecated: To be removed pending migration of existing configs.

type ZarazPublishResponse added in v0.86.0

type ZarazPublishResponse struct {
	Result string `json:"result"`
	Response
}

type ZarazPurpose added in v0.86.0

type ZarazPurpose struct {
	Name        string `json:"name"`
	Description string `json:"description"`
}

type ZarazPurposeWithTranslations added in v0.86.0

type ZarazPurposeWithTranslations struct {
	Name        map[string]string `json:"name"`
	Description map[string]string `json:"description"`
	Order       int               `json:"order"`
}

type ZarazRuleSettings added in v0.86.0

type ZarazRuleSettings struct {
	Type        ZarazSelectorType `json:"type,omitempty"`
	Selector    string            `json:"selector,omitempty"`
	WaitForTags int               `json:"waitForTags,omitempty"`
	Interval    int               `json:"interval,omitempty"`
	Limit       int               `json:"limit,omitempty"`
	Validate    *bool             `json:"validate,omitempty"`
	Variable    string            `json:"variable,omitempty"`
	Match       string            `json:"match,omitempty"`
	Positions   string            `json:"positions,omitempty"`
	Op          ZarazLoadRuleOp   `json:"op,omitempty"`
	Value       string            `json:"value,omitempty"`
}

type ZarazRuleType added in v0.86.0

type ZarazRuleType string
const (
	ZarazClickListener     ZarazRuleType = "clickListener"
	ZarazTimer             ZarazRuleType = "timer"
	ZarazFormSubmission    ZarazRuleType = "formSubmission"
	ZarazVariableMatch     ZarazRuleType = "variableMatch"
	ZarazScrollDepth       ZarazRuleType = "scrollDepth"
	ZarazElementVisibility ZarazRuleType = "elementVisibility"
	ZarazClientEval        ZarazRuleType = "clientEval"
)

type ZarazSelectorType added in v0.86.0

type ZarazSelectorType string
const (
	ZarazXPath ZarazSelectorType = "xpath"
	ZarazCSS   ZarazSelectorType = "css"
)

type ZarazTool added in v0.86.0

type ZarazTool struct {
	BlockingTriggers []string               `json:"blockingTriggers"`
	Enabled          *bool                  `json:"enabled"`
	DefaultFields    map[string]any         `json:"defaultFields"`
	Name             string                 `json:"name"`
	NeoEvents        []ZarazNeoEvent        `json:"neoEvents"`
	Actions          map[string]ZarazAction `json:"actions"`
	Type             ZarazToolType          `json:"type"`
	DefaultPurpose   string                 `json:"defaultPurpose,omitempty"`
	Library          string                 `json:"library,omitempty"`
	Component        string                 `json:"component,omitempty"`
	Permissions      []string               `json:"permissions"`
	Settings         map[string]any         `json:"settings"`
	Worker           ZarazWorker            `json:"worker,omitempty"`
}

type ZarazToolType added in v0.86.0

type ZarazToolType string
const (
	ZarazToolLibrary   ZarazToolType = "library"
	ZarazToolComponent ZarazToolType = "component"
	ZarazToolCustomMc  ZarazToolType = "custom-mc"
)

type ZarazTrigger added in v0.86.0

type ZarazTrigger struct {
	Name         string             `json:"name"`
	Description  string             `json:"description,omitempty"`
	LoadRules    []ZarazTriggerRule `json:"loadRules"`
	ExcludeRules []ZarazTriggerRule `json:"excludeRules"`
	ClientRules  []any              `json:"clientRules,omitempty"` // what is this?
	System       ZarazTriggerSystem `json:"system,omitempty"`
}

type ZarazTriggerRule added in v0.86.0

type ZarazTriggerRule struct {
	Id       string            `json:"id"`
	Match    string            `json:"match,omitempty"`
	Op       ZarazLoadRuleOp   `json:"op,omitempty"`
	Value    string            `json:"value,omitempty"`
	Action   ZarazRuleType     `json:"action"`
	Settings ZarazRuleSettings `json:"settings"`
}

type ZarazTriggerSystem added in v0.86.0

type ZarazTriggerSystem string
const ZarazPageload ZarazTriggerSystem = "pageload"

type ZarazVariable added in v0.86.0

type ZarazVariable struct {
	Name  string            `json:"name"`
	Type  ZarazVariableType `json:"type"`
	Value interface{}       `json:"value"`
}

type ZarazVariableType added in v0.86.0

type ZarazVariableType string
const (
	ZarazVarString ZarazVariableType = "string"
	ZarazVarSecret ZarazVariableType = "secret"
	ZarazVarWorker ZarazVariableType = "worker"
)

type ZarazWorker added in v0.86.0

type ZarazWorker struct {
	EscapedWorkerName string `json:"escapedWorkerName"`
	WorkerTag         string `json:"workerTag"`
	MutableId         string `json:"mutableId,omitempty"`
}

type ZarazWorkflowResponse added in v0.86.0

type ZarazWorkflowResponse struct {
	Result string `json:"result"`
	Response
}

type Zone added in v0.7.2

type Zone struct {
	ID   string `json:"id"`
	Name string `json:"name"`
	// DevMode contains the time in seconds until development expires (if
	// positive) or since it expired (if negative). It will be 0 if never used.
	DevMode           int       `json:"development_mode"`
	OriginalNS        []string  `json:"original_name_servers"`
	OriginalRegistrar string    `json:"original_registrar"`
	OriginalDNSHost   string    `json:"original_dnshost"`
	CreatedOn         time.Time `json:"created_on"`
	ModifiedOn        time.Time `json:"modified_on"`
	NameServers       []string  `json:"name_servers"`
	Owner             Owner     `json:"owner"`
	Permissions       []string  `json:"permissions"`
	Plan              ZonePlan  `json:"plan"`
	PlanPending       ZonePlan  `json:"plan_pending,omitempty"`
	Status            string    `json:"status"`
	Paused            bool      `json:"paused"`
	Type              string    `json:"type"`
	Host              struct {
		Name    string
		Website string
	} `json:"host"`
	VanityNS        []string `json:"vanity_name_servers"`
	Betas           []string `json:"betas"`
	DeactReason     string   `json:"deactivation_reason"`
	Meta            ZoneMeta `json:"meta"`
	Account         Account  `json:"account"`
	VerificationKey string   `json:"verification_key"`
}

Zone describes a Cloudflare zone.

type ZoneAnalytics added in v0.7.2

type ZoneAnalytics struct {
	Since    time.Time `json:"since"`
	Until    time.Time `json:"until"`
	Requests struct {
		All         int            `json:"all"`
		Cached      int            `json:"cached"`
		Uncached    int            `json:"uncached"`
		ContentType map[string]int `json:"content_type"`
		Country     map[string]int `json:"country"`
		SSL         struct {
			Encrypted   int `json:"encrypted"`
			Unencrypted int `json:"unencrypted"`
		} `json:"ssl"`
		HTTPStatus map[string]int `json:"http_status"`
	} `json:"requests"`
	Bandwidth struct {
		All         int            `json:"all"`
		Cached      int            `json:"cached"`
		Uncached    int            `json:"uncached"`
		ContentType map[string]int `json:"content_type"`
		Country     map[string]int `json:"country"`
		SSL         struct {
			Encrypted   int `json:"encrypted"`
			Unencrypted int `json:"unencrypted"`
		} `json:"ssl"`
	} `json:"bandwidth"`
	Threats struct {
		All     int            `json:"all"`
		Country map[string]int `json:"country"`
		Type    map[string]int `json:"type"`
	} `json:"threats"`
	Pageviews struct {
		All           int            `json:"all"`
		SearchEngines map[string]int `json:"search_engines"`
	} `json:"pageviews"`
	Uniques struct {
		All int `json:"all"`
	}
}

ZoneAnalytics contains analytics data for a zone.

type ZoneAnalyticsColocation added in v0.7.2

type ZoneAnalyticsColocation struct {
	ColocationID string          `json:"colo_id"`
	Timeseries   []ZoneAnalytics `json:"timeseries"`
}

ZoneAnalyticsColocation contains analytics data by datacenter.

type ZoneAnalyticsData added in v0.7.2

type ZoneAnalyticsData struct {
	Totals     ZoneAnalytics   `json:"totals"`
	Timeseries []ZoneAnalytics `json:"timeseries"`
}

ZoneAnalyticsData contains totals and timeseries analytics data for a zone.

type ZoneAnalyticsOptions added in v0.7.2

type ZoneAnalyticsOptions struct {
	Since      *time.Time
	Until      *time.Time
	Continuous *bool
}

ZoneAnalyticsOptions represents the optional parameters in Zone Analytics endpoint requests.

type ZoneCacheVariants added in v0.32.0

type ZoneCacheVariants struct {
	ModifiedOn time.Time               `json:"modified_on"`
	Value      ZoneCacheVariantsValues `json:"value"`
}

type ZoneCacheVariantsValues added in v0.32.0

type ZoneCacheVariantsValues struct {
	Avif []string `json:"avif,omitempty"`
	Bmp  []string `json:"bmp,omitempty"`
	Gif  []string `json:"gif,omitempty"`
	Jpeg []string `json:"jpeg,omitempty"`
	Jpg  []string `json:"jpg,omitempty"`
	Jpg2 []string `json:"jpg2,omitempty"`
	Jp2  []string `json:"jp2,omitempty"`
	Png  []string `json:"png,omitempty"`
	Tiff []string `json:"tiff,omitempty"`
	Tif  []string `json:"tif,omitempty"`
	Webp []string `json:"webp,omitempty"`
}

type ZoneCreateParams added in v0.36.0

type ZoneCreateParams struct {
	Name      string   `json:"name"`
	JumpStart bool     `json:"jump_start"`
	Type      string   `json:"type"`
	Account   *Account `json:"organization,omitempty"`
}

type ZoneCustomSSL added in v0.7.2

type ZoneCustomSSL struct {
	ID              string                        `json:"id"`
	Hosts           []string                      `json:"hosts"`
	Issuer          string                        `json:"issuer"`
	Signature       string                        `json:"signature"`
	Status          string                        `json:"status"`
	BundleMethod    string                        `json:"bundle_method"`
	GeoRestrictions *ZoneCustomSSLGeoRestrictions `json:"geo_restrictions,omitempty"`
	ZoneID          string                        `json:"zone_id"`
	UploadedOn      time.Time                     `json:"uploaded_on"`
	ModifiedOn      time.Time                     `json:"modified_on"`
	ExpiresOn       time.Time                     `json:"expires_on"`
	Priority        int                           `json:"priority"`
	KeylessServer   KeylessSSL                    `json:"keyless_server"`
}

ZoneCustomSSL represents custom SSL certificate metadata.

type ZoneCustomSSLGeoRestrictions added in v0.9.4

type ZoneCustomSSLGeoRestrictions struct {
	Label string `json:"label"`
}

ZoneCustomSSLGeoRestrictions represents the parameter to create or update geographic restrictions on a custom ssl certificate.

type ZoneCustomSSLOptions added in v0.7.2

type ZoneCustomSSLOptions struct {
	Certificate     string                        `json:"certificate"`
	PrivateKey      string                        `json:"private_key"`
	BundleMethod    string                        `json:"bundle_method,omitempty"`
	GeoRestrictions *ZoneCustomSSLGeoRestrictions `json:"geo_restrictions,omitempty"`
	Type            string                        `json:"type,omitempty"`
}

ZoneCustomSSLOptions represents the parameters to create or update an existing custom SSL configuration.

type ZoneCustomSSLPriority added in v0.7.2

type ZoneCustomSSLPriority struct {
	ID       string `json:"ID"`
	Priority int    `json:"priority"`
}

ZoneCustomSSLPriority represents a certificate's ID and priority. It is a subset of ZoneCustomSSL used for patch requests.

type ZoneDNSSEC added in v0.13.5

type ZoneDNSSEC struct {
	Status          string    `json:"status"`
	Flags           int       `json:"flags"`
	Algorithm       string    `json:"algorithm"`
	KeyType         string    `json:"key_type"`
	DigestType      string    `json:"digest_type"`
	DigestAlgorithm string    `json:"digest_algorithm"`
	Digest          string    `json:"digest"`
	DS              string    `json:"ds"`
	KeyTag          int       `json:"key_tag"`
	PublicKey       string    `json:"public_key"`
	ModifiedOn      time.Time `json:"modified_on"`
}

ZoneDNSSEC represents the response from the Zone DNSSEC Setting result.

type ZoneDNSSECDeleteResponse added in v0.13.5

type ZoneDNSSECDeleteResponse struct {
	Response
	Result string `json:"result"`
}

ZoneDNSSECDeleteResponse represents the response from the Zone DNSSEC Delete request.

type ZoneDNSSECResponse added in v0.13.5

type ZoneDNSSECResponse struct {
	Response
	Result ZoneDNSSEC `json:"result"`
}

ZoneDNSSECResponse represents the response from the Zone DNSSEC Setting.

type ZoneDNSSECUpdateOptions added in v0.13.5

type ZoneDNSSECUpdateOptions struct {
	Status string `json:"status"`
}

ZoneDNSSECUpdateOptions represents the options for DNSSEC update.

type ZoneHold added in v0.75.0

type ZoneHold struct {
	Hold              *bool      `json:"hold,omitempty"`
	IncludeSubdomains *bool      `json:"include_subdomains,omitempty"`
	HoldAfter         *time.Time `json:"hold_after,omitempty"`
}

Retrieve whether the zone is subject to a zone hold, and metadata about the hold.

type ZoneHoldResponse added in v0.75.0

type ZoneHoldResponse struct {
	Result ZoneHold `json:"result"`
	Response
	ResultInfo `json:"result_info"`
}

ZoneHoldResponse represents a response from the Zone Hold endpoint.

type ZoneID added in v0.7.2

type ZoneID struct {
	ID string `json:"id"`
}

ZoneID contains only the zone ID.

type ZoneIDResponse added in v0.7.2

type ZoneIDResponse struct {
	Response
	Result ZoneID `json:"result"`
}

ZoneIDResponse represents the response from the Zone endpoint, containing only a zone ID.

type ZoneListParams

type ZoneListParams struct {
	Match       string `url:"match,omitempty"`
	Name        string `url:"name,omitempty"`
	AccountName string `url:"account.name,omitempty"`
	Status      string `url:"status,omitempty"`
	AccountID   string `url:"account.id,omitempty"`
	Direction   string `url:"direction,omitempty"`

	ResultInfo // Rename `ResultInfo` in the next major version.
}

type ZoneLockdown added in v0.8.0

type ZoneLockdown struct {
	ID             string               `json:"id"`
	Description    string               `json:"description"`
	URLs           []string             `json:"urls"`
	Configurations []ZoneLockdownConfig `json:"configurations"`
	Paused         bool                 `json:"paused"`
	Priority       int                  `json:"priority,omitempty"`
	CreatedOn      *time.Time           `json:"created_on,omitempty"`
	ModifiedOn     *time.Time           `json:"modified_on,omitempty"`
}

ZoneLockdown represents a Zone Lockdown rule. A rule only permits access to the provided URL pattern(s) from the given IP address(es) or subnet(s).

type ZoneLockdownConfig added in v0.8.0

type ZoneLockdownConfig struct {
	Target string `json:"target"`
	Value  string `json:"value"`
}

ZoneLockdownConfig represents a Zone Lockdown config, which comprises a Target ("ip" or "ip_range") and a Value (an IP address or IP+mask, respectively.)

type ZoneLockdownCreateParams added in v0.47.0

type ZoneLockdownCreateParams struct {
	Description    string               `json:"description"`
	URLs           []string             `json:"urls"`
	Configurations []ZoneLockdownConfig `json:"configurations"`
	Paused         bool                 `json:"paused"`
	Priority       int                  `json:"priority,omitempty"`
}

ZoneLockdownCreateParams contains required and optional params for creating a zone lockdown.

type ZoneLockdownListResponse added in v0.8.0

type ZoneLockdownListResponse struct {
	Result []ZoneLockdown `json:"result"`
	Response
	ResultInfo `json:"result_info"`
}

ZoneLockdownListResponse represents a response from the List Zone Lockdown endpoint.

type ZoneLockdownResponse added in v0.8.0

type ZoneLockdownResponse struct {
	Result ZoneLockdown `json:"result"`
	Response
	ResultInfo `json:"result_info"`
}

ZoneLockdownResponse represents a response from the Zone Lockdown endpoint.

type ZoneLockdownUpdateParams added in v0.47.0

type ZoneLockdownUpdateParams struct {
	ID             string               `json:"id"`
	Description    string               `json:"description"`
	URLs           []string             `json:"urls"`
	Configurations []ZoneLockdownConfig `json:"configurations"`
	Paused         bool                 `json:"paused"`
	Priority       int                  `json:"priority,omitempty"`
}

ZoneLockdownUpdateParams contains required and optional params for updating a zone lockdown.

type ZoneMeta added in v0.7.2

type ZoneMeta struct {
	// custom_certificate_quota is broken - sometimes it's a string, sometimes a number!
	// CustCertQuota     int    `json:"custom_certificate_quota"`
	PageRuleQuota     int  `json:"page_rule_quota"`
	WildcardProxiable bool `json:"wildcard_proxiable"`
	PhishingDetected  bool `json:"phishing_detected"`
}

ZoneMeta describes metadata about a zone.

type ZoneOptions added in v0.7.2

type ZoneOptions struct {
	Paused   *bool     `json:"paused,omitempty"`
	VanityNS []string  `json:"vanity_name_servers,omitempty"`
	Plan     *ZonePlan `json:"plan,omitempty"`
	Type     string    `json:"type,omitempty"`
}

ZoneOptions is a subset of Zone, for editable options.

type ZonePlan added in v0.7.2

type ZonePlan struct {
	ZonePlanCommon
	LegacyID          string `json:"legacy_id"`
	IsSubscribed      bool   `json:"is_subscribed"`
	CanSubscribe      bool   `json:"can_subscribe"`
	LegacyDiscount    bool   `json:"legacy_discount"`
	ExternallyManaged bool   `json:"externally_managed"`
}

ZonePlan contains the plan information for a zone.

type ZonePlanCommon added in v0.9.0

type ZonePlanCommon struct {
	ID        string `json:"id"`
	Name      string `json:"name,omitempty"`
	Price     int    `json:"price,omitempty"`
	Currency  string `json:"currency,omitempty"`
	Frequency string `json:"frequency,omitempty"`
}

ZonePlanCommon contains fields used by various Plan endpoints.

type ZoneRatePlan added in v0.7.4

type ZoneRatePlan struct {
	ZonePlanCommon
	Components []zoneRatePlanComponents `json:"components,omitempty"`
}

ZoneRatePlan contains the plan information for a zone.

type ZoneRatePlanResponse added in v0.7.4

type ZoneRatePlanResponse struct {
	Response
	Result ZoneRatePlan `json:"result"`
}

ZoneRatePlanResponse represents the response from the Plan Details endpoint.

type ZoneResponse added in v0.7.2

type ZoneResponse struct {
	Response
	Result Zone `json:"result"`
}

ZoneResponse represents the response from the Zone endpoint containing a single zone.

type ZoneSSLSetting added in v0.7.4

type ZoneSSLSetting struct {
	ID                string `json:"id"`
	Editable          bool   `json:"editable"`
	ModifiedOn        string `json:"modified_on"`
	Value             string `json:"value"`
	CertificateStatus string `json:"certificate_status"`
}

ZoneSSLSetting contains ssl setting for a zone.

type ZoneSSLSettingResponse added in v0.7.4

type ZoneSSLSettingResponse struct {
	Response
	Result ZoneSSLSetting `json:"result"`
}

ZoneSSLSettingResponse represents the response from the Zone SSL Setting endpoint.

type ZoneSetting added in v0.7.2

type ZoneSetting struct {
	ID            string      `json:"id"`
	Editable      bool        `json:"editable"`
	ModifiedOn    string      `json:"modified_on,omitempty"`
	Value         interface{} `json:"value"`
	TimeRemaining int         `json:"time_remaining"`
}

ZoneSetting contains settings for a zone.

type ZoneSettingResponse added in v0.7.2

type ZoneSettingResponse struct {
	Response
	Result []ZoneSetting `json:"result"`
}

ZoneSettingResponse represents the response from the Zone Setting endpoint.

type ZoneSettingSingleResponse added in v0.10.2

type ZoneSettingSingleResponse struct {
	Response
	Result ZoneSetting `json:"result"`
}

ZoneSettingSingleResponse represents the response from the Zone Setting endpoint for the specified setting.

type ZoneUpdateParams added in v0.45.0

type ZoneUpdateParams struct {
	ID                string
	Paused            *bool    `json:"paused"`
	VanityNameServers []string `json:"vanity_name_servers,omitempty"`
	Plan              ZonePlan `json:"plan,omitempty"`
	Type              string   `json:"type,omitempty"`
}

type ZonesResponse added in v0.7.2

type ZonesResponse struct {
	Response
	Result     []Zone `json:"result"`
	ResultInfo `json:"result_info"`
}

ZonesResponse represents the response from the Zone endpoint containing an array of zones.

type ZonesService added in v0.36.0

type ZonesService service

func (*ZonesService) Delete added in v0.36.0

func (s *ZonesService) Delete(ctx context.Context, rc *ResourceContainer) error

Delete deletes a zone based on ID.

API reference: https://api.cloudflare.com/#zone-delete-zone

func (*ZonesService) Get added in v0.36.0

Get fetches a single zone.

API reference: https://api.cloudflare.com/#zone-zone-details

func (*ZonesService) List added in v0.36.0

func (s *ZonesService) List(ctx context.Context, params *ZoneListParams) ([]Zone, *ResultInfo, error)

List returns all zones that match the provided `ZoneParams` struct.

Pagination is automatically handled unless `params.Page` is supplied.

API reference: https://api.cloudflare.com/#zone-list-zones

func (*ZonesService) New added in v0.36.0

func (s *ZonesService) New(ctx context.Context, zone *ZoneCreateParams) (Zone, error)

New creates a new zone.

API reference: https://api.cloudflare.com/#zone-zone-details

func (*ZonesService) Update added in v0.45.0

func (s *ZonesService) Update(ctx context.Context, params *ZoneUpdateParams) ([]Zone, error)

Update modifies an existing zone.

API reference: https://api.cloudflare.com/#zone-edit-zone

Source Files

Directories

Path Synopsis
cmd
internal
tools Module

Jump to

Keyboard shortcuts

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