|
| 1 | +// File generated from our OpenAPI spec |
| 2 | +package com.stripe.model.radar; |
| 3 | + |
| 4 | +import com.google.gson.annotations.SerializedName; |
| 5 | +import com.stripe.exception.StripeException; |
| 6 | +import com.stripe.model.HasId; |
| 7 | +import com.stripe.model.StripeObject; |
| 8 | +import com.stripe.net.ApiRequest; |
| 9 | +import com.stripe.net.ApiRequestParams; |
| 10 | +import com.stripe.net.ApiResource; |
| 11 | +import com.stripe.net.BaseAddress; |
| 12 | +import com.stripe.net.RequestOptions; |
| 13 | +import com.stripe.net.StripeResponseGetter; |
| 14 | +import com.stripe.param.radar.CustomerEvaluationCreateParams; |
| 15 | +import java.math.BigDecimal; |
| 16 | +import java.util.Map; |
| 17 | +import lombok.EqualsAndHashCode; |
| 18 | +import lombok.Getter; |
| 19 | +import lombok.Setter; |
| 20 | + |
| 21 | +/** Customer Evaluation resource returned by the Radar Customer Evaluations API. */ |
| 22 | +@Getter |
| 23 | +@Setter |
| 24 | +@EqualsAndHashCode(callSuper = false) |
| 25 | +public class CustomerEvaluation extends ApiResource implements HasId { |
| 26 | + /** Time at which the object was created. Measured in seconds since the Unix epoch. */ |
| 27 | + @SerializedName("created_at") |
| 28 | + Long createdAt; |
| 29 | + |
| 30 | + /** The ID of the Stripe customer the customer evaluation is associated with. */ |
| 31 | + @SerializedName("customer") |
| 32 | + String customer; |
| 33 | + |
| 34 | + /** The type of evaluation event. */ |
| 35 | + @SerializedName("event_type") |
| 36 | + String eventType; |
| 37 | + |
| 38 | + /** Unique identifier for the object. */ |
| 39 | + @Getter(onMethod_ = {@Override}) |
| 40 | + @SerializedName("id") |
| 41 | + String id; |
| 42 | + |
| 43 | + /** |
| 44 | + * If the object exists in live mode, the value is {@code true}. If the object exists in test |
| 45 | + * mode, the value is {@code false}. |
| 46 | + */ |
| 47 | + @SerializedName("livemode") |
| 48 | + Boolean livemode; |
| 49 | + |
| 50 | + /** |
| 51 | + * String representing the object's type. Objects of the same type share the same value. |
| 52 | + * |
| 53 | + * <p>Equal to {@code radar.customer_evaluation}. |
| 54 | + */ |
| 55 | + @SerializedName("object") |
| 56 | + String object; |
| 57 | + |
| 58 | + /** A hash of signal objects providing Radar's evaluation for the lifecycle event. */ |
| 59 | + @SerializedName("signals") |
| 60 | + Signals signals; |
| 61 | + |
| 62 | + /** Creates a new {@code CustomerEvaluation} object. */ |
| 63 | + public static CustomerEvaluation create(Map<String, Object> params) throws StripeException { |
| 64 | + return create(params, (RequestOptions) null); |
| 65 | + } |
| 66 | + |
| 67 | + /** Creates a new {@code CustomerEvaluation} object. */ |
| 68 | + public static CustomerEvaluation create(Map<String, Object> params, RequestOptions options) |
| 69 | + throws StripeException { |
| 70 | + String path = "/v1/radar/customer_evaluations"; |
| 71 | + ApiRequest request = |
| 72 | + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options); |
| 73 | + return getGlobalResponseGetter().request(request, CustomerEvaluation.class); |
| 74 | + } |
| 75 | + |
| 76 | + /** Creates a new {@code CustomerEvaluation} object. */ |
| 77 | + public static CustomerEvaluation create(CustomerEvaluationCreateParams params) |
| 78 | + throws StripeException { |
| 79 | + return create(params, (RequestOptions) null); |
| 80 | + } |
| 81 | + |
| 82 | + /** Creates a new {@code CustomerEvaluation} object. */ |
| 83 | + public static CustomerEvaluation create( |
| 84 | + CustomerEvaluationCreateParams params, RequestOptions options) throws StripeException { |
| 85 | + String path = "/v1/radar/customer_evaluations"; |
| 86 | + ApiResource.checkNullTypedParams(path, params); |
| 87 | + ApiRequest request = |
| 88 | + new ApiRequest( |
| 89 | + BaseAddress.API, |
| 90 | + ApiResource.RequestMethod.POST, |
| 91 | + path, |
| 92 | + ApiRequestParams.paramsToMap(params), |
| 93 | + options); |
| 94 | + return getGlobalResponseGetter().request(request, CustomerEvaluation.class); |
| 95 | + } |
| 96 | + |
| 97 | + /** Customer Evaluation Signals resource returned by the Radar Customer Evaluations API. */ |
| 98 | + @Getter |
| 99 | + @Setter |
| 100 | + @EqualsAndHashCode(callSuper = false) |
| 101 | + public static class Signals extends StripeObject { |
| 102 | + @SerializedName("account_sharing") |
| 103 | + AccountSharing accountSharing; |
| 104 | + |
| 105 | + @SerializedName("multi_accounting") |
| 106 | + MultiAccounting multiAccounting; |
| 107 | + |
| 108 | + /** |
| 109 | + * For more details about AccountSharing, please refer to the <a |
| 110 | + * href="https://docs.stripe.com/api">API Reference.</a> |
| 111 | + */ |
| 112 | + @Getter |
| 113 | + @Setter |
| 114 | + @EqualsAndHashCode(callSuper = false) |
| 115 | + public static class AccountSharing extends StripeObject { |
| 116 | + /** Time at which the signal was evaluated. Measured in seconds since the Unix epoch. */ |
| 117 | + @SerializedName("evaluated_at") |
| 118 | + Long evaluatedAt; |
| 119 | + |
| 120 | + /** The risk level for this signal. */ |
| 121 | + @SerializedName("risk_level") |
| 122 | + String riskLevel; |
| 123 | + |
| 124 | + /** Score for this signal (float between 0.0-100.0). */ |
| 125 | + @SerializedName("score") |
| 126 | + BigDecimal score; |
| 127 | + } |
| 128 | + |
| 129 | + /** |
| 130 | + * For more details about MultiAccounting, please refer to the <a |
| 131 | + * href="https://docs.stripe.com/api">API Reference.</a> |
| 132 | + */ |
| 133 | + @Getter |
| 134 | + @Setter |
| 135 | + @EqualsAndHashCode(callSuper = false) |
| 136 | + public static class MultiAccounting extends StripeObject { |
| 137 | + /** Time at which the signal was evaluated. Measured in seconds since the Unix epoch. */ |
| 138 | + @SerializedName("evaluated_at") |
| 139 | + Long evaluatedAt; |
| 140 | + |
| 141 | + /** The risk level for this signal. */ |
| 142 | + @SerializedName("risk_level") |
| 143 | + String riskLevel; |
| 144 | + |
| 145 | + /** Score for this signal (float between 0.0-100.0). */ |
| 146 | + @SerializedName("score") |
| 147 | + BigDecimal score; |
| 148 | + } |
| 149 | + } |
| 150 | + |
| 151 | + @Override |
| 152 | + public void setResponseGetter(StripeResponseGetter responseGetter) { |
| 153 | + super.setResponseGetter(responseGetter); |
| 154 | + trySetResponseGetter(signals, responseGetter); |
| 155 | + } |
| 156 | +} |
0 commit comments