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

com.sinch.sdk.domains.voice.models.dto.v1.SvamlActionConnectSipDto 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.JsonValue;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

/**
 * Determines how to route a call to a SIP server. Available to use in a response to an [Incoming
 * Call Event](../../../voice/tag/Callbacks/#tag/Callbacks/operation/ice) callback.
 */
@JsonPropertyOrder({
  SvamlActionConnectSipDto.JSON_PROPERTY_NAME,
  SvamlActionConnectSipDto.JSON_PROPERTY_DESTINATION,
  SvamlActionConnectSipDto.JSON_PROPERTY_MAX_DURATION,
  SvamlActionConnectSipDto.JSON_PROPERTY_CLI,
  SvamlActionConnectSipDto.JSON_PROPERTY_TRANSPORT,
  SvamlActionConnectSipDto.JSON_PROPERTY_SUPPRESS_CALLBACKS,
  SvamlActionConnectSipDto.JSON_PROPERTY_CALL_HEADERS,
  SvamlActionConnectSipDto.JSON_PROPERTY_MOH
})
@JsonFilter("uninitializedFilter")
@JsonInclude(value = JsonInclude.Include.CUSTOM)
public class SvamlActionConnectSipDto {
  private static final long serialVersionUID = 1L;

  /** The name property. Must have the value `connectSip`. */
  public enum NameEnum {
    CONNECTSIP("connectSip"),

    UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api");

    private String value;

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

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

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

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

  public static final String JSON_PROPERTY_NAME = "name";
  private String name;
  private boolean nameDefined = false;

  public static final String JSON_PROPERTY_DESTINATION = "destination";
  private DestinationDto destination;
  private boolean destinationDefined = false;

  public static final String JSON_PROPERTY_MAX_DURATION = "maxDuration";
  private Integer maxDuration;
  private boolean maxDurationDefined = false;

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

  public static final String JSON_PROPERTY_TRANSPORT = "transport";
  private String transport;
  private boolean transportDefined = false;

  public static final String JSON_PROPERTY_SUPPRESS_CALLBACKS = "suppressCallbacks";
  private Boolean suppressCallbacks;
  private boolean suppressCallbacksDefined = false;

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

  public static final String JSON_PROPERTY_MOH = "moh";
  private String moh;
  private boolean mohDefined = false;

  public SvamlActionConnectSipDto() {}

  public SvamlActionConnectSipDto name(String name) {
    this.name = name;
    this.nameDefined = true;
    return this;
  }

  /**
   * The name property. Must have the value `connectSip`.
   *
   * @return name
   */
  @JsonProperty(JSON_PROPERTY_NAME)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public String getName() {
    return name;
  }

  @JsonIgnore
  public boolean getNameDefined() {
    return nameDefined;
  }

  @JsonProperty(JSON_PROPERTY_NAME)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setName(String name) {
    this.name = name;
    this.nameDefined = true;
  }

  public SvamlActionConnectSipDto destination(DestinationDto destination) {
    this.destination = destination;
    this.destinationDefined = true;
    return this;
  }

  /**
   * Get destination
   *
   * @return destination
   */
  @JsonProperty(JSON_PROPERTY_DESTINATION)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public DestinationDto getDestination() {
    return destination;
  }

  @JsonIgnore
  public boolean getDestinationDefined() {
    return destinationDefined;
  }

  @JsonProperty(JSON_PROPERTY_DESTINATION)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setDestination(DestinationDto destination) {
    this.destination = destination;
    this.destinationDefined = true;
  }

  public SvamlActionConnectSipDto maxDuration(Integer maxDuration) {
    this.maxDuration = maxDuration;
    this.maxDurationDefined = true;
    return this;
  }

  /**
   * The max duration of the call in seconds (max 14400 seconds). If the call is still connected at
   * that time, it will be automatically disconnected.
   *
   * @return maxDuration
   */
  @JsonProperty(JSON_PROPERTY_MAX_DURATION)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public Integer getMaxDuration() {
    return maxDuration;
  }

  @JsonIgnore
  public boolean getMaxDurationDefined() {
    return maxDurationDefined;
  }

  @JsonProperty(JSON_PROPERTY_MAX_DURATION)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setMaxDuration(Integer maxDuration) {
    this.maxDuration = maxDuration;
    this.maxDurationDefined = true;
  }

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

  /**
   * Used to override the CLI (or caller ID) of the client. The phone number of the person who
   * initiated the call is shown as the CLI. To set your own CLI, you may use your verified number
   * or your Dashboard virtual number.
   *
   * @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 SvamlActionConnectSipDto transport(String transport) {
    this.transport = transport;
    this.transportDefined = true;
    return this;
  }

  /**
   * An optional parameter to specify the SIP transport protocol. If unspecified, UDP is used.
   *
   * @return transport
   */
  @JsonProperty(JSON_PROPERTY_TRANSPORT)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public String getTransport() {
    return transport;
  }

  @JsonIgnore
  public boolean getTransportDefined() {
    return transportDefined;
  }

  @JsonProperty(JSON_PROPERTY_TRANSPORT)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setTransport(String transport) {
    this.transport = transport;
    this.transportDefined = true;
  }

  public SvamlActionConnectSipDto suppressCallbacks(Boolean suppressCallbacks) {
    this.suppressCallbacks = suppressCallbacks;
    this.suppressCallbacksDefined = true;
    return this;
  }

  /**
   * If enabled, suppresses [ACE](../../voice/tag/Callbacks/#tag/Callbacks/operation/ace) and
   * [DICE](../../voice/tag/Callbacks/#tag/Callbacks/operation/dice) callbacks for the call.
   *
   * @return suppressCallbacks
   */
  @JsonProperty(JSON_PROPERTY_SUPPRESS_CALLBACKS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public Boolean getSuppressCallbacks() {
    return suppressCallbacks;
  }

  @JsonIgnore
  public boolean getSuppressCallbacksDefined() {
    return suppressCallbacksDefined;
  }

  @JsonProperty(JSON_PROPERTY_SUPPRESS_CALLBACKS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setSuppressCallbacks(Boolean suppressCallbacks) {
    this.suppressCallbacks = suppressCallbacks;
    this.suppressCallbacksDefined = true;
  }

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

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

  /**
   * [Private SIP
   * headers](../../sip-trunking/#receiving-calls-from-sinch-platform-to-your-sip-infrastructure) to
   * send with the call.
   *
   * @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;
  }

  public SvamlActionConnectSipDto moh(String moh) {
    this.moh = moh;
    this.mohDefined = true;
    return this;
  }

  /**
   * Means \"music on hold\". If this optional parameter is included, plays music to the
   * connected participant if the SIP call is placed on hold. If `moh` isn't specified
   * and the SIP call is placed on hold, the user will only hear silence while during the holding
   * period .
   *
   * @return moh
   */
  @JsonProperty(JSON_PROPERTY_MOH)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public String getMoh() {
    return moh;
  }

  @JsonIgnore
  public boolean getMohDefined() {
    return mohDefined;
  }

  @JsonProperty(JSON_PROPERTY_MOH)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setMoh(String moh) {
    this.moh = moh;
    this.mohDefined = true;
  }

  /** Return true if this svaml.action.connectSip object is equal to o. */
  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    SvamlActionConnectSipDto svamlActionConnectSip = (SvamlActionConnectSipDto) o;
    return Objects.equals(this.name, svamlActionConnectSip.name)
        && Objects.equals(this.destination, svamlActionConnectSip.destination)
        && Objects.equals(this.maxDuration, svamlActionConnectSip.maxDuration)
        && Objects.equals(this.cli, svamlActionConnectSip.cli)
        && Objects.equals(this.transport, svamlActionConnectSip.transport)
        && Objects.equals(this.suppressCallbacks, svamlActionConnectSip.suppressCallbacks)
        && Objects.equals(this.callHeaders, svamlActionConnectSip.callHeaders)
        && Objects.equals(this.moh, svamlActionConnectSip.moh);
  }

  @Override
  public int hashCode() {
    return Objects.hash(
        name, destination, maxDuration, cli, transport, suppressCallbacks, callHeaders, moh);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class SvamlActionConnectSipDto {\n");
    sb.append("    name: ").append(toIndentedString(name)).append("\n");
    sb.append("    destination: ").append(toIndentedString(destination)).append("\n");
    sb.append("    maxDuration: ").append(toIndentedString(maxDuration)).append("\n");
    sb.append("    cli: ").append(toIndentedString(cli)).append("\n");
    sb.append("    transport: ").append(toIndentedString(transport)).append("\n");
    sb.append("    suppressCallbacks: ").append(toIndentedString(suppressCallbacks)).append("\n");
    sb.append("    callHeaders: ").append(toIndentedString(callHeaders)).append("\n");
    sb.append("    moh: ").append(toIndentedString(moh)).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    ");
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy