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

com.sinch.sdk.domains.voice.models.dto.v1.SvamlActionParkDto 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.Objects;

/**
 * Parks the call and places the caller on hold. The caller is placed into a loop, listening to an
 * IVR prompt (either a pre-recorded audio file or generated by text to speech). If the call is
 * unparked, prompts will stop playing immediately. If the max duration is reached, the last prompt
 * will be fully played until the call ends.
 */
@JsonPropertyOrder({
  SvamlActionParkDto.JSON_PROPERTY_NAME,
  SvamlActionParkDto.JSON_PROPERTY_LOCALE,
  SvamlActionParkDto.JSON_PROPERTY_INTRO_PROMPT,
  SvamlActionParkDto.JSON_PROPERTY_HOLD_PROMPT,
  SvamlActionParkDto.JSON_PROPERTY_MAX_DURATION
})
@JsonFilter("uninitializedFilter")
@JsonInclude(value = JsonInclude.Include.CUSTOM)
public class SvamlActionParkDto {
  private static final long serialVersionUID = 1L;

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

    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_LOCALE = "locale";
  private String locale;
  private boolean localeDefined = false;

  public static final String JSON_PROPERTY_INTRO_PROMPT = "introPrompt";
  private String introPrompt;
  private boolean introPromptDefined = false;

  public static final String JSON_PROPERTY_HOLD_PROMPT = "holdPrompt";
  private String holdPrompt;
  private boolean holdPromptDefined = false;

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

  public SvamlActionParkDto() {}

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

  /**
   * The name property. Must have the value `park`.
   *
   * @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 SvamlActionParkDto locale(String locale) {
    this.locale = locale;
    this.localeDefined = true;
    return this;
  }

  /**
   * The voice and language you want to use for the text-to-speech message. This can either be
   * defined by the ISO 639 locale and language code or by specifying a particular voice. Supported
   * languages and voices are detailed [here](../../voice-locales).
   *
   * @return locale
   */
  @JsonProperty(JSON_PROPERTY_LOCALE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public String getLocale() {
    return locale;
  }

  @JsonIgnore
  public boolean getLocaleDefined() {
    return localeDefined;
  }

  @JsonProperty(JSON_PROPERTY_LOCALE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setLocale(String locale) {
    this.locale = locale;
    this.localeDefined = true;
  }

  public SvamlActionParkDto introPrompt(String introPrompt) {
    this.introPrompt = introPrompt;
    this.introPromptDefined = true;
    return this;
  }

  /**
   * That prompt that is played when the call is first answered. You can use text-to-speech using
   * the `#tts[]` element, SSML commands using the `#ssml[]` element.
   *
   * @return introPrompt
   */
  @JsonProperty(JSON_PROPERTY_INTRO_PROMPT)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public String getIntroPrompt() {
    return introPrompt;
  }

  @JsonIgnore
  public boolean getIntroPromptDefined() {
    return introPromptDefined;
  }

  @JsonProperty(JSON_PROPERTY_INTRO_PROMPT)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setIntroPrompt(String introPrompt) {
    this.introPrompt = introPrompt;
    this.introPromptDefined = true;
  }

  public SvamlActionParkDto holdPrompt(String holdPrompt) {
    this.holdPrompt = holdPrompt;
    this.holdPromptDefined = true;
    return this;
  }

  /**
   * The prompt that is played on repeat until the call is unparked or the until the
   * `maxDuration` value is reached. You can use text-to-speech using the
   * `#tts[]` element, SSML commands using the `#ssml[]` element.
   *
   * @return holdPrompt
   */
  @JsonProperty(JSON_PROPERTY_HOLD_PROMPT)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public String getHoldPrompt() {
    return holdPrompt;
  }

  @JsonIgnore
  public boolean getHoldPromptDefined() {
    return holdPromptDefined;
  }

  @JsonProperty(JSON_PROPERTY_HOLD_PROMPT)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setHoldPrompt(String holdPrompt) {
    this.holdPrompt = holdPrompt;
    this.holdPromptDefined = true;
  }

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

  /**
   * The maximum amount of time in seconds that the `holdPrompt` will be played.
   *
   * @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;
  }

  /** Return true if this svaml.action.park object is equal to o. */
  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    SvamlActionParkDto svamlActionPark = (SvamlActionParkDto) o;
    return Objects.equals(this.name, svamlActionPark.name)
        && Objects.equals(this.locale, svamlActionPark.locale)
        && Objects.equals(this.introPrompt, svamlActionPark.introPrompt)
        && Objects.equals(this.holdPrompt, svamlActionPark.holdPrompt)
        && Objects.equals(this.maxDuration, svamlActionPark.maxDuration);
  }

  @Override
  public int hashCode() {
    return Objects.hash(name, locale, introPrompt, holdPrompt, maxDuration);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class SvamlActionParkDto {\n");
    sb.append("    name: ").append(toIndentedString(name)).append("\n");
    sb.append("    locale: ").append(toIndentedString(locale)).append("\n");
    sb.append("    introPrompt: ").append(toIndentedString(introPrompt)).append("\n");
    sb.append("    holdPrompt: ").append(toIndentedString(holdPrompt)).append("\n");
    sb.append("    maxDuration: ").append(toIndentedString(maxDuration)).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