challenges

package
v2.4.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const AuditLogActorTypeAdmin = shared.AuditLogActorTypeAdmin

This is an alias to an internal value.

View Source
const AuditLogActorTypeCloudflare = shared.AuditLogActorTypeCloudflare

This is an alias to an internal value.

View Source
const AuditLogActorTypeUser = shared.AuditLogActorTypeUser

This is an alias to an internal value.

View Source
const CertificateCADigicert = shared.CertificateCADigicert

This is an alias to an internal value.

View Source
const CertificateCAGoogle = shared.CertificateCAGoogle

This is an alias to an internal value.

View Source
const CertificateCALetsEncrypt = shared.CertificateCALetsEncrypt

This is an alias to an internal value.

View Source
const CertificateRequestTypeKeylessCertificate = shared.CertificateRequestTypeKeylessCertificate

This is an alias to an internal value.

View Source
const CertificateRequestTypeOriginECC = shared.CertificateRequestTypeOriginECC

This is an alias to an internal value.

View Source
const CertificateRequestTypeOriginRSA = shared.CertificateRequestTypeOriginRSA

This is an alias to an internal value.

View Source
const CloudflareTunnelStatusDegraded = shared.CloudflareTunnelStatusDegraded

This is an alias to an internal value.

View Source
const CloudflareTunnelStatusDown = shared.CloudflareTunnelStatusDown

This is an alias to an internal value.

View Source
const CloudflareTunnelStatusHealthy = shared.CloudflareTunnelStatusHealthy

This is an alias to an internal value.

View Source
const CloudflareTunnelStatusInactive = shared.CloudflareTunnelStatusInactive

This is an alias to an internal value.

View Source
const CloudflareTunnelTunTypeCNI = shared.CloudflareTunnelTunTypeCNI

This is an alias to an internal value.

View Source
const CloudflareTunnelTunTypeCfdTunnel = shared.CloudflareTunnelTunTypeCfdTunnel

This is an alias to an internal value.

View Source
const CloudflareTunnelTunTypeGRE = shared.CloudflareTunnelTunTypeGRE

This is an alias to an internal value.

View Source
const CloudflareTunnelTunTypeIPSec = shared.CloudflareTunnelTunTypeIPSec

This is an alias to an internal value.

View Source
const CloudflareTunnelTunTypeWARPConnector = shared.CloudflareTunnelTunTypeWARPConnector

This is an alias to an internal value.

View Source
const MemberStatusAccepted = shared.MemberStatusAccepted

This is an alias to an internal value.

View Source
const MemberStatusPending = shared.MemberStatusPending

This is an alias to an internal value.

View Source
const SortDirectionAsc = shared.SortDirectionAsc

This is an alias to an internal value.

View Source
const SortDirectionDesc = shared.SortDirectionDesc

This is an alias to an internal value.

Variables

This section is empty.

Functions

This section is empty.

Types

type ASN added in v2.1.0

type ASN = shared.ASN

This is an alias to an internal type.

type ASNParam added in v2.1.0

type ASNParam = shared.ASNParam

This is an alias to an internal type.

type AuditLog

type AuditLog = shared.AuditLog

This is an alias to an internal type.

type AuditLogAction

type AuditLogAction = shared.AuditLogAction

This is an alias to an internal type.

type AuditLogActor

type AuditLogActor = shared.AuditLogActor

This is an alias to an internal type.

type AuditLogActorType

type AuditLogActorType = shared.AuditLogActorType

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

This is an alias to an internal type.

type AuditLogOwner

type AuditLogOwner = shared.AuditLogOwner

This is an alias to an internal type.

type AuditLogResource

type AuditLogResource = shared.AuditLogResource

This is an alias to an internal type.

type CertificateCA added in v2.2.0

type CertificateCA = shared.CertificateCA

The Certificate Authority that will issue the certificate

This is an alias to an internal type.

type CertificateRequestType added in v2.2.0

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 ChallengeService

type ChallengeService struct {
	Options []option.RequestOption
	Widgets *WidgetService
}

ChallengeService 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 NewChallengeService method instead.

func NewChallengeService

func NewChallengeService(opts ...option.RequestOption) (r *ChallengeService)

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

type 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 added in v2.3.0

type CloudflareTunnelStatus = shared.CloudflareTunnelStatus

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

This is an alias to an internal type.

type CloudflareTunnelTunType

type CloudflareTunnelTunType = shared.CloudflareTunnelTunType

The type of tunnel.

This is an alias to an internal type.

type Error

type Error = apierror.Error

type ErrorData

type ErrorData = shared.ErrorData

This is an alias to an internal type.

type MemberParam added in v2.1.0

type MemberParam = shared.MemberParam

This is an alias to an internal type.

type MemberRoleParam added in v2.1.0

type MemberRoleParam = shared.MemberRoleParam

This is an alias to an internal type.

type MemberRolesPermissionsParam added in v2.1.0

type MemberRolesPermissionsParam = shared.MemberRolesPermissionsParam

This is an alias to an internal type.

type MemberStatus added in v2.3.0

type MemberStatus = shared.MemberStatus

A member's status in the account.

This is an alias to an internal type.

type MemberUserParam added in v2.1.0

type MemberUserParam = shared.MemberUserParam

Details of the user associated to the membership.

This is an alias to an internal type.

type Permission

type Permission = shared.Permission

This is an alias to an internal type.

type PermissionGrant

type PermissionGrant = shared.PermissionGrant

This is an alias to an internal type.

type PermissionGrantParam

type PermissionGrantParam = shared.PermissionGrantParam

This is an alias to an internal type.

type 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 SortDirection added in v2.2.0

type SortDirection = shared.SortDirection

Direction to order DNS records in.

This is an alias to an internal type.

type Widget

type Widget struct {
	// If bot_fight_mode is set to `true`, Cloudflare issues computationally expensive
	// challenges in response to malicious bots (ENT only).
	BotFightMode bool `json:"bot_fight_mode,required"`
	// If Turnstile is embedded on a Cloudflare site and the widget should grant
	// challenge clearance, this setting can determine the clearance level to be set
	ClearanceLevel WidgetClearanceLevel `json:"clearance_level,required"`
	// When the widget was created.
	CreatedOn time.Time      `json:"created_on,required" format:"date-time"`
	Domains   []WidgetDomain `json:"domains,required"`
	// Widget Mode
	Mode WidgetMode `json:"mode,required"`
	// When the widget was modified.
	ModifiedOn time.Time `json:"modified_on,required" format:"date-time"`
	// Human readable widget name. Not unique. Cloudflare suggests that you set this to
	// a meaningful string to make it easier to identify your widget, and where it is
	// used.
	Name string `json:"name,required"`
	// Do not show any Cloudflare branding on the widget (ENT only).
	Offlabel bool `json:"offlabel,required"`
	// Region where this widget can be used.
	Region WidgetRegion `json:"region,required"`
	// Secret key for this widget.
	Secret string `json:"secret,required"`
	// Widget item identifier tag.
	Sitekey string     `json:"sitekey,required"`
	JSON    widgetJSON `json:"-"`
}

A Turnstile widget's detailed configuration

func (*Widget) UnmarshalJSON

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

type WidgetClearanceLevel

type WidgetClearanceLevel string

If Turnstile is embedded on a Cloudflare site and the widget should grant challenge clearance, this setting can determine the clearance level to be set

const (
	WidgetClearanceLevelNoClearance WidgetClearanceLevel = "no_clearance"
	WidgetClearanceLevelJschallenge WidgetClearanceLevel = "jschallenge"
	WidgetClearanceLevelManaged     WidgetClearanceLevel = "managed"
	WidgetClearanceLevelInteractive WidgetClearanceLevel = "interactive"
)

func (WidgetClearanceLevel) IsKnown

func (r WidgetClearanceLevel) IsKnown() bool

type WidgetDeleteParams

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

type WidgetDeleteResponseEnvelope

type WidgetDeleteResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	// Whether the API call was successful
	Success bool `json:"success,required"`
	// A Turnstile widget's detailed configuration
	Result Widget                           `json:"result"`
	JSON   widgetDeleteResponseEnvelopeJSON `json:"-"`
}

func (*WidgetDeleteResponseEnvelope) UnmarshalJSON

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

type WidgetDomain

type WidgetDomain = string

type WidgetDomainParam

type WidgetDomainParam = string

type WidgetGetParams

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

type WidgetGetResponseEnvelope

type WidgetGetResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	// Whether the API call was successful
	Success bool `json:"success,required"`
	// A Turnstile widget's detailed configuration
	Result Widget                        `json:"result"`
	JSON   widgetGetResponseEnvelopeJSON `json:"-"`
}

func (*WidgetGetResponseEnvelope) UnmarshalJSON

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

type WidgetListParams

type WidgetListParams struct {
	// Identifier
	AccountID param.Field[string] `path:"account_id,required"`
	// Direction to order widgets.
	Direction param.Field[WidgetListParamsDirection] `query:"direction"`
	// Field to order widgets by.
	Order param.Field[WidgetListParamsOrder] `query:"order"`
	// Page number of paginated results.
	Page param.Field[float64] `query:"page"`
	// Number of items per page.
	PerPage param.Field[float64] `query:"per_page"`
}

func (WidgetListParams) URLQuery

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

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

type WidgetListParamsDirection

type WidgetListParamsDirection string

Direction to order widgets.

const (
	WidgetListParamsDirectionAsc  WidgetListParamsDirection = "asc"
	WidgetListParamsDirectionDesc WidgetListParamsDirection = "desc"
)

func (WidgetListParamsDirection) IsKnown

func (r WidgetListParamsDirection) IsKnown() bool

type WidgetListParamsOrder

type WidgetListParamsOrder string

Field to order widgets by.

const (
	WidgetListParamsOrderID         WidgetListParamsOrder = "id"
	WidgetListParamsOrderSitekey    WidgetListParamsOrder = "sitekey"
	WidgetListParamsOrderName       WidgetListParamsOrder = "name"
	WidgetListParamsOrderCreatedOn  WidgetListParamsOrder = "created_on"
	WidgetListParamsOrderModifiedOn WidgetListParamsOrder = "modified_on"
)

func (WidgetListParamsOrder) IsKnown

func (r WidgetListParamsOrder) IsKnown() bool

type WidgetListResponse

type WidgetListResponse struct {
	// If bot_fight_mode is set to `true`, Cloudflare issues computationally expensive
	// challenges in response to malicious bots (ENT only).
	BotFightMode bool `json:"bot_fight_mode,required"`
	// If Turnstile is embedded on a Cloudflare site and the widget should grant
	// challenge clearance, this setting can determine the clearance level to be set
	ClearanceLevel WidgetListResponseClearanceLevel `json:"clearance_level,required"`
	// When the widget was created.
	CreatedOn time.Time      `json:"created_on,required" format:"date-time"`
	Domains   []WidgetDomain `json:"domains,required"`
	// Widget Mode
	Mode WidgetListResponseMode `json:"mode,required"`
	// When the widget was modified.
	ModifiedOn time.Time `json:"modified_on,required" format:"date-time"`
	// Human readable widget name. Not unique. Cloudflare suggests that you set this to
	// a meaningful string to make it easier to identify your widget, and where it is
	// used.
	Name string `json:"name,required"`
	// Do not show any Cloudflare branding on the widget (ENT only).
	Offlabel bool `json:"offlabel,required"`
	// Region where this widget can be used.
	Region WidgetListResponseRegion `json:"region,required"`
	// Widget item identifier tag.
	Sitekey string                 `json:"sitekey,required"`
	JSON    widgetListResponseJSON `json:"-"`
}

A Turnstile Widgets configuration as it appears in listings

func (*WidgetListResponse) UnmarshalJSON

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

type WidgetListResponseClearanceLevel

type WidgetListResponseClearanceLevel string

If Turnstile is embedded on a Cloudflare site and the widget should grant challenge clearance, this setting can determine the clearance level to be set

const (
	WidgetListResponseClearanceLevelNoClearance WidgetListResponseClearanceLevel = "no_clearance"
	WidgetListResponseClearanceLevelJschallenge WidgetListResponseClearanceLevel = "jschallenge"
	WidgetListResponseClearanceLevelManaged     WidgetListResponseClearanceLevel = "managed"
	WidgetListResponseClearanceLevelInteractive WidgetListResponseClearanceLevel = "interactive"
)

func (WidgetListResponseClearanceLevel) IsKnown

type WidgetListResponseMode

type WidgetListResponseMode string

Widget Mode

const (
	WidgetListResponseModeNonInteractive WidgetListResponseMode = "non-interactive"
	WidgetListResponseModeInvisible      WidgetListResponseMode = "invisible"
	WidgetListResponseModeManaged        WidgetListResponseMode = "managed"
)

func (WidgetListResponseMode) IsKnown

func (r WidgetListResponseMode) IsKnown() bool

type WidgetListResponseRegion

type WidgetListResponseRegion string

Region where this widget can be used.

const (
	WidgetListResponseRegionWorld WidgetListResponseRegion = "world"
)

func (WidgetListResponseRegion) IsKnown

func (r WidgetListResponseRegion) IsKnown() bool

type WidgetMode

type WidgetMode string

Widget Mode

const (
	WidgetModeNonInteractive WidgetMode = "non-interactive"
	WidgetModeInvisible      WidgetMode = "invisible"
	WidgetModeManaged        WidgetMode = "managed"
)

func (WidgetMode) IsKnown

func (r WidgetMode) IsKnown() bool

type WidgetNewParams

type WidgetNewParams struct {
	// Identifier
	AccountID param.Field[string]              `path:"account_id,required"`
	Domains   param.Field[[]WidgetDomainParam] `json:"domains,required"`
	// Widget Mode
	Mode param.Field[WidgetNewParamsMode] `json:"mode,required"`
	// Human readable widget name. Not unique. Cloudflare suggests that you set this to
	// a meaningful string to make it easier to identify your widget, and where it is
	// used.
	Name param.Field[string] `json:"name,required"`
	// Direction to order widgets.
	Direction param.Field[WidgetNewParamsDirection] `query:"direction"`
	// Field to order widgets by.
	Order param.Field[WidgetNewParamsOrder] `query:"order"`
	// Page number of paginated results.
	Page param.Field[float64] `query:"page"`
	// Number of items per page.
	PerPage param.Field[float64] `query:"per_page"`
	// If bot_fight_mode is set to `true`, Cloudflare issues computationally expensive
	// challenges in response to malicious bots (ENT only).
	BotFightMode param.Field[bool] `json:"bot_fight_mode"`
	// If Turnstile is embedded on a Cloudflare site and the widget should grant
	// challenge clearance, this setting can determine the clearance level to be set
	ClearanceLevel param.Field[WidgetNewParamsClearanceLevel] `json:"clearance_level"`
	// Do not show any Cloudflare branding on the widget (ENT only).
	Offlabel param.Field[bool] `json:"offlabel"`
	// Region where this widget can be used.
	Region param.Field[WidgetNewParamsRegion] `json:"region"`
}

func (WidgetNewParams) MarshalJSON

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

func (WidgetNewParams) URLQuery

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

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

type WidgetNewParamsClearanceLevel

type WidgetNewParamsClearanceLevel string

If Turnstile is embedded on a Cloudflare site and the widget should grant challenge clearance, this setting can determine the clearance level to be set

const (
	WidgetNewParamsClearanceLevelNoClearance WidgetNewParamsClearanceLevel = "no_clearance"
	WidgetNewParamsClearanceLevelJschallenge WidgetNewParamsClearanceLevel = "jschallenge"
	WidgetNewParamsClearanceLevelManaged     WidgetNewParamsClearanceLevel = "managed"
	WidgetNewParamsClearanceLevelInteractive WidgetNewParamsClearanceLevel = "interactive"
)

func (WidgetNewParamsClearanceLevel) IsKnown

func (r WidgetNewParamsClearanceLevel) IsKnown() bool

type WidgetNewParamsDirection

type WidgetNewParamsDirection string

Direction to order widgets.

const (
	WidgetNewParamsDirectionAsc  WidgetNewParamsDirection = "asc"
	WidgetNewParamsDirectionDesc WidgetNewParamsDirection = "desc"
)

func (WidgetNewParamsDirection) IsKnown

func (r WidgetNewParamsDirection) IsKnown() bool

type WidgetNewParamsMode

type WidgetNewParamsMode string

Widget Mode

const (
	WidgetNewParamsModeNonInteractive WidgetNewParamsMode = "non-interactive"
	WidgetNewParamsModeInvisible      WidgetNewParamsMode = "invisible"
	WidgetNewParamsModeManaged        WidgetNewParamsMode = "managed"
)

func (WidgetNewParamsMode) IsKnown

func (r WidgetNewParamsMode) IsKnown() bool

type WidgetNewParamsOrder

type WidgetNewParamsOrder string

Field to order widgets by.

const (
	WidgetNewParamsOrderID         WidgetNewParamsOrder = "id"
	WidgetNewParamsOrderSitekey    WidgetNewParamsOrder = "sitekey"
	WidgetNewParamsOrderName       WidgetNewParamsOrder = "name"
	WidgetNewParamsOrderCreatedOn  WidgetNewParamsOrder = "created_on"
	WidgetNewParamsOrderModifiedOn WidgetNewParamsOrder = "modified_on"
)

func (WidgetNewParamsOrder) IsKnown

func (r WidgetNewParamsOrder) IsKnown() bool

type WidgetNewParamsRegion

type WidgetNewParamsRegion string

Region where this widget can be used.

const (
	WidgetNewParamsRegionWorld WidgetNewParamsRegion = "world"
)

func (WidgetNewParamsRegion) IsKnown

func (r WidgetNewParamsRegion) IsKnown() bool

type WidgetNewResponseEnvelope

type WidgetNewResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	// Whether the API call was successful
	Success bool `json:"success,required"`
	// A Turnstile widget's detailed configuration
	Result     Widget                              `json:"result"`
	ResultInfo WidgetNewResponseEnvelopeResultInfo `json:"result_info"`
	JSON       widgetNewResponseEnvelopeJSON       `json:"-"`
}

func (*WidgetNewResponseEnvelope) UnmarshalJSON

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

type WidgetNewResponseEnvelopeResultInfo

type WidgetNewResponseEnvelopeResultInfo struct {
	// Total number of results for the requested service
	Count float64 `json:"count,required"`
	// Current page within paginated list of results
	Page float64 `json:"page,required"`
	// Number of results per page of results
	PerPage float64 `json:"per_page,required"`
	// Total results available without any search parameters
	TotalCount float64                                 `json:"total_count,required"`
	JSON       widgetNewResponseEnvelopeResultInfoJSON `json:"-"`
}

func (*WidgetNewResponseEnvelopeResultInfo) UnmarshalJSON

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

type WidgetRegion

type WidgetRegion string

Region where this widget can be used.

const (
	WidgetRegionWorld WidgetRegion = "world"
)

func (WidgetRegion) IsKnown

func (r WidgetRegion) IsKnown() bool

type WidgetRotateSecretParams

type WidgetRotateSecretParams struct {
	// Identifier
	AccountID param.Field[string] `path:"account_id,required"`
	// If `invalidate_immediately` is set to `false`, the previous secret will remain
	// valid for two hours. Otherwise, the secret is immediately invalidated, and
	// requests using it will be rejected.
	InvalidateImmediately param.Field[bool] `json:"invalidate_immediately"`
}

func (WidgetRotateSecretParams) MarshalJSON

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

type WidgetRotateSecretResponseEnvelope

type WidgetRotateSecretResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	// Whether the API call was successful
	Success bool `json:"success,required"`
	// A Turnstile widget's detailed configuration
	Result Widget                                 `json:"result"`
	JSON   widgetRotateSecretResponseEnvelopeJSON `json:"-"`
}

func (*WidgetRotateSecretResponseEnvelope) UnmarshalJSON

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

type WidgetService

type WidgetService struct {
	Options []option.RequestOption
}

WidgetService 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 NewWidgetService method instead.

func NewWidgetService

func NewWidgetService(opts ...option.RequestOption) (r *WidgetService)

NewWidgetService 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 (*WidgetService) Delete

func (r *WidgetService) Delete(ctx context.Context, sitekey string, body WidgetDeleteParams, opts ...option.RequestOption) (res *Widget, err error)

Destroy a Turnstile Widget.

func (*WidgetService) Get

func (r *WidgetService) Get(ctx context.Context, sitekey string, query WidgetGetParams, opts ...option.RequestOption) (res *Widget, err error)

Show a single challenge widget configuration.

func (*WidgetService) List

Lists all turnstile widgets of an account.

func (*WidgetService) ListAutoPaging

Lists all turnstile widgets of an account.

func (*WidgetService) New

func (r *WidgetService) New(ctx context.Context, params WidgetNewParams, opts ...option.RequestOption) (res *Widget, err error)

Lists challenge widgets.

func (*WidgetService) RotateSecret

func (r *WidgetService) RotateSecret(ctx context.Context, sitekey string, params WidgetRotateSecretParams, opts ...option.RequestOption) (res *Widget, err error)

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

func (*WidgetService) Update

func (r *WidgetService) Update(ctx context.Context, sitekey string, params WidgetUpdateParams, opts ...option.RequestOption) (res *Widget, err error)

Update the configuration of a widget.

type WidgetUpdateParams

type WidgetUpdateParams struct {
	// Identifier
	AccountID param.Field[string]              `path:"account_id,required"`
	Domains   param.Field[[]WidgetDomainParam] `json:"domains,required"`
	// Widget Mode
	Mode param.Field[WidgetUpdateParamsMode] `json:"mode,required"`
	// Human readable widget name. Not unique. Cloudflare suggests that you set this to
	// a meaningful string to make it easier to identify your widget, and where it is
	// used.
	Name param.Field[string] `json:"name,required"`
	// If bot_fight_mode is set to `true`, Cloudflare issues computationally expensive
	// challenges in response to malicious bots (ENT only).
	BotFightMode param.Field[bool] `json:"bot_fight_mode"`
	// If Turnstile is embedded on a Cloudflare site and the widget should grant
	// challenge clearance, this setting can determine the clearance level to be set
	ClearanceLevel param.Field[WidgetUpdateParamsClearanceLevel] `json:"clearance_level"`
	// Do not show any Cloudflare branding on the widget (ENT only).
	Offlabel param.Field[bool] `json:"offlabel"`
}

func (WidgetUpdateParams) MarshalJSON

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

type WidgetUpdateParamsClearanceLevel

type WidgetUpdateParamsClearanceLevel string

If Turnstile is embedded on a Cloudflare site and the widget should grant challenge clearance, this setting can determine the clearance level to be set

const (
	WidgetUpdateParamsClearanceLevelNoClearance WidgetUpdateParamsClearanceLevel = "no_clearance"
	WidgetUpdateParamsClearanceLevelJschallenge WidgetUpdateParamsClearanceLevel = "jschallenge"
	WidgetUpdateParamsClearanceLevelManaged     WidgetUpdateParamsClearanceLevel = "managed"
	WidgetUpdateParamsClearanceLevelInteractive WidgetUpdateParamsClearanceLevel = "interactive"
)

func (WidgetUpdateParamsClearanceLevel) IsKnown

type WidgetUpdateParamsMode

type WidgetUpdateParamsMode string

Widget Mode

const (
	WidgetUpdateParamsModeNonInteractive WidgetUpdateParamsMode = "non-interactive"
	WidgetUpdateParamsModeInvisible      WidgetUpdateParamsMode = "invisible"
	WidgetUpdateParamsModeManaged        WidgetUpdateParamsMode = "managed"
)

func (WidgetUpdateParamsMode) IsKnown

func (r WidgetUpdateParamsMode) IsKnown() bool

type WidgetUpdateResponseEnvelope

type WidgetUpdateResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	// Whether the API call was successful
	Success bool `json:"success,required"`
	// A Turnstile widget's detailed configuration
	Result Widget                           `json:"result"`
	JSON   widgetUpdateResponseEnvelopeJSON `json:"-"`
}

func (*WidgetUpdateResponseEnvelope) UnmarshalJSON

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

Jump to

Keyboard shortcuts

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