page_shield

package
v4.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const AuditLogActorTypeAdmin = shared.AuditLogActorTypeAdmin

This is an alias to an internal value.

View Source
const AuditLogActorTypeCloudflare = shared.AuditLogActorTypeCloudflare

This is an alias to an internal value.

View Source
const AuditLogActorTypeUser = shared.AuditLogActorTypeUser

This is an alias to an internal value.

View Source
const CertificateCADigicert = shared.CertificateCADigicert

This is an alias to an internal value.

View Source
const CertificateCAGoogle = shared.CertificateCAGoogle

This is an alias to an internal value.

View Source
const CertificateCALetsEncrypt = shared.CertificateCALetsEncrypt

This is an alias to an internal value.

View Source
const CertificateCASSLCom = shared.CertificateCASSLCom

This is an alias to an internal value.

View Source
const CertificateRequestTypeKeylessCertificate = shared.CertificateRequestTypeKeylessCertificate

This is an alias to an internal value.

View Source
const CertificateRequestTypeOriginECC = shared.CertificateRequestTypeOriginECC

This is an alias to an internal value.

View Source
const CertificateRequestTypeOriginRSA = shared.CertificateRequestTypeOriginRSA

This is an alias to an internal value.

View Source
const CloudflareTunnelStatusDegraded = shared.CloudflareTunnelStatusDegraded

This is an alias to an internal value.

View Source
const CloudflareTunnelStatusDown = shared.CloudflareTunnelStatusDown

This is an alias to an internal value.

View Source
const CloudflareTunnelStatusHealthy = shared.CloudflareTunnelStatusHealthy

This is an alias to an internal value.

View Source
const CloudflareTunnelStatusInactive = shared.CloudflareTunnelStatusInactive

This is an alias to an internal value.

View Source
const CloudflareTunnelTunTypeCNI = shared.CloudflareTunnelTunTypeCNI

This is an alias to an internal value.

View Source
const CloudflareTunnelTunTypeCfdTunnel = shared.CloudflareTunnelTunTypeCfdTunnel

This is an alias to an internal value.

View Source
const CloudflareTunnelTunTypeGRE = shared.CloudflareTunnelTunTypeGRE

This is an alias to an internal value.

View Source
const CloudflareTunnelTunTypeIPSec = shared.CloudflareTunnelTunTypeIPSec

This is an alias to an internal value.

View Source
const CloudflareTunnelTunTypeWARPConnector = shared.CloudflareTunnelTunTypeWARPConnector

This is an alias to an internal value.

View Source
const MemberPoliciesAccessAllow = shared.MemberPoliciesAccessAllow

This is an alias to an internal value.

View Source
const MemberPoliciesAccessDeny = shared.MemberPoliciesAccessDeny

This is an alias to an internal value.

View Source
const MemberStatusAccepted = shared.MemberStatusAccepted

This is an alias to an internal value.

View Source
const MemberStatusPending = shared.MemberStatusPending

This is an alias to an internal value.

View Source
const SortDirectionAsc = shared.SortDirectionAsc

This is an alias to an internal value.

View Source
const SortDirectionDesc = shared.SortDirectionDesc

This is an alias to an internal value.

View Source
const SubscriptionFrequencyMonthly = shared.SubscriptionFrequencyMonthly

This is an alias to an internal value.

View Source
const SubscriptionFrequencyQuarterly = shared.SubscriptionFrequencyQuarterly

This is an alias to an internal value.

View Source
const SubscriptionFrequencyWeekly = shared.SubscriptionFrequencyWeekly

This is an alias to an internal value.

View Source
const SubscriptionFrequencyYearly = shared.SubscriptionFrequencyYearly

This is an alias to an internal value.

View Source
const SubscriptionStateAwaitingPayment = shared.SubscriptionStateAwaitingPayment

This is an alias to an internal value.

View Source
const SubscriptionStateCancelled = shared.SubscriptionStateCancelled

This is an alias to an internal value.

View Source
const SubscriptionStateExpired = shared.SubscriptionStateExpired

This is an alias to an internal value.

View Source
const SubscriptionStateFailed = shared.SubscriptionStateFailed

This is an alias to an internal value.

View Source
const SubscriptionStatePaid = shared.SubscriptionStatePaid

This is an alias to an internal value.

View Source
const SubscriptionStateProvisioned = shared.SubscriptionStateProvisioned

This is an alias to an internal value.

View Source
const SubscriptionStateTrial = shared.SubscriptionStateTrial

This is an alias to an internal value.

View Source
const TokenPolicyEffectAllow = shared.TokenPolicyEffectAllow

This is an alias to an internal value.

View Source
const TokenPolicyEffectDeny = shared.TokenPolicyEffectDeny

This is an alias to an internal value.

View Source
const TokenStatusActive = shared.TokenStatusActive

This is an alias to an internal value.

View Source
const TokenStatusDisabled = shared.TokenStatusDisabled

This is an alias to an internal value.

View Source
const TokenStatusExpired = shared.TokenStatusExpired

This is an alias to an internal value.

Variables

This section is empty.

Functions

This section is empty.

Types

type ASN

type ASN = shared.ASN

This is an alias to an internal type.

type ASNParam

type ASNParam = shared.ASNParam

This is an alias to an internal type.

type AuditLog

type AuditLog = shared.AuditLog

This is an alias to an internal type.

type AuditLogAction

type AuditLogAction = shared.AuditLogAction

This is an alias to an internal type.

type AuditLogActor

type AuditLogActor = shared.AuditLogActor

This is an alias to an internal type.

type AuditLogActorType

type AuditLogActorType = shared.AuditLogActorType

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

This is an alias to an internal type.

type AuditLogOwner

type AuditLogOwner = shared.AuditLogOwner

This is an alias to an internal type.

type AuditLogResource

type AuditLogResource = shared.AuditLogResource

This is an alias to an internal type.

type CertificateCA

type CertificateCA = shared.CertificateCA

The Certificate Authority that will issue the certificate

This is an alias to an internal type.

type CertificateRequestType

type CertificateRequestType = shared.CertificateRequestType

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

This is an alias to an internal type.

type CloudflareTunnel

type CloudflareTunnel = shared.CloudflareTunnel

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

This is an alias to an internal type.

type CloudflareTunnelConnection

type CloudflareTunnelConnection = shared.CloudflareTunnelConnection

This is an alias to an internal type.

type CloudflareTunnelStatus

type CloudflareTunnelStatus = shared.CloudflareTunnelStatus

The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge).

This is an alias to an internal type.

type CloudflareTunnelTunType

type CloudflareTunnelTunType = shared.CloudflareTunnelTunType

The type of tunnel.

This is an alias to an internal type.

type Connection

type Connection struct {
	// Identifier
	ID                        string         `json:"id,required"`
	AddedAt                   time.Time      `json:"added_at,required" format:"date-time"`
	FirstSeenAt               time.Time      `json:"first_seen_at,required" format:"date-time"`
	Host                      string         `json:"host,required"`
	LastSeenAt                time.Time      `json:"last_seen_at,required" format:"date-time"`
	URL                       string         `json:"url,required"`
	URLContainsCDNCGIPath     bool           `json:"url_contains_cdn_cgi_path,required"`
	DomainReportedMalicious   bool           `json:"domain_reported_malicious"`
	FirstPageURL              string         `json:"first_page_url"`
	MaliciousDomainCategories []string       `json:"malicious_domain_categories"`
	MaliciousURLCategories    []string       `json:"malicious_url_categories"`
	PageURLs                  []string       `json:"page_urls"`
	URLReportedMalicious      bool           `json:"url_reported_malicious"`
	JSON                      connectionJSON `json:"-"`
}

func (*Connection) UnmarshalJSON

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

type ConnectionGetParams

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

type ConnectionGetResponseEnvelope

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

func (*ConnectionGetResponseEnvelope) UnmarshalJSON

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

type ConnectionGetResponseEnvelopeSuccess

type ConnectionGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	ConnectionGetResponseEnvelopeSuccessTrue ConnectionGetResponseEnvelopeSuccess = true
)

func (ConnectionGetResponseEnvelopeSuccess) IsKnown

type ConnectionListParams

type ConnectionListParams struct {
	// Identifier
	ZoneID param.Field[string] `path:"zone_id,required"`
	// The direction used to sort returned connections.
	Direction param.Field[ConnectionListParamsDirection] `query:"direction"`
	// When true, excludes connections seen in a `/cdn-cgi` path from the returned
	// connections. The default value is true.
	ExcludeCDNCGI param.Field[bool] `query:"exclude_cdn_cgi"`
	// Excludes connections whose URL contains one of the URL-encoded URLs separated by
	// commas.
	ExcludeURLs param.Field[string] `query:"exclude_urls"`
	// Export the list of connections as a file.
	Export param.Field[ConnectionListParamsExport] `query:"export"`
	// Includes connections that match one or more URL-encoded hostnames separated by
	// commas.
	//
	// Wildcards are supported at the start and end of each hostname to support starts
	// with, ends with and contains. If no wildcards are used, results will be filtered
	// by exact match
	Hosts param.Field[string] `query:"hosts"`
	// The field used to sort returned connections.
	OrderBy param.Field[ConnectionListParamsOrderBy] `query:"order_by"`
	// The current page number of the paginated results.
	//
	// We additionally support a special value "all". When "all" is used, the API will
	// return all the connections with the applied filters in a single page. This
	// feature is best-effort and it may only work for zones with a low number of
	// connections
	Page param.Field[string] `query:"page"`
	// Includes connections that match one or more page URLs (separated by commas)
	// where they were last seen
	//
	// Wildcards are supported at the start and end of each page URL to support starts
	// with, ends with and contains. If no wildcards are used, results will be filtered
	// by exact match
	PageURL param.Field[string] `query:"page_url"`
	// The number of results per page.
	PerPage param.Field[float64] `query:"per_page"`
	// When true, malicious connections appear first in the returned connections.
	PrioritizeMalicious param.Field[bool] `query:"prioritize_malicious"`
	// Filters the returned connections using a comma-separated list of connection
	// statuses. Accepted values: `active`, `infrequent`, and `inactive`. The default
	// value is `active`.
	Status param.Field[string] `query:"status"`
	// Includes connections whose URL contain one or more URL-encoded URLs separated by
	// commas.
	URLs param.Field[string] `query:"urls"`
}

func (ConnectionListParams) URLQuery

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

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

type ConnectionListParamsDirection

type ConnectionListParamsDirection string

The direction used to sort returned connections.

const (
	ConnectionListParamsDirectionAsc  ConnectionListParamsDirection = "asc"
	ConnectionListParamsDirectionDesc ConnectionListParamsDirection = "desc"
)

func (ConnectionListParamsDirection) IsKnown

func (r ConnectionListParamsDirection) IsKnown() bool

type ConnectionListParamsExport

type ConnectionListParamsExport string

Export the list of connections as a file.

const (
	ConnectionListParamsExportCsv ConnectionListParamsExport = "csv"
)

func (ConnectionListParamsExport) IsKnown

func (r ConnectionListParamsExport) IsKnown() bool

type ConnectionListParamsOrderBy

type ConnectionListParamsOrderBy string

The field used to sort returned connections.

const (
	ConnectionListParamsOrderByFirstSeenAt ConnectionListParamsOrderBy = "first_seen_at"
	ConnectionListParamsOrderByLastSeenAt  ConnectionListParamsOrderBy = "last_seen_at"
)

func (ConnectionListParamsOrderBy) IsKnown

func (r ConnectionListParamsOrderBy) IsKnown() bool

type ConnectionService

type ConnectionService struct {
	Options []option.RequestOption
}

ConnectionService contains methods and other services that help with interacting with the cloudflare API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewConnectionService method instead.

func NewConnectionService

func NewConnectionService(opts ...option.RequestOption) (r *ConnectionService)

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

func (*ConnectionService) Get

func (r *ConnectionService) Get(ctx context.Context, connectionID string, query ConnectionGetParams, opts ...option.RequestOption) (res *Connection, err error)

Fetches a connection detected by Page Shield by connection ID.

func (*ConnectionService) List

Lists all connections detected by Page Shield.

func (*ConnectionService) ListAutoPaging

Lists all connections detected by Page Shield.

type CookieGetParams

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

type CookieGetResponse

type CookieGetResponse struct {
	// Identifier
	ID                string                             `json:"id,required"`
	FirstSeenAt       time.Time                          `json:"first_seen_at,required" format:"date-time"`
	Host              string                             `json:"host,required"`
	LastSeenAt        time.Time                          `json:"last_seen_at,required" format:"date-time"`
	Name              string                             `json:"name,required"`
	Type              CookieGetResponseType              `json:"type,required"`
	DomainAttribute   string                             `json:"domain_attribute"`
	ExpiresAttribute  time.Time                          `json:"expires_attribute" format:"date-time"`
	HTTPOnlyAttribute bool                               `json:"http_only_attribute"`
	MaxAgeAttribute   int64                              `json:"max_age_attribute"`
	PageURLs          []string                           `json:"page_urls"`
	PathAttribute     string                             `json:"path_attribute"`
	SameSiteAttribute CookieGetResponseSameSiteAttribute `json:"same_site_attribute"`
	SecureAttribute   bool                               `json:"secure_attribute"`
	JSON              cookieGetResponseJSON              `json:"-"`
}

func (*CookieGetResponse) UnmarshalJSON

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

type CookieGetResponseEnvelope

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

func (*CookieGetResponseEnvelope) UnmarshalJSON

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

type CookieGetResponseEnvelopeSuccess

type CookieGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	CookieGetResponseEnvelopeSuccessTrue CookieGetResponseEnvelopeSuccess = true
)

func (CookieGetResponseEnvelopeSuccess) IsKnown

type CookieGetResponseSameSiteAttribute

type CookieGetResponseSameSiteAttribute string
const (
	CookieGetResponseSameSiteAttributeLax    CookieGetResponseSameSiteAttribute = "lax"
	CookieGetResponseSameSiteAttributeStrict CookieGetResponseSameSiteAttribute = "strict"
	CookieGetResponseSameSiteAttributeNone   CookieGetResponseSameSiteAttribute = "none"
)

func (CookieGetResponseSameSiteAttribute) IsKnown

type CookieGetResponseType

type CookieGetResponseType string
const (
	CookieGetResponseTypeFirstParty CookieGetResponseType = "first_party"
	CookieGetResponseTypeUnknown    CookieGetResponseType = "unknown"
)

func (CookieGetResponseType) IsKnown

func (r CookieGetResponseType) IsKnown() bool

type CookieListParams

type CookieListParams struct {
	// Identifier
	ZoneID param.Field[string] `path:"zone_id,required"`
	// The direction used to sort returned cookies.'
	Direction param.Field[CookieListParamsDirection] `query:"direction"`
	// Filters the returned cookies that match the specified domain attribute
	Domain param.Field[string] `query:"domain"`
	// Export the list of cookies as a file.
	Export param.Field[CookieListParamsExport] `query:"export"`
	// Includes cookies that match one or more URL-encoded hostnames separated by
	// commas.
	//
	// Wildcards are supported at the start and end of each hostname to support starts
	// with, ends with and contains. If no wildcards are used, results will be filtered
	// by exact match
	Hosts param.Field[string] `query:"hosts"`
	// Filters the returned cookies that are set with HttpOnly
	HTTPOnly param.Field[bool] `query:"http_only"`
	// Filters the returned cookies that match the specified name. Wildcards are
	// supported at the start and end to support starts with, ends with and contains.
	// e.g. session\*
	Name param.Field[string] `query:"name"`
	// The field used to sort returned cookies.
	OrderBy param.Field[CookieListParamsOrderBy] `query:"order_by"`
	// The current page number of the paginated results.
	//
	// We additionally support a special value "all". When "all" is used, the API will
	// return all the cookies with the applied filters in a single page. This feature
	// is best-effort and it may only work for zones with a low number of cookies
	Page param.Field[string] `query:"page"`
	// Includes connections that match one or more page URLs (separated by commas)
	// where they were last seen
	//
	// Wildcards are supported at the start and end of each page URL to support starts
	// with, ends with and contains. If no wildcards are used, results will be filtered
	// by exact match
	PageURL param.Field[string] `query:"page_url"`
	// Filters the returned cookies that match the specified path attribute
	Path param.Field[string] `query:"path"`
	// The number of results per page.
	PerPage param.Field[float64] `query:"per_page"`
	// Filters the returned cookies that match the specified same_site attribute
	SameSite param.Field[CookieListParamsSameSite] `query:"same_site"`
	// Filters the returned cookies that are set with Secure
	Secure param.Field[bool] `query:"secure"`
	// Filters the returned cookies that match the specified type attribute
	Type param.Field[CookieListParamsType] `query:"type"`
}

func (CookieListParams) URLQuery

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

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

type CookieListParamsDirection

type CookieListParamsDirection string

The direction used to sort returned cookies.'

const (
	CookieListParamsDirectionAsc  CookieListParamsDirection = "asc"
	CookieListParamsDirectionDesc CookieListParamsDirection = "desc"
)

func (CookieListParamsDirection) IsKnown

func (r CookieListParamsDirection) IsKnown() bool

type CookieListParamsExport

type CookieListParamsExport string

Export the list of cookies as a file.

const (
	CookieListParamsExportCsv CookieListParamsExport = "csv"
)

func (CookieListParamsExport) IsKnown

func (r CookieListParamsExport) IsKnown() bool

type CookieListParamsOrderBy

type CookieListParamsOrderBy string

The field used to sort returned cookies.

const (
	CookieListParamsOrderByFirstSeenAt CookieListParamsOrderBy = "first_seen_at"
	CookieListParamsOrderByLastSeenAt  CookieListParamsOrderBy = "last_seen_at"
)

func (CookieListParamsOrderBy) IsKnown

func (r CookieListParamsOrderBy) IsKnown() bool

type CookieListParamsSameSite

type CookieListParamsSameSite string

Filters the returned cookies that match the specified same_site attribute

const (
	CookieListParamsSameSiteLax    CookieListParamsSameSite = "lax"
	CookieListParamsSameSiteStrict CookieListParamsSameSite = "strict"
	CookieListParamsSameSiteNone   CookieListParamsSameSite = "none"
)

func (CookieListParamsSameSite) IsKnown

func (r CookieListParamsSameSite) IsKnown() bool

type CookieListParamsType

type CookieListParamsType string

Filters the returned cookies that match the specified type attribute

const (
	CookieListParamsTypeFirstParty CookieListParamsType = "first_party"
	CookieListParamsTypeUnknown    CookieListParamsType = "unknown"
)

func (CookieListParamsType) IsKnown

func (r CookieListParamsType) IsKnown() bool

type CookieListResponse

type CookieListResponse struct {
	// Identifier
	ID                string                              `json:"id,required"`
	FirstSeenAt       time.Time                           `json:"first_seen_at,required" format:"date-time"`
	Host              string                              `json:"host,required"`
	LastSeenAt        time.Time                           `json:"last_seen_at,required" format:"date-time"`
	Name              string                              `json:"name,required"`
	Type              CookieListResponseType              `json:"type,required"`
	DomainAttribute   string                              `json:"domain_attribute"`
	ExpiresAttribute  time.Time                           `json:"expires_attribute" format:"date-time"`
	HTTPOnlyAttribute bool                                `json:"http_only_attribute"`
	MaxAgeAttribute   int64                               `json:"max_age_attribute"`
	PageURLs          []string                            `json:"page_urls"`
	PathAttribute     string                              `json:"path_attribute"`
	SameSiteAttribute CookieListResponseSameSiteAttribute `json:"same_site_attribute"`
	SecureAttribute   bool                                `json:"secure_attribute"`
	JSON              cookieListResponseJSON              `json:"-"`
}

func (*CookieListResponse) UnmarshalJSON

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

type CookieListResponseSameSiteAttribute

type CookieListResponseSameSiteAttribute string
const (
	CookieListResponseSameSiteAttributeLax    CookieListResponseSameSiteAttribute = "lax"
	CookieListResponseSameSiteAttributeStrict CookieListResponseSameSiteAttribute = "strict"
	CookieListResponseSameSiteAttributeNone   CookieListResponseSameSiteAttribute = "none"
)

func (CookieListResponseSameSiteAttribute) IsKnown

type CookieListResponseType

type CookieListResponseType string
const (
	CookieListResponseTypeFirstParty CookieListResponseType = "first_party"
	CookieListResponseTypeUnknown    CookieListResponseType = "unknown"
)

func (CookieListResponseType) IsKnown

func (r CookieListResponseType) IsKnown() bool

type CookieService

type CookieService struct {
	Options []option.RequestOption
}

CookieService contains methods and other services that help with interacting with the cloudflare API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewCookieService method instead.

func NewCookieService

func NewCookieService(opts ...option.RequestOption) (r *CookieService)

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

func (*CookieService) Get

func (r *CookieService) Get(ctx context.Context, cookieID string, query CookieGetParams, opts ...option.RequestOption) (res *CookieGetResponse, err error)

Fetches a cookie collected by Page Shield by cookie ID.

func (*CookieService) List

Lists all cookies collected by Page Shield.

func (*CookieService) ListAutoPaging

Lists all cookies collected by Page Shield.

type Error

type Error = apierror.Error

type ErrorData

type ErrorData = shared.ErrorData

This is an alias to an internal type.

type Member

type Member = shared.Member

This is an alias to an internal type.

type MemberPoliciesAccess

type MemberPoliciesAccess = shared.MemberPoliciesAccess

Allow or deny operations against the resources.

This is an alias to an internal type.

type MemberPoliciesPermissionGroup

type MemberPoliciesPermissionGroup = shared.MemberPoliciesPermissionGroup

A named group of permissions that map to a group of operations against resources.

This is an alias to an internal type.

type MemberPoliciesPermissionGroupsMeta

type MemberPoliciesPermissionGroupsMeta = shared.MemberPoliciesPermissionGroupsMeta

Attributes associated to the permission group.

This is an alias to an internal type.

type MemberPoliciesResourceGroup

type MemberPoliciesResourceGroup = shared.MemberPoliciesResourceGroup

A group of scoped resources.

This is an alias to an internal type.

type MemberPoliciesResourceGroupsMeta

type MemberPoliciesResourceGroupsMeta = shared.MemberPoliciesResourceGroupsMeta

Attributes associated to the resource group.

This is an alias to an internal type.

type MemberPoliciesResourceGroupsScope

type MemberPoliciesResourceGroupsScope = shared.MemberPoliciesResourceGroupsScope

A scope is a combination of scope objects which provides additional context.

This is an alias to an internal type.

type MemberPoliciesResourceGroupsScopeObject

type MemberPoliciesResourceGroupsScopeObject = shared.MemberPoliciesResourceGroupsScopeObject

A scope object represents any resource that can have actions applied against invite.

This is an alias to an internal type.

type MemberPolicy

type MemberPolicy = shared.MemberPolicy

This is an alias to an internal type.

type MemberStatus

type MemberStatus = shared.MemberStatus

A member's status in the account.

This is an alias to an internal type.

type MemberUser

type MemberUser = shared.MemberUser

Details of the user associated to the membership.

This is an alias to an internal type.

type PageShieldGetParams

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

type PageShieldGetResponseEnvelope

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

func (*PageShieldGetResponseEnvelope) UnmarshalJSON

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

type PageShieldGetResponseEnvelopeSuccess

type PageShieldGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	PageShieldGetResponseEnvelopeSuccessTrue PageShieldGetResponseEnvelopeSuccess = true
)

func (PageShieldGetResponseEnvelopeSuccess) IsKnown

type PageShieldService

type PageShieldService struct {
	Options     []option.RequestOption
	Policies    *PolicyService
	Connections *ConnectionService
	Scripts     *ScriptService
	Cookies     *CookieService
}

PageShieldService contains methods and other services that help with interacting with the cloudflare API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewPageShieldService method instead.

func NewPageShieldService

func NewPageShieldService(opts ...option.RequestOption) (r *PageShieldService)

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

func (*PageShieldService) Get

func (r *PageShieldService) Get(ctx context.Context, query PageShieldGetParams, opts ...option.RequestOption) (res *Setting, err error)

Fetches the Page Shield settings.

func (*PageShieldService) Update

Updates Page Shield settings.

type PageShieldUpdateParams

type PageShieldUpdateParams struct {
	// Identifier
	ZoneID param.Field[string] `path:"zone_id,required"`
	// When true, indicates that Page Shield is enabled.
	Enabled param.Field[bool] `json:"enabled"`
	// When true, CSP reports will be sent to
	// https://csp-reporting.cloudflare.com/cdn-cgi/script_monitor/report
	UseCloudflareReportingEndpoint param.Field[bool] `json:"use_cloudflare_reporting_endpoint"`
	// When true, the paths associated with connections URLs will also be analyzed.
	UseConnectionURLPath param.Field[bool] `json:"use_connection_url_path"`
}

func (PageShieldUpdateParams) MarshalJSON

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

type PageShieldUpdateResponse

type PageShieldUpdateResponse struct {
	// When true, indicates that Page Shield is enabled.
	Enabled bool `json:"enabled,required"`
	// The timestamp of when Page Shield was last updated.
	UpdatedAt string `json:"updated_at,required"`
	// When true, CSP reports will be sent to
	// https://csp-reporting.cloudflare.com/cdn-cgi/script_monitor/report
	UseCloudflareReportingEndpoint bool `json:"use_cloudflare_reporting_endpoint,required"`
	// When true, the paths associated with connections URLs will also be analyzed.
	UseConnectionURLPath bool                         `json:"use_connection_url_path,required"`
	JSON                 pageShieldUpdateResponseJSON `json:"-"`
}

func (*PageShieldUpdateResponse) UnmarshalJSON

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

type PageShieldUpdateResponseEnvelope

type PageShieldUpdateResponseEnvelope struct {
	// Whether the API call was successful
	Success  PageShieldUpdateResponseEnvelopeSuccess `json:"success,required"`
	Errors   []shared.ResponseInfo                   `json:"errors"`
	Messages []shared.ResponseInfo                   `json:"messages"`
	Result   PageShieldUpdateResponse                `json:"result"`
	JSON     pageShieldUpdateResponseEnvelopeJSON    `json:"-"`
}

func (*PageShieldUpdateResponseEnvelope) UnmarshalJSON

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

type PageShieldUpdateResponseEnvelopeSuccess

type PageShieldUpdateResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	PageShieldUpdateResponseEnvelopeSuccessTrue PageShieldUpdateResponseEnvelopeSuccess = true
)

func (PageShieldUpdateResponseEnvelopeSuccess) IsKnown

type Permission

type Permission = shared.Permission

This is an alias to an internal type.

type PermissionGrant

type PermissionGrant = shared.PermissionGrant

This is an alias to an internal type.

type PermissionGrantParam

type PermissionGrantParam = shared.PermissionGrantParam

This is an alias to an internal type.

type PolicyAction

type PolicyAction string

The action to take if the expression matches

const (
	PolicyActionAllow PolicyAction = "allow"
	PolicyActionLog   PolicyAction = "log"
)

func (PolicyAction) IsKnown

func (r PolicyAction) IsKnown() bool

type PolicyDeleteParams

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

type PolicyGetParams

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

type PolicyGetResponse

type PolicyGetResponse struct {
	// Identifier
	ID string `json:"id,required"`
	// The action to take if the expression matches
	Action PolicyGetResponseAction `json:"action,required"`
	// A description for the policy
	Description string `json:"description,required"`
	// Whether the policy is enabled
	Enabled bool `json:"enabled,required"`
	// The expression which must match for the policy to be applied, using the
	// Cloudflare Firewall rule expression syntax
	Expression string `json:"expression,required"`
	// The policy which will be applied
	Value string                `json:"value,required"`
	JSON  policyGetResponseJSON `json:"-"`
}

func (*PolicyGetResponse) UnmarshalJSON

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

type PolicyGetResponseAction

type PolicyGetResponseAction string

The action to take if the expression matches

const (
	PolicyGetResponseActionAllow PolicyGetResponseAction = "allow"
	PolicyGetResponseActionLog   PolicyGetResponseAction = "log"
)

func (PolicyGetResponseAction) IsKnown

func (r PolicyGetResponseAction) IsKnown() bool

type PolicyGetResponseEnvelope

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

func (*PolicyGetResponseEnvelope) UnmarshalJSON

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

type PolicyGetResponseEnvelopeSuccess

type PolicyGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	PolicyGetResponseEnvelopeSuccessTrue PolicyGetResponseEnvelopeSuccess = true
)

func (PolicyGetResponseEnvelopeSuccess) IsKnown

type PolicyListParams

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

type PolicyListResponse

type PolicyListResponse struct {
	// Identifier
	ID string `json:"id,required"`
	// The action to take if the expression matches
	Action PolicyListResponseAction `json:"action,required"`
	// A description for the policy
	Description string `json:"description,required"`
	// Whether the policy is enabled
	Enabled bool `json:"enabled,required"`
	// The expression which must match for the policy to be applied, using the
	// Cloudflare Firewall rule expression syntax
	Expression string `json:"expression,required"`
	// The policy which will be applied
	Value string                 `json:"value,required"`
	JSON  policyListResponseJSON `json:"-"`
}

func (*PolicyListResponse) UnmarshalJSON

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

type PolicyListResponseAction

type PolicyListResponseAction string

The action to take if the expression matches

const (
	PolicyListResponseActionAllow PolicyListResponseAction = "allow"
	PolicyListResponseActionLog   PolicyListResponseAction = "log"
)

func (PolicyListResponseAction) IsKnown

func (r PolicyListResponseAction) IsKnown() bool

type PolicyNewParams

type PolicyNewParams struct {
	// Identifier
	ZoneID param.Field[string] `path:"zone_id,required"`
	Policy PolicyParam         `json:"policy,required"`
}

func (PolicyNewParams) MarshalJSON

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

type PolicyNewResponse

type PolicyNewResponse struct {
	// Identifier
	ID string `json:"id,required"`
	// The action to take if the expression matches
	Action PolicyNewResponseAction `json:"action,required"`
	// A description for the policy
	Description string `json:"description,required"`
	// Whether the policy is enabled
	Enabled bool `json:"enabled,required"`
	// The expression which must match for the policy to be applied, using the
	// Cloudflare Firewall rule expression syntax
	Expression string `json:"expression,required"`
	// The policy which will be applied
	Value string                `json:"value,required"`
	JSON  policyNewResponseJSON `json:"-"`
}

func (*PolicyNewResponse) UnmarshalJSON

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

type PolicyNewResponseAction

type PolicyNewResponseAction string

The action to take if the expression matches

const (
	PolicyNewResponseActionAllow PolicyNewResponseAction = "allow"
	PolicyNewResponseActionLog   PolicyNewResponseAction = "log"
)

func (PolicyNewResponseAction) IsKnown

func (r PolicyNewResponseAction) IsKnown() bool

type PolicyNewResponseEnvelope

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

func (*PolicyNewResponseEnvelope) UnmarshalJSON

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

type PolicyNewResponseEnvelopeSuccess

type PolicyNewResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	PolicyNewResponseEnvelopeSuccessTrue PolicyNewResponseEnvelopeSuccess = true
)

func (PolicyNewResponseEnvelopeSuccess) IsKnown

type PolicyParam

type PolicyParam struct {
	// The action to take if the expression matches
	Action param.Field[PolicyAction] `json:"action,required"`
	// A description for the policy
	Description param.Field[string] `json:"description,required"`
	// Whether the policy is enabled
	Enabled param.Field[bool] `json:"enabled,required"`
	// The expression which must match for the policy to be applied, using the
	// Cloudflare Firewall rule expression syntax
	Expression param.Field[string] `json:"expression,required"`
	// The policy which will be applied
	Value param.Field[string] `json:"value,required"`
}

func (PolicyParam) MarshalJSON

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

type PolicyService

type PolicyService struct {
	Options []option.RequestOption
}

PolicyService contains methods and other services that help with interacting with the cloudflare API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewPolicyService method instead.

func NewPolicyService

func NewPolicyService(opts ...option.RequestOption) (r *PolicyService)

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

func (*PolicyService) Delete

func (r *PolicyService) Delete(ctx context.Context, policyID string, body PolicyDeleteParams, opts ...option.RequestOption) (err error)

Delete a Page Shield policy by ID.

func (*PolicyService) Get

func (r *PolicyService) Get(ctx context.Context, policyID string, query PolicyGetParams, opts ...option.RequestOption) (res *PolicyGetResponse, err error)

Fetches a Page Shield policy by ID.

func (*PolicyService) List

Lists all Page Shield policies.

func (*PolicyService) ListAutoPaging

Lists all Page Shield policies.

func (*PolicyService) New

func (r *PolicyService) New(ctx context.Context, params PolicyNewParams, opts ...option.RequestOption) (res *PolicyNewResponse, err error)

Create a Page Shield policy.

func (*PolicyService) Update

func (r *PolicyService) Update(ctx context.Context, policyID string, params PolicyUpdateParams, opts ...option.RequestOption) (res *PolicyUpdateResponse, err error)

Update a Page Shield policy by ID.

type PolicyUpdateParams

type PolicyUpdateParams struct {
	// Identifier
	ZoneID param.Field[string] `path:"zone_id,required"`
	// The action to take if the expression matches
	Action param.Field[PolicyUpdateParamsAction] `json:"action"`
	// A description for the policy
	Description param.Field[string] `json:"description"`
	// Whether the policy is enabled
	Enabled param.Field[bool] `json:"enabled"`
	// The expression which must match for the policy to be applied, using the
	// Cloudflare Firewall rule expression syntax
	Expression param.Field[string] `json:"expression"`
	// The policy which will be applied
	Value param.Field[string] `json:"value"`
}

func (PolicyUpdateParams) MarshalJSON

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

type PolicyUpdateParamsAction

type PolicyUpdateParamsAction string

The action to take if the expression matches

const (
	PolicyUpdateParamsActionAllow PolicyUpdateParamsAction = "allow"
	PolicyUpdateParamsActionLog   PolicyUpdateParamsAction = "log"
)

func (PolicyUpdateParamsAction) IsKnown

func (r PolicyUpdateParamsAction) IsKnown() bool

type PolicyUpdateResponse

type PolicyUpdateResponse struct {
	// Identifier
	ID string `json:"id,required"`
	// The action to take if the expression matches
	Action PolicyUpdateResponseAction `json:"action,required"`
	// A description for the policy
	Description string `json:"description,required"`
	// Whether the policy is enabled
	Enabled bool `json:"enabled,required"`
	// The expression which must match for the policy to be applied, using the
	// Cloudflare Firewall rule expression syntax
	Expression string `json:"expression,required"`
	// The policy which will be applied
	Value string                   `json:"value,required"`
	JSON  policyUpdateResponseJSON `json:"-"`
}

func (*PolicyUpdateResponse) UnmarshalJSON

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

type PolicyUpdateResponseAction

type PolicyUpdateResponseAction string

The action to take if the expression matches

const (
	PolicyUpdateResponseActionAllow PolicyUpdateResponseAction = "allow"
	PolicyUpdateResponseActionLog   PolicyUpdateResponseAction = "log"
)

func (PolicyUpdateResponseAction) IsKnown

func (r PolicyUpdateResponseAction) IsKnown() bool

type PolicyUpdateResponseEnvelope

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

func (*PolicyUpdateResponseEnvelope) UnmarshalJSON

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

type PolicyUpdateResponseEnvelopeSuccess

type PolicyUpdateResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	PolicyUpdateResponseEnvelopeSuccessTrue PolicyUpdateResponseEnvelopeSuccess = true
)

func (PolicyUpdateResponseEnvelopeSuccess) IsKnown

type RatePlan

type RatePlan = shared.RatePlan

The rate plan applied to the subscription.

This is an alias to an internal type.

type RatePlanParam

type RatePlanParam = shared.RatePlanParam

The rate plan applied to the subscription.

This is an alias to an internal type.

type ResponseInfo

type ResponseInfo = shared.ResponseInfo

This is an alias to an internal type.

type Role

type Role = shared.Role

This is an alias to an internal type.

type RoleParam

type RoleParam = shared.RoleParam

This is an alias to an internal type.

type RolePermissions

type RolePermissions = shared.RolePermissions

This is an alias to an internal type.

type RolePermissionsParam

type RolePermissionsParam = shared.RolePermissionsParam

This is an alias to an internal type.

type Script

type Script struct {
	// Identifier
	ID                    string    `json:"id,required"`
	AddedAt               time.Time `json:"added_at,required" format:"date-time"`
	FirstSeenAt           time.Time `json:"first_seen_at,required" format:"date-time"`
	Host                  string    `json:"host,required"`
	LastSeenAt            time.Time `json:"last_seen_at,required" format:"date-time"`
	URL                   string    `json:"url,required"`
	URLContainsCDNCGIPath bool      `json:"url_contains_cdn_cgi_path,required"`
	// The cryptomining score of the JavaScript content.
	CryptominingScore int64 `json:"cryptomining_score,nullable"`
	// The dataflow score of the JavaScript content.
	DataflowScore           int64 `json:"dataflow_score,nullable"`
	DomainReportedMalicious bool  `json:"domain_reported_malicious"`
	// The timestamp of when the script was last fetched.
	FetchedAt    string `json:"fetched_at,nullable"`
	FirstPageURL string `json:"first_page_url"`
	// The computed hash of the analyzed script.
	Hash string `json:"hash,nullable"`
	// The integrity score of the JavaScript content.
	JSIntegrityScore int64 `json:"js_integrity_score,nullable"`
	// The magecart score of the JavaScript content.
	MagecartScore             int64    `json:"magecart_score,nullable"`
	MaliciousDomainCategories []string `json:"malicious_domain_categories"`
	MaliciousURLCategories    []string `json:"malicious_url_categories"`
	// The malware score of the JavaScript content.
	MalwareScore int64 `json:"malware_score,nullable"`
	// The obfuscation score of the JavaScript content.
	ObfuscationScore     int64      `json:"obfuscation_score,nullable"`
	PageURLs             []string   `json:"page_urls"`
	URLReportedMalicious bool       `json:"url_reported_malicious"`
	JSON                 scriptJSON `json:"-"`
}

func (*Script) UnmarshalJSON

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

type ScriptGetParams

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

type ScriptGetResponse

type ScriptGetResponse struct {
	// Identifier
	ID                    string    `json:"id,required"`
	AddedAt               time.Time `json:"added_at,required" format:"date-time"`
	FirstSeenAt           time.Time `json:"first_seen_at,required" format:"date-time"`
	Host                  string    `json:"host,required"`
	LastSeenAt            time.Time `json:"last_seen_at,required" format:"date-time"`
	URL                   string    `json:"url,required"`
	URLContainsCDNCGIPath bool      `json:"url_contains_cdn_cgi_path,required"`
	// The cryptomining score of the JavaScript content.
	CryptominingScore int64 `json:"cryptomining_score,nullable"`
	// The dataflow score of the JavaScript content.
	DataflowScore           int64 `json:"dataflow_score,nullable"`
	DomainReportedMalicious bool  `json:"domain_reported_malicious"`
	// The timestamp of when the script was last fetched.
	FetchedAt    string `json:"fetched_at,nullable"`
	FirstPageURL string `json:"first_page_url"`
	// The computed hash of the analyzed script.
	Hash string `json:"hash,nullable"`
	// The integrity score of the JavaScript content.
	JSIntegrityScore int64 `json:"js_integrity_score,nullable"`
	// The magecart score of the JavaScript content.
	MagecartScore             int64    `json:"magecart_score,nullable"`
	MaliciousDomainCategories []string `json:"malicious_domain_categories"`
	MaliciousURLCategories    []string `json:"malicious_url_categories"`
	// The malware score of the JavaScript content.
	MalwareScore int64 `json:"malware_score,nullable"`
	// The obfuscation score of the JavaScript content.
	ObfuscationScore     int64                      `json:"obfuscation_score,nullable"`
	PageURLs             []string                   `json:"page_urls"`
	URLReportedMalicious bool                       `json:"url_reported_malicious"`
	Versions             []ScriptGetResponseVersion `json:"versions,nullable"`
	JSON                 scriptGetResponseJSON      `json:"-"`
}

func (*ScriptGetResponse) UnmarshalJSON

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

type ScriptGetResponseEnvelope

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

func (*ScriptGetResponseEnvelope) UnmarshalJSON

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

type ScriptGetResponseEnvelopeSuccess

type ScriptGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	ScriptGetResponseEnvelopeSuccessTrue ScriptGetResponseEnvelopeSuccess = true
)

func (ScriptGetResponseEnvelopeSuccess) IsKnown

type ScriptGetResponseVersion

type ScriptGetResponseVersion struct {
	// The cryptomining score of the JavaScript content.
	CryptominingScore int64 `json:"cryptomining_score,nullable"`
	// The dataflow score of the JavaScript content.
	DataflowScore int64 `json:"dataflow_score,nullable"`
	// The timestamp of when the script was last fetched.
	FetchedAt string `json:"fetched_at,nullable"`
	// The computed hash of the analyzed script.
	Hash string `json:"hash,nullable"`
	// The integrity score of the JavaScript content.
	JSIntegrityScore int64 `json:"js_integrity_score,nullable"`
	// The magecart score of the JavaScript content.
	MagecartScore int64 `json:"magecart_score,nullable"`
	// The malware score of the JavaScript content.
	MalwareScore int64 `json:"malware_score,nullable"`
	// The obfuscation score of the JavaScript content.
	ObfuscationScore int64                        `json:"obfuscation_score,nullable"`
	JSON             scriptGetResponseVersionJSON `json:"-"`
}

The version of the analyzed script.

func (*ScriptGetResponseVersion) UnmarshalJSON

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

type ScriptListParams

type ScriptListParams struct {
	// Identifier
	ZoneID param.Field[string] `path:"zone_id,required"`
	// The direction used to sort returned scripts.
	Direction param.Field[ScriptListParamsDirection] `query:"direction"`
	// When true, excludes scripts seen in a `/cdn-cgi` path from the returned scripts.
	// The default value is true.
	ExcludeCDNCGI param.Field[bool] `query:"exclude_cdn_cgi"`
	// When true, excludes duplicate scripts. We consider a script duplicate of another
	// if their javascript content matches and they share the same url host and zone
	// hostname. In such case, we return the most recent script for the URL host and
	// zone hostname combination.
	ExcludeDuplicates param.Field[bool] `query:"exclude_duplicates"`
	// Excludes scripts whose URL contains one of the URL-encoded URLs separated by
	// commas.
	ExcludeURLs param.Field[string] `query:"exclude_urls"`
	// Export the list of scripts as a file.
	Export param.Field[ScriptListParamsExport] `query:"export"`
	// Includes scripts that match one or more URL-encoded hostnames separated by
	// commas.
	//
	// Wildcards are supported at the start and end of each hostname to support starts
	// with, ends with and contains. If no wildcards are used, results will be filtered
	// by exact match
	Hosts param.Field[string] `query:"hosts"`
	// The field used to sort returned scripts.
	OrderBy param.Field[ScriptListParamsOrderBy] `query:"order_by"`
	// The current page number of the paginated results.
	//
	// We additionally support a special value "all". When "all" is used, the API will
	// return all the scripts with the applied filters in a single page. This feature
	// is best-effort and it may only work for zones with a low number of scripts
	Page param.Field[string] `query:"page"`
	// Includes scripts that match one or more page URLs (separated by commas) where
	// they were last seen
	//
	// Wildcards are supported at the start and end of each page URL to support starts
	// with, ends with and contains. If no wildcards are used, results will be filtered
	// by exact match
	PageURL param.Field[string] `query:"page_url"`
	// The number of results per page.
	PerPage param.Field[float64] `query:"per_page"`
	// When true, malicious scripts appear first in the returned scripts.
	PrioritizeMalicious param.Field[bool] `query:"prioritize_malicious"`
	// Filters the returned scripts using a comma-separated list of scripts statuses.
	// Accepted values: `active`, `infrequent`, and `inactive`. The default value is
	// `active`.
	Status param.Field[string] `query:"status"`
	// Includes scripts whose URL contain one or more URL-encoded URLs separated by
	// commas.
	URLs param.Field[string] `query:"urls"`
}

func (ScriptListParams) URLQuery

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

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

type ScriptListParamsDirection

type ScriptListParamsDirection string

The direction used to sort returned scripts.

const (
	ScriptListParamsDirectionAsc  ScriptListParamsDirection = "asc"
	ScriptListParamsDirectionDesc ScriptListParamsDirection = "desc"
)

func (ScriptListParamsDirection) IsKnown

func (r ScriptListParamsDirection) IsKnown() bool

type ScriptListParamsExport

type ScriptListParamsExport string

Export the list of scripts as a file.

const (
	ScriptListParamsExportCsv ScriptListParamsExport = "csv"
)

func (ScriptListParamsExport) IsKnown

func (r ScriptListParamsExport) IsKnown() bool

type ScriptListParamsOrderBy

type ScriptListParamsOrderBy string

The field used to sort returned scripts.

const (
	ScriptListParamsOrderByFirstSeenAt ScriptListParamsOrderBy = "first_seen_at"
	ScriptListParamsOrderByLastSeenAt  ScriptListParamsOrderBy = "last_seen_at"
)

func (ScriptListParamsOrderBy) IsKnown

func (r ScriptListParamsOrderBy) IsKnown() bool

type ScriptService

type ScriptService struct {
	Options []option.RequestOption
}

ScriptService contains methods and other services that help with interacting with the cloudflare API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewScriptService method instead.

func NewScriptService

func NewScriptService(opts ...option.RequestOption) (r *ScriptService)

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

func (*ScriptService) Get

func (r *ScriptService) Get(ctx context.Context, scriptID string, query ScriptGetParams, opts ...option.RequestOption) (res *ScriptGetResponse, err error)

Fetches a script detected by Page Shield by script ID.

func (*ScriptService) List

Lists all scripts detected by Page Shield.

func (*ScriptService) ListAutoPaging

Lists all scripts detected by Page Shield.

type Setting

type Setting struct {
	// When true, indicates that Page Shield is enabled.
	Enabled bool `json:"enabled,required"`
	// The timestamp of when Page Shield was last updated.
	UpdatedAt string `json:"updated_at,required"`
	// When true, CSP reports will be sent to
	// https://csp-reporting.cloudflare.com/cdn-cgi/script_monitor/report
	UseCloudflareReportingEndpoint bool `json:"use_cloudflare_reporting_endpoint,required"`
	// When true, the paths associated with connections URLs will also be analyzed.
	UseConnectionURLPath bool        `json:"use_connection_url_path,required"`
	JSON                 settingJSON `json:"-"`
}

func (*Setting) UnmarshalJSON

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

type SortDirection

type SortDirection = shared.SortDirection

Direction to order DNS records in.

This is an alias to an internal type.

type Subscription

type Subscription = shared.Subscription

This is an alias to an internal type.

type SubscriptionFrequency

type SubscriptionFrequency = shared.SubscriptionFrequency

How often the subscription is renewed automatically.

This is an alias to an internal type.

type SubscriptionParam

type SubscriptionParam = shared.SubscriptionParam

This is an alias to an internal type.

type SubscriptionState

type SubscriptionState = shared.SubscriptionState

The state that the subscription is in.

This is an alias to an internal type.

type Token

type Token = shared.Token

This is an alias to an internal type.

type TokenCondition

type TokenCondition = shared.TokenCondition

This is an alias to an internal type.

type TokenConditionCIDRList

type TokenConditionCIDRList = shared.TokenConditionCIDRList

IPv4/IPv6 CIDR.

This is an alias to an internal type.

type TokenConditionCIDRListParam

type TokenConditionCIDRListParam = shared.TokenConditionCIDRListParam

IPv4/IPv6 CIDR.

This is an alias to an internal type.

type TokenConditionParam

type TokenConditionParam = shared.TokenConditionParam

This is an alias to an internal type.

type TokenConditionRequestIP

type TokenConditionRequestIP = shared.TokenConditionRequestIP

Client IP restrictions.

This is an alias to an internal type.

type TokenConditionRequestIPParam

type TokenConditionRequestIPParam = shared.TokenConditionRequestIPParam

Client IP restrictions.

This is an alias to an internal type.

type TokenParam

type TokenParam = shared.TokenParam

This is an alias to an internal type.

type TokenPolicy

type TokenPolicy = shared.TokenPolicy

This is an alias to an internal type.

type TokenPolicyEffect

type TokenPolicyEffect = shared.TokenPolicyEffect

Allow or deny operations against the resources.

This is an alias to an internal type.

type TokenPolicyParam

type TokenPolicyParam = shared.TokenPolicyParam

This is an alias to an internal type.

type TokenPolicyPermissionGroup

type TokenPolicyPermissionGroup = shared.TokenPolicyPermissionGroup

A named group of permissions that map to a group of operations against resources.

This is an alias to an internal type.

type TokenPolicyPermissionGroupParam

type TokenPolicyPermissionGroupParam = shared.TokenPolicyPermissionGroupParam

A named group of permissions that map to a group of operations against resources.

This is an alias to an internal type.

type TokenPolicyPermissionGroupsMeta

type TokenPolicyPermissionGroupsMeta = shared.TokenPolicyPermissionGroupsMeta

Attributes associated to the permission group.

This is an alias to an internal type.

type TokenPolicyPermissionGroupsMetaParam

type TokenPolicyPermissionGroupsMetaParam = shared.TokenPolicyPermissionGroupsMetaParam

Attributes associated to the permission group.

This is an alias to an internal type.

type TokenStatus

type TokenStatus = shared.TokenStatus

Status of the token.

This is an alias to an internal type.

type TokenValue

type TokenValue = shared.TokenValue

The token value.

This is an alias to an internal type.

Jump to

Keyboard shortcuts

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