@@ -29,10 +29,10 @@ use phnxtypes::{
29
29
WelcomeInfoParams ,
30
30
} ,
31
31
client_ds_out:: {
32
- AddClientsParamsOut , AddUsersParamsOut , ClientToDsMessageOut , ClientToDsMessageTbsOut ,
32
+ AddClientsParamsOut , ClientToDsMessageOut , ClientToDsMessageTbsOut ,
33
33
CreateGroupParamsOut , DeleteGroupParamsOut , DsMessageTypeOut , DsProcessResponseIn ,
34
- DsRequestParamsOut , ExternalCommitInfoIn , JoinConnectionGroupParamsOut ,
35
- JoinGroupParamsOut , RemoveClientsParamsOut , RemoveUsersParamsOut ,
34
+ DsRequestParamsOut , ExternalCommitInfoIn , GroupOperationParamsOut ,
35
+ JoinConnectionGroupParamsOut , JoinGroupParamsOut , RemoveClientsParamsOut ,
36
36
ResyncClientParamsOut , SelfRemoveClientParamsOut , SendMessageParamsOut ,
37
37
UpdateClientParamsOut ,
38
38
} ,
@@ -167,38 +167,15 @@ impl ApiClient {
167
167
} )
168
168
}
169
169
170
- /// Add one or more users to a group.
171
- pub async fn ds_add_users (
170
+ /// Performs a group operation .
171
+ pub async fn ds_group_operation (
172
172
& self ,
173
- payload : AddUsersParamsOut ,
173
+ payload : GroupOperationParamsOut ,
174
174
group_state_ear_key : & GroupStateEarKey ,
175
175
signing_key : & UserAuthSigningKey ,
176
176
) -> Result < TimeStamp , DsRequestError > {
177
177
self . prepare_and_send_ds_group_message (
178
- DsRequestParamsOut :: AddUsers ( payload) ,
179
- signing_key,
180
- group_state_ear_key,
181
- )
182
- . await
183
- // Check if the response is what we expected it to be.
184
- . and_then ( |response| {
185
- if let DsProcessResponseIn :: FanoutTimestamp ( ts) = response {
186
- Ok ( ts)
187
- } else {
188
- Err ( DsRequestError :: UnexpectedResponse )
189
- }
190
- } )
191
- }
192
-
193
- /// Remove one or more users from a group.
194
- pub async fn ds_remove_users (
195
- & self ,
196
- params : RemoveUsersParamsOut ,
197
- group_state_ear_key : & GroupStateEarKey ,
198
- signing_key : & UserAuthSigningKey ,
199
- ) -> Result < TimeStamp , DsRequestError > {
200
- self . prepare_and_send_ds_group_message (
201
- DsRequestParamsOut :: RemoveUsers ( params) ,
178
+ DsRequestParamsOut :: GroupOperation ( payload) ,
202
179
signing_key,
203
180
group_state_ear_key,
204
181
)
0 commit comments