updateUser method
DOCS: https://docs.github.com/en/rest/users/users?apiVersion=2022-11-28#update-the-authenticated-user
Implementation
Future<github_scheme_respond_scheme.User> updateUser({
String? newName,
String? newEmail,
String? newBlog,
String? newTwitterUsername,
String? newCompany,
String? newLocation,
bool? newHireable,
String? newBio,
GithubClientAuth? githubClientAuth,
}) async {
Map jsonData = {
"name": newName,
"email": newEmail,
"blog": newBlog,
"twitter_username": newTwitterUsername,
"company": newCompany,
"location": newLocation,
"hireable": newHireable,
"bio": newBio,
};
jsonData.removeWhere((key, value) => value == null);
Map result = await invoke(
uriPath: "user",
parameters: jsonData,
method_request: "patch",
statusCodes: [200, 304],
specialTypeName: "user",
githubClientAuth: githubClientAuth,
);
github_scheme_respond_scheme.User user =
github_scheme_respond_scheme.User(result);
return user;
}