-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathUpdateAccount.java
More file actions
46 lines (37 loc) · 1.52 KB
/
Copy pathUpdateAccount.java
File metadata and controls
46 lines (37 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package com.bunq.tinker;
import com.bunq.sdk.context.ApiEnvironmentType;
import com.bunq.sdk.model.generated.endpoint.MonetaryAccountBank;
import com.bunq.tinker.libs.BunqLib;
import com.bunq.tinker.libs.SharedLib;
import com.bunq.tinker.utils.ITinker;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.ParseException;
public class UpdateAccount implements ITinker {
/**
* @param args
*
* @throws ParseException
*/
public void run(String[] args) throws ParseException {
CommandLine allOption = SharedLib.parseAllOption(args);
ApiEnvironmentType environmentType = SharedLib.determineEnvironmentType(allOption);
SharedLib.printHeader();
BunqLib bunq = new BunqLib(environmentType);
String name = SharedLib.determineNameFromAllOptionOrStdIn(allOption);
String accountId = SharedLib.determineAccountIdFromAllOptionOrStdIn(allOption);
System.out.println();
System.out.println(" | Updating Name: " + name);
System.out.println(" | of Account: " + accountId);
System.out.println();
System.out.println(" ...");
System.out.println();
MonetaryAccountBank.update(Integer.parseInt(accountId), name);
System.out.println();
System.out.println(" | ✅ Account updated");
System.out.println();
System.out.println(" | ▶️ Check your changed overview");
System.out.println();
System.out.println();
bunq.updateContext();
}
}