-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
this adds the remove user call from the accounts api, and a wrapper o… #65
Conversation
…bject to get the user
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few small things that should probably be tidied up.
@@ -99,4 +102,15 @@ public Boolean deleteAccount(String parentAccountId, String accountId) throws IO | |||
Optional<Delete> responseParsed = responseParser.parseToObject(Delete.class, response); | |||
return responseParsed.map(r -> r.getDelete()).orElse(false); | |||
} | |||
|
|||
public User deleteUser(Integer userId) throws IOException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than passing in a Integer
here, I'd pass in a String
as that way the same API can be used with both user ID numbers and prefixed identifiers (eg SIS IDs).
|
||
public User deleteUser(Integer userId) throws IOException { | ||
Map<String, List<String>> postParams = new HashMap<>(); | ||
String deleteUrl = buildCanvasUrl("accounts/" + CanvasConstants.ACCOUNT_ID + "/users/" + userId, Collections.emptyMap()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although i our instance our root account is 1 it's not always the case and passing in the account ID is the more portable solution. Again it should be a String
so we can use SIS IDs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
…bject to get the user