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

com.sinch.sdk.domains.voice.models.dto.v1.IceRequestDto Maven / Gradle / Ivy

There is a newer version: 1.4.0
Show newest version
/*
 * Voice API | Sinch
 * The Voice API exposes calling- and conference-related functionality in the Sinch Voice Platform.
 *
 * The version of the OpenAPI document: 1.0.1
 * Contact: [email protected]
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

package com.sinch.sdk.domains.voice.models.dto.v1;

import com.fasterxml.jackson.annotation.JsonCreator;
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.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonValue;
import com.sinch.sdk.core.utils.databind.JSONNavigator;
import java.time.OffsetDateTime;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;

/** The request body of an Incoming Call Event. */
@JsonPropertyOrder({
  IceRequestDto.JSON_PROPERTY_EVENT,
  IceRequestDto.JSON_PROPERTY_TIMESTAMP,
  IceRequestDto.JSON_PROPERTY_CUSTOM,
  IceRequestDto.JSON_PROPERTY_APPLICATION_KEY,
  IceRequestDto.JSON_PROPERTY_CALL_RESOURCE_URL,
  IceRequestDto.JSON_PROPERTY_USER_RATE,
  IceRequestDto.JSON_PROPERTY_CLI,
  IceRequestDto.JSON_PROPERTY_TO,
  IceRequestDto.JSON_PROPERTY_DOMAIN,
  IceRequestDto.JSON_PROPERTY_ORIGINATION_TYPE,
  IceRequestDto.JSON_PROPERTY_DURATION,
  IceRequestDto.JSON_PROPERTY_RDNIS,
  IceRequestDto.JSON_PROPERTY_CALL_HEADERS
})
@JsonFilter("uninitializedFilter")
@JsonInclude(value = JsonInclude.Include.CUSTOM)

/*@JsonIgnoreProperties(
  value = "event", // ignore manually set event, it will be automatically generated by Jackson during serialization
  allowSetters = true // allows the event to be set during deserialization
)*/
@JsonTypeInfo(
    use = JsonTypeInfo.Id.NONE,
    include = JsonTypeInfo.As.EXISTING_PROPERTY,
    property = "event",
    visible = true)
public class IceRequestDto extends WebhooksEventRequestDto {
  private static final long serialVersionUID = 1L;

  /** Must have the value `ice`. */
  public enum EventEnum {
    ICE("ice"),

    UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api");

    private String value;

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

    @JsonValue
    public String getValue() {
      return value;
    }

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

    @JsonCreator
    public static EventEnum fromValue(String value) {
      for (EventEnum b : EventEnum.values()) {
        if (b.value.equals(value)) {
          return b;
        }
      }
      return UNKNOWN_DEFAULT_OPEN_API;
    }
  }

  public static final String JSON_PROPERTY_EVENT = "event";
  private String event;
  private boolean eventDefined = false;

  public static final String JSON_PROPERTY_TIMESTAMP = "timestamp";
  private OffsetDateTime timestamp;
  private boolean timestampDefined = false;

  public static final String JSON_PROPERTY_CUSTOM = "custom";
  private String custom;
  private boolean customDefined = false;

  public static final String JSON_PROPERTY_APPLICATION_KEY = "applicationKey";
  private String applicationKey;
  private boolean applicationKeyDefined = false;

  public static final String JSON_PROPERTY_CALL_RESOURCE_URL = "callResourceUrl";
  private String callResourceUrl;
  private boolean callResourceUrlDefined = false;

  public static final String JSON_PROPERTY_USER_RATE = "userRate";
  private PriceDto userRate;
  private boolean userRateDefined = false;

  public static final String JSON_PROPERTY_CLI = "cli";
  private String cli;
  private boolean cliDefined = false;

  public static final String JSON_PROPERTY_TO = "to";
  private DestinationDto to;
  private boolean toDefined = false;

  public static final String JSON_PROPERTY_DOMAIN = "domain";
  private DomainDto domain;
  private boolean domainDefined = false;

  public static final String JSON_PROPERTY_ORIGINATION_TYPE = "originationType";
  private DomainDto originationType;
  private boolean originationTypeDefined = false;

  public static final String JSON_PROPERTY_DURATION = "duration";
  private Integer duration;
  private boolean durationDefined = false;

  public static final String JSON_PROPERTY_RDNIS = "rdnis";
  private String rdnis;
  private boolean rdnisDefined = false;

  public static final String JSON_PROPERTY_CALL_HEADERS = "callHeaders";
  private List callHeaders;
  private boolean callHeadersDefined = false;

  public IceRequestDto() {}

  public IceRequestDto event(String event) {
    this.event = event;
    this.eventDefined = true;
    return this;
  }

  /**
   * Must have the value `ice`.
   *
   * @return event
   */
  @JsonProperty(JSON_PROPERTY_EVENT)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public String getEvent() {
    return event;
  }

  @JsonIgnore
  public boolean getEventDefined() {
    return eventDefined;
  }

  @JsonProperty(JSON_PROPERTY_EVENT)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setEvent(String event) {
    this.event = event;
    this.eventDefined = true;
  }

  public IceRequestDto timestamp(OffsetDateTime timestamp) {
    this.timestamp = timestamp;
    this.timestampDefined = true;
    return this;
  }

  /**
   * The timestamp in UTC format.
   *
   * @return timestamp
   */
  @JsonProperty(JSON_PROPERTY_TIMESTAMP)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public OffsetDateTime getTimestamp() {
    return timestamp;
  }

  @JsonIgnore
  public boolean getTimestampDefined() {
    return timestampDefined;
  }

  @JsonProperty(JSON_PROPERTY_TIMESTAMP)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setTimestamp(OffsetDateTime timestamp) {
    this.timestamp = timestamp;
    this.timestampDefined = true;
  }

  public IceRequestDto custom(String custom) {
    this.custom = custom;
    this.customDefined = true;
    return this;
  }

  /**
   * A string that can be used to pass custom information related to the call.
   *
   * @return custom
   */
  @JsonProperty(JSON_PROPERTY_CUSTOM)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public String getCustom() {
    return custom;
  }

  @JsonIgnore
  public boolean getCustomDefined() {
    return customDefined;
  }

  @JsonProperty(JSON_PROPERTY_CUSTOM)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setCustom(String custom) {
    this.custom = custom;
    this.customDefined = true;
  }

  public IceRequestDto applicationKey(String applicationKey) {
    this.applicationKey = applicationKey;
    this.applicationKeyDefined = true;
    return this;
  }

  /**
   * The unique application key. You can find it in the Sinch
   * [dashboard](https://dashboard.sinch.com/voice/apps).
   *
   * @return applicationKey
   */
  @JsonProperty(JSON_PROPERTY_APPLICATION_KEY)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public String getApplicationKey() {
    return applicationKey;
  }

  @JsonIgnore
  public boolean getApplicationKeyDefined() {
    return applicationKeyDefined;
  }

  @JsonProperty(JSON_PROPERTY_APPLICATION_KEY)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setApplicationKey(String applicationKey) {
    this.applicationKey = applicationKey;
    this.applicationKeyDefined = true;
  }

  public IceRequestDto callResourceUrl(String callResourceUrl) {
    this.callResourceUrl = callResourceUrl;
    this.callResourceUrlDefined = true;
    return this;
  }

  /**
   * The path of the API resource.
   *
   * @return callResourceUrl
   */
  @JsonProperty(JSON_PROPERTY_CALL_RESOURCE_URL)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public String getCallResourceUrl() {
    return callResourceUrl;
  }

  @JsonIgnore
  public boolean getCallResourceUrlDefined() {
    return callResourceUrlDefined;
  }

  @JsonProperty(JSON_PROPERTY_CALL_RESOURCE_URL)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setCallResourceUrl(String callResourceUrl) {
    this.callResourceUrl = callResourceUrl;
    this.callResourceUrlDefined = true;
  }

  public IceRequestDto userRate(PriceDto userRate) {
    this.userRate = userRate;
    this.userRateDefined = true;
    return this;
  }

  /**
   * Get userRate
   *
   * @return userRate
   */
  @JsonProperty(JSON_PROPERTY_USER_RATE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public PriceDto getUserRate() {
    return userRate;
  }

  @JsonIgnore
  public boolean getUserRateDefined() {
    return userRateDefined;
  }

  @JsonProperty(JSON_PROPERTY_USER_RATE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setUserRate(PriceDto userRate) {
    this.userRate = userRate;
    this.userRateDefined = true;
  }

  public IceRequestDto cli(String cli) {
    this.cli = cli;
    this.cliDefined = true;
    return this;
  }

  /**
   * The number that will be displayed to the recipient of the call. To set your own CLI, you may
   * use your verified number or your Dashboard virtual number and add it to the
   * `connectPSTN` SVAML response to the Incoming Call Event request. It must be in
   * [E.164](https://community.sinch.com/t5/Glossary/E-164/ta-p/7537) format.
   *
   * @return cli
   */
  @JsonProperty(JSON_PROPERTY_CLI)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public String getCli() {
    return cli;
  }

  @JsonIgnore
  public boolean getCliDefined() {
    return cliDefined;
  }

  @JsonProperty(JSON_PROPERTY_CLI)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setCli(String cli) {
    this.cli = cli;
    this.cliDefined = true;
  }

  public IceRequestDto to(DestinationDto to) {
    this.to = to;
    this.toDefined = true;
    return this;
  }

  /**
   * Get to
   *
   * @return to
   */
  @JsonProperty(JSON_PROPERTY_TO)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public DestinationDto getTo() {
    return to;
  }

  @JsonIgnore
  public boolean getToDefined() {
    return toDefined;
  }

  @JsonProperty(JSON_PROPERTY_TO)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setTo(DestinationDto to) {
    this.to = to;
    this.toDefined = true;
  }

  public IceRequestDto domain(DomainDto domain) {
    this.domain = domain;
    this.domainDefined = true;
    return this;
  }

  /**
   * Get domain
   *
   * @return domain
   */
  @JsonProperty(JSON_PROPERTY_DOMAIN)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public DomainDto getDomain() {
    return domain;
  }

  @JsonIgnore
  public boolean getDomainDefined() {
    return domainDefined;
  }

  @JsonProperty(JSON_PROPERTY_DOMAIN)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setDomain(DomainDto domain) {
    this.domain = domain;
    this.domainDefined = true;
  }

  public IceRequestDto originationType(DomainDto originationType) {
    this.originationType = originationType;
    this.originationTypeDefined = true;
    return this;
  }

  /**
   * Get originationType
   *
   * @return originationType
   */
  @JsonProperty(JSON_PROPERTY_ORIGINATION_TYPE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public DomainDto getOriginationType() {
    return originationType;
  }

  @JsonIgnore
  public boolean getOriginationTypeDefined() {
    return originationTypeDefined;
  }

  @JsonProperty(JSON_PROPERTY_ORIGINATION_TYPE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setOriginationType(DomainDto originationType) {
    this.originationType = originationType;
    this.originationTypeDefined = true;
  }

  public IceRequestDto duration(Integer duration) {
    this.duration = duration;
    this.durationDefined = true;
    return this;
  }

  /**
   * The duration of the call in seconds.
   *
   * @return duration
   */
  @JsonProperty(JSON_PROPERTY_DURATION)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public Integer getDuration() {
    return duration;
  }

  @JsonIgnore
  public boolean getDurationDefined() {
    return durationDefined;
  }

  @JsonProperty(JSON_PROPERTY_DURATION)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setDuration(Integer duration) {
    this.duration = duration;
    this.durationDefined = true;
  }

  public IceRequestDto rdnis(String rdnis) {
    this.rdnis = rdnis;
    this.rdnisDefined = true;
    return this;
  }

  /**
   * The redirected dialled number identification service.
   *
   * @return rdnis
   */
  @JsonProperty(JSON_PROPERTY_RDNIS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public String getRdnis() {
    return rdnis;
  }

  @JsonIgnore
  public boolean getRdnisDefined() {
    return rdnisDefined;
  }

  @JsonProperty(JSON_PROPERTY_RDNIS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setRdnis(String rdnis) {
    this.rdnis = rdnis;
    this.rdnisDefined = true;
  }

  public IceRequestDto callHeaders(List callHeaders) {
    this.callHeaders = callHeaders;
    this.callHeadersDefined = true;
    return this;
  }

  public IceRequestDto addCallHeadersItem(CallHeaderDto callHeadersItem) {
    if (this.callHeaders == null) {
      this.callHeaders = new ArrayList<>();
    }
    this.callHeadersDefined = true;
    this.callHeaders.add(callHeadersItem);
    return this;
  }

  /**
   * If the call is initiated by a Sinch SDK client, call headers are the headers specified by the
   * *caller* client. Read more about call headers [here](../../../call-headers).
   *
   * @return callHeaders
   */
  @JsonProperty(JSON_PROPERTY_CALL_HEADERS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public List getCallHeaders() {
    return callHeaders;
  }

  @JsonIgnore
  public boolean getCallHeadersDefined() {
    return callHeadersDefined;
  }

  @JsonProperty(JSON_PROPERTY_CALL_HEADERS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setCallHeaders(List callHeaders) {
    this.callHeaders = callHeaders;
    this.callHeadersDefined = true;
  }

  @Override
  public IceRequestDto callid(String callid) {
    this.setCallid(callid);
    return this;
  }

  @Override
  public IceRequestDto version(Integer version) {
    this.setVersion(version);
    return this;
  }

  /** Return true if this iceRequest object is equal to o. */
  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    IceRequestDto iceRequest = (IceRequestDto) o;
    return Objects.equals(this.event, iceRequest.event)
        && Objects.equals(this.timestamp, iceRequest.timestamp)
        && Objects.equals(this.custom, iceRequest.custom)
        && Objects.equals(this.applicationKey, iceRequest.applicationKey)
        && Objects.equals(this.callResourceUrl, iceRequest.callResourceUrl)
        && Objects.equals(this.userRate, iceRequest.userRate)
        && Objects.equals(this.cli, iceRequest.cli)
        && Objects.equals(this.to, iceRequest.to)
        && Objects.equals(this.domain, iceRequest.domain)
        && Objects.equals(this.originationType, iceRequest.originationType)
        && Objects.equals(this.duration, iceRequest.duration)
        && Objects.equals(this.rdnis, iceRequest.rdnis)
        && Objects.equals(this.callHeaders, iceRequest.callHeaders)
        && super.equals(o);
  }

  @Override
  public int hashCode() {
    return Objects.hash(
        event,
        timestamp,
        custom,
        applicationKey,
        callResourceUrl,
        userRate,
        cli,
        to,
        domain,
        originationType,
        duration,
        rdnis,
        callHeaders,
        super.hashCode());
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class IceRequestDto {\n");
    sb.append("    ").append(toIndentedString(super.toString())).append("\n");
    sb.append("    event: ").append(toIndentedString(event)).append("\n");
    sb.append("    timestamp: ").append(toIndentedString(timestamp)).append("\n");
    sb.append("    custom: ").append(toIndentedString(custom)).append("\n");
    sb.append("    applicationKey: ").append(toIndentedString(applicationKey)).append("\n");
    sb.append("    callResourceUrl: ").append(toIndentedString(callResourceUrl)).append("\n");
    sb.append("    userRate: ").append(toIndentedString(userRate)).append("\n");
    sb.append("    cli: ").append(toIndentedString(cli)).append("\n");
    sb.append("    to: ").append(toIndentedString(to)).append("\n");
    sb.append("    domain: ").append(toIndentedString(domain)).append("\n");
    sb.append("    originationType: ").append(toIndentedString(originationType)).append("\n");
    sb.append("    duration: ").append(toIndentedString(duration)).append("\n");
    sb.append("    rdnis: ").append(toIndentedString(rdnis)).append("\n");
    sb.append("    callHeaders: ").append(toIndentedString(callHeaders)).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    ");
  }

  static {
    // Initialize and register the discriminator mappings.
    Map> mappings = new HashMap>();
    mappings.put("iceRequest", IceRequestDto.class);
    JSONNavigator.registerDiscriminator(IceRequestDto.class, "event", mappings);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy