All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.textmagic.sdk.model.DoCarrierLookupResponse Maven / Gradle / Ivy

There is a newer version: 2.0.2456
Show newest version
/*
 * TextMagic API
 * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
 *
 * OpenAPI spec version: 2
 * 
 *
 * NOTE: This class is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen.git
 * Do not edit the class manually.
 */


package com.textmagic.sdk.model;

import java.util.Objects;
import java.util.Arrays;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import com.textmagic.sdk.model.Country;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.math.BigDecimal;

/**
 * DoCarrierLookupResponse
 */

public class DoCarrierLookupResponse {
  @SerializedName("cost")
  private BigDecimal cost = null;

  @SerializedName("country")
  private Country country = null;

  @SerializedName("local")
  private String local = null;

  /**
   * Phone number type.
   */
  @JsonAdapter(TypeEnum.Adapter.class)
  public enum TypeEnum {
    MOBILE("mobile"),
    
    LANDLINE("landline"),
    
    VOIP("voip");

    private String value;

    TypeEnum(String value) {
      this.value = value;
    }

    public String getValue() {
      return value;
    }

    @Override
    public String toString() {
      return String.valueOf(value);
    }

    public static TypeEnum fromValue(String text) {
      for (TypeEnum b : TypeEnum.values()) {
        if (String.valueOf(b.value).equals(text)) {
          return b;
        }
      }
      return null;
    }

    public static class Adapter extends TypeAdapter {
      @Override
      public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException {
        jsonWriter.value(enumeration.getValue());
      }

      @Override
      public TypeEnum read(final JsonReader jsonReader) throws IOException {
        String value = jsonReader.nextString();
        return TypeEnum.fromValue(String.valueOf(value));
      }
    }
  }

  @SerializedName("type")
  private TypeEnum type = null;

  @SerializedName("carrier")
  private String carrier = null;

  @SerializedName("number164")
  private String number164 = null;

  @SerializedName("valid")
  private Boolean valid = null;

  public DoCarrierLookupResponse cost(BigDecimal cost) {
    this.cost = cost;
    return this;
  }

   /**
   * The cost to check that one number is constant – 0.04 in your account currency.
   * @return cost
  **/
  @ApiModelProperty(example = "0.04", required = true, value = "The cost to check that one number is constant – 0.04 in your account currency.")
  public BigDecimal getCost() {
    return cost;
  }

  public void setCost(BigDecimal cost) {
    this.cost = cost;
  }

  public DoCarrierLookupResponse country(Country country) {
    this.country = country;
    return this;
  }

   /**
   * Phone number country.
   * @return country
  **/
  @ApiModelProperty(value = "Phone number country.")
  public Country getCountry() {
    return country;
  }

  public void setCountry(Country country) {
    this.country = country;
  }

  public DoCarrierLookupResponse local(String local) {
    this.local = local;
    return this;
  }

   /**
   * Phone number in [National format](https://en.wikipedia.org/wiki/National_conventions_for_writing_telephone_numbers).
   * @return local
  **/
  @ApiModelProperty(example = "07860", required = true, value = "Phone number in [National format](https://en.wikipedia.org/wiki/National_conventions_for_writing_telephone_numbers).")
  public String getLocal() {
    return local;
  }

  public void setLocal(String local) {
    this.local = local;
  }

  public DoCarrierLookupResponse type(TypeEnum type) {
    this.type = type;
    return this;
  }

   /**
   * Phone number type.
   * @return type
  **/
  @ApiModelProperty(example = "mobile", required = true, value = "Phone number type.")
  public TypeEnum getType() {
    return type;
  }

  public void setType(TypeEnum type) {
    this.type = type;
  }

  public DoCarrierLookupResponse carrier(String carrier) {
    this.carrier = carrier;
    return this;
  }

   /**
   * Carrier name.
   * @return carrier
  **/
  @ApiModelProperty(example = "Telefonica UK", required = true, value = "Carrier name.")
  public String getCarrier() {
    return carrier;
  }

  public void setCarrier(String carrier) {
    this.carrier = carrier;
  }

  public DoCarrierLookupResponse number164(String number164) {
    this.number164 = number164;
    return this;
  }

   /**
   * Phone number in [E.164 format](https://en.wikipedia.org/wiki/E.164).
   * @return number164
  **/
  @ApiModelProperty(example = "447860021130", required = true, value = "Phone number in [E.164 format](https://en.wikipedia.org/wiki/E.164).")
  public String getNumber164() {
    return number164;
  }

  public void setNumber164(String number164) {
    this.number164 = number164;
  }

  public DoCarrierLookupResponse valid(Boolean valid) {
    this.valid = valid;
    return this;
  }

   /**
   * This field shows whether the entered phone number is valid or not.
   * @return valid
  **/
  @ApiModelProperty(example = "true", required = true, value = "This field shows whether the entered phone number is valid or not.")
  public Boolean isValid() {
    return valid;
  }

  public void setValid(Boolean valid) {
    this.valid = valid;
  }


  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    DoCarrierLookupResponse doCarrierLookupResponse = (DoCarrierLookupResponse) o;
    return Objects.equals(this.cost, doCarrierLookupResponse.cost) &&
        Objects.equals(this.country, doCarrierLookupResponse.country) &&
        Objects.equals(this.local, doCarrierLookupResponse.local) &&
        Objects.equals(this.type, doCarrierLookupResponse.type) &&
        Objects.equals(this.carrier, doCarrierLookupResponse.carrier) &&
        Objects.equals(this.number164, doCarrierLookupResponse.number164) &&
        Objects.equals(this.valid, doCarrierLookupResponse.valid);
  }

  @Override
  public int hashCode() {
    return Objects.hash(cost, country, local, type, carrier, number164, valid);
  }


  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class DoCarrierLookupResponse {\n");
    
    sb.append("    cost: ").append(toIndentedString(cost)).append("\n");
    sb.append("    country: ").append(toIndentedString(country)).append("\n");
    sb.append("    local: ").append(toIndentedString(local)).append("\n");
    sb.append("    type: ").append(toIndentedString(type)).append("\n");
    sb.append("    carrier: ").append(toIndentedString(carrier)).append("\n");
    sb.append("    number164: ").append(toIndentedString(number164)).append("\n");
    sb.append("    valid: ").append(toIndentedString(valid)).append("\n");
    sb.append("}");
    return sb.toString();
  }

  /**
   * Convert the given object to string with each line indented by 4 spaces
   * (except the first line).
   */
  private String toIndentedString(java.lang.Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }

}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy