Skip to content

Commit 44aa9b4

Browse files
committed
Add missing room on Session-DTO for /Sessions endpoint
1 parent db94801 commit 44aa9b4

File tree

2 files changed

+46
-1
lines changed

2 files changed

+46
-1
lines changed

openapi/openapi.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,8 @@ components:
313313
id:
314314
type: string
315315
format: integer # Sessions Endpoint contains only numeric IDs
316+
room:
317+
type: string # Sessions Endpoint
316318
speakers:
317319
type: array
318320
items:
@@ -323,6 +325,7 @@ components:
323325
$ref: '#/components/schemas/QuestionAnswerFull' # Sessions Endpoint
324326
required:
325327
- id
328+
- room
326329
- questionAnswers
327330
- speakers
328331
SessionAll:

sessionize-java-client/src/generated/java/software/xdev/sessionize/model/Session.java

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
Session.JSON_PROPERTY_RECORDING_URL,
5555
Session.JSON_PROPERTY_STATUS,
5656
Session.JSON_PROPERTY_ID,
57+
Session.JSON_PROPERTY_ROOM,
5758
Session.JSON_PROPERTY_SPEAKERS,
5859
Session.JSON_PROPERTY_QUESTION_ANSWERS
5960
})
@@ -95,6 +96,9 @@ public class Session {
9596
public static final String JSON_PROPERTY_ID = "id";
9697
private Integer id;
9798

99+
public static final String JSON_PROPERTY_ROOM = "room";
100+
private String room;
101+
98102
public static final String JSON_PROPERTY_SPEAKERS = "speakers";
99103
private List<SpeakerMinimal> speakers = new ArrayList<>();
100104

@@ -448,6 +452,32 @@ public void setId(Integer id) {
448452
}
449453

450454

455+
public Session room(String room) {
456+
457+
this.room = room;
458+
return this;
459+
}
460+
461+
/**
462+
* Get room
463+
* @return room
464+
**/
465+
@jakarta.annotation.Nonnull
466+
@JsonProperty(JSON_PROPERTY_ROOM)
467+
@JsonInclude(value = JsonInclude.Include.ALWAYS)
468+
469+
public String getRoom() {
470+
return room;
471+
}
472+
473+
474+
@JsonProperty(JSON_PROPERTY_ROOM)
475+
@JsonInclude(value = JsonInclude.Include.ALWAYS)
476+
public void setRoom(String room) {
477+
this.room = room;
478+
}
479+
480+
451481
public Session speakers(List<SpeakerMinimal> speakers) {
452482

453483
this.speakers = speakers;
@@ -536,6 +566,7 @@ public boolean equals(Object o) {
536566
equalsNullable(this.recordingUrl, session.recordingUrl) &&
537567
Objects.equals(this.status, session.status) &&
538568
Objects.equals(this.id, session.id) &&
569+
Objects.equals(this.room, session.room) &&
539570
Objects.equals(this.speakers, session.speakers) &&
540571
Objects.equals(this.questionAnswers, session.questionAnswers);
541572
}
@@ -546,7 +577,7 @@ private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b)
546577

547578
@Override
548579
public int hashCode() {
549-
return Objects.hash(title, hashCodeNullable(description), startsAt, endsAt, isServiceSession, isPlenumSession, categoryItems, roomId, hashCodeNullable(liveUrl), hashCodeNullable(recordingUrl), status, id, speakers, questionAnswers);
580+
return Objects.hash(title, hashCodeNullable(description), startsAt, endsAt, isServiceSession, isPlenumSession, categoryItems, roomId, hashCodeNullable(liveUrl), hashCodeNullable(recordingUrl), status, id, room, speakers, questionAnswers);
550581
}
551582

552583
private static <T> int hashCodeNullable(JsonNullable<T> a) {
@@ -572,6 +603,7 @@ public String toString() {
572603
sb.append(" recordingUrl: ").append(toIndentedString(recordingUrl)).append("\n");
573604
sb.append(" status: ").append(toIndentedString(status)).append("\n");
574605
sb.append(" id: ").append(toIndentedString(id)).append("\n");
606+
sb.append(" room: ").append(toIndentedString(room)).append("\n");
575607
sb.append(" speakers: ").append(toIndentedString(speakers)).append("\n");
576608
sb.append(" questionAnswers: ").append(toIndentedString(questionAnswers)).append("\n");
577609
sb.append("}");
@@ -745,6 +777,16 @@ public String toUrlQueryString(String prefix) {
745777
}
746778
}
747779

780+
// add `room` to the URL query string
781+
if (getRoom() != null) {
782+
try {
783+
joiner.add(String.format("%sroom%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getRoom()), "UTF-8").replaceAll("\\+", "%20")));
784+
} catch (UnsupportedEncodingException e) {
785+
// Should never happen, UTF-8 is always supported
786+
throw new RuntimeException(e);
787+
}
788+
}
789+
748790
// add `speakers` to the URL query string
749791
if (getSpeakers() != null) {
750792
for (int i = 0; i < getSpeakers().size(); i++) {

0 commit comments

Comments
 (0)