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

com.sinch.sdk.domains.voice.models.svaml.ActionConnectConference 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.domains.voice.models.ConferenceDtfmOptions;
import com.sinch.sdk.domains.voice.models.MusicOnHoldType;

public class ActionConnectConference extends Action {

  private final OptionalValue conferenceId;
  private final OptionalValue dtfmOptions;
  private final OptionalValue musicOnHold;

  private ActionConnectConference(
      OptionalValue conferenceId,
      OptionalValue dtfmOptions,
      OptionalValue musicOnHold) {
    this.conferenceId = conferenceId;
    this.dtfmOptions = dtfmOptions;
    this.musicOnHold = musicOnHold;
  }

  public OptionalValue getConferenceId() {
    return conferenceId;
  }

  public OptionalValue getDtfmOptions() {
    return dtfmOptions;
  }

  public OptionalValue getMusicOnHold() {
    return musicOnHold;
  }

  @Override
  public String toString() {
    return "ActionConnectConference{"
        + "conferenceId='"
        + conferenceId
        + '\''
        + ", dtfmOptions="
        + dtfmOptions
        + ", musicOnHold="
        + musicOnHold
        + "} "
        + super.toString();
  }

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

  public static class Builder> {

    OptionalValue conferenceId = OptionalValue.empty();
    OptionalValue dtfmOptions = OptionalValue.empty();
    OptionalValue musicOnHold = OptionalValue.empty();

    public Builder setConferenceId(String conferenceId) {
      this.conferenceId = OptionalValue.of(conferenceId);
      return this;
    }

    public Builder setDtfmOptions(ConferenceDtfmOptions dtfmOptions) {
      this.dtfmOptions = OptionalValue.of(dtfmOptions);
      return this;
    }

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

    public ActionConnectConference build() {
      return new ActionConnectConference(conferenceId, dtfmOptions, musicOnHold);
    }

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