Subversion Repositories SmartDukaan

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
123 ashish 1
/**
2
 * Autogenerated by Thrift
3
 *
4
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
 */
6
package in.shop2020.payments;
7
 
8
import java.util.List;
9
import java.util.ArrayList;
10
import java.util.Map;
11
import java.util.HashMap;
12
import java.util.EnumMap;
13
import java.util.Set;
14
import java.util.HashSet;
15
import java.util.EnumSet;
16
import java.util.Collections;
17
import java.util.BitSet;
18
import java.util.Arrays;
19
import org.slf4j.Logger;
20
import org.slf4j.LoggerFactory;
21
 
22
import org.apache.thrift.*;
23
import org.apache.thrift.meta_data.*;
24
import org.apache.thrift.protocol.*;
25
 
26
public class PaymentService {
27
 
28
  public interface Iface {
29
 
30
    public Payment createPayment(long user_id, long cart_id, double amount, PaymentGateway gateway) throws PaymentException, TException;
31
 
32
    public PaymentRequest createPaymentRequest(long cart_id, long application_id, long merchant_tx_id, List<Param> params) throws PaymentException, TException;
33
 
34
    public void addCallbackUrl(long application_id, String callback_url, boolean updateIfExisting) throws PaymentException, TException;
35
 
36
    public void getCallbackUrl(long application_id) throws PaymentException, TException;
37
 
38
    public List<Payment> getPaymentsForUser(long userId, long from_time, long to_time, PaymentStatus status, PaymentGateway gateway) throws PaymentException, TException;
39
 
40
    public List<Payment> getPaymentsForCart(long cartId, long from_time, long to_time, PaymentStatus status, PaymentGateway gateway) throws PaymentException, TException;
41
 
42
    public List<Payment> getPayments(long from_time, long to_time, PaymentStatus status, PaymentGateway gateway) throws PaymentException, TException;
43
 
44
    public Payment getPaymentForMerchantId(long merchant_tx_id) throws PaymentException, TException;
45
 
46
    public void changePaymentStatus(long merchant_tx_id, PaymentStatus newStatus) throws PaymentException, TException;
47
 
48
    public void changePaymentRequestStatus(long request_id, RequestStatus requestStatus) throws PaymentException, TException;
49
 
50
  }
51
 
52
  public static class Client implements Iface {
53
    public Client(TProtocol prot)
54
    {
55
      this(prot, prot);
56
    }
57
 
58
    public Client(TProtocol iprot, TProtocol oprot)
59
    {
60
      iprot_ = iprot;
61
      oprot_ = oprot;
62
    }
63
 
64
    protected TProtocol iprot_;
65
    protected TProtocol oprot_;
66
 
67
    protected int seqid_;
68
 
69
    public TProtocol getInputProtocol()
70
    {
71
      return this.iprot_;
72
    }
73
 
74
    public TProtocol getOutputProtocol()
75
    {
76
      return this.oprot_;
77
    }
78
 
79
    public Payment createPayment(long user_id, long cart_id, double amount, PaymentGateway gateway) throws PaymentException, TException
80
    {
81
      send_createPayment(user_id, cart_id, amount, gateway);
82
      return recv_createPayment();
83
    }
84
 
85
    public void send_createPayment(long user_id, long cart_id, double amount, PaymentGateway gateway) throws TException
86
    {
87
      oprot_.writeMessageBegin(new TMessage("createPayment", TMessageType.CALL, seqid_));
88
      createPayment_args args = new createPayment_args();
89
      args.user_id = user_id;
90
      args.cart_id = cart_id;
91
      args.amount = amount;
92
      args.gateway = gateway;
93
      args.write(oprot_);
94
      oprot_.writeMessageEnd();
95
      oprot_.getTransport().flush();
96
    }
97
 
98
    public Payment recv_createPayment() throws PaymentException, TException
99
    {
100
      TMessage msg = iprot_.readMessageBegin();
101
      if (msg.type == TMessageType.EXCEPTION) {
102
        TApplicationException x = TApplicationException.read(iprot_);
103
        iprot_.readMessageEnd();
104
        throw x;
105
      }
106
      createPayment_result result = new createPayment_result();
107
      result.read(iprot_);
108
      iprot_.readMessageEnd();
109
      if (result.isSetSuccess()) {
110
        return result.success;
111
      }
112
      if (result.pe != null) {
113
        throw result.pe;
114
      }
115
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "createPayment failed: unknown result");
116
    }
117
 
118
    public PaymentRequest createPaymentRequest(long cart_id, long application_id, long merchant_tx_id, List<Param> params) throws PaymentException, TException
119
    {
120
      send_createPaymentRequest(cart_id, application_id, merchant_tx_id, params);
121
      return recv_createPaymentRequest();
122
    }
123
 
124
    public void send_createPaymentRequest(long cart_id, long application_id, long merchant_tx_id, List<Param> params) throws TException
125
    {
126
      oprot_.writeMessageBegin(new TMessage("createPaymentRequest", TMessageType.CALL, seqid_));
127
      createPaymentRequest_args args = new createPaymentRequest_args();
128
      args.cart_id = cart_id;
129
      args.application_id = application_id;
130
      args.merchant_tx_id = merchant_tx_id;
131
      args.params = params;
132
      args.write(oprot_);
133
      oprot_.writeMessageEnd();
134
      oprot_.getTransport().flush();
135
    }
136
 
137
    public PaymentRequest recv_createPaymentRequest() throws PaymentException, TException
138
    {
139
      TMessage msg = iprot_.readMessageBegin();
140
      if (msg.type == TMessageType.EXCEPTION) {
141
        TApplicationException x = TApplicationException.read(iprot_);
142
        iprot_.readMessageEnd();
143
        throw x;
144
      }
145
      createPaymentRequest_result result = new createPaymentRequest_result();
146
      result.read(iprot_);
147
      iprot_.readMessageEnd();
148
      if (result.isSetSuccess()) {
149
        return result.success;
150
      }
151
      if (result.pe != null) {
152
        throw result.pe;
153
      }
154
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "createPaymentRequest failed: unknown result");
155
    }
156
 
157
    public void addCallbackUrl(long application_id, String callback_url, boolean updateIfExisting) throws PaymentException, TException
158
    {
159
      send_addCallbackUrl(application_id, callback_url, updateIfExisting);
160
      recv_addCallbackUrl();
161
    }
162
 
163
    public void send_addCallbackUrl(long application_id, String callback_url, boolean updateIfExisting) throws TException
164
    {
165
      oprot_.writeMessageBegin(new TMessage("addCallbackUrl", TMessageType.CALL, seqid_));
166
      addCallbackUrl_args args = new addCallbackUrl_args();
167
      args.application_id = application_id;
168
      args.callback_url = callback_url;
169
      args.updateIfExisting = updateIfExisting;
170
      args.write(oprot_);
171
      oprot_.writeMessageEnd();
172
      oprot_.getTransport().flush();
173
    }
174
 
175
    public void recv_addCallbackUrl() throws PaymentException, TException
176
    {
177
      TMessage msg = iprot_.readMessageBegin();
178
      if (msg.type == TMessageType.EXCEPTION) {
179
        TApplicationException x = TApplicationException.read(iprot_);
180
        iprot_.readMessageEnd();
181
        throw x;
182
      }
183
      addCallbackUrl_result result = new addCallbackUrl_result();
184
      result.read(iprot_);
185
      iprot_.readMessageEnd();
186
      if (result.pe != null) {
187
        throw result.pe;
188
      }
189
      return;
190
    }
191
 
192
    public void getCallbackUrl(long application_id) throws PaymentException, TException
193
    {
194
      send_getCallbackUrl(application_id);
195
      recv_getCallbackUrl();
196
    }
197
 
198
    public void send_getCallbackUrl(long application_id) throws TException
199
    {
200
      oprot_.writeMessageBegin(new TMessage("getCallbackUrl", TMessageType.CALL, seqid_));
201
      getCallbackUrl_args args = new getCallbackUrl_args();
202
      args.application_id = application_id;
203
      args.write(oprot_);
204
      oprot_.writeMessageEnd();
205
      oprot_.getTransport().flush();
206
    }
207
 
208
    public void recv_getCallbackUrl() throws PaymentException, TException
209
    {
210
      TMessage msg = iprot_.readMessageBegin();
211
      if (msg.type == TMessageType.EXCEPTION) {
212
        TApplicationException x = TApplicationException.read(iprot_);
213
        iprot_.readMessageEnd();
214
        throw x;
215
      }
216
      getCallbackUrl_result result = new getCallbackUrl_result();
217
      result.read(iprot_);
218
      iprot_.readMessageEnd();
219
      if (result.pe != null) {
220
        throw result.pe;
221
      }
222
      return;
223
    }
224
 
225
    public List<Payment> getPaymentsForUser(long userId, long from_time, long to_time, PaymentStatus status, PaymentGateway gateway) throws PaymentException, TException
226
    {
227
      send_getPaymentsForUser(userId, from_time, to_time, status, gateway);
228
      return recv_getPaymentsForUser();
229
    }
230
 
231
    public void send_getPaymentsForUser(long userId, long from_time, long to_time, PaymentStatus status, PaymentGateway gateway) throws TException
232
    {
233
      oprot_.writeMessageBegin(new TMessage("getPaymentsForUser", TMessageType.CALL, seqid_));
234
      getPaymentsForUser_args args = new getPaymentsForUser_args();
235
      args.userId = userId;
236
      args.from_time = from_time;
237
      args.to_time = to_time;
238
      args.status = status;
239
      args.gateway = gateway;
240
      args.write(oprot_);
241
      oprot_.writeMessageEnd();
242
      oprot_.getTransport().flush();
243
    }
244
 
245
    public List<Payment> recv_getPaymentsForUser() throws PaymentException, TException
246
    {
247
      TMessage msg = iprot_.readMessageBegin();
248
      if (msg.type == TMessageType.EXCEPTION) {
249
        TApplicationException x = TApplicationException.read(iprot_);
250
        iprot_.readMessageEnd();
251
        throw x;
252
      }
253
      getPaymentsForUser_result result = new getPaymentsForUser_result();
254
      result.read(iprot_);
255
      iprot_.readMessageEnd();
256
      if (result.isSetSuccess()) {
257
        return result.success;
258
      }
259
      if (result.pe != null) {
260
        throw result.pe;
261
      }
262
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getPaymentsForUser failed: unknown result");
263
    }
264
 
265
    public List<Payment> getPaymentsForCart(long cartId, long from_time, long to_time, PaymentStatus status, PaymentGateway gateway) throws PaymentException, TException
266
    {
267
      send_getPaymentsForCart(cartId, from_time, to_time, status, gateway);
268
      return recv_getPaymentsForCart();
269
    }
270
 
271
    public void send_getPaymentsForCart(long cartId, long from_time, long to_time, PaymentStatus status, PaymentGateway gateway) throws TException
272
    {
273
      oprot_.writeMessageBegin(new TMessage("getPaymentsForCart", TMessageType.CALL, seqid_));
274
      getPaymentsForCart_args args = new getPaymentsForCart_args();
275
      args.cartId = cartId;
276
      args.from_time = from_time;
277
      args.to_time = to_time;
278
      args.status = status;
279
      args.gateway = gateway;
280
      args.write(oprot_);
281
      oprot_.writeMessageEnd();
282
      oprot_.getTransport().flush();
283
    }
284
 
285
    public List<Payment> recv_getPaymentsForCart() throws PaymentException, TException
286
    {
287
      TMessage msg = iprot_.readMessageBegin();
288
      if (msg.type == TMessageType.EXCEPTION) {
289
        TApplicationException x = TApplicationException.read(iprot_);
290
        iprot_.readMessageEnd();
291
        throw x;
292
      }
293
      getPaymentsForCart_result result = new getPaymentsForCart_result();
294
      result.read(iprot_);
295
      iprot_.readMessageEnd();
296
      if (result.isSetSuccess()) {
297
        return result.success;
298
      }
299
      if (result.pe != null) {
300
        throw result.pe;
301
      }
302
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getPaymentsForCart failed: unknown result");
303
    }
304
 
305
    public List<Payment> getPayments(long from_time, long to_time, PaymentStatus status, PaymentGateway gateway) throws PaymentException, TException
306
    {
307
      send_getPayments(from_time, to_time, status, gateway);
308
      return recv_getPayments();
309
    }
310
 
311
    public void send_getPayments(long from_time, long to_time, PaymentStatus status, PaymentGateway gateway) throws TException
312
    {
313
      oprot_.writeMessageBegin(new TMessage("getPayments", TMessageType.CALL, seqid_));
314
      getPayments_args args = new getPayments_args();
315
      args.from_time = from_time;
316
      args.to_time = to_time;
317
      args.status = status;
318
      args.gateway = gateway;
319
      args.write(oprot_);
320
      oprot_.writeMessageEnd();
321
      oprot_.getTransport().flush();
322
    }
323
 
324
    public List<Payment> recv_getPayments() throws PaymentException, TException
325
    {
326
      TMessage msg = iprot_.readMessageBegin();
327
      if (msg.type == TMessageType.EXCEPTION) {
328
        TApplicationException x = TApplicationException.read(iprot_);
329
        iprot_.readMessageEnd();
330
        throw x;
331
      }
332
      getPayments_result result = new getPayments_result();
333
      result.read(iprot_);
334
      iprot_.readMessageEnd();
335
      if (result.isSetSuccess()) {
336
        return result.success;
337
      }
338
      if (result.pe != null) {
339
        throw result.pe;
340
      }
341
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getPayments failed: unknown result");
342
    }
343
 
344
    public Payment getPaymentForMerchantId(long merchant_tx_id) throws PaymentException, TException
345
    {
346
      send_getPaymentForMerchantId(merchant_tx_id);
347
      return recv_getPaymentForMerchantId();
348
    }
349
 
350
    public void send_getPaymentForMerchantId(long merchant_tx_id) throws TException
351
    {
352
      oprot_.writeMessageBegin(new TMessage("getPaymentForMerchantId", TMessageType.CALL, seqid_));
353
      getPaymentForMerchantId_args args = new getPaymentForMerchantId_args();
354
      args.merchant_tx_id = merchant_tx_id;
355
      args.write(oprot_);
356
      oprot_.writeMessageEnd();
357
      oprot_.getTransport().flush();
358
    }
359
 
360
    public Payment recv_getPaymentForMerchantId() throws PaymentException, TException
361
    {
362
      TMessage msg = iprot_.readMessageBegin();
363
      if (msg.type == TMessageType.EXCEPTION) {
364
        TApplicationException x = TApplicationException.read(iprot_);
365
        iprot_.readMessageEnd();
366
        throw x;
367
      }
368
      getPaymentForMerchantId_result result = new getPaymentForMerchantId_result();
369
      result.read(iprot_);
370
      iprot_.readMessageEnd();
371
      if (result.isSetSuccess()) {
372
        return result.success;
373
      }
374
      if (result.pe != null) {
375
        throw result.pe;
376
      }
377
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getPaymentForMerchantId failed: unknown result");
378
    }
379
 
380
    public void changePaymentStatus(long merchant_tx_id, PaymentStatus newStatus) throws PaymentException, TException
381
    {
382
      send_changePaymentStatus(merchant_tx_id, newStatus);
383
      recv_changePaymentStatus();
384
    }
385
 
386
    public void send_changePaymentStatus(long merchant_tx_id, PaymentStatus newStatus) throws TException
387
    {
388
      oprot_.writeMessageBegin(new TMessage("changePaymentStatus", TMessageType.CALL, seqid_));
389
      changePaymentStatus_args args = new changePaymentStatus_args();
390
      args.merchant_tx_id = merchant_tx_id;
391
      args.newStatus = newStatus;
392
      args.write(oprot_);
393
      oprot_.writeMessageEnd();
394
      oprot_.getTransport().flush();
395
    }
396
 
397
    public void recv_changePaymentStatus() throws PaymentException, TException
398
    {
399
      TMessage msg = iprot_.readMessageBegin();
400
      if (msg.type == TMessageType.EXCEPTION) {
401
        TApplicationException x = TApplicationException.read(iprot_);
402
        iprot_.readMessageEnd();
403
        throw x;
404
      }
405
      changePaymentStatus_result result = new changePaymentStatus_result();
406
      result.read(iprot_);
407
      iprot_.readMessageEnd();
408
      if (result.pe != null) {
409
        throw result.pe;
410
      }
411
      return;
412
    }
413
 
414
    public void changePaymentRequestStatus(long request_id, RequestStatus requestStatus) throws PaymentException, TException
415
    {
416
      send_changePaymentRequestStatus(request_id, requestStatus);
417
      recv_changePaymentRequestStatus();
418
    }
419
 
420
    public void send_changePaymentRequestStatus(long request_id, RequestStatus requestStatus) throws TException
421
    {
422
      oprot_.writeMessageBegin(new TMessage("changePaymentRequestStatus", TMessageType.CALL, seqid_));
423
      changePaymentRequestStatus_args args = new changePaymentRequestStatus_args();
424
      args.request_id = request_id;
425
      args.requestStatus = requestStatus;
426
      args.write(oprot_);
427
      oprot_.writeMessageEnd();
428
      oprot_.getTransport().flush();
429
    }
430
 
431
    public void recv_changePaymentRequestStatus() throws PaymentException, TException
432
    {
433
      TMessage msg = iprot_.readMessageBegin();
434
      if (msg.type == TMessageType.EXCEPTION) {
435
        TApplicationException x = TApplicationException.read(iprot_);
436
        iprot_.readMessageEnd();
437
        throw x;
438
      }
439
      changePaymentRequestStatus_result result = new changePaymentRequestStatus_result();
440
      result.read(iprot_);
441
      iprot_.readMessageEnd();
442
      if (result.pe != null) {
443
        throw result.pe;
444
      }
445
      return;
446
    }
447
 
448
  }
449
  public static class Processor implements TProcessor {
450
    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
451
    public Processor(Iface iface)
452
    {
453
      iface_ = iface;
454
      processMap_.put("createPayment", new createPayment());
455
      processMap_.put("createPaymentRequest", new createPaymentRequest());
456
      processMap_.put("addCallbackUrl", new addCallbackUrl());
457
      processMap_.put("getCallbackUrl", new getCallbackUrl());
458
      processMap_.put("getPaymentsForUser", new getPaymentsForUser());
459
      processMap_.put("getPaymentsForCart", new getPaymentsForCart());
460
      processMap_.put("getPayments", new getPayments());
461
      processMap_.put("getPaymentForMerchantId", new getPaymentForMerchantId());
462
      processMap_.put("changePaymentStatus", new changePaymentStatus());
463
      processMap_.put("changePaymentRequestStatus", new changePaymentRequestStatus());
464
    }
465
 
466
    protected static interface ProcessFunction {
467
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException;
468
    }
469
 
470
    private Iface iface_;
471
    protected final HashMap<String,ProcessFunction> processMap_ = new HashMap<String,ProcessFunction>();
472
 
473
    public boolean process(TProtocol iprot, TProtocol oprot) throws TException
474
    {
475
      TMessage msg = iprot.readMessageBegin();
476
      ProcessFunction fn = processMap_.get(msg.name);
477
      if (fn == null) {
478
        TProtocolUtil.skip(iprot, TType.STRUCT);
479
        iprot.readMessageEnd();
480
        TApplicationException x = new TApplicationException(TApplicationException.UNKNOWN_METHOD, "Invalid method name: '"+msg.name+"'");
481
        oprot.writeMessageBegin(new TMessage(msg.name, TMessageType.EXCEPTION, msg.seqid));
482
        x.write(oprot);
483
        oprot.writeMessageEnd();
484
        oprot.getTransport().flush();
485
        return true;
486
      }
487
      fn.process(msg.seqid, iprot, oprot);
488
      return true;
489
    }
490
 
491
    private class createPayment implements ProcessFunction {
492
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
493
      {
494
        createPayment_args args = new createPayment_args();
495
        args.read(iprot);
496
        iprot.readMessageEnd();
497
        createPayment_result result = new createPayment_result();
498
        try {
499
          result.success = iface_.createPayment(args.user_id, args.cart_id, args.amount, args.gateway);
500
        } catch (PaymentException pe) {
501
          result.pe = pe;
502
        } catch (Throwable th) {
503
          LOGGER.error("Internal error processing createPayment", th);
504
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing createPayment");
505
          oprot.writeMessageBegin(new TMessage("createPayment", TMessageType.EXCEPTION, seqid));
506
          x.write(oprot);
507
          oprot.writeMessageEnd();
508
          oprot.getTransport().flush();
509
          return;
510
        }
511
        oprot.writeMessageBegin(new TMessage("createPayment", TMessageType.REPLY, seqid));
512
        result.write(oprot);
513
        oprot.writeMessageEnd();
514
        oprot.getTransport().flush();
515
      }
516
 
517
    }
518
 
519
    private class createPaymentRequest implements ProcessFunction {
520
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
521
      {
522
        createPaymentRequest_args args = new createPaymentRequest_args();
523
        args.read(iprot);
524
        iprot.readMessageEnd();
525
        createPaymentRequest_result result = new createPaymentRequest_result();
526
        try {
527
          result.success = iface_.createPaymentRequest(args.cart_id, args.application_id, args.merchant_tx_id, args.params);
528
        } catch (PaymentException pe) {
529
          result.pe = pe;
530
        } catch (Throwable th) {
531
          LOGGER.error("Internal error processing createPaymentRequest", th);
532
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing createPaymentRequest");
533
          oprot.writeMessageBegin(new TMessage("createPaymentRequest", TMessageType.EXCEPTION, seqid));
534
          x.write(oprot);
535
          oprot.writeMessageEnd();
536
          oprot.getTransport().flush();
537
          return;
538
        }
539
        oprot.writeMessageBegin(new TMessage("createPaymentRequest", TMessageType.REPLY, seqid));
540
        result.write(oprot);
541
        oprot.writeMessageEnd();
542
        oprot.getTransport().flush();
543
      }
544
 
545
    }
546
 
547
    private class addCallbackUrl implements ProcessFunction {
548
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
549
      {
550
        addCallbackUrl_args args = new addCallbackUrl_args();
551
        args.read(iprot);
552
        iprot.readMessageEnd();
553
        addCallbackUrl_result result = new addCallbackUrl_result();
554
        try {
555
          iface_.addCallbackUrl(args.application_id, args.callback_url, args.updateIfExisting);
556
        } catch (PaymentException pe) {
557
          result.pe = pe;
558
        } catch (Throwable th) {
559
          LOGGER.error("Internal error processing addCallbackUrl", th);
560
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing addCallbackUrl");
561
          oprot.writeMessageBegin(new TMessage("addCallbackUrl", TMessageType.EXCEPTION, seqid));
562
          x.write(oprot);
563
          oprot.writeMessageEnd();
564
          oprot.getTransport().flush();
565
          return;
566
        }
567
        oprot.writeMessageBegin(new TMessage("addCallbackUrl", TMessageType.REPLY, seqid));
568
        result.write(oprot);
569
        oprot.writeMessageEnd();
570
        oprot.getTransport().flush();
571
      }
572
 
573
    }
574
 
575
    private class getCallbackUrl implements ProcessFunction {
576
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
577
      {
578
        getCallbackUrl_args args = new getCallbackUrl_args();
579
        args.read(iprot);
580
        iprot.readMessageEnd();
581
        getCallbackUrl_result result = new getCallbackUrl_result();
582
        try {
583
          iface_.getCallbackUrl(args.application_id);
584
        } catch (PaymentException pe) {
585
          result.pe = pe;
586
        } catch (Throwable th) {
587
          LOGGER.error("Internal error processing getCallbackUrl", th);
588
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getCallbackUrl");
589
          oprot.writeMessageBegin(new TMessage("getCallbackUrl", TMessageType.EXCEPTION, seqid));
590
          x.write(oprot);
591
          oprot.writeMessageEnd();
592
          oprot.getTransport().flush();
593
          return;
594
        }
595
        oprot.writeMessageBegin(new TMessage("getCallbackUrl", TMessageType.REPLY, seqid));
596
        result.write(oprot);
597
        oprot.writeMessageEnd();
598
        oprot.getTransport().flush();
599
      }
600
 
601
    }
602
 
603
    private class getPaymentsForUser implements ProcessFunction {
604
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
605
      {
606
        getPaymentsForUser_args args = new getPaymentsForUser_args();
607
        args.read(iprot);
608
        iprot.readMessageEnd();
609
        getPaymentsForUser_result result = new getPaymentsForUser_result();
610
        try {
611
          result.success = iface_.getPaymentsForUser(args.userId, args.from_time, args.to_time, args.status, args.gateway);
612
        } catch (PaymentException pe) {
613
          result.pe = pe;
614
        } catch (Throwable th) {
615
          LOGGER.error("Internal error processing getPaymentsForUser", th);
616
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getPaymentsForUser");
617
          oprot.writeMessageBegin(new TMessage("getPaymentsForUser", TMessageType.EXCEPTION, seqid));
618
          x.write(oprot);
619
          oprot.writeMessageEnd();
620
          oprot.getTransport().flush();
621
          return;
622
        }
623
        oprot.writeMessageBegin(new TMessage("getPaymentsForUser", TMessageType.REPLY, seqid));
624
        result.write(oprot);
625
        oprot.writeMessageEnd();
626
        oprot.getTransport().flush();
627
      }
628
 
629
    }
630
 
631
    private class getPaymentsForCart implements ProcessFunction {
632
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
633
      {
634
        getPaymentsForCart_args args = new getPaymentsForCart_args();
635
        args.read(iprot);
636
        iprot.readMessageEnd();
637
        getPaymentsForCart_result result = new getPaymentsForCart_result();
638
        try {
639
          result.success = iface_.getPaymentsForCart(args.cartId, args.from_time, args.to_time, args.status, args.gateway);
640
        } catch (PaymentException pe) {
641
          result.pe = pe;
642
        } catch (Throwable th) {
643
          LOGGER.error("Internal error processing getPaymentsForCart", th);
644
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getPaymentsForCart");
645
          oprot.writeMessageBegin(new TMessage("getPaymentsForCart", TMessageType.EXCEPTION, seqid));
646
          x.write(oprot);
647
          oprot.writeMessageEnd();
648
          oprot.getTransport().flush();
649
          return;
650
        }
651
        oprot.writeMessageBegin(new TMessage("getPaymentsForCart", TMessageType.REPLY, seqid));
652
        result.write(oprot);
653
        oprot.writeMessageEnd();
654
        oprot.getTransport().flush();
655
      }
656
 
657
    }
658
 
659
    private class getPayments implements ProcessFunction {
660
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
661
      {
662
        getPayments_args args = new getPayments_args();
663
        args.read(iprot);
664
        iprot.readMessageEnd();
665
        getPayments_result result = new getPayments_result();
666
        try {
667
          result.success = iface_.getPayments(args.from_time, args.to_time, args.status, args.gateway);
668
        } catch (PaymentException pe) {
669
          result.pe = pe;
670
        } catch (Throwable th) {
671
          LOGGER.error("Internal error processing getPayments", th);
672
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getPayments");
673
          oprot.writeMessageBegin(new TMessage("getPayments", TMessageType.EXCEPTION, seqid));
674
          x.write(oprot);
675
          oprot.writeMessageEnd();
676
          oprot.getTransport().flush();
677
          return;
678
        }
679
        oprot.writeMessageBegin(new TMessage("getPayments", TMessageType.REPLY, seqid));
680
        result.write(oprot);
681
        oprot.writeMessageEnd();
682
        oprot.getTransport().flush();
683
      }
684
 
685
    }
686
 
687
    private class getPaymentForMerchantId implements ProcessFunction {
688
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
689
      {
690
        getPaymentForMerchantId_args args = new getPaymentForMerchantId_args();
691
        args.read(iprot);
692
        iprot.readMessageEnd();
693
        getPaymentForMerchantId_result result = new getPaymentForMerchantId_result();
694
        try {
695
          result.success = iface_.getPaymentForMerchantId(args.merchant_tx_id);
696
        } catch (PaymentException pe) {
697
          result.pe = pe;
698
        } catch (Throwable th) {
699
          LOGGER.error("Internal error processing getPaymentForMerchantId", th);
700
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getPaymentForMerchantId");
701
          oprot.writeMessageBegin(new TMessage("getPaymentForMerchantId", TMessageType.EXCEPTION, seqid));
702
          x.write(oprot);
703
          oprot.writeMessageEnd();
704
          oprot.getTransport().flush();
705
          return;
706
        }
707
        oprot.writeMessageBegin(new TMessage("getPaymentForMerchantId", TMessageType.REPLY, seqid));
708
        result.write(oprot);
709
        oprot.writeMessageEnd();
710
        oprot.getTransport().flush();
711
      }
712
 
713
    }
714
 
715
    private class changePaymentStatus implements ProcessFunction {
716
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
717
      {
718
        changePaymentStatus_args args = new changePaymentStatus_args();
719
        args.read(iprot);
720
        iprot.readMessageEnd();
721
        changePaymentStatus_result result = new changePaymentStatus_result();
722
        try {
723
          iface_.changePaymentStatus(args.merchant_tx_id, args.newStatus);
724
        } catch (PaymentException pe) {
725
          result.pe = pe;
726
        } catch (Throwable th) {
727
          LOGGER.error("Internal error processing changePaymentStatus", th);
728
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing changePaymentStatus");
729
          oprot.writeMessageBegin(new TMessage("changePaymentStatus", TMessageType.EXCEPTION, seqid));
730
          x.write(oprot);
731
          oprot.writeMessageEnd();
732
          oprot.getTransport().flush();
733
          return;
734
        }
735
        oprot.writeMessageBegin(new TMessage("changePaymentStatus", TMessageType.REPLY, seqid));
736
        result.write(oprot);
737
        oprot.writeMessageEnd();
738
        oprot.getTransport().flush();
739
      }
740
 
741
    }
742
 
743
    private class changePaymentRequestStatus implements ProcessFunction {
744
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
745
      {
746
        changePaymentRequestStatus_args args = new changePaymentRequestStatus_args();
747
        args.read(iprot);
748
        iprot.readMessageEnd();
749
        changePaymentRequestStatus_result result = new changePaymentRequestStatus_result();
750
        try {
751
          iface_.changePaymentRequestStatus(args.request_id, args.requestStatus);
752
        } catch (PaymentException pe) {
753
          result.pe = pe;
754
        } catch (Throwable th) {
755
          LOGGER.error("Internal error processing changePaymentRequestStatus", th);
756
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing changePaymentRequestStatus");
757
          oprot.writeMessageBegin(new TMessage("changePaymentRequestStatus", TMessageType.EXCEPTION, seqid));
758
          x.write(oprot);
759
          oprot.writeMessageEnd();
760
          oprot.getTransport().flush();
761
          return;
762
        }
763
        oprot.writeMessageBegin(new TMessage("changePaymentRequestStatus", TMessageType.REPLY, seqid));
764
        result.write(oprot);
765
        oprot.writeMessageEnd();
766
        oprot.getTransport().flush();
767
      }
768
 
769
    }
770
 
771
  }
772
 
773
  public static class createPayment_args implements TBase<createPayment_args._Fields>, java.io.Serializable, Cloneable, Comparable<createPayment_args>   {
774
    private static final TStruct STRUCT_DESC = new TStruct("createPayment_args");
775
 
776
    private static final TField USER_ID_FIELD_DESC = new TField("user_id", TType.I64, (short)1);
777
    private static final TField CART_ID_FIELD_DESC = new TField("cart_id", TType.I64, (short)2);
778
    private static final TField AMOUNT_FIELD_DESC = new TField("amount", TType.DOUBLE, (short)3);
779
    private static final TField GATEWAY_FIELD_DESC = new TField("gateway", TType.I32, (short)4);
780
 
781
    private long user_id;
782
    private long cart_id;
783
    private double amount;
784
    private PaymentGateway gateway;
785
 
786
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
787
    public enum _Fields implements TFieldIdEnum {
788
      USER_ID((short)1, "user_id"),
789
      CART_ID((short)2, "cart_id"),
790
      AMOUNT((short)3, "amount"),
791
      /**
792
       * 
793
       * @see PaymentGateway
794
       */
795
      GATEWAY((short)4, "gateway");
796
 
797
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
798
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
799
 
800
      static {
801
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
802
          byId.put((int)field._thriftId, field);
803
          byName.put(field.getFieldName(), field);
804
        }
805
      }
806
 
807
      /**
808
       * Find the _Fields constant that matches fieldId, or null if its not found.
809
       */
810
      public static _Fields findByThriftId(int fieldId) {
811
        return byId.get(fieldId);
812
      }
813
 
814
      /**
815
       * Find the _Fields constant that matches fieldId, throwing an exception
816
       * if it is not found.
817
       */
818
      public static _Fields findByThriftIdOrThrow(int fieldId) {
819
        _Fields fields = findByThriftId(fieldId);
820
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
821
        return fields;
822
      }
823
 
824
      /**
825
       * Find the _Fields constant that matches name, or null if its not found.
826
       */
827
      public static _Fields findByName(String name) {
828
        return byName.get(name);
829
      }
830
 
831
      private final short _thriftId;
832
      private final String _fieldName;
833
 
834
      _Fields(short thriftId, String fieldName) {
835
        _thriftId = thriftId;
836
        _fieldName = fieldName;
837
      }
838
 
839
      public short getThriftFieldId() {
840
        return _thriftId;
841
      }
842
 
843
      public String getFieldName() {
844
        return _fieldName;
845
      }
846
    }
847
 
848
    // isset id assignments
849
    private static final int __USER_ID_ISSET_ID = 0;
850
    private static final int __CART_ID_ISSET_ID = 1;
851
    private static final int __AMOUNT_ISSET_ID = 2;
852
    private BitSet __isset_bit_vector = new BitSet(3);
853
 
854
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
855
      put(_Fields.USER_ID, new FieldMetaData("user_id", TFieldRequirementType.DEFAULT, 
856
          new FieldValueMetaData(TType.I64)));
857
      put(_Fields.CART_ID, new FieldMetaData("cart_id", TFieldRequirementType.DEFAULT, 
858
          new FieldValueMetaData(TType.I64)));
859
      put(_Fields.AMOUNT, new FieldMetaData("amount", TFieldRequirementType.DEFAULT, 
860
          new FieldValueMetaData(TType.DOUBLE)));
861
      put(_Fields.GATEWAY, new FieldMetaData("gateway", TFieldRequirementType.DEFAULT, 
862
          new EnumMetaData(TType.ENUM, PaymentGateway.class)));
863
    }});
864
 
865
    static {
866
      FieldMetaData.addStructMetaDataMap(createPayment_args.class, metaDataMap);
867
    }
868
 
869
    public createPayment_args() {
870
    }
871
 
872
    public createPayment_args(
873
      long user_id,
874
      long cart_id,
875
      double amount,
876
      PaymentGateway gateway)
877
    {
878
      this();
879
      this.user_id = user_id;
880
      setUser_idIsSet(true);
881
      this.cart_id = cart_id;
882
      setCart_idIsSet(true);
883
      this.amount = amount;
884
      setAmountIsSet(true);
885
      this.gateway = gateway;
886
    }
887
 
888
    /**
889
     * Performs a deep copy on <i>other</i>.
890
     */
891
    public createPayment_args(createPayment_args other) {
892
      __isset_bit_vector.clear();
893
      __isset_bit_vector.or(other.__isset_bit_vector);
894
      this.user_id = other.user_id;
895
      this.cart_id = other.cart_id;
896
      this.amount = other.amount;
897
      if (other.isSetGateway()) {
898
        this.gateway = other.gateway;
899
      }
900
    }
901
 
902
    public createPayment_args deepCopy() {
903
      return new createPayment_args(this);
904
    }
905
 
906
    @Deprecated
907
    public createPayment_args clone() {
908
      return new createPayment_args(this);
909
    }
910
 
911
    public long getUser_id() {
912
      return this.user_id;
913
    }
914
 
915
    public createPayment_args setUser_id(long user_id) {
916
      this.user_id = user_id;
917
      setUser_idIsSet(true);
918
      return this;
919
    }
920
 
921
    public void unsetUser_id() {
922
      __isset_bit_vector.clear(__USER_ID_ISSET_ID);
923
    }
924
 
925
    /** Returns true if field user_id is set (has been asigned a value) and false otherwise */
926
    public boolean isSetUser_id() {
927
      return __isset_bit_vector.get(__USER_ID_ISSET_ID);
928
    }
929
 
930
    public void setUser_idIsSet(boolean value) {
931
      __isset_bit_vector.set(__USER_ID_ISSET_ID, value);
932
    }
933
 
934
    public long getCart_id() {
935
      return this.cart_id;
936
    }
937
 
938
    public createPayment_args setCart_id(long cart_id) {
939
      this.cart_id = cart_id;
940
      setCart_idIsSet(true);
941
      return this;
942
    }
943
 
944
    public void unsetCart_id() {
945
      __isset_bit_vector.clear(__CART_ID_ISSET_ID);
946
    }
947
 
948
    /** Returns true if field cart_id is set (has been asigned a value) and false otherwise */
949
    public boolean isSetCart_id() {
950
      return __isset_bit_vector.get(__CART_ID_ISSET_ID);
951
    }
952
 
953
    public void setCart_idIsSet(boolean value) {
954
      __isset_bit_vector.set(__CART_ID_ISSET_ID, value);
955
    }
956
 
957
    public double getAmount() {
958
      return this.amount;
959
    }
960
 
961
    public createPayment_args setAmount(double amount) {
962
      this.amount = amount;
963
      setAmountIsSet(true);
964
      return this;
965
    }
966
 
967
    public void unsetAmount() {
968
      __isset_bit_vector.clear(__AMOUNT_ISSET_ID);
969
    }
970
 
971
    /** Returns true if field amount is set (has been asigned a value) and false otherwise */
972
    public boolean isSetAmount() {
973
      return __isset_bit_vector.get(__AMOUNT_ISSET_ID);
974
    }
975
 
976
    public void setAmountIsSet(boolean value) {
977
      __isset_bit_vector.set(__AMOUNT_ISSET_ID, value);
978
    }
979
 
980
    /**
981
     * 
982
     * @see PaymentGateway
983
     */
984
    public PaymentGateway getGateway() {
985
      return this.gateway;
986
    }
987
 
988
    /**
989
     * 
990
     * @see PaymentGateway
991
     */
992
    public createPayment_args setGateway(PaymentGateway gateway) {
993
      this.gateway = gateway;
994
      return this;
995
    }
996
 
997
    public void unsetGateway() {
998
      this.gateway = null;
999
    }
1000
 
1001
    /** Returns true if field gateway is set (has been asigned a value) and false otherwise */
1002
    public boolean isSetGateway() {
1003
      return this.gateway != null;
1004
    }
1005
 
1006
    public void setGatewayIsSet(boolean value) {
1007
      if (!value) {
1008
        this.gateway = null;
1009
      }
1010
    }
1011
 
1012
    public void setFieldValue(_Fields field, Object value) {
1013
      switch (field) {
1014
      case USER_ID:
1015
        if (value == null) {
1016
          unsetUser_id();
1017
        } else {
1018
          setUser_id((Long)value);
1019
        }
1020
        break;
1021
 
1022
      case CART_ID:
1023
        if (value == null) {
1024
          unsetCart_id();
1025
        } else {
1026
          setCart_id((Long)value);
1027
        }
1028
        break;
1029
 
1030
      case AMOUNT:
1031
        if (value == null) {
1032
          unsetAmount();
1033
        } else {
1034
          setAmount((Double)value);
1035
        }
1036
        break;
1037
 
1038
      case GATEWAY:
1039
        if (value == null) {
1040
          unsetGateway();
1041
        } else {
1042
          setGateway((PaymentGateway)value);
1043
        }
1044
        break;
1045
 
1046
      }
1047
    }
1048
 
1049
    public void setFieldValue(int fieldID, Object value) {
1050
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
1051
    }
1052
 
1053
    public Object getFieldValue(_Fields field) {
1054
      switch (field) {
1055
      case USER_ID:
1056
        return new Long(getUser_id());
1057
 
1058
      case CART_ID:
1059
        return new Long(getCart_id());
1060
 
1061
      case AMOUNT:
1062
        return new Double(getAmount());
1063
 
1064
      case GATEWAY:
1065
        return getGateway();
1066
 
1067
      }
1068
      throw new IllegalStateException();
1069
    }
1070
 
1071
    public Object getFieldValue(int fieldId) {
1072
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
1073
    }
1074
 
1075
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
1076
    public boolean isSet(_Fields field) {
1077
      switch (field) {
1078
      case USER_ID:
1079
        return isSetUser_id();
1080
      case CART_ID:
1081
        return isSetCart_id();
1082
      case AMOUNT:
1083
        return isSetAmount();
1084
      case GATEWAY:
1085
        return isSetGateway();
1086
      }
1087
      throw new IllegalStateException();
1088
    }
1089
 
1090
    public boolean isSet(int fieldID) {
1091
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
1092
    }
1093
 
1094
    @Override
1095
    public boolean equals(Object that) {
1096
      if (that == null)
1097
        return false;
1098
      if (that instanceof createPayment_args)
1099
        return this.equals((createPayment_args)that);
1100
      return false;
1101
    }
1102
 
1103
    public boolean equals(createPayment_args that) {
1104
      if (that == null)
1105
        return false;
1106
 
1107
      boolean this_present_user_id = true;
1108
      boolean that_present_user_id = true;
1109
      if (this_present_user_id || that_present_user_id) {
1110
        if (!(this_present_user_id && that_present_user_id))
1111
          return false;
1112
        if (this.user_id != that.user_id)
1113
          return false;
1114
      }
1115
 
1116
      boolean this_present_cart_id = true;
1117
      boolean that_present_cart_id = true;
1118
      if (this_present_cart_id || that_present_cart_id) {
1119
        if (!(this_present_cart_id && that_present_cart_id))
1120
          return false;
1121
        if (this.cart_id != that.cart_id)
1122
          return false;
1123
      }
1124
 
1125
      boolean this_present_amount = true;
1126
      boolean that_present_amount = true;
1127
      if (this_present_amount || that_present_amount) {
1128
        if (!(this_present_amount && that_present_amount))
1129
          return false;
1130
        if (this.amount != that.amount)
1131
          return false;
1132
      }
1133
 
1134
      boolean this_present_gateway = true && this.isSetGateway();
1135
      boolean that_present_gateway = true && that.isSetGateway();
1136
      if (this_present_gateway || that_present_gateway) {
1137
        if (!(this_present_gateway && that_present_gateway))
1138
          return false;
1139
        if (!this.gateway.equals(that.gateway))
1140
          return false;
1141
      }
1142
 
1143
      return true;
1144
    }
1145
 
1146
    @Override
1147
    public int hashCode() {
1148
      return 0;
1149
    }
1150
 
1151
    public int compareTo(createPayment_args other) {
1152
      if (!getClass().equals(other.getClass())) {
1153
        return getClass().getName().compareTo(other.getClass().getName());
1154
      }
1155
 
1156
      int lastComparison = 0;
1157
      createPayment_args typedOther = (createPayment_args)other;
1158
 
1159
      lastComparison = Boolean.valueOf(isSetUser_id()).compareTo(isSetUser_id());
1160
      if (lastComparison != 0) {
1161
        return lastComparison;
1162
      }
1163
      lastComparison = TBaseHelper.compareTo(user_id, typedOther.user_id);
1164
      if (lastComparison != 0) {
1165
        return lastComparison;
1166
      }
1167
      lastComparison = Boolean.valueOf(isSetCart_id()).compareTo(isSetCart_id());
1168
      if (lastComparison != 0) {
1169
        return lastComparison;
1170
      }
1171
      lastComparison = TBaseHelper.compareTo(cart_id, typedOther.cart_id);
1172
      if (lastComparison != 0) {
1173
        return lastComparison;
1174
      }
1175
      lastComparison = Boolean.valueOf(isSetAmount()).compareTo(isSetAmount());
1176
      if (lastComparison != 0) {
1177
        return lastComparison;
1178
      }
1179
      lastComparison = TBaseHelper.compareTo(amount, typedOther.amount);
1180
      if (lastComparison != 0) {
1181
        return lastComparison;
1182
      }
1183
      lastComparison = Boolean.valueOf(isSetGateway()).compareTo(isSetGateway());
1184
      if (lastComparison != 0) {
1185
        return lastComparison;
1186
      }
1187
      lastComparison = TBaseHelper.compareTo(gateway, typedOther.gateway);
1188
      if (lastComparison != 0) {
1189
        return lastComparison;
1190
      }
1191
      return 0;
1192
    }
1193
 
1194
    public void read(TProtocol iprot) throws TException {
1195
      TField field;
1196
      iprot.readStructBegin();
1197
      while (true)
1198
      {
1199
        field = iprot.readFieldBegin();
1200
        if (field.type == TType.STOP) { 
1201
          break;
1202
        }
1203
        _Fields fieldId = _Fields.findByThriftId(field.id);
1204
        if (fieldId == null) {
1205
          TProtocolUtil.skip(iprot, field.type);
1206
        } else {
1207
          switch (fieldId) {
1208
            case USER_ID:
1209
              if (field.type == TType.I64) {
1210
                this.user_id = iprot.readI64();
1211
                setUser_idIsSet(true);
1212
              } else { 
1213
                TProtocolUtil.skip(iprot, field.type);
1214
              }
1215
              break;
1216
            case CART_ID:
1217
              if (field.type == TType.I64) {
1218
                this.cart_id = iprot.readI64();
1219
                setCart_idIsSet(true);
1220
              } else { 
1221
                TProtocolUtil.skip(iprot, field.type);
1222
              }
1223
              break;
1224
            case AMOUNT:
1225
              if (field.type == TType.DOUBLE) {
1226
                this.amount = iprot.readDouble();
1227
                setAmountIsSet(true);
1228
              } else { 
1229
                TProtocolUtil.skip(iprot, field.type);
1230
              }
1231
              break;
1232
            case GATEWAY:
1233
              if (field.type == TType.I32) {
1234
                this.gateway = PaymentGateway.findByValue(iprot.readI32());
1235
              } else { 
1236
                TProtocolUtil.skip(iprot, field.type);
1237
              }
1238
              break;
1239
          }
1240
          iprot.readFieldEnd();
1241
        }
1242
      }
1243
      iprot.readStructEnd();
1244
      validate();
1245
    }
1246
 
1247
    public void write(TProtocol oprot) throws TException {
1248
      validate();
1249
 
1250
      oprot.writeStructBegin(STRUCT_DESC);
1251
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
1252
      oprot.writeI64(this.user_id);
1253
      oprot.writeFieldEnd();
1254
      oprot.writeFieldBegin(CART_ID_FIELD_DESC);
1255
      oprot.writeI64(this.cart_id);
1256
      oprot.writeFieldEnd();
1257
      oprot.writeFieldBegin(AMOUNT_FIELD_DESC);
1258
      oprot.writeDouble(this.amount);
1259
      oprot.writeFieldEnd();
1260
      if (this.gateway != null) {
1261
        oprot.writeFieldBegin(GATEWAY_FIELD_DESC);
1262
        oprot.writeI32(this.gateway.getValue());
1263
        oprot.writeFieldEnd();
1264
      }
1265
      oprot.writeFieldStop();
1266
      oprot.writeStructEnd();
1267
    }
1268
 
1269
    @Override
1270
    public String toString() {
1271
      StringBuilder sb = new StringBuilder("createPayment_args(");
1272
      boolean first = true;
1273
 
1274
      sb.append("user_id:");
1275
      sb.append(this.user_id);
1276
      first = false;
1277
      if (!first) sb.append(", ");
1278
      sb.append("cart_id:");
1279
      sb.append(this.cart_id);
1280
      first = false;
1281
      if (!first) sb.append(", ");
1282
      sb.append("amount:");
1283
      sb.append(this.amount);
1284
      first = false;
1285
      if (!first) sb.append(", ");
1286
      sb.append("gateway:");
1287
      if (this.gateway == null) {
1288
        sb.append("null");
1289
      } else {
1290
        String gateway_name = gateway.name();
1291
        if (gateway_name != null) {
1292
          sb.append(gateway_name);
1293
          sb.append(" (");
1294
        }
1295
        sb.append(this.gateway);
1296
        if (gateway_name != null) {
1297
          sb.append(")");
1298
        }
1299
      }
1300
      first = false;
1301
      sb.append(")");
1302
      return sb.toString();
1303
    }
1304
 
1305
    public void validate() throws TException {
1306
      // check for required fields
1307
    }
1308
 
1309
  }
1310
 
1311
  public static class createPayment_result implements TBase<createPayment_result._Fields>, java.io.Serializable, Cloneable   {
1312
    private static final TStruct STRUCT_DESC = new TStruct("createPayment_result");
1313
 
1314
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0);
1315
    private static final TField PE_FIELD_DESC = new TField("pe", TType.STRUCT, (short)1);
1316
 
1317
    private Payment success;
1318
    private PaymentException pe;
1319
 
1320
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
1321
    public enum _Fields implements TFieldIdEnum {
1322
      SUCCESS((short)0, "success"),
1323
      PE((short)1, "pe");
1324
 
1325
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
1326
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
1327
 
1328
      static {
1329
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
1330
          byId.put((int)field._thriftId, field);
1331
          byName.put(field.getFieldName(), field);
1332
        }
1333
      }
1334
 
1335
      /**
1336
       * Find the _Fields constant that matches fieldId, or null if its not found.
1337
       */
1338
      public static _Fields findByThriftId(int fieldId) {
1339
        return byId.get(fieldId);
1340
      }
1341
 
1342
      /**
1343
       * Find the _Fields constant that matches fieldId, throwing an exception
1344
       * if it is not found.
1345
       */
1346
      public static _Fields findByThriftIdOrThrow(int fieldId) {
1347
        _Fields fields = findByThriftId(fieldId);
1348
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
1349
        return fields;
1350
      }
1351
 
1352
      /**
1353
       * Find the _Fields constant that matches name, or null if its not found.
1354
       */
1355
      public static _Fields findByName(String name) {
1356
        return byName.get(name);
1357
      }
1358
 
1359
      private final short _thriftId;
1360
      private final String _fieldName;
1361
 
1362
      _Fields(short thriftId, String fieldName) {
1363
        _thriftId = thriftId;
1364
        _fieldName = fieldName;
1365
      }
1366
 
1367
      public short getThriftFieldId() {
1368
        return _thriftId;
1369
      }
1370
 
1371
      public String getFieldName() {
1372
        return _fieldName;
1373
      }
1374
    }
1375
 
1376
    // isset id assignments
1377
 
1378
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
1379
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
1380
          new StructMetaData(TType.STRUCT, Payment.class)));
1381
      put(_Fields.PE, new FieldMetaData("pe", TFieldRequirementType.DEFAULT, 
1382
          new FieldValueMetaData(TType.STRUCT)));
1383
    }});
1384
 
1385
    static {
1386
      FieldMetaData.addStructMetaDataMap(createPayment_result.class, metaDataMap);
1387
    }
1388
 
1389
    public createPayment_result() {
1390
    }
1391
 
1392
    public createPayment_result(
1393
      Payment success,
1394
      PaymentException pe)
1395
    {
1396
      this();
1397
      this.success = success;
1398
      this.pe = pe;
1399
    }
1400
 
1401
    /**
1402
     * Performs a deep copy on <i>other</i>.
1403
     */
1404
    public createPayment_result(createPayment_result other) {
1405
      if (other.isSetSuccess()) {
1406
        this.success = new Payment(other.success);
1407
      }
1408
      if (other.isSetPe()) {
1409
        this.pe = new PaymentException(other.pe);
1410
      }
1411
    }
1412
 
1413
    public createPayment_result deepCopy() {
1414
      return new createPayment_result(this);
1415
    }
1416
 
1417
    @Deprecated
1418
    public createPayment_result clone() {
1419
      return new createPayment_result(this);
1420
    }
1421
 
1422
    public Payment getSuccess() {
1423
      return this.success;
1424
    }
1425
 
1426
    public createPayment_result setSuccess(Payment success) {
1427
      this.success = success;
1428
      return this;
1429
    }
1430
 
1431
    public void unsetSuccess() {
1432
      this.success = null;
1433
    }
1434
 
1435
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
1436
    public boolean isSetSuccess() {
1437
      return this.success != null;
1438
    }
1439
 
1440
    public void setSuccessIsSet(boolean value) {
1441
      if (!value) {
1442
        this.success = null;
1443
      }
1444
    }
1445
 
1446
    public PaymentException getPe() {
1447
      return this.pe;
1448
    }
1449
 
1450
    public createPayment_result setPe(PaymentException pe) {
1451
      this.pe = pe;
1452
      return this;
1453
    }
1454
 
1455
    public void unsetPe() {
1456
      this.pe = null;
1457
    }
1458
 
1459
    /** Returns true if field pe is set (has been asigned a value) and false otherwise */
1460
    public boolean isSetPe() {
1461
      return this.pe != null;
1462
    }
1463
 
1464
    public void setPeIsSet(boolean value) {
1465
      if (!value) {
1466
        this.pe = null;
1467
      }
1468
    }
1469
 
1470
    public void setFieldValue(_Fields field, Object value) {
1471
      switch (field) {
1472
      case SUCCESS:
1473
        if (value == null) {
1474
          unsetSuccess();
1475
        } else {
1476
          setSuccess((Payment)value);
1477
        }
1478
        break;
1479
 
1480
      case PE:
1481
        if (value == null) {
1482
          unsetPe();
1483
        } else {
1484
          setPe((PaymentException)value);
1485
        }
1486
        break;
1487
 
1488
      }
1489
    }
1490
 
1491
    public void setFieldValue(int fieldID, Object value) {
1492
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
1493
    }
1494
 
1495
    public Object getFieldValue(_Fields field) {
1496
      switch (field) {
1497
      case SUCCESS:
1498
        return getSuccess();
1499
 
1500
      case PE:
1501
        return getPe();
1502
 
1503
      }
1504
      throw new IllegalStateException();
1505
    }
1506
 
1507
    public Object getFieldValue(int fieldId) {
1508
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
1509
    }
1510
 
1511
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
1512
    public boolean isSet(_Fields field) {
1513
      switch (field) {
1514
      case SUCCESS:
1515
        return isSetSuccess();
1516
      case PE:
1517
        return isSetPe();
1518
      }
1519
      throw new IllegalStateException();
1520
    }
1521
 
1522
    public boolean isSet(int fieldID) {
1523
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
1524
    }
1525
 
1526
    @Override
1527
    public boolean equals(Object that) {
1528
      if (that == null)
1529
        return false;
1530
      if (that instanceof createPayment_result)
1531
        return this.equals((createPayment_result)that);
1532
      return false;
1533
    }
1534
 
1535
    public boolean equals(createPayment_result that) {
1536
      if (that == null)
1537
        return false;
1538
 
1539
      boolean this_present_success = true && this.isSetSuccess();
1540
      boolean that_present_success = true && that.isSetSuccess();
1541
      if (this_present_success || that_present_success) {
1542
        if (!(this_present_success && that_present_success))
1543
          return false;
1544
        if (!this.success.equals(that.success))
1545
          return false;
1546
      }
1547
 
1548
      boolean this_present_pe = true && this.isSetPe();
1549
      boolean that_present_pe = true && that.isSetPe();
1550
      if (this_present_pe || that_present_pe) {
1551
        if (!(this_present_pe && that_present_pe))
1552
          return false;
1553
        if (!this.pe.equals(that.pe))
1554
          return false;
1555
      }
1556
 
1557
      return true;
1558
    }
1559
 
1560
    @Override
1561
    public int hashCode() {
1562
      return 0;
1563
    }
1564
 
1565
    public void read(TProtocol iprot) throws TException {
1566
      TField field;
1567
      iprot.readStructBegin();
1568
      while (true)
1569
      {
1570
        field = iprot.readFieldBegin();
1571
        if (field.type == TType.STOP) { 
1572
          break;
1573
        }
1574
        _Fields fieldId = _Fields.findByThriftId(field.id);
1575
        if (fieldId == null) {
1576
          TProtocolUtil.skip(iprot, field.type);
1577
        } else {
1578
          switch (fieldId) {
1579
            case SUCCESS:
1580
              if (field.type == TType.STRUCT) {
1581
                this.success = new Payment();
1582
                this.success.read(iprot);
1583
              } else { 
1584
                TProtocolUtil.skip(iprot, field.type);
1585
              }
1586
              break;
1587
            case PE:
1588
              if (field.type == TType.STRUCT) {
1589
                this.pe = new PaymentException();
1590
                this.pe.read(iprot);
1591
              } else { 
1592
                TProtocolUtil.skip(iprot, field.type);
1593
              }
1594
              break;
1595
          }
1596
          iprot.readFieldEnd();
1597
        }
1598
      }
1599
      iprot.readStructEnd();
1600
      validate();
1601
    }
1602
 
1603
    public void write(TProtocol oprot) throws TException {
1604
      oprot.writeStructBegin(STRUCT_DESC);
1605
 
1606
      if (this.isSetSuccess()) {
1607
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
1608
        this.success.write(oprot);
1609
        oprot.writeFieldEnd();
1610
      } else if (this.isSetPe()) {
1611
        oprot.writeFieldBegin(PE_FIELD_DESC);
1612
        this.pe.write(oprot);
1613
        oprot.writeFieldEnd();
1614
      }
1615
      oprot.writeFieldStop();
1616
      oprot.writeStructEnd();
1617
    }
1618
 
1619
    @Override
1620
    public String toString() {
1621
      StringBuilder sb = new StringBuilder("createPayment_result(");
1622
      boolean first = true;
1623
 
1624
      sb.append("success:");
1625
      if (this.success == null) {
1626
        sb.append("null");
1627
      } else {
1628
        sb.append(this.success);
1629
      }
1630
      first = false;
1631
      if (!first) sb.append(", ");
1632
      sb.append("pe:");
1633
      if (this.pe == null) {
1634
        sb.append("null");
1635
      } else {
1636
        sb.append(this.pe);
1637
      }
1638
      first = false;
1639
      sb.append(")");
1640
      return sb.toString();
1641
    }
1642
 
1643
    public void validate() throws TException {
1644
      // check for required fields
1645
    }
1646
 
1647
  }
1648
 
1649
  public static class createPaymentRequest_args implements TBase<createPaymentRequest_args._Fields>, java.io.Serializable, Cloneable, Comparable<createPaymentRequest_args>   {
1650
    private static final TStruct STRUCT_DESC = new TStruct("createPaymentRequest_args");
1651
 
1652
    private static final TField CART_ID_FIELD_DESC = new TField("cart_id", TType.I64, (short)1);
1653
    private static final TField APPLICATION_ID_FIELD_DESC = new TField("application_id", TType.I64, (short)2);
1654
    private static final TField MERCHANT_TX_ID_FIELD_DESC = new TField("merchant_tx_id", TType.I64, (short)3);
1655
    private static final TField PARAMS_FIELD_DESC = new TField("params", TType.LIST, (short)5);
1656
 
1657
    private long cart_id;
1658
    private long application_id;
1659
    private long merchant_tx_id;
1660
    private List<Param> params;
1661
 
1662
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
1663
    public enum _Fields implements TFieldIdEnum {
1664
      CART_ID((short)1, "cart_id"),
1665
      APPLICATION_ID((short)2, "application_id"),
1666
      MERCHANT_TX_ID((short)3, "merchant_tx_id"),
1667
      PARAMS((short)5, "params");
1668
 
1669
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
1670
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
1671
 
1672
      static {
1673
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
1674
          byId.put((int)field._thriftId, field);
1675
          byName.put(field.getFieldName(), field);
1676
        }
1677
      }
1678
 
1679
      /**
1680
       * Find the _Fields constant that matches fieldId, or null if its not found.
1681
       */
1682
      public static _Fields findByThriftId(int fieldId) {
1683
        return byId.get(fieldId);
1684
      }
1685
 
1686
      /**
1687
       * Find the _Fields constant that matches fieldId, throwing an exception
1688
       * if it is not found.
1689
       */
1690
      public static _Fields findByThriftIdOrThrow(int fieldId) {
1691
        _Fields fields = findByThriftId(fieldId);
1692
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
1693
        return fields;
1694
      }
1695
 
1696
      /**
1697
       * Find the _Fields constant that matches name, or null if its not found.
1698
       */
1699
      public static _Fields findByName(String name) {
1700
        return byName.get(name);
1701
      }
1702
 
1703
      private final short _thriftId;
1704
      private final String _fieldName;
1705
 
1706
      _Fields(short thriftId, String fieldName) {
1707
        _thriftId = thriftId;
1708
        _fieldName = fieldName;
1709
      }
1710
 
1711
      public short getThriftFieldId() {
1712
        return _thriftId;
1713
      }
1714
 
1715
      public String getFieldName() {
1716
        return _fieldName;
1717
      }
1718
    }
1719
 
1720
    // isset id assignments
1721
    private static final int __CART_ID_ISSET_ID = 0;
1722
    private static final int __APPLICATION_ID_ISSET_ID = 1;
1723
    private static final int __MERCHANT_TX_ID_ISSET_ID = 2;
1724
    private BitSet __isset_bit_vector = new BitSet(3);
1725
 
1726
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
1727
      put(_Fields.CART_ID, new FieldMetaData("cart_id", TFieldRequirementType.DEFAULT, 
1728
          new FieldValueMetaData(TType.I64)));
1729
      put(_Fields.APPLICATION_ID, new FieldMetaData("application_id", TFieldRequirementType.DEFAULT, 
1730
          new FieldValueMetaData(TType.I64)));
1731
      put(_Fields.MERCHANT_TX_ID, new FieldMetaData("merchant_tx_id", TFieldRequirementType.DEFAULT, 
1732
          new FieldValueMetaData(TType.I64)));
1733
      put(_Fields.PARAMS, new FieldMetaData("params", TFieldRequirementType.DEFAULT, 
1734
          new ListMetaData(TType.LIST, 
1735
              new StructMetaData(TType.STRUCT, Param.class))));
1736
    }});
1737
 
1738
    static {
1739
      FieldMetaData.addStructMetaDataMap(createPaymentRequest_args.class, metaDataMap);
1740
    }
1741
 
1742
    public createPaymentRequest_args() {
1743
    }
1744
 
1745
    public createPaymentRequest_args(
1746
      long cart_id,
1747
      long application_id,
1748
      long merchant_tx_id,
1749
      List<Param> params)
1750
    {
1751
      this();
1752
      this.cart_id = cart_id;
1753
      setCart_idIsSet(true);
1754
      this.application_id = application_id;
1755
      setApplication_idIsSet(true);
1756
      this.merchant_tx_id = merchant_tx_id;
1757
      setMerchant_tx_idIsSet(true);
1758
      this.params = params;
1759
    }
1760
 
1761
    /**
1762
     * Performs a deep copy on <i>other</i>.
1763
     */
1764
    public createPaymentRequest_args(createPaymentRequest_args other) {
1765
      __isset_bit_vector.clear();
1766
      __isset_bit_vector.or(other.__isset_bit_vector);
1767
      this.cart_id = other.cart_id;
1768
      this.application_id = other.application_id;
1769
      this.merchant_tx_id = other.merchant_tx_id;
1770
      if (other.isSetParams()) {
1771
        List<Param> __this__params = new ArrayList<Param>();
1772
        for (Param other_element : other.params) {
1773
          __this__params.add(new Param(other_element));
1774
        }
1775
        this.params = __this__params;
1776
      }
1777
    }
1778
 
1779
    public createPaymentRequest_args deepCopy() {
1780
      return new createPaymentRequest_args(this);
1781
    }
1782
 
1783
    @Deprecated
1784
    public createPaymentRequest_args clone() {
1785
      return new createPaymentRequest_args(this);
1786
    }
1787
 
1788
    public long getCart_id() {
1789
      return this.cart_id;
1790
    }
1791
 
1792
    public createPaymentRequest_args setCart_id(long cart_id) {
1793
      this.cart_id = cart_id;
1794
      setCart_idIsSet(true);
1795
      return this;
1796
    }
1797
 
1798
    public void unsetCart_id() {
1799
      __isset_bit_vector.clear(__CART_ID_ISSET_ID);
1800
    }
1801
 
1802
    /** Returns true if field cart_id is set (has been asigned a value) and false otherwise */
1803
    public boolean isSetCart_id() {
1804
      return __isset_bit_vector.get(__CART_ID_ISSET_ID);
1805
    }
1806
 
1807
    public void setCart_idIsSet(boolean value) {
1808
      __isset_bit_vector.set(__CART_ID_ISSET_ID, value);
1809
    }
1810
 
1811
    public long getApplication_id() {
1812
      return this.application_id;
1813
    }
1814
 
1815
    public createPaymentRequest_args setApplication_id(long application_id) {
1816
      this.application_id = application_id;
1817
      setApplication_idIsSet(true);
1818
      return this;
1819
    }
1820
 
1821
    public void unsetApplication_id() {
1822
      __isset_bit_vector.clear(__APPLICATION_ID_ISSET_ID);
1823
    }
1824
 
1825
    /** Returns true if field application_id is set (has been asigned a value) and false otherwise */
1826
    public boolean isSetApplication_id() {
1827
      return __isset_bit_vector.get(__APPLICATION_ID_ISSET_ID);
1828
    }
1829
 
1830
    public void setApplication_idIsSet(boolean value) {
1831
      __isset_bit_vector.set(__APPLICATION_ID_ISSET_ID, value);
1832
    }
1833
 
1834
    public long getMerchant_tx_id() {
1835
      return this.merchant_tx_id;
1836
    }
1837
 
1838
    public createPaymentRequest_args setMerchant_tx_id(long merchant_tx_id) {
1839
      this.merchant_tx_id = merchant_tx_id;
1840
      setMerchant_tx_idIsSet(true);
1841
      return this;
1842
    }
1843
 
1844
    public void unsetMerchant_tx_id() {
1845
      __isset_bit_vector.clear(__MERCHANT_TX_ID_ISSET_ID);
1846
    }
1847
 
1848
    /** Returns true if field merchant_tx_id is set (has been asigned a value) and false otherwise */
1849
    public boolean isSetMerchant_tx_id() {
1850
      return __isset_bit_vector.get(__MERCHANT_TX_ID_ISSET_ID);
1851
    }
1852
 
1853
    public void setMerchant_tx_idIsSet(boolean value) {
1854
      __isset_bit_vector.set(__MERCHANT_TX_ID_ISSET_ID, value);
1855
    }
1856
 
1857
    public int getParamsSize() {
1858
      return (this.params == null) ? 0 : this.params.size();
1859
    }
1860
 
1861
    public java.util.Iterator<Param> getParamsIterator() {
1862
      return (this.params == null) ? null : this.params.iterator();
1863
    }
1864
 
1865
    public void addToParams(Param elem) {
1866
      if (this.params == null) {
1867
        this.params = new ArrayList<Param>();
1868
      }
1869
      this.params.add(elem);
1870
    }
1871
 
1872
    public List<Param> getParams() {
1873
      return this.params;
1874
    }
1875
 
1876
    public createPaymentRequest_args setParams(List<Param> params) {
1877
      this.params = params;
1878
      return this;
1879
    }
1880
 
1881
    public void unsetParams() {
1882
      this.params = null;
1883
    }
1884
 
1885
    /** Returns true if field params is set (has been asigned a value) and false otherwise */
1886
    public boolean isSetParams() {
1887
      return this.params != null;
1888
    }
1889
 
1890
    public void setParamsIsSet(boolean value) {
1891
      if (!value) {
1892
        this.params = null;
1893
      }
1894
    }
1895
 
1896
    public void setFieldValue(_Fields field, Object value) {
1897
      switch (field) {
1898
      case CART_ID:
1899
        if (value == null) {
1900
          unsetCart_id();
1901
        } else {
1902
          setCart_id((Long)value);
1903
        }
1904
        break;
1905
 
1906
      case APPLICATION_ID:
1907
        if (value == null) {
1908
          unsetApplication_id();
1909
        } else {
1910
          setApplication_id((Long)value);
1911
        }
1912
        break;
1913
 
1914
      case MERCHANT_TX_ID:
1915
        if (value == null) {
1916
          unsetMerchant_tx_id();
1917
        } else {
1918
          setMerchant_tx_id((Long)value);
1919
        }
1920
        break;
1921
 
1922
      case PARAMS:
1923
        if (value == null) {
1924
          unsetParams();
1925
        } else {
1926
          setParams((List<Param>)value);
1927
        }
1928
        break;
1929
 
1930
      }
1931
    }
1932
 
1933
    public void setFieldValue(int fieldID, Object value) {
1934
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
1935
    }
1936
 
1937
    public Object getFieldValue(_Fields field) {
1938
      switch (field) {
1939
      case CART_ID:
1940
        return new Long(getCart_id());
1941
 
1942
      case APPLICATION_ID:
1943
        return new Long(getApplication_id());
1944
 
1945
      case MERCHANT_TX_ID:
1946
        return new Long(getMerchant_tx_id());
1947
 
1948
      case PARAMS:
1949
        return getParams();
1950
 
1951
      }
1952
      throw new IllegalStateException();
1953
    }
1954
 
1955
    public Object getFieldValue(int fieldId) {
1956
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
1957
    }
1958
 
1959
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
1960
    public boolean isSet(_Fields field) {
1961
      switch (field) {
1962
      case CART_ID:
1963
        return isSetCart_id();
1964
      case APPLICATION_ID:
1965
        return isSetApplication_id();
1966
      case MERCHANT_TX_ID:
1967
        return isSetMerchant_tx_id();
1968
      case PARAMS:
1969
        return isSetParams();
1970
      }
1971
      throw new IllegalStateException();
1972
    }
1973
 
1974
    public boolean isSet(int fieldID) {
1975
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
1976
    }
1977
 
1978
    @Override
1979
    public boolean equals(Object that) {
1980
      if (that == null)
1981
        return false;
1982
      if (that instanceof createPaymentRequest_args)
1983
        return this.equals((createPaymentRequest_args)that);
1984
      return false;
1985
    }
1986
 
1987
    public boolean equals(createPaymentRequest_args that) {
1988
      if (that == null)
1989
        return false;
1990
 
1991
      boolean this_present_cart_id = true;
1992
      boolean that_present_cart_id = true;
1993
      if (this_present_cart_id || that_present_cart_id) {
1994
        if (!(this_present_cart_id && that_present_cart_id))
1995
          return false;
1996
        if (this.cart_id != that.cart_id)
1997
          return false;
1998
      }
1999
 
2000
      boolean this_present_application_id = true;
2001
      boolean that_present_application_id = true;
2002
      if (this_present_application_id || that_present_application_id) {
2003
        if (!(this_present_application_id && that_present_application_id))
2004
          return false;
2005
        if (this.application_id != that.application_id)
2006
          return false;
2007
      }
2008
 
2009
      boolean this_present_merchant_tx_id = true;
2010
      boolean that_present_merchant_tx_id = true;
2011
      if (this_present_merchant_tx_id || that_present_merchant_tx_id) {
2012
        if (!(this_present_merchant_tx_id && that_present_merchant_tx_id))
2013
          return false;
2014
        if (this.merchant_tx_id != that.merchant_tx_id)
2015
          return false;
2016
      }
2017
 
2018
      boolean this_present_params = true && this.isSetParams();
2019
      boolean that_present_params = true && that.isSetParams();
2020
      if (this_present_params || that_present_params) {
2021
        if (!(this_present_params && that_present_params))
2022
          return false;
2023
        if (!this.params.equals(that.params))
2024
          return false;
2025
      }
2026
 
2027
      return true;
2028
    }
2029
 
2030
    @Override
2031
    public int hashCode() {
2032
      return 0;
2033
    }
2034
 
2035
    public int compareTo(createPaymentRequest_args other) {
2036
      if (!getClass().equals(other.getClass())) {
2037
        return getClass().getName().compareTo(other.getClass().getName());
2038
      }
2039
 
2040
      int lastComparison = 0;
2041
      createPaymentRequest_args typedOther = (createPaymentRequest_args)other;
2042
 
2043
      lastComparison = Boolean.valueOf(isSetCart_id()).compareTo(isSetCart_id());
2044
      if (lastComparison != 0) {
2045
        return lastComparison;
2046
      }
2047
      lastComparison = TBaseHelper.compareTo(cart_id, typedOther.cart_id);
2048
      if (lastComparison != 0) {
2049
        return lastComparison;
2050
      }
2051
      lastComparison = Boolean.valueOf(isSetApplication_id()).compareTo(isSetApplication_id());
2052
      if (lastComparison != 0) {
2053
        return lastComparison;
2054
      }
2055
      lastComparison = TBaseHelper.compareTo(application_id, typedOther.application_id);
2056
      if (lastComparison != 0) {
2057
        return lastComparison;
2058
      }
2059
      lastComparison = Boolean.valueOf(isSetMerchant_tx_id()).compareTo(isSetMerchant_tx_id());
2060
      if (lastComparison != 0) {
2061
        return lastComparison;
2062
      }
2063
      lastComparison = TBaseHelper.compareTo(merchant_tx_id, typedOther.merchant_tx_id);
2064
      if (lastComparison != 0) {
2065
        return lastComparison;
2066
      }
2067
      lastComparison = Boolean.valueOf(isSetParams()).compareTo(isSetParams());
2068
      if (lastComparison != 0) {
2069
        return lastComparison;
2070
      }
2071
      lastComparison = TBaseHelper.compareTo(params, typedOther.params);
2072
      if (lastComparison != 0) {
2073
        return lastComparison;
2074
      }
2075
      return 0;
2076
    }
2077
 
2078
    public void read(TProtocol iprot) throws TException {
2079
      TField field;
2080
      iprot.readStructBegin();
2081
      while (true)
2082
      {
2083
        field = iprot.readFieldBegin();
2084
        if (field.type == TType.STOP) { 
2085
          break;
2086
        }
2087
        _Fields fieldId = _Fields.findByThriftId(field.id);
2088
        if (fieldId == null) {
2089
          TProtocolUtil.skip(iprot, field.type);
2090
        } else {
2091
          switch (fieldId) {
2092
            case CART_ID:
2093
              if (field.type == TType.I64) {
2094
                this.cart_id = iprot.readI64();
2095
                setCart_idIsSet(true);
2096
              } else { 
2097
                TProtocolUtil.skip(iprot, field.type);
2098
              }
2099
              break;
2100
            case APPLICATION_ID:
2101
              if (field.type == TType.I64) {
2102
                this.application_id = iprot.readI64();
2103
                setApplication_idIsSet(true);
2104
              } else { 
2105
                TProtocolUtil.skip(iprot, field.type);
2106
              }
2107
              break;
2108
            case MERCHANT_TX_ID:
2109
              if (field.type == TType.I64) {
2110
                this.merchant_tx_id = iprot.readI64();
2111
                setMerchant_tx_idIsSet(true);
2112
              } else { 
2113
                TProtocolUtil.skip(iprot, field.type);
2114
              }
2115
              break;
2116
            case PARAMS:
2117
              if (field.type == TType.LIST) {
2118
                {
2119
                  TList _list9 = iprot.readListBegin();
2120
                  this.params = new ArrayList<Param>(_list9.size);
2121
                  for (int _i10 = 0; _i10 < _list9.size; ++_i10)
2122
                  {
2123
                    Param _elem11;
2124
                    _elem11 = new Param();
2125
                    _elem11.read(iprot);
2126
                    this.params.add(_elem11);
2127
                  }
2128
                  iprot.readListEnd();
2129
                }
2130
              } else { 
2131
                TProtocolUtil.skip(iprot, field.type);
2132
              }
2133
              break;
2134
          }
2135
          iprot.readFieldEnd();
2136
        }
2137
      }
2138
      iprot.readStructEnd();
2139
      validate();
2140
    }
2141
 
2142
    public void write(TProtocol oprot) throws TException {
2143
      validate();
2144
 
2145
      oprot.writeStructBegin(STRUCT_DESC);
2146
      oprot.writeFieldBegin(CART_ID_FIELD_DESC);
2147
      oprot.writeI64(this.cart_id);
2148
      oprot.writeFieldEnd();
2149
      oprot.writeFieldBegin(APPLICATION_ID_FIELD_DESC);
2150
      oprot.writeI64(this.application_id);
2151
      oprot.writeFieldEnd();
2152
      oprot.writeFieldBegin(MERCHANT_TX_ID_FIELD_DESC);
2153
      oprot.writeI64(this.merchant_tx_id);
2154
      oprot.writeFieldEnd();
2155
      if (this.params != null) {
2156
        oprot.writeFieldBegin(PARAMS_FIELD_DESC);
2157
        {
2158
          oprot.writeListBegin(new TList(TType.STRUCT, this.params.size()));
2159
          for (Param _iter12 : this.params)
2160
          {
2161
            _iter12.write(oprot);
2162
          }
2163
          oprot.writeListEnd();
2164
        }
2165
        oprot.writeFieldEnd();
2166
      }
2167
      oprot.writeFieldStop();
2168
      oprot.writeStructEnd();
2169
    }
2170
 
2171
    @Override
2172
    public String toString() {
2173
      StringBuilder sb = new StringBuilder("createPaymentRequest_args(");
2174
      boolean first = true;
2175
 
2176
      sb.append("cart_id:");
2177
      sb.append(this.cart_id);
2178
      first = false;
2179
      if (!first) sb.append(", ");
2180
      sb.append("application_id:");
2181
      sb.append(this.application_id);
2182
      first = false;
2183
      if (!first) sb.append(", ");
2184
      sb.append("merchant_tx_id:");
2185
      sb.append(this.merchant_tx_id);
2186
      first = false;
2187
      if (!first) sb.append(", ");
2188
      sb.append("params:");
2189
      if (this.params == null) {
2190
        sb.append("null");
2191
      } else {
2192
        sb.append(this.params);
2193
      }
2194
      first = false;
2195
      sb.append(")");
2196
      return sb.toString();
2197
    }
2198
 
2199
    public void validate() throws TException {
2200
      // check for required fields
2201
    }
2202
 
2203
  }
2204
 
2205
  public static class createPaymentRequest_result implements TBase<createPaymentRequest_result._Fields>, java.io.Serializable, Cloneable, Comparable<createPaymentRequest_result>   {
2206
    private static final TStruct STRUCT_DESC = new TStruct("createPaymentRequest_result");
2207
 
2208
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0);
2209
    private static final TField PE_FIELD_DESC = new TField("pe", TType.STRUCT, (short)1);
2210
 
2211
    private PaymentRequest success;
2212
    private PaymentException pe;
2213
 
2214
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
2215
    public enum _Fields implements TFieldIdEnum {
2216
      SUCCESS((short)0, "success"),
2217
      PE((short)1, "pe");
2218
 
2219
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
2220
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2221
 
2222
      static {
2223
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2224
          byId.put((int)field._thriftId, field);
2225
          byName.put(field.getFieldName(), field);
2226
        }
2227
      }
2228
 
2229
      /**
2230
       * Find the _Fields constant that matches fieldId, or null if its not found.
2231
       */
2232
      public static _Fields findByThriftId(int fieldId) {
2233
        return byId.get(fieldId);
2234
      }
2235
 
2236
      /**
2237
       * Find the _Fields constant that matches fieldId, throwing an exception
2238
       * if it is not found.
2239
       */
2240
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2241
        _Fields fields = findByThriftId(fieldId);
2242
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2243
        return fields;
2244
      }
2245
 
2246
      /**
2247
       * Find the _Fields constant that matches name, or null if its not found.
2248
       */
2249
      public static _Fields findByName(String name) {
2250
        return byName.get(name);
2251
      }
2252
 
2253
      private final short _thriftId;
2254
      private final String _fieldName;
2255
 
2256
      _Fields(short thriftId, String fieldName) {
2257
        _thriftId = thriftId;
2258
        _fieldName = fieldName;
2259
      }
2260
 
2261
      public short getThriftFieldId() {
2262
        return _thriftId;
2263
      }
2264
 
2265
      public String getFieldName() {
2266
        return _fieldName;
2267
      }
2268
    }
2269
 
2270
    // isset id assignments
2271
 
2272
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
2273
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
2274
          new StructMetaData(TType.STRUCT, PaymentRequest.class)));
2275
      put(_Fields.PE, new FieldMetaData("pe", TFieldRequirementType.DEFAULT, 
2276
          new FieldValueMetaData(TType.STRUCT)));
2277
    }});
2278
 
2279
    static {
2280
      FieldMetaData.addStructMetaDataMap(createPaymentRequest_result.class, metaDataMap);
2281
    }
2282
 
2283
    public createPaymentRequest_result() {
2284
    }
2285
 
2286
    public createPaymentRequest_result(
2287
      PaymentRequest success,
2288
      PaymentException pe)
2289
    {
2290
      this();
2291
      this.success = success;
2292
      this.pe = pe;
2293
    }
2294
 
2295
    /**
2296
     * Performs a deep copy on <i>other</i>.
2297
     */
2298
    public createPaymentRequest_result(createPaymentRequest_result other) {
2299
      if (other.isSetSuccess()) {
2300
        this.success = new PaymentRequest(other.success);
2301
      }
2302
      if (other.isSetPe()) {
2303
        this.pe = new PaymentException(other.pe);
2304
      }
2305
    }
2306
 
2307
    public createPaymentRequest_result deepCopy() {
2308
      return new createPaymentRequest_result(this);
2309
    }
2310
 
2311
    @Deprecated
2312
    public createPaymentRequest_result clone() {
2313
      return new createPaymentRequest_result(this);
2314
    }
2315
 
2316
    public PaymentRequest getSuccess() {
2317
      return this.success;
2318
    }
2319
 
2320
    public createPaymentRequest_result setSuccess(PaymentRequest success) {
2321
      this.success = success;
2322
      return this;
2323
    }
2324
 
2325
    public void unsetSuccess() {
2326
      this.success = null;
2327
    }
2328
 
2329
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
2330
    public boolean isSetSuccess() {
2331
      return this.success != null;
2332
    }
2333
 
2334
    public void setSuccessIsSet(boolean value) {
2335
      if (!value) {
2336
        this.success = null;
2337
      }
2338
    }
2339
 
2340
    public PaymentException getPe() {
2341
      return this.pe;
2342
    }
2343
 
2344
    public createPaymentRequest_result setPe(PaymentException pe) {
2345
      this.pe = pe;
2346
      return this;
2347
    }
2348
 
2349
    public void unsetPe() {
2350
      this.pe = null;
2351
    }
2352
 
2353
    /** Returns true if field pe is set (has been asigned a value) and false otherwise */
2354
    public boolean isSetPe() {
2355
      return this.pe != null;
2356
    }
2357
 
2358
    public void setPeIsSet(boolean value) {
2359
      if (!value) {
2360
        this.pe = null;
2361
      }
2362
    }
2363
 
2364
    public void setFieldValue(_Fields field, Object value) {
2365
      switch (field) {
2366
      case SUCCESS:
2367
        if (value == null) {
2368
          unsetSuccess();
2369
        } else {
2370
          setSuccess((PaymentRequest)value);
2371
        }
2372
        break;
2373
 
2374
      case PE:
2375
        if (value == null) {
2376
          unsetPe();
2377
        } else {
2378
          setPe((PaymentException)value);
2379
        }
2380
        break;
2381
 
2382
      }
2383
    }
2384
 
2385
    public void setFieldValue(int fieldID, Object value) {
2386
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
2387
    }
2388
 
2389
    public Object getFieldValue(_Fields field) {
2390
      switch (field) {
2391
      case SUCCESS:
2392
        return getSuccess();
2393
 
2394
      case PE:
2395
        return getPe();
2396
 
2397
      }
2398
      throw new IllegalStateException();
2399
    }
2400
 
2401
    public Object getFieldValue(int fieldId) {
2402
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
2403
    }
2404
 
2405
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
2406
    public boolean isSet(_Fields field) {
2407
      switch (field) {
2408
      case SUCCESS:
2409
        return isSetSuccess();
2410
      case PE:
2411
        return isSetPe();
2412
      }
2413
      throw new IllegalStateException();
2414
    }
2415
 
2416
    public boolean isSet(int fieldID) {
2417
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
2418
    }
2419
 
2420
    @Override
2421
    public boolean equals(Object that) {
2422
      if (that == null)
2423
        return false;
2424
      if (that instanceof createPaymentRequest_result)
2425
        return this.equals((createPaymentRequest_result)that);
2426
      return false;
2427
    }
2428
 
2429
    public boolean equals(createPaymentRequest_result that) {
2430
      if (that == null)
2431
        return false;
2432
 
2433
      boolean this_present_success = true && this.isSetSuccess();
2434
      boolean that_present_success = true && that.isSetSuccess();
2435
      if (this_present_success || that_present_success) {
2436
        if (!(this_present_success && that_present_success))
2437
          return false;
2438
        if (!this.success.equals(that.success))
2439
          return false;
2440
      }
2441
 
2442
      boolean this_present_pe = true && this.isSetPe();
2443
      boolean that_present_pe = true && that.isSetPe();
2444
      if (this_present_pe || that_present_pe) {
2445
        if (!(this_present_pe && that_present_pe))
2446
          return false;
2447
        if (!this.pe.equals(that.pe))
2448
          return false;
2449
      }
2450
 
2451
      return true;
2452
    }
2453
 
2454
    @Override
2455
    public int hashCode() {
2456
      return 0;
2457
    }
2458
 
2459
    public int compareTo(createPaymentRequest_result other) {
2460
      if (!getClass().equals(other.getClass())) {
2461
        return getClass().getName().compareTo(other.getClass().getName());
2462
      }
2463
 
2464
      int lastComparison = 0;
2465
      createPaymentRequest_result typedOther = (createPaymentRequest_result)other;
2466
 
2467
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
2468
      if (lastComparison != 0) {
2469
        return lastComparison;
2470
      }
2471
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
2472
      if (lastComparison != 0) {
2473
        return lastComparison;
2474
      }
2475
      lastComparison = Boolean.valueOf(isSetPe()).compareTo(isSetPe());
2476
      if (lastComparison != 0) {
2477
        return lastComparison;
2478
      }
2479
      lastComparison = TBaseHelper.compareTo(pe, typedOther.pe);
2480
      if (lastComparison != 0) {
2481
        return lastComparison;
2482
      }
2483
      return 0;
2484
    }
2485
 
2486
    public void read(TProtocol iprot) throws TException {
2487
      TField field;
2488
      iprot.readStructBegin();
2489
      while (true)
2490
      {
2491
        field = iprot.readFieldBegin();
2492
        if (field.type == TType.STOP) { 
2493
          break;
2494
        }
2495
        _Fields fieldId = _Fields.findByThriftId(field.id);
2496
        if (fieldId == null) {
2497
          TProtocolUtil.skip(iprot, field.type);
2498
        } else {
2499
          switch (fieldId) {
2500
            case SUCCESS:
2501
              if (field.type == TType.STRUCT) {
2502
                this.success = new PaymentRequest();
2503
                this.success.read(iprot);
2504
              } else { 
2505
                TProtocolUtil.skip(iprot, field.type);
2506
              }
2507
              break;
2508
            case PE:
2509
              if (field.type == TType.STRUCT) {
2510
                this.pe = new PaymentException();
2511
                this.pe.read(iprot);
2512
              } else { 
2513
                TProtocolUtil.skip(iprot, field.type);
2514
              }
2515
              break;
2516
          }
2517
          iprot.readFieldEnd();
2518
        }
2519
      }
2520
      iprot.readStructEnd();
2521
      validate();
2522
    }
2523
 
2524
    public void write(TProtocol oprot) throws TException {
2525
      oprot.writeStructBegin(STRUCT_DESC);
2526
 
2527
      if (this.isSetSuccess()) {
2528
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
2529
        this.success.write(oprot);
2530
        oprot.writeFieldEnd();
2531
      } else if (this.isSetPe()) {
2532
        oprot.writeFieldBegin(PE_FIELD_DESC);
2533
        this.pe.write(oprot);
2534
        oprot.writeFieldEnd();
2535
      }
2536
      oprot.writeFieldStop();
2537
      oprot.writeStructEnd();
2538
    }
2539
 
2540
    @Override
2541
    public String toString() {
2542
      StringBuilder sb = new StringBuilder("createPaymentRequest_result(");
2543
      boolean first = true;
2544
 
2545
      sb.append("success:");
2546
      if (this.success == null) {
2547
        sb.append("null");
2548
      } else {
2549
        sb.append(this.success);
2550
      }
2551
      first = false;
2552
      if (!first) sb.append(", ");
2553
      sb.append("pe:");
2554
      if (this.pe == null) {
2555
        sb.append("null");
2556
      } else {
2557
        sb.append(this.pe);
2558
      }
2559
      first = false;
2560
      sb.append(")");
2561
      return sb.toString();
2562
    }
2563
 
2564
    public void validate() throws TException {
2565
      // check for required fields
2566
    }
2567
 
2568
  }
2569
 
2570
  public static class addCallbackUrl_args implements TBase<addCallbackUrl_args._Fields>, java.io.Serializable, Cloneable, Comparable<addCallbackUrl_args>   {
2571
    private static final TStruct STRUCT_DESC = new TStruct("addCallbackUrl_args");
2572
 
2573
    private static final TField APPLICATION_ID_FIELD_DESC = new TField("application_id", TType.I64, (short)1);
2574
    private static final TField CALLBACK_URL_FIELD_DESC = new TField("callback_url", TType.STRING, (short)2);
2575
    private static final TField UPDATE_IF_EXISTING_FIELD_DESC = new TField("updateIfExisting", TType.BOOL, (short)3);
2576
 
2577
    private long application_id;
2578
    private String callback_url;
2579
    private boolean updateIfExisting;
2580
 
2581
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
2582
    public enum _Fields implements TFieldIdEnum {
2583
      APPLICATION_ID((short)1, "application_id"),
2584
      CALLBACK_URL((short)2, "callback_url"),
2585
      UPDATE_IF_EXISTING((short)3, "updateIfExisting");
2586
 
2587
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
2588
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2589
 
2590
      static {
2591
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2592
          byId.put((int)field._thriftId, field);
2593
          byName.put(field.getFieldName(), field);
2594
        }
2595
      }
2596
 
2597
      /**
2598
       * Find the _Fields constant that matches fieldId, or null if its not found.
2599
       */
2600
      public static _Fields findByThriftId(int fieldId) {
2601
        return byId.get(fieldId);
2602
      }
2603
 
2604
      /**
2605
       * Find the _Fields constant that matches fieldId, throwing an exception
2606
       * if it is not found.
2607
       */
2608
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2609
        _Fields fields = findByThriftId(fieldId);
2610
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2611
        return fields;
2612
      }
2613
 
2614
      /**
2615
       * Find the _Fields constant that matches name, or null if its not found.
2616
       */
2617
      public static _Fields findByName(String name) {
2618
        return byName.get(name);
2619
      }
2620
 
2621
      private final short _thriftId;
2622
      private final String _fieldName;
2623
 
2624
      _Fields(short thriftId, String fieldName) {
2625
        _thriftId = thriftId;
2626
        _fieldName = fieldName;
2627
      }
2628
 
2629
      public short getThriftFieldId() {
2630
        return _thriftId;
2631
      }
2632
 
2633
      public String getFieldName() {
2634
        return _fieldName;
2635
      }
2636
    }
2637
 
2638
    // isset id assignments
2639
    private static final int __APPLICATION_ID_ISSET_ID = 0;
2640
    private static final int __UPDATEIFEXISTING_ISSET_ID = 1;
2641
    private BitSet __isset_bit_vector = new BitSet(2);
2642
 
2643
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
2644
      put(_Fields.APPLICATION_ID, new FieldMetaData("application_id", TFieldRequirementType.DEFAULT, 
2645
          new FieldValueMetaData(TType.I64)));
2646
      put(_Fields.CALLBACK_URL, new FieldMetaData("callback_url", TFieldRequirementType.DEFAULT, 
2647
          new FieldValueMetaData(TType.STRING)));
2648
      put(_Fields.UPDATE_IF_EXISTING, new FieldMetaData("updateIfExisting", TFieldRequirementType.DEFAULT, 
2649
          new FieldValueMetaData(TType.BOOL)));
2650
    }});
2651
 
2652
    static {
2653
      FieldMetaData.addStructMetaDataMap(addCallbackUrl_args.class, metaDataMap);
2654
    }
2655
 
2656
    public addCallbackUrl_args() {
2657
    }
2658
 
2659
    public addCallbackUrl_args(
2660
      long application_id,
2661
      String callback_url,
2662
      boolean updateIfExisting)
2663
    {
2664
      this();
2665
      this.application_id = application_id;
2666
      setApplication_idIsSet(true);
2667
      this.callback_url = callback_url;
2668
      this.updateIfExisting = updateIfExisting;
2669
      setUpdateIfExistingIsSet(true);
2670
    }
2671
 
2672
    /**
2673
     * Performs a deep copy on <i>other</i>.
2674
     */
2675
    public addCallbackUrl_args(addCallbackUrl_args other) {
2676
      __isset_bit_vector.clear();
2677
      __isset_bit_vector.or(other.__isset_bit_vector);
2678
      this.application_id = other.application_id;
2679
      if (other.isSetCallback_url()) {
2680
        this.callback_url = other.callback_url;
2681
      }
2682
      this.updateIfExisting = other.updateIfExisting;
2683
    }
2684
 
2685
    public addCallbackUrl_args deepCopy() {
2686
      return new addCallbackUrl_args(this);
2687
    }
2688
 
2689
    @Deprecated
2690
    public addCallbackUrl_args clone() {
2691
      return new addCallbackUrl_args(this);
2692
    }
2693
 
2694
    public long getApplication_id() {
2695
      return this.application_id;
2696
    }
2697
 
2698
    public addCallbackUrl_args setApplication_id(long application_id) {
2699
      this.application_id = application_id;
2700
      setApplication_idIsSet(true);
2701
      return this;
2702
    }
2703
 
2704
    public void unsetApplication_id() {
2705
      __isset_bit_vector.clear(__APPLICATION_ID_ISSET_ID);
2706
    }
2707
 
2708
    /** Returns true if field application_id is set (has been asigned a value) and false otherwise */
2709
    public boolean isSetApplication_id() {
2710
      return __isset_bit_vector.get(__APPLICATION_ID_ISSET_ID);
2711
    }
2712
 
2713
    public void setApplication_idIsSet(boolean value) {
2714
      __isset_bit_vector.set(__APPLICATION_ID_ISSET_ID, value);
2715
    }
2716
 
2717
    public String getCallback_url() {
2718
      return this.callback_url;
2719
    }
2720
 
2721
    public addCallbackUrl_args setCallback_url(String callback_url) {
2722
      this.callback_url = callback_url;
2723
      return this;
2724
    }
2725
 
2726
    public void unsetCallback_url() {
2727
      this.callback_url = null;
2728
    }
2729
 
2730
    /** Returns true if field callback_url is set (has been asigned a value) and false otherwise */
2731
    public boolean isSetCallback_url() {
2732
      return this.callback_url != null;
2733
    }
2734
 
2735
    public void setCallback_urlIsSet(boolean value) {
2736
      if (!value) {
2737
        this.callback_url = null;
2738
      }
2739
    }
2740
 
2741
    public boolean isUpdateIfExisting() {
2742
      return this.updateIfExisting;
2743
    }
2744
 
2745
    public addCallbackUrl_args setUpdateIfExisting(boolean updateIfExisting) {
2746
      this.updateIfExisting = updateIfExisting;
2747
      setUpdateIfExistingIsSet(true);
2748
      return this;
2749
    }
2750
 
2751
    public void unsetUpdateIfExisting() {
2752
      __isset_bit_vector.clear(__UPDATEIFEXISTING_ISSET_ID);
2753
    }
2754
 
2755
    /** Returns true if field updateIfExisting is set (has been asigned a value) and false otherwise */
2756
    public boolean isSetUpdateIfExisting() {
2757
      return __isset_bit_vector.get(__UPDATEIFEXISTING_ISSET_ID);
2758
    }
2759
 
2760
    public void setUpdateIfExistingIsSet(boolean value) {
2761
      __isset_bit_vector.set(__UPDATEIFEXISTING_ISSET_ID, value);
2762
    }
2763
 
2764
    public void setFieldValue(_Fields field, Object value) {
2765
      switch (field) {
2766
      case APPLICATION_ID:
2767
        if (value == null) {
2768
          unsetApplication_id();
2769
        } else {
2770
          setApplication_id((Long)value);
2771
        }
2772
        break;
2773
 
2774
      case CALLBACK_URL:
2775
        if (value == null) {
2776
          unsetCallback_url();
2777
        } else {
2778
          setCallback_url((String)value);
2779
        }
2780
        break;
2781
 
2782
      case UPDATE_IF_EXISTING:
2783
        if (value == null) {
2784
          unsetUpdateIfExisting();
2785
        } else {
2786
          setUpdateIfExisting((Boolean)value);
2787
        }
2788
        break;
2789
 
2790
      }
2791
    }
2792
 
2793
    public void setFieldValue(int fieldID, Object value) {
2794
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
2795
    }
2796
 
2797
    public Object getFieldValue(_Fields field) {
2798
      switch (field) {
2799
      case APPLICATION_ID:
2800
        return new Long(getApplication_id());
2801
 
2802
      case CALLBACK_URL:
2803
        return getCallback_url();
2804
 
2805
      case UPDATE_IF_EXISTING:
2806
        return new Boolean(isUpdateIfExisting());
2807
 
2808
      }
2809
      throw new IllegalStateException();
2810
    }
2811
 
2812
    public Object getFieldValue(int fieldId) {
2813
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
2814
    }
2815
 
2816
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
2817
    public boolean isSet(_Fields field) {
2818
      switch (field) {
2819
      case APPLICATION_ID:
2820
        return isSetApplication_id();
2821
      case CALLBACK_URL:
2822
        return isSetCallback_url();
2823
      case UPDATE_IF_EXISTING:
2824
        return isSetUpdateIfExisting();
2825
      }
2826
      throw new IllegalStateException();
2827
    }
2828
 
2829
    public boolean isSet(int fieldID) {
2830
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
2831
    }
2832
 
2833
    @Override
2834
    public boolean equals(Object that) {
2835
      if (that == null)
2836
        return false;
2837
      if (that instanceof addCallbackUrl_args)
2838
        return this.equals((addCallbackUrl_args)that);
2839
      return false;
2840
    }
2841
 
2842
    public boolean equals(addCallbackUrl_args that) {
2843
      if (that == null)
2844
        return false;
2845
 
2846
      boolean this_present_application_id = true;
2847
      boolean that_present_application_id = true;
2848
      if (this_present_application_id || that_present_application_id) {
2849
        if (!(this_present_application_id && that_present_application_id))
2850
          return false;
2851
        if (this.application_id != that.application_id)
2852
          return false;
2853
      }
2854
 
2855
      boolean this_present_callback_url = true && this.isSetCallback_url();
2856
      boolean that_present_callback_url = true && that.isSetCallback_url();
2857
      if (this_present_callback_url || that_present_callback_url) {
2858
        if (!(this_present_callback_url && that_present_callback_url))
2859
          return false;
2860
        if (!this.callback_url.equals(that.callback_url))
2861
          return false;
2862
      }
2863
 
2864
      boolean this_present_updateIfExisting = true;
2865
      boolean that_present_updateIfExisting = true;
2866
      if (this_present_updateIfExisting || that_present_updateIfExisting) {
2867
        if (!(this_present_updateIfExisting && that_present_updateIfExisting))
2868
          return false;
2869
        if (this.updateIfExisting != that.updateIfExisting)
2870
          return false;
2871
      }
2872
 
2873
      return true;
2874
    }
2875
 
2876
    @Override
2877
    public int hashCode() {
2878
      return 0;
2879
    }
2880
 
2881
    public int compareTo(addCallbackUrl_args other) {
2882
      if (!getClass().equals(other.getClass())) {
2883
        return getClass().getName().compareTo(other.getClass().getName());
2884
      }
2885
 
2886
      int lastComparison = 0;
2887
      addCallbackUrl_args typedOther = (addCallbackUrl_args)other;
2888
 
2889
      lastComparison = Boolean.valueOf(isSetApplication_id()).compareTo(isSetApplication_id());
2890
      if (lastComparison != 0) {
2891
        return lastComparison;
2892
      }
2893
      lastComparison = TBaseHelper.compareTo(application_id, typedOther.application_id);
2894
      if (lastComparison != 0) {
2895
        return lastComparison;
2896
      }
2897
      lastComparison = Boolean.valueOf(isSetCallback_url()).compareTo(isSetCallback_url());
2898
      if (lastComparison != 0) {
2899
        return lastComparison;
2900
      }
2901
      lastComparison = TBaseHelper.compareTo(callback_url, typedOther.callback_url);
2902
      if (lastComparison != 0) {
2903
        return lastComparison;
2904
      }
2905
      lastComparison = Boolean.valueOf(isSetUpdateIfExisting()).compareTo(isSetUpdateIfExisting());
2906
      if (lastComparison != 0) {
2907
        return lastComparison;
2908
      }
2909
      lastComparison = TBaseHelper.compareTo(updateIfExisting, typedOther.updateIfExisting);
2910
      if (lastComparison != 0) {
2911
        return lastComparison;
2912
      }
2913
      return 0;
2914
    }
2915
 
2916
    public void read(TProtocol iprot) throws TException {
2917
      TField field;
2918
      iprot.readStructBegin();
2919
      while (true)
2920
      {
2921
        field = iprot.readFieldBegin();
2922
        if (field.type == TType.STOP) { 
2923
          break;
2924
        }
2925
        _Fields fieldId = _Fields.findByThriftId(field.id);
2926
        if (fieldId == null) {
2927
          TProtocolUtil.skip(iprot, field.type);
2928
        } else {
2929
          switch (fieldId) {
2930
            case APPLICATION_ID:
2931
              if (field.type == TType.I64) {
2932
                this.application_id = iprot.readI64();
2933
                setApplication_idIsSet(true);
2934
              } else { 
2935
                TProtocolUtil.skip(iprot, field.type);
2936
              }
2937
              break;
2938
            case CALLBACK_URL:
2939
              if (field.type == TType.STRING) {
2940
                this.callback_url = iprot.readString();
2941
              } else { 
2942
                TProtocolUtil.skip(iprot, field.type);
2943
              }
2944
              break;
2945
            case UPDATE_IF_EXISTING:
2946
              if (field.type == TType.BOOL) {
2947
                this.updateIfExisting = iprot.readBool();
2948
                setUpdateIfExistingIsSet(true);
2949
              } else { 
2950
                TProtocolUtil.skip(iprot, field.type);
2951
              }
2952
              break;
2953
          }
2954
          iprot.readFieldEnd();
2955
        }
2956
      }
2957
      iprot.readStructEnd();
2958
      validate();
2959
    }
2960
 
2961
    public void write(TProtocol oprot) throws TException {
2962
      validate();
2963
 
2964
      oprot.writeStructBegin(STRUCT_DESC);
2965
      oprot.writeFieldBegin(APPLICATION_ID_FIELD_DESC);
2966
      oprot.writeI64(this.application_id);
2967
      oprot.writeFieldEnd();
2968
      if (this.callback_url != null) {
2969
        oprot.writeFieldBegin(CALLBACK_URL_FIELD_DESC);
2970
        oprot.writeString(this.callback_url);
2971
        oprot.writeFieldEnd();
2972
      }
2973
      oprot.writeFieldBegin(UPDATE_IF_EXISTING_FIELD_DESC);
2974
      oprot.writeBool(this.updateIfExisting);
2975
      oprot.writeFieldEnd();
2976
      oprot.writeFieldStop();
2977
      oprot.writeStructEnd();
2978
    }
2979
 
2980
    @Override
2981
    public String toString() {
2982
      StringBuilder sb = new StringBuilder("addCallbackUrl_args(");
2983
      boolean first = true;
2984
 
2985
      sb.append("application_id:");
2986
      sb.append(this.application_id);
2987
      first = false;
2988
      if (!first) sb.append(", ");
2989
      sb.append("callback_url:");
2990
      if (this.callback_url == null) {
2991
        sb.append("null");
2992
      } else {
2993
        sb.append(this.callback_url);
2994
      }
2995
      first = false;
2996
      if (!first) sb.append(", ");
2997
      sb.append("updateIfExisting:");
2998
      sb.append(this.updateIfExisting);
2999
      first = false;
3000
      sb.append(")");
3001
      return sb.toString();
3002
    }
3003
 
3004
    public void validate() throws TException {
3005
      // check for required fields
3006
    }
3007
 
3008
  }
3009
 
3010
  public static class addCallbackUrl_result implements TBase<addCallbackUrl_result._Fields>, java.io.Serializable, Cloneable, Comparable<addCallbackUrl_result>   {
3011
    private static final TStruct STRUCT_DESC = new TStruct("addCallbackUrl_result");
3012
 
3013
    private static final TField PE_FIELD_DESC = new TField("pe", TType.STRUCT, (short)1);
3014
 
3015
    private PaymentException pe;
3016
 
3017
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3018
    public enum _Fields implements TFieldIdEnum {
3019
      PE((short)1, "pe");
3020
 
3021
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
3022
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3023
 
3024
      static {
3025
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3026
          byId.put((int)field._thriftId, field);
3027
          byName.put(field.getFieldName(), field);
3028
        }
3029
      }
3030
 
3031
      /**
3032
       * Find the _Fields constant that matches fieldId, or null if its not found.
3033
       */
3034
      public static _Fields findByThriftId(int fieldId) {
3035
        return byId.get(fieldId);
3036
      }
3037
 
3038
      /**
3039
       * Find the _Fields constant that matches fieldId, throwing an exception
3040
       * if it is not found.
3041
       */
3042
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3043
        _Fields fields = findByThriftId(fieldId);
3044
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3045
        return fields;
3046
      }
3047
 
3048
      /**
3049
       * Find the _Fields constant that matches name, or null if its not found.
3050
       */
3051
      public static _Fields findByName(String name) {
3052
        return byName.get(name);
3053
      }
3054
 
3055
      private final short _thriftId;
3056
      private final String _fieldName;
3057
 
3058
      _Fields(short thriftId, String fieldName) {
3059
        _thriftId = thriftId;
3060
        _fieldName = fieldName;
3061
      }
3062
 
3063
      public short getThriftFieldId() {
3064
        return _thriftId;
3065
      }
3066
 
3067
      public String getFieldName() {
3068
        return _fieldName;
3069
      }
3070
    }
3071
 
3072
    // isset id assignments
3073
 
3074
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
3075
      put(_Fields.PE, new FieldMetaData("pe", TFieldRequirementType.DEFAULT, 
3076
          new FieldValueMetaData(TType.STRUCT)));
3077
    }});
3078
 
3079
    static {
3080
      FieldMetaData.addStructMetaDataMap(addCallbackUrl_result.class, metaDataMap);
3081
    }
3082
 
3083
    public addCallbackUrl_result() {
3084
    }
3085
 
3086
    public addCallbackUrl_result(
3087
      PaymentException pe)
3088
    {
3089
      this();
3090
      this.pe = pe;
3091
    }
3092
 
3093
    /**
3094
     * Performs a deep copy on <i>other</i>.
3095
     */
3096
    public addCallbackUrl_result(addCallbackUrl_result other) {
3097
      if (other.isSetPe()) {
3098
        this.pe = new PaymentException(other.pe);
3099
      }
3100
    }
3101
 
3102
    public addCallbackUrl_result deepCopy() {
3103
      return new addCallbackUrl_result(this);
3104
    }
3105
 
3106
    @Deprecated
3107
    public addCallbackUrl_result clone() {
3108
      return new addCallbackUrl_result(this);
3109
    }
3110
 
3111
    public PaymentException getPe() {
3112
      return this.pe;
3113
    }
3114
 
3115
    public addCallbackUrl_result setPe(PaymentException pe) {
3116
      this.pe = pe;
3117
      return this;
3118
    }
3119
 
3120
    public void unsetPe() {
3121
      this.pe = null;
3122
    }
3123
 
3124
    /** Returns true if field pe is set (has been asigned a value) and false otherwise */
3125
    public boolean isSetPe() {
3126
      return this.pe != null;
3127
    }
3128
 
3129
    public void setPeIsSet(boolean value) {
3130
      if (!value) {
3131
        this.pe = null;
3132
      }
3133
    }
3134
 
3135
    public void setFieldValue(_Fields field, Object value) {
3136
      switch (field) {
3137
      case PE:
3138
        if (value == null) {
3139
          unsetPe();
3140
        } else {
3141
          setPe((PaymentException)value);
3142
        }
3143
        break;
3144
 
3145
      }
3146
    }
3147
 
3148
    public void setFieldValue(int fieldID, Object value) {
3149
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
3150
    }
3151
 
3152
    public Object getFieldValue(_Fields field) {
3153
      switch (field) {
3154
      case PE:
3155
        return getPe();
3156
 
3157
      }
3158
      throw new IllegalStateException();
3159
    }
3160
 
3161
    public Object getFieldValue(int fieldId) {
3162
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
3163
    }
3164
 
3165
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
3166
    public boolean isSet(_Fields field) {
3167
      switch (field) {
3168
      case PE:
3169
        return isSetPe();
3170
      }
3171
      throw new IllegalStateException();
3172
    }
3173
 
3174
    public boolean isSet(int fieldID) {
3175
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
3176
    }
3177
 
3178
    @Override
3179
    public boolean equals(Object that) {
3180
      if (that == null)
3181
        return false;
3182
      if (that instanceof addCallbackUrl_result)
3183
        return this.equals((addCallbackUrl_result)that);
3184
      return false;
3185
    }
3186
 
3187
    public boolean equals(addCallbackUrl_result that) {
3188
      if (that == null)
3189
        return false;
3190
 
3191
      boolean this_present_pe = true && this.isSetPe();
3192
      boolean that_present_pe = true && that.isSetPe();
3193
      if (this_present_pe || that_present_pe) {
3194
        if (!(this_present_pe && that_present_pe))
3195
          return false;
3196
        if (!this.pe.equals(that.pe))
3197
          return false;
3198
      }
3199
 
3200
      return true;
3201
    }
3202
 
3203
    @Override
3204
    public int hashCode() {
3205
      return 0;
3206
    }
3207
 
3208
    public int compareTo(addCallbackUrl_result other) {
3209
      if (!getClass().equals(other.getClass())) {
3210
        return getClass().getName().compareTo(other.getClass().getName());
3211
      }
3212
 
3213
      int lastComparison = 0;
3214
      addCallbackUrl_result typedOther = (addCallbackUrl_result)other;
3215
 
3216
      lastComparison = Boolean.valueOf(isSetPe()).compareTo(isSetPe());
3217
      if (lastComparison != 0) {
3218
        return lastComparison;
3219
      }
3220
      lastComparison = TBaseHelper.compareTo(pe, typedOther.pe);
3221
      if (lastComparison != 0) {
3222
        return lastComparison;
3223
      }
3224
      return 0;
3225
    }
3226
 
3227
    public void read(TProtocol iprot) throws TException {
3228
      TField field;
3229
      iprot.readStructBegin();
3230
      while (true)
3231
      {
3232
        field = iprot.readFieldBegin();
3233
        if (field.type == TType.STOP) { 
3234
          break;
3235
        }
3236
        _Fields fieldId = _Fields.findByThriftId(field.id);
3237
        if (fieldId == null) {
3238
          TProtocolUtil.skip(iprot, field.type);
3239
        } else {
3240
          switch (fieldId) {
3241
            case PE:
3242
              if (field.type == TType.STRUCT) {
3243
                this.pe = new PaymentException();
3244
                this.pe.read(iprot);
3245
              } else { 
3246
                TProtocolUtil.skip(iprot, field.type);
3247
              }
3248
              break;
3249
          }
3250
          iprot.readFieldEnd();
3251
        }
3252
      }
3253
      iprot.readStructEnd();
3254
      validate();
3255
    }
3256
 
3257
    public void write(TProtocol oprot) throws TException {
3258
      oprot.writeStructBegin(STRUCT_DESC);
3259
 
3260
      if (this.isSetPe()) {
3261
        oprot.writeFieldBegin(PE_FIELD_DESC);
3262
        this.pe.write(oprot);
3263
        oprot.writeFieldEnd();
3264
      }
3265
      oprot.writeFieldStop();
3266
      oprot.writeStructEnd();
3267
    }
3268
 
3269
    @Override
3270
    public String toString() {
3271
      StringBuilder sb = new StringBuilder("addCallbackUrl_result(");
3272
      boolean first = true;
3273
 
3274
      sb.append("pe:");
3275
      if (this.pe == null) {
3276
        sb.append("null");
3277
      } else {
3278
        sb.append(this.pe);
3279
      }
3280
      first = false;
3281
      sb.append(")");
3282
      return sb.toString();
3283
    }
3284
 
3285
    public void validate() throws TException {
3286
      // check for required fields
3287
    }
3288
 
3289
  }
3290
 
3291
  public static class getCallbackUrl_args implements TBase<getCallbackUrl_args._Fields>, java.io.Serializable, Cloneable, Comparable<getCallbackUrl_args>   {
3292
    private static final TStruct STRUCT_DESC = new TStruct("getCallbackUrl_args");
3293
 
3294
    private static final TField APPLICATION_ID_FIELD_DESC = new TField("application_id", TType.I64, (short)1);
3295
 
3296
    private long application_id;
3297
 
3298
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3299
    public enum _Fields implements TFieldIdEnum {
3300
      APPLICATION_ID((short)1, "application_id");
3301
 
3302
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
3303
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3304
 
3305
      static {
3306
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3307
          byId.put((int)field._thriftId, field);
3308
          byName.put(field.getFieldName(), field);
3309
        }
3310
      }
3311
 
3312
      /**
3313
       * Find the _Fields constant that matches fieldId, or null if its not found.
3314
       */
3315
      public static _Fields findByThriftId(int fieldId) {
3316
        return byId.get(fieldId);
3317
      }
3318
 
3319
      /**
3320
       * Find the _Fields constant that matches fieldId, throwing an exception
3321
       * if it is not found.
3322
       */
3323
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3324
        _Fields fields = findByThriftId(fieldId);
3325
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3326
        return fields;
3327
      }
3328
 
3329
      /**
3330
       * Find the _Fields constant that matches name, or null if its not found.
3331
       */
3332
      public static _Fields findByName(String name) {
3333
        return byName.get(name);
3334
      }
3335
 
3336
      private final short _thriftId;
3337
      private final String _fieldName;
3338
 
3339
      _Fields(short thriftId, String fieldName) {
3340
        _thriftId = thriftId;
3341
        _fieldName = fieldName;
3342
      }
3343
 
3344
      public short getThriftFieldId() {
3345
        return _thriftId;
3346
      }
3347
 
3348
      public String getFieldName() {
3349
        return _fieldName;
3350
      }
3351
    }
3352
 
3353
    // isset id assignments
3354
    private static final int __APPLICATION_ID_ISSET_ID = 0;
3355
    private BitSet __isset_bit_vector = new BitSet(1);
3356
 
3357
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
3358
      put(_Fields.APPLICATION_ID, new FieldMetaData("application_id", TFieldRequirementType.DEFAULT, 
3359
          new FieldValueMetaData(TType.I64)));
3360
    }});
3361
 
3362
    static {
3363
      FieldMetaData.addStructMetaDataMap(getCallbackUrl_args.class, metaDataMap);
3364
    }
3365
 
3366
    public getCallbackUrl_args() {
3367
    }
3368
 
3369
    public getCallbackUrl_args(
3370
      long application_id)
3371
    {
3372
      this();
3373
      this.application_id = application_id;
3374
      setApplication_idIsSet(true);
3375
    }
3376
 
3377
    /**
3378
     * Performs a deep copy on <i>other</i>.
3379
     */
3380
    public getCallbackUrl_args(getCallbackUrl_args other) {
3381
      __isset_bit_vector.clear();
3382
      __isset_bit_vector.or(other.__isset_bit_vector);
3383
      this.application_id = other.application_id;
3384
    }
3385
 
3386
    public getCallbackUrl_args deepCopy() {
3387
      return new getCallbackUrl_args(this);
3388
    }
3389
 
3390
    @Deprecated
3391
    public getCallbackUrl_args clone() {
3392
      return new getCallbackUrl_args(this);
3393
    }
3394
 
3395
    public long getApplication_id() {
3396
      return this.application_id;
3397
    }
3398
 
3399
    public getCallbackUrl_args setApplication_id(long application_id) {
3400
      this.application_id = application_id;
3401
      setApplication_idIsSet(true);
3402
      return this;
3403
    }
3404
 
3405
    public void unsetApplication_id() {
3406
      __isset_bit_vector.clear(__APPLICATION_ID_ISSET_ID);
3407
    }
3408
 
3409
    /** Returns true if field application_id is set (has been asigned a value) and false otherwise */
3410
    public boolean isSetApplication_id() {
3411
      return __isset_bit_vector.get(__APPLICATION_ID_ISSET_ID);
3412
    }
3413
 
3414
    public void setApplication_idIsSet(boolean value) {
3415
      __isset_bit_vector.set(__APPLICATION_ID_ISSET_ID, value);
3416
    }
3417
 
3418
    public void setFieldValue(_Fields field, Object value) {
3419
      switch (field) {
3420
      case APPLICATION_ID:
3421
        if (value == null) {
3422
          unsetApplication_id();
3423
        } else {
3424
          setApplication_id((Long)value);
3425
        }
3426
        break;
3427
 
3428
      }
3429
    }
3430
 
3431
    public void setFieldValue(int fieldID, Object value) {
3432
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
3433
    }
3434
 
3435
    public Object getFieldValue(_Fields field) {
3436
      switch (field) {
3437
      case APPLICATION_ID:
3438
        return new Long(getApplication_id());
3439
 
3440
      }
3441
      throw new IllegalStateException();
3442
    }
3443
 
3444
    public Object getFieldValue(int fieldId) {
3445
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
3446
    }
3447
 
3448
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
3449
    public boolean isSet(_Fields field) {
3450
      switch (field) {
3451
      case APPLICATION_ID:
3452
        return isSetApplication_id();
3453
      }
3454
      throw new IllegalStateException();
3455
    }
3456
 
3457
    public boolean isSet(int fieldID) {
3458
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
3459
    }
3460
 
3461
    @Override
3462
    public boolean equals(Object that) {
3463
      if (that == null)
3464
        return false;
3465
      if (that instanceof getCallbackUrl_args)
3466
        return this.equals((getCallbackUrl_args)that);
3467
      return false;
3468
    }
3469
 
3470
    public boolean equals(getCallbackUrl_args that) {
3471
      if (that == null)
3472
        return false;
3473
 
3474
      boolean this_present_application_id = true;
3475
      boolean that_present_application_id = true;
3476
      if (this_present_application_id || that_present_application_id) {
3477
        if (!(this_present_application_id && that_present_application_id))
3478
          return false;
3479
        if (this.application_id != that.application_id)
3480
          return false;
3481
      }
3482
 
3483
      return true;
3484
    }
3485
 
3486
    @Override
3487
    public int hashCode() {
3488
      return 0;
3489
    }
3490
 
3491
    public int compareTo(getCallbackUrl_args other) {
3492
      if (!getClass().equals(other.getClass())) {
3493
        return getClass().getName().compareTo(other.getClass().getName());
3494
      }
3495
 
3496
      int lastComparison = 0;
3497
      getCallbackUrl_args typedOther = (getCallbackUrl_args)other;
3498
 
3499
      lastComparison = Boolean.valueOf(isSetApplication_id()).compareTo(isSetApplication_id());
3500
      if (lastComparison != 0) {
3501
        return lastComparison;
3502
      }
3503
      lastComparison = TBaseHelper.compareTo(application_id, typedOther.application_id);
3504
      if (lastComparison != 0) {
3505
        return lastComparison;
3506
      }
3507
      return 0;
3508
    }
3509
 
3510
    public void read(TProtocol iprot) throws TException {
3511
      TField field;
3512
      iprot.readStructBegin();
3513
      while (true)
3514
      {
3515
        field = iprot.readFieldBegin();
3516
        if (field.type == TType.STOP) { 
3517
          break;
3518
        }
3519
        _Fields fieldId = _Fields.findByThriftId(field.id);
3520
        if (fieldId == null) {
3521
          TProtocolUtil.skip(iprot, field.type);
3522
        } else {
3523
          switch (fieldId) {
3524
            case APPLICATION_ID:
3525
              if (field.type == TType.I64) {
3526
                this.application_id = iprot.readI64();
3527
                setApplication_idIsSet(true);
3528
              } else { 
3529
                TProtocolUtil.skip(iprot, field.type);
3530
              }
3531
              break;
3532
          }
3533
          iprot.readFieldEnd();
3534
        }
3535
      }
3536
      iprot.readStructEnd();
3537
      validate();
3538
    }
3539
 
3540
    public void write(TProtocol oprot) throws TException {
3541
      validate();
3542
 
3543
      oprot.writeStructBegin(STRUCT_DESC);
3544
      oprot.writeFieldBegin(APPLICATION_ID_FIELD_DESC);
3545
      oprot.writeI64(this.application_id);
3546
      oprot.writeFieldEnd();
3547
      oprot.writeFieldStop();
3548
      oprot.writeStructEnd();
3549
    }
3550
 
3551
    @Override
3552
    public String toString() {
3553
      StringBuilder sb = new StringBuilder("getCallbackUrl_args(");
3554
      boolean first = true;
3555
 
3556
      sb.append("application_id:");
3557
      sb.append(this.application_id);
3558
      first = false;
3559
      sb.append(")");
3560
      return sb.toString();
3561
    }
3562
 
3563
    public void validate() throws TException {
3564
      // check for required fields
3565
    }
3566
 
3567
  }
3568
 
3569
  public static class getCallbackUrl_result implements TBase<getCallbackUrl_result._Fields>, java.io.Serializable, Cloneable, Comparable<getCallbackUrl_result>   {
3570
    private static final TStruct STRUCT_DESC = new TStruct("getCallbackUrl_result");
3571
 
3572
    private static final TField PE_FIELD_DESC = new TField("pe", TType.STRUCT, (short)1);
3573
 
3574
    private PaymentException pe;
3575
 
3576
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3577
    public enum _Fields implements TFieldIdEnum {
3578
      PE((short)1, "pe");
3579
 
3580
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
3581
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3582
 
3583
      static {
3584
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3585
          byId.put((int)field._thriftId, field);
3586
          byName.put(field.getFieldName(), field);
3587
        }
3588
      }
3589
 
3590
      /**
3591
       * Find the _Fields constant that matches fieldId, or null if its not found.
3592
       */
3593
      public static _Fields findByThriftId(int fieldId) {
3594
        return byId.get(fieldId);
3595
      }
3596
 
3597
      /**
3598
       * Find the _Fields constant that matches fieldId, throwing an exception
3599
       * if it is not found.
3600
       */
3601
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3602
        _Fields fields = findByThriftId(fieldId);
3603
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3604
        return fields;
3605
      }
3606
 
3607
      /**
3608
       * Find the _Fields constant that matches name, or null if its not found.
3609
       */
3610
      public static _Fields findByName(String name) {
3611
        return byName.get(name);
3612
      }
3613
 
3614
      private final short _thriftId;
3615
      private final String _fieldName;
3616
 
3617
      _Fields(short thriftId, String fieldName) {
3618
        _thriftId = thriftId;
3619
        _fieldName = fieldName;
3620
      }
3621
 
3622
      public short getThriftFieldId() {
3623
        return _thriftId;
3624
      }
3625
 
3626
      public String getFieldName() {
3627
        return _fieldName;
3628
      }
3629
    }
3630
 
3631
    // isset id assignments
3632
 
3633
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
3634
      put(_Fields.PE, new FieldMetaData("pe", TFieldRequirementType.DEFAULT, 
3635
          new FieldValueMetaData(TType.STRUCT)));
3636
    }});
3637
 
3638
    static {
3639
      FieldMetaData.addStructMetaDataMap(getCallbackUrl_result.class, metaDataMap);
3640
    }
3641
 
3642
    public getCallbackUrl_result() {
3643
    }
3644
 
3645
    public getCallbackUrl_result(
3646
      PaymentException pe)
3647
    {
3648
      this();
3649
      this.pe = pe;
3650
    }
3651
 
3652
    /**
3653
     * Performs a deep copy on <i>other</i>.
3654
     */
3655
    public getCallbackUrl_result(getCallbackUrl_result other) {
3656
      if (other.isSetPe()) {
3657
        this.pe = new PaymentException(other.pe);
3658
      }
3659
    }
3660
 
3661
    public getCallbackUrl_result deepCopy() {
3662
      return new getCallbackUrl_result(this);
3663
    }
3664
 
3665
    @Deprecated
3666
    public getCallbackUrl_result clone() {
3667
      return new getCallbackUrl_result(this);
3668
    }
3669
 
3670
    public PaymentException getPe() {
3671
      return this.pe;
3672
    }
3673
 
3674
    public getCallbackUrl_result setPe(PaymentException pe) {
3675
      this.pe = pe;
3676
      return this;
3677
    }
3678
 
3679
    public void unsetPe() {
3680
      this.pe = null;
3681
    }
3682
 
3683
    /** Returns true if field pe is set (has been asigned a value) and false otherwise */
3684
    public boolean isSetPe() {
3685
      return this.pe != null;
3686
    }
3687
 
3688
    public void setPeIsSet(boolean value) {
3689
      if (!value) {
3690
        this.pe = null;
3691
      }
3692
    }
3693
 
3694
    public void setFieldValue(_Fields field, Object value) {
3695
      switch (field) {
3696
      case PE:
3697
        if (value == null) {
3698
          unsetPe();
3699
        } else {
3700
          setPe((PaymentException)value);
3701
        }
3702
        break;
3703
 
3704
      }
3705
    }
3706
 
3707
    public void setFieldValue(int fieldID, Object value) {
3708
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
3709
    }
3710
 
3711
    public Object getFieldValue(_Fields field) {
3712
      switch (field) {
3713
      case PE:
3714
        return getPe();
3715
 
3716
      }
3717
      throw new IllegalStateException();
3718
    }
3719
 
3720
    public Object getFieldValue(int fieldId) {
3721
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
3722
    }
3723
 
3724
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
3725
    public boolean isSet(_Fields field) {
3726
      switch (field) {
3727
      case PE:
3728
        return isSetPe();
3729
      }
3730
      throw new IllegalStateException();
3731
    }
3732
 
3733
    public boolean isSet(int fieldID) {
3734
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
3735
    }
3736
 
3737
    @Override
3738
    public boolean equals(Object that) {
3739
      if (that == null)
3740
        return false;
3741
      if (that instanceof getCallbackUrl_result)
3742
        return this.equals((getCallbackUrl_result)that);
3743
      return false;
3744
    }
3745
 
3746
    public boolean equals(getCallbackUrl_result that) {
3747
      if (that == null)
3748
        return false;
3749
 
3750
      boolean this_present_pe = true && this.isSetPe();
3751
      boolean that_present_pe = true && that.isSetPe();
3752
      if (this_present_pe || that_present_pe) {
3753
        if (!(this_present_pe && that_present_pe))
3754
          return false;
3755
        if (!this.pe.equals(that.pe))
3756
          return false;
3757
      }
3758
 
3759
      return true;
3760
    }
3761
 
3762
    @Override
3763
    public int hashCode() {
3764
      return 0;
3765
    }
3766
 
3767
    public int compareTo(getCallbackUrl_result other) {
3768
      if (!getClass().equals(other.getClass())) {
3769
        return getClass().getName().compareTo(other.getClass().getName());
3770
      }
3771
 
3772
      int lastComparison = 0;
3773
      getCallbackUrl_result typedOther = (getCallbackUrl_result)other;
3774
 
3775
      lastComparison = Boolean.valueOf(isSetPe()).compareTo(isSetPe());
3776
      if (lastComparison != 0) {
3777
        return lastComparison;
3778
      }
3779
      lastComparison = TBaseHelper.compareTo(pe, typedOther.pe);
3780
      if (lastComparison != 0) {
3781
        return lastComparison;
3782
      }
3783
      return 0;
3784
    }
3785
 
3786
    public void read(TProtocol iprot) throws TException {
3787
      TField field;
3788
      iprot.readStructBegin();
3789
      while (true)
3790
      {
3791
        field = iprot.readFieldBegin();
3792
        if (field.type == TType.STOP) { 
3793
          break;
3794
        }
3795
        _Fields fieldId = _Fields.findByThriftId(field.id);
3796
        if (fieldId == null) {
3797
          TProtocolUtil.skip(iprot, field.type);
3798
        } else {
3799
          switch (fieldId) {
3800
            case PE:
3801
              if (field.type == TType.STRUCT) {
3802
                this.pe = new PaymentException();
3803
                this.pe.read(iprot);
3804
              } else { 
3805
                TProtocolUtil.skip(iprot, field.type);
3806
              }
3807
              break;
3808
          }
3809
          iprot.readFieldEnd();
3810
        }
3811
      }
3812
      iprot.readStructEnd();
3813
      validate();
3814
    }
3815
 
3816
    public void write(TProtocol oprot) throws TException {
3817
      oprot.writeStructBegin(STRUCT_DESC);
3818
 
3819
      if (this.isSetPe()) {
3820
        oprot.writeFieldBegin(PE_FIELD_DESC);
3821
        this.pe.write(oprot);
3822
        oprot.writeFieldEnd();
3823
      }
3824
      oprot.writeFieldStop();
3825
      oprot.writeStructEnd();
3826
    }
3827
 
3828
    @Override
3829
    public String toString() {
3830
      StringBuilder sb = new StringBuilder("getCallbackUrl_result(");
3831
      boolean first = true;
3832
 
3833
      sb.append("pe:");
3834
      if (this.pe == null) {
3835
        sb.append("null");
3836
      } else {
3837
        sb.append(this.pe);
3838
      }
3839
      first = false;
3840
      sb.append(")");
3841
      return sb.toString();
3842
    }
3843
 
3844
    public void validate() throws TException {
3845
      // check for required fields
3846
    }
3847
 
3848
  }
3849
 
3850
  public static class getPaymentsForUser_args implements TBase<getPaymentsForUser_args._Fields>, java.io.Serializable, Cloneable, Comparable<getPaymentsForUser_args>   {
3851
    private static final TStruct STRUCT_DESC = new TStruct("getPaymentsForUser_args");
3852
 
3853
    private static final TField USER_ID_FIELD_DESC = new TField("userId", TType.I64, (short)1);
3854
    private static final TField FROM_TIME_FIELD_DESC = new TField("from_time", TType.I64, (short)2);
3855
    private static final TField TO_TIME_FIELD_DESC = new TField("to_time", TType.I64, (short)3);
3856
    private static final TField STATUS_FIELD_DESC = new TField("status", TType.I32, (short)4);
3857
    private static final TField GATEWAY_FIELD_DESC = new TField("gateway", TType.I32, (short)5);
3858
 
3859
    private long userId;
3860
    private long from_time;
3861
    private long to_time;
3862
    private PaymentStatus status;
3863
    private PaymentGateway gateway;
3864
 
3865
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3866
    public enum _Fields implements TFieldIdEnum {
3867
      USER_ID((short)1, "userId"),
3868
      FROM_TIME((short)2, "from_time"),
3869
      TO_TIME((short)3, "to_time"),
3870
      /**
3871
       * 
3872
       * @see PaymentStatus
3873
       */
3874
      STATUS((short)4, "status"),
3875
      /**
3876
       * 
3877
       * @see PaymentGateway
3878
       */
3879
      GATEWAY((short)5, "gateway");
3880
 
3881
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
3882
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3883
 
3884
      static {
3885
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3886
          byId.put((int)field._thriftId, field);
3887
          byName.put(field.getFieldName(), field);
3888
        }
3889
      }
3890
 
3891
      /**
3892
       * Find the _Fields constant that matches fieldId, or null if its not found.
3893
       */
3894
      public static _Fields findByThriftId(int fieldId) {
3895
        return byId.get(fieldId);
3896
      }
3897
 
3898
      /**
3899
       * Find the _Fields constant that matches fieldId, throwing an exception
3900
       * if it is not found.
3901
       */
3902
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3903
        _Fields fields = findByThriftId(fieldId);
3904
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3905
        return fields;
3906
      }
3907
 
3908
      /**
3909
       * Find the _Fields constant that matches name, or null if its not found.
3910
       */
3911
      public static _Fields findByName(String name) {
3912
        return byName.get(name);
3913
      }
3914
 
3915
      private final short _thriftId;
3916
      private final String _fieldName;
3917
 
3918
      _Fields(short thriftId, String fieldName) {
3919
        _thriftId = thriftId;
3920
        _fieldName = fieldName;
3921
      }
3922
 
3923
      public short getThriftFieldId() {
3924
        return _thriftId;
3925
      }
3926
 
3927
      public String getFieldName() {
3928
        return _fieldName;
3929
      }
3930
    }
3931
 
3932
    // isset id assignments
3933
    private static final int __USERID_ISSET_ID = 0;
3934
    private static final int __FROM_TIME_ISSET_ID = 1;
3935
    private static final int __TO_TIME_ISSET_ID = 2;
3936
    private BitSet __isset_bit_vector = new BitSet(3);
3937
 
3938
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
3939
      put(_Fields.USER_ID, new FieldMetaData("userId", TFieldRequirementType.DEFAULT, 
3940
          new FieldValueMetaData(TType.I64)));
3941
      put(_Fields.FROM_TIME, new FieldMetaData("from_time", TFieldRequirementType.DEFAULT, 
3942
          new FieldValueMetaData(TType.I64)));
3943
      put(_Fields.TO_TIME, new FieldMetaData("to_time", TFieldRequirementType.DEFAULT, 
3944
          new FieldValueMetaData(TType.I64)));
3945
      put(_Fields.STATUS, new FieldMetaData("status", TFieldRequirementType.DEFAULT, 
3946
          new EnumMetaData(TType.ENUM, PaymentStatus.class)));
3947
      put(_Fields.GATEWAY, new FieldMetaData("gateway", TFieldRequirementType.DEFAULT, 
3948
          new EnumMetaData(TType.ENUM, PaymentGateway.class)));
3949
    }});
3950
 
3951
    static {
3952
      FieldMetaData.addStructMetaDataMap(getPaymentsForUser_args.class, metaDataMap);
3953
    }
3954
 
3955
    public getPaymentsForUser_args() {
3956
    }
3957
 
3958
    public getPaymentsForUser_args(
3959
      long userId,
3960
      long from_time,
3961
      long to_time,
3962
      PaymentStatus status,
3963
      PaymentGateway gateway)
3964
    {
3965
      this();
3966
      this.userId = userId;
3967
      setUserIdIsSet(true);
3968
      this.from_time = from_time;
3969
      setFrom_timeIsSet(true);
3970
      this.to_time = to_time;
3971
      setTo_timeIsSet(true);
3972
      this.status = status;
3973
      this.gateway = gateway;
3974
    }
3975
 
3976
    /**
3977
     * Performs a deep copy on <i>other</i>.
3978
     */
3979
    public getPaymentsForUser_args(getPaymentsForUser_args other) {
3980
      __isset_bit_vector.clear();
3981
      __isset_bit_vector.or(other.__isset_bit_vector);
3982
      this.userId = other.userId;
3983
      this.from_time = other.from_time;
3984
      this.to_time = other.to_time;
3985
      if (other.isSetStatus()) {
3986
        this.status = other.status;
3987
      }
3988
      if (other.isSetGateway()) {
3989
        this.gateway = other.gateway;
3990
      }
3991
    }
3992
 
3993
    public getPaymentsForUser_args deepCopy() {
3994
      return new getPaymentsForUser_args(this);
3995
    }
3996
 
3997
    @Deprecated
3998
    public getPaymentsForUser_args clone() {
3999
      return new getPaymentsForUser_args(this);
4000
    }
4001
 
4002
    public long getUserId() {
4003
      return this.userId;
4004
    }
4005
 
4006
    public getPaymentsForUser_args setUserId(long userId) {
4007
      this.userId = userId;
4008
      setUserIdIsSet(true);
4009
      return this;
4010
    }
4011
 
4012
    public void unsetUserId() {
4013
      __isset_bit_vector.clear(__USERID_ISSET_ID);
4014
    }
4015
 
4016
    /** Returns true if field userId is set (has been asigned a value) and false otherwise */
4017
    public boolean isSetUserId() {
4018
      return __isset_bit_vector.get(__USERID_ISSET_ID);
4019
    }
4020
 
4021
    public void setUserIdIsSet(boolean value) {
4022
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
4023
    }
4024
 
4025
    public long getFrom_time() {
4026
      return this.from_time;
4027
    }
4028
 
4029
    public getPaymentsForUser_args setFrom_time(long from_time) {
4030
      this.from_time = from_time;
4031
      setFrom_timeIsSet(true);
4032
      return this;
4033
    }
4034
 
4035
    public void unsetFrom_time() {
4036
      __isset_bit_vector.clear(__FROM_TIME_ISSET_ID);
4037
    }
4038
 
4039
    /** Returns true if field from_time is set (has been asigned a value) and false otherwise */
4040
    public boolean isSetFrom_time() {
4041
      return __isset_bit_vector.get(__FROM_TIME_ISSET_ID);
4042
    }
4043
 
4044
    public void setFrom_timeIsSet(boolean value) {
4045
      __isset_bit_vector.set(__FROM_TIME_ISSET_ID, value);
4046
    }
4047
 
4048
    public long getTo_time() {
4049
      return this.to_time;
4050
    }
4051
 
4052
    public getPaymentsForUser_args setTo_time(long to_time) {
4053
      this.to_time = to_time;
4054
      setTo_timeIsSet(true);
4055
      return this;
4056
    }
4057
 
4058
    public void unsetTo_time() {
4059
      __isset_bit_vector.clear(__TO_TIME_ISSET_ID);
4060
    }
4061
 
4062
    /** Returns true if field to_time is set (has been asigned a value) and false otherwise */
4063
    public boolean isSetTo_time() {
4064
      return __isset_bit_vector.get(__TO_TIME_ISSET_ID);
4065
    }
4066
 
4067
    public void setTo_timeIsSet(boolean value) {
4068
      __isset_bit_vector.set(__TO_TIME_ISSET_ID, value);
4069
    }
4070
 
4071
    /**
4072
     * 
4073
     * @see PaymentStatus
4074
     */
4075
    public PaymentStatus getStatus() {
4076
      return this.status;
4077
    }
4078
 
4079
    /**
4080
     * 
4081
     * @see PaymentStatus
4082
     */
4083
    public getPaymentsForUser_args setStatus(PaymentStatus status) {
4084
      this.status = status;
4085
      return this;
4086
    }
4087
 
4088
    public void unsetStatus() {
4089
      this.status = null;
4090
    }
4091
 
4092
    /** Returns true if field status is set (has been asigned a value) and false otherwise */
4093
    public boolean isSetStatus() {
4094
      return this.status != null;
4095
    }
4096
 
4097
    public void setStatusIsSet(boolean value) {
4098
      if (!value) {
4099
        this.status = null;
4100
      }
4101
    }
4102
 
4103
    /**
4104
     * 
4105
     * @see PaymentGateway
4106
     */
4107
    public PaymentGateway getGateway() {
4108
      return this.gateway;
4109
    }
4110
 
4111
    /**
4112
     * 
4113
     * @see PaymentGateway
4114
     */
4115
    public getPaymentsForUser_args setGateway(PaymentGateway gateway) {
4116
      this.gateway = gateway;
4117
      return this;
4118
    }
4119
 
4120
    public void unsetGateway() {
4121
      this.gateway = null;
4122
    }
4123
 
4124
    /** Returns true if field gateway is set (has been asigned a value) and false otherwise */
4125
    public boolean isSetGateway() {
4126
      return this.gateway != null;
4127
    }
4128
 
4129
    public void setGatewayIsSet(boolean value) {
4130
      if (!value) {
4131
        this.gateway = null;
4132
      }
4133
    }
4134
 
4135
    public void setFieldValue(_Fields field, Object value) {
4136
      switch (field) {
4137
      case USER_ID:
4138
        if (value == null) {
4139
          unsetUserId();
4140
        } else {
4141
          setUserId((Long)value);
4142
        }
4143
        break;
4144
 
4145
      case FROM_TIME:
4146
        if (value == null) {
4147
          unsetFrom_time();
4148
        } else {
4149
          setFrom_time((Long)value);
4150
        }
4151
        break;
4152
 
4153
      case TO_TIME:
4154
        if (value == null) {
4155
          unsetTo_time();
4156
        } else {
4157
          setTo_time((Long)value);
4158
        }
4159
        break;
4160
 
4161
      case STATUS:
4162
        if (value == null) {
4163
          unsetStatus();
4164
        } else {
4165
          setStatus((PaymentStatus)value);
4166
        }
4167
        break;
4168
 
4169
      case GATEWAY:
4170
        if (value == null) {
4171
          unsetGateway();
4172
        } else {
4173
          setGateway((PaymentGateway)value);
4174
        }
4175
        break;
4176
 
4177
      }
4178
    }
4179
 
4180
    public void setFieldValue(int fieldID, Object value) {
4181
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
4182
    }
4183
 
4184
    public Object getFieldValue(_Fields field) {
4185
      switch (field) {
4186
      case USER_ID:
4187
        return new Long(getUserId());
4188
 
4189
      case FROM_TIME:
4190
        return new Long(getFrom_time());
4191
 
4192
      case TO_TIME:
4193
        return new Long(getTo_time());
4194
 
4195
      case STATUS:
4196
        return getStatus();
4197
 
4198
      case GATEWAY:
4199
        return getGateway();
4200
 
4201
      }
4202
      throw new IllegalStateException();
4203
    }
4204
 
4205
    public Object getFieldValue(int fieldId) {
4206
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
4207
    }
4208
 
4209
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
4210
    public boolean isSet(_Fields field) {
4211
      switch (field) {
4212
      case USER_ID:
4213
        return isSetUserId();
4214
      case FROM_TIME:
4215
        return isSetFrom_time();
4216
      case TO_TIME:
4217
        return isSetTo_time();
4218
      case STATUS:
4219
        return isSetStatus();
4220
      case GATEWAY:
4221
        return isSetGateway();
4222
      }
4223
      throw new IllegalStateException();
4224
    }
4225
 
4226
    public boolean isSet(int fieldID) {
4227
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
4228
    }
4229
 
4230
    @Override
4231
    public boolean equals(Object that) {
4232
      if (that == null)
4233
        return false;
4234
      if (that instanceof getPaymentsForUser_args)
4235
        return this.equals((getPaymentsForUser_args)that);
4236
      return false;
4237
    }
4238
 
4239
    public boolean equals(getPaymentsForUser_args that) {
4240
      if (that == null)
4241
        return false;
4242
 
4243
      boolean this_present_userId = true;
4244
      boolean that_present_userId = true;
4245
      if (this_present_userId || that_present_userId) {
4246
        if (!(this_present_userId && that_present_userId))
4247
          return false;
4248
        if (this.userId != that.userId)
4249
          return false;
4250
      }
4251
 
4252
      boolean this_present_from_time = true;
4253
      boolean that_present_from_time = true;
4254
      if (this_present_from_time || that_present_from_time) {
4255
        if (!(this_present_from_time && that_present_from_time))
4256
          return false;
4257
        if (this.from_time != that.from_time)
4258
          return false;
4259
      }
4260
 
4261
      boolean this_present_to_time = true;
4262
      boolean that_present_to_time = true;
4263
      if (this_present_to_time || that_present_to_time) {
4264
        if (!(this_present_to_time && that_present_to_time))
4265
          return false;
4266
        if (this.to_time != that.to_time)
4267
          return false;
4268
      }
4269
 
4270
      boolean this_present_status = true && this.isSetStatus();
4271
      boolean that_present_status = true && that.isSetStatus();
4272
      if (this_present_status || that_present_status) {
4273
        if (!(this_present_status && that_present_status))
4274
          return false;
4275
        if (!this.status.equals(that.status))
4276
          return false;
4277
      }
4278
 
4279
      boolean this_present_gateway = true && this.isSetGateway();
4280
      boolean that_present_gateway = true && that.isSetGateway();
4281
      if (this_present_gateway || that_present_gateway) {
4282
        if (!(this_present_gateway && that_present_gateway))
4283
          return false;
4284
        if (!this.gateway.equals(that.gateway))
4285
          return false;
4286
      }
4287
 
4288
      return true;
4289
    }
4290
 
4291
    @Override
4292
    public int hashCode() {
4293
      return 0;
4294
    }
4295
 
4296
    public int compareTo(getPaymentsForUser_args other) {
4297
      if (!getClass().equals(other.getClass())) {
4298
        return getClass().getName().compareTo(other.getClass().getName());
4299
      }
4300
 
4301
      int lastComparison = 0;
4302
      getPaymentsForUser_args typedOther = (getPaymentsForUser_args)other;
4303
 
4304
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(isSetUserId());
4305
      if (lastComparison != 0) {
4306
        return lastComparison;
4307
      }
4308
      lastComparison = TBaseHelper.compareTo(userId, typedOther.userId);
4309
      if (lastComparison != 0) {
4310
        return lastComparison;
4311
      }
4312
      lastComparison = Boolean.valueOf(isSetFrom_time()).compareTo(isSetFrom_time());
4313
      if (lastComparison != 0) {
4314
        return lastComparison;
4315
      }
4316
      lastComparison = TBaseHelper.compareTo(from_time, typedOther.from_time);
4317
      if (lastComparison != 0) {
4318
        return lastComparison;
4319
      }
4320
      lastComparison = Boolean.valueOf(isSetTo_time()).compareTo(isSetTo_time());
4321
      if (lastComparison != 0) {
4322
        return lastComparison;
4323
      }
4324
      lastComparison = TBaseHelper.compareTo(to_time, typedOther.to_time);
4325
      if (lastComparison != 0) {
4326
        return lastComparison;
4327
      }
4328
      lastComparison = Boolean.valueOf(isSetStatus()).compareTo(isSetStatus());
4329
      if (lastComparison != 0) {
4330
        return lastComparison;
4331
      }
4332
      lastComparison = TBaseHelper.compareTo(status, typedOther.status);
4333
      if (lastComparison != 0) {
4334
        return lastComparison;
4335
      }
4336
      lastComparison = Boolean.valueOf(isSetGateway()).compareTo(isSetGateway());
4337
      if (lastComparison != 0) {
4338
        return lastComparison;
4339
      }
4340
      lastComparison = TBaseHelper.compareTo(gateway, typedOther.gateway);
4341
      if (lastComparison != 0) {
4342
        return lastComparison;
4343
      }
4344
      return 0;
4345
    }
4346
 
4347
    public void read(TProtocol iprot) throws TException {
4348
      TField field;
4349
      iprot.readStructBegin();
4350
      while (true)
4351
      {
4352
        field = iprot.readFieldBegin();
4353
        if (field.type == TType.STOP) { 
4354
          break;
4355
        }
4356
        _Fields fieldId = _Fields.findByThriftId(field.id);
4357
        if (fieldId == null) {
4358
          TProtocolUtil.skip(iprot, field.type);
4359
        } else {
4360
          switch (fieldId) {
4361
            case USER_ID:
4362
              if (field.type == TType.I64) {
4363
                this.userId = iprot.readI64();
4364
                setUserIdIsSet(true);
4365
              } else { 
4366
                TProtocolUtil.skip(iprot, field.type);
4367
              }
4368
              break;
4369
            case FROM_TIME:
4370
              if (field.type == TType.I64) {
4371
                this.from_time = iprot.readI64();
4372
                setFrom_timeIsSet(true);
4373
              } else { 
4374
                TProtocolUtil.skip(iprot, field.type);
4375
              }
4376
              break;
4377
            case TO_TIME:
4378
              if (field.type == TType.I64) {
4379
                this.to_time = iprot.readI64();
4380
                setTo_timeIsSet(true);
4381
              } else { 
4382
                TProtocolUtil.skip(iprot, field.type);
4383
              }
4384
              break;
4385
            case STATUS:
4386
              if (field.type == TType.I32) {
4387
                this.status = PaymentStatus.findByValue(iprot.readI32());
4388
              } else { 
4389
                TProtocolUtil.skip(iprot, field.type);
4390
              }
4391
              break;
4392
            case GATEWAY:
4393
              if (field.type == TType.I32) {
4394
                this.gateway = PaymentGateway.findByValue(iprot.readI32());
4395
              } else { 
4396
                TProtocolUtil.skip(iprot, field.type);
4397
              }
4398
              break;
4399
          }
4400
          iprot.readFieldEnd();
4401
        }
4402
      }
4403
      iprot.readStructEnd();
4404
      validate();
4405
    }
4406
 
4407
    public void write(TProtocol oprot) throws TException {
4408
      validate();
4409
 
4410
      oprot.writeStructBegin(STRUCT_DESC);
4411
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
4412
      oprot.writeI64(this.userId);
4413
      oprot.writeFieldEnd();
4414
      oprot.writeFieldBegin(FROM_TIME_FIELD_DESC);
4415
      oprot.writeI64(this.from_time);
4416
      oprot.writeFieldEnd();
4417
      oprot.writeFieldBegin(TO_TIME_FIELD_DESC);
4418
      oprot.writeI64(this.to_time);
4419
      oprot.writeFieldEnd();
4420
      if (this.status != null) {
4421
        oprot.writeFieldBegin(STATUS_FIELD_DESC);
4422
        oprot.writeI32(this.status.getValue());
4423
        oprot.writeFieldEnd();
4424
      }
4425
      if (this.gateway != null) {
4426
        oprot.writeFieldBegin(GATEWAY_FIELD_DESC);
4427
        oprot.writeI32(this.gateway.getValue());
4428
        oprot.writeFieldEnd();
4429
      }
4430
      oprot.writeFieldStop();
4431
      oprot.writeStructEnd();
4432
    }
4433
 
4434
    @Override
4435
    public String toString() {
4436
      StringBuilder sb = new StringBuilder("getPaymentsForUser_args(");
4437
      boolean first = true;
4438
 
4439
      sb.append("userId:");
4440
      sb.append(this.userId);
4441
      first = false;
4442
      if (!first) sb.append(", ");
4443
      sb.append("from_time:");
4444
      sb.append(this.from_time);
4445
      first = false;
4446
      if (!first) sb.append(", ");
4447
      sb.append("to_time:");
4448
      sb.append(this.to_time);
4449
      first = false;
4450
      if (!first) sb.append(", ");
4451
      sb.append("status:");
4452
      if (this.status == null) {
4453
        sb.append("null");
4454
      } else {
4455
        String status_name = status.name();
4456
        if (status_name != null) {
4457
          sb.append(status_name);
4458
          sb.append(" (");
4459
        }
4460
        sb.append(this.status);
4461
        if (status_name != null) {
4462
          sb.append(")");
4463
        }
4464
      }
4465
      first = false;
4466
      if (!first) sb.append(", ");
4467
      sb.append("gateway:");
4468
      if (this.gateway == null) {
4469
        sb.append("null");
4470
      } else {
4471
        String gateway_name = gateway.name();
4472
        if (gateway_name != null) {
4473
          sb.append(gateway_name);
4474
          sb.append(" (");
4475
        }
4476
        sb.append(this.gateway);
4477
        if (gateway_name != null) {
4478
          sb.append(")");
4479
        }
4480
      }
4481
      first = false;
4482
      sb.append(")");
4483
      return sb.toString();
4484
    }
4485
 
4486
    public void validate() throws TException {
4487
      // check for required fields
4488
    }
4489
 
4490
  }
4491
 
4492
  public static class getPaymentsForUser_result implements TBase<getPaymentsForUser_result._Fields>, java.io.Serializable, Cloneable   {
4493
    private static final TStruct STRUCT_DESC = new TStruct("getPaymentsForUser_result");
4494
 
4495
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0);
4496
    private static final TField PE_FIELD_DESC = new TField("pe", TType.STRUCT, (short)1);
4497
 
4498
    private List<Payment> success;
4499
    private PaymentException pe;
4500
 
4501
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
4502
    public enum _Fields implements TFieldIdEnum {
4503
      SUCCESS((short)0, "success"),
4504
      PE((short)1, "pe");
4505
 
4506
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
4507
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4508
 
4509
      static {
4510
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4511
          byId.put((int)field._thriftId, field);
4512
          byName.put(field.getFieldName(), field);
4513
        }
4514
      }
4515
 
4516
      /**
4517
       * Find the _Fields constant that matches fieldId, or null if its not found.
4518
       */
4519
      public static _Fields findByThriftId(int fieldId) {
4520
        return byId.get(fieldId);
4521
      }
4522
 
4523
      /**
4524
       * Find the _Fields constant that matches fieldId, throwing an exception
4525
       * if it is not found.
4526
       */
4527
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4528
        _Fields fields = findByThriftId(fieldId);
4529
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4530
        return fields;
4531
      }
4532
 
4533
      /**
4534
       * Find the _Fields constant that matches name, or null if its not found.
4535
       */
4536
      public static _Fields findByName(String name) {
4537
        return byName.get(name);
4538
      }
4539
 
4540
      private final short _thriftId;
4541
      private final String _fieldName;
4542
 
4543
      _Fields(short thriftId, String fieldName) {
4544
        _thriftId = thriftId;
4545
        _fieldName = fieldName;
4546
      }
4547
 
4548
      public short getThriftFieldId() {
4549
        return _thriftId;
4550
      }
4551
 
4552
      public String getFieldName() {
4553
        return _fieldName;
4554
      }
4555
    }
4556
 
4557
    // isset id assignments
4558
 
4559
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
4560
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
4561
          new ListMetaData(TType.LIST, 
4562
              new StructMetaData(TType.STRUCT, Payment.class))));
4563
      put(_Fields.PE, new FieldMetaData("pe", TFieldRequirementType.DEFAULT, 
4564
          new FieldValueMetaData(TType.STRUCT)));
4565
    }});
4566
 
4567
    static {
4568
      FieldMetaData.addStructMetaDataMap(getPaymentsForUser_result.class, metaDataMap);
4569
    }
4570
 
4571
    public getPaymentsForUser_result() {
4572
    }
4573
 
4574
    public getPaymentsForUser_result(
4575
      List<Payment> success,
4576
      PaymentException pe)
4577
    {
4578
      this();
4579
      this.success = success;
4580
      this.pe = pe;
4581
    }
4582
 
4583
    /**
4584
     * Performs a deep copy on <i>other</i>.
4585
     */
4586
    public getPaymentsForUser_result(getPaymentsForUser_result other) {
4587
      if (other.isSetSuccess()) {
4588
        List<Payment> __this__success = new ArrayList<Payment>();
4589
        for (Payment other_element : other.success) {
4590
          __this__success.add(new Payment(other_element));
4591
        }
4592
        this.success = __this__success;
4593
      }
4594
      if (other.isSetPe()) {
4595
        this.pe = new PaymentException(other.pe);
4596
      }
4597
    }
4598
 
4599
    public getPaymentsForUser_result deepCopy() {
4600
      return new getPaymentsForUser_result(this);
4601
    }
4602
 
4603
    @Deprecated
4604
    public getPaymentsForUser_result clone() {
4605
      return new getPaymentsForUser_result(this);
4606
    }
4607
 
4608
    public int getSuccessSize() {
4609
      return (this.success == null) ? 0 : this.success.size();
4610
    }
4611
 
4612
    public java.util.Iterator<Payment> getSuccessIterator() {
4613
      return (this.success == null) ? null : this.success.iterator();
4614
    }
4615
 
4616
    public void addToSuccess(Payment elem) {
4617
      if (this.success == null) {
4618
        this.success = new ArrayList<Payment>();
4619
      }
4620
      this.success.add(elem);
4621
    }
4622
 
4623
    public List<Payment> getSuccess() {
4624
      return this.success;
4625
    }
4626
 
4627
    public getPaymentsForUser_result setSuccess(List<Payment> success) {
4628
      this.success = success;
4629
      return this;
4630
    }
4631
 
4632
    public void unsetSuccess() {
4633
      this.success = null;
4634
    }
4635
 
4636
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
4637
    public boolean isSetSuccess() {
4638
      return this.success != null;
4639
    }
4640
 
4641
    public void setSuccessIsSet(boolean value) {
4642
      if (!value) {
4643
        this.success = null;
4644
      }
4645
    }
4646
 
4647
    public PaymentException getPe() {
4648
      return this.pe;
4649
    }
4650
 
4651
    public getPaymentsForUser_result setPe(PaymentException pe) {
4652
      this.pe = pe;
4653
      return this;
4654
    }
4655
 
4656
    public void unsetPe() {
4657
      this.pe = null;
4658
    }
4659
 
4660
    /** Returns true if field pe is set (has been asigned a value) and false otherwise */
4661
    public boolean isSetPe() {
4662
      return this.pe != null;
4663
    }
4664
 
4665
    public void setPeIsSet(boolean value) {
4666
      if (!value) {
4667
        this.pe = null;
4668
      }
4669
    }
4670
 
4671
    public void setFieldValue(_Fields field, Object value) {
4672
      switch (field) {
4673
      case SUCCESS:
4674
        if (value == null) {
4675
          unsetSuccess();
4676
        } else {
4677
          setSuccess((List<Payment>)value);
4678
        }
4679
        break;
4680
 
4681
      case PE:
4682
        if (value == null) {
4683
          unsetPe();
4684
        } else {
4685
          setPe((PaymentException)value);
4686
        }
4687
        break;
4688
 
4689
      }
4690
    }
4691
 
4692
    public void setFieldValue(int fieldID, Object value) {
4693
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
4694
    }
4695
 
4696
    public Object getFieldValue(_Fields field) {
4697
      switch (field) {
4698
      case SUCCESS:
4699
        return getSuccess();
4700
 
4701
      case PE:
4702
        return getPe();
4703
 
4704
      }
4705
      throw new IllegalStateException();
4706
    }
4707
 
4708
    public Object getFieldValue(int fieldId) {
4709
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
4710
    }
4711
 
4712
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
4713
    public boolean isSet(_Fields field) {
4714
      switch (field) {
4715
      case SUCCESS:
4716
        return isSetSuccess();
4717
      case PE:
4718
        return isSetPe();
4719
      }
4720
      throw new IllegalStateException();
4721
    }
4722
 
4723
    public boolean isSet(int fieldID) {
4724
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
4725
    }
4726
 
4727
    @Override
4728
    public boolean equals(Object that) {
4729
      if (that == null)
4730
        return false;
4731
      if (that instanceof getPaymentsForUser_result)
4732
        return this.equals((getPaymentsForUser_result)that);
4733
      return false;
4734
    }
4735
 
4736
    public boolean equals(getPaymentsForUser_result that) {
4737
      if (that == null)
4738
        return false;
4739
 
4740
      boolean this_present_success = true && this.isSetSuccess();
4741
      boolean that_present_success = true && that.isSetSuccess();
4742
      if (this_present_success || that_present_success) {
4743
        if (!(this_present_success && that_present_success))
4744
          return false;
4745
        if (!this.success.equals(that.success))
4746
          return false;
4747
      }
4748
 
4749
      boolean this_present_pe = true && this.isSetPe();
4750
      boolean that_present_pe = true && that.isSetPe();
4751
      if (this_present_pe || that_present_pe) {
4752
        if (!(this_present_pe && that_present_pe))
4753
          return false;
4754
        if (!this.pe.equals(that.pe))
4755
          return false;
4756
      }
4757
 
4758
      return true;
4759
    }
4760
 
4761
    @Override
4762
    public int hashCode() {
4763
      return 0;
4764
    }
4765
 
4766
    public void read(TProtocol iprot) throws TException {
4767
      TField field;
4768
      iprot.readStructBegin();
4769
      while (true)
4770
      {
4771
        field = iprot.readFieldBegin();
4772
        if (field.type == TType.STOP) { 
4773
          break;
4774
        }
4775
        _Fields fieldId = _Fields.findByThriftId(field.id);
4776
        if (fieldId == null) {
4777
          TProtocolUtil.skip(iprot, field.type);
4778
        } else {
4779
          switch (fieldId) {
4780
            case SUCCESS:
4781
              if (field.type == TType.LIST) {
4782
                {
4783
                  TList _list13 = iprot.readListBegin();
4784
                  this.success = new ArrayList<Payment>(_list13.size);
4785
                  for (int _i14 = 0; _i14 < _list13.size; ++_i14)
4786
                  {
4787
                    Payment _elem15;
4788
                    _elem15 = new Payment();
4789
                    _elem15.read(iprot);
4790
                    this.success.add(_elem15);
4791
                  }
4792
                  iprot.readListEnd();
4793
                }
4794
              } else { 
4795
                TProtocolUtil.skip(iprot, field.type);
4796
              }
4797
              break;
4798
            case PE:
4799
              if (field.type == TType.STRUCT) {
4800
                this.pe = new PaymentException();
4801
                this.pe.read(iprot);
4802
              } else { 
4803
                TProtocolUtil.skip(iprot, field.type);
4804
              }
4805
              break;
4806
          }
4807
          iprot.readFieldEnd();
4808
        }
4809
      }
4810
      iprot.readStructEnd();
4811
      validate();
4812
    }
4813
 
4814
    public void write(TProtocol oprot) throws TException {
4815
      oprot.writeStructBegin(STRUCT_DESC);
4816
 
4817
      if (this.isSetSuccess()) {
4818
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
4819
        {
4820
          oprot.writeListBegin(new TList(TType.STRUCT, this.success.size()));
4821
          for (Payment _iter16 : this.success)
4822
          {
4823
            _iter16.write(oprot);
4824
          }
4825
          oprot.writeListEnd();
4826
        }
4827
        oprot.writeFieldEnd();
4828
      } else if (this.isSetPe()) {
4829
        oprot.writeFieldBegin(PE_FIELD_DESC);
4830
        this.pe.write(oprot);
4831
        oprot.writeFieldEnd();
4832
      }
4833
      oprot.writeFieldStop();
4834
      oprot.writeStructEnd();
4835
    }
4836
 
4837
    @Override
4838
    public String toString() {
4839
      StringBuilder sb = new StringBuilder("getPaymentsForUser_result(");
4840
      boolean first = true;
4841
 
4842
      sb.append("success:");
4843
      if (this.success == null) {
4844
        sb.append("null");
4845
      } else {
4846
        sb.append(this.success);
4847
      }
4848
      first = false;
4849
      if (!first) sb.append(", ");
4850
      sb.append("pe:");
4851
      if (this.pe == null) {
4852
        sb.append("null");
4853
      } else {
4854
        sb.append(this.pe);
4855
      }
4856
      first = false;
4857
      sb.append(")");
4858
      return sb.toString();
4859
    }
4860
 
4861
    public void validate() throws TException {
4862
      // check for required fields
4863
    }
4864
 
4865
  }
4866
 
4867
  public static class getPaymentsForCart_args implements TBase<getPaymentsForCart_args._Fields>, java.io.Serializable, Cloneable, Comparable<getPaymentsForCart_args>   {
4868
    private static final TStruct STRUCT_DESC = new TStruct("getPaymentsForCart_args");
4869
 
4870
    private static final TField CART_ID_FIELD_DESC = new TField("cartId", TType.I64, (short)1);
4871
    private static final TField FROM_TIME_FIELD_DESC = new TField("from_time", TType.I64, (short)2);
4872
    private static final TField TO_TIME_FIELD_DESC = new TField("to_time", TType.I64, (short)3);
4873
    private static final TField STATUS_FIELD_DESC = new TField("status", TType.I32, (short)4);
4874
    private static final TField GATEWAY_FIELD_DESC = new TField("gateway", TType.I32, (short)5);
4875
 
4876
    private long cartId;
4877
    private long from_time;
4878
    private long to_time;
4879
    private PaymentStatus status;
4880
    private PaymentGateway gateway;
4881
 
4882
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
4883
    public enum _Fields implements TFieldIdEnum {
4884
      CART_ID((short)1, "cartId"),
4885
      FROM_TIME((short)2, "from_time"),
4886
      TO_TIME((short)3, "to_time"),
4887
      /**
4888
       * 
4889
       * @see PaymentStatus
4890
       */
4891
      STATUS((short)4, "status"),
4892
      /**
4893
       * 
4894
       * @see PaymentGateway
4895
       */
4896
      GATEWAY((short)5, "gateway");
4897
 
4898
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
4899
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4900
 
4901
      static {
4902
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4903
          byId.put((int)field._thriftId, field);
4904
          byName.put(field.getFieldName(), field);
4905
        }
4906
      }
4907
 
4908
      /**
4909
       * Find the _Fields constant that matches fieldId, or null if its not found.
4910
       */
4911
      public static _Fields findByThriftId(int fieldId) {
4912
        return byId.get(fieldId);
4913
      }
4914
 
4915
      /**
4916
       * Find the _Fields constant that matches fieldId, throwing an exception
4917
       * if it is not found.
4918
       */
4919
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4920
        _Fields fields = findByThriftId(fieldId);
4921
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4922
        return fields;
4923
      }
4924
 
4925
      /**
4926
       * Find the _Fields constant that matches name, or null if its not found.
4927
       */
4928
      public static _Fields findByName(String name) {
4929
        return byName.get(name);
4930
      }
4931
 
4932
      private final short _thriftId;
4933
      private final String _fieldName;
4934
 
4935
      _Fields(short thriftId, String fieldName) {
4936
        _thriftId = thriftId;
4937
        _fieldName = fieldName;
4938
      }
4939
 
4940
      public short getThriftFieldId() {
4941
        return _thriftId;
4942
      }
4943
 
4944
      public String getFieldName() {
4945
        return _fieldName;
4946
      }
4947
    }
4948
 
4949
    // isset id assignments
4950
    private static final int __CARTID_ISSET_ID = 0;
4951
    private static final int __FROM_TIME_ISSET_ID = 1;
4952
    private static final int __TO_TIME_ISSET_ID = 2;
4953
    private BitSet __isset_bit_vector = new BitSet(3);
4954
 
4955
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
4956
      put(_Fields.CART_ID, new FieldMetaData("cartId", TFieldRequirementType.DEFAULT, 
4957
          new FieldValueMetaData(TType.I64)));
4958
      put(_Fields.FROM_TIME, new FieldMetaData("from_time", TFieldRequirementType.DEFAULT, 
4959
          new FieldValueMetaData(TType.I64)));
4960
      put(_Fields.TO_TIME, new FieldMetaData("to_time", TFieldRequirementType.DEFAULT, 
4961
          new FieldValueMetaData(TType.I64)));
4962
      put(_Fields.STATUS, new FieldMetaData("status", TFieldRequirementType.DEFAULT, 
4963
          new EnumMetaData(TType.ENUM, PaymentStatus.class)));
4964
      put(_Fields.GATEWAY, new FieldMetaData("gateway", TFieldRequirementType.DEFAULT, 
4965
          new EnumMetaData(TType.ENUM, PaymentGateway.class)));
4966
    }});
4967
 
4968
    static {
4969
      FieldMetaData.addStructMetaDataMap(getPaymentsForCart_args.class, metaDataMap);
4970
    }
4971
 
4972
    public getPaymentsForCart_args() {
4973
    }
4974
 
4975
    public getPaymentsForCart_args(
4976
      long cartId,
4977
      long from_time,
4978
      long to_time,
4979
      PaymentStatus status,
4980
      PaymentGateway gateway)
4981
    {
4982
      this();
4983
      this.cartId = cartId;
4984
      setCartIdIsSet(true);
4985
      this.from_time = from_time;
4986
      setFrom_timeIsSet(true);
4987
      this.to_time = to_time;
4988
      setTo_timeIsSet(true);
4989
      this.status = status;
4990
      this.gateway = gateway;
4991
    }
4992
 
4993
    /**
4994
     * Performs a deep copy on <i>other</i>.
4995
     */
4996
    public getPaymentsForCart_args(getPaymentsForCart_args other) {
4997
      __isset_bit_vector.clear();
4998
      __isset_bit_vector.or(other.__isset_bit_vector);
4999
      this.cartId = other.cartId;
5000
      this.from_time = other.from_time;
5001
      this.to_time = other.to_time;
5002
      if (other.isSetStatus()) {
5003
        this.status = other.status;
5004
      }
5005
      if (other.isSetGateway()) {
5006
        this.gateway = other.gateway;
5007
      }
5008
    }
5009
 
5010
    public getPaymentsForCart_args deepCopy() {
5011
      return new getPaymentsForCart_args(this);
5012
    }
5013
 
5014
    @Deprecated
5015
    public getPaymentsForCart_args clone() {
5016
      return new getPaymentsForCart_args(this);
5017
    }
5018
 
5019
    public long getCartId() {
5020
      return this.cartId;
5021
    }
5022
 
5023
    public getPaymentsForCart_args setCartId(long cartId) {
5024
      this.cartId = cartId;
5025
      setCartIdIsSet(true);
5026
      return this;
5027
    }
5028
 
5029
    public void unsetCartId() {
5030
      __isset_bit_vector.clear(__CARTID_ISSET_ID);
5031
    }
5032
 
5033
    /** Returns true if field cartId is set (has been asigned a value) and false otherwise */
5034
    public boolean isSetCartId() {
5035
      return __isset_bit_vector.get(__CARTID_ISSET_ID);
5036
    }
5037
 
5038
    public void setCartIdIsSet(boolean value) {
5039
      __isset_bit_vector.set(__CARTID_ISSET_ID, value);
5040
    }
5041
 
5042
    public long getFrom_time() {
5043
      return this.from_time;
5044
    }
5045
 
5046
    public getPaymentsForCart_args setFrom_time(long from_time) {
5047
      this.from_time = from_time;
5048
      setFrom_timeIsSet(true);
5049
      return this;
5050
    }
5051
 
5052
    public void unsetFrom_time() {
5053
      __isset_bit_vector.clear(__FROM_TIME_ISSET_ID);
5054
    }
5055
 
5056
    /** Returns true if field from_time is set (has been asigned a value) and false otherwise */
5057
    public boolean isSetFrom_time() {
5058
      return __isset_bit_vector.get(__FROM_TIME_ISSET_ID);
5059
    }
5060
 
5061
    public void setFrom_timeIsSet(boolean value) {
5062
      __isset_bit_vector.set(__FROM_TIME_ISSET_ID, value);
5063
    }
5064
 
5065
    public long getTo_time() {
5066
      return this.to_time;
5067
    }
5068
 
5069
    public getPaymentsForCart_args setTo_time(long to_time) {
5070
      this.to_time = to_time;
5071
      setTo_timeIsSet(true);
5072
      return this;
5073
    }
5074
 
5075
    public void unsetTo_time() {
5076
      __isset_bit_vector.clear(__TO_TIME_ISSET_ID);
5077
    }
5078
 
5079
    /** Returns true if field to_time is set (has been asigned a value) and false otherwise */
5080
    public boolean isSetTo_time() {
5081
      return __isset_bit_vector.get(__TO_TIME_ISSET_ID);
5082
    }
5083
 
5084
    public void setTo_timeIsSet(boolean value) {
5085
      __isset_bit_vector.set(__TO_TIME_ISSET_ID, value);
5086
    }
5087
 
5088
    /**
5089
     * 
5090
     * @see PaymentStatus
5091
     */
5092
    public PaymentStatus getStatus() {
5093
      return this.status;
5094
    }
5095
 
5096
    /**
5097
     * 
5098
     * @see PaymentStatus
5099
     */
5100
    public getPaymentsForCart_args setStatus(PaymentStatus status) {
5101
      this.status = status;
5102
      return this;
5103
    }
5104
 
5105
    public void unsetStatus() {
5106
      this.status = null;
5107
    }
5108
 
5109
    /** Returns true if field status is set (has been asigned a value) and false otherwise */
5110
    public boolean isSetStatus() {
5111
      return this.status != null;
5112
    }
5113
 
5114
    public void setStatusIsSet(boolean value) {
5115
      if (!value) {
5116
        this.status = null;
5117
      }
5118
    }
5119
 
5120
    /**
5121
     * 
5122
     * @see PaymentGateway
5123
     */
5124
    public PaymentGateway getGateway() {
5125
      return this.gateway;
5126
    }
5127
 
5128
    /**
5129
     * 
5130
     * @see PaymentGateway
5131
     */
5132
    public getPaymentsForCart_args setGateway(PaymentGateway gateway) {
5133
      this.gateway = gateway;
5134
      return this;
5135
    }
5136
 
5137
    public void unsetGateway() {
5138
      this.gateway = null;
5139
    }
5140
 
5141
    /** Returns true if field gateway is set (has been asigned a value) and false otherwise */
5142
    public boolean isSetGateway() {
5143
      return this.gateway != null;
5144
    }
5145
 
5146
    public void setGatewayIsSet(boolean value) {
5147
      if (!value) {
5148
        this.gateway = null;
5149
      }
5150
    }
5151
 
5152
    public void setFieldValue(_Fields field, Object value) {
5153
      switch (field) {
5154
      case CART_ID:
5155
        if (value == null) {
5156
          unsetCartId();
5157
        } else {
5158
          setCartId((Long)value);
5159
        }
5160
        break;
5161
 
5162
      case FROM_TIME:
5163
        if (value == null) {
5164
          unsetFrom_time();
5165
        } else {
5166
          setFrom_time((Long)value);
5167
        }
5168
        break;
5169
 
5170
      case TO_TIME:
5171
        if (value == null) {
5172
          unsetTo_time();
5173
        } else {
5174
          setTo_time((Long)value);
5175
        }
5176
        break;
5177
 
5178
      case STATUS:
5179
        if (value == null) {
5180
          unsetStatus();
5181
        } else {
5182
          setStatus((PaymentStatus)value);
5183
        }
5184
        break;
5185
 
5186
      case GATEWAY:
5187
        if (value == null) {
5188
          unsetGateway();
5189
        } else {
5190
          setGateway((PaymentGateway)value);
5191
        }
5192
        break;
5193
 
5194
      }
5195
    }
5196
 
5197
    public void setFieldValue(int fieldID, Object value) {
5198
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
5199
    }
5200
 
5201
    public Object getFieldValue(_Fields field) {
5202
      switch (field) {
5203
      case CART_ID:
5204
        return new Long(getCartId());
5205
 
5206
      case FROM_TIME:
5207
        return new Long(getFrom_time());
5208
 
5209
      case TO_TIME:
5210
        return new Long(getTo_time());
5211
 
5212
      case STATUS:
5213
        return getStatus();
5214
 
5215
      case GATEWAY:
5216
        return getGateway();
5217
 
5218
      }
5219
      throw new IllegalStateException();
5220
    }
5221
 
5222
    public Object getFieldValue(int fieldId) {
5223
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
5224
    }
5225
 
5226
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
5227
    public boolean isSet(_Fields field) {
5228
      switch (field) {
5229
      case CART_ID:
5230
        return isSetCartId();
5231
      case FROM_TIME:
5232
        return isSetFrom_time();
5233
      case TO_TIME:
5234
        return isSetTo_time();
5235
      case STATUS:
5236
        return isSetStatus();
5237
      case GATEWAY:
5238
        return isSetGateway();
5239
      }
5240
      throw new IllegalStateException();
5241
    }
5242
 
5243
    public boolean isSet(int fieldID) {
5244
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
5245
    }
5246
 
5247
    @Override
5248
    public boolean equals(Object that) {
5249
      if (that == null)
5250
        return false;
5251
      if (that instanceof getPaymentsForCart_args)
5252
        return this.equals((getPaymentsForCart_args)that);
5253
      return false;
5254
    }
5255
 
5256
    public boolean equals(getPaymentsForCart_args that) {
5257
      if (that == null)
5258
        return false;
5259
 
5260
      boolean this_present_cartId = true;
5261
      boolean that_present_cartId = true;
5262
      if (this_present_cartId || that_present_cartId) {
5263
        if (!(this_present_cartId && that_present_cartId))
5264
          return false;
5265
        if (this.cartId != that.cartId)
5266
          return false;
5267
      }
5268
 
5269
      boolean this_present_from_time = true;
5270
      boolean that_present_from_time = true;
5271
      if (this_present_from_time || that_present_from_time) {
5272
        if (!(this_present_from_time && that_present_from_time))
5273
          return false;
5274
        if (this.from_time != that.from_time)
5275
          return false;
5276
      }
5277
 
5278
      boolean this_present_to_time = true;
5279
      boolean that_present_to_time = true;
5280
      if (this_present_to_time || that_present_to_time) {
5281
        if (!(this_present_to_time && that_present_to_time))
5282
          return false;
5283
        if (this.to_time != that.to_time)
5284
          return false;
5285
      }
5286
 
5287
      boolean this_present_status = true && this.isSetStatus();
5288
      boolean that_present_status = true && that.isSetStatus();
5289
      if (this_present_status || that_present_status) {
5290
        if (!(this_present_status && that_present_status))
5291
          return false;
5292
        if (!this.status.equals(that.status))
5293
          return false;
5294
      }
5295
 
5296
      boolean this_present_gateway = true && this.isSetGateway();
5297
      boolean that_present_gateway = true && that.isSetGateway();
5298
      if (this_present_gateway || that_present_gateway) {
5299
        if (!(this_present_gateway && that_present_gateway))
5300
          return false;
5301
        if (!this.gateway.equals(that.gateway))
5302
          return false;
5303
      }
5304
 
5305
      return true;
5306
    }
5307
 
5308
    @Override
5309
    public int hashCode() {
5310
      return 0;
5311
    }
5312
 
5313
    public int compareTo(getPaymentsForCart_args other) {
5314
      if (!getClass().equals(other.getClass())) {
5315
        return getClass().getName().compareTo(other.getClass().getName());
5316
      }
5317
 
5318
      int lastComparison = 0;
5319
      getPaymentsForCart_args typedOther = (getPaymentsForCart_args)other;
5320
 
5321
      lastComparison = Boolean.valueOf(isSetCartId()).compareTo(isSetCartId());
5322
      if (lastComparison != 0) {
5323
        return lastComparison;
5324
      }
5325
      lastComparison = TBaseHelper.compareTo(cartId, typedOther.cartId);
5326
      if (lastComparison != 0) {
5327
        return lastComparison;
5328
      }
5329
      lastComparison = Boolean.valueOf(isSetFrom_time()).compareTo(isSetFrom_time());
5330
      if (lastComparison != 0) {
5331
        return lastComparison;
5332
      }
5333
      lastComparison = TBaseHelper.compareTo(from_time, typedOther.from_time);
5334
      if (lastComparison != 0) {
5335
        return lastComparison;
5336
      }
5337
      lastComparison = Boolean.valueOf(isSetTo_time()).compareTo(isSetTo_time());
5338
      if (lastComparison != 0) {
5339
        return lastComparison;
5340
      }
5341
      lastComparison = TBaseHelper.compareTo(to_time, typedOther.to_time);
5342
      if (lastComparison != 0) {
5343
        return lastComparison;
5344
      }
5345
      lastComparison = Boolean.valueOf(isSetStatus()).compareTo(isSetStatus());
5346
      if (lastComparison != 0) {
5347
        return lastComparison;
5348
      }
5349
      lastComparison = TBaseHelper.compareTo(status, typedOther.status);
5350
      if (lastComparison != 0) {
5351
        return lastComparison;
5352
      }
5353
      lastComparison = Boolean.valueOf(isSetGateway()).compareTo(isSetGateway());
5354
      if (lastComparison != 0) {
5355
        return lastComparison;
5356
      }
5357
      lastComparison = TBaseHelper.compareTo(gateway, typedOther.gateway);
5358
      if (lastComparison != 0) {
5359
        return lastComparison;
5360
      }
5361
      return 0;
5362
    }
5363
 
5364
    public void read(TProtocol iprot) throws TException {
5365
      TField field;
5366
      iprot.readStructBegin();
5367
      while (true)
5368
      {
5369
        field = iprot.readFieldBegin();
5370
        if (field.type == TType.STOP) { 
5371
          break;
5372
        }
5373
        _Fields fieldId = _Fields.findByThriftId(field.id);
5374
        if (fieldId == null) {
5375
          TProtocolUtil.skip(iprot, field.type);
5376
        } else {
5377
          switch (fieldId) {
5378
            case CART_ID:
5379
              if (field.type == TType.I64) {
5380
                this.cartId = iprot.readI64();
5381
                setCartIdIsSet(true);
5382
              } else { 
5383
                TProtocolUtil.skip(iprot, field.type);
5384
              }
5385
              break;
5386
            case FROM_TIME:
5387
              if (field.type == TType.I64) {
5388
                this.from_time = iprot.readI64();
5389
                setFrom_timeIsSet(true);
5390
              } else { 
5391
                TProtocolUtil.skip(iprot, field.type);
5392
              }
5393
              break;
5394
            case TO_TIME:
5395
              if (field.type == TType.I64) {
5396
                this.to_time = iprot.readI64();
5397
                setTo_timeIsSet(true);
5398
              } else { 
5399
                TProtocolUtil.skip(iprot, field.type);
5400
              }
5401
              break;
5402
            case STATUS:
5403
              if (field.type == TType.I32) {
5404
                this.status = PaymentStatus.findByValue(iprot.readI32());
5405
              } else { 
5406
                TProtocolUtil.skip(iprot, field.type);
5407
              }
5408
              break;
5409
            case GATEWAY:
5410
              if (field.type == TType.I32) {
5411
                this.gateway = PaymentGateway.findByValue(iprot.readI32());
5412
              } else { 
5413
                TProtocolUtil.skip(iprot, field.type);
5414
              }
5415
              break;
5416
          }
5417
          iprot.readFieldEnd();
5418
        }
5419
      }
5420
      iprot.readStructEnd();
5421
      validate();
5422
    }
5423
 
5424
    public void write(TProtocol oprot) throws TException {
5425
      validate();
5426
 
5427
      oprot.writeStructBegin(STRUCT_DESC);
5428
      oprot.writeFieldBegin(CART_ID_FIELD_DESC);
5429
      oprot.writeI64(this.cartId);
5430
      oprot.writeFieldEnd();
5431
      oprot.writeFieldBegin(FROM_TIME_FIELD_DESC);
5432
      oprot.writeI64(this.from_time);
5433
      oprot.writeFieldEnd();
5434
      oprot.writeFieldBegin(TO_TIME_FIELD_DESC);
5435
      oprot.writeI64(this.to_time);
5436
      oprot.writeFieldEnd();
5437
      if (this.status != null) {
5438
        oprot.writeFieldBegin(STATUS_FIELD_DESC);
5439
        oprot.writeI32(this.status.getValue());
5440
        oprot.writeFieldEnd();
5441
      }
5442
      if (this.gateway != null) {
5443
        oprot.writeFieldBegin(GATEWAY_FIELD_DESC);
5444
        oprot.writeI32(this.gateway.getValue());
5445
        oprot.writeFieldEnd();
5446
      }
5447
      oprot.writeFieldStop();
5448
      oprot.writeStructEnd();
5449
    }
5450
 
5451
    @Override
5452
    public String toString() {
5453
      StringBuilder sb = new StringBuilder("getPaymentsForCart_args(");
5454
      boolean first = true;
5455
 
5456
      sb.append("cartId:");
5457
      sb.append(this.cartId);
5458
      first = false;
5459
      if (!first) sb.append(", ");
5460
      sb.append("from_time:");
5461
      sb.append(this.from_time);
5462
      first = false;
5463
      if (!first) sb.append(", ");
5464
      sb.append("to_time:");
5465
      sb.append(this.to_time);
5466
      first = false;
5467
      if (!first) sb.append(", ");
5468
      sb.append("status:");
5469
      if (this.status == null) {
5470
        sb.append("null");
5471
      } else {
5472
        String status_name = status.name();
5473
        if (status_name != null) {
5474
          sb.append(status_name);
5475
          sb.append(" (");
5476
        }
5477
        sb.append(this.status);
5478
        if (status_name != null) {
5479
          sb.append(")");
5480
        }
5481
      }
5482
      first = false;
5483
      if (!first) sb.append(", ");
5484
      sb.append("gateway:");
5485
      if (this.gateway == null) {
5486
        sb.append("null");
5487
      } else {
5488
        String gateway_name = gateway.name();
5489
        if (gateway_name != null) {
5490
          sb.append(gateway_name);
5491
          sb.append(" (");
5492
        }
5493
        sb.append(this.gateway);
5494
        if (gateway_name != null) {
5495
          sb.append(")");
5496
        }
5497
      }
5498
      first = false;
5499
      sb.append(")");
5500
      return sb.toString();
5501
    }
5502
 
5503
    public void validate() throws TException {
5504
      // check for required fields
5505
    }
5506
 
5507
  }
5508
 
5509
  public static class getPaymentsForCart_result implements TBase<getPaymentsForCart_result._Fields>, java.io.Serializable, Cloneable   {
5510
    private static final TStruct STRUCT_DESC = new TStruct("getPaymentsForCart_result");
5511
 
5512
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0);
5513
    private static final TField PE_FIELD_DESC = new TField("pe", TType.STRUCT, (short)1);
5514
 
5515
    private List<Payment> success;
5516
    private PaymentException pe;
5517
 
5518
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
5519
    public enum _Fields implements TFieldIdEnum {
5520
      SUCCESS((short)0, "success"),
5521
      PE((short)1, "pe");
5522
 
5523
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
5524
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5525
 
5526
      static {
5527
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5528
          byId.put((int)field._thriftId, field);
5529
          byName.put(field.getFieldName(), field);
5530
        }
5531
      }
5532
 
5533
      /**
5534
       * Find the _Fields constant that matches fieldId, or null if its not found.
5535
       */
5536
      public static _Fields findByThriftId(int fieldId) {
5537
        return byId.get(fieldId);
5538
      }
5539
 
5540
      /**
5541
       * Find the _Fields constant that matches fieldId, throwing an exception
5542
       * if it is not found.
5543
       */
5544
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5545
        _Fields fields = findByThriftId(fieldId);
5546
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5547
        return fields;
5548
      }
5549
 
5550
      /**
5551
       * Find the _Fields constant that matches name, or null if its not found.
5552
       */
5553
      public static _Fields findByName(String name) {
5554
        return byName.get(name);
5555
      }
5556
 
5557
      private final short _thriftId;
5558
      private final String _fieldName;
5559
 
5560
      _Fields(short thriftId, String fieldName) {
5561
        _thriftId = thriftId;
5562
        _fieldName = fieldName;
5563
      }
5564
 
5565
      public short getThriftFieldId() {
5566
        return _thriftId;
5567
      }
5568
 
5569
      public String getFieldName() {
5570
        return _fieldName;
5571
      }
5572
    }
5573
 
5574
    // isset id assignments
5575
 
5576
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
5577
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
5578
          new ListMetaData(TType.LIST, 
5579
              new StructMetaData(TType.STRUCT, Payment.class))));
5580
      put(_Fields.PE, new FieldMetaData("pe", TFieldRequirementType.DEFAULT, 
5581
          new FieldValueMetaData(TType.STRUCT)));
5582
    }});
5583
 
5584
    static {
5585
      FieldMetaData.addStructMetaDataMap(getPaymentsForCart_result.class, metaDataMap);
5586
    }
5587
 
5588
    public getPaymentsForCart_result() {
5589
    }
5590
 
5591
    public getPaymentsForCart_result(
5592
      List<Payment> success,
5593
      PaymentException pe)
5594
    {
5595
      this();
5596
      this.success = success;
5597
      this.pe = pe;
5598
    }
5599
 
5600
    /**
5601
     * Performs a deep copy on <i>other</i>.
5602
     */
5603
    public getPaymentsForCart_result(getPaymentsForCart_result other) {
5604
      if (other.isSetSuccess()) {
5605
        List<Payment> __this__success = new ArrayList<Payment>();
5606
        for (Payment other_element : other.success) {
5607
          __this__success.add(new Payment(other_element));
5608
        }
5609
        this.success = __this__success;
5610
      }
5611
      if (other.isSetPe()) {
5612
        this.pe = new PaymentException(other.pe);
5613
      }
5614
    }
5615
 
5616
    public getPaymentsForCart_result deepCopy() {
5617
      return new getPaymentsForCart_result(this);
5618
    }
5619
 
5620
    @Deprecated
5621
    public getPaymentsForCart_result clone() {
5622
      return new getPaymentsForCart_result(this);
5623
    }
5624
 
5625
    public int getSuccessSize() {
5626
      return (this.success == null) ? 0 : this.success.size();
5627
    }
5628
 
5629
    public java.util.Iterator<Payment> getSuccessIterator() {
5630
      return (this.success == null) ? null : this.success.iterator();
5631
    }
5632
 
5633
    public void addToSuccess(Payment elem) {
5634
      if (this.success == null) {
5635
        this.success = new ArrayList<Payment>();
5636
      }
5637
      this.success.add(elem);
5638
    }
5639
 
5640
    public List<Payment> getSuccess() {
5641
      return this.success;
5642
    }
5643
 
5644
    public getPaymentsForCart_result setSuccess(List<Payment> success) {
5645
      this.success = success;
5646
      return this;
5647
    }
5648
 
5649
    public void unsetSuccess() {
5650
      this.success = null;
5651
    }
5652
 
5653
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
5654
    public boolean isSetSuccess() {
5655
      return this.success != null;
5656
    }
5657
 
5658
    public void setSuccessIsSet(boolean value) {
5659
      if (!value) {
5660
        this.success = null;
5661
      }
5662
    }
5663
 
5664
    public PaymentException getPe() {
5665
      return this.pe;
5666
    }
5667
 
5668
    public getPaymentsForCart_result setPe(PaymentException pe) {
5669
      this.pe = pe;
5670
      return this;
5671
    }
5672
 
5673
    public void unsetPe() {
5674
      this.pe = null;
5675
    }
5676
 
5677
    /** Returns true if field pe is set (has been asigned a value) and false otherwise */
5678
    public boolean isSetPe() {
5679
      return this.pe != null;
5680
    }
5681
 
5682
    public void setPeIsSet(boolean value) {
5683
      if (!value) {
5684
        this.pe = null;
5685
      }
5686
    }
5687
 
5688
    public void setFieldValue(_Fields field, Object value) {
5689
      switch (field) {
5690
      case SUCCESS:
5691
        if (value == null) {
5692
          unsetSuccess();
5693
        } else {
5694
          setSuccess((List<Payment>)value);
5695
        }
5696
        break;
5697
 
5698
      case PE:
5699
        if (value == null) {
5700
          unsetPe();
5701
        } else {
5702
          setPe((PaymentException)value);
5703
        }
5704
        break;
5705
 
5706
      }
5707
    }
5708
 
5709
    public void setFieldValue(int fieldID, Object value) {
5710
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
5711
    }
5712
 
5713
    public Object getFieldValue(_Fields field) {
5714
      switch (field) {
5715
      case SUCCESS:
5716
        return getSuccess();
5717
 
5718
      case PE:
5719
        return getPe();
5720
 
5721
      }
5722
      throw new IllegalStateException();
5723
    }
5724
 
5725
    public Object getFieldValue(int fieldId) {
5726
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
5727
    }
5728
 
5729
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
5730
    public boolean isSet(_Fields field) {
5731
      switch (field) {
5732
      case SUCCESS:
5733
        return isSetSuccess();
5734
      case PE:
5735
        return isSetPe();
5736
      }
5737
      throw new IllegalStateException();
5738
    }
5739
 
5740
    public boolean isSet(int fieldID) {
5741
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
5742
    }
5743
 
5744
    @Override
5745
    public boolean equals(Object that) {
5746
      if (that == null)
5747
        return false;
5748
      if (that instanceof getPaymentsForCart_result)
5749
        return this.equals((getPaymentsForCart_result)that);
5750
      return false;
5751
    }
5752
 
5753
    public boolean equals(getPaymentsForCart_result that) {
5754
      if (that == null)
5755
        return false;
5756
 
5757
      boolean this_present_success = true && this.isSetSuccess();
5758
      boolean that_present_success = true && that.isSetSuccess();
5759
      if (this_present_success || that_present_success) {
5760
        if (!(this_present_success && that_present_success))
5761
          return false;
5762
        if (!this.success.equals(that.success))
5763
          return false;
5764
      }
5765
 
5766
      boolean this_present_pe = true && this.isSetPe();
5767
      boolean that_present_pe = true && that.isSetPe();
5768
      if (this_present_pe || that_present_pe) {
5769
        if (!(this_present_pe && that_present_pe))
5770
          return false;
5771
        if (!this.pe.equals(that.pe))
5772
          return false;
5773
      }
5774
 
5775
      return true;
5776
    }
5777
 
5778
    @Override
5779
    public int hashCode() {
5780
      return 0;
5781
    }
5782
 
5783
    public void read(TProtocol iprot) throws TException {
5784
      TField field;
5785
      iprot.readStructBegin();
5786
      while (true)
5787
      {
5788
        field = iprot.readFieldBegin();
5789
        if (field.type == TType.STOP) { 
5790
          break;
5791
        }
5792
        _Fields fieldId = _Fields.findByThriftId(field.id);
5793
        if (fieldId == null) {
5794
          TProtocolUtil.skip(iprot, field.type);
5795
        } else {
5796
          switch (fieldId) {
5797
            case SUCCESS:
5798
              if (field.type == TType.LIST) {
5799
                {
5800
                  TList _list17 = iprot.readListBegin();
5801
                  this.success = new ArrayList<Payment>(_list17.size);
5802
                  for (int _i18 = 0; _i18 < _list17.size; ++_i18)
5803
                  {
5804
                    Payment _elem19;
5805
                    _elem19 = new Payment();
5806
                    _elem19.read(iprot);
5807
                    this.success.add(_elem19);
5808
                  }
5809
                  iprot.readListEnd();
5810
                }
5811
              } else { 
5812
                TProtocolUtil.skip(iprot, field.type);
5813
              }
5814
              break;
5815
            case PE:
5816
              if (field.type == TType.STRUCT) {
5817
                this.pe = new PaymentException();
5818
                this.pe.read(iprot);
5819
              } else { 
5820
                TProtocolUtil.skip(iprot, field.type);
5821
              }
5822
              break;
5823
          }
5824
          iprot.readFieldEnd();
5825
        }
5826
      }
5827
      iprot.readStructEnd();
5828
      validate();
5829
    }
5830
 
5831
    public void write(TProtocol oprot) throws TException {
5832
      oprot.writeStructBegin(STRUCT_DESC);
5833
 
5834
      if (this.isSetSuccess()) {
5835
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
5836
        {
5837
          oprot.writeListBegin(new TList(TType.STRUCT, this.success.size()));
5838
          for (Payment _iter20 : this.success)
5839
          {
5840
            _iter20.write(oprot);
5841
          }
5842
          oprot.writeListEnd();
5843
        }
5844
        oprot.writeFieldEnd();
5845
      } else if (this.isSetPe()) {
5846
        oprot.writeFieldBegin(PE_FIELD_DESC);
5847
        this.pe.write(oprot);
5848
        oprot.writeFieldEnd();
5849
      }
5850
      oprot.writeFieldStop();
5851
      oprot.writeStructEnd();
5852
    }
5853
 
5854
    @Override
5855
    public String toString() {
5856
      StringBuilder sb = new StringBuilder("getPaymentsForCart_result(");
5857
      boolean first = true;
5858
 
5859
      sb.append("success:");
5860
      if (this.success == null) {
5861
        sb.append("null");
5862
      } else {
5863
        sb.append(this.success);
5864
      }
5865
      first = false;
5866
      if (!first) sb.append(", ");
5867
      sb.append("pe:");
5868
      if (this.pe == null) {
5869
        sb.append("null");
5870
      } else {
5871
        sb.append(this.pe);
5872
      }
5873
      first = false;
5874
      sb.append(")");
5875
      return sb.toString();
5876
    }
5877
 
5878
    public void validate() throws TException {
5879
      // check for required fields
5880
    }
5881
 
5882
  }
5883
 
5884
  public static class getPayments_args implements TBase<getPayments_args._Fields>, java.io.Serializable, Cloneable, Comparable<getPayments_args>   {
5885
    private static final TStruct STRUCT_DESC = new TStruct("getPayments_args");
5886
 
5887
    private static final TField FROM_TIME_FIELD_DESC = new TField("from_time", TType.I64, (short)1);
5888
    private static final TField TO_TIME_FIELD_DESC = new TField("to_time", TType.I64, (short)2);
5889
    private static final TField STATUS_FIELD_DESC = new TField("status", TType.I32, (short)3);
5890
    private static final TField GATEWAY_FIELD_DESC = new TField("gateway", TType.I32, (short)4);
5891
 
5892
    private long from_time;
5893
    private long to_time;
5894
    private PaymentStatus status;
5895
    private PaymentGateway gateway;
5896
 
5897
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
5898
    public enum _Fields implements TFieldIdEnum {
5899
      FROM_TIME((short)1, "from_time"),
5900
      TO_TIME((short)2, "to_time"),
5901
      /**
5902
       * 
5903
       * @see PaymentStatus
5904
       */
5905
      STATUS((short)3, "status"),
5906
      /**
5907
       * 
5908
       * @see PaymentGateway
5909
       */
5910
      GATEWAY((short)4, "gateway");
5911
 
5912
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
5913
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5914
 
5915
      static {
5916
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5917
          byId.put((int)field._thriftId, field);
5918
          byName.put(field.getFieldName(), field);
5919
        }
5920
      }
5921
 
5922
      /**
5923
       * Find the _Fields constant that matches fieldId, or null if its not found.
5924
       */
5925
      public static _Fields findByThriftId(int fieldId) {
5926
        return byId.get(fieldId);
5927
      }
5928
 
5929
      /**
5930
       * Find the _Fields constant that matches fieldId, throwing an exception
5931
       * if it is not found.
5932
       */
5933
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5934
        _Fields fields = findByThriftId(fieldId);
5935
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5936
        return fields;
5937
      }
5938
 
5939
      /**
5940
       * Find the _Fields constant that matches name, or null if its not found.
5941
       */
5942
      public static _Fields findByName(String name) {
5943
        return byName.get(name);
5944
      }
5945
 
5946
      private final short _thriftId;
5947
      private final String _fieldName;
5948
 
5949
      _Fields(short thriftId, String fieldName) {
5950
        _thriftId = thriftId;
5951
        _fieldName = fieldName;
5952
      }
5953
 
5954
      public short getThriftFieldId() {
5955
        return _thriftId;
5956
      }
5957
 
5958
      public String getFieldName() {
5959
        return _fieldName;
5960
      }
5961
    }
5962
 
5963
    // isset id assignments
5964
    private static final int __FROM_TIME_ISSET_ID = 0;
5965
    private static final int __TO_TIME_ISSET_ID = 1;
5966
    private BitSet __isset_bit_vector = new BitSet(2);
5967
 
5968
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
5969
      put(_Fields.FROM_TIME, new FieldMetaData("from_time", TFieldRequirementType.DEFAULT, 
5970
          new FieldValueMetaData(TType.I64)));
5971
      put(_Fields.TO_TIME, new FieldMetaData("to_time", TFieldRequirementType.DEFAULT, 
5972
          new FieldValueMetaData(TType.I64)));
5973
      put(_Fields.STATUS, new FieldMetaData("status", TFieldRequirementType.DEFAULT, 
5974
          new EnumMetaData(TType.ENUM, PaymentStatus.class)));
5975
      put(_Fields.GATEWAY, new FieldMetaData("gateway", TFieldRequirementType.DEFAULT, 
5976
          new EnumMetaData(TType.ENUM, PaymentGateway.class)));
5977
    }});
5978
 
5979
    static {
5980
      FieldMetaData.addStructMetaDataMap(getPayments_args.class, metaDataMap);
5981
    }
5982
 
5983
    public getPayments_args() {
5984
    }
5985
 
5986
    public getPayments_args(
5987
      long from_time,
5988
      long to_time,
5989
      PaymentStatus status,
5990
      PaymentGateway gateway)
5991
    {
5992
      this();
5993
      this.from_time = from_time;
5994
      setFrom_timeIsSet(true);
5995
      this.to_time = to_time;
5996
      setTo_timeIsSet(true);
5997
      this.status = status;
5998
      this.gateway = gateway;
5999
    }
6000
 
6001
    /**
6002
     * Performs a deep copy on <i>other</i>.
6003
     */
6004
    public getPayments_args(getPayments_args other) {
6005
      __isset_bit_vector.clear();
6006
      __isset_bit_vector.or(other.__isset_bit_vector);
6007
      this.from_time = other.from_time;
6008
      this.to_time = other.to_time;
6009
      if (other.isSetStatus()) {
6010
        this.status = other.status;
6011
      }
6012
      if (other.isSetGateway()) {
6013
        this.gateway = other.gateway;
6014
      }
6015
    }
6016
 
6017
    public getPayments_args deepCopy() {
6018
      return new getPayments_args(this);
6019
    }
6020
 
6021
    @Deprecated
6022
    public getPayments_args clone() {
6023
      return new getPayments_args(this);
6024
    }
6025
 
6026
    public long getFrom_time() {
6027
      return this.from_time;
6028
    }
6029
 
6030
    public getPayments_args setFrom_time(long from_time) {
6031
      this.from_time = from_time;
6032
      setFrom_timeIsSet(true);
6033
      return this;
6034
    }
6035
 
6036
    public void unsetFrom_time() {
6037
      __isset_bit_vector.clear(__FROM_TIME_ISSET_ID);
6038
    }
6039
 
6040
    /** Returns true if field from_time is set (has been asigned a value) and false otherwise */
6041
    public boolean isSetFrom_time() {
6042
      return __isset_bit_vector.get(__FROM_TIME_ISSET_ID);
6043
    }
6044
 
6045
    public void setFrom_timeIsSet(boolean value) {
6046
      __isset_bit_vector.set(__FROM_TIME_ISSET_ID, value);
6047
    }
6048
 
6049
    public long getTo_time() {
6050
      return this.to_time;
6051
    }
6052
 
6053
    public getPayments_args setTo_time(long to_time) {
6054
      this.to_time = to_time;
6055
      setTo_timeIsSet(true);
6056
      return this;
6057
    }
6058
 
6059
    public void unsetTo_time() {
6060
      __isset_bit_vector.clear(__TO_TIME_ISSET_ID);
6061
    }
6062
 
6063
    /** Returns true if field to_time is set (has been asigned a value) and false otherwise */
6064
    public boolean isSetTo_time() {
6065
      return __isset_bit_vector.get(__TO_TIME_ISSET_ID);
6066
    }
6067
 
6068
    public void setTo_timeIsSet(boolean value) {
6069
      __isset_bit_vector.set(__TO_TIME_ISSET_ID, value);
6070
    }
6071
 
6072
    /**
6073
     * 
6074
     * @see PaymentStatus
6075
     */
6076
    public PaymentStatus getStatus() {
6077
      return this.status;
6078
    }
6079
 
6080
    /**
6081
     * 
6082
     * @see PaymentStatus
6083
     */
6084
    public getPayments_args setStatus(PaymentStatus status) {
6085
      this.status = status;
6086
      return this;
6087
    }
6088
 
6089
    public void unsetStatus() {
6090
      this.status = null;
6091
    }
6092
 
6093
    /** Returns true if field status is set (has been asigned a value) and false otherwise */
6094
    public boolean isSetStatus() {
6095
      return this.status != null;
6096
    }
6097
 
6098
    public void setStatusIsSet(boolean value) {
6099
      if (!value) {
6100
        this.status = null;
6101
      }
6102
    }
6103
 
6104
    /**
6105
     * 
6106
     * @see PaymentGateway
6107
     */
6108
    public PaymentGateway getGateway() {
6109
      return this.gateway;
6110
    }
6111
 
6112
    /**
6113
     * 
6114
     * @see PaymentGateway
6115
     */
6116
    public getPayments_args setGateway(PaymentGateway gateway) {
6117
      this.gateway = gateway;
6118
      return this;
6119
    }
6120
 
6121
    public void unsetGateway() {
6122
      this.gateway = null;
6123
    }
6124
 
6125
    /** Returns true if field gateway is set (has been asigned a value) and false otherwise */
6126
    public boolean isSetGateway() {
6127
      return this.gateway != null;
6128
    }
6129
 
6130
    public void setGatewayIsSet(boolean value) {
6131
      if (!value) {
6132
        this.gateway = null;
6133
      }
6134
    }
6135
 
6136
    public void setFieldValue(_Fields field, Object value) {
6137
      switch (field) {
6138
      case FROM_TIME:
6139
        if (value == null) {
6140
          unsetFrom_time();
6141
        } else {
6142
          setFrom_time((Long)value);
6143
        }
6144
        break;
6145
 
6146
      case TO_TIME:
6147
        if (value == null) {
6148
          unsetTo_time();
6149
        } else {
6150
          setTo_time((Long)value);
6151
        }
6152
        break;
6153
 
6154
      case STATUS:
6155
        if (value == null) {
6156
          unsetStatus();
6157
        } else {
6158
          setStatus((PaymentStatus)value);
6159
        }
6160
        break;
6161
 
6162
      case GATEWAY:
6163
        if (value == null) {
6164
          unsetGateway();
6165
        } else {
6166
          setGateway((PaymentGateway)value);
6167
        }
6168
        break;
6169
 
6170
      }
6171
    }
6172
 
6173
    public void setFieldValue(int fieldID, Object value) {
6174
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
6175
    }
6176
 
6177
    public Object getFieldValue(_Fields field) {
6178
      switch (field) {
6179
      case FROM_TIME:
6180
        return new Long(getFrom_time());
6181
 
6182
      case TO_TIME:
6183
        return new Long(getTo_time());
6184
 
6185
      case STATUS:
6186
        return getStatus();
6187
 
6188
      case GATEWAY:
6189
        return getGateway();
6190
 
6191
      }
6192
      throw new IllegalStateException();
6193
    }
6194
 
6195
    public Object getFieldValue(int fieldId) {
6196
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
6197
    }
6198
 
6199
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
6200
    public boolean isSet(_Fields field) {
6201
      switch (field) {
6202
      case FROM_TIME:
6203
        return isSetFrom_time();
6204
      case TO_TIME:
6205
        return isSetTo_time();
6206
      case STATUS:
6207
        return isSetStatus();
6208
      case GATEWAY:
6209
        return isSetGateway();
6210
      }
6211
      throw new IllegalStateException();
6212
    }
6213
 
6214
    public boolean isSet(int fieldID) {
6215
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
6216
    }
6217
 
6218
    @Override
6219
    public boolean equals(Object that) {
6220
      if (that == null)
6221
        return false;
6222
      if (that instanceof getPayments_args)
6223
        return this.equals((getPayments_args)that);
6224
      return false;
6225
    }
6226
 
6227
    public boolean equals(getPayments_args that) {
6228
      if (that == null)
6229
        return false;
6230
 
6231
      boolean this_present_from_time = true;
6232
      boolean that_present_from_time = true;
6233
      if (this_present_from_time || that_present_from_time) {
6234
        if (!(this_present_from_time && that_present_from_time))
6235
          return false;
6236
        if (this.from_time != that.from_time)
6237
          return false;
6238
      }
6239
 
6240
      boolean this_present_to_time = true;
6241
      boolean that_present_to_time = true;
6242
      if (this_present_to_time || that_present_to_time) {
6243
        if (!(this_present_to_time && that_present_to_time))
6244
          return false;
6245
        if (this.to_time != that.to_time)
6246
          return false;
6247
      }
6248
 
6249
      boolean this_present_status = true && this.isSetStatus();
6250
      boolean that_present_status = true && that.isSetStatus();
6251
      if (this_present_status || that_present_status) {
6252
        if (!(this_present_status && that_present_status))
6253
          return false;
6254
        if (!this.status.equals(that.status))
6255
          return false;
6256
      }
6257
 
6258
      boolean this_present_gateway = true && this.isSetGateway();
6259
      boolean that_present_gateway = true && that.isSetGateway();
6260
      if (this_present_gateway || that_present_gateway) {
6261
        if (!(this_present_gateway && that_present_gateway))
6262
          return false;
6263
        if (!this.gateway.equals(that.gateway))
6264
          return false;
6265
      }
6266
 
6267
      return true;
6268
    }
6269
 
6270
    @Override
6271
    public int hashCode() {
6272
      return 0;
6273
    }
6274
 
6275
    public int compareTo(getPayments_args other) {
6276
      if (!getClass().equals(other.getClass())) {
6277
        return getClass().getName().compareTo(other.getClass().getName());
6278
      }
6279
 
6280
      int lastComparison = 0;
6281
      getPayments_args typedOther = (getPayments_args)other;
6282
 
6283
      lastComparison = Boolean.valueOf(isSetFrom_time()).compareTo(isSetFrom_time());
6284
      if (lastComparison != 0) {
6285
        return lastComparison;
6286
      }
6287
      lastComparison = TBaseHelper.compareTo(from_time, typedOther.from_time);
6288
      if (lastComparison != 0) {
6289
        return lastComparison;
6290
      }
6291
      lastComparison = Boolean.valueOf(isSetTo_time()).compareTo(isSetTo_time());
6292
      if (lastComparison != 0) {
6293
        return lastComparison;
6294
      }
6295
      lastComparison = TBaseHelper.compareTo(to_time, typedOther.to_time);
6296
      if (lastComparison != 0) {
6297
        return lastComparison;
6298
      }
6299
      lastComparison = Boolean.valueOf(isSetStatus()).compareTo(isSetStatus());
6300
      if (lastComparison != 0) {
6301
        return lastComparison;
6302
      }
6303
      lastComparison = TBaseHelper.compareTo(status, typedOther.status);
6304
      if (lastComparison != 0) {
6305
        return lastComparison;
6306
      }
6307
      lastComparison = Boolean.valueOf(isSetGateway()).compareTo(isSetGateway());
6308
      if (lastComparison != 0) {
6309
        return lastComparison;
6310
      }
6311
      lastComparison = TBaseHelper.compareTo(gateway, typedOther.gateway);
6312
      if (lastComparison != 0) {
6313
        return lastComparison;
6314
      }
6315
      return 0;
6316
    }
6317
 
6318
    public void read(TProtocol iprot) throws TException {
6319
      TField field;
6320
      iprot.readStructBegin();
6321
      while (true)
6322
      {
6323
        field = iprot.readFieldBegin();
6324
        if (field.type == TType.STOP) { 
6325
          break;
6326
        }
6327
        _Fields fieldId = _Fields.findByThriftId(field.id);
6328
        if (fieldId == null) {
6329
          TProtocolUtil.skip(iprot, field.type);
6330
        } else {
6331
          switch (fieldId) {
6332
            case FROM_TIME:
6333
              if (field.type == TType.I64) {
6334
                this.from_time = iprot.readI64();
6335
                setFrom_timeIsSet(true);
6336
              } else { 
6337
                TProtocolUtil.skip(iprot, field.type);
6338
              }
6339
              break;
6340
            case TO_TIME:
6341
              if (field.type == TType.I64) {
6342
                this.to_time = iprot.readI64();
6343
                setTo_timeIsSet(true);
6344
              } else { 
6345
                TProtocolUtil.skip(iprot, field.type);
6346
              }
6347
              break;
6348
            case STATUS:
6349
              if (field.type == TType.I32) {
6350
                this.status = PaymentStatus.findByValue(iprot.readI32());
6351
              } else { 
6352
                TProtocolUtil.skip(iprot, field.type);
6353
              }
6354
              break;
6355
            case GATEWAY:
6356
              if (field.type == TType.I32) {
6357
                this.gateway = PaymentGateway.findByValue(iprot.readI32());
6358
              } else { 
6359
                TProtocolUtil.skip(iprot, field.type);
6360
              }
6361
              break;
6362
          }
6363
          iprot.readFieldEnd();
6364
        }
6365
      }
6366
      iprot.readStructEnd();
6367
      validate();
6368
    }
6369
 
6370
    public void write(TProtocol oprot) throws TException {
6371
      validate();
6372
 
6373
      oprot.writeStructBegin(STRUCT_DESC);
6374
      oprot.writeFieldBegin(FROM_TIME_FIELD_DESC);
6375
      oprot.writeI64(this.from_time);
6376
      oprot.writeFieldEnd();
6377
      oprot.writeFieldBegin(TO_TIME_FIELD_DESC);
6378
      oprot.writeI64(this.to_time);
6379
      oprot.writeFieldEnd();
6380
      if (this.status != null) {
6381
        oprot.writeFieldBegin(STATUS_FIELD_DESC);
6382
        oprot.writeI32(this.status.getValue());
6383
        oprot.writeFieldEnd();
6384
      }
6385
      if (this.gateway != null) {
6386
        oprot.writeFieldBegin(GATEWAY_FIELD_DESC);
6387
        oprot.writeI32(this.gateway.getValue());
6388
        oprot.writeFieldEnd();
6389
      }
6390
      oprot.writeFieldStop();
6391
      oprot.writeStructEnd();
6392
    }
6393
 
6394
    @Override
6395
    public String toString() {
6396
      StringBuilder sb = new StringBuilder("getPayments_args(");
6397
      boolean first = true;
6398
 
6399
      sb.append("from_time:");
6400
      sb.append(this.from_time);
6401
      first = false;
6402
      if (!first) sb.append(", ");
6403
      sb.append("to_time:");
6404
      sb.append(this.to_time);
6405
      first = false;
6406
      if (!first) sb.append(", ");
6407
      sb.append("status:");
6408
      if (this.status == null) {
6409
        sb.append("null");
6410
      } else {
6411
        String status_name = status.name();
6412
        if (status_name != null) {
6413
          sb.append(status_name);
6414
          sb.append(" (");
6415
        }
6416
        sb.append(this.status);
6417
        if (status_name != null) {
6418
          sb.append(")");
6419
        }
6420
      }
6421
      first = false;
6422
      if (!first) sb.append(", ");
6423
      sb.append("gateway:");
6424
      if (this.gateway == null) {
6425
        sb.append("null");
6426
      } else {
6427
        String gateway_name = gateway.name();
6428
        if (gateway_name != null) {
6429
          sb.append(gateway_name);
6430
          sb.append(" (");
6431
        }
6432
        sb.append(this.gateway);
6433
        if (gateway_name != null) {
6434
          sb.append(")");
6435
        }
6436
      }
6437
      first = false;
6438
      sb.append(")");
6439
      return sb.toString();
6440
    }
6441
 
6442
    public void validate() throws TException {
6443
      // check for required fields
6444
    }
6445
 
6446
  }
6447
 
6448
  public static class getPayments_result implements TBase<getPayments_result._Fields>, java.io.Serializable, Cloneable   {
6449
    private static final TStruct STRUCT_DESC = new TStruct("getPayments_result");
6450
 
6451
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0);
6452
    private static final TField PE_FIELD_DESC = new TField("pe", TType.STRUCT, (short)1);
6453
 
6454
    private List<Payment> success;
6455
    private PaymentException pe;
6456
 
6457
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
6458
    public enum _Fields implements TFieldIdEnum {
6459
      SUCCESS((short)0, "success"),
6460
      PE((short)1, "pe");
6461
 
6462
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
6463
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
6464
 
6465
      static {
6466
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
6467
          byId.put((int)field._thriftId, field);
6468
          byName.put(field.getFieldName(), field);
6469
        }
6470
      }
6471
 
6472
      /**
6473
       * Find the _Fields constant that matches fieldId, or null if its not found.
6474
       */
6475
      public static _Fields findByThriftId(int fieldId) {
6476
        return byId.get(fieldId);
6477
      }
6478
 
6479
      /**
6480
       * Find the _Fields constant that matches fieldId, throwing an exception
6481
       * if it is not found.
6482
       */
6483
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6484
        _Fields fields = findByThriftId(fieldId);
6485
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6486
        return fields;
6487
      }
6488
 
6489
      /**
6490
       * Find the _Fields constant that matches name, or null if its not found.
6491
       */
6492
      public static _Fields findByName(String name) {
6493
        return byName.get(name);
6494
      }
6495
 
6496
      private final short _thriftId;
6497
      private final String _fieldName;
6498
 
6499
      _Fields(short thriftId, String fieldName) {
6500
        _thriftId = thriftId;
6501
        _fieldName = fieldName;
6502
      }
6503
 
6504
      public short getThriftFieldId() {
6505
        return _thriftId;
6506
      }
6507
 
6508
      public String getFieldName() {
6509
        return _fieldName;
6510
      }
6511
    }
6512
 
6513
    // isset id assignments
6514
 
6515
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
6516
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
6517
          new ListMetaData(TType.LIST, 
6518
              new StructMetaData(TType.STRUCT, Payment.class))));
6519
      put(_Fields.PE, new FieldMetaData("pe", TFieldRequirementType.DEFAULT, 
6520
          new FieldValueMetaData(TType.STRUCT)));
6521
    }});
6522
 
6523
    static {
6524
      FieldMetaData.addStructMetaDataMap(getPayments_result.class, metaDataMap);
6525
    }
6526
 
6527
    public getPayments_result() {
6528
    }
6529
 
6530
    public getPayments_result(
6531
      List<Payment> success,
6532
      PaymentException pe)
6533
    {
6534
      this();
6535
      this.success = success;
6536
      this.pe = pe;
6537
    }
6538
 
6539
    /**
6540
     * Performs a deep copy on <i>other</i>.
6541
     */
6542
    public getPayments_result(getPayments_result other) {
6543
      if (other.isSetSuccess()) {
6544
        List<Payment> __this__success = new ArrayList<Payment>();
6545
        for (Payment other_element : other.success) {
6546
          __this__success.add(new Payment(other_element));
6547
        }
6548
        this.success = __this__success;
6549
      }
6550
      if (other.isSetPe()) {
6551
        this.pe = new PaymentException(other.pe);
6552
      }
6553
    }
6554
 
6555
    public getPayments_result deepCopy() {
6556
      return new getPayments_result(this);
6557
    }
6558
 
6559
    @Deprecated
6560
    public getPayments_result clone() {
6561
      return new getPayments_result(this);
6562
    }
6563
 
6564
    public int getSuccessSize() {
6565
      return (this.success == null) ? 0 : this.success.size();
6566
    }
6567
 
6568
    public java.util.Iterator<Payment> getSuccessIterator() {
6569
      return (this.success == null) ? null : this.success.iterator();
6570
    }
6571
 
6572
    public void addToSuccess(Payment elem) {
6573
      if (this.success == null) {
6574
        this.success = new ArrayList<Payment>();
6575
      }
6576
      this.success.add(elem);
6577
    }
6578
 
6579
    public List<Payment> getSuccess() {
6580
      return this.success;
6581
    }
6582
 
6583
    public getPayments_result setSuccess(List<Payment> success) {
6584
      this.success = success;
6585
      return this;
6586
    }
6587
 
6588
    public void unsetSuccess() {
6589
      this.success = null;
6590
    }
6591
 
6592
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
6593
    public boolean isSetSuccess() {
6594
      return this.success != null;
6595
    }
6596
 
6597
    public void setSuccessIsSet(boolean value) {
6598
      if (!value) {
6599
        this.success = null;
6600
      }
6601
    }
6602
 
6603
    public PaymentException getPe() {
6604
      return this.pe;
6605
    }
6606
 
6607
    public getPayments_result setPe(PaymentException pe) {
6608
      this.pe = pe;
6609
      return this;
6610
    }
6611
 
6612
    public void unsetPe() {
6613
      this.pe = null;
6614
    }
6615
 
6616
    /** Returns true if field pe is set (has been asigned a value) and false otherwise */
6617
    public boolean isSetPe() {
6618
      return this.pe != null;
6619
    }
6620
 
6621
    public void setPeIsSet(boolean value) {
6622
      if (!value) {
6623
        this.pe = null;
6624
      }
6625
    }
6626
 
6627
    public void setFieldValue(_Fields field, Object value) {
6628
      switch (field) {
6629
      case SUCCESS:
6630
        if (value == null) {
6631
          unsetSuccess();
6632
        } else {
6633
          setSuccess((List<Payment>)value);
6634
        }
6635
        break;
6636
 
6637
      case PE:
6638
        if (value == null) {
6639
          unsetPe();
6640
        } else {
6641
          setPe((PaymentException)value);
6642
        }
6643
        break;
6644
 
6645
      }
6646
    }
6647
 
6648
    public void setFieldValue(int fieldID, Object value) {
6649
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
6650
    }
6651
 
6652
    public Object getFieldValue(_Fields field) {
6653
      switch (field) {
6654
      case SUCCESS:
6655
        return getSuccess();
6656
 
6657
      case PE:
6658
        return getPe();
6659
 
6660
      }
6661
      throw new IllegalStateException();
6662
    }
6663
 
6664
    public Object getFieldValue(int fieldId) {
6665
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
6666
    }
6667
 
6668
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
6669
    public boolean isSet(_Fields field) {
6670
      switch (field) {
6671
      case SUCCESS:
6672
        return isSetSuccess();
6673
      case PE:
6674
        return isSetPe();
6675
      }
6676
      throw new IllegalStateException();
6677
    }
6678
 
6679
    public boolean isSet(int fieldID) {
6680
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
6681
    }
6682
 
6683
    @Override
6684
    public boolean equals(Object that) {
6685
      if (that == null)
6686
        return false;
6687
      if (that instanceof getPayments_result)
6688
        return this.equals((getPayments_result)that);
6689
      return false;
6690
    }
6691
 
6692
    public boolean equals(getPayments_result that) {
6693
      if (that == null)
6694
        return false;
6695
 
6696
      boolean this_present_success = true && this.isSetSuccess();
6697
      boolean that_present_success = true && that.isSetSuccess();
6698
      if (this_present_success || that_present_success) {
6699
        if (!(this_present_success && that_present_success))
6700
          return false;
6701
        if (!this.success.equals(that.success))
6702
          return false;
6703
      }
6704
 
6705
      boolean this_present_pe = true && this.isSetPe();
6706
      boolean that_present_pe = true && that.isSetPe();
6707
      if (this_present_pe || that_present_pe) {
6708
        if (!(this_present_pe && that_present_pe))
6709
          return false;
6710
        if (!this.pe.equals(that.pe))
6711
          return false;
6712
      }
6713
 
6714
      return true;
6715
    }
6716
 
6717
    @Override
6718
    public int hashCode() {
6719
      return 0;
6720
    }
6721
 
6722
    public void read(TProtocol iprot) throws TException {
6723
      TField field;
6724
      iprot.readStructBegin();
6725
      while (true)
6726
      {
6727
        field = iprot.readFieldBegin();
6728
        if (field.type == TType.STOP) { 
6729
          break;
6730
        }
6731
        _Fields fieldId = _Fields.findByThriftId(field.id);
6732
        if (fieldId == null) {
6733
          TProtocolUtil.skip(iprot, field.type);
6734
        } else {
6735
          switch (fieldId) {
6736
            case SUCCESS:
6737
              if (field.type == TType.LIST) {
6738
                {
6739
                  TList _list21 = iprot.readListBegin();
6740
                  this.success = new ArrayList<Payment>(_list21.size);
6741
                  for (int _i22 = 0; _i22 < _list21.size; ++_i22)
6742
                  {
6743
                    Payment _elem23;
6744
                    _elem23 = new Payment();
6745
                    _elem23.read(iprot);
6746
                    this.success.add(_elem23);
6747
                  }
6748
                  iprot.readListEnd();
6749
                }
6750
              } else { 
6751
                TProtocolUtil.skip(iprot, field.type);
6752
              }
6753
              break;
6754
            case PE:
6755
              if (field.type == TType.STRUCT) {
6756
                this.pe = new PaymentException();
6757
                this.pe.read(iprot);
6758
              } else { 
6759
                TProtocolUtil.skip(iprot, field.type);
6760
              }
6761
              break;
6762
          }
6763
          iprot.readFieldEnd();
6764
        }
6765
      }
6766
      iprot.readStructEnd();
6767
      validate();
6768
    }
6769
 
6770
    public void write(TProtocol oprot) throws TException {
6771
      oprot.writeStructBegin(STRUCT_DESC);
6772
 
6773
      if (this.isSetSuccess()) {
6774
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
6775
        {
6776
          oprot.writeListBegin(new TList(TType.STRUCT, this.success.size()));
6777
          for (Payment _iter24 : this.success)
6778
          {
6779
            _iter24.write(oprot);
6780
          }
6781
          oprot.writeListEnd();
6782
        }
6783
        oprot.writeFieldEnd();
6784
      } else if (this.isSetPe()) {
6785
        oprot.writeFieldBegin(PE_FIELD_DESC);
6786
        this.pe.write(oprot);
6787
        oprot.writeFieldEnd();
6788
      }
6789
      oprot.writeFieldStop();
6790
      oprot.writeStructEnd();
6791
    }
6792
 
6793
    @Override
6794
    public String toString() {
6795
      StringBuilder sb = new StringBuilder("getPayments_result(");
6796
      boolean first = true;
6797
 
6798
      sb.append("success:");
6799
      if (this.success == null) {
6800
        sb.append("null");
6801
      } else {
6802
        sb.append(this.success);
6803
      }
6804
      first = false;
6805
      if (!first) sb.append(", ");
6806
      sb.append("pe:");
6807
      if (this.pe == null) {
6808
        sb.append("null");
6809
      } else {
6810
        sb.append(this.pe);
6811
      }
6812
      first = false;
6813
      sb.append(")");
6814
      return sb.toString();
6815
    }
6816
 
6817
    public void validate() throws TException {
6818
      // check for required fields
6819
    }
6820
 
6821
  }
6822
 
6823
  public static class getPaymentForMerchantId_args implements TBase<getPaymentForMerchantId_args._Fields>, java.io.Serializable, Cloneable, Comparable<getPaymentForMerchantId_args>   {
6824
    private static final TStruct STRUCT_DESC = new TStruct("getPaymentForMerchantId_args");
6825
 
6826
    private static final TField MERCHANT_TX_ID_FIELD_DESC = new TField("merchant_tx_id", TType.I64, (short)1);
6827
 
6828
    private long merchant_tx_id;
6829
 
6830
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
6831
    public enum _Fields implements TFieldIdEnum {
6832
      MERCHANT_TX_ID((short)1, "merchant_tx_id");
6833
 
6834
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
6835
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
6836
 
6837
      static {
6838
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
6839
          byId.put((int)field._thriftId, field);
6840
          byName.put(field.getFieldName(), field);
6841
        }
6842
      }
6843
 
6844
      /**
6845
       * Find the _Fields constant that matches fieldId, or null if its not found.
6846
       */
6847
      public static _Fields findByThriftId(int fieldId) {
6848
        return byId.get(fieldId);
6849
      }
6850
 
6851
      /**
6852
       * Find the _Fields constant that matches fieldId, throwing an exception
6853
       * if it is not found.
6854
       */
6855
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6856
        _Fields fields = findByThriftId(fieldId);
6857
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6858
        return fields;
6859
      }
6860
 
6861
      /**
6862
       * Find the _Fields constant that matches name, or null if its not found.
6863
       */
6864
      public static _Fields findByName(String name) {
6865
        return byName.get(name);
6866
      }
6867
 
6868
      private final short _thriftId;
6869
      private final String _fieldName;
6870
 
6871
      _Fields(short thriftId, String fieldName) {
6872
        _thriftId = thriftId;
6873
        _fieldName = fieldName;
6874
      }
6875
 
6876
      public short getThriftFieldId() {
6877
        return _thriftId;
6878
      }
6879
 
6880
      public String getFieldName() {
6881
        return _fieldName;
6882
      }
6883
    }
6884
 
6885
    // isset id assignments
6886
    private static final int __MERCHANT_TX_ID_ISSET_ID = 0;
6887
    private BitSet __isset_bit_vector = new BitSet(1);
6888
 
6889
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
6890
      put(_Fields.MERCHANT_TX_ID, new FieldMetaData("merchant_tx_id", TFieldRequirementType.DEFAULT, 
6891
          new FieldValueMetaData(TType.I64)));
6892
    }});
6893
 
6894
    static {
6895
      FieldMetaData.addStructMetaDataMap(getPaymentForMerchantId_args.class, metaDataMap);
6896
    }
6897
 
6898
    public getPaymentForMerchantId_args() {
6899
    }
6900
 
6901
    public getPaymentForMerchantId_args(
6902
      long merchant_tx_id)
6903
    {
6904
      this();
6905
      this.merchant_tx_id = merchant_tx_id;
6906
      setMerchant_tx_idIsSet(true);
6907
    }
6908
 
6909
    /**
6910
     * Performs a deep copy on <i>other</i>.
6911
     */
6912
    public getPaymentForMerchantId_args(getPaymentForMerchantId_args other) {
6913
      __isset_bit_vector.clear();
6914
      __isset_bit_vector.or(other.__isset_bit_vector);
6915
      this.merchant_tx_id = other.merchant_tx_id;
6916
    }
6917
 
6918
    public getPaymentForMerchantId_args deepCopy() {
6919
      return new getPaymentForMerchantId_args(this);
6920
    }
6921
 
6922
    @Deprecated
6923
    public getPaymentForMerchantId_args clone() {
6924
      return new getPaymentForMerchantId_args(this);
6925
    }
6926
 
6927
    public long getMerchant_tx_id() {
6928
      return this.merchant_tx_id;
6929
    }
6930
 
6931
    public getPaymentForMerchantId_args setMerchant_tx_id(long merchant_tx_id) {
6932
      this.merchant_tx_id = merchant_tx_id;
6933
      setMerchant_tx_idIsSet(true);
6934
      return this;
6935
    }
6936
 
6937
    public void unsetMerchant_tx_id() {
6938
      __isset_bit_vector.clear(__MERCHANT_TX_ID_ISSET_ID);
6939
    }
6940
 
6941
    /** Returns true if field merchant_tx_id is set (has been asigned a value) and false otherwise */
6942
    public boolean isSetMerchant_tx_id() {
6943
      return __isset_bit_vector.get(__MERCHANT_TX_ID_ISSET_ID);
6944
    }
6945
 
6946
    public void setMerchant_tx_idIsSet(boolean value) {
6947
      __isset_bit_vector.set(__MERCHANT_TX_ID_ISSET_ID, value);
6948
    }
6949
 
6950
    public void setFieldValue(_Fields field, Object value) {
6951
      switch (field) {
6952
      case MERCHANT_TX_ID:
6953
        if (value == null) {
6954
          unsetMerchant_tx_id();
6955
        } else {
6956
          setMerchant_tx_id((Long)value);
6957
        }
6958
        break;
6959
 
6960
      }
6961
    }
6962
 
6963
    public void setFieldValue(int fieldID, Object value) {
6964
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
6965
    }
6966
 
6967
    public Object getFieldValue(_Fields field) {
6968
      switch (field) {
6969
      case MERCHANT_TX_ID:
6970
        return new Long(getMerchant_tx_id());
6971
 
6972
      }
6973
      throw new IllegalStateException();
6974
    }
6975
 
6976
    public Object getFieldValue(int fieldId) {
6977
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
6978
    }
6979
 
6980
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
6981
    public boolean isSet(_Fields field) {
6982
      switch (field) {
6983
      case MERCHANT_TX_ID:
6984
        return isSetMerchant_tx_id();
6985
      }
6986
      throw new IllegalStateException();
6987
    }
6988
 
6989
    public boolean isSet(int fieldID) {
6990
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
6991
    }
6992
 
6993
    @Override
6994
    public boolean equals(Object that) {
6995
      if (that == null)
6996
        return false;
6997
      if (that instanceof getPaymentForMerchantId_args)
6998
        return this.equals((getPaymentForMerchantId_args)that);
6999
      return false;
7000
    }
7001
 
7002
    public boolean equals(getPaymentForMerchantId_args that) {
7003
      if (that == null)
7004
        return false;
7005
 
7006
      boolean this_present_merchant_tx_id = true;
7007
      boolean that_present_merchant_tx_id = true;
7008
      if (this_present_merchant_tx_id || that_present_merchant_tx_id) {
7009
        if (!(this_present_merchant_tx_id && that_present_merchant_tx_id))
7010
          return false;
7011
        if (this.merchant_tx_id != that.merchant_tx_id)
7012
          return false;
7013
      }
7014
 
7015
      return true;
7016
    }
7017
 
7018
    @Override
7019
    public int hashCode() {
7020
      return 0;
7021
    }
7022
 
7023
    public int compareTo(getPaymentForMerchantId_args other) {
7024
      if (!getClass().equals(other.getClass())) {
7025
        return getClass().getName().compareTo(other.getClass().getName());
7026
      }
7027
 
7028
      int lastComparison = 0;
7029
      getPaymentForMerchantId_args typedOther = (getPaymentForMerchantId_args)other;
7030
 
7031
      lastComparison = Boolean.valueOf(isSetMerchant_tx_id()).compareTo(isSetMerchant_tx_id());
7032
      if (lastComparison != 0) {
7033
        return lastComparison;
7034
      }
7035
      lastComparison = TBaseHelper.compareTo(merchant_tx_id, typedOther.merchant_tx_id);
7036
      if (lastComparison != 0) {
7037
        return lastComparison;
7038
      }
7039
      return 0;
7040
    }
7041
 
7042
    public void read(TProtocol iprot) throws TException {
7043
      TField field;
7044
      iprot.readStructBegin();
7045
      while (true)
7046
      {
7047
        field = iprot.readFieldBegin();
7048
        if (field.type == TType.STOP) { 
7049
          break;
7050
        }
7051
        _Fields fieldId = _Fields.findByThriftId(field.id);
7052
        if (fieldId == null) {
7053
          TProtocolUtil.skip(iprot, field.type);
7054
        } else {
7055
          switch (fieldId) {
7056
            case MERCHANT_TX_ID:
7057
              if (field.type == TType.I64) {
7058
                this.merchant_tx_id = iprot.readI64();
7059
                setMerchant_tx_idIsSet(true);
7060
              } else { 
7061
                TProtocolUtil.skip(iprot, field.type);
7062
              }
7063
              break;
7064
          }
7065
          iprot.readFieldEnd();
7066
        }
7067
      }
7068
      iprot.readStructEnd();
7069
      validate();
7070
    }
7071
 
7072
    public void write(TProtocol oprot) throws TException {
7073
      validate();
7074
 
7075
      oprot.writeStructBegin(STRUCT_DESC);
7076
      oprot.writeFieldBegin(MERCHANT_TX_ID_FIELD_DESC);
7077
      oprot.writeI64(this.merchant_tx_id);
7078
      oprot.writeFieldEnd();
7079
      oprot.writeFieldStop();
7080
      oprot.writeStructEnd();
7081
    }
7082
 
7083
    @Override
7084
    public String toString() {
7085
      StringBuilder sb = new StringBuilder("getPaymentForMerchantId_args(");
7086
      boolean first = true;
7087
 
7088
      sb.append("merchant_tx_id:");
7089
      sb.append(this.merchant_tx_id);
7090
      first = false;
7091
      sb.append(")");
7092
      return sb.toString();
7093
    }
7094
 
7095
    public void validate() throws TException {
7096
      // check for required fields
7097
    }
7098
 
7099
  }
7100
 
7101
  public static class getPaymentForMerchantId_result implements TBase<getPaymentForMerchantId_result._Fields>, java.io.Serializable, Cloneable   {
7102
    private static final TStruct STRUCT_DESC = new TStruct("getPaymentForMerchantId_result");
7103
 
7104
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0);
7105
    private static final TField PE_FIELD_DESC = new TField("pe", TType.STRUCT, (short)1);
7106
 
7107
    private Payment success;
7108
    private PaymentException pe;
7109
 
7110
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
7111
    public enum _Fields implements TFieldIdEnum {
7112
      SUCCESS((short)0, "success"),
7113
      PE((short)1, "pe");
7114
 
7115
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
7116
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
7117
 
7118
      static {
7119
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
7120
          byId.put((int)field._thriftId, field);
7121
          byName.put(field.getFieldName(), field);
7122
        }
7123
      }
7124
 
7125
      /**
7126
       * Find the _Fields constant that matches fieldId, or null if its not found.
7127
       */
7128
      public static _Fields findByThriftId(int fieldId) {
7129
        return byId.get(fieldId);
7130
      }
7131
 
7132
      /**
7133
       * Find the _Fields constant that matches fieldId, throwing an exception
7134
       * if it is not found.
7135
       */
7136
      public static _Fields findByThriftIdOrThrow(int fieldId) {
7137
        _Fields fields = findByThriftId(fieldId);
7138
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
7139
        return fields;
7140
      }
7141
 
7142
      /**
7143
       * Find the _Fields constant that matches name, or null if its not found.
7144
       */
7145
      public static _Fields findByName(String name) {
7146
        return byName.get(name);
7147
      }
7148
 
7149
      private final short _thriftId;
7150
      private final String _fieldName;
7151
 
7152
      _Fields(short thriftId, String fieldName) {
7153
        _thriftId = thriftId;
7154
        _fieldName = fieldName;
7155
      }
7156
 
7157
      public short getThriftFieldId() {
7158
        return _thriftId;
7159
      }
7160
 
7161
      public String getFieldName() {
7162
        return _fieldName;
7163
      }
7164
    }
7165
 
7166
    // isset id assignments
7167
 
7168
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
7169
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
7170
          new StructMetaData(TType.STRUCT, Payment.class)));
7171
      put(_Fields.PE, new FieldMetaData("pe", TFieldRequirementType.DEFAULT, 
7172
          new FieldValueMetaData(TType.STRUCT)));
7173
    }});
7174
 
7175
    static {
7176
      FieldMetaData.addStructMetaDataMap(getPaymentForMerchantId_result.class, metaDataMap);
7177
    }
7178
 
7179
    public getPaymentForMerchantId_result() {
7180
    }
7181
 
7182
    public getPaymentForMerchantId_result(
7183
      Payment success,
7184
      PaymentException pe)
7185
    {
7186
      this();
7187
      this.success = success;
7188
      this.pe = pe;
7189
    }
7190
 
7191
    /**
7192
     * Performs a deep copy on <i>other</i>.
7193
     */
7194
    public getPaymentForMerchantId_result(getPaymentForMerchantId_result other) {
7195
      if (other.isSetSuccess()) {
7196
        this.success = new Payment(other.success);
7197
      }
7198
      if (other.isSetPe()) {
7199
        this.pe = new PaymentException(other.pe);
7200
      }
7201
    }
7202
 
7203
    public getPaymentForMerchantId_result deepCopy() {
7204
      return new getPaymentForMerchantId_result(this);
7205
    }
7206
 
7207
    @Deprecated
7208
    public getPaymentForMerchantId_result clone() {
7209
      return new getPaymentForMerchantId_result(this);
7210
    }
7211
 
7212
    public Payment getSuccess() {
7213
      return this.success;
7214
    }
7215
 
7216
    public getPaymentForMerchantId_result setSuccess(Payment success) {
7217
      this.success = success;
7218
      return this;
7219
    }
7220
 
7221
    public void unsetSuccess() {
7222
      this.success = null;
7223
    }
7224
 
7225
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
7226
    public boolean isSetSuccess() {
7227
      return this.success != null;
7228
    }
7229
 
7230
    public void setSuccessIsSet(boolean value) {
7231
      if (!value) {
7232
        this.success = null;
7233
      }
7234
    }
7235
 
7236
    public PaymentException getPe() {
7237
      return this.pe;
7238
    }
7239
 
7240
    public getPaymentForMerchantId_result setPe(PaymentException pe) {
7241
      this.pe = pe;
7242
      return this;
7243
    }
7244
 
7245
    public void unsetPe() {
7246
      this.pe = null;
7247
    }
7248
 
7249
    /** Returns true if field pe is set (has been asigned a value) and false otherwise */
7250
    public boolean isSetPe() {
7251
      return this.pe != null;
7252
    }
7253
 
7254
    public void setPeIsSet(boolean value) {
7255
      if (!value) {
7256
        this.pe = null;
7257
      }
7258
    }
7259
 
7260
    public void setFieldValue(_Fields field, Object value) {
7261
      switch (field) {
7262
      case SUCCESS:
7263
        if (value == null) {
7264
          unsetSuccess();
7265
        } else {
7266
          setSuccess((Payment)value);
7267
        }
7268
        break;
7269
 
7270
      case PE:
7271
        if (value == null) {
7272
          unsetPe();
7273
        } else {
7274
          setPe((PaymentException)value);
7275
        }
7276
        break;
7277
 
7278
      }
7279
    }
7280
 
7281
    public void setFieldValue(int fieldID, Object value) {
7282
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
7283
    }
7284
 
7285
    public Object getFieldValue(_Fields field) {
7286
      switch (field) {
7287
      case SUCCESS:
7288
        return getSuccess();
7289
 
7290
      case PE:
7291
        return getPe();
7292
 
7293
      }
7294
      throw new IllegalStateException();
7295
    }
7296
 
7297
    public Object getFieldValue(int fieldId) {
7298
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
7299
    }
7300
 
7301
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
7302
    public boolean isSet(_Fields field) {
7303
      switch (field) {
7304
      case SUCCESS:
7305
        return isSetSuccess();
7306
      case PE:
7307
        return isSetPe();
7308
      }
7309
      throw new IllegalStateException();
7310
    }
7311
 
7312
    public boolean isSet(int fieldID) {
7313
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
7314
    }
7315
 
7316
    @Override
7317
    public boolean equals(Object that) {
7318
      if (that == null)
7319
        return false;
7320
      if (that instanceof getPaymentForMerchantId_result)
7321
        return this.equals((getPaymentForMerchantId_result)that);
7322
      return false;
7323
    }
7324
 
7325
    public boolean equals(getPaymentForMerchantId_result that) {
7326
      if (that == null)
7327
        return false;
7328
 
7329
      boolean this_present_success = true && this.isSetSuccess();
7330
      boolean that_present_success = true && that.isSetSuccess();
7331
      if (this_present_success || that_present_success) {
7332
        if (!(this_present_success && that_present_success))
7333
          return false;
7334
        if (!this.success.equals(that.success))
7335
          return false;
7336
      }
7337
 
7338
      boolean this_present_pe = true && this.isSetPe();
7339
      boolean that_present_pe = true && that.isSetPe();
7340
      if (this_present_pe || that_present_pe) {
7341
        if (!(this_present_pe && that_present_pe))
7342
          return false;
7343
        if (!this.pe.equals(that.pe))
7344
          return false;
7345
      }
7346
 
7347
      return true;
7348
    }
7349
 
7350
    @Override
7351
    public int hashCode() {
7352
      return 0;
7353
    }
7354
 
7355
    public void read(TProtocol iprot) throws TException {
7356
      TField field;
7357
      iprot.readStructBegin();
7358
      while (true)
7359
      {
7360
        field = iprot.readFieldBegin();
7361
        if (field.type == TType.STOP) { 
7362
          break;
7363
        }
7364
        _Fields fieldId = _Fields.findByThriftId(field.id);
7365
        if (fieldId == null) {
7366
          TProtocolUtil.skip(iprot, field.type);
7367
        } else {
7368
          switch (fieldId) {
7369
            case SUCCESS:
7370
              if (field.type == TType.STRUCT) {
7371
                this.success = new Payment();
7372
                this.success.read(iprot);
7373
              } else { 
7374
                TProtocolUtil.skip(iprot, field.type);
7375
              }
7376
              break;
7377
            case PE:
7378
              if (field.type == TType.STRUCT) {
7379
                this.pe = new PaymentException();
7380
                this.pe.read(iprot);
7381
              } else { 
7382
                TProtocolUtil.skip(iprot, field.type);
7383
              }
7384
              break;
7385
          }
7386
          iprot.readFieldEnd();
7387
        }
7388
      }
7389
      iprot.readStructEnd();
7390
      validate();
7391
    }
7392
 
7393
    public void write(TProtocol oprot) throws TException {
7394
      oprot.writeStructBegin(STRUCT_DESC);
7395
 
7396
      if (this.isSetSuccess()) {
7397
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
7398
        this.success.write(oprot);
7399
        oprot.writeFieldEnd();
7400
      } else if (this.isSetPe()) {
7401
        oprot.writeFieldBegin(PE_FIELD_DESC);
7402
        this.pe.write(oprot);
7403
        oprot.writeFieldEnd();
7404
      }
7405
      oprot.writeFieldStop();
7406
      oprot.writeStructEnd();
7407
    }
7408
 
7409
    @Override
7410
    public String toString() {
7411
      StringBuilder sb = new StringBuilder("getPaymentForMerchantId_result(");
7412
      boolean first = true;
7413
 
7414
      sb.append("success:");
7415
      if (this.success == null) {
7416
        sb.append("null");
7417
      } else {
7418
        sb.append(this.success);
7419
      }
7420
      first = false;
7421
      if (!first) sb.append(", ");
7422
      sb.append("pe:");
7423
      if (this.pe == null) {
7424
        sb.append("null");
7425
      } else {
7426
        sb.append(this.pe);
7427
      }
7428
      first = false;
7429
      sb.append(")");
7430
      return sb.toString();
7431
    }
7432
 
7433
    public void validate() throws TException {
7434
      // check for required fields
7435
    }
7436
 
7437
  }
7438
 
7439
  public static class changePaymentStatus_args implements TBase<changePaymentStatus_args._Fields>, java.io.Serializable, Cloneable, Comparable<changePaymentStatus_args>   {
7440
    private static final TStruct STRUCT_DESC = new TStruct("changePaymentStatus_args");
7441
 
7442
    private static final TField MERCHANT_TX_ID_FIELD_DESC = new TField("merchant_tx_id", TType.I64, (short)1);
7443
    private static final TField NEW_STATUS_FIELD_DESC = new TField("newStatus", TType.I32, (short)2);
7444
 
7445
    private long merchant_tx_id;
7446
    private PaymentStatus newStatus;
7447
 
7448
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
7449
    public enum _Fields implements TFieldIdEnum {
7450
      MERCHANT_TX_ID((short)1, "merchant_tx_id"),
7451
      /**
7452
       * 
7453
       * @see PaymentStatus
7454
       */
7455
      NEW_STATUS((short)2, "newStatus");
7456
 
7457
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
7458
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
7459
 
7460
      static {
7461
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
7462
          byId.put((int)field._thriftId, field);
7463
          byName.put(field.getFieldName(), field);
7464
        }
7465
      }
7466
 
7467
      /**
7468
       * Find the _Fields constant that matches fieldId, or null if its not found.
7469
       */
7470
      public static _Fields findByThriftId(int fieldId) {
7471
        return byId.get(fieldId);
7472
      }
7473
 
7474
      /**
7475
       * Find the _Fields constant that matches fieldId, throwing an exception
7476
       * if it is not found.
7477
       */
7478
      public static _Fields findByThriftIdOrThrow(int fieldId) {
7479
        _Fields fields = findByThriftId(fieldId);
7480
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
7481
        return fields;
7482
      }
7483
 
7484
      /**
7485
       * Find the _Fields constant that matches name, or null if its not found.
7486
       */
7487
      public static _Fields findByName(String name) {
7488
        return byName.get(name);
7489
      }
7490
 
7491
      private final short _thriftId;
7492
      private final String _fieldName;
7493
 
7494
      _Fields(short thriftId, String fieldName) {
7495
        _thriftId = thriftId;
7496
        _fieldName = fieldName;
7497
      }
7498
 
7499
      public short getThriftFieldId() {
7500
        return _thriftId;
7501
      }
7502
 
7503
      public String getFieldName() {
7504
        return _fieldName;
7505
      }
7506
    }
7507
 
7508
    // isset id assignments
7509
    private static final int __MERCHANT_TX_ID_ISSET_ID = 0;
7510
    private BitSet __isset_bit_vector = new BitSet(1);
7511
 
7512
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
7513
      put(_Fields.MERCHANT_TX_ID, new FieldMetaData("merchant_tx_id", TFieldRequirementType.DEFAULT, 
7514
          new FieldValueMetaData(TType.I64)));
7515
      put(_Fields.NEW_STATUS, new FieldMetaData("newStatus", TFieldRequirementType.DEFAULT, 
7516
          new EnumMetaData(TType.ENUM, PaymentStatus.class)));
7517
    }});
7518
 
7519
    static {
7520
      FieldMetaData.addStructMetaDataMap(changePaymentStatus_args.class, metaDataMap);
7521
    }
7522
 
7523
    public changePaymentStatus_args() {
7524
    }
7525
 
7526
    public changePaymentStatus_args(
7527
      long merchant_tx_id,
7528
      PaymentStatus newStatus)
7529
    {
7530
      this();
7531
      this.merchant_tx_id = merchant_tx_id;
7532
      setMerchant_tx_idIsSet(true);
7533
      this.newStatus = newStatus;
7534
    }
7535
 
7536
    /**
7537
     * Performs a deep copy on <i>other</i>.
7538
     */
7539
    public changePaymentStatus_args(changePaymentStatus_args other) {
7540
      __isset_bit_vector.clear();
7541
      __isset_bit_vector.or(other.__isset_bit_vector);
7542
      this.merchant_tx_id = other.merchant_tx_id;
7543
      if (other.isSetNewStatus()) {
7544
        this.newStatus = other.newStatus;
7545
      }
7546
    }
7547
 
7548
    public changePaymentStatus_args deepCopy() {
7549
      return new changePaymentStatus_args(this);
7550
    }
7551
 
7552
    @Deprecated
7553
    public changePaymentStatus_args clone() {
7554
      return new changePaymentStatus_args(this);
7555
    }
7556
 
7557
    public long getMerchant_tx_id() {
7558
      return this.merchant_tx_id;
7559
    }
7560
 
7561
    public changePaymentStatus_args setMerchant_tx_id(long merchant_tx_id) {
7562
      this.merchant_tx_id = merchant_tx_id;
7563
      setMerchant_tx_idIsSet(true);
7564
      return this;
7565
    }
7566
 
7567
    public void unsetMerchant_tx_id() {
7568
      __isset_bit_vector.clear(__MERCHANT_TX_ID_ISSET_ID);
7569
    }
7570
 
7571
    /** Returns true if field merchant_tx_id is set (has been asigned a value) and false otherwise */
7572
    public boolean isSetMerchant_tx_id() {
7573
      return __isset_bit_vector.get(__MERCHANT_TX_ID_ISSET_ID);
7574
    }
7575
 
7576
    public void setMerchant_tx_idIsSet(boolean value) {
7577
      __isset_bit_vector.set(__MERCHANT_TX_ID_ISSET_ID, value);
7578
    }
7579
 
7580
    /**
7581
     * 
7582
     * @see PaymentStatus
7583
     */
7584
    public PaymentStatus getNewStatus() {
7585
      return this.newStatus;
7586
    }
7587
 
7588
    /**
7589
     * 
7590
     * @see PaymentStatus
7591
     */
7592
    public changePaymentStatus_args setNewStatus(PaymentStatus newStatus) {
7593
      this.newStatus = newStatus;
7594
      return this;
7595
    }
7596
 
7597
    public void unsetNewStatus() {
7598
      this.newStatus = null;
7599
    }
7600
 
7601
    /** Returns true if field newStatus is set (has been asigned a value) and false otherwise */
7602
    public boolean isSetNewStatus() {
7603
      return this.newStatus != null;
7604
    }
7605
 
7606
    public void setNewStatusIsSet(boolean value) {
7607
      if (!value) {
7608
        this.newStatus = null;
7609
      }
7610
    }
7611
 
7612
    public void setFieldValue(_Fields field, Object value) {
7613
      switch (field) {
7614
      case MERCHANT_TX_ID:
7615
        if (value == null) {
7616
          unsetMerchant_tx_id();
7617
        } else {
7618
          setMerchant_tx_id((Long)value);
7619
        }
7620
        break;
7621
 
7622
      case NEW_STATUS:
7623
        if (value == null) {
7624
          unsetNewStatus();
7625
        } else {
7626
          setNewStatus((PaymentStatus)value);
7627
        }
7628
        break;
7629
 
7630
      }
7631
    }
7632
 
7633
    public void setFieldValue(int fieldID, Object value) {
7634
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
7635
    }
7636
 
7637
    public Object getFieldValue(_Fields field) {
7638
      switch (field) {
7639
      case MERCHANT_TX_ID:
7640
        return new Long(getMerchant_tx_id());
7641
 
7642
      case NEW_STATUS:
7643
        return getNewStatus();
7644
 
7645
      }
7646
      throw new IllegalStateException();
7647
    }
7648
 
7649
    public Object getFieldValue(int fieldId) {
7650
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
7651
    }
7652
 
7653
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
7654
    public boolean isSet(_Fields field) {
7655
      switch (field) {
7656
      case MERCHANT_TX_ID:
7657
        return isSetMerchant_tx_id();
7658
      case NEW_STATUS:
7659
        return isSetNewStatus();
7660
      }
7661
      throw new IllegalStateException();
7662
    }
7663
 
7664
    public boolean isSet(int fieldID) {
7665
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
7666
    }
7667
 
7668
    @Override
7669
    public boolean equals(Object that) {
7670
      if (that == null)
7671
        return false;
7672
      if (that instanceof changePaymentStatus_args)
7673
        return this.equals((changePaymentStatus_args)that);
7674
      return false;
7675
    }
7676
 
7677
    public boolean equals(changePaymentStatus_args that) {
7678
      if (that == null)
7679
        return false;
7680
 
7681
      boolean this_present_merchant_tx_id = true;
7682
      boolean that_present_merchant_tx_id = true;
7683
      if (this_present_merchant_tx_id || that_present_merchant_tx_id) {
7684
        if (!(this_present_merchant_tx_id && that_present_merchant_tx_id))
7685
          return false;
7686
        if (this.merchant_tx_id != that.merchant_tx_id)
7687
          return false;
7688
      }
7689
 
7690
      boolean this_present_newStatus = true && this.isSetNewStatus();
7691
      boolean that_present_newStatus = true && that.isSetNewStatus();
7692
      if (this_present_newStatus || that_present_newStatus) {
7693
        if (!(this_present_newStatus && that_present_newStatus))
7694
          return false;
7695
        if (!this.newStatus.equals(that.newStatus))
7696
          return false;
7697
      }
7698
 
7699
      return true;
7700
    }
7701
 
7702
    @Override
7703
    public int hashCode() {
7704
      return 0;
7705
    }
7706
 
7707
    public int compareTo(changePaymentStatus_args other) {
7708
      if (!getClass().equals(other.getClass())) {
7709
        return getClass().getName().compareTo(other.getClass().getName());
7710
      }
7711
 
7712
      int lastComparison = 0;
7713
      changePaymentStatus_args typedOther = (changePaymentStatus_args)other;
7714
 
7715
      lastComparison = Boolean.valueOf(isSetMerchant_tx_id()).compareTo(isSetMerchant_tx_id());
7716
      if (lastComparison != 0) {
7717
        return lastComparison;
7718
      }
7719
      lastComparison = TBaseHelper.compareTo(merchant_tx_id, typedOther.merchant_tx_id);
7720
      if (lastComparison != 0) {
7721
        return lastComparison;
7722
      }
7723
      lastComparison = Boolean.valueOf(isSetNewStatus()).compareTo(isSetNewStatus());
7724
      if (lastComparison != 0) {
7725
        return lastComparison;
7726
      }
7727
      lastComparison = TBaseHelper.compareTo(newStatus, typedOther.newStatus);
7728
      if (lastComparison != 0) {
7729
        return lastComparison;
7730
      }
7731
      return 0;
7732
    }
7733
 
7734
    public void read(TProtocol iprot) throws TException {
7735
      TField field;
7736
      iprot.readStructBegin();
7737
      while (true)
7738
      {
7739
        field = iprot.readFieldBegin();
7740
        if (field.type == TType.STOP) { 
7741
          break;
7742
        }
7743
        _Fields fieldId = _Fields.findByThriftId(field.id);
7744
        if (fieldId == null) {
7745
          TProtocolUtil.skip(iprot, field.type);
7746
        } else {
7747
          switch (fieldId) {
7748
            case MERCHANT_TX_ID:
7749
              if (field.type == TType.I64) {
7750
                this.merchant_tx_id = iprot.readI64();
7751
                setMerchant_tx_idIsSet(true);
7752
              } else { 
7753
                TProtocolUtil.skip(iprot, field.type);
7754
              }
7755
              break;
7756
            case NEW_STATUS:
7757
              if (field.type == TType.I32) {
7758
                this.newStatus = PaymentStatus.findByValue(iprot.readI32());
7759
              } else { 
7760
                TProtocolUtil.skip(iprot, field.type);
7761
              }
7762
              break;
7763
          }
7764
          iprot.readFieldEnd();
7765
        }
7766
      }
7767
      iprot.readStructEnd();
7768
      validate();
7769
    }
7770
 
7771
    public void write(TProtocol oprot) throws TException {
7772
      validate();
7773
 
7774
      oprot.writeStructBegin(STRUCT_DESC);
7775
      oprot.writeFieldBegin(MERCHANT_TX_ID_FIELD_DESC);
7776
      oprot.writeI64(this.merchant_tx_id);
7777
      oprot.writeFieldEnd();
7778
      if (this.newStatus != null) {
7779
        oprot.writeFieldBegin(NEW_STATUS_FIELD_DESC);
7780
        oprot.writeI32(this.newStatus.getValue());
7781
        oprot.writeFieldEnd();
7782
      }
7783
      oprot.writeFieldStop();
7784
      oprot.writeStructEnd();
7785
    }
7786
 
7787
    @Override
7788
    public String toString() {
7789
      StringBuilder sb = new StringBuilder("changePaymentStatus_args(");
7790
      boolean first = true;
7791
 
7792
      sb.append("merchant_tx_id:");
7793
      sb.append(this.merchant_tx_id);
7794
      first = false;
7795
      if (!first) sb.append(", ");
7796
      sb.append("newStatus:");
7797
      if (this.newStatus == null) {
7798
        sb.append("null");
7799
      } else {
7800
        String newStatus_name = newStatus.name();
7801
        if (newStatus_name != null) {
7802
          sb.append(newStatus_name);
7803
          sb.append(" (");
7804
        }
7805
        sb.append(this.newStatus);
7806
        if (newStatus_name != null) {
7807
          sb.append(")");
7808
        }
7809
      }
7810
      first = false;
7811
      sb.append(")");
7812
      return sb.toString();
7813
    }
7814
 
7815
    public void validate() throws TException {
7816
      // check for required fields
7817
    }
7818
 
7819
  }
7820
 
7821
  public static class changePaymentStatus_result implements TBase<changePaymentStatus_result._Fields>, java.io.Serializable, Cloneable, Comparable<changePaymentStatus_result>   {
7822
    private static final TStruct STRUCT_DESC = new TStruct("changePaymentStatus_result");
7823
 
7824
    private static final TField PE_FIELD_DESC = new TField("pe", TType.STRUCT, (short)1);
7825
 
7826
    private PaymentException pe;
7827
 
7828
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
7829
    public enum _Fields implements TFieldIdEnum {
7830
      PE((short)1, "pe");
7831
 
7832
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
7833
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
7834
 
7835
      static {
7836
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
7837
          byId.put((int)field._thriftId, field);
7838
          byName.put(field.getFieldName(), field);
7839
        }
7840
      }
7841
 
7842
      /**
7843
       * Find the _Fields constant that matches fieldId, or null if its not found.
7844
       */
7845
      public static _Fields findByThriftId(int fieldId) {
7846
        return byId.get(fieldId);
7847
      }
7848
 
7849
      /**
7850
       * Find the _Fields constant that matches fieldId, throwing an exception
7851
       * if it is not found.
7852
       */
7853
      public static _Fields findByThriftIdOrThrow(int fieldId) {
7854
        _Fields fields = findByThriftId(fieldId);
7855
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
7856
        return fields;
7857
      }
7858
 
7859
      /**
7860
       * Find the _Fields constant that matches name, or null if its not found.
7861
       */
7862
      public static _Fields findByName(String name) {
7863
        return byName.get(name);
7864
      }
7865
 
7866
      private final short _thriftId;
7867
      private final String _fieldName;
7868
 
7869
      _Fields(short thriftId, String fieldName) {
7870
        _thriftId = thriftId;
7871
        _fieldName = fieldName;
7872
      }
7873
 
7874
      public short getThriftFieldId() {
7875
        return _thriftId;
7876
      }
7877
 
7878
      public String getFieldName() {
7879
        return _fieldName;
7880
      }
7881
    }
7882
 
7883
    // isset id assignments
7884
 
7885
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
7886
      put(_Fields.PE, new FieldMetaData("pe", TFieldRequirementType.DEFAULT, 
7887
          new FieldValueMetaData(TType.STRUCT)));
7888
    }});
7889
 
7890
    static {
7891
      FieldMetaData.addStructMetaDataMap(changePaymentStatus_result.class, metaDataMap);
7892
    }
7893
 
7894
    public changePaymentStatus_result() {
7895
    }
7896
 
7897
    public changePaymentStatus_result(
7898
      PaymentException pe)
7899
    {
7900
      this();
7901
      this.pe = pe;
7902
    }
7903
 
7904
    /**
7905
     * Performs a deep copy on <i>other</i>.
7906
     */
7907
    public changePaymentStatus_result(changePaymentStatus_result other) {
7908
      if (other.isSetPe()) {
7909
        this.pe = new PaymentException(other.pe);
7910
      }
7911
    }
7912
 
7913
    public changePaymentStatus_result deepCopy() {
7914
      return new changePaymentStatus_result(this);
7915
    }
7916
 
7917
    @Deprecated
7918
    public changePaymentStatus_result clone() {
7919
      return new changePaymentStatus_result(this);
7920
    }
7921
 
7922
    public PaymentException getPe() {
7923
      return this.pe;
7924
    }
7925
 
7926
    public changePaymentStatus_result setPe(PaymentException pe) {
7927
      this.pe = pe;
7928
      return this;
7929
    }
7930
 
7931
    public void unsetPe() {
7932
      this.pe = null;
7933
    }
7934
 
7935
    /** Returns true if field pe is set (has been asigned a value) and false otherwise */
7936
    public boolean isSetPe() {
7937
      return this.pe != null;
7938
    }
7939
 
7940
    public void setPeIsSet(boolean value) {
7941
      if (!value) {
7942
        this.pe = null;
7943
      }
7944
    }
7945
 
7946
    public void setFieldValue(_Fields field, Object value) {
7947
      switch (field) {
7948
      case PE:
7949
        if (value == null) {
7950
          unsetPe();
7951
        } else {
7952
          setPe((PaymentException)value);
7953
        }
7954
        break;
7955
 
7956
      }
7957
    }
7958
 
7959
    public void setFieldValue(int fieldID, Object value) {
7960
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
7961
    }
7962
 
7963
    public Object getFieldValue(_Fields field) {
7964
      switch (field) {
7965
      case PE:
7966
        return getPe();
7967
 
7968
      }
7969
      throw new IllegalStateException();
7970
    }
7971
 
7972
    public Object getFieldValue(int fieldId) {
7973
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
7974
    }
7975
 
7976
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
7977
    public boolean isSet(_Fields field) {
7978
      switch (field) {
7979
      case PE:
7980
        return isSetPe();
7981
      }
7982
      throw new IllegalStateException();
7983
    }
7984
 
7985
    public boolean isSet(int fieldID) {
7986
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
7987
    }
7988
 
7989
    @Override
7990
    public boolean equals(Object that) {
7991
      if (that == null)
7992
        return false;
7993
      if (that instanceof changePaymentStatus_result)
7994
        return this.equals((changePaymentStatus_result)that);
7995
      return false;
7996
    }
7997
 
7998
    public boolean equals(changePaymentStatus_result that) {
7999
      if (that == null)
8000
        return false;
8001
 
8002
      boolean this_present_pe = true && this.isSetPe();
8003
      boolean that_present_pe = true && that.isSetPe();
8004
      if (this_present_pe || that_present_pe) {
8005
        if (!(this_present_pe && that_present_pe))
8006
          return false;
8007
        if (!this.pe.equals(that.pe))
8008
          return false;
8009
      }
8010
 
8011
      return true;
8012
    }
8013
 
8014
    @Override
8015
    public int hashCode() {
8016
      return 0;
8017
    }
8018
 
8019
    public int compareTo(changePaymentStatus_result other) {
8020
      if (!getClass().equals(other.getClass())) {
8021
        return getClass().getName().compareTo(other.getClass().getName());
8022
      }
8023
 
8024
      int lastComparison = 0;
8025
      changePaymentStatus_result typedOther = (changePaymentStatus_result)other;
8026
 
8027
      lastComparison = Boolean.valueOf(isSetPe()).compareTo(isSetPe());
8028
      if (lastComparison != 0) {
8029
        return lastComparison;
8030
      }
8031
      lastComparison = TBaseHelper.compareTo(pe, typedOther.pe);
8032
      if (lastComparison != 0) {
8033
        return lastComparison;
8034
      }
8035
      return 0;
8036
    }
8037
 
8038
    public void read(TProtocol iprot) throws TException {
8039
      TField field;
8040
      iprot.readStructBegin();
8041
      while (true)
8042
      {
8043
        field = iprot.readFieldBegin();
8044
        if (field.type == TType.STOP) { 
8045
          break;
8046
        }
8047
        _Fields fieldId = _Fields.findByThriftId(field.id);
8048
        if (fieldId == null) {
8049
          TProtocolUtil.skip(iprot, field.type);
8050
        } else {
8051
          switch (fieldId) {
8052
            case PE:
8053
              if (field.type == TType.STRUCT) {
8054
                this.pe = new PaymentException();
8055
                this.pe.read(iprot);
8056
              } else { 
8057
                TProtocolUtil.skip(iprot, field.type);
8058
              }
8059
              break;
8060
          }
8061
          iprot.readFieldEnd();
8062
        }
8063
      }
8064
      iprot.readStructEnd();
8065
      validate();
8066
    }
8067
 
8068
    public void write(TProtocol oprot) throws TException {
8069
      oprot.writeStructBegin(STRUCT_DESC);
8070
 
8071
      if (this.isSetPe()) {
8072
        oprot.writeFieldBegin(PE_FIELD_DESC);
8073
        this.pe.write(oprot);
8074
        oprot.writeFieldEnd();
8075
      }
8076
      oprot.writeFieldStop();
8077
      oprot.writeStructEnd();
8078
    }
8079
 
8080
    @Override
8081
    public String toString() {
8082
      StringBuilder sb = new StringBuilder("changePaymentStatus_result(");
8083
      boolean first = true;
8084
 
8085
      sb.append("pe:");
8086
      if (this.pe == null) {
8087
        sb.append("null");
8088
      } else {
8089
        sb.append(this.pe);
8090
      }
8091
      first = false;
8092
      sb.append(")");
8093
      return sb.toString();
8094
    }
8095
 
8096
    public void validate() throws TException {
8097
      // check for required fields
8098
    }
8099
 
8100
  }
8101
 
8102
  public static class changePaymentRequestStatus_args implements TBase<changePaymentRequestStatus_args._Fields>, java.io.Serializable, Cloneable, Comparable<changePaymentRequestStatus_args>   {
8103
    private static final TStruct STRUCT_DESC = new TStruct("changePaymentRequestStatus_args");
8104
 
8105
    private static final TField REQUEST_ID_FIELD_DESC = new TField("request_id", TType.I64, (short)1);
8106
    private static final TField REQUEST_STATUS_FIELD_DESC = new TField("requestStatus", TType.I32, (short)2);
8107
 
8108
    private long request_id;
8109
    private RequestStatus requestStatus;
8110
 
8111
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
8112
    public enum _Fields implements TFieldIdEnum {
8113
      REQUEST_ID((short)1, "request_id"),
8114
      /**
8115
       * 
8116
       * @see RequestStatus
8117
       */
8118
      REQUEST_STATUS((short)2, "requestStatus");
8119
 
8120
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
8121
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
8122
 
8123
      static {
8124
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
8125
          byId.put((int)field._thriftId, field);
8126
          byName.put(field.getFieldName(), field);
8127
        }
8128
      }
8129
 
8130
      /**
8131
       * Find the _Fields constant that matches fieldId, or null if its not found.
8132
       */
8133
      public static _Fields findByThriftId(int fieldId) {
8134
        return byId.get(fieldId);
8135
      }
8136
 
8137
      /**
8138
       * Find the _Fields constant that matches fieldId, throwing an exception
8139
       * if it is not found.
8140
       */
8141
      public static _Fields findByThriftIdOrThrow(int fieldId) {
8142
        _Fields fields = findByThriftId(fieldId);
8143
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
8144
        return fields;
8145
      }
8146
 
8147
      /**
8148
       * Find the _Fields constant that matches name, or null if its not found.
8149
       */
8150
      public static _Fields findByName(String name) {
8151
        return byName.get(name);
8152
      }
8153
 
8154
      private final short _thriftId;
8155
      private final String _fieldName;
8156
 
8157
      _Fields(short thriftId, String fieldName) {
8158
        _thriftId = thriftId;
8159
        _fieldName = fieldName;
8160
      }
8161
 
8162
      public short getThriftFieldId() {
8163
        return _thriftId;
8164
      }
8165
 
8166
      public String getFieldName() {
8167
        return _fieldName;
8168
      }
8169
    }
8170
 
8171
    // isset id assignments
8172
    private static final int __REQUEST_ID_ISSET_ID = 0;
8173
    private BitSet __isset_bit_vector = new BitSet(1);
8174
 
8175
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
8176
      put(_Fields.REQUEST_ID, new FieldMetaData("request_id", TFieldRequirementType.DEFAULT, 
8177
          new FieldValueMetaData(TType.I64)));
8178
      put(_Fields.REQUEST_STATUS, new FieldMetaData("requestStatus", TFieldRequirementType.DEFAULT, 
8179
          new EnumMetaData(TType.ENUM, RequestStatus.class)));
8180
    }});
8181
 
8182
    static {
8183
      FieldMetaData.addStructMetaDataMap(changePaymentRequestStatus_args.class, metaDataMap);
8184
    }
8185
 
8186
    public changePaymentRequestStatus_args() {
8187
    }
8188
 
8189
    public changePaymentRequestStatus_args(
8190
      long request_id,
8191
      RequestStatus requestStatus)
8192
    {
8193
      this();
8194
      this.request_id = request_id;
8195
      setRequest_idIsSet(true);
8196
      this.requestStatus = requestStatus;
8197
    }
8198
 
8199
    /**
8200
     * Performs a deep copy on <i>other</i>.
8201
     */
8202
    public changePaymentRequestStatus_args(changePaymentRequestStatus_args other) {
8203
      __isset_bit_vector.clear();
8204
      __isset_bit_vector.or(other.__isset_bit_vector);
8205
      this.request_id = other.request_id;
8206
      if (other.isSetRequestStatus()) {
8207
        this.requestStatus = other.requestStatus;
8208
      }
8209
    }
8210
 
8211
    public changePaymentRequestStatus_args deepCopy() {
8212
      return new changePaymentRequestStatus_args(this);
8213
    }
8214
 
8215
    @Deprecated
8216
    public changePaymentRequestStatus_args clone() {
8217
      return new changePaymentRequestStatus_args(this);
8218
    }
8219
 
8220
    public long getRequest_id() {
8221
      return this.request_id;
8222
    }
8223
 
8224
    public changePaymentRequestStatus_args setRequest_id(long request_id) {
8225
      this.request_id = request_id;
8226
      setRequest_idIsSet(true);
8227
      return this;
8228
    }
8229
 
8230
    public void unsetRequest_id() {
8231
      __isset_bit_vector.clear(__REQUEST_ID_ISSET_ID);
8232
    }
8233
 
8234
    /** Returns true if field request_id is set (has been asigned a value) and false otherwise */
8235
    public boolean isSetRequest_id() {
8236
      return __isset_bit_vector.get(__REQUEST_ID_ISSET_ID);
8237
    }
8238
 
8239
    public void setRequest_idIsSet(boolean value) {
8240
      __isset_bit_vector.set(__REQUEST_ID_ISSET_ID, value);
8241
    }
8242
 
8243
    /**
8244
     * 
8245
     * @see RequestStatus
8246
     */
8247
    public RequestStatus getRequestStatus() {
8248
      return this.requestStatus;
8249
    }
8250
 
8251
    /**
8252
     * 
8253
     * @see RequestStatus
8254
     */
8255
    public changePaymentRequestStatus_args setRequestStatus(RequestStatus requestStatus) {
8256
      this.requestStatus = requestStatus;
8257
      return this;
8258
    }
8259
 
8260
    public void unsetRequestStatus() {
8261
      this.requestStatus = null;
8262
    }
8263
 
8264
    /** Returns true if field requestStatus is set (has been asigned a value) and false otherwise */
8265
    public boolean isSetRequestStatus() {
8266
      return this.requestStatus != null;
8267
    }
8268
 
8269
    public void setRequestStatusIsSet(boolean value) {
8270
      if (!value) {
8271
        this.requestStatus = null;
8272
      }
8273
    }
8274
 
8275
    public void setFieldValue(_Fields field, Object value) {
8276
      switch (field) {
8277
      case REQUEST_ID:
8278
        if (value == null) {
8279
          unsetRequest_id();
8280
        } else {
8281
          setRequest_id((Long)value);
8282
        }
8283
        break;
8284
 
8285
      case REQUEST_STATUS:
8286
        if (value == null) {
8287
          unsetRequestStatus();
8288
        } else {
8289
          setRequestStatus((RequestStatus)value);
8290
        }
8291
        break;
8292
 
8293
      }
8294
    }
8295
 
8296
    public void setFieldValue(int fieldID, Object value) {
8297
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
8298
    }
8299
 
8300
    public Object getFieldValue(_Fields field) {
8301
      switch (field) {
8302
      case REQUEST_ID:
8303
        return new Long(getRequest_id());
8304
 
8305
      case REQUEST_STATUS:
8306
        return getRequestStatus();
8307
 
8308
      }
8309
      throw new IllegalStateException();
8310
    }
8311
 
8312
    public Object getFieldValue(int fieldId) {
8313
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
8314
    }
8315
 
8316
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
8317
    public boolean isSet(_Fields field) {
8318
      switch (field) {
8319
      case REQUEST_ID:
8320
        return isSetRequest_id();
8321
      case REQUEST_STATUS:
8322
        return isSetRequestStatus();
8323
      }
8324
      throw new IllegalStateException();
8325
    }
8326
 
8327
    public boolean isSet(int fieldID) {
8328
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
8329
    }
8330
 
8331
    @Override
8332
    public boolean equals(Object that) {
8333
      if (that == null)
8334
        return false;
8335
      if (that instanceof changePaymentRequestStatus_args)
8336
        return this.equals((changePaymentRequestStatus_args)that);
8337
      return false;
8338
    }
8339
 
8340
    public boolean equals(changePaymentRequestStatus_args that) {
8341
      if (that == null)
8342
        return false;
8343
 
8344
      boolean this_present_request_id = true;
8345
      boolean that_present_request_id = true;
8346
      if (this_present_request_id || that_present_request_id) {
8347
        if (!(this_present_request_id && that_present_request_id))
8348
          return false;
8349
        if (this.request_id != that.request_id)
8350
          return false;
8351
      }
8352
 
8353
      boolean this_present_requestStatus = true && this.isSetRequestStatus();
8354
      boolean that_present_requestStatus = true && that.isSetRequestStatus();
8355
      if (this_present_requestStatus || that_present_requestStatus) {
8356
        if (!(this_present_requestStatus && that_present_requestStatus))
8357
          return false;
8358
        if (!this.requestStatus.equals(that.requestStatus))
8359
          return false;
8360
      }
8361
 
8362
      return true;
8363
    }
8364
 
8365
    @Override
8366
    public int hashCode() {
8367
      return 0;
8368
    }
8369
 
8370
    public int compareTo(changePaymentRequestStatus_args other) {
8371
      if (!getClass().equals(other.getClass())) {
8372
        return getClass().getName().compareTo(other.getClass().getName());
8373
      }
8374
 
8375
      int lastComparison = 0;
8376
      changePaymentRequestStatus_args typedOther = (changePaymentRequestStatus_args)other;
8377
 
8378
      lastComparison = Boolean.valueOf(isSetRequest_id()).compareTo(isSetRequest_id());
8379
      if (lastComparison != 0) {
8380
        return lastComparison;
8381
      }
8382
      lastComparison = TBaseHelper.compareTo(request_id, typedOther.request_id);
8383
      if (lastComparison != 0) {
8384
        return lastComparison;
8385
      }
8386
      lastComparison = Boolean.valueOf(isSetRequestStatus()).compareTo(isSetRequestStatus());
8387
      if (lastComparison != 0) {
8388
        return lastComparison;
8389
      }
8390
      lastComparison = TBaseHelper.compareTo(requestStatus, typedOther.requestStatus);
8391
      if (lastComparison != 0) {
8392
        return lastComparison;
8393
      }
8394
      return 0;
8395
    }
8396
 
8397
    public void read(TProtocol iprot) throws TException {
8398
      TField field;
8399
      iprot.readStructBegin();
8400
      while (true)
8401
      {
8402
        field = iprot.readFieldBegin();
8403
        if (field.type == TType.STOP) { 
8404
          break;
8405
        }
8406
        _Fields fieldId = _Fields.findByThriftId(field.id);
8407
        if (fieldId == null) {
8408
          TProtocolUtil.skip(iprot, field.type);
8409
        } else {
8410
          switch (fieldId) {
8411
            case REQUEST_ID:
8412
              if (field.type == TType.I64) {
8413
                this.request_id = iprot.readI64();
8414
                setRequest_idIsSet(true);
8415
              } else { 
8416
                TProtocolUtil.skip(iprot, field.type);
8417
              }
8418
              break;
8419
            case REQUEST_STATUS:
8420
              if (field.type == TType.I32) {
8421
                this.requestStatus = RequestStatus.findByValue(iprot.readI32());
8422
              } else { 
8423
                TProtocolUtil.skip(iprot, field.type);
8424
              }
8425
              break;
8426
          }
8427
          iprot.readFieldEnd();
8428
        }
8429
      }
8430
      iprot.readStructEnd();
8431
      validate();
8432
    }
8433
 
8434
    public void write(TProtocol oprot) throws TException {
8435
      validate();
8436
 
8437
      oprot.writeStructBegin(STRUCT_DESC);
8438
      oprot.writeFieldBegin(REQUEST_ID_FIELD_DESC);
8439
      oprot.writeI64(this.request_id);
8440
      oprot.writeFieldEnd();
8441
      if (this.requestStatus != null) {
8442
        oprot.writeFieldBegin(REQUEST_STATUS_FIELD_DESC);
8443
        oprot.writeI32(this.requestStatus.getValue());
8444
        oprot.writeFieldEnd();
8445
      }
8446
      oprot.writeFieldStop();
8447
      oprot.writeStructEnd();
8448
    }
8449
 
8450
    @Override
8451
    public String toString() {
8452
      StringBuilder sb = new StringBuilder("changePaymentRequestStatus_args(");
8453
      boolean first = true;
8454
 
8455
      sb.append("request_id:");
8456
      sb.append(this.request_id);
8457
      first = false;
8458
      if (!first) sb.append(", ");
8459
      sb.append("requestStatus:");
8460
      if (this.requestStatus == null) {
8461
        sb.append("null");
8462
      } else {
8463
        String requestStatus_name = requestStatus.name();
8464
        if (requestStatus_name != null) {
8465
          sb.append(requestStatus_name);
8466
          sb.append(" (");
8467
        }
8468
        sb.append(this.requestStatus);
8469
        if (requestStatus_name != null) {
8470
          sb.append(")");
8471
        }
8472
      }
8473
      first = false;
8474
      sb.append(")");
8475
      return sb.toString();
8476
    }
8477
 
8478
    public void validate() throws TException {
8479
      // check for required fields
8480
    }
8481
 
8482
  }
8483
 
8484
  public static class changePaymentRequestStatus_result implements TBase<changePaymentRequestStatus_result._Fields>, java.io.Serializable, Cloneable, Comparable<changePaymentRequestStatus_result>   {
8485
    private static final TStruct STRUCT_DESC = new TStruct("changePaymentRequestStatus_result");
8486
 
8487
    private static final TField PE_FIELD_DESC = new TField("pe", TType.STRUCT, (short)1);
8488
 
8489
    private PaymentException pe;
8490
 
8491
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
8492
    public enum _Fields implements TFieldIdEnum {
8493
      PE((short)1, "pe");
8494
 
8495
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
8496
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
8497
 
8498
      static {
8499
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
8500
          byId.put((int)field._thriftId, field);
8501
          byName.put(field.getFieldName(), field);
8502
        }
8503
      }
8504
 
8505
      /**
8506
       * Find the _Fields constant that matches fieldId, or null if its not found.
8507
       */
8508
      public static _Fields findByThriftId(int fieldId) {
8509
        return byId.get(fieldId);
8510
      }
8511
 
8512
      /**
8513
       * Find the _Fields constant that matches fieldId, throwing an exception
8514
       * if it is not found.
8515
       */
8516
      public static _Fields findByThriftIdOrThrow(int fieldId) {
8517
        _Fields fields = findByThriftId(fieldId);
8518
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
8519
        return fields;
8520
      }
8521
 
8522
      /**
8523
       * Find the _Fields constant that matches name, or null if its not found.
8524
       */
8525
      public static _Fields findByName(String name) {
8526
        return byName.get(name);
8527
      }
8528
 
8529
      private final short _thriftId;
8530
      private final String _fieldName;
8531
 
8532
      _Fields(short thriftId, String fieldName) {
8533
        _thriftId = thriftId;
8534
        _fieldName = fieldName;
8535
      }
8536
 
8537
      public short getThriftFieldId() {
8538
        return _thriftId;
8539
      }
8540
 
8541
      public String getFieldName() {
8542
        return _fieldName;
8543
      }
8544
    }
8545
 
8546
    // isset id assignments
8547
 
8548
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
8549
      put(_Fields.PE, new FieldMetaData("pe", TFieldRequirementType.DEFAULT, 
8550
          new FieldValueMetaData(TType.STRUCT)));
8551
    }});
8552
 
8553
    static {
8554
      FieldMetaData.addStructMetaDataMap(changePaymentRequestStatus_result.class, metaDataMap);
8555
    }
8556
 
8557
    public changePaymentRequestStatus_result() {
8558
    }
8559
 
8560
    public changePaymentRequestStatus_result(
8561
      PaymentException pe)
8562
    {
8563
      this();
8564
      this.pe = pe;
8565
    }
8566
 
8567
    /**
8568
     * Performs a deep copy on <i>other</i>.
8569
     */
8570
    public changePaymentRequestStatus_result(changePaymentRequestStatus_result other) {
8571
      if (other.isSetPe()) {
8572
        this.pe = new PaymentException(other.pe);
8573
      }
8574
    }
8575
 
8576
    public changePaymentRequestStatus_result deepCopy() {
8577
      return new changePaymentRequestStatus_result(this);
8578
    }
8579
 
8580
    @Deprecated
8581
    public changePaymentRequestStatus_result clone() {
8582
      return new changePaymentRequestStatus_result(this);
8583
    }
8584
 
8585
    public PaymentException getPe() {
8586
      return this.pe;
8587
    }
8588
 
8589
    public changePaymentRequestStatus_result setPe(PaymentException pe) {
8590
      this.pe = pe;
8591
      return this;
8592
    }
8593
 
8594
    public void unsetPe() {
8595
      this.pe = null;
8596
    }
8597
 
8598
    /** Returns true if field pe is set (has been asigned a value) and false otherwise */
8599
    public boolean isSetPe() {
8600
      return this.pe != null;
8601
    }
8602
 
8603
    public void setPeIsSet(boolean value) {
8604
      if (!value) {
8605
        this.pe = null;
8606
      }
8607
    }
8608
 
8609
    public void setFieldValue(_Fields field, Object value) {
8610
      switch (field) {
8611
      case PE:
8612
        if (value == null) {
8613
          unsetPe();
8614
        } else {
8615
          setPe((PaymentException)value);
8616
        }
8617
        break;
8618
 
8619
      }
8620
    }
8621
 
8622
    public void setFieldValue(int fieldID, Object value) {
8623
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
8624
    }
8625
 
8626
    public Object getFieldValue(_Fields field) {
8627
      switch (field) {
8628
      case PE:
8629
        return getPe();
8630
 
8631
      }
8632
      throw new IllegalStateException();
8633
    }
8634
 
8635
    public Object getFieldValue(int fieldId) {
8636
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
8637
    }
8638
 
8639
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
8640
    public boolean isSet(_Fields field) {
8641
      switch (field) {
8642
      case PE:
8643
        return isSetPe();
8644
      }
8645
      throw new IllegalStateException();
8646
    }
8647
 
8648
    public boolean isSet(int fieldID) {
8649
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
8650
    }
8651
 
8652
    @Override
8653
    public boolean equals(Object that) {
8654
      if (that == null)
8655
        return false;
8656
      if (that instanceof changePaymentRequestStatus_result)
8657
        return this.equals((changePaymentRequestStatus_result)that);
8658
      return false;
8659
    }
8660
 
8661
    public boolean equals(changePaymentRequestStatus_result that) {
8662
      if (that == null)
8663
        return false;
8664
 
8665
      boolean this_present_pe = true && this.isSetPe();
8666
      boolean that_present_pe = true && that.isSetPe();
8667
      if (this_present_pe || that_present_pe) {
8668
        if (!(this_present_pe && that_present_pe))
8669
          return false;
8670
        if (!this.pe.equals(that.pe))
8671
          return false;
8672
      }
8673
 
8674
      return true;
8675
    }
8676
 
8677
    @Override
8678
    public int hashCode() {
8679
      return 0;
8680
    }
8681
 
8682
    public int compareTo(changePaymentRequestStatus_result other) {
8683
      if (!getClass().equals(other.getClass())) {
8684
        return getClass().getName().compareTo(other.getClass().getName());
8685
      }
8686
 
8687
      int lastComparison = 0;
8688
      changePaymentRequestStatus_result typedOther = (changePaymentRequestStatus_result)other;
8689
 
8690
      lastComparison = Boolean.valueOf(isSetPe()).compareTo(isSetPe());
8691
      if (lastComparison != 0) {
8692
        return lastComparison;
8693
      }
8694
      lastComparison = TBaseHelper.compareTo(pe, typedOther.pe);
8695
      if (lastComparison != 0) {
8696
        return lastComparison;
8697
      }
8698
      return 0;
8699
    }
8700
 
8701
    public void read(TProtocol iprot) throws TException {
8702
      TField field;
8703
      iprot.readStructBegin();
8704
      while (true)
8705
      {
8706
        field = iprot.readFieldBegin();
8707
        if (field.type == TType.STOP) { 
8708
          break;
8709
        }
8710
        _Fields fieldId = _Fields.findByThriftId(field.id);
8711
        if (fieldId == null) {
8712
          TProtocolUtil.skip(iprot, field.type);
8713
        } else {
8714
          switch (fieldId) {
8715
            case PE:
8716
              if (field.type == TType.STRUCT) {
8717
                this.pe = new PaymentException();
8718
                this.pe.read(iprot);
8719
              } else { 
8720
                TProtocolUtil.skip(iprot, field.type);
8721
              }
8722
              break;
8723
          }
8724
          iprot.readFieldEnd();
8725
        }
8726
      }
8727
      iprot.readStructEnd();
8728
      validate();
8729
    }
8730
 
8731
    public void write(TProtocol oprot) throws TException {
8732
      oprot.writeStructBegin(STRUCT_DESC);
8733
 
8734
      if (this.isSetPe()) {
8735
        oprot.writeFieldBegin(PE_FIELD_DESC);
8736
        this.pe.write(oprot);
8737
        oprot.writeFieldEnd();
8738
      }
8739
      oprot.writeFieldStop();
8740
      oprot.writeStructEnd();
8741
    }
8742
 
8743
    @Override
8744
    public String toString() {
8745
      StringBuilder sb = new StringBuilder("changePaymentRequestStatus_result(");
8746
      boolean first = true;
8747
 
8748
      sb.append("pe:");
8749
      if (this.pe == null) {
8750
        sb.append("null");
8751
      } else {
8752
        sb.append(this.pe);
8753
      }
8754
      first = false;
8755
      sb.append(")");
8756
      return sb.toString();
8757
    }
8758
 
8759
    public void validate() throws TException {
8760
      // check for required fields
8761
    }
8762
 
8763
  }
8764
 
8765
}