Skip to content

Commit

Permalink
Merge pull request #878 from broswen/waitingroom-next-event
Browse files Browse the repository at this point in the history
add next_event_prequeue_start_time and next_event_start_time
  • Loading branch information
jacobbednarz committed May 11, 2022
2 parents 53bd41f + d436ff2 commit 1f43607
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 49 deletions.
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

0 comments on commit 1f43607

Please sign in to comment.