Initial checkin
[ldk-swift-linux] / LDKSwift / Sources / LDKSwift / options / PaymentSendFailure.swift
1 import LDKCHeaders
2
3 public class PaymentSendFailure {
4
5     public internal(set) var cOpaqueStruct: LDKPaymentSendFailure?;
6
7         
8
9     public init(pointer: LDKPaymentSendFailure){
10                 self.cOpaqueStruct = pointer
11         }
12
13     /* OPTION_METHODS_START */
14
15                                 public enum PaymentSendFailureValueType {
16                                         case ParameterError, PathParameterError, AllFailedRetrySafe, PartialFailure
17                                 }
18                                 
19                                 public func getValueType() -> PaymentSendFailureValueType? {
20                                         switch self.cOpaqueStruct?.tag {
21                     
22                                         case LDKPaymentSendFailure_ParameterError:
23                                                 return .ParameterError
24                                         case LDKPaymentSendFailure_PathParameterError:
25                                                 return .PathParameterError
26                                         case LDKPaymentSendFailure_AllFailedRetrySafe:
27                                                 return .AllFailedRetrySafe
28                                         case LDKPaymentSendFailure_PartialFailure:
29                                                 return .PartialFailure
30                     default:
31                         return nil
32                     }
33                                 }
34                                 
35                                 
36                                         public func getValueAsParameterError() -> APIError? {
37                                                 if self.cOpaqueStruct?.tag != LDKPaymentSendFailure_ParameterError {
38                                                         return nil
39                                                 }
40                                                 return APIError(pointer: self.cOpaqueStruct!.parameter_error)
41                                         }
42                                 
43                                         public func getValueAsPathParameterError() -> [LDKCResult_NoneAPIErrorZ]? {
44                                                 if self.cOpaqueStruct?.tag != LDKPaymentSendFailure_PathParameterError {
45                                                         return nil
46                                                 }
47                                                 return Bindings.LDKCVec_CResult_NoneAPIErrorZZ_to_array(nativeType: self.cOpaqueStruct!.path_parameter_error)
48                                         }
49                                 
50                                         public func getValueAsAllFailedRetrySafe() -> [LDKAPIError]? {
51                                                 if self.cOpaqueStruct?.tag != LDKPaymentSendFailure_AllFailedRetrySafe {
52                                                         return nil
53                                                 }
54                                                 return Bindings.LDKCVec_APIErrorZ_to_array(nativeType: self.cOpaqueStruct!.all_failed_retry_safe)
55                                         }
56                                 
57                                         public func getValueAsPartialFailure() -> [LDKCResult_NoneAPIErrorZ]? {
58                                                 if self.cOpaqueStruct?.tag != LDKPaymentSendFailure_PartialFailure {
59                                                         return nil
60                                                 }
61                                                 return Bindings.LDKCVec_CResult_NoneAPIErrorZZ_to_array(nativeType: self.cOpaqueStruct!.partial_failure)
62                                         }
63                                 
64                         
65     /* OPTION_METHODS_END */
66
67         /* TYPE_CLASSES */
68 }