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