Documentation ¶
Index ¶
- Constants
- type ASN
- type ASNParam
- type AdditionalRoutes
- type AdditionalRoutesParam
- type AuditLog
- type AuditLogAction
- type AuditLogActor
- type AuditLogActorType
- type AuditLogOwner
- type AuditLogResource
- type CertificateCA
- type CertificateRequestType
- type CloudflareTunnel
- type CloudflareTunnelConnection
- type CloudflareTunnelStatus
- type CloudflareTunnelTunType
- type CookieAttributes
- type CookieAttributesParam
- type CookieAttributesSamesite
- type CookieAttributesSecure
- type Error
- type ErrorData
- type Event
- type EventDeleteParams
- type EventDeleteResponse
- type EventDeleteResponseEnvelope
- type EventDetailGetParams
- type EventDetailGetResponse
- type EventDetailGetResponseEnvelope
- type EventDetailService
- type EventEditParams
- type EventEditResponseEnvelope
- type EventGetParams
- type EventGetResponseEnvelope
- type EventListParams
- type EventNewParams
- type EventNewResponseEnvelope
- type EventQueryParam
- type EventService
- func (r *EventService) Delete(ctx context.Context, waitingRoomID string, eventID string, ...) (res *EventDeleteResponse, err error)
- func (r *EventService) Edit(ctx context.Context, waitingRoomID string, eventID string, ...) (res *Event, err error)
- func (r *EventService) Get(ctx context.Context, waitingRoomID string, eventID string, ...) (res *Event, err error)
- func (r *EventService) List(ctx context.Context, waitingRoomID string, params EventListParams, ...) (res *pagination.V4PagePaginationArray[Event], err error)
- func (r *EventService) ListAutoPaging(ctx context.Context, waitingRoomID string, params EventListParams, ...) *pagination.V4PagePaginationArrayAutoPager[Event]
- func (r *EventService) New(ctx context.Context, waitingRoomID string, params EventNewParams, ...) (res *Event, err error)
- func (r *EventService) Update(ctx context.Context, waitingRoomID string, eventID string, ...) (res *Event, err error)
- type EventUpdateParams
- type EventUpdateResponseEnvelope
- type MemberParam
- type MemberRoleParam
- type MemberRolesPermissionsParam
- type MemberStatus
- type MemberUserParam
- type PagePreviewParams
- type PagePreviewResponse
- type PagePreviewResponseEnvelope
- type PageService
- type Permission
- type PermissionGrant
- type PermissionGrantParam
- type QueryDefaultTemplateLanguage
- type QueryEnabledOriginCommand
- type QueryParam
- type QueryQueueingMethod
- type QueryQueueingStatusCode
- type RatePlan
- type RatePlanParam
- type ResponseInfo
- type Role
- type RuleDeleteParams
- type RuleDeleteResponseEnvelope
- type RuleDeleteResponseEnvelopeResultInfo
- type RuleDeleteResponseEnvelopeSuccess
- type RuleEditParams
- type RuleEditParamsAction
- type RuleEditParamsPosition
- type RuleEditParamsPositionAfter
- type RuleEditParamsPositionBefore
- type RuleEditParamsPositionIndex
- type RuleEditParamsPositionUnion
- type RuleEditResponseEnvelope
- type RuleEditResponseEnvelopeResultInfo
- type RuleEditResponseEnvelopeSuccess
- type RuleGetParams
- type RuleGetResponseEnvelope
- type RuleGetResponseEnvelopeResultInfo
- type RuleGetResponseEnvelopeSuccess
- type RuleNewParams
- type RuleNewParamsAction
- type RuleNewResponseEnvelope
- type RuleNewResponseEnvelopeResultInfo
- type RuleNewResponseEnvelopeSuccess
- type RuleService
- func (r *RuleService) Delete(ctx context.Context, waitingRoomID string, ruleID string, ...) (res *[]WaitingRoomRule, err error)
- func (r *RuleService) Edit(ctx context.Context, waitingRoomID string, ruleID string, ...) (res *[]WaitingRoomRule, err error)
- func (r *RuleService) Get(ctx context.Context, waitingRoomID string, query RuleGetParams, ...) (res *[]WaitingRoomRule, err error)
- func (r *RuleService) New(ctx context.Context, waitingRoomID string, params RuleNewParams, ...) (res *[]WaitingRoomRule, err error)
- func (r *RuleService) Update(ctx context.Context, waitingRoomID string, params RuleUpdateParams, ...) (res *[]WaitingRoomRule, err error)
- type RuleUpdateParams
- type RuleUpdateParamsBody
- type RuleUpdateParamsBodyAction
- type RuleUpdateResponseEnvelope
- type RuleUpdateResponseEnvelopeResultInfo
- type RuleUpdateResponseEnvelopeSuccess
- type SettingEditParams
- type SettingEditResponse
- type SettingEditResponseEnvelope
- type SettingGetParams
- type SettingGetResponse
- type SettingGetResponseEnvelope
- type SettingService
- func (r *SettingService) Edit(ctx context.Context, params SettingEditParams, opts ...option.RequestOption) (res *SettingEditResponse, err error)
- func (r *SettingService) Get(ctx context.Context, query SettingGetParams, opts ...option.RequestOption) (res *SettingGetResponse, err error)
- func (r *SettingService) Update(ctx context.Context, params SettingUpdateParams, opts ...option.RequestOption) (res *SettingUpdateResponse, err error)
- type SettingUpdateParams
- type SettingUpdateResponse
- type SettingUpdateResponseEnvelope
- type SortDirection
- type StatusGetParams
- type StatusGetResponse
- type StatusGetResponseEnvelope
- type StatusGetResponseStatus
- type StatusService
- type Subscription
- type SubscriptionFrequency
- type SubscriptionParam
- type SubscriptionState
- type WaitingRoom
- type WaitingRoomDefaultTemplateLanguage
- type WaitingRoomDeleteParams
- type WaitingRoomDeleteResponse
- type WaitingRoomDeleteResponseEnvelope
- type WaitingRoomEditParams
- type WaitingRoomEditResponseEnvelope
- type WaitingRoomEnabledOriginCommand
- type WaitingRoomGetParams
- type WaitingRoomGetResponseEnvelope
- type WaitingRoomListParams
- type WaitingRoomNewParams
- type WaitingRoomNewResponseEnvelope
- type WaitingRoomQueueingMethod
- type WaitingRoomQueueingStatusCode
- type WaitingRoomRule
- type WaitingRoomRuleAction
- type WaitingRoomService
- func (r *WaitingRoomService) Delete(ctx context.Context, waitingRoomID string, body WaitingRoomDeleteParams, ...) (res *WaitingRoomDeleteResponse, err error)
- func (r *WaitingRoomService) Edit(ctx context.Context, waitingRoomID string, params WaitingRoomEditParams, ...) (res *WaitingRoom, err error)
- func (r *WaitingRoomService) Get(ctx context.Context, waitingRoomID string, query WaitingRoomGetParams, ...) (res *WaitingRoom, err error)
- func (r *WaitingRoomService) List(ctx context.Context, params WaitingRoomListParams, ...) (res *pagination.V4PagePaginationArray[WaitingRoom], err error)
- func (r *WaitingRoomService) ListAutoPaging(ctx context.Context, params WaitingRoomListParams, ...) *pagination.V4PagePaginationArrayAutoPager[WaitingRoom]
- func (r *WaitingRoomService) New(ctx context.Context, params WaitingRoomNewParams, opts ...option.RequestOption) (res *WaitingRoom, err error)
- func (r *WaitingRoomService) Update(ctx context.Context, waitingRoomID string, params WaitingRoomUpdateParams, ...) (res *WaitingRoom, err error)
- type WaitingRoomUpdateParams
- type WaitingRoomUpdateResponseEnvelope
Constants ¶
const AuditLogActorTypeAdmin = shared.AuditLogActorTypeAdmin
This is an alias to an internal value.
const AuditLogActorTypeCloudflare = shared.AuditLogActorTypeCloudflare
This is an alias to an internal value.
const AuditLogActorTypeUser = shared.AuditLogActorTypeUser
This is an alias to an internal value.
const CertificateCADigicert = shared.CertificateCADigicert
This is an alias to an internal value.
const CertificateCAGoogle = shared.CertificateCAGoogle
This is an alias to an internal value.
const CertificateCALetsEncrypt = shared.CertificateCALetsEncrypt
This is an alias to an internal value.
const CertificateCASSLCom = shared.CertificateCASSLCom
This is an alias to an internal value.
const CertificateRequestTypeKeylessCertificate = shared.CertificateRequestTypeKeylessCertificate
This is an alias to an internal value.
const CertificateRequestTypeOriginECC = shared.CertificateRequestTypeOriginECC
This is an alias to an internal value.
const CertificateRequestTypeOriginRSA = shared.CertificateRequestTypeOriginRSA
This is an alias to an internal value.
const CloudflareTunnelStatusDegraded = shared.CloudflareTunnelStatusDegraded
This is an alias to an internal value.
const CloudflareTunnelStatusDown = shared.CloudflareTunnelStatusDown
This is an alias to an internal value.
const CloudflareTunnelStatusHealthy = shared.CloudflareTunnelStatusHealthy
This is an alias to an internal value.
const CloudflareTunnelStatusInactive = shared.CloudflareTunnelStatusInactive
This is an alias to an internal value.
const CloudflareTunnelTunTypeCNI = shared.CloudflareTunnelTunTypeCNI
This is an alias to an internal value.
const CloudflareTunnelTunTypeCfdTunnel = shared.CloudflareTunnelTunTypeCfdTunnel
This is an alias to an internal value.
const CloudflareTunnelTunTypeGRE = shared.CloudflareTunnelTunTypeGRE
This is an alias to an internal value.
const CloudflareTunnelTunTypeIPSec = shared.CloudflareTunnelTunTypeIPSec
This is an alias to an internal value.
const CloudflareTunnelTunTypeWARPConnector = shared.CloudflareTunnelTunTypeWARPConnector
This is an alias to an internal value.
const MemberStatusAccepted = shared.MemberStatusAccepted
This is an alias to an internal value.
const MemberStatusPending = shared.MemberStatusPending
This is an alias to an internal value.
const SortDirectionAsc = shared.SortDirectionAsc
This is an alias to an internal value.
const SortDirectionDesc = shared.SortDirectionDesc
This is an alias to an internal value.
const SubscriptionFrequencyMonthly = shared.SubscriptionFrequencyMonthly
This is an alias to an internal value.
const SubscriptionFrequencyQuarterly = shared.SubscriptionFrequencyQuarterly
This is an alias to an internal value.
const SubscriptionFrequencyWeekly = shared.SubscriptionFrequencyWeekly
This is an alias to an internal value.
const SubscriptionFrequencyYearly = shared.SubscriptionFrequencyYearly
This is an alias to an internal value.
const SubscriptionStateAwaitingPayment = shared.SubscriptionStateAwaitingPayment
This is an alias to an internal value.
const SubscriptionStateCancelled = shared.SubscriptionStateCancelled
This is an alias to an internal value.
const SubscriptionStateExpired = shared.SubscriptionStateExpired
This is an alias to an internal value.
const SubscriptionStateFailed = shared.SubscriptionStateFailed
This is an alias to an internal value.
const SubscriptionStatePaid = shared.SubscriptionStatePaid
This is an alias to an internal value.
const SubscriptionStateProvisioned = shared.SubscriptionStateProvisioned
This is an alias to an internal value.
const SubscriptionStateTrial = shared.SubscriptionStateTrial
This is an alias to an internal value.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdditionalRoutes ¶
type AdditionalRoutes 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 additionalRoutesJSON `json:"-"` }
func (*AdditionalRoutes) UnmarshalJSON ¶
func (r *AdditionalRoutes) UnmarshalJSON(data []byte) (err error)
type AdditionalRoutesParam ¶
type AdditionalRoutesParam 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 (AdditionalRoutesParam) MarshalJSON ¶
func (r AdditionalRoutesParam) MarshalJSON() (data []byte, err error)
type AuditLogAction ¶
type AuditLogAction = shared.AuditLogAction
This is an alias to an internal type.
type AuditLogActor ¶
type AuditLogActor = shared.AuditLogActor
This is an alias to an internal type.
type AuditLogActorType ¶
type AuditLogActorType = shared.AuditLogActorType
The type of actor, whether a User, Cloudflare Admin, or an Automated System.
This is an alias to an internal type.
type AuditLogOwner ¶
type AuditLogOwner = shared.AuditLogOwner
This is an alias to an internal type.
type AuditLogResource ¶
type AuditLogResource = shared.AuditLogResource
This is an alias to an internal type.
type CertificateCA ¶
type CertificateCA = shared.CertificateCA
The Certificate Authority that will issue the certificate
This is an alias to an internal type.
type CertificateRequestType ¶
type CertificateRequestType = shared.CertificateRequestType
Signature type desired on certificate ("origin-rsa" (rsa), "origin-ecc" (ecdsa), or "keyless-certificate" (for Keyless SSL servers).
This is an alias to an internal type.
type CloudflareTunnel ¶
type CloudflareTunnel = shared.CloudflareTunnel
A Cloudflare Tunnel that connects your origin to Cloudflare's edge.
This is an alias to an internal type.
type CloudflareTunnelConnection ¶
type CloudflareTunnelConnection = shared.CloudflareTunnelConnection
This is an alias to an internal type.
type CloudflareTunnelStatus ¶
type CloudflareTunnelStatus = shared.CloudflareTunnelStatus
The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge).
This is an alias to an internal type.
type CloudflareTunnelTunType ¶
type CloudflareTunnelTunType = shared.CloudflareTunnelTunType
The type of tunnel.
This is an alias to an internal type.
type CookieAttributes ¶
type CookieAttributes 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 CookieAttributesSamesite `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 CookieAttributesSecure `json:"secure"` JSON cookieAttributesJSON `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 (*CookieAttributes) UnmarshalJSON ¶
func (r *CookieAttributes) UnmarshalJSON(data []byte) (err error)
type CookieAttributesParam ¶
type CookieAttributesParam 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[CookieAttributesSamesite] `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[CookieAttributesSecure] `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 (CookieAttributesParam) MarshalJSON ¶
func (r CookieAttributesParam) MarshalJSON() (data []byte, err error)
type CookieAttributesSamesite ¶
type CookieAttributesSamesite 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 ( CookieAttributesSamesiteAuto CookieAttributesSamesite = "auto" CookieAttributesSamesiteLax CookieAttributesSamesite = "lax" CookieAttributesSamesiteNone CookieAttributesSamesite = "none" CookieAttributesSamesiteStrict CookieAttributesSamesite = "strict" )
func (CookieAttributesSamesite) IsKnown ¶
func (r CookieAttributesSamesite) IsKnown() bool
type CookieAttributesSecure ¶
type CookieAttributesSecure 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 ( CookieAttributesSecureAuto CookieAttributesSecure = "auto" CookieAttributesSecureAlways CookieAttributesSecure = "always" CookieAttributesSecureNever CookieAttributesSecure = "never" )
func (CookieAttributesSecure) IsKnown ¶
func (r CookieAttributesSecure) IsKnown() bool
type Event ¶
type Event struct { ID string `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 eventJSON `json:"-"` }
func (*Event) UnmarshalJSON ¶
type EventDeleteParams ¶
type EventDeleteResponse ¶
type EventDeleteResponse struct { ID string `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 EventDetailGetParams ¶
type EventDetailGetResponse ¶
type EventDetailGetResponse struct { ID string `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 eventDetailGetResponseJSON `json:"-"` }
func (*EventDetailGetResponse) UnmarshalJSON ¶
func (r *EventDetailGetResponse) UnmarshalJSON(data []byte) (err error)
type EventDetailGetResponseEnvelope ¶
type EventDetailGetResponseEnvelope struct { Result EventDetailGetResponse `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, waitingRoomID string, eventID string, query EventDetailGetParams, opts ...option.RequestOption) (res *EventDetailGetResponse, 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 { // Identifier ZoneID param.Field[string] `path:"zone_id,required"` EventQuery EventQueryParam `json:"event_query,required"` }
func (EventEditParams) MarshalJSON ¶
func (r EventEditParams) MarshalJSON() (data []byte, err error)
type EventEditResponseEnvelope ¶
type EventEditResponseEnvelope struct { Result Event `json:"result,required"` JSON eventEditResponseEnvelopeJSON `json:"-"` }
func (*EventEditResponseEnvelope) UnmarshalJSON ¶
func (r *EventEditResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type EventGetParams ¶
type EventGetResponseEnvelope ¶
type EventGetResponseEnvelope struct { Result Event `json:"result,required"` JSON eventGetResponseEnvelopeJSON `json:"-"` }
func (*EventGetResponseEnvelope) UnmarshalJSON ¶
func (r *EventGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type EventListParams ¶
type EventListParams struct { // Identifier ZoneID param.Field[string] `path:"zone_id,required"` // Page number of paginated results. Page param.Field[float64] `query:"page"` // Maximum number of results per page. Must be a multiple of 5. PerPage param.Field[float64] `query:"per_page"` }
func (EventListParams) URLQuery ¶
func (r EventListParams) URLQuery() (v url.Values)
URLQuery serializes EventListParams's query parameters as `url.Values`.
type EventNewParams ¶
type EventNewParams struct { // Identifier ZoneID param.Field[string] `path:"zone_id,required"` EventQuery EventQueryParam `json:"event_query,required"` }
func (EventNewParams) MarshalJSON ¶
func (r EventNewParams) MarshalJSON() (data []byte, err error)
type EventNewResponseEnvelope ¶
type EventNewResponseEnvelope struct { Result Event `json:"result,required"` JSON eventNewResponseEnvelopeJSON `json:"-"` }
func (*EventNewResponseEnvelope) UnmarshalJSON ¶
func (r *EventNewResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type EventQueryParam ¶
type EventQueryParam 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 (EventQueryParam) MarshalJSON ¶
func (r EventQueryParam) MarshalJSON() (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, waitingRoomID string, eventID string, body EventDeleteParams, opts ...option.RequestOption) (res *EventDeleteResponse, err error)
Deletes an event for a waiting room.
func (*EventService) Edit ¶
func (r *EventService) Edit(ctx context.Context, waitingRoomID string, eventID string, params EventEditParams, opts ...option.RequestOption) (res *Event, err error)
Patches a configured event for a waiting room.
func (*EventService) Get ¶
func (r *EventService) Get(ctx context.Context, waitingRoomID string, eventID string, query EventGetParams, opts ...option.RequestOption) (res *Event, err error)
Fetches a single configured event for a waiting room.
func (*EventService) List ¶
func (r *EventService) List(ctx context.Context, waitingRoomID string, params EventListParams, opts ...option.RequestOption) (res *pagination.V4PagePaginationArray[Event], err error)
Lists events for a waiting room.
func (*EventService) ListAutoPaging ¶
func (r *EventService) ListAutoPaging(ctx context.Context, waitingRoomID string, params EventListParams, opts ...option.RequestOption) *pagination.V4PagePaginationArrayAutoPager[Event]
Lists events for a waiting room.
func (*EventService) New ¶
func (r *EventService) New(ctx context.Context, waitingRoomID string, params EventNewParams, opts ...option.RequestOption) (res *Event, 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, waitingRoomID string, eventID string, params EventUpdateParams, opts ...option.RequestOption) (res *Event, err error)
Updates a configured event for a waiting room.
type EventUpdateParams ¶
type EventUpdateParams struct { // Identifier ZoneID param.Field[string] `path:"zone_id,required"` EventQuery EventQueryParam `json:"event_query,required"` }
func (EventUpdateParams) MarshalJSON ¶
func (r EventUpdateParams) MarshalJSON() (data []byte, err error)
type EventUpdateResponseEnvelope ¶
type EventUpdateResponseEnvelope struct { Result Event `json:"result,required"` JSON eventUpdateResponseEnvelopeJSON `json:"-"` }
func (*EventUpdateResponseEnvelope) UnmarshalJSON ¶
func (r *EventUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type MemberRoleParam ¶
type MemberRoleParam = shared.MemberRoleParam
This is an alias to an internal type.
type MemberRolesPermissionsParam ¶
type MemberRolesPermissionsParam = shared.MemberRolesPermissionsParam
This is an alias to an internal type.
type MemberStatus ¶
type MemberStatus = shared.MemberStatus
A member's status in the account.
This is an alias to an internal type.
type MemberUserParam ¶
type MemberUserParam = shared.MemberUserParam
Details of the user associated to the membership.
This is an alias to an internal type.
type PagePreviewParams ¶
type PagePreviewParams struct { // Identifier ZoneID param.Field[string] `path:"zone_id,required"` // 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, params 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 PermissionGrant ¶
type PermissionGrant = shared.PermissionGrant
This is an alias to an internal type.
type PermissionGrantParam ¶
type PermissionGrantParam = shared.PermissionGrantParam
This is an alias to an internal type.
type QueryDefaultTemplateLanguage ¶
type QueryDefaultTemplateLanguage string
The language of the default page template. If no default_template_language is provided, then `en-US` (English) will be used.
const ( QueryDefaultTemplateLanguageEnUs QueryDefaultTemplateLanguage = "en-US" QueryDefaultTemplateLanguageEsEs QueryDefaultTemplateLanguage = "es-ES" QueryDefaultTemplateLanguageDeDe QueryDefaultTemplateLanguage = "de-DE" QueryDefaultTemplateLanguageFrFr QueryDefaultTemplateLanguage = "fr-FR" QueryDefaultTemplateLanguageItIt QueryDefaultTemplateLanguage = "it-IT" QueryDefaultTemplateLanguageJaJp QueryDefaultTemplateLanguage = "ja-JP" QueryDefaultTemplateLanguageKoKr QueryDefaultTemplateLanguage = "ko-KR" QueryDefaultTemplateLanguagePtBr QueryDefaultTemplateLanguage = "pt-BR" QueryDefaultTemplateLanguageZhCn QueryDefaultTemplateLanguage = "zh-CN" QueryDefaultTemplateLanguageZhTw QueryDefaultTemplateLanguage = "zh-TW" QueryDefaultTemplateLanguageNlNl QueryDefaultTemplateLanguage = "nl-NL" QueryDefaultTemplateLanguagePlPl QueryDefaultTemplateLanguage = "pl-PL" QueryDefaultTemplateLanguageIDID QueryDefaultTemplateLanguage = "id-ID" QueryDefaultTemplateLanguageTrTr QueryDefaultTemplateLanguage = "tr-TR" QueryDefaultTemplateLanguageArEg QueryDefaultTemplateLanguage = "ar-EG" QueryDefaultTemplateLanguageRuRu QueryDefaultTemplateLanguage = "ru-RU" QueryDefaultTemplateLanguageFaIr QueryDefaultTemplateLanguage = "fa-IR" )
func (QueryDefaultTemplateLanguage) IsKnown ¶
func (r QueryDefaultTemplateLanguage) IsKnown() bool
type QueryEnabledOriginCommand ¶
type QueryEnabledOriginCommand string
const (
QueryEnabledOriginCommandRevoke QueryEnabledOriginCommand = "revoke"
)
func (QueryEnabledOriginCommand) IsKnown ¶
func (r QueryEnabledOriginCommand) IsKnown() bool
type QueryParam ¶
type QueryParam 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[[]AdditionalRoutesParam] `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[CookieAttributesParam] `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[QueryDefaultTemplateLanguage] `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"` // A list of enabled origin commands. EnabledOriginCommands param.Field[[]QueryEnabledOriginCommand] `json:"enabled_origin_commands"` // 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[QueryQueueingMethod] `json:"queueing_method"` // HTTP status code returned to a user while in the queue. QueueingStatusCode param.Field[QueryQueueingStatusCode] `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 (QueryParam) MarshalJSON ¶
func (r QueryParam) MarshalJSON() (data []byte, err error)
type QueryQueueingMethod ¶
type QueryQueueingMethod 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 ( QueryQueueingMethodFifo QueryQueueingMethod = "fifo" QueryQueueingMethodRandom QueryQueueingMethod = "random" QueryQueueingMethodPassthrough QueryQueueingMethod = "passthrough" QueryQueueingMethodReject QueryQueueingMethod = "reject" )
func (QueryQueueingMethod) IsKnown ¶
func (r QueryQueueingMethod) IsKnown() bool
type QueryQueueingStatusCode ¶
type QueryQueueingStatusCode int64
HTTP status code returned to a user while in the queue.
const ( QueryQueueingStatusCode200 QueryQueueingStatusCode = 200 QueryQueueingStatusCode202 QueryQueueingStatusCode = 202 QueryQueueingStatusCode429 QueryQueueingStatusCode = 429 )
func (QueryQueueingStatusCode) IsKnown ¶
func (r QueryQueueingStatusCode) IsKnown() bool
type RatePlanParam ¶
type RatePlanParam = shared.RatePlanParam
The rate plan applied to the subscription.
This is an alias to an internal type.
type RuleDeleteParams ¶
type RuleDeleteResponseEnvelope ¶
type RuleDeleteResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` // Whether the API call was successful Success RuleDeleteResponseEnvelopeSuccess `json:"success,required"` Result []WaitingRoomRule `json:"result"` ResultInfo RuleDeleteResponseEnvelopeResultInfo `json:"result_info"` JSON ruleDeleteResponseEnvelopeJSON `json:"-"` }
func (*RuleDeleteResponseEnvelope) UnmarshalJSON ¶
func (r *RuleDeleteResponseEnvelope) 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
)
func (RuleDeleteResponseEnvelopeSuccess) IsKnown ¶
func (r RuleDeleteResponseEnvelopeSuccess) IsKnown() bool
type RuleEditParams ¶
type RuleEditParams struct { // Identifier ZoneID param.Field[string] `path:"zone_id,required"` // 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[RuleEditParamsPositionUnion] `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"
)
func (RuleEditParamsAction) IsKnown ¶
func (r RuleEditParamsAction) IsKnown() bool
type RuleEditParamsPosition ¶
type RuleEditParamsPosition 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"` // Places the rule before rule <RULE_ID>. Use this argument with an empty rule ID // value ("") to set the rule as the first rule in the ruleset. Before param.Field[string] `json:"before"` // Places the rule after rule <RULE_ID>. Use this argument with an empty rule ID // value ("") to set the rule as the last rule in the ruleset. After param.Field[string] `json:"after"` }
Reorder the position of a rule
func (RuleEditParamsPosition) MarshalJSON ¶
func (r RuleEditParamsPosition) MarshalJSON() (data []byte, err error)
type RuleEditParamsPositionAfter ¶
type RuleEditParamsPositionAfter struct { // Places the rule after rule <RULE_ID>. Use this argument with an empty rule ID // value ("") to set the rule as the last rule in the ruleset. After param.Field[string] `json:"after"` }
func (RuleEditParamsPositionAfter) MarshalJSON ¶
func (r RuleEditParamsPositionAfter) MarshalJSON() (data []byte, err error)
type RuleEditParamsPositionBefore ¶
type RuleEditParamsPositionBefore struct { // Places the rule before rule <RULE_ID>. Use this argument with an empty rule ID // value ("") to set the rule as the first rule in the ruleset. Before param.Field[string] `json:"before"` }
func (RuleEditParamsPositionBefore) MarshalJSON ¶
func (r RuleEditParamsPositionBefore) MarshalJSON() (data []byte, err error)
type RuleEditParamsPositionIndex ¶
type RuleEditParamsPositionIndex 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 (RuleEditParamsPositionIndex) MarshalJSON ¶
func (r RuleEditParamsPositionIndex) MarshalJSON() (data []byte, err error)
type RuleEditParamsPositionUnion ¶
type RuleEditParamsPositionUnion interface {
// contains filtered or unexported methods
}
Reorder the position of a rule
Satisfied by waiting_rooms.RuleEditParamsPositionIndex, waiting_rooms.RuleEditParamsPositionBefore, waiting_rooms.RuleEditParamsPositionAfter, RuleEditParamsPosition.
type RuleEditResponseEnvelope ¶
type RuleEditResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` // Whether the API call was successful Success RuleEditResponseEnvelopeSuccess `json:"success,required"` Result []WaitingRoomRule `json:"result"` ResultInfo RuleEditResponseEnvelopeResultInfo `json:"result_info"` JSON ruleEditResponseEnvelopeJSON `json:"-"` }
func (*RuleEditResponseEnvelope) UnmarshalJSON ¶
func (r *RuleEditResponseEnvelope) 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
)
func (RuleEditResponseEnvelopeSuccess) IsKnown ¶
func (r RuleEditResponseEnvelopeSuccess) IsKnown() bool
type RuleGetParams ¶
type RuleGetResponseEnvelope ¶
type RuleGetResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` // Whether the API call was successful Success RuleGetResponseEnvelopeSuccess `json:"success,required"` Result []WaitingRoomRule `json:"result"` ResultInfo RuleGetResponseEnvelopeResultInfo `json:"result_info"` JSON ruleGetResponseEnvelopeJSON `json:"-"` }
func (*RuleGetResponseEnvelope) UnmarshalJSON ¶
func (r *RuleGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type RuleGetResponseEnvelopeResultInfo ¶
type RuleGetResponseEnvelopeResultInfo 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 ruleGetResponseEnvelopeResultInfoJSON `json:"-"` }
func (*RuleGetResponseEnvelopeResultInfo) UnmarshalJSON ¶
func (r *RuleGetResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error)
type RuleGetResponseEnvelopeSuccess ¶
type RuleGetResponseEnvelopeSuccess bool
Whether the API call was successful
const (
RuleGetResponseEnvelopeSuccessTrue RuleGetResponseEnvelopeSuccess = true
)
func (RuleGetResponseEnvelopeSuccess) IsKnown ¶
func (r RuleGetResponseEnvelopeSuccess) IsKnown() bool
type RuleNewParams ¶
type RuleNewParams struct { // Identifier ZoneID param.Field[string] `path:"zone_id,required"` // 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"
)
func (RuleNewParamsAction) IsKnown ¶
func (r RuleNewParamsAction) IsKnown() bool
type RuleNewResponseEnvelope ¶
type RuleNewResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` // Whether the API call was successful Success RuleNewResponseEnvelopeSuccess `json:"success,required"` Result []WaitingRoomRule `json:"result"` ResultInfo RuleNewResponseEnvelopeResultInfo `json:"result_info"` JSON ruleNewResponseEnvelopeJSON `json:"-"` }
func (*RuleNewResponseEnvelope) UnmarshalJSON ¶
func (r *RuleNewResponseEnvelope) 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
)
func (RuleNewResponseEnvelopeSuccess) IsKnown ¶
func (r RuleNewResponseEnvelopeSuccess) IsKnown() bool
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, waitingRoomID string, ruleID string, body RuleDeleteParams, opts ...option.RequestOption) (res *[]WaitingRoomRule, err error)
Deletes a rule for a waiting room.
func (*RuleService) Edit ¶
func (r *RuleService) Edit(ctx context.Context, waitingRoomID string, ruleID string, params RuleEditParams, opts ...option.RequestOption) (res *[]WaitingRoomRule, err error)
Patches a rule for a waiting room.
func (*RuleService) Get ¶
func (r *RuleService) Get(ctx context.Context, waitingRoomID string, query RuleGetParams, opts ...option.RequestOption) (res *[]WaitingRoomRule, err error)
Lists rules for a waiting room.
func (*RuleService) New ¶
func (r *RuleService) New(ctx context.Context, waitingRoomID string, params RuleNewParams, opts ...option.RequestOption) (res *[]WaitingRoomRule, 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, waitingRoomID string, params RuleUpdateParams, opts ...option.RequestOption) (res *[]WaitingRoomRule, err error)
Only available for the Waiting Room Advanced subscription. Replaces all rules for a waiting room.
type RuleUpdateParams ¶
type RuleUpdateParams struct { // Identifier ZoneID param.Field[string] `path:"zone_id,required"` Body []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"
)
func (RuleUpdateParamsBodyAction) IsKnown ¶
func (r RuleUpdateParamsBodyAction) IsKnown() bool
type RuleUpdateResponseEnvelope ¶
type RuleUpdateResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` // Whether the API call was successful Success RuleUpdateResponseEnvelopeSuccess `json:"success,required"` Result []WaitingRoomRule `json:"result"` ResultInfo RuleUpdateResponseEnvelopeResultInfo `json:"result_info"` JSON ruleUpdateResponseEnvelopeJSON `json:"-"` }
func (*RuleUpdateResponseEnvelope) UnmarshalJSON ¶
func (r *RuleUpdateResponseEnvelope) 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
)
func (RuleUpdateResponseEnvelopeSuccess) IsKnown ¶
func (r RuleUpdateResponseEnvelopeSuccess) IsKnown() bool
type SettingEditParams ¶
type SettingEditParams struct { // Identifier ZoneID param.Field[string] `path:"zone_id,required"` // 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 SettingGetParams ¶
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, params SettingEditParams, opts ...option.RequestOption) (res *SettingEditResponse, err error)
Patch zone-level Waiting Room settings
func (*SettingService) Get ¶
func (r *SettingService) Get(ctx context.Context, query SettingGetParams, opts ...option.RequestOption) (res *SettingGetResponse, err error)
Get zone-level Waiting Room settings
func (*SettingService) Update ¶
func (r *SettingService) Update(ctx context.Context, params SettingUpdateParams, opts ...option.RequestOption) (res *SettingUpdateResponse, err error)
Update zone-level Waiting Room settings
type SettingUpdateParams ¶
type SettingUpdateParams struct { // Identifier ZoneID param.Field[string] `path:"zone_id,required"` // 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 SortDirection ¶
type SortDirection = shared.SortDirection
Direction to order DNS records in.
This is an alias to an internal type.
type StatusGetParams ¶
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" )
func (StatusGetResponseStatus) IsKnown ¶
func (r StatusGetResponseStatus) IsKnown() bool
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, waitingRoomID string, query StatusGetParams, 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 SubscriptionFrequency ¶
type SubscriptionFrequency = shared.SubscriptionFrequency
How often the subscription is renewed automatically.
This is an alias to an internal type.
type SubscriptionParam ¶
type SubscriptionParam = shared.SubscriptionParam
This is an alias to an internal type.
type SubscriptionState ¶
type SubscriptionState = shared.SubscriptionState
The state that the subscription is in.
This is an alias to an internal type.
type WaitingRoom ¶
type WaitingRoom struct { ID string `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 []AdditionalRoutes `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 CookieAttributes `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 WaitingRoomDefaultTemplateLanguage `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"` // A list of enabled origin commands. EnabledOriginCommands []WaitingRoomEnabledOriginCommand `json:"enabled_origin_commands"` // 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 WaitingRoomQueueingMethod `json:"queueing_method"` // HTTP status code returned to a user while in the queue. QueueingStatusCode WaitingRoomQueueingStatusCode `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 waitingRoomJSON `json:"-"` }
func (*WaitingRoom) UnmarshalJSON ¶
func (r *WaitingRoom) UnmarshalJSON(data []byte) (err error)
type WaitingRoomDefaultTemplateLanguage ¶
type WaitingRoomDefaultTemplateLanguage string
The language of the default page template. If no default_template_language is provided, then `en-US` (English) will be used.
const ( WaitingRoomDefaultTemplateLanguageEnUs WaitingRoomDefaultTemplateLanguage = "en-US" WaitingRoomDefaultTemplateLanguageEsEs WaitingRoomDefaultTemplateLanguage = "es-ES" WaitingRoomDefaultTemplateLanguageDeDe WaitingRoomDefaultTemplateLanguage = "de-DE" WaitingRoomDefaultTemplateLanguageFrFr WaitingRoomDefaultTemplateLanguage = "fr-FR" WaitingRoomDefaultTemplateLanguageItIt WaitingRoomDefaultTemplateLanguage = "it-IT" WaitingRoomDefaultTemplateLanguageJaJp WaitingRoomDefaultTemplateLanguage = "ja-JP" WaitingRoomDefaultTemplateLanguageKoKr WaitingRoomDefaultTemplateLanguage = "ko-KR" WaitingRoomDefaultTemplateLanguagePtBr WaitingRoomDefaultTemplateLanguage = "pt-BR" WaitingRoomDefaultTemplateLanguageZhCn WaitingRoomDefaultTemplateLanguage = "zh-CN" WaitingRoomDefaultTemplateLanguageZhTw WaitingRoomDefaultTemplateLanguage = "zh-TW" WaitingRoomDefaultTemplateLanguageNlNl WaitingRoomDefaultTemplateLanguage = "nl-NL" WaitingRoomDefaultTemplateLanguagePlPl WaitingRoomDefaultTemplateLanguage = "pl-PL" WaitingRoomDefaultTemplateLanguageIDID WaitingRoomDefaultTemplateLanguage = "id-ID" WaitingRoomDefaultTemplateLanguageTrTr WaitingRoomDefaultTemplateLanguage = "tr-TR" WaitingRoomDefaultTemplateLanguageArEg WaitingRoomDefaultTemplateLanguage = "ar-EG" WaitingRoomDefaultTemplateLanguageRuRu WaitingRoomDefaultTemplateLanguage = "ru-RU" WaitingRoomDefaultTemplateLanguageFaIr WaitingRoomDefaultTemplateLanguage = "fa-IR" )
func (WaitingRoomDefaultTemplateLanguage) IsKnown ¶
func (r WaitingRoomDefaultTemplateLanguage) IsKnown() bool
type WaitingRoomDeleteParams ¶
type WaitingRoomDeleteResponse ¶
type WaitingRoomDeleteResponse struct { ID string `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 { // Identifier ZoneID param.Field[string] `path:"zone_id,required"` Query QueryParam `json:"query,required"` }
func (WaitingRoomEditParams) MarshalJSON ¶
func (r WaitingRoomEditParams) MarshalJSON() (data []byte, err error)
type WaitingRoomEditResponseEnvelope ¶
type WaitingRoomEditResponseEnvelope struct { Result WaitingRoom `json:"result,required"` JSON waitingRoomEditResponseEnvelopeJSON `json:"-"` }
func (*WaitingRoomEditResponseEnvelope) UnmarshalJSON ¶
func (r *WaitingRoomEditResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type WaitingRoomEnabledOriginCommand ¶
type WaitingRoomEnabledOriginCommand string
const (
WaitingRoomEnabledOriginCommandRevoke WaitingRoomEnabledOriginCommand = "revoke"
)
func (WaitingRoomEnabledOriginCommand) IsKnown ¶
func (r WaitingRoomEnabledOriginCommand) IsKnown() bool
type WaitingRoomGetParams ¶
type WaitingRoomGetResponseEnvelope ¶
type WaitingRoomGetResponseEnvelope struct { Result WaitingRoom `json:"result,required"` JSON waitingRoomGetResponseEnvelopeJSON `json:"-"` }
func (*WaitingRoomGetResponseEnvelope) UnmarshalJSON ¶
func (r *WaitingRoomGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type WaitingRoomListParams ¶
type WaitingRoomListParams struct { // Identifier ZoneID param.Field[string] `path:"zone_id,required"` // Page number of paginated results. Page param.Field[float64] `query:"page"` // Maximum number of results per page. Must be a multiple of 5. PerPage param.Field[float64] `query:"per_page"` }
func (WaitingRoomListParams) URLQuery ¶
func (r WaitingRoomListParams) URLQuery() (v url.Values)
URLQuery serializes WaitingRoomListParams's query parameters as `url.Values`.
type WaitingRoomNewParams ¶
type WaitingRoomNewParams struct { // Identifier ZoneID param.Field[string] `path:"zone_id,required"` Query QueryParam `json:"query,required"` }
func (WaitingRoomNewParams) MarshalJSON ¶
func (r WaitingRoomNewParams) MarshalJSON() (data []byte, err error)
type WaitingRoomNewResponseEnvelope ¶
type WaitingRoomNewResponseEnvelope struct { Result WaitingRoom `json:"result,required"` JSON waitingRoomNewResponseEnvelopeJSON `json:"-"` }
func (*WaitingRoomNewResponseEnvelope) UnmarshalJSON ¶
func (r *WaitingRoomNewResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type WaitingRoomQueueingMethod ¶
type WaitingRoomQueueingMethod 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 ( WaitingRoomQueueingMethodFifo WaitingRoomQueueingMethod = "fifo" WaitingRoomQueueingMethodRandom WaitingRoomQueueingMethod = "random" WaitingRoomQueueingMethodPassthrough WaitingRoomQueueingMethod = "passthrough" WaitingRoomQueueingMethodReject WaitingRoomQueueingMethod = "reject" )
func (WaitingRoomQueueingMethod) IsKnown ¶
func (r WaitingRoomQueueingMethod) IsKnown() bool
type WaitingRoomQueueingStatusCode ¶
type WaitingRoomQueueingStatusCode int64
HTTP status code returned to a user while in the queue.
const ( WaitingRoomQueueingStatusCode200 WaitingRoomQueueingStatusCode = 200 WaitingRoomQueueingStatusCode202 WaitingRoomQueueingStatusCode = 202 WaitingRoomQueueingStatusCode429 WaitingRoomQueueingStatusCode = 429 )
func (WaitingRoomQueueingStatusCode) IsKnown ¶
func (r WaitingRoomQueueingStatusCode) IsKnown() bool
type WaitingRoomRule ¶
type WaitingRoomRule struct { // The ID of the rule. ID string `json:"id"` // The action to take when the expression matches. Action WaitingRoomRuleAction `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 waitingRoomRuleJSON `json:"-"` }
func (*WaitingRoomRule) UnmarshalJSON ¶
func (r *WaitingRoomRule) UnmarshalJSON(data []byte) (err error)
type WaitingRoomRuleAction ¶
type WaitingRoomRuleAction string
The action to take when the expression matches.
const (
WaitingRoomRuleActionBypassWaitingRoom WaitingRoomRuleAction = "bypass_waiting_room"
)
func (WaitingRoomRuleAction) IsKnown ¶
func (r WaitingRoomRuleAction) IsKnown() bool
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, waitingRoomID string, body WaitingRoomDeleteParams, opts ...option.RequestOption) (res *WaitingRoomDeleteResponse, err error)
Deletes a waiting room.
func (*WaitingRoomService) Edit ¶
func (r *WaitingRoomService) Edit(ctx context.Context, waitingRoomID string, params WaitingRoomEditParams, opts ...option.RequestOption) (res *WaitingRoom, err error)
Patches a configured waiting room.
func (*WaitingRoomService) Get ¶
func (r *WaitingRoomService) Get(ctx context.Context, waitingRoomID string, query WaitingRoomGetParams, opts ...option.RequestOption) (res *WaitingRoom, err error)
Fetches a single configured waiting room.
func (*WaitingRoomService) List ¶
func (r *WaitingRoomService) List(ctx context.Context, params WaitingRoomListParams, opts ...option.RequestOption) (res *pagination.V4PagePaginationArray[WaitingRoom], err error)
Lists waiting rooms.
func (*WaitingRoomService) ListAutoPaging ¶
func (r *WaitingRoomService) ListAutoPaging(ctx context.Context, params WaitingRoomListParams, opts ...option.RequestOption) *pagination.V4PagePaginationArrayAutoPager[WaitingRoom]
Lists waiting rooms.
func (*WaitingRoomService) New ¶
func (r *WaitingRoomService) New(ctx context.Context, params WaitingRoomNewParams, opts ...option.RequestOption) (res *WaitingRoom, err error)
Creates a new waiting room.
func (*WaitingRoomService) Update ¶
func (r *WaitingRoomService) Update(ctx context.Context, waitingRoomID string, params WaitingRoomUpdateParams, opts ...option.RequestOption) (res *WaitingRoom, err error)
Updates a configured waiting room.
type WaitingRoomUpdateParams ¶
type WaitingRoomUpdateParams struct { // Identifier ZoneID param.Field[string] `path:"zone_id,required"` Query QueryParam `json:"query,required"` }
func (WaitingRoomUpdateParams) MarshalJSON ¶
func (r WaitingRoomUpdateParams) MarshalJSON() (data []byte, err error)
type WaitingRoomUpdateResponseEnvelope ¶
type WaitingRoomUpdateResponseEnvelope struct { Result WaitingRoom `json:"result,required"` JSON waitingRoomUpdateResponseEnvelopeJSON `json:"-"` }
func (*WaitingRoomUpdateResponseEnvelope) UnmarshalJSON ¶
func (r *WaitingRoomUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error)