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

com.sinch.sdk.domains.voice.models.svaml.ActionConnectSip 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.core.utils.Pair;
import com.sinch.sdk.domains.voice.models.DestinationSip;
import com.sinch.sdk.domains.voice.models.MusicOnHoldType;
import com.sinch.sdk.domains.voice.models.TransportType;
import java.util.Collection;

public class ActionConnectSip extends Action {

  private final OptionalValue destination;
  private final OptionalValue maxDuration;
  private final OptionalValue cli;
  private final OptionalValue transport;
  private final OptionalValue suppressCallbacks;
  private final OptionalValue>> callHeaders;
  private final OptionalValue musicOnHold;

  private ActionConnectSip(
      OptionalValue destination,
      OptionalValue maxDuration,
      OptionalValue cli,
      OptionalValue transport,
      OptionalValue suppressCallbacks,
      OptionalValue>> callHeaders,
      OptionalValue musicOnHold) {
    this.destination = destination;
    this.maxDuration = maxDuration;
    this.cli = cli;
    this.transport = transport;
    this.suppressCallbacks = suppressCallbacks;
    this.callHeaders = callHeaders;
    this.musicOnHold = musicOnHold;
  }

  public OptionalValue getDestination() {
    return destination;
  }

  public OptionalValue getMaxDuration() {
    return maxDuration;
  }

  public OptionalValue getCli() {
    return cli;
  }

  public OptionalValue getTransport() {
    return transport;
  }

  public OptionalValue getSuppressCallbacks() {
    return suppressCallbacks;
  }

  public OptionalValue>> getCallHeaders() {
    return callHeaders;
  }

  public OptionalValue getMusicOnHold() {
    return musicOnHold;
  }

  @Override
  public String toString() {
    return "ActionConnectSip{"
        + "destination="
        + destination
        + ", maxDuration="
        + maxDuration
        + ", cli='"
        + cli
        + '\''
        + ", transport="
        + transport
        + ", suppressCallbacks="
        + suppressCallbacks
        + ", callHeaders="
        + callHeaders
        + ", musicOnHold="
        + musicOnHold
        + "} "
        + super.toString();
  }

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

  public static class Builder> {

    OptionalValue destination = OptionalValue.empty();
    OptionalValue maxDuration = OptionalValue.empty();
    OptionalValue cli = OptionalValue.empty();
    OptionalValue transport = OptionalValue.empty();
    OptionalValue suppressCallbacks = OptionalValue.empty();
    OptionalValue>> callHeaders = OptionalValue.empty();
    OptionalValue musicOnHold = OptionalValue.empty();

    public Builder setDestination(DestinationSip destination) {
      this.destination = OptionalValue.of(destination);
      return this;
    }

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

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

    public Builder setTransport(TransportType transport) {
      this.transport = OptionalValue.of(transport);
      return this;
    }

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

    public Builder setCallHeaders(Collection> callHeaders) {
      this.callHeaders = OptionalValue.of(callHeaders);
      return this;
    }

    public Builder setMusicOnHold(MusicOnHoldType musicOnHold) {
      this.musicOnHold = OptionalValue.of(musicOnHold);
      return this;
    }

    public ActionConnectSip build() {
      return new ActionConnectSip(
          destination, maxDuration, cli, transport, suppressCallbacks, callHeaders, musicOnHold);
    }

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