-
Notifications
You must be signed in to change notification settings - Fork 400
Expand file tree
/
Copy pathCannotProceedException.java
More file actions
45 lines (40 loc) · 1.5 KB
/
CannotProceedException.java
File metadata and controls
45 lines (40 loc) · 1.5 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
// File generated from our OpenAPI spec
package com.stripe.exception;
import com.google.gson.JsonObject;
import com.google.gson.annotations.SerializedName;
import com.stripe.model.StripeError;
import com.stripe.model.StripeObject;
import com.stripe.net.StripeResponseGetter;
import lombok.Getter;
/** Returned when the PayoutMethod object is set as default_for_currency and cannot be archived. */
public final class CannotProceedException extends ApiException {
private static final long serialVersionUID = 2L;
@Getter String reason;
private CannotProceedException(
String message,
String requestId,
String code,
Integer statusCode,
Throwable e,
String reason) {
super(message, requestId, code, statusCode, e);
this.reason = reason;
}
static CannotProceedException parse(
JsonObject body, int statusCode, String requestId, StripeResponseGetter responseGetter) {
CannotProceedException.CannotProceedError error =
(CannotProceedException.CannotProceedError)
StripeObject.deserializeStripeObject(
body, CannotProceedException.CannotProceedError.class, responseGetter);
CannotProceedException exception =
new CannotProceedException(
error.getMessage(), requestId, error.getCode(), statusCode, null, error.getReason());
exception.setStripeError(error);
return exception;
}
public static class CannotProceedError extends StripeError {
@Getter
@SerializedName("reason")
String reason;
}
}