Documentation ¶
Index ¶
- type Error
- type EventDeleteResponse
- type EventDeleteResponseEnvelope
- type EventDetailGetResponseEnvelope
- type EventDetailService
- type EventEditParams
- type EventEditResponseEnvelope
- type EventGetResponseEnvelope
- type EventListResponseEnvelope
- type EventListResponseEnvelopeErrors
- type EventListResponseEnvelopeMessages
- type EventListResponseEnvelopeResultInfo
- type EventListResponseEnvelopeSuccess
- type EventNewParams
- type EventNewResponseEnvelope
- type EventService
- func (r *EventService) Delete(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, ...) (res *EventDeleteResponse, err error)
- func (r *EventService) Edit(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, ...) (res *WaitingroomEventResult, err error)
- func (r *EventService) Get(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, ...) (res *WaitingroomEventResult, err error)
- func (r *EventService) List(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, ...) (res *[]WaitingroomEventResult, err error)
- func (r *EventService) New(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, ...) (res *WaitingroomEventResult, err error)
- func (r *EventService) Update(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, ...) (res *WaitingroomEventResult, err error)
- type EventUpdateParams
- type EventUpdateResponseEnvelope
- type PagePreviewParams
- type PagePreviewResponse
- type PagePreviewResponseEnvelope
- type PageService
- type RuleDeleteResponseEnvelope
- type RuleDeleteResponseEnvelopeErrors
- type RuleDeleteResponseEnvelopeMessages
- type RuleDeleteResponseEnvelopeResultInfo
- type RuleDeleteResponseEnvelopeSuccess
- type RuleEditParams
- type RuleEditParamsAction
- type RuleEditParamsPosition
- type RuleEditParamsPositionObject
- type RuleEditResponseEnvelope
- type RuleEditResponseEnvelopeErrors
- type RuleEditResponseEnvelopeMessages
- type RuleEditResponseEnvelopeResultInfo
- type RuleEditResponseEnvelopeSuccess
- type RuleListResponseEnvelope
- type RuleListResponseEnvelopeErrors
- type RuleListResponseEnvelopeMessages
- type RuleListResponseEnvelopeResultInfo
- type RuleListResponseEnvelopeSuccess
- type RuleNewParams
- type RuleNewParamsAction
- type RuleNewResponseEnvelope
- type RuleNewResponseEnvelopeErrors
- type RuleNewResponseEnvelopeMessages
- type RuleNewResponseEnvelopeResultInfo
- type RuleNewResponseEnvelopeSuccess
- type RuleService
- func (r *RuleService) Delete(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, ...) (res *[]WaitingroomRuleResult, err error)
- func (r *RuleService) Edit(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, ...) (res *[]WaitingroomRuleResult, err error)
- func (r *RuleService) List(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, ...) (res *[]WaitingroomRuleResult, err error)
- func (r *RuleService) New(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, ...) (res *[]WaitingroomRuleResult, err error)
- func (r *RuleService) Update(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, ...) (res *[]WaitingroomRuleResult, err error)
- type RuleUpdateParams
- type RuleUpdateParamsBody
- type RuleUpdateParamsBodyAction
- type RuleUpdateResponseEnvelope
- type RuleUpdateResponseEnvelopeErrors
- type RuleUpdateResponseEnvelopeMessages
- type RuleUpdateResponseEnvelopeResultInfo
- type RuleUpdateResponseEnvelopeSuccess
- type SettingEditParams
- type SettingEditResponse
- type SettingEditResponseEnvelope
- type SettingGetResponse
- type SettingGetResponseEnvelope
- type SettingService
- func (r *SettingService) Edit(ctx context.Context, zoneIdentifier string, body SettingEditParams, ...) (res *SettingEditResponse, err error)
- func (r *SettingService) Get(ctx context.Context, zoneIdentifier string, opts ...option.RequestOption) (res *SettingGetResponse, err error)
- func (r *SettingService) Update(ctx context.Context, zoneIdentifier string, body SettingUpdateParams, ...) (res *SettingUpdateResponse, err error)
- type SettingUpdateParams
- type SettingUpdateResponse
- type SettingUpdateResponseEnvelope
- type StatusGetResponse
- type StatusGetResponseEnvelope
- type StatusGetResponseStatus
- type StatusService
- type WaitingRoomDeleteResponse
- type WaitingRoomDeleteResponseEnvelope
- type WaitingRoomEditParams
- type WaitingRoomEditParamsAdditionalRoute
- type WaitingRoomEditParamsCookieAttributes
- type WaitingRoomEditParamsCookieAttributesSamesite
- type WaitingRoomEditParamsCookieAttributesSecure
- type WaitingRoomEditParamsDefaultTemplateLanguage
- type WaitingRoomEditParamsQueueingMethod
- type WaitingRoomEditParamsQueueingStatusCode
- type WaitingRoomEditResponseEnvelope
- type WaitingRoomGetResponseEnvelope
- type WaitingRoomListResponseEnvelope
- type WaitingRoomListResponseEnvelopeErrors
- type WaitingRoomListResponseEnvelopeMessages
- type WaitingRoomListResponseEnvelopeResultInfo
- type WaitingRoomListResponseEnvelopeSuccess
- type WaitingRoomNewParams
- type WaitingRoomNewParamsAdditionalRoute
- type WaitingRoomNewParamsCookieAttributes
- type WaitingRoomNewParamsCookieAttributesSamesite
- type WaitingRoomNewParamsCookieAttributesSecure
- type WaitingRoomNewParamsDefaultTemplateLanguage
- type WaitingRoomNewParamsQueueingMethod
- type WaitingRoomNewParamsQueueingStatusCode
- type WaitingRoomNewResponseEnvelope
- type WaitingRoomService
- func (r *WaitingRoomService) Delete(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, ...) (res *WaitingRoomDeleteResponse, err error)
- func (r *WaitingRoomService) Edit(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, ...) (res *WaitingroomWaitingroom, err error)
- func (r *WaitingRoomService) Get(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, ...) (res *WaitingroomWaitingroom, err error)
- func (r *WaitingRoomService) List(ctx context.Context, zoneIdentifier string, opts ...option.RequestOption) (res *[]WaitingroomWaitingroom, err error)
- func (r *WaitingRoomService) New(ctx context.Context, zoneIdentifier string, body WaitingRoomNewParams, ...) (res *WaitingroomWaitingroom, err error)
- func (r *WaitingRoomService) Update(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, ...) (res *WaitingroomWaitingroom, err error)
- type WaitingRoomUpdateParams
- type WaitingRoomUpdateParamsAdditionalRoute
- type WaitingRoomUpdateParamsCookieAttributes
- type WaitingRoomUpdateParamsCookieAttributesSamesite
- type WaitingRoomUpdateParamsCookieAttributesSecure
- type WaitingRoomUpdateParamsDefaultTemplateLanguage
- type WaitingRoomUpdateParamsQueueingMethod
- type WaitingRoomUpdateParamsQueueingStatusCode
- type WaitingRoomUpdateResponseEnvelope
- type WaitingroomEventDetailsResult
- type WaitingroomEventResult
- type WaitingroomRuleResult
- type WaitingroomRuleResultAction
- type WaitingroomWaitingroom
- type WaitingroomWaitingroomAdditionalRoute
- type WaitingroomWaitingroomCookieAttributes
- type WaitingroomWaitingroomCookieAttributesSamesite
- type WaitingroomWaitingroomCookieAttributesSecure
- type WaitingroomWaitingroomDefaultTemplateLanguage
- type WaitingroomWaitingroomQueueingMethod
- type WaitingroomWaitingroomQueueingStatusCode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventDeleteResponse ¶
type EventDeleteResponse struct { ID interface{} `json:"id"` JSON eventDeleteResponseJSON `json:"-"` }
func (*EventDeleteResponse) UnmarshalJSON ¶
func (r *EventDeleteResponse) UnmarshalJSON(data []byte) (err error)
type EventDeleteResponseEnvelope ¶
type EventDeleteResponseEnvelope struct { Result EventDeleteResponse `json:"result,required"` JSON eventDeleteResponseEnvelopeJSON `json:"-"` }
func (*EventDeleteResponseEnvelope) UnmarshalJSON ¶
func (r *EventDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type EventDetailGetResponseEnvelope ¶
type EventDetailGetResponseEnvelope struct { Result WaitingroomEventDetailsResult `json:"result,required"` JSON eventDetailGetResponseEnvelopeJSON `json:"-"` }
func (*EventDetailGetResponseEnvelope) UnmarshalJSON ¶
func (r *EventDetailGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type EventDetailService ¶
type EventDetailService struct {
Options []option.RequestOption
}
EventDetailService 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 NewEventDetailService method instead.
func NewEventDetailService ¶
func NewEventDetailService(opts ...option.RequestOption) (r *EventDetailService)
NewEventDetailService 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 (*EventDetailService) Get ¶
func (r *EventDetailService) Get(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, eventID interface{}, opts ...option.RequestOption) (res *WaitingroomEventDetailsResult, err error)
Previews an event's configuration as if it was active. Inherited fields from the waiting room will be displayed with their current values.
type EventEditParams ¶
type EventEditParams struct { // An ISO 8601 timestamp that marks the end of the event. EventEndTime param.Field[string] `json:"event_end_time,required"` // An ISO 8601 timestamp that marks the start of the event. At this time, queued // users will be processed with the event's configuration. The start time must be // at least one minute before `event_end_time`. EventStartTime param.Field[string] `json:"event_start_time,required"` // A unique name to identify the event. Only alphanumeric characters, hyphens and // underscores are allowed. Name param.Field[string] `json:"name,required"` // If set, the event will override the waiting room's `custom_page_html` property // while it is active. If null, the event will inherit it. CustomPageHTML param.Field[string] `json:"custom_page_html"` // A note that you can use to add more details about the event. Description param.Field[string] `json:"description"` // If set, the event will override the waiting room's `disable_session_renewal` // property while it is active. If null, the event will inherit it. DisableSessionRenewal param.Field[bool] `json:"disable_session_renewal"` // If set, the event will override the waiting room's `new_users_per_minute` // property while it is active. If null, the event will inherit it. This can only // be set if the event's `total_active_users` property is also set. NewUsersPerMinute param.Field[int64] `json:"new_users_per_minute"` // An ISO 8601 timestamp that marks when to begin queueing all users before the // event starts. The prequeue must start at least five minutes before // `event_start_time`. PrequeueStartTime param.Field[string] `json:"prequeue_start_time"` // If set, the event will override the waiting room's `queueing_method` property // while it is active. If null, the event will inherit it. QueueingMethod param.Field[string] `json:"queueing_method"` // If set, the event will override the waiting room's `session_duration` property // while it is active. If null, the event will inherit it. SessionDuration param.Field[int64] `json:"session_duration"` // If enabled, users in the prequeue will be shuffled randomly at the // `event_start_time`. Requires that `prequeue_start_time` is not null. This is // useful for situations when many users will join the event prequeue at the same // time and you want to shuffle them to ensure fairness. Naturally, it makes the // most sense to enable this feature when the `queueing_method` during the event // respects ordering such as **fifo**, or else the shuffling may be unnecessary. ShuffleAtEventStart param.Field[bool] `json:"shuffle_at_event_start"` // Suspends or allows an event. If set to `true`, the event is ignored and traffic // will be handled based on the waiting room configuration. Suspended param.Field[bool] `json:"suspended"` // If set, the event will override the waiting room's `total_active_users` property // while it is active. If null, the event will inherit it. This can only be set if // the event's `new_users_per_minute` property is also set. TotalActiveUsers param.Field[int64] `json:"total_active_users"` }
func (EventEditParams) MarshalJSON ¶
func (r EventEditParams) MarshalJSON() (data []byte, err error)
type EventEditResponseEnvelope ¶
type EventEditResponseEnvelope struct { Result WaitingroomEventResult `json:"result,required"` JSON eventEditResponseEnvelopeJSON `json:"-"` }
func (*EventEditResponseEnvelope) UnmarshalJSON ¶
func (r *EventEditResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type EventGetResponseEnvelope ¶
type EventGetResponseEnvelope struct { Result WaitingroomEventResult `json:"result,required"` JSON eventGetResponseEnvelopeJSON `json:"-"` }
func (*EventGetResponseEnvelope) UnmarshalJSON ¶
func (r *EventGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type EventListResponseEnvelope ¶
type EventListResponseEnvelope struct { Errors []EventListResponseEnvelopeErrors `json:"errors,required"` Messages []EventListResponseEnvelopeMessages `json:"messages,required"` Result []WaitingroomEventResult `json:"result,required,nullable"` // Whether the API call was successful Success EventListResponseEnvelopeSuccess `json:"success,required"` ResultInfo EventListResponseEnvelopeResultInfo `json:"result_info"` JSON eventListResponseEnvelopeJSON `json:"-"` }
func (*EventListResponseEnvelope) UnmarshalJSON ¶
func (r *EventListResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type EventListResponseEnvelopeErrors ¶
type EventListResponseEnvelopeErrors struct { Code int64 `json:"code,required"` Message string `json:"message,required"` JSON eventListResponseEnvelopeErrorsJSON `json:"-"` }
func (*EventListResponseEnvelopeErrors) UnmarshalJSON ¶
func (r *EventListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)
type EventListResponseEnvelopeMessages ¶
type EventListResponseEnvelopeMessages struct { Code int64 `json:"code,required"` Message string `json:"message,required"` JSON eventListResponseEnvelopeMessagesJSON `json:"-"` }
func (*EventListResponseEnvelopeMessages) UnmarshalJSON ¶
func (r *EventListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)
type EventListResponseEnvelopeResultInfo ¶
type EventListResponseEnvelopeResultInfo struct { // Total number of results for the requested service Count float64 `json:"count"` // Current page within paginated list of results Page float64 `json:"page"` // Number of results per page of results PerPage float64 `json:"per_page"` // Total results available without any search parameters TotalCount float64 `json:"total_count"` JSON eventListResponseEnvelopeResultInfoJSON `json:"-"` }
func (*EventListResponseEnvelopeResultInfo) UnmarshalJSON ¶
func (r *EventListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error)
type EventListResponseEnvelopeSuccess ¶
type EventListResponseEnvelopeSuccess bool
Whether the API call was successful
const (
EventListResponseEnvelopeSuccessTrue EventListResponseEnvelopeSuccess = true
)
type EventNewParams ¶
type EventNewParams struct { // An ISO 8601 timestamp that marks the end of the event. EventEndTime param.Field[string] `json:"event_end_time,required"` // An ISO 8601 timestamp that marks the start of the event. At this time, queued // users will be processed with the event's configuration. The start time must be // at least one minute before `event_end_time`. EventStartTime param.Field[string] `json:"event_start_time,required"` // A unique name to identify the event. Only alphanumeric characters, hyphens and // underscores are allowed. Name param.Field[string] `json:"name,required"` // If set, the event will override the waiting room's `custom_page_html` property // while it is active. If null, the event will inherit it. CustomPageHTML param.Field[string] `json:"custom_page_html"` // A note that you can use to add more details about the event. Description param.Field[string] `json:"description"` // If set, the event will override the waiting room's `disable_session_renewal` // property while it is active. If null, the event will inherit it. DisableSessionRenewal param.Field[bool] `json:"disable_session_renewal"` // If set, the event will override the waiting room's `new_users_per_minute` // property while it is active. If null, the event will inherit it. This can only // be set if the event's `total_active_users` property is also set. NewUsersPerMinute param.Field[int64] `json:"new_users_per_minute"` // An ISO 8601 timestamp that marks when to begin queueing all users before the // event starts. The prequeue must start at least five minutes before // `event_start_time`. PrequeueStartTime param.Field[string] `json:"prequeue_start_time"` // If set, the event will override the waiting room's `queueing_method` property // while it is active. If null, the event will inherit it. QueueingMethod param.Field[string] `json:"queueing_method"` // If set, the event will override the waiting room's `session_duration` property // while it is active. If null, the event will inherit it. SessionDuration param.Field[int64] `json:"session_duration"` // If enabled, users in the prequeue will be shuffled randomly at the // `event_start_time`. Requires that `prequeue_start_time` is not null. This is // useful for situations when many users will join the event prequeue at the same // time and you want to shuffle them to ensure fairness. Naturally, it makes the // most sense to enable this feature when the `queueing_method` during the event // respects ordering such as **fifo**, or else the shuffling may be unnecessary. ShuffleAtEventStart param.Field[bool] `json:"shuffle_at_event_start"` // Suspends or allows an event. If set to `true`, the event is ignored and traffic // will be handled based on the waiting room configuration. Suspended param.Field[bool] `json:"suspended"` // If set, the event will override the waiting room's `total_active_users` property // while it is active. If null, the event will inherit it. This can only be set if // the event's `new_users_per_minute` property is also set. TotalActiveUsers param.Field[int64] `json:"total_active_users"` }
func (EventNewParams) MarshalJSON ¶
func (r EventNewParams) MarshalJSON() (data []byte, err error)
type EventNewResponseEnvelope ¶
type EventNewResponseEnvelope struct { Result WaitingroomEventResult `json:"result,required"` JSON eventNewResponseEnvelopeJSON `json:"-"` }
func (*EventNewResponseEnvelope) UnmarshalJSON ¶
func (r *EventNewResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type EventService ¶
type EventService struct { Options []option.RequestOption Details *EventDetailService }
EventService 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 NewEventService method instead.
func NewEventService ¶
func NewEventService(opts ...option.RequestOption) (r *EventService)
NewEventService 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 (*EventService) Delete ¶
func (r *EventService) Delete(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, eventID interface{}, opts ...option.RequestOption) (res *EventDeleteResponse, err error)
Deletes an event for a waiting room.
func (*EventService) Edit ¶
func (r *EventService) Edit(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, eventID interface{}, body EventEditParams, opts ...option.RequestOption) (res *WaitingroomEventResult, err error)
Patches a configured event for a waiting room.
func (*EventService) Get ¶
func (r *EventService) Get(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, eventID interface{}, opts ...option.RequestOption) (res *WaitingroomEventResult, err error)
Fetches a single configured event for a waiting room.
func (*EventService) List ¶
func (r *EventService) List(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, opts ...option.RequestOption) (res *[]WaitingroomEventResult, err error)
Lists events for a waiting room.
func (*EventService) New ¶
func (r *EventService) New(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, body EventNewParams, opts ...option.RequestOption) (res *WaitingroomEventResult, err error)
Only available for the Waiting Room Advanced subscription. Creates an event for a waiting room. An event takes place during a specified period of time, temporarily changing the behavior of a waiting room. While the event is active, some of the properties in the event's configuration may either override or inherit from the waiting room's configuration. Note that events cannot overlap with each other, so only one event can be active at a time.
func (*EventService) Update ¶
func (r *EventService) Update(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, eventID interface{}, body EventUpdateParams, opts ...option.RequestOption) (res *WaitingroomEventResult, err error)
Updates a configured event for a waiting room.
type EventUpdateParams ¶
type EventUpdateParams struct { // An ISO 8601 timestamp that marks the end of the event. EventEndTime param.Field[string] `json:"event_end_time,required"` // An ISO 8601 timestamp that marks the start of the event. At this time, queued // users will be processed with the event's configuration. The start time must be // at least one minute before `event_end_time`. EventStartTime param.Field[string] `json:"event_start_time,required"` // A unique name to identify the event. Only alphanumeric characters, hyphens and // underscores are allowed. Name param.Field[string] `json:"name,required"` // If set, the event will override the waiting room's `custom_page_html` property // while it is active. If null, the event will inherit it. CustomPageHTML param.Field[string] `json:"custom_page_html"` // A note that you can use to add more details about the event. Description param.Field[string] `json:"description"` // If set, the event will override the waiting room's `disable_session_renewal` // property while it is active. If null, the event will inherit it. DisableSessionRenewal param.Field[bool] `json:"disable_session_renewal"` // If set, the event will override the waiting room's `new_users_per_minute` // property while it is active. If null, the event will inherit it. This can only // be set if the event's `total_active_users` property is also set. NewUsersPerMinute param.Field[int64] `json:"new_users_per_minute"` // An ISO 8601 timestamp that marks when to begin queueing all users before the // event starts. The prequeue must start at least five minutes before // `event_start_time`. PrequeueStartTime param.Field[string] `json:"prequeue_start_time"` // If set, the event will override the waiting room's `queueing_method` property // while it is active. If null, the event will inherit it. QueueingMethod param.Field[string] `json:"queueing_method"` // If set, the event will override the waiting room's `session_duration` property // while it is active. If null, the event will inherit it. SessionDuration param.Field[int64] `json:"session_duration"` // If enabled, users in the prequeue will be shuffled randomly at the // `event_start_time`. Requires that `prequeue_start_time` is not null. This is // useful for situations when many users will join the event prequeue at the same // time and you want to shuffle them to ensure fairness. Naturally, it makes the // most sense to enable this feature when the `queueing_method` during the event // respects ordering such as **fifo**, or else the shuffling may be unnecessary. ShuffleAtEventStart param.Field[bool] `json:"shuffle_at_event_start"` // Suspends or allows an event. If set to `true`, the event is ignored and traffic // will be handled based on the waiting room configuration. Suspended param.Field[bool] `json:"suspended"` // If set, the event will override the waiting room's `total_active_users` property // while it is active. If null, the event will inherit it. This can only be set if // the event's `new_users_per_minute` property is also set. TotalActiveUsers param.Field[int64] `json:"total_active_users"` }
func (EventUpdateParams) MarshalJSON ¶
func (r EventUpdateParams) MarshalJSON() (data []byte, err error)
type EventUpdateResponseEnvelope ¶
type EventUpdateResponseEnvelope struct { Result WaitingroomEventResult `json:"result,required"` JSON eventUpdateResponseEnvelopeJSON `json:"-"` }
func (*EventUpdateResponseEnvelope) UnmarshalJSON ¶
func (r *EventUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type PagePreviewParams ¶
type PagePreviewParams struct { // Only available for the Waiting Room Advanced subscription. This is a template // html file that will be rendered at the edge. If no custom_page_html is provided, // the default waiting room will be used. The template is based on mustache ( // https://mustache.github.io/ ). There are several variables that are evaluated by // the Cloudflare edge: // // 1. {{`waitTimeKnown`}} Acts like a boolean value that indicates the behavior to // take when wait time is not available, for instance when queue_all is // **true**. // 2. {{`waitTimeFormatted`}} Estimated wait time for the user. For example, five // minutes. Alternatively, you can use: // 3. {{`waitTime`}} Number of minutes of estimated wait for a user. // 4. {{`waitTimeHours`}} Number of hours of estimated wait for a user // (`Math.floor(waitTime/60)`). // 5. {{`waitTimeHourMinutes`}} Number of minutes above the `waitTimeHours` value // (`waitTime%60`). // 6. {{`queueIsFull`}} Changes to **true** when no more people can be added to the // queue. // // To view the full list of variables, look at the `cfWaitingRoom` object described // under the `json_response_enabled` property in other Waiting Room API calls. CustomHTML param.Field[string] `json:"custom_html,required"` }
func (PagePreviewParams) MarshalJSON ¶
func (r PagePreviewParams) MarshalJSON() (data []byte, err error)
type PagePreviewResponse ¶
type PagePreviewResponse struct { // URL where the custom waiting room page can temporarily be previewed. PreviewURL string `json:"preview_url"` JSON pagePreviewResponseJSON `json:"-"` }
func (*PagePreviewResponse) UnmarshalJSON ¶
func (r *PagePreviewResponse) UnmarshalJSON(data []byte) (err error)
type PagePreviewResponseEnvelope ¶
type PagePreviewResponseEnvelope struct { Result PagePreviewResponse `json:"result,required"` JSON pagePreviewResponseEnvelopeJSON `json:"-"` }
func (*PagePreviewResponseEnvelope) UnmarshalJSON ¶
func (r *PagePreviewResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type PageService ¶
type PageService struct {
Options []option.RequestOption
}
PageService 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 NewPageService method instead.
func NewPageService ¶
func NewPageService(opts ...option.RequestOption) (r *PageService)
NewPageService 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 (*PageService) Preview ¶
func (r *PageService) Preview(ctx context.Context, zoneIdentifier string, body PagePreviewParams, opts ...option.RequestOption) (res *PagePreviewResponse, err error)
Creates a waiting room page preview. Upload a custom waiting room page for preview. You will receive a preview URL in the form `http://waitingrooms.dev/preview/<uuid>`. You can use the following query parameters to change the state of the preview:
- `force_queue`: Boolean indicating if all users will be queued in the waiting room and no one will be let into the origin website (also known as queueAll).
- `queue_is_full`: Boolean indicating if the waiting room's queue is currently full and not accepting new users at the moment.
- `queueing_method`: The queueing method currently used by the waiting room. - **fifo** indicates a FIFO queue. - **random** indicates a Random queue. - **passthrough** indicates a Passthrough queue. Keep in mind that the waiting room page will only be displayed if `force_queue=true` or `event=prequeueing` — for other cases the request will pass through to the origin. For our preview, this will be a fake origin website returning "Welcome". - **reject** indicates a Reject queue.
- `event`: Used to preview a waiting room event. - **none** indicates no event is occurring. - **prequeueing** indicates that an event is prequeueing (between `prequeue_start_time` and `event_start_time`). - **started** indicates that an event has started (between `event_start_time` and `event_end_time`).
- `shuffle_at_event_start`: Boolean indicating if the event will shuffle users in the prequeue when it starts. This can only be set to **true** if an event is active (`event` is not **none**).
For example, you can make a request to `http://waitingrooms.dev/preview/<uuid>?force_queue=false&queue_is_full=false&queueing_method=random&event=started&shuffle_at_event_start=true` 6. `waitTime`: Non-zero, positive integer indicating the estimated wait time in minutes. The default value is 10 minutes.
For example, you can make a request to `http://waitingrooms.dev/preview/<uuid>?waitTime=50` to configure the estimated wait time as 50 minutes.
type RuleDeleteResponseEnvelope ¶
type RuleDeleteResponseEnvelope struct { Errors []RuleDeleteResponseEnvelopeErrors `json:"errors,required"` Messages []RuleDeleteResponseEnvelopeMessages `json:"messages,required"` Result []WaitingroomRuleResult `json:"result,required,nullable"` // Whether the API call was successful Success RuleDeleteResponseEnvelopeSuccess `json:"success,required"` ResultInfo RuleDeleteResponseEnvelopeResultInfo `json:"result_info"` JSON ruleDeleteResponseEnvelopeJSON `json:"-"` }
func (*RuleDeleteResponseEnvelope) UnmarshalJSON ¶
func (r *RuleDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type RuleDeleteResponseEnvelopeErrors ¶
type RuleDeleteResponseEnvelopeErrors struct { Code int64 `json:"code,required"` Message string `json:"message,required"` JSON ruleDeleteResponseEnvelopeErrorsJSON `json:"-"` }
func (*RuleDeleteResponseEnvelopeErrors) UnmarshalJSON ¶
func (r *RuleDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)
type RuleDeleteResponseEnvelopeMessages ¶
type RuleDeleteResponseEnvelopeMessages struct { Code int64 `json:"code,required"` Message string `json:"message,required"` JSON ruleDeleteResponseEnvelopeMessagesJSON `json:"-"` }
func (*RuleDeleteResponseEnvelopeMessages) UnmarshalJSON ¶
func (r *RuleDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)
type RuleDeleteResponseEnvelopeResultInfo ¶
type RuleDeleteResponseEnvelopeResultInfo struct { // Total number of results for the requested service Count float64 `json:"count"` // Current page within paginated list of results Page float64 `json:"page"` // Number of results per page of results PerPage float64 `json:"per_page"` // Total results available without any search parameters TotalCount float64 `json:"total_count"` JSON ruleDeleteResponseEnvelopeResultInfoJSON `json:"-"` }
func (*RuleDeleteResponseEnvelopeResultInfo) UnmarshalJSON ¶
func (r *RuleDeleteResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error)
type RuleDeleteResponseEnvelopeSuccess ¶
type RuleDeleteResponseEnvelopeSuccess bool
Whether the API call was successful
const (
RuleDeleteResponseEnvelopeSuccessTrue RuleDeleteResponseEnvelopeSuccess = true
)
type RuleEditParams ¶
type RuleEditParams struct { // The action to take when the expression matches. Action param.Field[RuleEditParamsAction] `json:"action,required"` // Criteria defining when there is a match for the current rule. Expression param.Field[string] `json:"expression,required"` // The description of the rule. Description param.Field[string] `json:"description"` // When set to true, the rule is enabled. Enabled param.Field[bool] `json:"enabled"` // Reorder the position of a rule Position param.Field[RuleEditParamsPosition] `json:"position"` }
func (RuleEditParams) MarshalJSON ¶
func (r RuleEditParams) MarshalJSON() (data []byte, err error)
type RuleEditParamsAction ¶
type RuleEditParamsAction string
The action to take when the expression matches.
const (
RuleEditParamsActionBypassWaitingRoom RuleEditParamsAction = "bypass_waiting_room"
)
type RuleEditParamsPosition ¶
type RuleEditParamsPosition interface {
// contains filtered or unexported methods
}
Reorder the position of a rule
Satisfied by waiting_rooms.RuleEditParamsPositionObject, waiting_rooms.RuleEditParamsPositionObject, waiting_rooms.RuleEditParamsPositionObject.
type RuleEditParamsPositionObject ¶
type RuleEditParamsPositionObject struct { // Places the rule in the exact position specified by the integer number // <POSITION_NUMBER>. Position numbers start with 1. Existing rules in the ruleset // from the specified position number onward are shifted one position (no rule is // overwritten). Index param.Field[int64] `json:"index"` }
func (RuleEditParamsPositionObject) MarshalJSON ¶
func (r RuleEditParamsPositionObject) MarshalJSON() (data []byte, err error)
type RuleEditResponseEnvelope ¶
type RuleEditResponseEnvelope struct { Errors []RuleEditResponseEnvelopeErrors `json:"errors,required"` Messages []RuleEditResponseEnvelopeMessages `json:"messages,required"` Result []WaitingroomRuleResult `json:"result,required,nullable"` // Whether the API call was successful Success RuleEditResponseEnvelopeSuccess `json:"success,required"` ResultInfo RuleEditResponseEnvelopeResultInfo `json:"result_info"` JSON ruleEditResponseEnvelopeJSON `json:"-"` }
func (*RuleEditResponseEnvelope) UnmarshalJSON ¶
func (r *RuleEditResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type RuleEditResponseEnvelopeErrors ¶
type RuleEditResponseEnvelopeErrors struct { Code int64 `json:"code,required"` Message string `json:"message,required"` JSON ruleEditResponseEnvelopeErrorsJSON `json:"-"` }
func (*RuleEditResponseEnvelopeErrors) UnmarshalJSON ¶
func (r *RuleEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)
type RuleEditResponseEnvelopeMessages ¶
type RuleEditResponseEnvelopeMessages struct { Code int64 `json:"code,required"` Message string `json:"message,required"` JSON ruleEditResponseEnvelopeMessagesJSON `json:"-"` }
func (*RuleEditResponseEnvelopeMessages) UnmarshalJSON ¶
func (r *RuleEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)
type RuleEditResponseEnvelopeResultInfo ¶
type RuleEditResponseEnvelopeResultInfo struct { // Total number of results for the requested service Count float64 `json:"count"` // Current page within paginated list of results Page float64 `json:"page"` // Number of results per page of results PerPage float64 `json:"per_page"` // Total results available without any search parameters TotalCount float64 `json:"total_count"` JSON ruleEditResponseEnvelopeResultInfoJSON `json:"-"` }
func (*RuleEditResponseEnvelopeResultInfo) UnmarshalJSON ¶
func (r *RuleEditResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error)
type RuleEditResponseEnvelopeSuccess ¶
type RuleEditResponseEnvelopeSuccess bool
Whether the API call was successful
const (
RuleEditResponseEnvelopeSuccessTrue RuleEditResponseEnvelopeSuccess = true
)
type RuleListResponseEnvelope ¶
type RuleListResponseEnvelope struct { Errors []RuleListResponseEnvelopeErrors `json:"errors,required"` Messages []RuleListResponseEnvelopeMessages `json:"messages,required"` Result []WaitingroomRuleResult `json:"result,required,nullable"` // Whether the API call was successful Success RuleListResponseEnvelopeSuccess `json:"success,required"` ResultInfo RuleListResponseEnvelopeResultInfo `json:"result_info"` JSON ruleListResponseEnvelopeJSON `json:"-"` }
func (*RuleListResponseEnvelope) UnmarshalJSON ¶
func (r *RuleListResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type RuleListResponseEnvelopeErrors ¶
type RuleListResponseEnvelopeErrors struct { Code int64 `json:"code,required"` Message string `json:"message,required"` JSON ruleListResponseEnvelopeErrorsJSON `json:"-"` }
func (*RuleListResponseEnvelopeErrors) UnmarshalJSON ¶
func (r *RuleListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)
type RuleListResponseEnvelopeMessages ¶
type RuleListResponseEnvelopeMessages struct { Code int64 `json:"code,required"` Message string `json:"message,required"` JSON ruleListResponseEnvelopeMessagesJSON `json:"-"` }
func (*RuleListResponseEnvelopeMessages) UnmarshalJSON ¶
func (r *RuleListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)
type RuleListResponseEnvelopeResultInfo ¶
type RuleListResponseEnvelopeResultInfo struct { // Total number of results for the requested service Count float64 `json:"count"` // Current page within paginated list of results Page float64 `json:"page"` // Number of results per page of results PerPage float64 `json:"per_page"` // Total results available without any search parameters TotalCount float64 `json:"total_count"` JSON ruleListResponseEnvelopeResultInfoJSON `json:"-"` }
func (*RuleListResponseEnvelopeResultInfo) UnmarshalJSON ¶
func (r *RuleListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error)
type RuleListResponseEnvelopeSuccess ¶
type RuleListResponseEnvelopeSuccess bool
Whether the API call was successful
const (
RuleListResponseEnvelopeSuccessTrue RuleListResponseEnvelopeSuccess = true
)
type RuleNewParams ¶
type RuleNewParams struct { // The action to take when the expression matches. Action param.Field[RuleNewParamsAction] `json:"action,required"` // Criteria defining when there is a match for the current rule. Expression param.Field[string] `json:"expression,required"` // The description of the rule. Description param.Field[string] `json:"description"` // When set to true, the rule is enabled. Enabled param.Field[bool] `json:"enabled"` }
func (RuleNewParams) MarshalJSON ¶
func (r RuleNewParams) MarshalJSON() (data []byte, err error)
type RuleNewParamsAction ¶
type RuleNewParamsAction string
The action to take when the expression matches.
const (
RuleNewParamsActionBypassWaitingRoom RuleNewParamsAction = "bypass_waiting_room"
)
type RuleNewResponseEnvelope ¶
type RuleNewResponseEnvelope struct { Errors []RuleNewResponseEnvelopeErrors `json:"errors,required"` Messages []RuleNewResponseEnvelopeMessages `json:"messages,required"` Result []WaitingroomRuleResult `json:"result,required,nullable"` // Whether the API call was successful Success RuleNewResponseEnvelopeSuccess `json:"success,required"` ResultInfo RuleNewResponseEnvelopeResultInfo `json:"result_info"` JSON ruleNewResponseEnvelopeJSON `json:"-"` }
func (*RuleNewResponseEnvelope) UnmarshalJSON ¶
func (r *RuleNewResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type RuleNewResponseEnvelopeErrors ¶
type RuleNewResponseEnvelopeErrors struct { Code int64 `json:"code,required"` Message string `json:"message,required"` JSON ruleNewResponseEnvelopeErrorsJSON `json:"-"` }
func (*RuleNewResponseEnvelopeErrors) UnmarshalJSON ¶
func (r *RuleNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)
type RuleNewResponseEnvelopeMessages ¶
type RuleNewResponseEnvelopeMessages struct { Code int64 `json:"code,required"` Message string `json:"message,required"` JSON ruleNewResponseEnvelopeMessagesJSON `json:"-"` }
func (*RuleNewResponseEnvelopeMessages) UnmarshalJSON ¶
func (r *RuleNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)
type RuleNewResponseEnvelopeResultInfo ¶
type RuleNewResponseEnvelopeResultInfo struct { // Total number of results for the requested service Count float64 `json:"count"` // Current page within paginated list of results Page float64 `json:"page"` // Number of results per page of results PerPage float64 `json:"per_page"` // Total results available without any search parameters TotalCount float64 `json:"total_count"` JSON ruleNewResponseEnvelopeResultInfoJSON `json:"-"` }
func (*RuleNewResponseEnvelopeResultInfo) UnmarshalJSON ¶
func (r *RuleNewResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error)
type RuleNewResponseEnvelopeSuccess ¶
type RuleNewResponseEnvelopeSuccess bool
Whether the API call was successful
const (
RuleNewResponseEnvelopeSuccessTrue RuleNewResponseEnvelopeSuccess = true
)
type RuleService ¶
type RuleService struct {
Options []option.RequestOption
}
RuleService 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 NewRuleService method instead.
func NewRuleService ¶
func NewRuleService(opts ...option.RequestOption) (r *RuleService)
NewRuleService 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 (*RuleService) Delete ¶
func (r *RuleService) Delete(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, ruleID string, opts ...option.RequestOption) (res *[]WaitingroomRuleResult, err error)
Deletes a rule for a waiting room.
func (*RuleService) Edit ¶
func (r *RuleService) Edit(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, ruleID string, body RuleEditParams, opts ...option.RequestOption) (res *[]WaitingroomRuleResult, err error)
Patches a rule for a waiting room.
func (*RuleService) List ¶
func (r *RuleService) List(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, opts ...option.RequestOption) (res *[]WaitingroomRuleResult, err error)
Lists rules for a waiting room.
func (*RuleService) New ¶
func (r *RuleService) New(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, body RuleNewParams, opts ...option.RequestOption) (res *[]WaitingroomRuleResult, err error)
Only available for the Waiting Room Advanced subscription. Creates a rule for a waiting room.
func (*RuleService) Update ¶
func (r *RuleService) Update(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, body RuleUpdateParams, opts ...option.RequestOption) (res *[]WaitingroomRuleResult, err error)
Only available for the Waiting Room Advanced subscription. Replaces all rules for a waiting room.
type RuleUpdateParams ¶
type RuleUpdateParams struct {
Body param.Field[[]RuleUpdateParamsBody] `json:"body,required"`
}
func (RuleUpdateParams) MarshalJSON ¶
func (r RuleUpdateParams) MarshalJSON() (data []byte, err error)
type RuleUpdateParamsBody ¶
type RuleUpdateParamsBody struct { // The action to take when the expression matches. Action param.Field[RuleUpdateParamsBodyAction] `json:"action,required"` // Criteria defining when there is a match for the current rule. Expression param.Field[string] `json:"expression,required"` // The description of the rule. Description param.Field[string] `json:"description"` // When set to true, the rule is enabled. Enabled param.Field[bool] `json:"enabled"` }
func (RuleUpdateParamsBody) MarshalJSON ¶
func (r RuleUpdateParamsBody) MarshalJSON() (data []byte, err error)
type RuleUpdateParamsBodyAction ¶
type RuleUpdateParamsBodyAction string
The action to take when the expression matches.
const (
RuleUpdateParamsBodyActionBypassWaitingRoom RuleUpdateParamsBodyAction = "bypass_waiting_room"
)
type RuleUpdateResponseEnvelope ¶
type RuleUpdateResponseEnvelope struct { Errors []RuleUpdateResponseEnvelopeErrors `json:"errors,required"` Messages []RuleUpdateResponseEnvelopeMessages `json:"messages,required"` Result []WaitingroomRuleResult `json:"result,required,nullable"` // Whether the API call was successful Success RuleUpdateResponseEnvelopeSuccess `json:"success,required"` ResultInfo RuleUpdateResponseEnvelopeResultInfo `json:"result_info"` JSON ruleUpdateResponseEnvelopeJSON `json:"-"` }
func (*RuleUpdateResponseEnvelope) UnmarshalJSON ¶
func (r *RuleUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type RuleUpdateResponseEnvelopeErrors ¶
type RuleUpdateResponseEnvelopeErrors struct { Code int64 `json:"code,required"` Message string `json:"message,required"` JSON ruleUpdateResponseEnvelopeErrorsJSON `json:"-"` }
func (*RuleUpdateResponseEnvelopeErrors) UnmarshalJSON ¶
func (r *RuleUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)
type RuleUpdateResponseEnvelopeMessages ¶
type RuleUpdateResponseEnvelopeMessages struct { Code int64 `json:"code,required"` Message string `json:"message,required"` JSON ruleUpdateResponseEnvelopeMessagesJSON `json:"-"` }
func (*RuleUpdateResponseEnvelopeMessages) UnmarshalJSON ¶
func (r *RuleUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)
type RuleUpdateResponseEnvelopeResultInfo ¶
type RuleUpdateResponseEnvelopeResultInfo struct { // Total number of results for the requested service Count float64 `json:"count"` // Current page within paginated list of results Page float64 `json:"page"` // Number of results per page of results PerPage float64 `json:"per_page"` // Total results available without any search parameters TotalCount float64 `json:"total_count"` JSON ruleUpdateResponseEnvelopeResultInfoJSON `json:"-"` }
func (*RuleUpdateResponseEnvelopeResultInfo) UnmarshalJSON ¶
func (r *RuleUpdateResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error)
type RuleUpdateResponseEnvelopeSuccess ¶
type RuleUpdateResponseEnvelopeSuccess bool
Whether the API call was successful
const (
RuleUpdateResponseEnvelopeSuccessTrue RuleUpdateResponseEnvelopeSuccess = true
)
type SettingEditParams ¶
type SettingEditParams struct { // Whether to allow verified search engine crawlers to bypass all waiting rooms on // this zone. Verified search engine crawlers will not be tracked or counted by the // waiting room system, and will not appear in waiting room analytics. SearchEngineCrawlerBypass param.Field[bool] `json:"search_engine_crawler_bypass"` }
func (SettingEditParams) MarshalJSON ¶
func (r SettingEditParams) MarshalJSON() (data []byte, err error)
type SettingEditResponse ¶
type SettingEditResponse struct { // Whether to allow verified search engine crawlers to bypass all waiting rooms on // this zone. Verified search engine crawlers will not be tracked or counted by the // waiting room system, and will not appear in waiting room analytics. SearchEngineCrawlerBypass bool `json:"search_engine_crawler_bypass,required"` JSON settingEditResponseJSON `json:"-"` }
func (*SettingEditResponse) UnmarshalJSON ¶
func (r *SettingEditResponse) UnmarshalJSON(data []byte) (err error)
type SettingEditResponseEnvelope ¶
type SettingEditResponseEnvelope struct { Result SettingEditResponse `json:"result,required"` JSON settingEditResponseEnvelopeJSON `json:"-"` }
func (*SettingEditResponseEnvelope) UnmarshalJSON ¶
func (r *SettingEditResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type SettingGetResponse ¶
type SettingGetResponse struct { // Whether to allow verified search engine crawlers to bypass all waiting rooms on // this zone. Verified search engine crawlers will not be tracked or counted by the // waiting room system, and will not appear in waiting room analytics. SearchEngineCrawlerBypass bool `json:"search_engine_crawler_bypass,required"` JSON settingGetResponseJSON `json:"-"` }
func (*SettingGetResponse) UnmarshalJSON ¶
func (r *SettingGetResponse) UnmarshalJSON(data []byte) (err error)
type SettingGetResponseEnvelope ¶
type SettingGetResponseEnvelope struct { Result SettingGetResponse `json:"result,required"` JSON settingGetResponseEnvelopeJSON `json:"-"` }
func (*SettingGetResponseEnvelope) UnmarshalJSON ¶
func (r *SettingGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type SettingService ¶
type SettingService struct {
Options []option.RequestOption
}
SettingService 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 NewSettingService method instead.
func NewSettingService ¶
func NewSettingService(opts ...option.RequestOption) (r *SettingService)
NewSettingService 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 (*SettingService) Edit ¶
func (r *SettingService) Edit(ctx context.Context, zoneIdentifier string, body SettingEditParams, opts ...option.RequestOption) (res *SettingEditResponse, err error)
Patch zone-level Waiting Room settings
func (*SettingService) Get ¶
func (r *SettingService) Get(ctx context.Context, zoneIdentifier string, opts ...option.RequestOption) (res *SettingGetResponse, err error)
Get zone-level Waiting Room settings
func (*SettingService) Update ¶
func (r *SettingService) Update(ctx context.Context, zoneIdentifier string, body SettingUpdateParams, opts ...option.RequestOption) (res *SettingUpdateResponse, err error)
Update zone-level Waiting Room settings
type SettingUpdateParams ¶
type SettingUpdateParams struct { // Whether to allow verified search engine crawlers to bypass all waiting rooms on // this zone. Verified search engine crawlers will not be tracked or counted by the // waiting room system, and will not appear in waiting room analytics. SearchEngineCrawlerBypass param.Field[bool] `json:"search_engine_crawler_bypass"` }
func (SettingUpdateParams) MarshalJSON ¶
func (r SettingUpdateParams) MarshalJSON() (data []byte, err error)
type SettingUpdateResponse ¶
type SettingUpdateResponse struct { // Whether to allow verified search engine crawlers to bypass all waiting rooms on // this zone. Verified search engine crawlers will not be tracked or counted by the // waiting room system, and will not appear in waiting room analytics. SearchEngineCrawlerBypass bool `json:"search_engine_crawler_bypass,required"` JSON settingUpdateResponseJSON `json:"-"` }
func (*SettingUpdateResponse) UnmarshalJSON ¶
func (r *SettingUpdateResponse) UnmarshalJSON(data []byte) (err error)
type SettingUpdateResponseEnvelope ¶
type SettingUpdateResponseEnvelope struct { Result SettingUpdateResponse `json:"result,required"` JSON settingUpdateResponseEnvelopeJSON `json:"-"` }
func (*SettingUpdateResponseEnvelope) UnmarshalJSON ¶
func (r *SettingUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type StatusGetResponse ¶
type StatusGetResponse struct { EstimatedQueuedUsers int64 `json:"estimated_queued_users"` EstimatedTotalActiveUsers int64 `json:"estimated_total_active_users"` EventID string `json:"event_id"` MaxEstimatedTimeMinutes int64 `json:"max_estimated_time_minutes"` Status StatusGetResponseStatus `json:"status"` JSON statusGetResponseJSON `json:"-"` }
func (*StatusGetResponse) UnmarshalJSON ¶
func (r *StatusGetResponse) UnmarshalJSON(data []byte) (err error)
type StatusGetResponseEnvelope ¶
type StatusGetResponseEnvelope struct { Result StatusGetResponse `json:"result,required"` JSON statusGetResponseEnvelopeJSON `json:"-"` }
func (*StatusGetResponseEnvelope) UnmarshalJSON ¶
func (r *StatusGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type StatusGetResponseStatus ¶
type StatusGetResponseStatus string
const ( StatusGetResponseStatusEventPrequeueing StatusGetResponseStatus = "event_prequeueing" StatusGetResponseStatusNotQueueing StatusGetResponseStatus = "not_queueing" StatusGetResponseStatusQueueing StatusGetResponseStatus = "queueing" )
type StatusService ¶
type StatusService struct {
Options []option.RequestOption
}
StatusService 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 NewStatusService method instead.
func NewStatusService ¶
func NewStatusService(opts ...option.RequestOption) (r *StatusService)
NewStatusService 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 (*StatusService) Get ¶
func (r *StatusService) Get(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, opts ...option.RequestOption) (res *StatusGetResponse, err error)
Fetches the status of a configured waiting room. Response fields include:
- `status`: String indicating the status of the waiting room. The possible status are: - **not_queueing** indicates that the configured thresholds have not been met and all users are going through to the origin. - **queueing** indicates that the thresholds have been met and some users are held in the waiting room. - **event_prequeueing** indicates that an event is active and is currently prequeueing users before it starts.
- `event_id`: String of the current event's `id` if an event is active, otherwise an empty string.
- `estimated_queued_users`: Integer of the estimated number of users currently waiting in the queue.
- `estimated_total_active_users`: Integer of the estimated number of users currently active on the origin.
- `max_estimated_time_minutes`: Integer of the maximum estimated time currently presented to the users.
type WaitingRoomDeleteResponse ¶
type WaitingRoomDeleteResponse struct { ID interface{} `json:"id"` JSON waitingRoomDeleteResponseJSON `json:"-"` }
func (*WaitingRoomDeleteResponse) UnmarshalJSON ¶
func (r *WaitingRoomDeleteResponse) UnmarshalJSON(data []byte) (err error)
type WaitingRoomDeleteResponseEnvelope ¶
type WaitingRoomDeleteResponseEnvelope struct { Result WaitingRoomDeleteResponse `json:"result,required"` JSON waitingRoomDeleteResponseEnvelopeJSON `json:"-"` }
func (*WaitingRoomDeleteResponseEnvelope) UnmarshalJSON ¶
func (r *WaitingRoomDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type WaitingRoomEditParams ¶
type WaitingRoomEditParams struct { // The host name to which the waiting room will be applied (no wildcards). Please // do not include the scheme (http:// or https://). The host and path combination // must be unique. Host param.Field[string] `json:"host,required"` // A unique name to identify the waiting room. Only alphanumeric characters, // hyphens and underscores are allowed. Name param.Field[string] `json:"name,required"` // Sets the number of new users that will be let into the route every minute. This // value is used as baseline for the number of users that are let in per minute. So // it is possible that there is a little more or little less traffic coming to the // route based on the traffic patterns at that time around the world. NewUsersPerMinute param.Field[int64] `json:"new_users_per_minute,required"` // Sets the total number of active user sessions on the route at a point in time. A // route is a combination of host and path on which a waiting room is available. // This value is used as a baseline for the total number of active user sessions on // the route. It is possible to have a situation where there are more or less // active users sessions on the route based on the traffic patterns at that time // around the world. TotalActiveUsers param.Field[int64] `json:"total_active_users,required"` // Only available for the Waiting Room Advanced subscription. Additional hostname // and path combinations to which this waiting room will be applied. There is an // implied wildcard at the end of the path. The hostname and path combination must // be unique to this and all other waiting rooms. AdditionalRoutes param.Field[[]WaitingRoomEditParamsAdditionalRoute] `json:"additional_routes"` // Configures cookie attributes for the waiting room cookie. This encrypted cookie // stores a user's status in the waiting room, such as queue position. CookieAttributes param.Field[WaitingRoomEditParamsCookieAttributes] `json:"cookie_attributes"` // Appends a '\_' + a custom suffix to the end of Cloudflare Waiting Room's cookie // name(**cf_waitingroom). If `cookie_suffix` is "abcd", the cookie name will be // `**cf_waitingroom_abcd`. This field is required if using `additional_routes`. CookieSuffix param.Field[string] `json:"cookie_suffix"` // Only available for the Waiting Room Advanced subscription. This is a template // html file that will be rendered at the edge. If no custom_page_html is provided, // the default waiting room will be used. The template is based on mustache ( // https://mustache.github.io/ ). There are several variables that are evaluated by // the Cloudflare edge: // // 1. {{`waitTimeKnown`}} Acts like a boolean value that indicates the behavior to // take when wait time is not available, for instance when queue_all is // **true**. // 2. {{`waitTimeFormatted`}} Estimated wait time for the user. For example, five // minutes. Alternatively, you can use: // 3. {{`waitTime`}} Number of minutes of estimated wait for a user. // 4. {{`waitTimeHours`}} Number of hours of estimated wait for a user // (`Math.floor(waitTime/60)`). // 5. {{`waitTimeHourMinutes`}} Number of minutes above the `waitTimeHours` value // (`waitTime%60`). // 6. {{`queueIsFull`}} Changes to **true** when no more people can be added to the // queue. // // To view the full list of variables, look at the `cfWaitingRoom` object described // under the `json_response_enabled` property in other Waiting Room API calls. CustomPageHTML param.Field[string] `json:"custom_page_html"` // The language of the default page template. If no default_template_language is // provided, then `en-US` (English) will be used. DefaultTemplateLanguage param.Field[WaitingRoomEditParamsDefaultTemplateLanguage] `json:"default_template_language"` // A note that you can use to add more details about the waiting room. Description param.Field[string] `json:"description"` // Only available for the Waiting Room Advanced subscription. Disables automatic // renewal of session cookies. If `true`, an accepted user will have // session_duration minutes to browse the site. After that, they will have to go // through the waiting room again. If `false`, a user's session cookie will be // automatically renewed on every request. DisableSessionRenewal param.Field[bool] `json:"disable_session_renewal"` // Only available for the Waiting Room Advanced subscription. If `true`, requests // to the waiting room with the header `Accept: application/json` will receive a // JSON response object with information on the user's status in the waiting room // as opposed to the configured static HTML page. This JSON response object has one // property `cfWaitingRoom` which is an object containing the following fields: // // 1. `inWaitingRoom`: Boolean indicating if the user is in the waiting room // (always **true**). // 2. `waitTimeKnown`: Boolean indicating if the current estimated wait times are // accurate. If **false**, they are not available. // 3. `waitTime`: Valid only when `waitTimeKnown` is **true**. Integer indicating // the current estimated time in minutes the user will wait in the waiting room. // When `queueingMethod` is **random**, this is set to `waitTime50Percentile`. // 4. `waitTime25Percentile`: Valid only when `queueingMethod` is **random** and // `waitTimeKnown` is **true**. Integer indicating the current estimated maximum // wait time for the 25% of users that gain entry the fastest (25th percentile). // 5. `waitTime50Percentile`: Valid only when `queueingMethod` is **random** and // `waitTimeKnown` is **true**. Integer indicating the current estimated maximum // wait time for the 50% of users that gain entry the fastest (50th percentile). // In other words, half of the queued users are expected to let into the origin // website before `waitTime50Percentile` and half are expected to be let in // after it. // 6. `waitTime75Percentile`: Valid only when `queueingMethod` is **random** and // `waitTimeKnown` is **true**. Integer indicating the current estimated maximum // wait time for the 75% of users that gain entry the fastest (75th percentile). // 7. `waitTimeFormatted`: String displaying the `waitTime` formatted in English // for users. If `waitTimeKnown` is **false**, `waitTimeFormatted` will display // **unavailable**. // 8. `queueIsFull`: Boolean indicating if the waiting room's queue is currently // full and not accepting new users at the moment. // 9. `queueAll`: Boolean indicating if all users will be queued in the waiting // room and no one will be let into the origin website. // 10. `lastUpdated`: String displaying the timestamp as an ISO 8601 string of the // user's last attempt to leave the waiting room and be let into the origin // website. The user is able to make another attempt after // `refreshIntervalSeconds` past this time. If the user makes a request too // soon, it will be ignored and `lastUpdated` will not change. // 11. `refreshIntervalSeconds`: Integer indicating the number of seconds after // `lastUpdated` until the user is able to make another attempt to leave the // waiting room and be let into the origin website. When the `queueingMethod` // is `reject`, there is no specified refresh time — it will always be // **zero**. // 12. `queueingMethod`: The queueing method currently used by the waiting room. It // is either **fifo**, **random**, **passthrough**, or **reject**. // 13. `isFIFOQueue`: Boolean indicating if the waiting room uses a FIFO // (First-In-First-Out) queue. // 14. `isRandomQueue`: Boolean indicating if the waiting room uses a Random queue // where users gain access randomly. // 15. `isPassthroughQueue`: Boolean indicating if the waiting room uses a // passthrough queue. Keep in mind that when passthrough is enabled, this JSON // response will only exist when `queueAll` is **true** or `isEventPrequeueing` // is **true** because in all other cases requests will go directly to the // origin. // 16. `isRejectQueue`: Boolean indicating if the waiting room uses a reject queue. // 17. `isEventActive`: Boolean indicating if an event is currently occurring. // Events are able to change a waiting room's behavior during a specified // period of time. For additional information, look at the event properties // `prequeue_start_time`, `event_start_time`, and `event_end_time` in the // documentation for creating waiting room events. Events are considered active // between these start and end times, as well as during the prequeueing period // if it exists. // 18. `isEventPrequeueing`: Valid only when `isEventActive` is **true**. Boolean // indicating if an event is currently prequeueing users before it starts. // 19. `timeUntilEventStart`: Valid only when `isEventPrequeueing` is **true**. // Integer indicating the number of minutes until the event starts. // 20. `timeUntilEventStartFormatted`: String displaying the `timeUntilEventStart` // formatted in English for users. If `isEventPrequeueing` is **false**, // `timeUntilEventStartFormatted` will display **unavailable**. // 21. `timeUntilEventEnd`: Valid only when `isEventActive` is **true**. Integer // indicating the number of minutes until the event ends. // 22. `timeUntilEventEndFormatted`: String displaying the `timeUntilEventEnd` // formatted in English for users. If `isEventActive` is **false**, // `timeUntilEventEndFormatted` will display **unavailable**. // 23. `shuffleAtEventStart`: Valid only when `isEventActive` is **true**. Boolean // indicating if the users in the prequeue are shuffled randomly when the event // starts. // // An example cURL to a waiting room could be: // // curl -X GET "https://example.com/waitingroom" \ // -H "Accept: application/json" // // If `json_response_enabled` is **true** and the request hits the waiting room, an // example JSON response when `queueingMethod` is **fifo** and no event is active // could be: // // { // "cfWaitingRoom": { // "inWaitingRoom": true, // "waitTimeKnown": true, // "waitTime": 10, // "waitTime25Percentile": 0, // "waitTime50Percentile": 0, // "waitTime75Percentile": 0, // "waitTimeFormatted": "10 minutes", // "queueIsFull": false, // "queueAll": false, // "lastUpdated": "2020-08-03T23:46:00.000Z", // "refreshIntervalSeconds": 20, // "queueingMethod": "fifo", // "isFIFOQueue": true, // "isRandomQueue": false, // "isPassthroughQueue": false, // "isRejectQueue": false, // "isEventActive": false, // "isEventPrequeueing": false, // "timeUntilEventStart": 0, // "timeUntilEventStartFormatted": "unavailable", // "timeUntilEventEnd": 0, // "timeUntilEventEndFormatted": "unavailable", // "shuffleAtEventStart": false // } // } // // If `json_response_enabled` is **true** and the request hits the waiting room, an // example JSON response when `queueingMethod` is **random** and an event is active // could be: // // { // "cfWaitingRoom": { // "inWaitingRoom": true, // "waitTimeKnown": true, // "waitTime": 10, // "waitTime25Percentile": 5, // "waitTime50Percentile": 10, // "waitTime75Percentile": 15, // "waitTimeFormatted": "5 minutes to 15 minutes", // "queueIsFull": false, // "queueAll": false, // "lastUpdated": "2020-08-03T23:46:00.000Z", // "refreshIntervalSeconds": 20, // "queueingMethod": "random", // "isFIFOQueue": false, // "isRandomQueue": true, // "isPassthroughQueue": false, // "isRejectQueue": false, // "isEventActive": true, // "isEventPrequeueing": false, // "timeUntilEventStart": 0, // "timeUntilEventStartFormatted": "unavailable", // "timeUntilEventEnd": 15, // "timeUntilEventEndFormatted": "15 minutes", // "shuffleAtEventStart": true // } // }. JsonResponseEnabled param.Field[bool] `json:"json_response_enabled"` // Sets the path within the host to enable the waiting room on. The waiting room // will be enabled for all subpaths as well. If there are two waiting rooms on the // same subpath, the waiting room for the most specific path will be chosen. // Wildcards and query parameters are not supported. Path param.Field[string] `json:"path"` // If queue_all is `true`, all the traffic that is coming to a route will be sent // to the waiting room. No new traffic can get to the route once this field is set // and estimated time will become unavailable. QueueAll param.Field[bool] `json:"queue_all"` // Sets the queueing method used by the waiting room. Changing this parameter from // the **default** queueing method is only available for the Waiting Room Advanced // subscription. Regardless of the queueing method, if `queue_all` is enabled or an // event is prequeueing, users in the waiting room will not be accepted to the // origin. These users will always see a waiting room page that refreshes // automatically. The valid queueing methods are: // // 1. `fifo` **(default)**: First-In-First-Out queue where customers gain access in // the order they arrived. // 2. `random`: Random queue where customers gain access randomly, regardless of // arrival time. // 3. `passthrough`: Users will pass directly through the waiting room and into the // origin website. As a result, any configured limits will not be respected // while this is enabled. This method can be used as an alternative to disabling // a waiting room (with `suspended`) so that analytics are still reported. This // can be used if you wish to allow all traffic normally, but want to restrict // traffic during a waiting room event, or vice versa. // 4. `reject`: Users will be immediately rejected from the waiting room. As a // result, no users will reach the origin website while this is enabled. This // can be used if you wish to reject all traffic while performing maintenance, // block traffic during a specified period of time (an event), or block traffic // while events are not occurring. Consider a waiting room used for vaccine // distribution that only allows traffic during sign-up events, and otherwise // blocks all traffic. For this case, the waiting room uses `reject`, and its // events override this with `fifo`, `random`, or `passthrough`. When this // queueing method is enabled and neither `queueAll` is enabled nor an event is // prequeueing, the waiting room page **will not refresh automatically**. QueueingMethod param.Field[WaitingRoomEditParamsQueueingMethod] `json:"queueing_method"` // HTTP status code returned to a user while in the queue. QueueingStatusCode param.Field[WaitingRoomEditParamsQueueingStatusCode] `json:"queueing_status_code"` // Lifetime of a cookie (in minutes) set by Cloudflare for users who get access to // the route. If a user is not seen by Cloudflare again in that time period, they // will be treated as a new user that visits the route. SessionDuration param.Field[int64] `json:"session_duration"` // Suspends or allows traffic going to the waiting room. If set to `true`, the // traffic will not go to the waiting room. Suspended param.Field[bool] `json:"suspended"` }
func (WaitingRoomEditParams) MarshalJSON ¶
func (r WaitingRoomEditParams) MarshalJSON() (data []byte, err error)
type WaitingRoomEditParamsAdditionalRoute ¶
type WaitingRoomEditParamsAdditionalRoute struct { // The hostname to which this waiting room will be applied (no wildcards). The // hostname must be the primary domain, subdomain, or custom hostname (if using SSL // for SaaS) of this zone. Please do not include the scheme (http:// or https://). Host param.Field[string] `json:"host"` // Sets the path within the host to enable the waiting room on. The waiting room // will be enabled for all subpaths as well. If there are two waiting rooms on the // same subpath, the waiting room for the most specific path will be chosen. // Wildcards and query parameters are not supported. Path param.Field[string] `json:"path"` }
func (WaitingRoomEditParamsAdditionalRoute) MarshalJSON ¶
func (r WaitingRoomEditParamsAdditionalRoute) MarshalJSON() (data []byte, err error)
type WaitingRoomEditParamsCookieAttributes ¶
type WaitingRoomEditParamsCookieAttributes struct { // Configures the SameSite attribute on the waiting room cookie. Value `auto` will // be translated to `lax` or `none` depending if **Always Use HTTPS** is enabled. // Note that when using value `none`, the secure attribute cannot be set to // `never`. Samesite param.Field[WaitingRoomEditParamsCookieAttributesSamesite] `json:"samesite"` // Configures the Secure attribute on the waiting room cookie. Value `always` // indicates that the Secure attribute will be set in the Set-Cookie header, // `never` indicates that the Secure attribute will not be set, and `auto` will set // the Secure attribute depending if **Always Use HTTPS** is enabled. Secure param.Field[WaitingRoomEditParamsCookieAttributesSecure] `json:"secure"` }
Configures cookie attributes for the waiting room cookie. This encrypted cookie stores a user's status in the waiting room, such as queue position.
func (WaitingRoomEditParamsCookieAttributes) MarshalJSON ¶
func (r WaitingRoomEditParamsCookieAttributes) MarshalJSON() (data []byte, err error)
type WaitingRoomEditParamsCookieAttributesSamesite ¶
type WaitingRoomEditParamsCookieAttributesSamesite string
Configures the SameSite attribute on the waiting room cookie. Value `auto` will be translated to `lax` or `none` depending if **Always Use HTTPS** is enabled. Note that when using value `none`, the secure attribute cannot be set to `never`.
const ( WaitingRoomEditParamsCookieAttributesSamesiteAuto WaitingRoomEditParamsCookieAttributesSamesite = "auto" WaitingRoomEditParamsCookieAttributesSamesiteLax WaitingRoomEditParamsCookieAttributesSamesite = "lax" WaitingRoomEditParamsCookieAttributesSamesiteNone WaitingRoomEditParamsCookieAttributesSamesite = "none" WaitingRoomEditParamsCookieAttributesSamesiteStrict WaitingRoomEditParamsCookieAttributesSamesite = "strict" )
type WaitingRoomEditParamsCookieAttributesSecure ¶
type WaitingRoomEditParamsCookieAttributesSecure string
Configures the Secure attribute on the waiting room cookie. Value `always` indicates that the Secure attribute will be set in the Set-Cookie header, `never` indicates that the Secure attribute will not be set, and `auto` will set the Secure attribute depending if **Always Use HTTPS** is enabled.
const ( WaitingRoomEditParamsCookieAttributesSecureAuto WaitingRoomEditParamsCookieAttributesSecure = "auto" WaitingRoomEditParamsCookieAttributesSecureAlways WaitingRoomEditParamsCookieAttributesSecure = "always" WaitingRoomEditParamsCookieAttributesSecureNever WaitingRoomEditParamsCookieAttributesSecure = "never" )
type WaitingRoomEditParamsDefaultTemplateLanguage ¶
type WaitingRoomEditParamsDefaultTemplateLanguage string
The language of the default page template. If no default_template_language is provided, then `en-US` (English) will be used.
const ( WaitingRoomEditParamsDefaultTemplateLanguageEnUs WaitingRoomEditParamsDefaultTemplateLanguage = "en-US" WaitingRoomEditParamsDefaultTemplateLanguageEsEs WaitingRoomEditParamsDefaultTemplateLanguage = "es-ES" WaitingRoomEditParamsDefaultTemplateLanguageDeDe WaitingRoomEditParamsDefaultTemplateLanguage = "de-DE" WaitingRoomEditParamsDefaultTemplateLanguageFrFr WaitingRoomEditParamsDefaultTemplateLanguage = "fr-FR" WaitingRoomEditParamsDefaultTemplateLanguageItIt WaitingRoomEditParamsDefaultTemplateLanguage = "it-IT" WaitingRoomEditParamsDefaultTemplateLanguageJaJp WaitingRoomEditParamsDefaultTemplateLanguage = "ja-JP" WaitingRoomEditParamsDefaultTemplateLanguageKoKr WaitingRoomEditParamsDefaultTemplateLanguage = "ko-KR" WaitingRoomEditParamsDefaultTemplateLanguagePtBr WaitingRoomEditParamsDefaultTemplateLanguage = "pt-BR" WaitingRoomEditParamsDefaultTemplateLanguageZhCn WaitingRoomEditParamsDefaultTemplateLanguage = "zh-CN" WaitingRoomEditParamsDefaultTemplateLanguageZhTw WaitingRoomEditParamsDefaultTemplateLanguage = "zh-TW" WaitingRoomEditParamsDefaultTemplateLanguageNlNl WaitingRoomEditParamsDefaultTemplateLanguage = "nl-NL" WaitingRoomEditParamsDefaultTemplateLanguagePlPl WaitingRoomEditParamsDefaultTemplateLanguage = "pl-PL" WaitingRoomEditParamsDefaultTemplateLanguageIDID WaitingRoomEditParamsDefaultTemplateLanguage = "id-ID" WaitingRoomEditParamsDefaultTemplateLanguageTrTr WaitingRoomEditParamsDefaultTemplateLanguage = "tr-TR" WaitingRoomEditParamsDefaultTemplateLanguageArEg WaitingRoomEditParamsDefaultTemplateLanguage = "ar-EG" WaitingRoomEditParamsDefaultTemplateLanguageRuRu WaitingRoomEditParamsDefaultTemplateLanguage = "ru-RU" WaitingRoomEditParamsDefaultTemplateLanguageFaIr WaitingRoomEditParamsDefaultTemplateLanguage = "fa-IR" )
type WaitingRoomEditParamsQueueingMethod ¶
type WaitingRoomEditParamsQueueingMethod string
Sets the queueing method used by the waiting room. Changing this parameter from the **default** queueing method is only available for the Waiting Room Advanced subscription. Regardless of the queueing method, if `queue_all` is enabled or an event is prequeueing, users in the waiting room will not be accepted to the origin. These users will always see a waiting room page that refreshes automatically. The valid queueing methods are:
- `fifo` **(default)**: First-In-First-Out queue where customers gain access in the order they arrived.
- `random`: Random queue where customers gain access randomly, regardless of arrival time.
- `passthrough`: Users will pass directly through the waiting room and into the origin website. As a result, any configured limits will not be respected while this is enabled. This method can be used as an alternative to disabling a waiting room (with `suspended`) so that analytics are still reported. This can be used if you wish to allow all traffic normally, but want to restrict traffic during a waiting room event, or vice versa.
- `reject`: Users will be immediately rejected from the waiting room. As a result, no users will reach the origin website while this is enabled. This can be used if you wish to reject all traffic while performing maintenance, block traffic during a specified period of time (an event), or block traffic while events are not occurring. Consider a waiting room used for vaccine distribution that only allows traffic during sign-up events, and otherwise blocks all traffic. For this case, the waiting room uses `reject`, and its events override this with `fifo`, `random`, or `passthrough`. When this queueing method is enabled and neither `queueAll` is enabled nor an event is prequeueing, the waiting room page **will not refresh automatically**.
const ( WaitingRoomEditParamsQueueingMethodFifo WaitingRoomEditParamsQueueingMethod = "fifo" WaitingRoomEditParamsQueueingMethodRandom WaitingRoomEditParamsQueueingMethod = "random" WaitingRoomEditParamsQueueingMethodPassthrough WaitingRoomEditParamsQueueingMethod = "passthrough" WaitingRoomEditParamsQueueingMethodReject WaitingRoomEditParamsQueueingMethod = "reject" )
type WaitingRoomEditParamsQueueingStatusCode ¶
type WaitingRoomEditParamsQueueingStatusCode int64
HTTP status code returned to a user while in the queue.
const ( WaitingRoomEditParamsQueueingStatusCode200 WaitingRoomEditParamsQueueingStatusCode = 200 WaitingRoomEditParamsQueueingStatusCode202 WaitingRoomEditParamsQueueingStatusCode = 202 WaitingRoomEditParamsQueueingStatusCode429 WaitingRoomEditParamsQueueingStatusCode = 429 )
type WaitingRoomEditResponseEnvelope ¶
type WaitingRoomEditResponseEnvelope struct { Result WaitingroomWaitingroom `json:"result,required"` JSON waitingRoomEditResponseEnvelopeJSON `json:"-"` }
func (*WaitingRoomEditResponseEnvelope) UnmarshalJSON ¶
func (r *WaitingRoomEditResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type WaitingRoomGetResponseEnvelope ¶
type WaitingRoomGetResponseEnvelope struct { Result WaitingroomWaitingroom `json:"result,required"` JSON waitingRoomGetResponseEnvelopeJSON `json:"-"` }
func (*WaitingRoomGetResponseEnvelope) UnmarshalJSON ¶
func (r *WaitingRoomGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type WaitingRoomListResponseEnvelope ¶
type WaitingRoomListResponseEnvelope struct { Errors []WaitingRoomListResponseEnvelopeErrors `json:"errors,required"` Messages []WaitingRoomListResponseEnvelopeMessages `json:"messages,required"` Result []WaitingroomWaitingroom `json:"result,required,nullable"` // Whether the API call was successful Success WaitingRoomListResponseEnvelopeSuccess `json:"success,required"` ResultInfo WaitingRoomListResponseEnvelopeResultInfo `json:"result_info"` JSON waitingRoomListResponseEnvelopeJSON `json:"-"` }
func (*WaitingRoomListResponseEnvelope) UnmarshalJSON ¶
func (r *WaitingRoomListResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type WaitingRoomListResponseEnvelopeErrors ¶
type WaitingRoomListResponseEnvelopeErrors struct { Code int64 `json:"code,required"` Message string `json:"message,required"` JSON waitingRoomListResponseEnvelopeErrorsJSON `json:"-"` }
func (*WaitingRoomListResponseEnvelopeErrors) UnmarshalJSON ¶
func (r *WaitingRoomListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)
type WaitingRoomListResponseEnvelopeMessages ¶
type WaitingRoomListResponseEnvelopeMessages struct { Code int64 `json:"code,required"` Message string `json:"message,required"` JSON waitingRoomListResponseEnvelopeMessagesJSON `json:"-"` }
func (*WaitingRoomListResponseEnvelopeMessages) UnmarshalJSON ¶
func (r *WaitingRoomListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)
type WaitingRoomListResponseEnvelopeResultInfo ¶
type WaitingRoomListResponseEnvelopeResultInfo struct { // Total number of results for the requested service Count float64 `json:"count"` // Current page within paginated list of results Page float64 `json:"page"` // Number of results per page of results PerPage float64 `json:"per_page"` // Total results available without any search parameters TotalCount float64 `json:"total_count"` JSON waitingRoomListResponseEnvelopeResultInfoJSON `json:"-"` }
func (*WaitingRoomListResponseEnvelopeResultInfo) UnmarshalJSON ¶
func (r *WaitingRoomListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error)
type WaitingRoomListResponseEnvelopeSuccess ¶
type WaitingRoomListResponseEnvelopeSuccess bool
Whether the API call was successful
const (
WaitingRoomListResponseEnvelopeSuccessTrue WaitingRoomListResponseEnvelopeSuccess = true
)
type WaitingRoomNewParams ¶
type WaitingRoomNewParams struct { // The host name to which the waiting room will be applied (no wildcards). Please // do not include the scheme (http:// or https://). The host and path combination // must be unique. Host param.Field[string] `json:"host,required"` // A unique name to identify the waiting room. Only alphanumeric characters, // hyphens and underscores are allowed. Name param.Field[string] `json:"name,required"` // Sets the number of new users that will be let into the route every minute. This // value is used as baseline for the number of users that are let in per minute. So // it is possible that there is a little more or little less traffic coming to the // route based on the traffic patterns at that time around the world. NewUsersPerMinute param.Field[int64] `json:"new_users_per_minute,required"` // Sets the total number of active user sessions on the route at a point in time. A // route is a combination of host and path on which a waiting room is available. // This value is used as a baseline for the total number of active user sessions on // the route. It is possible to have a situation where there are more or less // active users sessions on the route based on the traffic patterns at that time // around the world. TotalActiveUsers param.Field[int64] `json:"total_active_users,required"` // Only available for the Waiting Room Advanced subscription. Additional hostname // and path combinations to which this waiting room will be applied. There is an // implied wildcard at the end of the path. The hostname and path combination must // be unique to this and all other waiting rooms. AdditionalRoutes param.Field[[]WaitingRoomNewParamsAdditionalRoute] `json:"additional_routes"` // Configures cookie attributes for the waiting room cookie. This encrypted cookie // stores a user's status in the waiting room, such as queue position. CookieAttributes param.Field[WaitingRoomNewParamsCookieAttributes] `json:"cookie_attributes"` // Appends a '\_' + a custom suffix to the end of Cloudflare Waiting Room's cookie // name(**cf_waitingroom). If `cookie_suffix` is "abcd", the cookie name will be // `**cf_waitingroom_abcd`. This field is required if using `additional_routes`. CookieSuffix param.Field[string] `json:"cookie_suffix"` // Only available for the Waiting Room Advanced subscription. This is a template // html file that will be rendered at the edge. If no custom_page_html is provided, // the default waiting room will be used. The template is based on mustache ( // https://mustache.github.io/ ). There are several variables that are evaluated by // the Cloudflare edge: // // 1. {{`waitTimeKnown`}} Acts like a boolean value that indicates the behavior to // take when wait time is not available, for instance when queue_all is // **true**. // 2. {{`waitTimeFormatted`}} Estimated wait time for the user. For example, five // minutes. Alternatively, you can use: // 3. {{`waitTime`}} Number of minutes of estimated wait for a user. // 4. {{`waitTimeHours`}} Number of hours of estimated wait for a user // (`Math.floor(waitTime/60)`). // 5. {{`waitTimeHourMinutes`}} Number of minutes above the `waitTimeHours` value // (`waitTime%60`). // 6. {{`queueIsFull`}} Changes to **true** when no more people can be added to the // queue. // // To view the full list of variables, look at the `cfWaitingRoom` object described // under the `json_response_enabled` property in other Waiting Room API calls. CustomPageHTML param.Field[string] `json:"custom_page_html"` // The language of the default page template. If no default_template_language is // provided, then `en-US` (English) will be used. DefaultTemplateLanguage param.Field[WaitingRoomNewParamsDefaultTemplateLanguage] `json:"default_template_language"` // A note that you can use to add more details about the waiting room. Description param.Field[string] `json:"description"` // Only available for the Waiting Room Advanced subscription. Disables automatic // renewal of session cookies. If `true`, an accepted user will have // session_duration minutes to browse the site. After that, they will have to go // through the waiting room again. If `false`, a user's session cookie will be // automatically renewed on every request. DisableSessionRenewal param.Field[bool] `json:"disable_session_renewal"` // Only available for the Waiting Room Advanced subscription. If `true`, requests // to the waiting room with the header `Accept: application/json` will receive a // JSON response object with information on the user's status in the waiting room // as opposed to the configured static HTML page. This JSON response object has one // property `cfWaitingRoom` which is an object containing the following fields: // // 1. `inWaitingRoom`: Boolean indicating if the user is in the waiting room // (always **true**). // 2. `waitTimeKnown`: Boolean indicating if the current estimated wait times are // accurate. If **false**, they are not available. // 3. `waitTime`: Valid only when `waitTimeKnown` is **true**. Integer indicating // the current estimated time in minutes the user will wait in the waiting room. // When `queueingMethod` is **random**, this is set to `waitTime50Percentile`. // 4. `waitTime25Percentile`: Valid only when `queueingMethod` is **random** and // `waitTimeKnown` is **true**. Integer indicating the current estimated maximum // wait time for the 25% of users that gain entry the fastest (25th percentile). // 5. `waitTime50Percentile`: Valid only when `queueingMethod` is **random** and // `waitTimeKnown` is **true**. Integer indicating the current estimated maximum // wait time for the 50% of users that gain entry the fastest (50th percentile). // In other words, half of the queued users are expected to let into the origin // website before `waitTime50Percentile` and half are expected to be let in // after it. // 6. `waitTime75Percentile`: Valid only when `queueingMethod` is **random** and // `waitTimeKnown` is **true**. Integer indicating the current estimated maximum // wait time for the 75% of users that gain entry the fastest (75th percentile). // 7. `waitTimeFormatted`: String displaying the `waitTime` formatted in English // for users. If `waitTimeKnown` is **false**, `waitTimeFormatted` will display // **unavailable**. // 8. `queueIsFull`: Boolean indicating if the waiting room's queue is currently // full and not accepting new users at the moment. // 9. `queueAll`: Boolean indicating if all users will be queued in the waiting // room and no one will be let into the origin website. // 10. `lastUpdated`: String displaying the timestamp as an ISO 8601 string of the // user's last attempt to leave the waiting room and be let into the origin // website. The user is able to make another attempt after // `refreshIntervalSeconds` past this time. If the user makes a request too // soon, it will be ignored and `lastUpdated` will not change. // 11. `refreshIntervalSeconds`: Integer indicating the number of seconds after // `lastUpdated` until the user is able to make another attempt to leave the // waiting room and be let into the origin website. When the `queueingMethod` // is `reject`, there is no specified refresh time — it will always be // **zero**. // 12. `queueingMethod`: The queueing method currently used by the waiting room. It // is either **fifo**, **random**, **passthrough**, or **reject**. // 13. `isFIFOQueue`: Boolean indicating if the waiting room uses a FIFO // (First-In-First-Out) queue. // 14. `isRandomQueue`: Boolean indicating if the waiting room uses a Random queue // where users gain access randomly. // 15. `isPassthroughQueue`: Boolean indicating if the waiting room uses a // passthrough queue. Keep in mind that when passthrough is enabled, this JSON // response will only exist when `queueAll` is **true** or `isEventPrequeueing` // is **true** because in all other cases requests will go directly to the // origin. // 16. `isRejectQueue`: Boolean indicating if the waiting room uses a reject queue. // 17. `isEventActive`: Boolean indicating if an event is currently occurring. // Events are able to change a waiting room's behavior during a specified // period of time. For additional information, look at the event properties // `prequeue_start_time`, `event_start_time`, and `event_end_time` in the // documentation for creating waiting room events. Events are considered active // between these start and end times, as well as during the prequeueing period // if it exists. // 18. `isEventPrequeueing`: Valid only when `isEventActive` is **true**. Boolean // indicating if an event is currently prequeueing users before it starts. // 19. `timeUntilEventStart`: Valid only when `isEventPrequeueing` is **true**. // Integer indicating the number of minutes until the event starts. // 20. `timeUntilEventStartFormatted`: String displaying the `timeUntilEventStart` // formatted in English for users. If `isEventPrequeueing` is **false**, // `timeUntilEventStartFormatted` will display **unavailable**. // 21. `timeUntilEventEnd`: Valid only when `isEventActive` is **true**. Integer // indicating the number of minutes until the event ends. // 22. `timeUntilEventEndFormatted`: String displaying the `timeUntilEventEnd` // formatted in English for users. If `isEventActive` is **false**, // `timeUntilEventEndFormatted` will display **unavailable**. // 23. `shuffleAtEventStart`: Valid only when `isEventActive` is **true**. Boolean // indicating if the users in the prequeue are shuffled randomly when the event // starts. // // An example cURL to a waiting room could be: // // curl -X GET "https://example.com/waitingroom" \ // -H "Accept: application/json" // // If `json_response_enabled` is **true** and the request hits the waiting room, an // example JSON response when `queueingMethod` is **fifo** and no event is active // could be: // // { // "cfWaitingRoom": { // "inWaitingRoom": true, // "waitTimeKnown": true, // "waitTime": 10, // "waitTime25Percentile": 0, // "waitTime50Percentile": 0, // "waitTime75Percentile": 0, // "waitTimeFormatted": "10 minutes", // "queueIsFull": false, // "queueAll": false, // "lastUpdated": "2020-08-03T23:46:00.000Z", // "refreshIntervalSeconds": 20, // "queueingMethod": "fifo", // "isFIFOQueue": true, // "isRandomQueue": false, // "isPassthroughQueue": false, // "isRejectQueue": false, // "isEventActive": false, // "isEventPrequeueing": false, // "timeUntilEventStart": 0, // "timeUntilEventStartFormatted": "unavailable", // "timeUntilEventEnd": 0, // "timeUntilEventEndFormatted": "unavailable", // "shuffleAtEventStart": false // } // } // // If `json_response_enabled` is **true** and the request hits the waiting room, an // example JSON response when `queueingMethod` is **random** and an event is active // could be: // // { // "cfWaitingRoom": { // "inWaitingRoom": true, // "waitTimeKnown": true, // "waitTime": 10, // "waitTime25Percentile": 5, // "waitTime50Percentile": 10, // "waitTime75Percentile": 15, // "waitTimeFormatted": "5 minutes to 15 minutes", // "queueIsFull": false, // "queueAll": false, // "lastUpdated": "2020-08-03T23:46:00.000Z", // "refreshIntervalSeconds": 20, // "queueingMethod": "random", // "isFIFOQueue": false, // "isRandomQueue": true, // "isPassthroughQueue": false, // "isRejectQueue": false, // "isEventActive": true, // "isEventPrequeueing": false, // "timeUntilEventStart": 0, // "timeUntilEventStartFormatted": "unavailable", // "timeUntilEventEnd": 15, // "timeUntilEventEndFormatted": "15 minutes", // "shuffleAtEventStart": true // } // }. JsonResponseEnabled param.Field[bool] `json:"json_response_enabled"` // Sets the path within the host to enable the waiting room on. The waiting room // will be enabled for all subpaths as well. If there are two waiting rooms on the // same subpath, the waiting room for the most specific path will be chosen. // Wildcards and query parameters are not supported. Path param.Field[string] `json:"path"` // If queue_all is `true`, all the traffic that is coming to a route will be sent // to the waiting room. No new traffic can get to the route once this field is set // and estimated time will become unavailable. QueueAll param.Field[bool] `json:"queue_all"` // Sets the queueing method used by the waiting room. Changing this parameter from // the **default** queueing method is only available for the Waiting Room Advanced // subscription. Regardless of the queueing method, if `queue_all` is enabled or an // event is prequeueing, users in the waiting room will not be accepted to the // origin. These users will always see a waiting room page that refreshes // automatically. The valid queueing methods are: // // 1. `fifo` **(default)**: First-In-First-Out queue where customers gain access in // the order they arrived. // 2. `random`: Random queue where customers gain access randomly, regardless of // arrival time. // 3. `passthrough`: Users will pass directly through the waiting room and into the // origin website. As a result, any configured limits will not be respected // while this is enabled. This method can be used as an alternative to disabling // a waiting room (with `suspended`) so that analytics are still reported. This // can be used if you wish to allow all traffic normally, but want to restrict // traffic during a waiting room event, or vice versa. // 4. `reject`: Users will be immediately rejected from the waiting room. As a // result, no users will reach the origin website while this is enabled. This // can be used if you wish to reject all traffic while performing maintenance, // block traffic during a specified period of time (an event), or block traffic // while events are not occurring. Consider a waiting room used for vaccine // distribution that only allows traffic during sign-up events, and otherwise // blocks all traffic. For this case, the waiting room uses `reject`, and its // events override this with `fifo`, `random`, or `passthrough`. When this // queueing method is enabled and neither `queueAll` is enabled nor an event is // prequeueing, the waiting room page **will not refresh automatically**. QueueingMethod param.Field[WaitingRoomNewParamsQueueingMethod] `json:"queueing_method"` // HTTP status code returned to a user while in the queue. QueueingStatusCode param.Field[WaitingRoomNewParamsQueueingStatusCode] `json:"queueing_status_code"` // Lifetime of a cookie (in minutes) set by Cloudflare for users who get access to // the route. If a user is not seen by Cloudflare again in that time period, they // will be treated as a new user that visits the route. SessionDuration param.Field[int64] `json:"session_duration"` // Suspends or allows traffic going to the waiting room. If set to `true`, the // traffic will not go to the waiting room. Suspended param.Field[bool] `json:"suspended"` }
func (WaitingRoomNewParams) MarshalJSON ¶
func (r WaitingRoomNewParams) MarshalJSON() (data []byte, err error)
type WaitingRoomNewParamsAdditionalRoute ¶
type WaitingRoomNewParamsAdditionalRoute struct { // The hostname to which this waiting room will be applied (no wildcards). The // hostname must be the primary domain, subdomain, or custom hostname (if using SSL // for SaaS) of this zone. Please do not include the scheme (http:// or https://). Host param.Field[string] `json:"host"` // Sets the path within the host to enable the waiting room on. The waiting room // will be enabled for all subpaths as well. If there are two waiting rooms on the // same subpath, the waiting room for the most specific path will be chosen. // Wildcards and query parameters are not supported. Path param.Field[string] `json:"path"` }
func (WaitingRoomNewParamsAdditionalRoute) MarshalJSON ¶
func (r WaitingRoomNewParamsAdditionalRoute) MarshalJSON() (data []byte, err error)
type WaitingRoomNewParamsCookieAttributes ¶
type WaitingRoomNewParamsCookieAttributes struct { // Configures the SameSite attribute on the waiting room cookie. Value `auto` will // be translated to `lax` or `none` depending if **Always Use HTTPS** is enabled. // Note that when using value `none`, the secure attribute cannot be set to // `never`. Samesite param.Field[WaitingRoomNewParamsCookieAttributesSamesite] `json:"samesite"` // Configures the Secure attribute on the waiting room cookie. Value `always` // indicates that the Secure attribute will be set in the Set-Cookie header, // `never` indicates that the Secure attribute will not be set, and `auto` will set // the Secure attribute depending if **Always Use HTTPS** is enabled. Secure param.Field[WaitingRoomNewParamsCookieAttributesSecure] `json:"secure"` }
Configures cookie attributes for the waiting room cookie. This encrypted cookie stores a user's status in the waiting room, such as queue position.
func (WaitingRoomNewParamsCookieAttributes) MarshalJSON ¶
func (r WaitingRoomNewParamsCookieAttributes) MarshalJSON() (data []byte, err error)
type WaitingRoomNewParamsCookieAttributesSamesite ¶
type WaitingRoomNewParamsCookieAttributesSamesite string
Configures the SameSite attribute on the waiting room cookie. Value `auto` will be translated to `lax` or `none` depending if **Always Use HTTPS** is enabled. Note that when using value `none`, the secure attribute cannot be set to `never`.
const ( WaitingRoomNewParamsCookieAttributesSamesiteAuto WaitingRoomNewParamsCookieAttributesSamesite = "auto" WaitingRoomNewParamsCookieAttributesSamesiteLax WaitingRoomNewParamsCookieAttributesSamesite = "lax" WaitingRoomNewParamsCookieAttributesSamesiteNone WaitingRoomNewParamsCookieAttributesSamesite = "none" WaitingRoomNewParamsCookieAttributesSamesiteStrict WaitingRoomNewParamsCookieAttributesSamesite = "strict" )
type WaitingRoomNewParamsCookieAttributesSecure ¶
type WaitingRoomNewParamsCookieAttributesSecure string
Configures the Secure attribute on the waiting room cookie. Value `always` indicates that the Secure attribute will be set in the Set-Cookie header, `never` indicates that the Secure attribute will not be set, and `auto` will set the Secure attribute depending if **Always Use HTTPS** is enabled.
const ( WaitingRoomNewParamsCookieAttributesSecureAuto WaitingRoomNewParamsCookieAttributesSecure = "auto" WaitingRoomNewParamsCookieAttributesSecureAlways WaitingRoomNewParamsCookieAttributesSecure = "always" WaitingRoomNewParamsCookieAttributesSecureNever WaitingRoomNewParamsCookieAttributesSecure = "never" )
type WaitingRoomNewParamsDefaultTemplateLanguage ¶
type WaitingRoomNewParamsDefaultTemplateLanguage string
The language of the default page template. If no default_template_language is provided, then `en-US` (English) will be used.
const ( WaitingRoomNewParamsDefaultTemplateLanguageEnUs WaitingRoomNewParamsDefaultTemplateLanguage = "en-US" WaitingRoomNewParamsDefaultTemplateLanguageEsEs WaitingRoomNewParamsDefaultTemplateLanguage = "es-ES" WaitingRoomNewParamsDefaultTemplateLanguageDeDe WaitingRoomNewParamsDefaultTemplateLanguage = "de-DE" WaitingRoomNewParamsDefaultTemplateLanguageFrFr WaitingRoomNewParamsDefaultTemplateLanguage = "fr-FR" WaitingRoomNewParamsDefaultTemplateLanguageItIt WaitingRoomNewParamsDefaultTemplateLanguage = "it-IT" WaitingRoomNewParamsDefaultTemplateLanguageJaJp WaitingRoomNewParamsDefaultTemplateLanguage = "ja-JP" WaitingRoomNewParamsDefaultTemplateLanguageKoKr WaitingRoomNewParamsDefaultTemplateLanguage = "ko-KR" WaitingRoomNewParamsDefaultTemplateLanguagePtBr WaitingRoomNewParamsDefaultTemplateLanguage = "pt-BR" WaitingRoomNewParamsDefaultTemplateLanguageZhCn WaitingRoomNewParamsDefaultTemplateLanguage = "zh-CN" WaitingRoomNewParamsDefaultTemplateLanguageZhTw WaitingRoomNewParamsDefaultTemplateLanguage = "zh-TW" WaitingRoomNewParamsDefaultTemplateLanguageNlNl WaitingRoomNewParamsDefaultTemplateLanguage = "nl-NL" WaitingRoomNewParamsDefaultTemplateLanguagePlPl WaitingRoomNewParamsDefaultTemplateLanguage = "pl-PL" WaitingRoomNewParamsDefaultTemplateLanguageIDID WaitingRoomNewParamsDefaultTemplateLanguage = "id-ID" WaitingRoomNewParamsDefaultTemplateLanguageTrTr WaitingRoomNewParamsDefaultTemplateLanguage = "tr-TR" WaitingRoomNewParamsDefaultTemplateLanguageArEg WaitingRoomNewParamsDefaultTemplateLanguage = "ar-EG" WaitingRoomNewParamsDefaultTemplateLanguageRuRu WaitingRoomNewParamsDefaultTemplateLanguage = "ru-RU" WaitingRoomNewParamsDefaultTemplateLanguageFaIr WaitingRoomNewParamsDefaultTemplateLanguage = "fa-IR" )
type WaitingRoomNewParamsQueueingMethod ¶
type WaitingRoomNewParamsQueueingMethod string
Sets the queueing method used by the waiting room. Changing this parameter from the **default** queueing method is only available for the Waiting Room Advanced subscription. Regardless of the queueing method, if `queue_all` is enabled or an event is prequeueing, users in the waiting room will not be accepted to the origin. These users will always see a waiting room page that refreshes automatically. The valid queueing methods are:
- `fifo` **(default)**: First-In-First-Out queue where customers gain access in the order they arrived.
- `random`: Random queue where customers gain access randomly, regardless of arrival time.
- `passthrough`: Users will pass directly through the waiting room and into the origin website. As a result, any configured limits will not be respected while this is enabled. This method can be used as an alternative to disabling a waiting room (with `suspended`) so that analytics are still reported. This can be used if you wish to allow all traffic normally, but want to restrict traffic during a waiting room event, or vice versa.
- `reject`: Users will be immediately rejected from the waiting room. As a result, no users will reach the origin website while this is enabled. This can be used if you wish to reject all traffic while performing maintenance, block traffic during a specified period of time (an event), or block traffic while events are not occurring. Consider a waiting room used for vaccine distribution that only allows traffic during sign-up events, and otherwise blocks all traffic. For this case, the waiting room uses `reject`, and its events override this with `fifo`, `random`, or `passthrough`. When this queueing method is enabled and neither `queueAll` is enabled nor an event is prequeueing, the waiting room page **will not refresh automatically**.
const ( WaitingRoomNewParamsQueueingMethodFifo WaitingRoomNewParamsQueueingMethod = "fifo" WaitingRoomNewParamsQueueingMethodRandom WaitingRoomNewParamsQueueingMethod = "random" WaitingRoomNewParamsQueueingMethodPassthrough WaitingRoomNewParamsQueueingMethod = "passthrough" WaitingRoomNewParamsQueueingMethodReject WaitingRoomNewParamsQueueingMethod = "reject" )
type WaitingRoomNewParamsQueueingStatusCode ¶
type WaitingRoomNewParamsQueueingStatusCode int64
HTTP status code returned to a user while in the queue.
const ( WaitingRoomNewParamsQueueingStatusCode200 WaitingRoomNewParamsQueueingStatusCode = 200 WaitingRoomNewParamsQueueingStatusCode202 WaitingRoomNewParamsQueueingStatusCode = 202 WaitingRoomNewParamsQueueingStatusCode429 WaitingRoomNewParamsQueueingStatusCode = 429 )
type WaitingRoomNewResponseEnvelope ¶
type WaitingRoomNewResponseEnvelope struct { Result WaitingroomWaitingroom `json:"result,required"` JSON waitingRoomNewResponseEnvelopeJSON `json:"-"` }
func (*WaitingRoomNewResponseEnvelope) UnmarshalJSON ¶
func (r *WaitingRoomNewResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type WaitingRoomService ¶
type WaitingRoomService struct { Options []option.RequestOption Page *PageService Events *EventService Rules *RuleService Statuses *StatusService Settings *SettingService }
WaitingRoomService 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 NewWaitingRoomService method instead.
func NewWaitingRoomService ¶
func NewWaitingRoomService(opts ...option.RequestOption) (r *WaitingRoomService)
NewWaitingRoomService 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 (*WaitingRoomService) Delete ¶
func (r *WaitingRoomService) Delete(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, opts ...option.RequestOption) (res *WaitingRoomDeleteResponse, err error)
Deletes a waiting room.
func (*WaitingRoomService) Edit ¶
func (r *WaitingRoomService) Edit(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, body WaitingRoomEditParams, opts ...option.RequestOption) (res *WaitingroomWaitingroom, err error)
Patches a configured waiting room.
func (*WaitingRoomService) Get ¶
func (r *WaitingRoomService) Get(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, opts ...option.RequestOption) (res *WaitingroomWaitingroom, err error)
Fetches a single configured waiting room.
func (*WaitingRoomService) List ¶
func (r *WaitingRoomService) List(ctx context.Context, zoneIdentifier string, opts ...option.RequestOption) (res *[]WaitingroomWaitingroom, err error)
Lists waiting rooms.
func (*WaitingRoomService) New ¶
func (r *WaitingRoomService) New(ctx context.Context, zoneIdentifier string, body WaitingRoomNewParams, opts ...option.RequestOption) (res *WaitingroomWaitingroom, err error)
Creates a new waiting room.
func (*WaitingRoomService) Update ¶
func (r *WaitingRoomService) Update(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, body WaitingRoomUpdateParams, opts ...option.RequestOption) (res *WaitingroomWaitingroom, err error)
Updates a configured waiting room.
type WaitingRoomUpdateParams ¶
type WaitingRoomUpdateParams struct { // The host name to which the waiting room will be applied (no wildcards). Please // do not include the scheme (http:// or https://). The host and path combination // must be unique. Host param.Field[string] `json:"host,required"` // A unique name to identify the waiting room. Only alphanumeric characters, // hyphens and underscores are allowed. Name param.Field[string] `json:"name,required"` // Sets the number of new users that will be let into the route every minute. This // value is used as baseline for the number of users that are let in per minute. So // it is possible that there is a little more or little less traffic coming to the // route based on the traffic patterns at that time around the world. NewUsersPerMinute param.Field[int64] `json:"new_users_per_minute,required"` // Sets the total number of active user sessions on the route at a point in time. A // route is a combination of host and path on which a waiting room is available. // This value is used as a baseline for the total number of active user sessions on // the route. It is possible to have a situation where there are more or less // active users sessions on the route based on the traffic patterns at that time // around the world. TotalActiveUsers param.Field[int64] `json:"total_active_users,required"` // Only available for the Waiting Room Advanced subscription. Additional hostname // and path combinations to which this waiting room will be applied. There is an // implied wildcard at the end of the path. The hostname and path combination must // be unique to this and all other waiting rooms. AdditionalRoutes param.Field[[]WaitingRoomUpdateParamsAdditionalRoute] `json:"additional_routes"` // Configures cookie attributes for the waiting room cookie. This encrypted cookie // stores a user's status in the waiting room, such as queue position. CookieAttributes param.Field[WaitingRoomUpdateParamsCookieAttributes] `json:"cookie_attributes"` // Appends a '\_' + a custom suffix to the end of Cloudflare Waiting Room's cookie // name(**cf_waitingroom). If `cookie_suffix` is "abcd", the cookie name will be // `**cf_waitingroom_abcd`. This field is required if using `additional_routes`. CookieSuffix param.Field[string] `json:"cookie_suffix"` // Only available for the Waiting Room Advanced subscription. This is a template // html file that will be rendered at the edge. If no custom_page_html is provided, // the default waiting room will be used. The template is based on mustache ( // https://mustache.github.io/ ). There are several variables that are evaluated by // the Cloudflare edge: // // 1. {{`waitTimeKnown`}} Acts like a boolean value that indicates the behavior to // take when wait time is not available, for instance when queue_all is // **true**. // 2. {{`waitTimeFormatted`}} Estimated wait time for the user. For example, five // minutes. Alternatively, you can use: // 3. {{`waitTime`}} Number of minutes of estimated wait for a user. // 4. {{`waitTimeHours`}} Number of hours of estimated wait for a user // (`Math.floor(waitTime/60)`). // 5. {{`waitTimeHourMinutes`}} Number of minutes above the `waitTimeHours` value // (`waitTime%60`). // 6. {{`queueIsFull`}} Changes to **true** when no more people can be added to the // queue. // // To view the full list of variables, look at the `cfWaitingRoom` object described // under the `json_response_enabled` property in other Waiting Room API calls. CustomPageHTML param.Field[string] `json:"custom_page_html"` // The language of the default page template. If no default_template_language is // provided, then `en-US` (English) will be used. DefaultTemplateLanguage param.Field[WaitingRoomUpdateParamsDefaultTemplateLanguage] `json:"default_template_language"` // A note that you can use to add more details about the waiting room. Description param.Field[string] `json:"description"` // Only available for the Waiting Room Advanced subscription. Disables automatic // renewal of session cookies. If `true`, an accepted user will have // session_duration minutes to browse the site. After that, they will have to go // through the waiting room again. If `false`, a user's session cookie will be // automatically renewed on every request. DisableSessionRenewal param.Field[bool] `json:"disable_session_renewal"` // Only available for the Waiting Room Advanced subscription. If `true`, requests // to the waiting room with the header `Accept: application/json` will receive a // JSON response object with information on the user's status in the waiting room // as opposed to the configured static HTML page. This JSON response object has one // property `cfWaitingRoom` which is an object containing the following fields: // // 1. `inWaitingRoom`: Boolean indicating if the user is in the waiting room // (always **true**). // 2. `waitTimeKnown`: Boolean indicating if the current estimated wait times are // accurate. If **false**, they are not available. // 3. `waitTime`: Valid only when `waitTimeKnown` is **true**. Integer indicating // the current estimated time in minutes the user will wait in the waiting room. // When `queueingMethod` is **random**, this is set to `waitTime50Percentile`. // 4. `waitTime25Percentile`: Valid only when `queueingMethod` is **random** and // `waitTimeKnown` is **true**. Integer indicating the current estimated maximum // wait time for the 25% of users that gain entry the fastest (25th percentile). // 5. `waitTime50Percentile`: Valid only when `queueingMethod` is **random** and // `waitTimeKnown` is **true**. Integer indicating the current estimated maximum // wait time for the 50% of users that gain entry the fastest (50th percentile). // In other words, half of the queued users are expected to let into the origin // website before `waitTime50Percentile` and half are expected to be let in // after it. // 6. `waitTime75Percentile`: Valid only when `queueingMethod` is **random** and // `waitTimeKnown` is **true**. Integer indicating the current estimated maximum // wait time for the 75% of users that gain entry the fastest (75th percentile). // 7. `waitTimeFormatted`: String displaying the `waitTime` formatted in English // for users. If `waitTimeKnown` is **false**, `waitTimeFormatted` will display // **unavailable**. // 8. `queueIsFull`: Boolean indicating if the waiting room's queue is currently // full and not accepting new users at the moment. // 9. `queueAll`: Boolean indicating if all users will be queued in the waiting // room and no one will be let into the origin website. // 10. `lastUpdated`: String displaying the timestamp as an ISO 8601 string of the // user's last attempt to leave the waiting room and be let into the origin // website. The user is able to make another attempt after // `refreshIntervalSeconds` past this time. If the user makes a request too // soon, it will be ignored and `lastUpdated` will not change. // 11. `refreshIntervalSeconds`: Integer indicating the number of seconds after // `lastUpdated` until the user is able to make another attempt to leave the // waiting room and be let into the origin website. When the `queueingMethod` // is `reject`, there is no specified refresh time — it will always be // **zero**. // 12. `queueingMethod`: The queueing method currently used by the waiting room. It // is either **fifo**, **random**, **passthrough**, or **reject**. // 13. `isFIFOQueue`: Boolean indicating if the waiting room uses a FIFO // (First-In-First-Out) queue. // 14. `isRandomQueue`: Boolean indicating if the waiting room uses a Random queue // where users gain access randomly. // 15. `isPassthroughQueue`: Boolean indicating if the waiting room uses a // passthrough queue. Keep in mind that when passthrough is enabled, this JSON // response will only exist when `queueAll` is **true** or `isEventPrequeueing` // is **true** because in all other cases requests will go directly to the // origin. // 16. `isRejectQueue`: Boolean indicating if the waiting room uses a reject queue. // 17. `isEventActive`: Boolean indicating if an event is currently occurring. // Events are able to change a waiting room's behavior during a specified // period of time. For additional information, look at the event properties // `prequeue_start_time`, `event_start_time`, and `event_end_time` in the // documentation for creating waiting room events. Events are considered active // between these start and end times, as well as during the prequeueing period // if it exists. // 18. `isEventPrequeueing`: Valid only when `isEventActive` is **true**. Boolean // indicating if an event is currently prequeueing users before it starts. // 19. `timeUntilEventStart`: Valid only when `isEventPrequeueing` is **true**. // Integer indicating the number of minutes until the event starts. // 20. `timeUntilEventStartFormatted`: String displaying the `timeUntilEventStart` // formatted in English for users. If `isEventPrequeueing` is **false**, // `timeUntilEventStartFormatted` will display **unavailable**. // 21. `timeUntilEventEnd`: Valid only when `isEventActive` is **true**. Integer // indicating the number of minutes until the event ends. // 22. `timeUntilEventEndFormatted`: String displaying the `timeUntilEventEnd` // formatted in English for users. If `isEventActive` is **false**, // `timeUntilEventEndFormatted` will display **unavailable**. // 23. `shuffleAtEventStart`: Valid only when `isEventActive` is **true**. Boolean // indicating if the users in the prequeue are shuffled randomly when the event // starts. // // An example cURL to a waiting room could be: // // curl -X GET "https://example.com/waitingroom" \ // -H "Accept: application/json" // // If `json_response_enabled` is **true** and the request hits the waiting room, an // example JSON response when `queueingMethod` is **fifo** and no event is active // could be: // // { // "cfWaitingRoom": { // "inWaitingRoom": true, // "waitTimeKnown": true, // "waitTime": 10, // "waitTime25Percentile": 0, // "waitTime50Percentile": 0, // "waitTime75Percentile": 0, // "waitTimeFormatted": "10 minutes", // "queueIsFull": false, // "queueAll": false, // "lastUpdated": "2020-08-03T23:46:00.000Z", // "refreshIntervalSeconds": 20, // "queueingMethod": "fifo", // "isFIFOQueue": true, // "isRandomQueue": false, // "isPassthroughQueue": false, // "isRejectQueue": false, // "isEventActive": false, // "isEventPrequeueing": false, // "timeUntilEventStart": 0, // "timeUntilEventStartFormatted": "unavailable", // "timeUntilEventEnd": 0, // "timeUntilEventEndFormatted": "unavailable", // "shuffleAtEventStart": false // } // } // // If `json_response_enabled` is **true** and the request hits the waiting room, an // example JSON response when `queueingMethod` is **random** and an event is active // could be: // // { // "cfWaitingRoom": { // "inWaitingRoom": true, // "waitTimeKnown": true, // "waitTime": 10, // "waitTime25Percentile": 5, // "waitTime50Percentile": 10, // "waitTime75Percentile": 15, // "waitTimeFormatted": "5 minutes to 15 minutes", // "queueIsFull": false, // "queueAll": false, // "lastUpdated": "2020-08-03T23:46:00.000Z", // "refreshIntervalSeconds": 20, // "queueingMethod": "random", // "isFIFOQueue": false, // "isRandomQueue": true, // "isPassthroughQueue": false, // "isRejectQueue": false, // "isEventActive": true, // "isEventPrequeueing": false, // "timeUntilEventStart": 0, // "timeUntilEventStartFormatted": "unavailable", // "timeUntilEventEnd": 15, // "timeUntilEventEndFormatted": "15 minutes", // "shuffleAtEventStart": true // } // }. JsonResponseEnabled param.Field[bool] `json:"json_response_enabled"` // Sets the path within the host to enable the waiting room on. The waiting room // will be enabled for all subpaths as well. If there are two waiting rooms on the // same subpath, the waiting room for the most specific path will be chosen. // Wildcards and query parameters are not supported. Path param.Field[string] `json:"path"` // If queue_all is `true`, all the traffic that is coming to a route will be sent // to the waiting room. No new traffic can get to the route once this field is set // and estimated time will become unavailable. QueueAll param.Field[bool] `json:"queue_all"` // Sets the queueing method used by the waiting room. Changing this parameter from // the **default** queueing method is only available for the Waiting Room Advanced // subscription. Regardless of the queueing method, if `queue_all` is enabled or an // event is prequeueing, users in the waiting room will not be accepted to the // origin. These users will always see a waiting room page that refreshes // automatically. The valid queueing methods are: // // 1. `fifo` **(default)**: First-In-First-Out queue where customers gain access in // the order they arrived. // 2. `random`: Random queue where customers gain access randomly, regardless of // arrival time. // 3. `passthrough`: Users will pass directly through the waiting room and into the // origin website. As a result, any configured limits will not be respected // while this is enabled. This method can be used as an alternative to disabling // a waiting room (with `suspended`) so that analytics are still reported. This // can be used if you wish to allow all traffic normally, but want to restrict // traffic during a waiting room event, or vice versa. // 4. `reject`: Users will be immediately rejected from the waiting room. As a // result, no users will reach the origin website while this is enabled. This // can be used if you wish to reject all traffic while performing maintenance, // block traffic during a specified period of time (an event), or block traffic // while events are not occurring. Consider a waiting room used for vaccine // distribution that only allows traffic during sign-up events, and otherwise // blocks all traffic. For this case, the waiting room uses `reject`, and its // events override this with `fifo`, `random`, or `passthrough`. When this // queueing method is enabled and neither `queueAll` is enabled nor an event is // prequeueing, the waiting room page **will not refresh automatically**. QueueingMethod param.Field[WaitingRoomUpdateParamsQueueingMethod] `json:"queueing_method"` // HTTP status code returned to a user while in the queue. QueueingStatusCode param.Field[WaitingRoomUpdateParamsQueueingStatusCode] `json:"queueing_status_code"` // Lifetime of a cookie (in minutes) set by Cloudflare for users who get access to // the route. If a user is not seen by Cloudflare again in that time period, they // will be treated as a new user that visits the route. SessionDuration param.Field[int64] `json:"session_duration"` // Suspends or allows traffic going to the waiting room. If set to `true`, the // traffic will not go to the waiting room. Suspended param.Field[bool] `json:"suspended"` }
func (WaitingRoomUpdateParams) MarshalJSON ¶
func (r WaitingRoomUpdateParams) MarshalJSON() (data []byte, err error)
type WaitingRoomUpdateParamsAdditionalRoute ¶
type WaitingRoomUpdateParamsAdditionalRoute struct { // The hostname to which this waiting room will be applied (no wildcards). The // hostname must be the primary domain, subdomain, or custom hostname (if using SSL // for SaaS) of this zone. Please do not include the scheme (http:// or https://). Host param.Field[string] `json:"host"` // Sets the path within the host to enable the waiting room on. The waiting room // will be enabled for all subpaths as well. If there are two waiting rooms on the // same subpath, the waiting room for the most specific path will be chosen. // Wildcards and query parameters are not supported. Path param.Field[string] `json:"path"` }
func (WaitingRoomUpdateParamsAdditionalRoute) MarshalJSON ¶
func (r WaitingRoomUpdateParamsAdditionalRoute) MarshalJSON() (data []byte, err error)
type WaitingRoomUpdateParamsCookieAttributes ¶
type WaitingRoomUpdateParamsCookieAttributes struct { // Configures the SameSite attribute on the waiting room cookie. Value `auto` will // be translated to `lax` or `none` depending if **Always Use HTTPS** is enabled. // Note that when using value `none`, the secure attribute cannot be set to // `never`. Samesite param.Field[WaitingRoomUpdateParamsCookieAttributesSamesite] `json:"samesite"` // Configures the Secure attribute on the waiting room cookie. Value `always` // indicates that the Secure attribute will be set in the Set-Cookie header, // `never` indicates that the Secure attribute will not be set, and `auto` will set // the Secure attribute depending if **Always Use HTTPS** is enabled. Secure param.Field[WaitingRoomUpdateParamsCookieAttributesSecure] `json:"secure"` }
Configures cookie attributes for the waiting room cookie. This encrypted cookie stores a user's status in the waiting room, such as queue position.
func (WaitingRoomUpdateParamsCookieAttributes) MarshalJSON ¶
func (r WaitingRoomUpdateParamsCookieAttributes) MarshalJSON() (data []byte, err error)
type WaitingRoomUpdateParamsCookieAttributesSamesite ¶
type WaitingRoomUpdateParamsCookieAttributesSamesite string
Configures the SameSite attribute on the waiting room cookie. Value `auto` will be translated to `lax` or `none` depending if **Always Use HTTPS** is enabled. Note that when using value `none`, the secure attribute cannot be set to `never`.
const ( WaitingRoomUpdateParamsCookieAttributesSamesiteAuto WaitingRoomUpdateParamsCookieAttributesSamesite = "auto" WaitingRoomUpdateParamsCookieAttributesSamesiteLax WaitingRoomUpdateParamsCookieAttributesSamesite = "lax" WaitingRoomUpdateParamsCookieAttributesSamesiteNone WaitingRoomUpdateParamsCookieAttributesSamesite = "none" WaitingRoomUpdateParamsCookieAttributesSamesiteStrict WaitingRoomUpdateParamsCookieAttributesSamesite = "strict" )
type WaitingRoomUpdateParamsCookieAttributesSecure ¶
type WaitingRoomUpdateParamsCookieAttributesSecure string
Configures the Secure attribute on the waiting room cookie. Value `always` indicates that the Secure attribute will be set in the Set-Cookie header, `never` indicates that the Secure attribute will not be set, and `auto` will set the Secure attribute depending if **Always Use HTTPS** is enabled.
const ( WaitingRoomUpdateParamsCookieAttributesSecureAuto WaitingRoomUpdateParamsCookieAttributesSecure = "auto" WaitingRoomUpdateParamsCookieAttributesSecureAlways WaitingRoomUpdateParamsCookieAttributesSecure = "always" WaitingRoomUpdateParamsCookieAttributesSecureNever WaitingRoomUpdateParamsCookieAttributesSecure = "never" )
type WaitingRoomUpdateParamsDefaultTemplateLanguage ¶
type WaitingRoomUpdateParamsDefaultTemplateLanguage string
The language of the default page template. If no default_template_language is provided, then `en-US` (English) will be used.
const ( WaitingRoomUpdateParamsDefaultTemplateLanguageEnUs WaitingRoomUpdateParamsDefaultTemplateLanguage = "en-US" WaitingRoomUpdateParamsDefaultTemplateLanguageEsEs WaitingRoomUpdateParamsDefaultTemplateLanguage = "es-ES" WaitingRoomUpdateParamsDefaultTemplateLanguageDeDe WaitingRoomUpdateParamsDefaultTemplateLanguage = "de-DE" WaitingRoomUpdateParamsDefaultTemplateLanguageFrFr WaitingRoomUpdateParamsDefaultTemplateLanguage = "fr-FR" WaitingRoomUpdateParamsDefaultTemplateLanguageItIt WaitingRoomUpdateParamsDefaultTemplateLanguage = "it-IT" WaitingRoomUpdateParamsDefaultTemplateLanguageJaJp WaitingRoomUpdateParamsDefaultTemplateLanguage = "ja-JP" WaitingRoomUpdateParamsDefaultTemplateLanguageKoKr WaitingRoomUpdateParamsDefaultTemplateLanguage = "ko-KR" WaitingRoomUpdateParamsDefaultTemplateLanguagePtBr WaitingRoomUpdateParamsDefaultTemplateLanguage = "pt-BR" WaitingRoomUpdateParamsDefaultTemplateLanguageZhCn WaitingRoomUpdateParamsDefaultTemplateLanguage = "zh-CN" WaitingRoomUpdateParamsDefaultTemplateLanguageZhTw WaitingRoomUpdateParamsDefaultTemplateLanguage = "zh-TW" WaitingRoomUpdateParamsDefaultTemplateLanguageNlNl WaitingRoomUpdateParamsDefaultTemplateLanguage = "nl-NL" WaitingRoomUpdateParamsDefaultTemplateLanguagePlPl WaitingRoomUpdateParamsDefaultTemplateLanguage = "pl-PL" WaitingRoomUpdateParamsDefaultTemplateLanguageIDID WaitingRoomUpdateParamsDefaultTemplateLanguage = "id-ID" WaitingRoomUpdateParamsDefaultTemplateLanguageTrTr WaitingRoomUpdateParamsDefaultTemplateLanguage = "tr-TR" WaitingRoomUpdateParamsDefaultTemplateLanguageArEg WaitingRoomUpdateParamsDefaultTemplateLanguage = "ar-EG" WaitingRoomUpdateParamsDefaultTemplateLanguageRuRu WaitingRoomUpdateParamsDefaultTemplateLanguage = "ru-RU" WaitingRoomUpdateParamsDefaultTemplateLanguageFaIr WaitingRoomUpdateParamsDefaultTemplateLanguage = "fa-IR" )
type WaitingRoomUpdateParamsQueueingMethod ¶
type WaitingRoomUpdateParamsQueueingMethod string
Sets the queueing method used by the waiting room. Changing this parameter from the **default** queueing method is only available for the Waiting Room Advanced subscription. Regardless of the queueing method, if `queue_all` is enabled or an event is prequeueing, users in the waiting room will not be accepted to the origin. These users will always see a waiting room page that refreshes automatically. The valid queueing methods are:
- `fifo` **(default)**: First-In-First-Out queue where customers gain access in the order they arrived.
- `random`: Random queue where customers gain access randomly, regardless of arrival time.
- `passthrough`: Users will pass directly through the waiting room and into the origin website. As a result, any configured limits will not be respected while this is enabled. This method can be used as an alternative to disabling a waiting room (with `suspended`) so that analytics are still reported. This can be used if you wish to allow all traffic normally, but want to restrict traffic during a waiting room event, or vice versa.
- `reject`: Users will be immediately rejected from the waiting room. As a result, no users will reach the origin website while this is enabled. This can be used if you wish to reject all traffic while performing maintenance, block traffic during a specified period of time (an event), or block traffic while events are not occurring. Consider a waiting room used for vaccine distribution that only allows traffic during sign-up events, and otherwise blocks all traffic. For this case, the waiting room uses `reject`, and its events override this with `fifo`, `random`, or `passthrough`. When this queueing method is enabled and neither `queueAll` is enabled nor an event is prequeueing, the waiting room page **will not refresh automatically**.
const ( WaitingRoomUpdateParamsQueueingMethodFifo WaitingRoomUpdateParamsQueueingMethod = "fifo" WaitingRoomUpdateParamsQueueingMethodRandom WaitingRoomUpdateParamsQueueingMethod = "random" WaitingRoomUpdateParamsQueueingMethodPassthrough WaitingRoomUpdateParamsQueueingMethod = "passthrough" WaitingRoomUpdateParamsQueueingMethodReject WaitingRoomUpdateParamsQueueingMethod = "reject" )
type WaitingRoomUpdateParamsQueueingStatusCode ¶
type WaitingRoomUpdateParamsQueueingStatusCode int64
HTTP status code returned to a user while in the queue.
const ( WaitingRoomUpdateParamsQueueingStatusCode200 WaitingRoomUpdateParamsQueueingStatusCode = 200 WaitingRoomUpdateParamsQueueingStatusCode202 WaitingRoomUpdateParamsQueueingStatusCode = 202 WaitingRoomUpdateParamsQueueingStatusCode429 WaitingRoomUpdateParamsQueueingStatusCode = 429 )
type WaitingRoomUpdateResponseEnvelope ¶
type WaitingRoomUpdateResponseEnvelope struct { Result WaitingroomWaitingroom `json:"result,required"` JSON waitingRoomUpdateResponseEnvelopeJSON `json:"-"` }
func (*WaitingRoomUpdateResponseEnvelope) UnmarshalJSON ¶
func (r *WaitingRoomUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type WaitingroomEventDetailsResult ¶
type WaitingroomEventDetailsResult struct { ID interface{} `json:"id"` CreatedOn time.Time `json:"created_on" format:"date-time"` CustomPageHTML string `json:"custom_page_html"` // A note that you can use to add more details about the event. Description string `json:"description"` DisableSessionRenewal bool `json:"disable_session_renewal"` // An ISO 8601 timestamp that marks the end of the event. EventEndTime string `json:"event_end_time"` // An ISO 8601 timestamp that marks the start of the event. At this time, queued // users will be processed with the event's configuration. The start time must be // at least one minute before `event_end_time`. EventStartTime string `json:"event_start_time"` ModifiedOn time.Time `json:"modified_on" format:"date-time"` // A unique name to identify the event. Only alphanumeric characters, hyphens and // underscores are allowed. Name string `json:"name"` NewUsersPerMinute int64 `json:"new_users_per_minute"` // An ISO 8601 timestamp that marks when to begin queueing all users before the // event starts. The prequeue must start at least five minutes before // `event_start_time`. PrequeueStartTime string `json:"prequeue_start_time,nullable"` QueueingMethod string `json:"queueing_method"` SessionDuration int64 `json:"session_duration"` // If enabled, users in the prequeue will be shuffled randomly at the // `event_start_time`. Requires that `prequeue_start_time` is not null. This is // useful for situations when many users will join the event prequeue at the same // time and you want to shuffle them to ensure fairness. Naturally, it makes the // most sense to enable this feature when the `queueing_method` during the event // respects ordering such as **fifo**, or else the shuffling may be unnecessary. ShuffleAtEventStart bool `json:"shuffle_at_event_start"` // Suspends or allows an event. If set to `true`, the event is ignored and traffic // will be handled based on the waiting room configuration. Suspended bool `json:"suspended"` TotalActiveUsers int64 `json:"total_active_users"` JSON waitingroomEventDetailsResultJSON `json:"-"` }
func (*WaitingroomEventDetailsResult) UnmarshalJSON ¶
func (r *WaitingroomEventDetailsResult) UnmarshalJSON(data []byte) (err error)
type WaitingroomEventResult ¶
type WaitingroomEventResult struct { ID interface{} `json:"id"` CreatedOn time.Time `json:"created_on" format:"date-time"` // If set, the event will override the waiting room's `custom_page_html` property // while it is active. If null, the event will inherit it. CustomPageHTML string `json:"custom_page_html,nullable"` // A note that you can use to add more details about the event. Description string `json:"description"` // If set, the event will override the waiting room's `disable_session_renewal` // property while it is active. If null, the event will inherit it. DisableSessionRenewal bool `json:"disable_session_renewal,nullable"` // An ISO 8601 timestamp that marks the end of the event. EventEndTime string `json:"event_end_time"` // An ISO 8601 timestamp that marks the start of the event. At this time, queued // users will be processed with the event's configuration. The start time must be // at least one minute before `event_end_time`. EventStartTime string `json:"event_start_time"` ModifiedOn time.Time `json:"modified_on" format:"date-time"` // A unique name to identify the event. Only alphanumeric characters, hyphens and // underscores are allowed. Name string `json:"name"` // If set, the event will override the waiting room's `new_users_per_minute` // property while it is active. If null, the event will inherit it. This can only // be set if the event's `total_active_users` property is also set. NewUsersPerMinute int64 `json:"new_users_per_minute,nullable"` // An ISO 8601 timestamp that marks when to begin queueing all users before the // event starts. The prequeue must start at least five minutes before // `event_start_time`. PrequeueStartTime string `json:"prequeue_start_time,nullable"` // If set, the event will override the waiting room's `queueing_method` property // while it is active. If null, the event will inherit it. QueueingMethod string `json:"queueing_method,nullable"` // If set, the event will override the waiting room's `session_duration` property // while it is active. If null, the event will inherit it. SessionDuration int64 `json:"session_duration,nullable"` // If enabled, users in the prequeue will be shuffled randomly at the // `event_start_time`. Requires that `prequeue_start_time` is not null. This is // useful for situations when many users will join the event prequeue at the same // time and you want to shuffle them to ensure fairness. Naturally, it makes the // most sense to enable this feature when the `queueing_method` during the event // respects ordering such as **fifo**, or else the shuffling may be unnecessary. ShuffleAtEventStart bool `json:"shuffle_at_event_start"` // Suspends or allows an event. If set to `true`, the event is ignored and traffic // will be handled based on the waiting room configuration. Suspended bool `json:"suspended"` // If set, the event will override the waiting room's `total_active_users` property // while it is active. If null, the event will inherit it. This can only be set if // the event's `new_users_per_minute` property is also set. TotalActiveUsers int64 `json:"total_active_users,nullable"` JSON waitingroomEventResultJSON `json:"-"` }
func (*WaitingroomEventResult) UnmarshalJSON ¶
func (r *WaitingroomEventResult) UnmarshalJSON(data []byte) (err error)
type WaitingroomRuleResult ¶
type WaitingroomRuleResult struct { // The ID of the rule. ID string `json:"id"` // The action to take when the expression matches. Action WaitingroomRuleResultAction `json:"action"` // The description of the rule. Description string `json:"description"` // When set to true, the rule is enabled. Enabled bool `json:"enabled"` // Criteria defining when there is a match for the current rule. Expression string `json:"expression"` LastUpdated time.Time `json:"last_updated" format:"date-time"` // The version of the rule. Version string `json:"version"` JSON waitingroomRuleResultJSON `json:"-"` }
func (*WaitingroomRuleResult) UnmarshalJSON ¶
func (r *WaitingroomRuleResult) UnmarshalJSON(data []byte) (err error)
type WaitingroomRuleResultAction ¶
type WaitingroomRuleResultAction string
The action to take when the expression matches.
const (
WaitingroomRuleResultActionBypassWaitingRoom WaitingroomRuleResultAction = "bypass_waiting_room"
)
type WaitingroomWaitingroom ¶
type WaitingroomWaitingroom struct { ID interface{} `json:"id"` // Only available for the Waiting Room Advanced subscription. Additional hostname // and path combinations to which this waiting room will be applied. There is an // implied wildcard at the end of the path. The hostname and path combination must // be unique to this and all other waiting rooms. AdditionalRoutes []WaitingroomWaitingroomAdditionalRoute `json:"additional_routes"` // Configures cookie attributes for the waiting room cookie. This encrypted cookie // stores a user's status in the waiting room, such as queue position. CookieAttributes WaitingroomWaitingroomCookieAttributes `json:"cookie_attributes"` // Appends a '\_' + a custom suffix to the end of Cloudflare Waiting Room's cookie // name(**cf_waitingroom). If `cookie_suffix` is "abcd", the cookie name will be // `**cf_waitingroom_abcd`. This field is required if using `additional_routes`. CookieSuffix string `json:"cookie_suffix"` CreatedOn time.Time `json:"created_on" format:"date-time"` // Only available for the Waiting Room Advanced subscription. This is a template // html file that will be rendered at the edge. If no custom_page_html is provided, // the default waiting room will be used. The template is based on mustache ( // https://mustache.github.io/ ). There are several variables that are evaluated by // the Cloudflare edge: // // 1. {{`waitTimeKnown`}} Acts like a boolean value that indicates the behavior to // take when wait time is not available, for instance when queue_all is // **true**. // 2. {{`waitTimeFormatted`}} Estimated wait time for the user. For example, five // minutes. Alternatively, you can use: // 3. {{`waitTime`}} Number of minutes of estimated wait for a user. // 4. {{`waitTimeHours`}} Number of hours of estimated wait for a user // (`Math.floor(waitTime/60)`). // 5. {{`waitTimeHourMinutes`}} Number of minutes above the `waitTimeHours` value // (`waitTime%60`). // 6. {{`queueIsFull`}} Changes to **true** when no more people can be added to the // queue. // // To view the full list of variables, look at the `cfWaitingRoom` object described // under the `json_response_enabled` property in other Waiting Room API calls. CustomPageHTML string `json:"custom_page_html"` // The language of the default page template. If no default_template_language is // provided, then `en-US` (English) will be used. DefaultTemplateLanguage WaitingroomWaitingroomDefaultTemplateLanguage `json:"default_template_language"` // A note that you can use to add more details about the waiting room. Description string `json:"description"` // Only available for the Waiting Room Advanced subscription. Disables automatic // renewal of session cookies. If `true`, an accepted user will have // session_duration minutes to browse the site. After that, they will have to go // through the waiting room again. If `false`, a user's session cookie will be // automatically renewed on every request. DisableSessionRenewal bool `json:"disable_session_renewal"` // The host name to which the waiting room will be applied (no wildcards). Please // do not include the scheme (http:// or https://). The host and path combination // must be unique. Host string `json:"host"` // Only available for the Waiting Room Advanced subscription. If `true`, requests // to the waiting room with the header `Accept: application/json` will receive a // JSON response object with information on the user's status in the waiting room // as opposed to the configured static HTML page. This JSON response object has one // property `cfWaitingRoom` which is an object containing the following fields: // // 1. `inWaitingRoom`: Boolean indicating if the user is in the waiting room // (always **true**). // 2. `waitTimeKnown`: Boolean indicating if the current estimated wait times are // accurate. If **false**, they are not available. // 3. `waitTime`: Valid only when `waitTimeKnown` is **true**. Integer indicating // the current estimated time in minutes the user will wait in the waiting room. // When `queueingMethod` is **random**, this is set to `waitTime50Percentile`. // 4. `waitTime25Percentile`: Valid only when `queueingMethod` is **random** and // `waitTimeKnown` is **true**. Integer indicating the current estimated maximum // wait time for the 25% of users that gain entry the fastest (25th percentile). // 5. `waitTime50Percentile`: Valid only when `queueingMethod` is **random** and // `waitTimeKnown` is **true**. Integer indicating the current estimated maximum // wait time for the 50% of users that gain entry the fastest (50th percentile). // In other words, half of the queued users are expected to let into the origin // website before `waitTime50Percentile` and half are expected to be let in // after it. // 6. `waitTime75Percentile`: Valid only when `queueingMethod` is **random** and // `waitTimeKnown` is **true**. Integer indicating the current estimated maximum // wait time for the 75% of users that gain entry the fastest (75th percentile). // 7. `waitTimeFormatted`: String displaying the `waitTime` formatted in English // for users. If `waitTimeKnown` is **false**, `waitTimeFormatted` will display // **unavailable**. // 8. `queueIsFull`: Boolean indicating if the waiting room's queue is currently // full and not accepting new users at the moment. // 9. `queueAll`: Boolean indicating if all users will be queued in the waiting // room and no one will be let into the origin website. // 10. `lastUpdated`: String displaying the timestamp as an ISO 8601 string of the // user's last attempt to leave the waiting room and be let into the origin // website. The user is able to make another attempt after // `refreshIntervalSeconds` past this time. If the user makes a request too // soon, it will be ignored and `lastUpdated` will not change. // 11. `refreshIntervalSeconds`: Integer indicating the number of seconds after // `lastUpdated` until the user is able to make another attempt to leave the // waiting room and be let into the origin website. When the `queueingMethod` // is `reject`, there is no specified refresh time — it will always be // **zero**. // 12. `queueingMethod`: The queueing method currently used by the waiting room. It // is either **fifo**, **random**, **passthrough**, or **reject**. // 13. `isFIFOQueue`: Boolean indicating if the waiting room uses a FIFO // (First-In-First-Out) queue. // 14. `isRandomQueue`: Boolean indicating if the waiting room uses a Random queue // where users gain access randomly. // 15. `isPassthroughQueue`: Boolean indicating if the waiting room uses a // passthrough queue. Keep in mind that when passthrough is enabled, this JSON // response will only exist when `queueAll` is **true** or `isEventPrequeueing` // is **true** because in all other cases requests will go directly to the // origin. // 16. `isRejectQueue`: Boolean indicating if the waiting room uses a reject queue. // 17. `isEventActive`: Boolean indicating if an event is currently occurring. // Events are able to change a waiting room's behavior during a specified // period of time. For additional information, look at the event properties // `prequeue_start_time`, `event_start_time`, and `event_end_time` in the // documentation for creating waiting room events. Events are considered active // between these start and end times, as well as during the prequeueing period // if it exists. // 18. `isEventPrequeueing`: Valid only when `isEventActive` is **true**. Boolean // indicating if an event is currently prequeueing users before it starts. // 19. `timeUntilEventStart`: Valid only when `isEventPrequeueing` is **true**. // Integer indicating the number of minutes until the event starts. // 20. `timeUntilEventStartFormatted`: String displaying the `timeUntilEventStart` // formatted in English for users. If `isEventPrequeueing` is **false**, // `timeUntilEventStartFormatted` will display **unavailable**. // 21. `timeUntilEventEnd`: Valid only when `isEventActive` is **true**. Integer // indicating the number of minutes until the event ends. // 22. `timeUntilEventEndFormatted`: String displaying the `timeUntilEventEnd` // formatted in English for users. If `isEventActive` is **false**, // `timeUntilEventEndFormatted` will display **unavailable**. // 23. `shuffleAtEventStart`: Valid only when `isEventActive` is **true**. Boolean // indicating if the users in the prequeue are shuffled randomly when the event // starts. // // An example cURL to a waiting room could be: // // curl -X GET "https://example.com/waitingroom" \ // -H "Accept: application/json" // // If `json_response_enabled` is **true** and the request hits the waiting room, an // example JSON response when `queueingMethod` is **fifo** and no event is active // could be: // // { // "cfWaitingRoom": { // "inWaitingRoom": true, // "waitTimeKnown": true, // "waitTime": 10, // "waitTime25Percentile": 0, // "waitTime50Percentile": 0, // "waitTime75Percentile": 0, // "waitTimeFormatted": "10 minutes", // "queueIsFull": false, // "queueAll": false, // "lastUpdated": "2020-08-03T23:46:00.000Z", // "refreshIntervalSeconds": 20, // "queueingMethod": "fifo", // "isFIFOQueue": true, // "isRandomQueue": false, // "isPassthroughQueue": false, // "isRejectQueue": false, // "isEventActive": false, // "isEventPrequeueing": false, // "timeUntilEventStart": 0, // "timeUntilEventStartFormatted": "unavailable", // "timeUntilEventEnd": 0, // "timeUntilEventEndFormatted": "unavailable", // "shuffleAtEventStart": false // } // } // // If `json_response_enabled` is **true** and the request hits the waiting room, an // example JSON response when `queueingMethod` is **random** and an event is active // could be: // // { // "cfWaitingRoom": { // "inWaitingRoom": true, // "waitTimeKnown": true, // "waitTime": 10, // "waitTime25Percentile": 5, // "waitTime50Percentile": 10, // "waitTime75Percentile": 15, // "waitTimeFormatted": "5 minutes to 15 minutes", // "queueIsFull": false, // "queueAll": false, // "lastUpdated": "2020-08-03T23:46:00.000Z", // "refreshIntervalSeconds": 20, // "queueingMethod": "random", // "isFIFOQueue": false, // "isRandomQueue": true, // "isPassthroughQueue": false, // "isRejectQueue": false, // "isEventActive": true, // "isEventPrequeueing": false, // "timeUntilEventStart": 0, // "timeUntilEventStartFormatted": "unavailable", // "timeUntilEventEnd": 15, // "timeUntilEventEndFormatted": "15 minutes", // "shuffleAtEventStart": true // } // }. JsonResponseEnabled bool `json:"json_response_enabled"` ModifiedOn time.Time `json:"modified_on" format:"date-time"` // A unique name to identify the waiting room. Only alphanumeric characters, // hyphens and underscores are allowed. Name string `json:"name"` // Sets the number of new users that will be let into the route every minute. This // value is used as baseline for the number of users that are let in per minute. So // it is possible that there is a little more or little less traffic coming to the // route based on the traffic patterns at that time around the world. NewUsersPerMinute int64 `json:"new_users_per_minute"` // An ISO 8601 timestamp that marks when the next event will begin queueing. NextEventPrequeueStartTime string `json:"next_event_prequeue_start_time,nullable"` // An ISO 8601 timestamp that marks when the next event will start. NextEventStartTime string `json:"next_event_start_time,nullable"` // Sets the path within the host to enable the waiting room on. The waiting room // will be enabled for all subpaths as well. If there are two waiting rooms on the // same subpath, the waiting room for the most specific path will be chosen. // Wildcards and query parameters are not supported. Path string `json:"path"` // If queue_all is `true`, all the traffic that is coming to a route will be sent // to the waiting room. No new traffic can get to the route once this field is set // and estimated time will become unavailable. QueueAll bool `json:"queue_all"` // Sets the queueing method used by the waiting room. Changing this parameter from // the **default** queueing method is only available for the Waiting Room Advanced // subscription. Regardless of the queueing method, if `queue_all` is enabled or an // event is prequeueing, users in the waiting room will not be accepted to the // origin. These users will always see a waiting room page that refreshes // automatically. The valid queueing methods are: // // 1. `fifo` **(default)**: First-In-First-Out queue where customers gain access in // the order they arrived. // 2. `random`: Random queue where customers gain access randomly, regardless of // arrival time. // 3. `passthrough`: Users will pass directly through the waiting room and into the // origin website. As a result, any configured limits will not be respected // while this is enabled. This method can be used as an alternative to disabling // a waiting room (with `suspended`) so that analytics are still reported. This // can be used if you wish to allow all traffic normally, but want to restrict // traffic during a waiting room event, or vice versa. // 4. `reject`: Users will be immediately rejected from the waiting room. As a // result, no users will reach the origin website while this is enabled. This // can be used if you wish to reject all traffic while performing maintenance, // block traffic during a specified period of time (an event), or block traffic // while events are not occurring. Consider a waiting room used for vaccine // distribution that only allows traffic during sign-up events, and otherwise // blocks all traffic. For this case, the waiting room uses `reject`, and its // events override this with `fifo`, `random`, or `passthrough`. When this // queueing method is enabled and neither `queueAll` is enabled nor an event is // prequeueing, the waiting room page **will not refresh automatically**. QueueingMethod WaitingroomWaitingroomQueueingMethod `json:"queueing_method"` // HTTP status code returned to a user while in the queue. QueueingStatusCode WaitingroomWaitingroomQueueingStatusCode `json:"queueing_status_code"` // Lifetime of a cookie (in minutes) set by Cloudflare for users who get access to // the route. If a user is not seen by Cloudflare again in that time period, they // will be treated as a new user that visits the route. SessionDuration int64 `json:"session_duration"` // Suspends or allows traffic going to the waiting room. If set to `true`, the // traffic will not go to the waiting room. Suspended bool `json:"suspended"` // Sets the total number of active user sessions on the route at a point in time. A // route is a combination of host and path on which a waiting room is available. // This value is used as a baseline for the total number of active user sessions on // the route. It is possible to have a situation where there are more or less // active users sessions on the route based on the traffic patterns at that time // around the world. TotalActiveUsers int64 `json:"total_active_users"` JSON waitingroomWaitingroomJSON `json:"-"` }
func (*WaitingroomWaitingroom) UnmarshalJSON ¶
func (r *WaitingroomWaitingroom) UnmarshalJSON(data []byte) (err error)
type WaitingroomWaitingroomAdditionalRoute ¶
type WaitingroomWaitingroomAdditionalRoute struct { // The hostname to which this waiting room will be applied (no wildcards). The // hostname must be the primary domain, subdomain, or custom hostname (if using SSL // for SaaS) of this zone. Please do not include the scheme (http:// or https://). Host string `json:"host"` // Sets the path within the host to enable the waiting room on. The waiting room // will be enabled for all subpaths as well. If there are two waiting rooms on the // same subpath, the waiting room for the most specific path will be chosen. // Wildcards and query parameters are not supported. Path string `json:"path"` JSON waitingroomWaitingroomAdditionalRouteJSON `json:"-"` }
func (*WaitingroomWaitingroomAdditionalRoute) UnmarshalJSON ¶
func (r *WaitingroomWaitingroomAdditionalRoute) UnmarshalJSON(data []byte) (err error)
type WaitingroomWaitingroomCookieAttributes ¶
type WaitingroomWaitingroomCookieAttributes struct { // Configures the SameSite attribute on the waiting room cookie. Value `auto` will // be translated to `lax` or `none` depending if **Always Use HTTPS** is enabled. // Note that when using value `none`, the secure attribute cannot be set to // `never`. Samesite WaitingroomWaitingroomCookieAttributesSamesite `json:"samesite"` // Configures the Secure attribute on the waiting room cookie. Value `always` // indicates that the Secure attribute will be set in the Set-Cookie header, // `never` indicates that the Secure attribute will not be set, and `auto` will set // the Secure attribute depending if **Always Use HTTPS** is enabled. Secure WaitingroomWaitingroomCookieAttributesSecure `json:"secure"` JSON waitingroomWaitingroomCookieAttributesJSON `json:"-"` }
Configures cookie attributes for the waiting room cookie. This encrypted cookie stores a user's status in the waiting room, such as queue position.
func (*WaitingroomWaitingroomCookieAttributes) UnmarshalJSON ¶
func (r *WaitingroomWaitingroomCookieAttributes) UnmarshalJSON(data []byte) (err error)
type WaitingroomWaitingroomCookieAttributesSamesite ¶
type WaitingroomWaitingroomCookieAttributesSamesite string
Configures the SameSite attribute on the waiting room cookie. Value `auto` will be translated to `lax` or `none` depending if **Always Use HTTPS** is enabled. Note that when using value `none`, the secure attribute cannot be set to `never`.
const ( WaitingroomWaitingroomCookieAttributesSamesiteAuto WaitingroomWaitingroomCookieAttributesSamesite = "auto" WaitingroomWaitingroomCookieAttributesSamesiteLax WaitingroomWaitingroomCookieAttributesSamesite = "lax" WaitingroomWaitingroomCookieAttributesSamesiteNone WaitingroomWaitingroomCookieAttributesSamesite = "none" WaitingroomWaitingroomCookieAttributesSamesiteStrict WaitingroomWaitingroomCookieAttributesSamesite = "strict" )
type WaitingroomWaitingroomCookieAttributesSecure ¶
type WaitingroomWaitingroomCookieAttributesSecure string
Configures the Secure attribute on the waiting room cookie. Value `always` indicates that the Secure attribute will be set in the Set-Cookie header, `never` indicates that the Secure attribute will not be set, and `auto` will set the Secure attribute depending if **Always Use HTTPS** is enabled.
const ( WaitingroomWaitingroomCookieAttributesSecureAuto WaitingroomWaitingroomCookieAttributesSecure = "auto" WaitingroomWaitingroomCookieAttributesSecureAlways WaitingroomWaitingroomCookieAttributesSecure = "always" WaitingroomWaitingroomCookieAttributesSecureNever WaitingroomWaitingroomCookieAttributesSecure = "never" )
type WaitingroomWaitingroomDefaultTemplateLanguage ¶
type WaitingroomWaitingroomDefaultTemplateLanguage string
The language of the default page template. If no default_template_language is provided, then `en-US` (English) will be used.
const ( WaitingroomWaitingroomDefaultTemplateLanguageEnUs WaitingroomWaitingroomDefaultTemplateLanguage = "en-US" WaitingroomWaitingroomDefaultTemplateLanguageEsEs WaitingroomWaitingroomDefaultTemplateLanguage = "es-ES" WaitingroomWaitingroomDefaultTemplateLanguageDeDe WaitingroomWaitingroomDefaultTemplateLanguage = "de-DE" WaitingroomWaitingroomDefaultTemplateLanguageFrFr WaitingroomWaitingroomDefaultTemplateLanguage = "fr-FR" WaitingroomWaitingroomDefaultTemplateLanguageItIt WaitingroomWaitingroomDefaultTemplateLanguage = "it-IT" WaitingroomWaitingroomDefaultTemplateLanguageJaJp WaitingroomWaitingroomDefaultTemplateLanguage = "ja-JP" WaitingroomWaitingroomDefaultTemplateLanguageKoKr WaitingroomWaitingroomDefaultTemplateLanguage = "ko-KR" WaitingroomWaitingroomDefaultTemplateLanguagePtBr WaitingroomWaitingroomDefaultTemplateLanguage = "pt-BR" WaitingroomWaitingroomDefaultTemplateLanguageZhCn WaitingroomWaitingroomDefaultTemplateLanguage = "zh-CN" WaitingroomWaitingroomDefaultTemplateLanguageZhTw WaitingroomWaitingroomDefaultTemplateLanguage = "zh-TW" WaitingroomWaitingroomDefaultTemplateLanguageNlNl WaitingroomWaitingroomDefaultTemplateLanguage = "nl-NL" WaitingroomWaitingroomDefaultTemplateLanguagePlPl WaitingroomWaitingroomDefaultTemplateLanguage = "pl-PL" WaitingroomWaitingroomDefaultTemplateLanguageIDID WaitingroomWaitingroomDefaultTemplateLanguage = "id-ID" WaitingroomWaitingroomDefaultTemplateLanguageTrTr WaitingroomWaitingroomDefaultTemplateLanguage = "tr-TR" WaitingroomWaitingroomDefaultTemplateLanguageArEg WaitingroomWaitingroomDefaultTemplateLanguage = "ar-EG" WaitingroomWaitingroomDefaultTemplateLanguageRuRu WaitingroomWaitingroomDefaultTemplateLanguage = "ru-RU" WaitingroomWaitingroomDefaultTemplateLanguageFaIr WaitingroomWaitingroomDefaultTemplateLanguage = "fa-IR" )
type WaitingroomWaitingroomQueueingMethod ¶
type WaitingroomWaitingroomQueueingMethod string
Sets the queueing method used by the waiting room. Changing this parameter from the **default** queueing method is only available for the Waiting Room Advanced subscription. Regardless of the queueing method, if `queue_all` is enabled or an event is prequeueing, users in the waiting room will not be accepted to the origin. These users will always see a waiting room page that refreshes automatically. The valid queueing methods are:
- `fifo` **(default)**: First-In-First-Out queue where customers gain access in the order they arrived.
- `random`: Random queue where customers gain access randomly, regardless of arrival time.
- `passthrough`: Users will pass directly through the waiting room and into the origin website. As a result, any configured limits will not be respected while this is enabled. This method can be used as an alternative to disabling a waiting room (with `suspended`) so that analytics are still reported. This can be used if you wish to allow all traffic normally, but want to restrict traffic during a waiting room event, or vice versa.
- `reject`: Users will be immediately rejected from the waiting room. As a result, no users will reach the origin website while this is enabled. This can be used if you wish to reject all traffic while performing maintenance, block traffic during a specified period of time (an event), or block traffic while events are not occurring. Consider a waiting room used for vaccine distribution that only allows traffic during sign-up events, and otherwise blocks all traffic. For this case, the waiting room uses `reject`, and its events override this with `fifo`, `random`, or `passthrough`. When this queueing method is enabled and neither `queueAll` is enabled nor an event is prequeueing, the waiting room page **will not refresh automatically**.
const ( WaitingroomWaitingroomQueueingMethodFifo WaitingroomWaitingroomQueueingMethod = "fifo" WaitingroomWaitingroomQueueingMethodRandom WaitingroomWaitingroomQueueingMethod = "random" WaitingroomWaitingroomQueueingMethodPassthrough WaitingroomWaitingroomQueueingMethod = "passthrough" WaitingroomWaitingroomQueueingMethodReject WaitingroomWaitingroomQueueingMethod = "reject" )
type WaitingroomWaitingroomQueueingStatusCode ¶
type WaitingroomWaitingroomQueueingStatusCode int64
HTTP status code returned to a user while in the queue.
const ( WaitingroomWaitingroomQueueingStatusCode200 WaitingroomWaitingroomQueueingStatusCode = 200 WaitingroomWaitingroomQueueingStatusCode202 WaitingroomWaitingroomQueueingStatusCode = 202 WaitingroomWaitingroomQueueingStatusCode429 WaitingroomWaitingroomQueueingStatusCode = 429 )