@@ -41,15 +41,7 @@ public ChatroomV2Service(YunxinApiHttpClient httpClient) {
4141
4242 @ Override
4343 public Result <CreateChatroomResponseV2 > createChatroom (CreateChatroomRequestV2 request ) throws YunxinSdkException {
44- // Validate required parameters
45- if (request .getCreator () == null || request .getCreator ().isEmpty ()) {
46- throw new IllegalArgumentException ("Creator cannot be null or empty" );
47- }
48-
49- if (request .getRoomName () == null || request .getRoomName ().isEmpty ()) {
50- throw new IllegalArgumentException ("Room name cannot be null or empty" );
51- }
52-
44+
5345 // Convert the request to JSON string
5446 String requestBody = JSONObject .toJSONString (request );
5547
@@ -67,20 +59,7 @@ public Result<CreateChatroomResponseV2> createChatroom(CreateChatroomRequestV2 r
6759
6860 @ Override
6961 public Result <GetChatroomAddressResponseV2 > getChatroomAddress (GetChatroomAddressRequestV2 request ) throws YunxinSdkException {
70- // Validate required parameters
71- if (request .getRoomId () == null ) {
72- throw new IllegalArgumentException ("Chatroom ID cannot be null" );
73- }
74-
75- if (request .getAccountId () == null || request .getAccountId ().isEmpty ()) {
76- throw new IllegalArgumentException ("Account ID cannot be null or empty" );
77- }
78-
79- if (request .getClientIp () == null || request .getClientIp ().isEmpty ()) {
80- throw new IllegalArgumentException ("Client IP cannot be null or empty" );
81- }
8262
83-
8463 // Replace the path parameter in the URL
8564 String path = ChatroomV2UrlContext .GET_CHATROOM_ADDRESS .replace ("{room_id}" , request .getRoomId ().toString ());
8665
@@ -111,11 +90,7 @@ public Result<GetChatroomAddressResponseV2> getChatroomAddress(GetChatroomAddres
11190
11291 @ Override
11392 public Result <GetChatroomInfoResponseV2 > getChatroomInfo (GetChatroomInfoRequestV2 request ) throws YunxinSdkException {
114- // Validate required parameters
115- if (request .getRoomId () == null ) {
116- throw new IllegalArgumentException ("Chatroom ID cannot be null" );
117- }
118-
93+
11994 // Replace the path parameter in the URL
12095 String path = ChatroomV2UrlContext .GET_CHATROOM_INFO .replace ("{room_id}" , request .getRoomId ().toString ());
12196
@@ -144,10 +119,6 @@ public Result<GetChatroomInfoResponseV2> getChatroomInfo(GetChatroomInfoRequestV
144119
145120 @ Override
146121 public Result <UpdateChatroomInfoResponseV2 > updateChatroomInfo (UpdateChatroomInfoRequestV2 request ) throws YunxinSdkException {
147- // Validate required parameters
148- if (request .getRoomId () == null ) {
149- throw new IllegalArgumentException ("Chatroom ID cannot be null" );
150- }
151122 // Replace the path parameter in the URL
152123 String path = ChatroomV2UrlContext .UPDATE_CHATROOM_INFO .replace ("{room_id}" , request .getRoomId ().toString ());
153124
@@ -168,15 +139,6 @@ public Result<UpdateChatroomInfoResponseV2> updateChatroomInfo(UpdateChatroomInf
168139
169140 @ Override
170141 public Result <UpdateChatroomStatusResponseV2 > updateChatroomStatus (UpdateChatroomStatusRequestV2 request ) throws YunxinSdkException {
171-
172- if (request .getOperatorAccountId () == null || request .getOperatorAccountId ().isEmpty ()) {
173- throw new IllegalArgumentException ("Operator account ID cannot be null or empty" );
174- }
175-
176- if (request .getValid () == null ) {
177- throw new IllegalArgumentException ("Valid status cannot be null" );
178- }
179-
180142 // Replace the path parameter in the URL
181143 String path = ChatroomV2UrlContext .UPDATE_CHATROOM_STATUS .replace ("{room_id}" , String .valueOf (request .getRoomId ()));
182144
@@ -199,15 +161,6 @@ public Result<UpdateChatroomStatusResponseV2> updateChatroomStatus(UpdateChatroo
199161 @ Override
200162 public Result <ToggleChatroomMuteResponseV2 > toggleChatroomMute (ToggleChatroomMuteRequestV2 request ) throws YunxinSdkException {
201163
202- if (request .getOperatorAccountId () == null || request .getOperatorAccountId ().isEmpty ()) {
203- throw new IllegalArgumentException ("Operator account ID cannot be null or empty" );
204- }
205-
206- if (request .getChatBanned () == null ) {
207- throw new IllegalArgumentException ("Chat banned status cannot be null" );
208- }
209-
210-
211164 // Replace the path parameter in the URL
212165 String path = ChatroomV2UrlContext .TOGGLE_CHATROOM_MUTE .replace ("{room_id}" , String .valueOf (request .getRoomId ()));
213166
@@ -228,15 +181,7 @@ public Result<ToggleChatroomMuteResponseV2> toggleChatroomMute(ToggleChatroomMut
228181
229182 @ Override
230183 public Result <ToggleInOutNotificationResponseV2 > toggleInOutNotification (ToggleInOutNotificationRequestV2 request ) throws YunxinSdkException {
231- // Validate required parameters
232- if (request .getRoomId () == null ) {
233- throw new IllegalArgumentException ("Chatroom ID cannot be null" );
234- }
235-
236- if (request .getInOutNotification () == null ) {
237- throw new IllegalArgumentException ("In/out notification status cannot be null" );
238- }
239-
184+
240185 // Replace the path parameter in the URL
241186 String path = ChatroomV2UrlContext .TOGGLE_IN_OUT_NOTIFICATION .replace ("{room_id}" , request .getRoomId ().toString ());
242187
@@ -258,11 +203,7 @@ public Result<ToggleInOutNotificationResponseV2> toggleInOutNotification(ToggleI
258203
259204 @ Override
260205 public Result <QueryOpenChatroomsResponseV2 > queryOpenChatrooms (QueryOpenChatroomsRequestV2 request ) throws YunxinSdkException {
261- // Validate required parameters
262- if (request .getCreatorAccountId () == null || request .getCreatorAccountId ().isEmpty ()) {
263- throw new IllegalArgumentException ("Creator account ID cannot be null or empty" );
264- }
265-
206+
266207 // Set up query parameters
267208 Map <String , String > queryParams = new HashMap <>();
268209 queryParams .put ("creator_account_id" , request .getCreatorAccountId ());
@@ -281,18 +222,6 @@ public Result<QueryOpenChatroomsResponseV2> queryOpenChatrooms(QueryOpenChatroom
281222
282223 @ Override
283224 public Result <ListOnlineMembersResponseV2 > listOnlineMembers (ListOnlineMembersRequestV2 request ) throws YunxinSdkException {
284- // Validate required parameters
285- if (request .getRoomId () == null ) {
286- throw new IllegalArgumentException ("Chatroom ID cannot be null" );
287- }
288-
289- if (request .getOffset () == null ) {
290- throw new IllegalArgumentException ("Offset cannot be null" );
291- }
292-
293- if (request .getLimit () == null ) {
294- throw new IllegalArgumentException ("Limit cannot be null" );
295- }
296225 // Replace the path parameter in the URL
297226 String path = ChatroomV2UrlContext .LIST_ONLINE_MEMBERS .replace ("{room_id}" , request .getRoomId ().toString ());
298227
@@ -319,11 +248,7 @@ public Result<ListOnlineMembersResponseV2> listOnlineMembers(ListOnlineMembersRe
319248
320249 @ Override
321250 public Result <ListFixedMembersResponseV2 > listFixedMembers (ListFixedMembersRequestV2 request ) throws YunxinSdkException {
322- // Validate required parameters
323- if (request .getRoomId () == null ) {
324- throw new IllegalArgumentException ("Chatroom ID cannot be null" );
325- }
326-
251+
327252 // Replace the path parameter in the URL
328253 String path = ChatroomV2UrlContext .LIST_FIXED_MEMBERS .replace ("{room_id}" , request .getRoomId ().toString ());
329254
0 commit comments