11package com .sendgrid .http ;
22
33import lombok .Getter ;
4-
4+ import org . apache . http . Header ;
55import java .util .Map ;
66import java .util .StringJoiner ;
77
88public class ApiResponse <T > {
99 @ Getter
1010 private Integer statusCode ;
1111 @ Getter
12- private String statusMessage ;
13- @ Getter
1412 private T body ;
1513 @ Getter
16- private Map < String , String > headers ;
14+ private Header [] headers ;
1715
1816
19- public ApiResponse (int statusCode , String statusMessage , Map < String , String > headers ) {
17+ public ApiResponse (int statusCode , Header [] headers ) {
2018 this .body = null ;
2119 this .headers = headers ;
2220 this .statusCode = statusCode ;
23- this .statusMessage = statusMessage ;
2421 }
2522
26- public ApiResponse (int statusCode , String statusMessage , T body , Map < String , String > headers ) {
23+ public ApiResponse (int statusCode , T body , Header [] headers ) {
2724 this .statusCode = statusCode ;
28- this .statusMessage = statusMessage ;
2925 this .body = body ;
3026 this .headers = headers ;
3127 }
@@ -34,9 +30,8 @@ public ApiResponse(int statusCode, String statusMessage, T body, Map<String, Str
3430 public String toString () {
3531 StringJoiner joiner = new StringJoiner (", " , ApiResponse .class .getSimpleName () + "(" , ")" );
3632 if (statusCode != null ) joiner .add ("statusCode=" + statusCode );
37- if (statusMessage != null ) joiner .add ("statusMessage=" + statusMessage );
38- if (statusMessage != null ) joiner .add ("body=" + body );
39- if (statusMessage != null ) joiner .add ("headers=" + headers );
33+ if (headers != null ) joiner .add ("headers=" + headers );
34+ if (body != null ) joiner .add ("body=" + body );
4035 return joiner .toString ();
4136 }
4237}
0 commit comments