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

com.sinch.sdk.domains.voice.models.svaml.ActionConnectPstn Maven / Gradle / Ivy

There is a newer version: 1.4.0
Show newest version
package com.sinch.sdk.domains.voice.models.svaml;

import com.sinch.sdk.core.models.OptionalValue;
import com.sinch.sdk.models.DualToneMultiFrequency;
import com.sinch.sdk.models.E164PhoneNumber;

public class ActionConnectPstn extends Action {

  private final OptionalValue number;
  private final OptionalValue locale;
  private final OptionalValue maxDuration;
  private final OptionalValue dialTimeout;
  private final OptionalValue cli;
  private final OptionalValue suppressCallbacks;
  private final OptionalValue dualToneMultiFrequency;
  private final OptionalValue indications;
  private final OptionalValue answeringMachineDetection;

  private ActionConnectPstn(
      OptionalValue number,
      OptionalValue locale,
      OptionalValue maxDuration,
      OptionalValue dialTimeout,
      OptionalValue cli,
      OptionalValue suppressCallbacks,
      OptionalValue dualToneMultiFrequency,
      OptionalValue indications,
      OptionalValue answeringMachineDetection) {
    this.number = number;
    this.locale = locale;
    this.maxDuration = maxDuration;
    this.dialTimeout = dialTimeout;
    this.cli = cli;
    this.suppressCallbacks = suppressCallbacks;
    this.dualToneMultiFrequency = dualToneMultiFrequency;
    this.indications = indications;
    this.answeringMachineDetection = answeringMachineDetection;
  }

  public OptionalValue getNumber() {
    return number;
  }

  public OptionalValue getLocale() {
    return locale;
  }

  public OptionalValue getMaxDuration() {
    return maxDuration;
  }

  public OptionalValue getDialTimeout() {
    return dialTimeout;
  }

  public OptionalValue getCli() {
    return cli;
  }

  public OptionalValue getSuppressCallbacks() {
    return suppressCallbacks;
  }

  public OptionalValue getDualToneMultiFrequency() {
    return dualToneMultiFrequency;
  }

  public OptionalValue getIndications() {
    return indications;
  }

  public OptionalValue getAnsweringMachineDetection() {
    return answeringMachineDetection;
  }

  @Override
  public String toString() {
    return "ActionConnectPstn{"
        + "number="
        + number
        + ", locale='"
        + locale
        + '\''
        + ", maxDuration="
        + maxDuration
        + ", dialTimeout="
        + dialTimeout
        + ", cli='"
        + cli
        + '\''
        + ", suppressCallbacks="
        + suppressCallbacks
        + ", dualToneMultiFrequency="
        + dualToneMultiFrequency
        + ", indications="
        + indications
        + ", answeringMachineDetection="
        + answeringMachineDetection
        + "} "
        + super.toString();
  }

  public static Builder builder() {
    return new Builder<>();
  }

  public static class Builder> {

    OptionalValue number = OptionalValue.empty();
    OptionalValue locale = OptionalValue.empty();
    OptionalValue maxDuration = OptionalValue.empty();
    OptionalValue dialTimeout = OptionalValue.empty();
    OptionalValue cli = OptionalValue.empty();
    OptionalValue suppressCallbacks = OptionalValue.empty();
    OptionalValue dualToneMultiFrequency = OptionalValue.empty();
    OptionalValue indications = OptionalValue.empty();
    OptionalValue answeringMachineDetection = OptionalValue.empty();

    public Builder setNumber(E164PhoneNumber number) {
      this.number = OptionalValue.of(number);
      return this;
    }

    public Builder setLocale(String locale) {
      this.locale = OptionalValue.of(locale);
      return this;
    }

    public Builder setMaxDuration(Integer duration) {
      this.maxDuration = OptionalValue.of(duration);
      return this;
    }

    public Builder setDialTimeout(Integer dialTimeout) {
      this.dialTimeout = OptionalValue.of(dialTimeout);
      return this;
    }

    public Builder setCli(String cli) {
      this.cli = OptionalValue.of(cli);
      return this;
    }

    public Builder setSuppressCallbacks(Boolean suppressCallbacks) {
      this.suppressCallbacks = OptionalValue.of(suppressCallbacks);
      return this;
    }

    public Builder setDualToneMultiFrequency(DualToneMultiFrequency dualToneMultiFrequency) {
      this.dualToneMultiFrequency = OptionalValue.of(dualToneMultiFrequency);
      return this;
    }

    public Builder setIndications(IndicationType indications) {
      this.indications = OptionalValue.of(indications);
      return this;
    }

    public Builder setAnsweringMachineDetection(
        AnsweringMachineDetection answeringMachineDetection) {
      this.answeringMachineDetection = OptionalValue.of(answeringMachineDetection);
      return this;
    }

    public ActionConnectPstn build() {
      return new ActionConnectPstn(
          number,
          locale,
          maxDuration,
          dialTimeout,
          cli,
          suppressCallbacks,
          dualToneMultiFrequency,
          indications,
          answeringMachineDetection);
    }

    @SuppressWarnings("unchecked")
    protected B self() {
      return (B) this;
    }
  }
}