1212import com .fasterxml .jackson .annotation .JsonProperty ;
1313import com .fasterxml .jackson .annotation .JsonTypeInfo ;
1414import com .fasterxml .jackson .annotation .JsonTypeName ;
15+ import com .fasterxml .jackson .annotation .JsonView ;
1516import com .gooddata .util .GoodDataToStringBuilder ;
1617import org .springframework .web .util .UriTemplate ;
1718
19+ import java .util .List ;
20+
1821/**
1922 * Account setting
2023 */
@@ -35,11 +38,25 @@ public class Account {
3538 public static final String CURRENT_ID = "current" ;
3639
3740 private final String login ;
38- private final String email ;
39- private final String password ;
40- private final String verifyPassword ;
41- private final String firstName ;
42- private final String lastName ;
41+
42+ @ JsonView (UpdateView .class )
43+ private String email ;
44+
45+ @ JsonView (UpdateView .class )
46+ private String password ;
47+
48+ @ JsonView (UpdateView .class )
49+ private String verifyPassword ;
50+
51+ @ JsonView (UpdateView .class )
52+ private String firstName ;
53+
54+ @ JsonView (UpdateView .class )
55+ private String lastName ;
56+
57+ @ JsonView (UpdateView .class )
58+ private List <String > ipWhitelist ;
59+
4360 @ JsonIgnore
4461 private final Links links ;
4562
@@ -51,6 +68,7 @@ private Account(
5168 @ JsonProperty ("verifyPassword" ) String verifyPassword ,
5269 @ JsonProperty ("firstName" ) String firstName ,
5370 @ JsonProperty ("lastName" ) String lastName ,
71+ @ JsonProperty ("ipWhitelist" ) List <String > ipWhitelist ,
5472 @ JsonProperty ("links" ) Links links
5573 ) {
5674 this .login = login ;
@@ -59,11 +77,12 @@ private Account(
5977 this .verifyPassword = verifyPassword ;
6078 this .firstName = firstName ;
6179 this .lastName = lastName ;
80+ this .ipWhitelist = ipWhitelist ;
6281 this .links = links ;
6382 }
6483
65- public Account (String firstName ,String lastName , Links links ) {
66- this (null , null , null , null , firstName , lastName , links );
84+ public Account (String firstName , String lastName , Links links ) {
85+ this (null , null , null , null , firstName , lastName , null , links );
6786 }
6887
6988 /**
@@ -74,7 +93,7 @@ public Account(String firstName,String lastName, Links links) {
7493 * @param password password
7594 */
7695 public Account (String email , String password , String firstName , String lastName ) {
77- this (email , email , password , password , firstName , lastName , null );
96+ this (email , email , password , password , firstName , lastName , null , null );
7897 }
7998
8099 public String getLogin () {
@@ -126,6 +145,34 @@ public String getId() {
126145 return getId (getUri ());
127146 }
128147
148+ public List <String > getIpWhitelist () {
149+ return ipWhitelist ;
150+ }
151+
152+ public void setEmail (final String email ) {
153+ this .email = email ;
154+ }
155+
156+ public void setPassword (final String password ) {
157+ this .password = password ;
158+ }
159+
160+ public void setVerifyPassword (final String verifyPassword ) {
161+ this .verifyPassword = verifyPassword ;
162+ }
163+
164+ public void setFirstName (final String firstName ) {
165+ this .firstName = firstName ;
166+ }
167+
168+ public void setLastName (final String lastName ) {
169+ this .lastName = lastName ;
170+ }
171+
172+ public void setIpWhitelist (final List <String > ipWhitelist ) {
173+ this .ipWhitelist = ipWhitelist ;
174+ }
175+
129176 @ JsonIgnoreProperties (ignoreUnknown = true )
130177 private static class Links {
131178 private final String self ;
@@ -154,4 +201,10 @@ static String getId(String uri) {
154201 public String toString () {
155202 return GoodDataToStringBuilder .defaultToString (this , "password" , "verifyPassword" );
156203 }
204+
205+ /**
206+ * Class representing update view of account
207+ */
208+ static class UpdateView {
209+ }
157210}
0 commit comments