22
33import com .bunq .sdk .context .ApiEnvironmentType ;
44import com .bunq .sdk .model .generated .endpoint .Card ;
5+ import com .bunq .sdk .model .generated .object .CardPinAssignment ;
56import com .bunq .tinker .libs .BunqLib ;
67import com .bunq .tinker .libs .SharedLib ;
78import com .bunq .tinker .utils .ITinker ;
89import org .apache .commons .cli .CommandLine ;
910import org .apache .commons .cli .ParseException ;
11+ import java .util .ArrayList ;
1012
1113public class LinkCard implements ITinker {
1214
15+ /**
16+ * Input constants.
17+ */
18+ private static final String CARD_PIN_ASSIGNMENT_TYPE_PRIMARY = "PRIMARY" ;
19+
1320 /**
1421 * @param args
1522 *
@@ -18,6 +25,7 @@ public class LinkCard implements ITinker {
1825 public void run (String [] args ) throws ParseException {
1926 CommandLine allOption = SharedLib .parseAllOption (args );
2027 ApiEnvironmentType environmentType = SharedLib .determineEnvironmentType (allOption );
28+ ArrayList <CardPinAssignment > allCardPinAssignment = new ArrayList <>();
2129
2230 SharedLib .printHeader ();
2331
@@ -26,6 +34,12 @@ public void run(String[] args) throws ParseException {
2634 String cardId = SharedLib .determineCardIdFromAllOptionOrStdIn (allOption );
2735 String accountId = SharedLib .determineAccountIdFromAllOptionOrStdIn (allOption );
2836
37+ allCardPinAssignment .add (new CardPinAssignment (
38+ CARD_PIN_ASSIGNMENT_TYPE_PRIMARY ,
39+ null , /* pinCode */
40+ Integer .parseInt (accountId ))
41+ );
42+
2943 System .out .println ();
3044 System .out .println (" | Link Card: " + cardId );
3145 System .out .println (" | To Account: " + accountId );
@@ -38,10 +52,11 @@ public void run(String[] args) throws ParseException {
3852 null , /* pinCode */
3953 null , /* activationCode */
4054 null , /* status */
41- null , /* limit */
55+ null , /* cardLimit */
56+ null , /* cardLimitAtm */
4257 null , /* magStripePermissions */
4358 null , /* countryPermission */
44- Integer . parseInt ( accountId )
59+ allCardPinAssignment
4560 );
4661
4762 System .out .println ();
0 commit comments