Skip to content

Commit 512fcd2

Browse files
Add missing setters in FreeBusy and fix typo in Event field (#140)
# Description This PR holds two minor fixes, one for adding missing setters in the `FreeBusy` class. The second is fixing a typo in `Event` where `hide_participant` was supposed to be `hide_participants`. # License <!-- Your PR comment must contain the following line for us to merge the PR. --> I confirm that this contribution is made under the terms of the MIT license and that I have the authority necessary to make this contribution on behalf of its copyright owner. Co-authored-by: Ricardo Enrique <RicardoGeek@users.noreply.github.com>
1 parent 2908287 commit 512fcd2

5 files changed

Lines changed: 27 additions & 7 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,14 @@ This section contains changes that have been committed but not yet released.
88

99
### Changed
1010

11+
* Added missing setters for `FreeBusy`
12+
1113
### Deprecated
1214

1315
### Fixed
1416

17+
* Fixed typo in `Event.hide_participants`
18+
1519
### Removed
1620

1721
### Security

src/main/java/com/nylas/Event.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public class Event extends AccountOwnedModel implements JsonObject {
3131
private Integer capacity;
3232
private Boolean read_only;
3333
private Boolean busy;
34-
private Boolean hide_participant;
34+
private Boolean hide_participants;
3535
private Long original_start_time;
3636
private When when;
3737
private Conferencing conferencing;
@@ -123,8 +123,8 @@ public Boolean getBusy() {
123123
return busy;
124124
}
125125

126-
public Boolean getHideParticipant() {
127-
return hide_participant;
126+
public Boolean getHideParticipants() {
127+
return hide_participants;
128128
}
129129

130130
public Map<String, String> getMetadata() {
@@ -179,7 +179,7 @@ public String toString() {
179179
", capacity=" + capacity +
180180
", read_only=" + read_only +
181181
", busy=" + busy +
182-
", hide_participant=" + hide_participant +
182+
", hide_participants=" + hide_participants +
183183
", original_start_time=" + getOriginalStartTime() +
184184
", when=" + when +
185185
", conferencing=" + conferencing +
@@ -236,8 +236,8 @@ public void setBusy(Boolean busy) {
236236
this.modifiedFields.put("busy", this.busy);
237237
}
238238

239-
public void setHideParticipant(Boolean hideParticipant) {
240-
this.hide_participant = hideParticipant;
239+
public void setHideParticipants(Boolean hideParticipants) {
240+
this.hide_participants = hideParticipants;
241241
}
242242

243243
public void setMetadata(Map<String, String> metadata) {

src/main/java/com/nylas/FreeBusy.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ public List<TimeSlot> getTimeSlots() {
1515
return time_slots;
1616
}
1717

18+
public void setEmail(String email) {
19+
this.email = email;
20+
}
21+
22+
public void setTimeSlots(List<TimeSlot> timeSlots) {
23+
this.time_slots = timeSlots;
24+
}
25+
1826
@Override
1927
public String toString() {
2028
return "FreeBusy [email=" + email + ", time_slots=" + time_slots + "]";

src/main/java/com/nylas/IntegrationHostedAuthentication.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ public static class RequestBuilder {
5353
private String grant_id;
5454
private String login_hint;
5555
private String state;
56+
private String account_id;
5657
private Long expires_in;
5758
private List<String> scope;
5859
private Map<String, String> settings;
@@ -112,6 +113,12 @@ public RequestBuilder metadata(Map<String, Object> metadata) {
112113
return this;
113114
}
114115

116+
/** Nylas Account ID */
117+
public RequestBuilder accountId(String accountId) {
118+
this.account_id = accountId;
119+
return this;
120+
}
121+
115122
private void validate() {
116123
assertState(!nullOrEmpty(this.provider), "Provider is required");
117124
assertState(!nullOrEmpty(this.redirect_uri), "Redirect URI is required");
@@ -130,6 +137,7 @@ private Map<String, Object> build() {
130137
Maps.putIfNotNull(request, "login_hint", login_hint);
131138
Maps.putIfNotNull(request, "state", state);
132139
Maps.putIfNotNull(request, "expires_in", expires_in);
140+
Maps.putIfNotNull(request, "account_id", account_id);
133141
return request;
134142
}
135143
}

src/test/java/com/nylas/MessageTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public void testGetters() {
7171
assertEquals(message.getLabels().size(), 1);
7272
assertEquals(message.getMetadata().size(), 1);
7373
assertEquals(message.getHeaders().size(), 1);
74-
assertEquals(message.toString(), "Message [id=null, account_id=null, thread_id=okdvc089, subject=That thing I sent you, from=[NameEmail [name=Peter Potamus, email=potamus.peter@sebbebandsebben.com]], to=[NameEmail [name=Blue Falcone, email=falcone.blue@sebbebandsebben.com]], cc=[NameEmail [name=Harvey Birdman, email=harvey.birdman@sebbebandsebben.com]], bcc=[NameEmail [name=Christie, email=christie@sebbebandsebben.com]], reply_to=[NameEmail [name=Peter Potamus, email=potamus.peter@sebbebandsebben.com]], date=2022-11-10T12:28:00Z, unread=true, starred=true, snippet=Did you get that thing..., body.length=46, files=[File [id=null, filename=logo.jpg, size=12334, content_type=image/jpeg, message_ids=[odjashjcv89], content_id=osdivcnm90834e]], events=[Event [id='null', calendar_id='null', ical_uid='null', master_event_id='null', event_collection_id='null', title='null', description='null', location='null', owner='null', status='null', capacity=null, read_only=null, busy=null, hide_participant=null, original_start_time=null, when=null, conferencing=null, recurrence=null, round_robin_order=[], notifications=[], participants=[], metadata={}]], folder=Folder [id=null, name=null, display_name=null], labels=[Label [id=null, name=null, display_name=null]], headers={header1=value}, metadata={key1=value}]");
74+
assertEquals(message.toString(), "Message [id=null, account_id=null, thread_id=okdvc089, subject=That thing I sent you, from=[NameEmail [name=Peter Potamus, email=potamus.peter@sebbebandsebben.com]], to=[NameEmail [name=Blue Falcone, email=falcone.blue@sebbebandsebben.com]], cc=[NameEmail [name=Harvey Birdman, email=harvey.birdman@sebbebandsebben.com]], bcc=[NameEmail [name=Christie, email=christie@sebbebandsebben.com]], reply_to=[NameEmail [name=Peter Potamus, email=potamus.peter@sebbebandsebben.com]], date=2022-11-10T12:28:00Z, unread=true, starred=true, snippet=Did you get that thing..., body.length=46, files=[File [id=null, filename=logo.jpg, size=12334, content_type=image/jpeg, message_ids=[odjashjcv89], content_id=osdivcnm90834e]], events=[Event [id='null', calendar_id='null', ical_uid='null', master_event_id='null', event_collection_id='null', title='null', description='null', location='null', owner='null', status='null', capacity=null, read_only=null, busy=null, hide_participants=null, original_start_time=null, when=null, conferencing=null, recurrence=null, round_robin_order=[], notifications=[], participants=[], metadata={}]], folder=Folder [id=null, name=null, display_name=null], labels=[Label [id=null, name=null, display_name=null]], headers={header1=value}, metadata={key1=value}]");
7575
}
7676

7777

0 commit comments

Comments
 (0)