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

com.sinch.sdk.domains.verification.models.v1.webhooks.VerificationRequestEventImpl Maven / Gradle / Ivy

There is a newer version: 1.4.0
Show newest version
package com.sinch.sdk.domains.verification.models.v1.webhooks;

import com.fasterxml.jackson.annotation.JsonFilter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder;
import com.sinch.sdk.core.models.OptionalValue;
import com.sinch.sdk.domains.verification.models.v1.Identity;
import com.sinch.sdk.domains.verification.models.v1.Price;
import java.util.List;
import java.util.Objects;

@JsonPropertyOrder({
  VerificationRequestEventImpl.JSON_PROPERTY_ID,
  VerificationRequestEventImpl.JSON_PROPERTY_EVENT,
  VerificationRequestEventImpl.JSON_PROPERTY_IDENTITY,
  VerificationRequestEventImpl.JSON_PROPERTY_REFERENCE,
  VerificationRequestEventImpl.JSON_PROPERTY_CUSTOM,
  VerificationRequestEventImpl.JSON_PROPERTY_METHOD,
  VerificationRequestEventImpl.JSON_PROPERTY_PRICE,
  VerificationRequestEventImpl.JSON_PROPERTY_ACCEPT_LANGUAGE
})
@JsonFilter("uninitializedFilter")
@JsonInclude(value = JsonInclude.Include.CUSTOM)
public class VerificationRequestEventImpl
    implements VerificationRequestEvent,
        com.sinch.sdk.domains.verification.models.v1.webhooks.VerificationEvent {
  private static final long serialVersionUID = 1L;

  public static final String JSON_PROPERTY_ID = "id";

  private OptionalValue id;

  public static final String JSON_PROPERTY_EVENT = "event";

  private OptionalValue event;

  public static final String JSON_PROPERTY_IDENTITY = "identity";

  private OptionalValue identity;

  public static final String JSON_PROPERTY_REFERENCE = "reference";

  private OptionalValue reference;

  public static final String JSON_PROPERTY_CUSTOM = "custom";

  private OptionalValue custom;

  public static final String JSON_PROPERTY_METHOD = "method";

  private OptionalValue method;

  public static final String JSON_PROPERTY_PRICE = "price";

  private OptionalValue price;

  public static final String JSON_PROPERTY_ACCEPT_LANGUAGE = "acceptLanguage";

  private OptionalValue> acceptLanguage;

  public VerificationRequestEventImpl() {}

  protected VerificationRequestEventImpl(
      OptionalValue id,
      OptionalValue event,
      OptionalValue identity,
      OptionalValue reference,
      OptionalValue custom,
      OptionalValue method,
      OptionalValue price,
      OptionalValue> acceptLanguage) {
    this.id = id;
    this.event = event;
    this.identity = identity;
    this.reference = reference;
    this.custom = custom;
    this.method = method;
    this.price = price;
    this.acceptLanguage = acceptLanguage;
  }

  @JsonIgnore
  public String getId() {
    return id.orElse(null);
  }

  @JsonProperty(JSON_PROPERTY_ID)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public OptionalValue id() {
    return id;
  }

  @JsonIgnore
  public EventEnum getEvent() {
    return event.orElse(null);
  }

  @JsonProperty(JSON_PROPERTY_EVENT)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public OptionalValue event() {
    return event;
  }

  @JsonIgnore
  public Identity getIdentity() {
    return identity.orElse(null);
  }

  @JsonProperty(JSON_PROPERTY_IDENTITY)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public OptionalValue identity() {
    return identity;
  }

  @JsonIgnore
  public String getReference() {
    return reference.orElse(null);
  }

  @JsonProperty(JSON_PROPERTY_REFERENCE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public OptionalValue reference() {
    return reference;
  }

  @JsonIgnore
  public String getCustom() {
    return custom.orElse(null);
  }

  @JsonProperty(JSON_PROPERTY_CUSTOM)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public OptionalValue custom() {
    return custom;
  }

  @JsonIgnore
  public MethodEnum getMethod() {
    return method.orElse(null);
  }

  @JsonProperty(JSON_PROPERTY_METHOD)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public OptionalValue method() {
    return method;
  }

  @JsonIgnore
  public Price getPrice() {
    return price.orElse(null);
  }

  @JsonProperty(JSON_PROPERTY_PRICE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public OptionalValue price() {
    return price;
  }

  @JsonIgnore
  public List getAcceptLanguage() {
    return acceptLanguage.orElse(null);
  }

  @JsonProperty(JSON_PROPERTY_ACCEPT_LANGUAGE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public OptionalValue> acceptLanguage() {
    return acceptLanguage;
  }

  /** Return true if this VerificationRequestEvent object is equal to o. */
  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    VerificationRequestEventImpl verificationRequestEvent = (VerificationRequestEventImpl) o;
    return Objects.equals(this.id, verificationRequestEvent.id)
        && Objects.equals(this.event, verificationRequestEvent.event)
        && Objects.equals(this.identity, verificationRequestEvent.identity)
        && Objects.equals(this.reference, verificationRequestEvent.reference)
        && Objects.equals(this.custom, verificationRequestEvent.custom)
        && Objects.equals(this.method, verificationRequestEvent.method)
        && Objects.equals(this.price, verificationRequestEvent.price)
        && Objects.equals(this.acceptLanguage, verificationRequestEvent.acceptLanguage);
  }

  @Override
  public int hashCode() {
    return Objects.hash(id, event, identity, reference, custom, method, price, acceptLanguage);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class VerificationRequestEventImpl {\n");
    sb.append("    id: ").append(toIndentedString(id)).append("\n");
    sb.append("    event: ").append(toIndentedString(event)).append("\n");
    sb.append("    identity: ").append(toIndentedString(identity)).append("\n");
    sb.append("    reference: ").append(toIndentedString(reference)).append("\n");
    sb.append("    custom: ").append(toIndentedString(custom)).append("\n");
    sb.append("    method: ").append(toIndentedString(method)).append("\n");
    sb.append("    price: ").append(toIndentedString(price)).append("\n");
    sb.append("    acceptLanguage: ").append(toIndentedString(acceptLanguage)).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(Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }

  @JsonPOJOBuilder(withPrefix = "set")
  static class Builder implements VerificationRequestEvent.Builder {
    OptionalValue id = OptionalValue.empty();
    OptionalValue event = OptionalValue.empty();
    OptionalValue identity = OptionalValue.empty();
    OptionalValue reference = OptionalValue.empty();
    OptionalValue custom = OptionalValue.empty();
    OptionalValue method = OptionalValue.empty();
    OptionalValue price = OptionalValue.empty();
    OptionalValue> acceptLanguage = OptionalValue.empty();

    @JsonProperty(JSON_PROPERTY_ID)
    public Builder setId(String id) {
      this.id = OptionalValue.of(id);
      return this;
    }

    @JsonProperty(JSON_PROPERTY_EVENT)
    public Builder setEvent(EventEnum event) {
      this.event = OptionalValue.of(event);
      return this;
    }

    @JsonProperty(JSON_PROPERTY_IDENTITY)
    public Builder setIdentity(Identity identity) {
      this.identity = OptionalValue.of(identity);
      return this;
    }

    @JsonProperty(JSON_PROPERTY_REFERENCE)
    public Builder setReference(String reference) {
      this.reference = OptionalValue.of(reference);
      return this;
    }

    @JsonProperty(JSON_PROPERTY_CUSTOM)
    public Builder setCustom(String custom) {
      this.custom = OptionalValue.of(custom);
      return this;
    }

    @JsonProperty(JSON_PROPERTY_METHOD)
    public Builder setMethod(MethodEnum method) {
      this.method = OptionalValue.of(method);
      return this;
    }

    @JsonProperty(JSON_PROPERTY_PRICE)
    public Builder setPrice(Price price) {
      this.price = OptionalValue.of(price);
      return this;
    }

    @JsonProperty(JSON_PROPERTY_ACCEPT_LANGUAGE)
    public Builder setAcceptLanguage(List acceptLanguage) {
      this.acceptLanguage = OptionalValue.of(acceptLanguage);
      return this;
    }

    public VerificationRequestEvent build() {
      return new VerificationRequestEventImpl(
          id, event, identity, reference, custom, method, price, acceptLanguage);
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy