diff --git a/waiting_room.go b/waiting_room.go index f7da89c6a..9a7dddc32 100644 --- a/waiting_room.go +++ b/waiting_room.go @@ -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. @@ -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. diff --git a/waiting_room_test.go b/waiting_room_test.go index 24d65bf63..ef0202493 100644 --- a/waiting_room_test.go +++ b/waiting_room_test.go @@ -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(` { @@ -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{ @@ -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,