-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCaptureValidationError.cs
More file actions
114 lines (91 loc) · 5.15 KB
/
Copy pathCaptureValidationError.cs
File metadata and controls
114 lines (91 loc) · 5.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace Moov.Sdk.Models.Errors
{
using Moov.Sdk.Models.Components;
using Moov.Sdk.Utils;
using Newtonsoft.Json;
using System;
using System.Net.Http;
public class CaptureValidationErrorPayload
{
[JsonProperty("destinationPaymentMethodID")]
public string? DestinationPaymentMethodID { get; set; }
[JsonProperty("amount")]
public AmountDecimalValidationError? Amount { get; set; }
[JsonProperty("isFinal")]
public string? IsFinal { get; set; }
[JsonProperty("description")]
public string? Description { get; set; }
[JsonProperty("facilitatorFeeAmount")]
public AmountDecimalValidationError? FacilitatorFeeAmount { get; set; }
[JsonProperty("metadata")]
public string? Metadata { get; set; }
[JsonProperty("foreignID")]
public string? ForeignID { get; set; }
[JsonProperty("lineItems")]
public CreateTransferLineItemsValidationError? LineItems { get; set; }
[JsonProperty("amountDetails")]
public CreateTransferAmountDetailsValidationError? AmountDetails { get; set; }
[JsonProperty("-")]
public HTTPMetadata HttpMeta { get; set; } = default!;
}
/// <summary>
/// Descriptions of any field validations that failed on a capture request.
/// </summary>
public class CaptureValidationError : MoovException
{
/// <summary>
/// The original data that was passed to this exception.
/// </summary>
public CaptureValidationErrorPayload Payload { get; }
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use CaptureValidationError.Payload.DestinationPaymentMethodID instead.")]
public string? DestinationPaymentMethodID { get; set; }
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use CaptureValidationError.Payload.Amount instead.")]
public AmountDecimalValidationError? Amount { get; set; }
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use CaptureValidationError.Payload.IsFinal instead.")]
public string? IsFinal { get; set; }
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use CaptureValidationError.Payload.Description instead.")]
public string? Description { get; set; }
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use CaptureValidationError.Payload.FacilitatorFeeAmount instead.")]
public AmountDecimalValidationError? FacilitatorFeeAmount { get; set; }
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use CaptureValidationError.Payload.Metadata instead.")]
public string? Metadata { get; set; }
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use CaptureValidationError.Payload.ForeignID instead.")]
public string? ForeignID { get; set; }
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use CaptureValidationError.Payload.LineItems instead.")]
public CreateTransferLineItemsValidationError? LineItems { get; set; }
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use CaptureValidationError.Payload.AmountDetails instead.")]
public CreateTransferAmountDetailsValidationError? AmountDetails { get; set; }
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use CaptureValidationError.Payload.HttpMeta instead.")]
public HTTPMetadata HttpMeta { get; set; } = default!;
public CaptureValidationError(
CaptureValidationErrorPayload payload,
HttpRequestMessage request,
HttpResponseMessage response,
string body
): base("API error occurred", request, response, body)
{
Payload = payload;
#pragma warning disable CS0618
DestinationPaymentMethodID = payload.DestinationPaymentMethodID;
Amount = payload.Amount;
IsFinal = payload.IsFinal;
Description = payload.Description;
FacilitatorFeeAmount = payload.FacilitatorFeeAmount;
Metadata = payload.Metadata;
ForeignID = payload.ForeignID;
LineItems = payload.LineItems;
AmountDetails = payload.AmountDetails;
HttpMeta = payload.HttpMeta;
#pragma warning restore CS0618
}
}
}