[C#] Run tests against release library in determinism CI run
[ldk-java] / c_sharp / src / org / ldk / structs / ErroneousField.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
9 /**
10  * The field in the [`InvoiceRequest`] or the [`Bolt12Invoice`] that contained an error.
11  * 
12  * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
13  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
14  */
15 public class ErroneousField : CommonBase {
16         internal ErroneousField(object _dummy, long ptr) : base(ptr) { }
17         ~ErroneousField() {
18                 if (ptr != 0) { bindings.ErroneousField_free(ptr); }
19         }
20
21         /**
22          * The type number of the TLV field containing the error.
23          */
24         public long get_tlv_fieldnum() {
25                 long ret = bindings.ErroneousField_get_tlv_fieldnum(this.ptr);
26                 GC.KeepAlive(this);
27                 return ret;
28         }
29
30         /**
31          * The type number of the TLV field containing the error.
32          */
33         public void set_tlv_fieldnum(long val) {
34                 bindings.ErroneousField_set_tlv_fieldnum(this.ptr, val);
35                 GC.KeepAlive(this);
36                 GC.KeepAlive(val);
37         }
38
39         /**
40          * A value to use for the TLV field to avoid the error.
41          * 
42          * Returns a copy of the field.
43          */
44         public Option_CVec_u8ZZ get_suggested_value() {
45                 long ret = bindings.ErroneousField_get_suggested_value(this.ptr);
46                 GC.KeepAlive(this);
47                 if (ret >= 0 && ret <= 4096) { return null; }
48                 org.ldk.structs.Option_CVec_u8ZZ ret_hu_conv = org.ldk.structs.Option_CVec_u8ZZ.constr_from_ptr(ret);
49                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
50                 return ret_hu_conv;
51         }
52
53         /**
54          * A value to use for the TLV field to avoid the error.
55          */
56         public void set_suggested_value(org.ldk.structs.Option_CVec_u8ZZ val) {
57                 bindings.ErroneousField_set_suggested_value(this.ptr, val.ptr);
58                 GC.KeepAlive(this);
59                 GC.KeepAlive(val);
60                 if (this != null) { this.ptrs_to.AddLast(val); };
61         }
62
63         /**
64          * Constructs a new ErroneousField given each field
65          */
66         public static ErroneousField of(long tlv_fieldnum_arg, org.ldk.structs.Option_CVec_u8ZZ suggested_value_arg) {
67                 long ret = bindings.ErroneousField_new(tlv_fieldnum_arg, suggested_value_arg.ptr);
68                 GC.KeepAlive(tlv_fieldnum_arg);
69                 GC.KeepAlive(suggested_value_arg);
70                 if (ret >= 0 && ret <= 4096) { return null; }
71                 org.ldk.structs.ErroneousField ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ErroneousField(null, ret); }
72                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
73                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(suggested_value_arg); };
74                 return ret_hu_conv;
75         }
76
77         internal long clone_ptr() {
78                 long ret = bindings.ErroneousField_clone_ptr(this.ptr);
79                 GC.KeepAlive(this);
80                 return ret;
81         }
82
83         /**
84          * Creates a copy of the ErroneousField
85          */
86         public ErroneousField clone() {
87                 long ret = bindings.ErroneousField_clone(this.ptr);
88                 GC.KeepAlive(this);
89                 if (ret >= 0 && ret <= 4096) { return null; }
90                 org.ldk.structs.ErroneousField ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ErroneousField(null, ret); }
91                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
92                 return ret_hu_conv;
93         }
94
95 }
96 } } }