@@ -55,13 +55,39 @@ public static User update(User user) throws InvalidException, AuthorizationExcep
5555 return DataResource .update (UserUpdate .buildFrom (user ), "users" , User .class );
5656 }
5757
58- public static User delete (String id )
58+ /**
59+ * @deprecated Replaced by {@link #archive(String)}. Renamed for consistency with API language
60+ */
61+ public static User delete (String id ) {
62+ return archive (id );
63+ }
64+
65+ public static User archive (String id )
5966 throws AuthorizationException , ClientException , ServerException , InvalidException , RateLimitException {
6067 return DataResource .delete (id , "users" , User .class );
6168 }
6269
63- public static User delete ( Map < String , String > params )
70+ public static UserPermanentDeleteResponse permanentDelete ( String id )
6471 throws AuthorizationException , ClientException , ServerException , InvalidException , RateLimitException {
72+
73+ final URI uri = UriBuilder .newBuilder ()
74+ .path ("user_delete_requests" )
75+ .build ();
76+ return new HttpClient (uri )
77+ .post (UserPermanentDeleteResponse .class , new UserPermanentDeleteRequest (id ));
78+ }
79+
80+ /**
81+ * @deprecated Replaced by {@link #archive(Map)}. Renamed for consistency with API language
82+ */
83+ @ Deprecated
84+ public static User delete (Map <String , String > params )
85+ throws AuthorizationException , ClientException , ServerException , InvalidException , RateLimitException {
86+ return archive (params );
87+ }
88+
89+ public static User archive (Map <String , String > params )
90+ throws AuthorizationException , ClientException , ServerException , InvalidException , RateLimitException {
6591 return DataResource .delete (params , "users" , User .class );
6692 }
6793
0 commit comments