challenges

package
v2.0.0-beta.11 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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 Error

type Error = apierror.Error

type NcChallengesAdminWidgetDetail

type NcChallengesAdminWidgetDetail 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 NcChallengesAdminWidgetDetailClearanceLevel `json:"clearance_level,required"`
	// When the widget was created.
	CreatedOn time.Time `json:"created_on,required" format:"date-time"`
	Domains   []string  `json:"domains,required"`
	// Widget Mode
	Mode NcChallengesAdminWidgetDetailMode `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 NcChallengesAdminWidgetDetailRegion `json:"region,required"`
	// Secret key for this widget.
	Secret string `json:"secret,required"`
	// Widget item identifier tag.
	Sitekey string                            `json:"sitekey,required"`
	JSON    ncChallengesAdminWidgetDetailJSON `json:"-"`
}

A Turnstile widget's detailed configuration

func (*NcChallengesAdminWidgetDetail) UnmarshalJSON

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

type NcChallengesAdminWidgetDetailClearanceLevel

type NcChallengesAdminWidgetDetailClearanceLevel 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 (
	NcChallengesAdminWidgetDetailClearanceLevelNoClearance NcChallengesAdminWidgetDetailClearanceLevel = "no_clearance"
	NcChallengesAdminWidgetDetailClearanceLevelJschallenge NcChallengesAdminWidgetDetailClearanceLevel = "jschallenge"
	NcChallengesAdminWidgetDetailClearanceLevelManaged     NcChallengesAdminWidgetDetailClearanceLevel = "managed"
	NcChallengesAdminWidgetDetailClearanceLevelInteractive NcChallengesAdminWidgetDetailClearanceLevel = "interactive"
)

func (NcChallengesAdminWidgetDetailClearanceLevel) IsKnown

type NcChallengesAdminWidgetDetailMode

type NcChallengesAdminWidgetDetailMode string

Widget Mode

const (
	NcChallengesAdminWidgetDetailModeNonInteractive NcChallengesAdminWidgetDetailMode = "non-interactive"
	NcChallengesAdminWidgetDetailModeInvisible      NcChallengesAdminWidgetDetailMode = "invisible"
	NcChallengesAdminWidgetDetailModeManaged        NcChallengesAdminWidgetDetailMode = "managed"
)

func (NcChallengesAdminWidgetDetailMode) IsKnown

type NcChallengesAdminWidgetDetailRegion

type NcChallengesAdminWidgetDetailRegion string

Region where this widget can be used.

const (
	NcChallengesAdminWidgetDetailRegionWorld NcChallengesAdminWidgetDetailRegion = "world"
)

func (NcChallengesAdminWidgetDetailRegion) IsKnown

type NcChallengesAdminWidgetList

type NcChallengesAdminWidgetList 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 NcChallengesAdminWidgetListClearanceLevel `json:"clearance_level,required"`
	// When the widget was created.
	CreatedOn time.Time `json:"created_on,required" format:"date-time"`
	Domains   []string  `json:"domains,required"`
	// Widget Mode
	Mode NcChallengesAdminWidgetListMode `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 NcChallengesAdminWidgetListRegion `json:"region,required"`
	// Widget item identifier tag.
	Sitekey string                          `json:"sitekey,required"`
	JSON    ncChallengesAdminWidgetListJSON `json:"-"`
}

A Turnstile Widgets configuration as it appears in listings

func (*NcChallengesAdminWidgetList) UnmarshalJSON

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

type NcChallengesAdminWidgetListClearanceLevel

type NcChallengesAdminWidgetListClearanceLevel 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 (
	NcChallengesAdminWidgetListClearanceLevelNoClearance NcChallengesAdminWidgetListClearanceLevel = "no_clearance"
	NcChallengesAdminWidgetListClearanceLevelJschallenge NcChallengesAdminWidgetListClearanceLevel = "jschallenge"
	NcChallengesAdminWidgetListClearanceLevelManaged     NcChallengesAdminWidgetListClearanceLevel = "managed"
	NcChallengesAdminWidgetListClearanceLevelInteractive NcChallengesAdminWidgetListClearanceLevel = "interactive"
)

func (NcChallengesAdminWidgetListClearanceLevel) IsKnown

type NcChallengesAdminWidgetListMode

type NcChallengesAdminWidgetListMode string

Widget Mode

const (
	NcChallengesAdminWidgetListModeNonInteractive NcChallengesAdminWidgetListMode = "non-interactive"
	NcChallengesAdminWidgetListModeInvisible      NcChallengesAdminWidgetListMode = "invisible"
	NcChallengesAdminWidgetListModeManaged        NcChallengesAdminWidgetListMode = "managed"
)

func (NcChallengesAdminWidgetListMode) IsKnown

type NcChallengesAdminWidgetListRegion

type NcChallengesAdminWidgetListRegion string

Region where this widget can be used.

const (
	NcChallengesAdminWidgetListRegionWorld NcChallengesAdminWidgetListRegion = "world"
)

func (NcChallengesAdminWidgetListRegion) IsKnown

type WidgetDeleteParams

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

type WidgetDeleteResponseEnvelope

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

func (*WidgetDeleteResponseEnvelope) UnmarshalJSON

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

type WidgetDeleteResponseEnvelopeErrors

type WidgetDeleteResponseEnvelopeErrors struct {
	Code    int64                                  `json:"code,required"`
	Message string                                 `json:"message,required"`
	JSON    widgetDeleteResponseEnvelopeErrorsJSON `json:"-"`
}

func (*WidgetDeleteResponseEnvelopeErrors) UnmarshalJSON

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

type WidgetDeleteResponseEnvelopeMessages

type WidgetDeleteResponseEnvelopeMessages struct {
	Code    int64                                    `json:"code,required"`
	Message string                                   `json:"message,required"`
	JSON    widgetDeleteResponseEnvelopeMessagesJSON `json:"-"`
}

func (*WidgetDeleteResponseEnvelopeMessages) UnmarshalJSON

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

type WidgetGetParams

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

type WidgetGetResponseEnvelope

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

func (*WidgetGetResponseEnvelope) UnmarshalJSON

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

type WidgetGetResponseEnvelopeErrors

type WidgetGetResponseEnvelopeErrors struct {
	Code    int64                               `json:"code,required"`
	Message string                              `json:"message,required"`
	JSON    widgetGetResponseEnvelopeErrorsJSON `json:"-"`
}

func (*WidgetGetResponseEnvelopeErrors) UnmarshalJSON

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

type WidgetGetResponseEnvelopeMessages

type WidgetGetResponseEnvelopeMessages struct {
	Code    int64                                 `json:"code,required"`
	Message string                                `json:"message,required"`
	JSON    widgetGetResponseEnvelopeMessagesJSON `json:"-"`
}

func (*WidgetGetResponseEnvelopeMessages) UnmarshalJSON

func (r *WidgetGetResponseEnvelopeMessages) 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 WidgetNewParams

type WidgetNewParams struct {
	// Identifier
	AccountID param.Field[string]   `path:"account_id,required"`
	Domains   param.Field[[]string] `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   []WidgetNewResponseEnvelopeErrors   `json:"errors,required"`
	Messages []WidgetNewResponseEnvelopeMessages `json:"messages,required"`
	// Whether the API call was successful
	Success bool `json:"success,required"`
	// A Turnstile widget's detailed configuration
	Result     NcChallengesAdminWidgetDetail       `json:"result"`
	ResultInfo WidgetNewResponseEnvelopeResultInfo `json:"result_info"`
	JSON       widgetNewResponseEnvelopeJSON       `json:"-"`
}

func (*WidgetNewResponseEnvelope) UnmarshalJSON

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

type WidgetNewResponseEnvelopeErrors

type WidgetNewResponseEnvelopeErrors struct {
	Code    int64                               `json:"code,required"`
	Message string                              `json:"message,required"`
	JSON    widgetNewResponseEnvelopeErrorsJSON `json:"-"`
}

func (*WidgetNewResponseEnvelopeErrors) UnmarshalJSON

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

type WidgetNewResponseEnvelopeMessages

type WidgetNewResponseEnvelopeMessages struct {
	Code    int64                                 `json:"code,required"`
	Message string                                `json:"message,required"`
	JSON    widgetNewResponseEnvelopeMessagesJSON `json:"-"`
}

func (*WidgetNewResponseEnvelopeMessages) UnmarshalJSON

func (r *WidgetNewResponseEnvelopeMessages) 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 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   []WidgetRotateSecretResponseEnvelopeErrors   `json:"errors,required"`
	Messages []WidgetRotateSecretResponseEnvelopeMessages `json:"messages,required"`
	// Whether the API call was successful
	Success bool `json:"success,required"`
	// A Turnstile widget's detailed configuration
	Result NcChallengesAdminWidgetDetail          `json:"result"`
	JSON   widgetRotateSecretResponseEnvelopeJSON `json:"-"`
}

func (*WidgetRotateSecretResponseEnvelope) UnmarshalJSON

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

type WidgetRotateSecretResponseEnvelopeErrors

type WidgetRotateSecretResponseEnvelopeErrors struct {
	Code    int64                                        `json:"code,required"`
	Message string                                       `json:"message,required"`
	JSON    widgetRotateSecretResponseEnvelopeErrorsJSON `json:"-"`
}

func (*WidgetRotateSecretResponseEnvelopeErrors) UnmarshalJSON

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

type WidgetRotateSecretResponseEnvelopeMessages

type WidgetRotateSecretResponseEnvelopeMessages struct {
	Code    int64                                          `json:"code,required"`
	Message string                                         `json:"message,required"`
	JSON    widgetRotateSecretResponseEnvelopeMessagesJSON `json:"-"`
}

func (*WidgetRotateSecretResponseEnvelopeMessages) UnmarshalJSON

func (r *WidgetRotateSecretResponseEnvelopeMessages) 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

Destroy a Turnstile Widget.

func (*WidgetService) Get

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

Lists challenge widgets.

func (*WidgetService) RotateSecret

func (r *WidgetService) RotateSecret(ctx context.Context, sitekey string, params WidgetRotateSecretParams, opts ...option.RequestOption) (res *NcChallengesAdminWidgetDetail, 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 *NcChallengesAdminWidgetDetail, 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[[]string] `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   []WidgetUpdateResponseEnvelopeErrors   `json:"errors,required"`
	Messages []WidgetUpdateResponseEnvelopeMessages `json:"messages,required"`
	// Whether the API call was successful
	Success bool `json:"success,required"`
	// A Turnstile widget's detailed configuration
	Result NcChallengesAdminWidgetDetail    `json:"result"`
	JSON   widgetUpdateResponseEnvelopeJSON `json:"-"`
}

func (*WidgetUpdateResponseEnvelope) UnmarshalJSON

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

type WidgetUpdateResponseEnvelopeErrors

type WidgetUpdateResponseEnvelopeErrors struct {
	Code    int64                                  `json:"code,required"`
	Message string                                 `json:"message,required"`
	JSON    widgetUpdateResponseEnvelopeErrorsJSON `json:"-"`
}

func (*WidgetUpdateResponseEnvelopeErrors) UnmarshalJSON

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

type WidgetUpdateResponseEnvelopeMessages

type WidgetUpdateResponseEnvelopeMessages struct {
	Code    int64                                    `json:"code,required"`
	Message string                                   `json:"message,required"`
	JSON    widgetUpdateResponseEnvelopeMessagesJSON `json:"-"`
}

func (*WidgetUpdateResponseEnvelopeMessages) UnmarshalJSON

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

Jump to

Keyboard shortcuts

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