001package com.plivo.api.models.address;
002
003import com.fasterxml.jackson.databind.JsonNode;
004import com.plivo.api.models.base.BaseResource;
005
006public class Address extends BaseResource {
007
008  private String account;
009  private String id;
010  private String countryIso;
011  private String alias;
012  private String salutation;
013  private String firstName;
014  private String lastName;
015  private String addressLine1;
016  private String addressLine2;
017  private String city;
018  private String region;
019  private String postalCode;
020  private String fiscalIdentificationCode;
021  private String streetCode;
022  private String municipalCode;
023  private String validationStatus;
024  private String verificationStatus;
025  private String subaccount;
026  private String url;
027  private String addressProofType;
028  private JsonNode documentDetails;
029
030  public static AddressCreator creator(
031    String countryIso, String salutation, String firstName, String lastName,
032    String addressLine1, String addressLine2, String city, String region, String postalCode) {
033    return new AddressCreator(countryIso, salutation, firstName, lastName, addressLine1, addressLine2, city, region, postalCode);
034  }
035
036  public static AddressUpdater updater(String id){
037    return new AddressUpdater(id);
038  }
039
040  public static AddressGetter getter(String id) {
041    return new AddressGetter(id);
042  }
043
044  public static AddressDeleter deleter(String id) {
045    return new AddressDeleter(id);
046  }
047
048  public static AddressLister lister(){
049    return new AddressLister();
050  }
051
052  /**
053   * @return Account the address belongs to.
054   */
055  public String getAccount() {
056    return account;
057  }
058
059  /**
060   * @return Country ISO 2 code.
061   */
062  public String getCountryIso() {
063    return countryIso;
064  }
065
066  /**
067   * @return Alias name of the address.
068   */
069  public String getAlias() {
070    return alias;
071  }
072
073  // FIXME: This has to be an enum, plivoClient current implementaion breaking upper case enums
074  public String getSalutation() {
075    return salutation;
076  }
077
078  /**
079   * @return First name of the user for whom the identity is created.
080   */
081  public String getFirstName() {
082    return firstName;
083  }
084
085  /**
086   * @return Last name of the user for whom the identity is created.
087   */
088  public String getLastName() {
089    return lastName;
090  }
091
092  /**
093   * @return Building name/number.
094   */
095  public String getAddressLine1() {
096    return addressLine1;
097  }
098
099  /**
100   * @return The street name/number of the address.
101   */
102  public String getAddressLine2() {
103    return addressLine2;
104  }
105
106  /**
107   * @return The city of the address for which the address proof is created.
108   */
109  public String getCity() {
110    return city;
111  }
112
113  /**
114   * @return The region of the address for which the address proof is created.
115   */
116  public String getRegion() {
117    return region;
118  }
119
120  /**
121   * @return The document details json object of the address.
122   */
123
124  public JsonNode getDocumentDetails() {
125    return documentDetails;
126  }
127
128  /**
129   * @return The postal code of the address that is being created.
130   */
131  public String getPostalCode() {
132    return postalCode;
133  }
134
135  /**
136   * @return The code is available for businesses alone and will be available for spain mobile numbers.
137   *         If not present, return null.
138   */
139  public String getFiscalIdentificationCode() {
140    return fiscalIdentificationCode;
141  }
142
143  /**
144   * @return Street code of the address. Return null if not present.
145   */
146  public String getStreetCode() {
147    return streetCode;
148  }
149
150  /**
151   * @return Municipal code of the address. Return null if not present.
152   */
153  public String getMunicipalCode() {
154    return municipalCode;
155  }
156
157  /**
158   * @return Can take the following values: pending. accepted, rejected, null.
159   */
160  public String getValidationStatus() {
161    return validationStatus; }
162
163  /**
164   * @return Can take the following values: pending. verified, rejected, null.
165   */
166  public String getVerificationStatus() {
167    return verificationStatus;
168  }
169
170  /**
171   * @return The link to the subaccount resource associated with the application.
172   *         If the application belongs to the main account, this field will be null.
173   */
174  public String getSubaccount() {
175    return subaccount;
176  }
177
178  /**
179   * @return A plivo wrapped link to the document stored in the Plivo CDN.
180   */
181  public String getUrl() {
182    return url;
183  }
184
185  /**
186   * @return The type of document that is provided as address proof.
187   */
188  // FIXME: This has to be an enum, some invalid values in DB needs to be fixed before making the change
189  public String getAddressProofType() {
190    return addressProofType;
191  }
192
193  @Override
194  public String getId() {
195    return id;
196  }
197}