Update auto-generated bindings
[ldk-java] / src / main / java / org / ldk / structs / Result_PaymentSecretAPIErrorZ.java
1 package org.ldk.structs;
2
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
5 import org.ldk.util.*;
6 import java.util.Arrays;
7
8 public class Result_PaymentSecretAPIErrorZ extends CommonBase {
9         private Result_PaymentSecretAPIErrorZ(Object _dummy, long ptr) { super(ptr); }
10         protected void finalize() throws Throwable {
11                 if (ptr != 0) { bindings.CResult_PaymentSecretAPIErrorZ_free(ptr); } super.finalize();
12         }
13
14         static Result_PaymentSecretAPIErrorZ constr_from_ptr(long ptr) {
15                 if (bindings.LDKCResult_PaymentSecretAPIErrorZ_result_ok(ptr)) {
16                         return new Result_PaymentSecretAPIErrorZ_OK(null, ptr);
17                 } else {
18                         return new Result_PaymentSecretAPIErrorZ_Err(null, ptr);
19                 }
20         }
21         public static final class Result_PaymentSecretAPIErrorZ_OK extends Result_PaymentSecretAPIErrorZ {
22                 public final byte[] res;
23                 private Result_PaymentSecretAPIErrorZ_OK(Object _dummy, long ptr) {
24                         super(_dummy, ptr);
25                         this.res = bindings.LDKCResult_PaymentSecretAPIErrorZ_get_ok(ptr);
26                 }
27         }
28
29         public static final class Result_PaymentSecretAPIErrorZ_Err extends Result_PaymentSecretAPIErrorZ {
30                 public final APIError err;
31                 private Result_PaymentSecretAPIErrorZ_Err(Object _dummy, long ptr) {
32                         super(_dummy, ptr);
33                         long err = bindings.LDKCResult_PaymentSecretAPIErrorZ_get_err(ptr);
34                         APIError err_hu_conv = APIError.constr_from_ptr(err);
35                         err_hu_conv.ptrs_to.add(this);
36                         this.err = err_hu_conv;
37                 }
38         }
39
40         /**
41          * Creates a new CResult_PaymentSecretAPIErrorZ in the success state.
42          */
43         public static Result_PaymentSecretAPIErrorZ ok(byte[] o) {
44                 long ret = bindings.CResult_PaymentSecretAPIErrorZ_ok(o);
45                 Result_PaymentSecretAPIErrorZ ret_hu_conv = Result_PaymentSecretAPIErrorZ.constr_from_ptr(ret);
46                 return ret_hu_conv;
47         }
48
49         /**
50          * Creates a new CResult_PaymentSecretAPIErrorZ in the error state.
51          */
52         public static Result_PaymentSecretAPIErrorZ err(APIError e) {
53                 long ret = bindings.CResult_PaymentSecretAPIErrorZ_err(e.ptr);
54                 Result_PaymentSecretAPIErrorZ ret_hu_conv = Result_PaymentSecretAPIErrorZ.constr_from_ptr(ret);
55                 return ret_hu_conv;
56         }
57
58         /**
59          * Creates a new CResult_PaymentSecretAPIErrorZ which has the same data as `orig`
60          * but with all dynamically-allocated buffers duplicated in new buffers.
61          */
62         public Result_PaymentSecretAPIErrorZ clone() {
63                 long ret = bindings.CResult_PaymentSecretAPIErrorZ_clone(this.ptr);
64                 Result_PaymentSecretAPIErrorZ ret_hu_conv = Result_PaymentSecretAPIErrorZ.constr_from_ptr(ret);
65                 return ret_hu_conv;
66         }
67
68 }