[C#] Drop reference to `assert` which makes building on Win hard
[ldk-java] / c_sharp / src / org / ldk / structs / Result_PaymentHashRetryableSendFailureZ.cs
1 using org.ldk.impl;
2 using org.ldk.enums;
3 using org.ldk.util;
4 using System;
5
6 namespace org { namespace ldk { namespace structs {
7
8 public class Result_PaymentHashRetryableSendFailureZ : CommonBase {
9         Result_PaymentHashRetryableSendFailureZ(object _dummy, long ptr) : base(ptr) { }
10         ~Result_PaymentHashRetryableSendFailureZ() {
11                 if (ptr != 0) { bindings.CResult_PaymentHashRetryableSendFailureZ_free(ptr); }
12         }
13
14         internal static Result_PaymentHashRetryableSendFailureZ constr_from_ptr(long ptr) {
15                 if (bindings.CResult_PaymentHashRetryableSendFailureZ_is_ok(ptr)) {
16                         return new Result_PaymentHashRetryableSendFailureZ_OK(null, ptr);
17                 } else {
18                         return new Result_PaymentHashRetryableSendFailureZ_Err(null, ptr);
19                 }
20         }
21         public class Result_PaymentHashRetryableSendFailureZ_OK : Result_PaymentHashRetryableSendFailureZ {
22                 public readonly byte[] res;
23                 internal Result_PaymentHashRetryableSendFailureZ_OK(object _dummy, long ptr) : base(_dummy, ptr) {
24                         this.res = bindings.CResult_PaymentHashRetryableSendFailureZ_get_ok(ptr);
25                 }
26         }
27
28         public class Result_PaymentHashRetryableSendFailureZ_Err : Result_PaymentHashRetryableSendFailureZ {
29                 public readonly RetryableSendFailure err;
30                 internal Result_PaymentHashRetryableSendFailureZ_Err(object _dummy, long ptr) : base(_dummy, ptr) {
31                         this.err = bindings.CResult_PaymentHashRetryableSendFailureZ_get_err(ptr);
32                 }
33         }
34
35         /**
36          * Creates a new CResult_PaymentHashRetryableSendFailureZ in the success state.
37          */
38         public static Result_PaymentHashRetryableSendFailureZ ok(byte[] o) {
39                 long ret = bindings.CResult_PaymentHashRetryableSendFailureZ_ok(InternalUtils.check_arr_len(o, 32));
40                 GC.KeepAlive(o);
41                 if (ret >= 0 && ret <= 4096) { return null; }
42                 Result_PaymentHashRetryableSendFailureZ ret_hu_conv = Result_PaymentHashRetryableSendFailureZ.constr_from_ptr(ret);
43                 return ret_hu_conv;
44         }
45
46         /**
47          * Creates a new CResult_PaymentHashRetryableSendFailureZ in the error state.
48          */
49         public static Result_PaymentHashRetryableSendFailureZ err(RetryableSendFailure e) {
50                 long ret = bindings.CResult_PaymentHashRetryableSendFailureZ_err(e);
51                 GC.KeepAlive(e);
52                 if (ret >= 0 && ret <= 4096) { return null; }
53                 Result_PaymentHashRetryableSendFailureZ ret_hu_conv = Result_PaymentHashRetryableSendFailureZ.constr_from_ptr(ret);
54                 return ret_hu_conv;
55         }
56
57         /**
58          * Checks if the given object is currently in the success state
59          */
60         public bool is_ok() {
61                 bool ret = bindings.CResult_PaymentHashRetryableSendFailureZ_is_ok(this.ptr);
62                 GC.KeepAlive(this);
63                 return ret;
64         }
65
66         internal long clone_ptr() {
67                 long ret = bindings.CResult_PaymentHashRetryableSendFailureZ_clone_ptr(this.ptr);
68                 GC.KeepAlive(this);
69                 return ret;
70         }
71
72         /**
73          * Creates a new CResult_PaymentHashRetryableSendFailureZ which has the same data as `orig`
74          * but with all dynamically-allocated buffers duplicated in new buffers.
75          */
76         public Result_PaymentHashRetryableSendFailureZ clone() {
77                 long ret = bindings.CResult_PaymentHashRetryableSendFailureZ_clone(this.ptr);
78                 GC.KeepAlive(this);
79                 if (ret >= 0 && ret <= 4096) { return null; }
80                 Result_PaymentHashRetryableSendFailureZ ret_hu_conv = Result_PaymentHashRetryableSendFailureZ.constr_from_ptr(ret);
81                 return ret_hu_conv;
82         }
83
84 }
85 } } }