|
| 1 | +package com.starkbank; |
| 2 | + |
| 3 | +import com.starkbank.utils.Generator; |
| 4 | +import com.starkbank.utils.Resource; |
| 5 | +import com.starkbank.utils.Rest; |
| 6 | + |
| 7 | +import java.util.ArrayList; |
| 8 | +import java.util.HashMap; |
| 9 | +import java.util.List; |
| 10 | +import java.util.Map; |
| 11 | + |
| 12 | + |
| 13 | +public class MerchantCard extends Resource { |
| 14 | + |
| 15 | + /** |
| 16 | + # MerchantCard object |
| 17 | + Check out our API Documentation at https://starkbank.com/docs/api#merchant-card |
| 18 | + **/ |
| 19 | + |
| 20 | + static ClassData data = new ClassData(MerchantCard.class, "MerchantCard"); |
| 21 | + |
| 22 | + public String ending; |
| 23 | + public String fundingType; |
| 24 | + public String holderName; |
| 25 | + public String network; |
| 26 | + public String status; |
| 27 | + public List<String> tags; |
| 28 | + public String expiration; |
| 29 | + public String created; |
| 30 | + public String updated; |
| 31 | + |
| 32 | + public MerchantCard(String id, String ending, String fundingType, String holderName, String network, String status, List<String> tags, String expiration, String created, String updated) { |
| 33 | + super(id); |
| 34 | + this.ending = ending; |
| 35 | + this.fundingType = fundingType; |
| 36 | + this.holderName = holderName; |
| 37 | + this.network = network; |
| 38 | + this.status = status; |
| 39 | + this.tags = tags; |
| 40 | + this.expiration = expiration; |
| 41 | + this.created = created; |
| 42 | + this.updated = updated; |
| 43 | + } |
| 44 | + |
| 45 | + public static Generator<MerchantCard> query(Map<String, Object> params, User user) throws Exception { |
| 46 | + return Rest.getStream(data, params, user); |
| 47 | + } |
| 48 | + |
| 49 | + public static Generator<MerchantCard> query(Map<String, Object> params) throws Exception { |
| 50 | + return MerchantCard.query(params, null); |
| 51 | + } |
| 52 | + |
| 53 | + public static Generator<MerchantCard> query() throws Exception { |
| 54 | + return Rest.getStream(data, new HashMap<>(), null); |
| 55 | + } |
| 56 | + |
| 57 | + public static MerchantCard get(String id, User user) throws Exception { |
| 58 | + return Rest.getId(data, id, user); |
| 59 | + } |
| 60 | + |
| 61 | + public static MerchantCard get(String id) throws Exception { |
| 62 | + return MerchantCard.get(id, null); |
| 63 | + } |
| 64 | + |
| 65 | + public static MerchantCard.Page page(Map<String, Object> params) throws Exception { |
| 66 | + return page(params, null); |
| 67 | + } |
| 68 | + |
| 69 | + public static MerchantCard.Page page(User user) throws Exception { |
| 70 | + return page(new HashMap<>(), user); |
| 71 | + } |
| 72 | + |
| 73 | + public static MerchantCard.Page page() throws Exception { |
| 74 | + return page(new HashMap<>(), null); |
| 75 | + } |
| 76 | + |
| 77 | + |
| 78 | + public static MerchantCard.Page page(Map<String, Object> params, User user) throws Exception { |
| 79 | + com.starkcore.utils.Page page = Rest.getPage(data, params, user); |
| 80 | + List<MerchantCard> MerchantCards = new ArrayList<>(); |
| 81 | + for (com.starkcore.utils.SubResource MerchantCard: page.entities) { |
| 82 | + MerchantCards.add((MerchantCard) MerchantCard); |
| 83 | + } |
| 84 | + return new MerchantCard.Page(MerchantCards, page.cursor); |
| 85 | + } |
| 86 | + |
| 87 | + public final static class Page { |
| 88 | + public List<MerchantCard> merchantCards; |
| 89 | + public String cursor; |
| 90 | + |
| 91 | + public Page(List<MerchantCard> merchantCards, String cursor) { |
| 92 | + this.merchantCards = merchantCards; |
| 93 | + this.cursor = cursor; |
| 94 | + } |
| 95 | + } |
| 96 | + |
| 97 | + public final static class Log extends Resource { |
| 98 | + static ClassData data = new ClassData(MerchantCard.Log.class, "MerchantCardLog"); |
| 99 | + |
| 100 | + public String created; |
| 101 | + public String type; |
| 102 | + public String[] errors; |
| 103 | + public MerchantCard card; |
| 104 | + |
| 105 | + public Log(String created, String type, String[] errors, MerchantCard card, String id) { |
| 106 | + super(id); |
| 107 | + this.created = created; |
| 108 | + this.type = type; |
| 109 | + this.errors = errors; |
| 110 | + this.card = card; |
| 111 | + } |
| 112 | + |
| 113 | + |
| 114 | + public static MerchantCard.Log get(String id) throws Exception { |
| 115 | + return MerchantCard.Log.get(id, null); |
| 116 | + } |
| 117 | + |
| 118 | + public static MerchantCard.Log get(String id, User user) throws Exception { |
| 119 | + return Rest.getId(data, id, user); |
| 120 | + } |
| 121 | + |
| 122 | + public static Generator<MerchantCard.Log> query(Map<String, Object> params) throws Exception { |
| 123 | + return MerchantCard.Log.query(params, null); |
| 124 | + } |
| 125 | + |
| 126 | + public static Generator<MerchantCard.Log> query(User user) throws Exception { |
| 127 | + return MerchantCard.Log.query(new HashMap<>(), user); |
| 128 | + } |
| 129 | + |
| 130 | + public static Generator<MerchantCard.Log> query() throws Exception { |
| 131 | + return MerchantCard.Log.query(new HashMap<>(), null); |
| 132 | + } |
| 133 | + |
| 134 | + public static Generator<MerchantCard.Log> query(Map<String, Object> params, User user) throws Exception { |
| 135 | + return Rest.getStream(data, params, user); |
| 136 | + } |
| 137 | + |
| 138 | + public final static class Page { |
| 139 | + public List<MerchantCard.Log> logs; |
| 140 | + public String cursor; |
| 141 | + |
| 142 | + public Page(List<MerchantCard.Log> logs, String cursor) { |
| 143 | + this.logs = logs; |
| 144 | + this.cursor = cursor; |
| 145 | + } |
| 146 | + } |
| 147 | + |
| 148 | + public static MerchantCard.Log.Page page(Map<String, Object> params) throws Exception { |
| 149 | + return MerchantCard.Log.page(params, null); |
| 150 | + } |
| 151 | + |
| 152 | + public static MerchantCard.Log.Page page(User user) throws Exception { |
| 153 | + return MerchantCard.Log.page(new HashMap<>(), user); |
| 154 | + } |
| 155 | + |
| 156 | + public static MerchantCard.Log.Page page() throws Exception { |
| 157 | + return MerchantCard.Log.page(new HashMap<>(), null); |
| 158 | + } |
| 159 | + |
| 160 | + public static MerchantCard.Log.Page page(Map<String, Object> params, User user) throws Exception { |
| 161 | + com.starkcore.utils.Page page = Rest.getPage(data, params, user); |
| 162 | + List<MerchantCard.Log> logs = new ArrayList<>(); |
| 163 | + for (com.starkcore.utils.SubResource log: page.entities) { |
| 164 | + logs.add((MerchantCard.Log) log); |
| 165 | + } |
| 166 | + return new MerchantCard.Log.Page(logs, page.cursor); |
| 167 | + } |
| 168 | + |
| 169 | + } |
| 170 | + |
| 171 | +} |
0 commit comments