|
9 | 9 | import io.getstream.chat.java.models.Channel.ChannelListRequestData.ChannelListRequest;
|
10 | 10 | import io.getstream.chat.java.models.Channel.ChannelMarkAllReadRequestData.ChannelMarkAllReadRequest;
|
11 | 11 | import io.getstream.chat.java.models.Channel.ChannelMarkReadRequestData.ChannelMarkReadRequest;
|
| 12 | +import io.getstream.chat.java.models.Channel.ChannelMemberPartialUpdateRequestData.ChannelMemberPartialUpdateRequest; |
12 | 13 | import io.getstream.chat.java.models.Channel.ChannelMuteRequestData.ChannelMuteRequest;
|
13 | 14 | import io.getstream.chat.java.models.Channel.ChannelPartialUpdateRequestData.ChannelPartialUpdateRequest;
|
14 | 15 | import io.getstream.chat.java.models.Channel.ChannelQueryMembersRequestData.ChannelQueryMembersRequest;
|
@@ -138,6 +139,17 @@ public static class ChannelRead {
|
138 | 139 | @Data
|
139 | 140 | @NoArgsConstructor
|
140 | 141 | public static class ChannelMember {
|
| 142 | + public enum InviteStatus { |
| 143 | + @JsonProperty("pending") |
| 144 | + PENDING, |
| 145 | + @JsonProperty("accepted") |
| 146 | + ACCEPTED, |
| 147 | + @JsonProperty("rejected") |
| 148 | + REJECTED, |
| 149 | + @JsonEnumDefaultValue |
| 150 | + UNKNOWN |
| 151 | + } |
| 152 | + |
141 | 153 | @Nullable
|
142 | 154 | @JsonProperty("user_id")
|
143 | 155 | private String userId;
|
@@ -193,6 +205,30 @@ public static class ChannelMember {
|
193 | 205 | @Nullable
|
194 | 206 | @JsonProperty("notifications_muted")
|
195 | 207 | private Boolean notificationsMuted;
|
| 208 | + |
| 209 | + @Nullable |
| 210 | + @JsonProperty("status") |
| 211 | + private InviteStatus status; |
| 212 | + |
| 213 | + @Nullable |
| 214 | + @JsonProperty("archived_at") |
| 215 | + private Date archivedAt; |
| 216 | + |
| 217 | + @Nullable |
| 218 | + @JsonProperty("pinned_at") |
| 219 | + private Date pinnedAt; |
| 220 | + |
| 221 | + @Singular @Nullable @JsonIgnore private Map<String, Object> additionalFields = new HashMap<>(); |
| 222 | + |
| 223 | + @JsonAnyGetter |
| 224 | + public Map<String, Object> getAdditionalFields() { |
| 225 | + return this.additionalFields; |
| 226 | + } |
| 227 | + |
| 228 | + @JsonAnySetter |
| 229 | + public void setAdditionalField(String name, Object value) { |
| 230 | + this.additionalFields.put(name, value); |
| 231 | + } |
196 | 232 | }
|
197 | 233 |
|
198 | 234 | @Data
|
@@ -1097,6 +1133,54 @@ protected Call<ChannelPartialUpdateResponse> generateCall(Client client) {
|
1097 | 1133 | }
|
1098 | 1134 | }
|
1099 | 1135 |
|
| 1136 | + @Builder( |
| 1137 | + builderClassName = "ChannelMemberPartialUpdateRequest", |
| 1138 | + builderMethodName = "", |
| 1139 | + buildMethodName = "internalBuild") |
| 1140 | + public static class ChannelMemberPartialUpdateRequestData { |
| 1141 | + @Singular |
| 1142 | + @Nullable |
| 1143 | + @JsonProperty("set") |
| 1144 | + private Map<String, Object> setValues; |
| 1145 | + |
| 1146 | + @Singular |
| 1147 | + @Nullable |
| 1148 | + @JsonProperty("unset") |
| 1149 | + private List<String> unsetValues; |
| 1150 | + |
| 1151 | + public static class ChannelMemberPartialUpdateRequest |
| 1152 | + extends StreamRequest<ChannelMemberResponse> { |
| 1153 | + @NotNull private String channelType; |
| 1154 | + |
| 1155 | + @NotNull private String channelId; |
| 1156 | + |
| 1157 | + @NotNull private String userId; |
| 1158 | + |
| 1159 | + private ChannelMemberPartialUpdateRequest( |
| 1160 | + @NotNull String channelType, @NotNull String channelId, @NotNull String userId) { |
| 1161 | + this.channelType = channelType; |
| 1162 | + this.channelId = channelId; |
| 1163 | + this.userId = userId; |
| 1164 | + } |
| 1165 | + |
| 1166 | + @Override |
| 1167 | + protected Call<ChannelMemberResponse> generateCall(Client client) { |
| 1168 | + return client |
| 1169 | + .create(ChannelService.class) |
| 1170 | + .updateMemberPartial(channelType, channelId, userId, this.internalBuild()); |
| 1171 | + } |
| 1172 | + } |
| 1173 | + } |
| 1174 | + |
| 1175 | + @Data |
| 1176 | + @NoArgsConstructor |
| 1177 | + @EqualsAndHashCode(callSuper = true) |
| 1178 | + public static class ChannelMemberResponse extends StreamResponseObject { |
| 1179 | + @Nullable |
| 1180 | + @JsonProperty("channel_member") |
| 1181 | + private ChannelMember member; |
| 1182 | + } |
| 1183 | + |
1100 | 1184 | @Data
|
1101 | 1185 | @NoArgsConstructor
|
1102 | 1186 | @EqualsAndHashCode(callSuper = true)
|
@@ -1344,6 +1428,23 @@ public static class ChannelUnMuteResponse extends StreamResponseObject {
|
1344 | 1428 | private OwnUser ownUser;
|
1345 | 1429 | }
|
1346 | 1430 |
|
| 1431 | + @Data |
| 1432 | + @NoArgsConstructor |
| 1433 | + @EqualsAndHashCode(callSuper = true) |
| 1434 | + public static class ChannelPinResponse extends StreamResponseObject { |
| 1435 | + @Nullable |
| 1436 | + @JsonProperty("channel_mute") |
| 1437 | + private ChannelMute channelMute; |
| 1438 | + |
| 1439 | + @Nullable |
| 1440 | + @JsonProperty("channel_mutes") |
| 1441 | + private List<ChannelMute> channelMutes; |
| 1442 | + |
| 1443 | + @Nullable |
| 1444 | + @JsonProperty("own_user") |
| 1445 | + private OwnUser ownUser; |
| 1446 | + } |
| 1447 | + |
1347 | 1448 | @Data
|
1348 | 1449 | @NoArgsConstructor
|
1349 | 1450 | @EqualsAndHashCode(callSuper = true)
|
@@ -1552,4 +1653,74 @@ public static ChannelPartialUpdateRequest partialUpdate(
|
1552 | 1653 | public static AssignRoleRequest assignRoles(@NotNull String type, @NotNull String id) {
|
1553 | 1654 | return new AssignRoleRequest(type, id);
|
1554 | 1655 | }
|
| 1656 | + |
| 1657 | + /** |
| 1658 | + * Creates a update member partial request |
| 1659 | + * |
| 1660 | + * @param type the channel type |
| 1661 | + * @param id the channel id |
| 1662 | + * @param userId the user id |
| 1663 | + * @return the created request |
| 1664 | + */ |
| 1665 | + @NotNull |
| 1666 | + public static ChannelMemberPartialUpdateRequest updateMemberPartial( |
| 1667 | + @NotNull String type, @NotNull String id, @NotNull String userId) { |
| 1668 | + return new ChannelMemberPartialUpdateRequest(type, id, userId); |
| 1669 | + } |
| 1670 | + |
| 1671 | + /** |
| 1672 | + * Creates a pin channel request |
| 1673 | + * |
| 1674 | + * @param type the channel type |
| 1675 | + * @param id the channel id |
| 1676 | + * @param userId the user id |
| 1677 | + * @return the created request |
| 1678 | + */ |
| 1679 | + @NotNull |
| 1680 | + public static ChannelMemberPartialUpdateRequest pin( |
| 1681 | + @NotNull String type, @NotNull String id, @NotNull String userId) { |
| 1682 | + return new ChannelMemberPartialUpdateRequest(type, id, userId).setValue("pinned", true); |
| 1683 | + } |
| 1684 | + |
| 1685 | + /** |
| 1686 | + * Creates a unpin channel request |
| 1687 | + * |
| 1688 | + * @param type the channel type |
| 1689 | + * @param id the channel id |
| 1690 | + * @param userId the user id |
| 1691 | + * @return the created request |
| 1692 | + */ |
| 1693 | + @NotNull |
| 1694 | + public static ChannelMemberPartialUpdateRequest unpin( |
| 1695 | + @NotNull String type, @NotNull String id, @NotNull String userId) { |
| 1696 | + return new ChannelMemberPartialUpdateRequest(type, id, userId).setValue("pinned", false); |
| 1697 | + } |
| 1698 | + |
| 1699 | + /** |
| 1700 | + * Creates a archive channel request |
| 1701 | + * |
| 1702 | + * @param type the channel type |
| 1703 | + * @param id the channel id |
| 1704 | + * @param userId the user id |
| 1705 | + * @return the created request |
| 1706 | + */ |
| 1707 | + @NotNull |
| 1708 | + public static ChannelMemberPartialUpdateRequest archive( |
| 1709 | + @NotNull String type, @NotNull String id, @NotNull String userId) { |
| 1710 | + return new ChannelMemberPartialUpdateRequest(type, id, userId).setValue("archived", true); |
| 1711 | + } |
| 1712 | + |
| 1713 | + /** |
| 1714 | + * Creates a unarchive channel request |
| 1715 | + * |
| 1716 | + * @param type the channel type |
| 1717 | + * @param id the channel id |
| 1718 | + * @param userId the user id |
| 1719 | + * @return the created request |
| 1720 | + */ |
| 1721 | + @NotNull |
| 1722 | + public static ChannelMemberPartialUpdateRequest unarchive( |
| 1723 | + @NotNull String type, @NotNull String id, @NotNull String userId) { |
| 1724 | + return new ChannelMemberPartialUpdateRequest(type, id, userId).setValue("archived", false); |
| 1725 | + } |
1555 | 1726 | }
|
0 commit comments