1212import com .stripe .net .RequestOptions ;
1313import com .stripe .net .StripeResponseGetter ;
1414import com .stripe .param .radar .CustomerEvaluationCreateParams ;
15+ import com .stripe .param .radar .CustomerEvaluationUpdateParams ;
1516import java .math .BigDecimal ;
17+ import java .util .List ;
1618import java .util .Map ;
1719import lombok .EqualsAndHashCode ;
1820import lombok .Getter ;
@@ -35,6 +37,10 @@ public class CustomerEvaluation extends ApiResource implements HasId {
3537 @ SerializedName ("event_type" )
3638 String eventType ;
3739
40+ /** A list of events that have been reported on this customer evaluation. */
41+ @ SerializedName ("events" )
42+ List <CustomerEvaluation .Event > events ;
43+
3844 /** Unique identifier for the object. */
3945 @ Getter (onMethod_ = {@ Override })
4046 @ SerializedName ("id" )
@@ -94,6 +100,86 @@ public static CustomerEvaluation create(
94100 return getGlobalResponseGetter ().request (request , CustomerEvaluation .class );
95101 }
96102
103+ /** Reports an event on a {@code CustomerEvaluation} object. */
104+ public CustomerEvaluation update (Map <String , Object > params ) throws StripeException {
105+ return update (params , (RequestOptions ) null );
106+ }
107+
108+ /** Reports an event on a {@code CustomerEvaluation} object. */
109+ public CustomerEvaluation update (Map <String , Object > params , RequestOptions options )
110+ throws StripeException {
111+ String path =
112+ String .format (
113+ "/v1/radar/customer_evaluations/%s/report" , ApiResource .urlEncodeId (this .getId ()));
114+ ApiRequest request =
115+ new ApiRequest (BaseAddress .API , ApiResource .RequestMethod .POST , path , params , options );
116+ return getResponseGetter ().request (request , CustomerEvaluation .class );
117+ }
118+
119+ /** Reports an event on a {@code CustomerEvaluation} object. */
120+ public CustomerEvaluation update (CustomerEvaluationUpdateParams params ) throws StripeException {
121+ return update (params , (RequestOptions ) null );
122+ }
123+
124+ /** Reports an event on a {@code CustomerEvaluation} object. */
125+ public CustomerEvaluation update (CustomerEvaluationUpdateParams params , RequestOptions options )
126+ throws StripeException {
127+ String path =
128+ String .format (
129+ "/v1/radar/customer_evaluations/%s/report" , ApiResource .urlEncodeId (this .getId ()));
130+ ApiResource .checkNullTypedParams (path , params );
131+ ApiRequest request =
132+ new ApiRequest (
133+ BaseAddress .API ,
134+ ApiResource .RequestMethod .POST ,
135+ path ,
136+ ApiRequestParams .paramsToMap (params ),
137+ options );
138+ return getResponseGetter ().request (request , CustomerEvaluation .class );
139+ }
140+
141+ /** Event object representing an event reported for a Customer Evaluation via the report API. */
142+ @ Getter
143+ @ Setter
144+ @ EqualsAndHashCode (callSuper = false )
145+ public static class Event extends StripeObject {
146+ /** Data about a failed login event. */
147+ @ SerializedName ("login_failed" )
148+ LoginFailed loginFailed ;
149+
150+ /** Time at which the event occurred. Measured in seconds since the Unix epoch. */
151+ @ SerializedName ("occurred_at" )
152+ Long occurredAt ;
153+
154+ /** Data about a failed registration event. */
155+ @ SerializedName ("registration_failed" )
156+ RegistrationFailed registrationFailed ;
157+
158+ /** The type of event that occurred. */
159+ @ SerializedName ("type" )
160+ String type ;
161+
162+ /** Data about a failed login event. */
163+ @ Getter
164+ @ Setter
165+ @ EqualsAndHashCode (callSuper = false )
166+ public static class LoginFailed extends StripeObject {
167+ /** The reason why this login failed. */
168+ @ SerializedName ("reason" )
169+ String reason ;
170+ }
171+
172+ /** Data about a failed registration event. */
173+ @ Getter
174+ @ Setter
175+ @ EqualsAndHashCode (callSuper = false )
176+ public static class RegistrationFailed extends StripeObject {
177+ /** The reason why this registration failed. */
178+ @ SerializedName ("reason" )
179+ String reason ;
180+ }
181+ }
182+
97183 /** Customer Evaluation Signals resource returned by the Radar Customer Evaluations API. */
98184 @ Getter
99185 @ Setter
0 commit comments