@@ -808,6 +808,18 @@ public Identity requestVerifyUserIdentity(long userId, long identityId) {
808
808
.set ("identityId" , identityId ), JSON , null ), handle (Identity .class , "identity" )));
809
809
}
810
810
811
+ public Identity updateUserIdentity (long userId , Identity identity ) {
812
+ checkHasId (identity );
813
+ return complete (submit (req ("PUT" , tmpl ("/users/{userId}/identities/{identityId}.json" )
814
+ .set ("userId" , userId )
815
+ .set ("identityId" , identity .getId ()), JSON , null ), handle (Identity .class , "identity" )));
816
+ }
817
+
818
+ public Identity updateUserIdentity (User user , Identity identity ) {
819
+ checkHasId (user );
820
+ return updateUserIdentity (user .getId (), identity );
821
+ }
822
+
811
823
public void deleteUserIdentity (User user , Identity identity ) {
812
824
checkHasId (identity );
813
825
deleteUserIdentity (user , identity .getId ());
@@ -825,14 +837,14 @@ public void deleteUserIdentity(long userId, long identityId) {
825
837
), handleStatus ()));
826
838
}
827
839
828
- public void createUserIdentity (long userId , Identity identity ) {
829
- complete (submit (req ("POST" , tmpl ("/users/{userId}/identities.json" ).set ("userId" , userId ), JSON , json (
830
- Collections .singletonMap ("identity" , identity ))), handle (Identity .class , "identity" )));
840
+ public Identity createUserIdentity (long userId , Identity identity ) {
841
+ return complete (submit (req ("POST" , tmpl ("/users/{userId}/identities.json" ).set ("userId" , userId ), JSON ,
842
+ json ( Collections .singletonMap ("identity" , identity ))), handle (Identity .class , "identity" )));
831
843
}
832
844
833
- public void createUserIdentity (User user , Identity identity ) {
834
- complete (submit (req ("POST" , tmpl ("/users/{userId}/identities.json" ).set ("userId" , user .getId ()), JSON , json (
835
- Collections .singletonMap ("identity" , identity ))), handle (Identity .class , "identity" )));
845
+ public Identity createUserIdentity (User user , Identity identity ) {
846
+ return complete (submit (req ("POST" , tmpl ("/users/{userId}/identities.json" ).set ("userId" , user .getId ()), JSON ,
847
+ json ( Collections .singletonMap ("identity" , identity ))), handle (Identity .class , "identity" )));
836
848
}
837
849
838
850
public Iterable <org .zendesk .client .v2 .model .Request > getRequests () {
0 commit comments