Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add next_event_prequeue_start_time and next_event_start_time #878

Merged
merged 1 commit into from May 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
64 changes: 33 additions & 31 deletions waiting_room.go
Expand Up @@ -12,21 +12,23 @@ import (

// WaitingRoom describes a WaitingRoom object.
type WaitingRoom struct {
CreatedOn time.Time `json:"created_on,omitempty"`
ModifiedOn time.Time `json:"modified_on,omitempty"`
Path string `json:"path"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
CustomPageHTML string `json:"custom_page_html,omitempty"`
Host string `json:"host"`
ID string `json:"id,omitempty"`
NewUsersPerMinute int `json:"new_users_per_minute"`
TotalActiveUsers int `json:"total_active_users"`
SessionDuration int `json:"session_duration"`
QueueAll bool `json:"queue_all"`
DisableSessionRenewal bool `json:"disable_session_renewal"`
Suspended bool `json:"suspended"`
JsonResponseEnabled bool `json:"json_response_enabled"`
CreatedOn time.Time `json:"created_on,omitempty"`
ModifiedOn time.Time `json:"modified_on,omitempty"`
Path string `json:"path"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
CustomPageHTML string `json:"custom_page_html,omitempty"`
Host string `json:"host"`
ID string `json:"id,omitempty"`
NewUsersPerMinute int `json:"new_users_per_minute"`
TotalActiveUsers int `json:"total_active_users"`
SessionDuration int `json:"session_duration"`
QueueAll bool `json:"queue_all"`
DisableSessionRenewal bool `json:"disable_session_renewal"`
Suspended bool `json:"suspended"`
JsonResponseEnabled bool `json:"json_response_enabled"`
NextEventPrequeueStartTime *time.Time `json:"next_event_prequeue_start_time,omitempty"`
NextEventStartTime *time.Time `json:"next_event_start_time,omitempty"`
}

// WaitingRoomStatus describes the status of a waiting room.
Expand All @@ -40,22 +42,22 @@ type WaitingRoomStatus struct {

// WaitingRoomEvent describes a WaitingRoomEvent object.
type WaitingRoomEvent struct {
EventEndTime time.Time `json:"event_end_time"`
CreatedOn time.Time `json:"created_on,omitempty"`
ModifiedOn time.Time `json:"modified_on,omitempty"`
PrequeueStartTime time.Time `json:"prequeue_start_time,omitempty"`
EventStartTime time.Time `json:"event_start_time"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
QueueingMethod string `json:"queueing_method,omitempty"`
ID string `json:"id,omitempty"`
CustomPageHTML string `json:"custom_page_html,omitempty"`
NewUsersPerMinute int `json:"new_users_per_minute,omitempty"`
TotalActiveUsers int `json:"total_active_users,omitempty"`
SessionDuration int `json:"session_duration,omitempty"`
DisableSessionRenewal *bool `json:"disable_session_renewal,omitempty"`
Suspended bool `json:"suspended"`
ShuffleAtEventStart bool `json:"shuffle_at_event_start"`
EventEndTime time.Time `json:"event_end_time"`
CreatedOn time.Time `json:"created_on,omitempty"`
ModifiedOn time.Time `json:"modified_on,omitempty"`
PrequeueStartTime *time.Time `json:"prequeue_start_time,omitempty"`
EventStartTime time.Time `json:"event_start_time"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
QueueingMethod string `json:"queueing_method,omitempty"`
ID string `json:"id,omitempty"`
CustomPageHTML string `json:"custom_page_html,omitempty"`
NewUsersPerMinute int `json:"new_users_per_minute,omitempty"`
TotalActiveUsers int `json:"total_active_users,omitempty"`
SessionDuration int `json:"session_duration,omitempty"`
DisableSessionRenewal *bool `json:"disable_session_renewal,omitempty"`
Suspended bool `json:"suspended"`
ShuffleAtEventStart bool `json:"shuffle_at_event_start"`
}

// WaitingRoomPagePreviewURL describes a WaitingRoomPagePreviewURL object.
Expand Down
41 changes: 23 additions & 18 deletions waiting_room_test.go
Expand Up @@ -34,9 +34,12 @@ var waitingRoomJSON = fmt.Sprintf(`
"session_duration": 10,
"disable_session_renewal": false,
"json_response_enabled": true,
"custom_page_html": "{{#waitTimeKnown}} {{waitTime}} mins {{/waitTimeKnown}} {{^waitTimeKnown}} Queue all enabled {{/waitTimeKnown}}"
"custom_page_html": "{{#waitTimeKnown}} {{waitTime}} mins {{/waitTimeKnown}} {{^waitTimeKnown}} Queue all enabled {{/waitTimeKnown}}",
"next_event_prequeue_start_time": null,
"next_event_start_time": "%s"
}
`, waitingRoomID, testTimestampWaitingRoom.Format(time.RFC3339Nano), testTimestampWaitingRoom.Format(time.RFC3339Nano))
`, waitingRoomID, testTimestampWaitingRoom.Format(time.RFC3339Nano), testTimestampWaitingRoom.Format(time.RFC3339Nano),
testTimestampWaitingRoomEventStart.Format(time.RFC3339Nano))

var waitingRoomEventJSON = fmt.Sprintf(`
{
Expand Down Expand Up @@ -80,21 +83,23 @@ var waitingRoomPagePreviewJSON = `
`

var waitingRoom = WaitingRoom{
ID: waitingRoomID,
CreatedOn: testTimestampWaitingRoom,
ModifiedOn: testTimestampWaitingRoom,
Name: "production_webinar",
Description: "Production - DO NOT MODIFY",
Suspended: false,
Host: "shop.example.com",
Path: "/shop/checkout",
QueueAll: true,
NewUsersPerMinute: 600,
TotalActiveUsers: 1000,
SessionDuration: 10,
DisableSessionRenewal: false,
JsonResponseEnabled: true,
CustomPageHTML: "{{#waitTimeKnown}} {{waitTime}} mins {{/waitTimeKnown}} {{^waitTimeKnown}} Queue all enabled {{/waitTimeKnown}}",
ID: waitingRoomID,
CreatedOn: testTimestampWaitingRoom,
ModifiedOn: testTimestampWaitingRoom,
Name: "production_webinar",
Description: "Production - DO NOT MODIFY",
Suspended: false,
Host: "shop.example.com",
Path: "/shop/checkout",
QueueAll: true,
NewUsersPerMinute: 600,
TotalActiveUsers: 1000,
SessionDuration: 10,
DisableSessionRenewal: false,
JsonResponseEnabled: true,
CustomPageHTML: "{{#waitTimeKnown}} {{waitTime}} mins {{/waitTimeKnown}} {{^waitTimeKnown}} Queue all enabled {{/waitTimeKnown}}",
NextEventStartTime: &testTimestampWaitingRoomEventStart,
NextEventPrequeueStartTime: nil,
}

var waitingRoomEvent = WaitingRoomEvent{
Expand All @@ -104,7 +109,7 @@ var waitingRoomEvent = WaitingRoomEvent{
Name: "production_webinar_event",
Description: "Production event - DO NOT MODIFY",
Suspended: false,
PrequeueStartTime: testTimestampWaitingRoomEventPrequeue,
PrequeueStartTime: &testTimestampWaitingRoomEventPrequeue,
EventStartTime: testTimestampWaitingRoomEventStart,
EventEndTime: testTimestampWaitingRoomEventEnd,
ShuffleAtEventStart: false,
Expand Down