001package com.plivo.api.models.identity;
002
003import com.fasterxml.jackson.databind.JsonNode;
004import com.plivo.api.models.base.BaseResource;
005
006import java.time.LocalDate;
007
008public class Identity extends BaseResource {
009
010  private String account;
011  private String id;
012  private String countryIso;
013  private String alias;
014  private String salutation;
015  private String firstName;
016  private String lastName;
017  private String birthPlace;
018  private String birthDate;
019  private String nationality;
020  private String idNationality;
021  private String idIssueDate;
022  private String businessName;
023  private String idType;
024  private String idNumber;
025  private String addressLine1;
026  private String addressLine2;
027  private String city;
028  private String region;
029  private String postalCode;
030  private String fiscalIdentificationCode;
031  private String streetCode;
032  private String municipalCode;
033  private String validationStatus;
034  private String verificationStatus;
035  private String subaccount;
036  private String url;
037  private JsonNode documentDetails;
038
039  public static IdentityCreator creator(String countryIso, String salutation, String firstName, String lastName,
040                                        String birthPlace, LocalDate birthDate, String nationality, String idNationality,
041                                        LocalDate idIssueDate, String businessName, String idType, String idNumber,
042                                        String addressLine1, String addressLine2, String city, String region, String postalCode) {
043    return new IdentityCreator(countryIso, salutation, firstName, lastName, birthPlace, birthDate,
044      nationality, idNationality, idIssueDate, businessName, idType, idNumber, addressLine1, addressLine2,
045      city, region, postalCode);
046  }
047
048  public static IdentityUpdater updater(String id){
049    return new IdentityUpdater(id);
050  }
051
052  public static IdentityDeleter deleter(String id){
053    return new IdentityDeleter(id);
054  }
055
056  public static IdentityGetter getter(String id){
057    return new IdentityGetter(id);
058  }
059
060  public static IdentityLister lister(){
061    return new IdentityLister();
062  }
063
064  /**
065   * @return Account the address belongs to
066   */
067  public String getAccount() {
068    return account;
069  }
070
071  /**
072   * @return Country ISO 2 code.
073   */
074  public String getCountryIso() {
075    return countryIso;
076  }
077
078  /**
079   * @return Alias name of the address.
080   */
081  public String getAlias() {
082    return alias;
083  }
084
085  // FIXME: This has to be an enum, plivoClient current implementaion breaking upper case enums
086  public String getSalutation() {
087    return salutation;
088  }
089
090  /**
091   * @return First name of the user for whom the identity is created.
092   */
093  public String getFirstName() {
094    return firstName;
095  }
096
097  /**
098   * @return Last name of the user for whom the identity is created.
099   */
100  public String getLastName() {
101    return lastName;
102  }
103
104  /**
105   * @return Birthplace of the user for whom the identity is created.
106   */
107  public String getBirthPlace() {
108    return birthPlace;
109  }
110
111  /**
112   * @return Birth date in yyyy-mm-dd format of the user for whom the identity is created.
113   */
114  public String getBirthDate() {
115    return birthDate;
116  }
117
118  /**
119   * @return Nationality of the user for whom the identity is created.
120   */
121  public String getNationality() {
122    return nationality;
123  }
124
125  /**
126   * @return Nationality mentioned in the identity proof.
127   */
128  public String getIdNationality() {
129    return idNationality;
130  }
131
132  /**
133   * @return Issue date in yyyy-mm-dd mentioned in the identity proof.
134   */
135  public String getIdIssueDate() {
136    return idIssueDate;
137  }
138
139  /**
140   * @return Business name of the user for whom the identity is created.
141   */
142  public String getBusinessName() {
143    return businessName;
144  }
145
146  /**
147   * @return Building name/number
148   */
149  public String getIdType() {
150    return idType;
151  }
152
153  /**
154   * @return The unique number on the identifier.
155   */
156  public String getIdNumber() {
157    return idNumber;
158  }
159
160  /**
161   * @return Building name/number
162   */
163  public String getAddressLine1() {
164    return addressLine1;
165  }
166
167  /**
168   * @return The street name/number of the address
169   */
170  public String getAddressLine2() {
171    return addressLine2;
172  }
173
174  /**
175   * @return The city of the address for which the address proof is created
176   */
177  public String getCity() {
178    return city;
179  }
180
181  /**
182   * @return The region of the address for which the address proof is created
183   */
184  public String getRegion() {
185    return region;
186  }
187
188  /**
189   * @return The postal code of the address that is being created
190   */
191  public String getPostalCode() {
192    return postalCode;
193  }
194
195  /**
196   * @return The code is available for businesses alone and will be available for spain mobile numbers.
197   *         If not present, return null
198   */
199  public String getFiscalIdentificationCode() {
200    return fiscalIdentificationCode;
201  }
202
203  /**
204    * @return Street code of the address. Return null if not present.
205   */
206  public String getStreetCode() {
207    return streetCode;
208  }
209
210  /**
211   * @return Municipal code of the address. Return null if not present.
212   */
213  public String getMunicipalCode() {
214    return municipalCode;
215  }
216
217  /**
218   * @return Can take the following values: pending. accepted, rejected, null
219   */
220  public String getValidationStatus() {
221    return validationStatus;
222  }
223
224  /**
225   * @return Can take the following values: pending. verified, rejected
226   */
227  public String getVerificationStatus() {
228    return verificationStatus;
229  }
230
231  /**
232   * @return The link to the subaccount resource associated with the application.
233   *         If the application belongs to the main account, this field will be null.
234   */
235  public String getSubaccount() {
236    return subaccount;
237  }
238
239  /**
240   * @return A plivo wrapped link to the document stored in the Plivo CDN.
241   */
242  public String getUrl() {
243    return url;
244  }
245
246  /**
247   * @return The document details json object of the address.
248   */
249
250  public JsonNode getDocumentDetails() {
251    return documentDetails;
252  }
253
254  @Override
255  public String getId() {
256    return id;
257  }
258}