Class CreateTurnstileWidgetRequest
- Namespace
- Cloudflare.NET.Turnstile.Models
- Assembly
- Cloudflare.NET.dll
Request to create a new Turnstile widget.
The created widget will have a unique sitekey (public key) and secret (private key). The secret is only returned in the create response - store it securely.
public record CreateTurnstileWidgetRequest : IEquatable<CreateTurnstileWidgetRequest>
- Inheritance
-
CreateTurnstileWidgetRequest
- Implements
- Inherited Members
Constructors
CreateTurnstileWidgetRequest(string, IReadOnlyList<string>, WidgetMode, bool?, ClearanceLevel?, bool?, bool?, string?)
Request to create a new Turnstile widget.
The created widget will have a unique sitekey (public key) and secret (private key). The secret is only returned in the create response - store it securely.
public CreateTurnstileWidgetRequest(string Name, IReadOnlyList<string> Domains, WidgetMode Mode, bool? BotFightMode = null, ClearanceLevel? ClearanceLevel = null, bool? EphemeralId = null, bool? Offlabel = null, string? Region = null)
Parameters
NamestringWidget name for identification.
DomainsIReadOnlyList<string>Allowed domains for this widget.
ModeWidgetModeWidget mode (invisible, managed, or non-interactive).
BotFightModebool?Enable bot fight mode. Defaults to false if not specified.
ClearanceLevelClearanceLevel?Challenge clearance level.
EphemeralIdbool?Use ephemeral IDs. Defaults to false if not specified.
Offlabelbool?Allow off-label use. Defaults to false if not specified.
RegionstringGeographic region for the widget.
Properties
BotFightMode
Enable bot fight mode. Defaults to false if not specified.
[JsonPropertyName("bot_fight_mode")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public bool? BotFightMode { get; init; }
Property Value
- bool?
ClearanceLevel
Challenge clearance level.
[JsonPropertyName("clearance_level")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public ClearanceLevel? ClearanceLevel { get; init; }
Property Value
Domains
Allowed domains for this widget.
[JsonPropertyName("domains")]
public IReadOnlyList<string> Domains { get; init; }
Property Value
EphemeralId
Use ephemeral IDs. Defaults to false if not specified.
[JsonPropertyName("ephemeral_id")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public bool? EphemeralId { get; init; }
Property Value
- bool?
Mode
Widget mode (invisible, managed, or non-interactive).
[JsonPropertyName("mode")]
public WidgetMode Mode { get; init; }
Property Value
Name
Widget name for identification.
[JsonPropertyName("name")]
public string Name { get; init; }
Property Value
Offlabel
Allow off-label use. Defaults to false if not specified.
[JsonPropertyName("offlabel")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public bool? Offlabel { get; init; }
Property Value
- bool?
Region
Geographic region for the widget.
[JsonPropertyName("region")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Region { get; init; }