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

com.plivo.api.models.call.actions.CallPlayCreator Maven / Gradle / Ivy

Go to download

A Java SDK to make voice calls & send SMS using Plivo and to generate Plivo XML

There is a newer version: 5.44.3
Show newest version
package com.plivo.api.models.call.actions;

import com.plivo.api.PlivoClient;
import com.plivo.api.exceptions.PlivoRestException;
import com.plivo.api.models.base.VoiceCreator;
import com.plivo.api.models.call.LegSpecifier;
import java.io.IOException;
import java.util.List;
import retrofit2.Call;

public class CallPlayCreator extends VoiceCreator {

  private List urls;
  private Long length;
  private LegSpecifier legs;
  private Boolean loop;
  private Boolean mix;
  private String id;

  public CallPlayCreator(String id, List urls) {
    this.id = id;
    this.urls = urls;
  }

  public List urls() {
    return this.urls;
  }

  public Long length() {
    return this.length;
  }

  public LegSpecifier legs() {
    return this.legs;
  }

  public Boolean loop() {
    return this.loop;
  }

  public Boolean mix() {
    return this.mix;
  }

  public CallPlayCreator urls(final List urls) {
    this.urls = urls;
    return this;
  }

  public CallPlayCreator length(final Long length) {
    this.length = length;
    return this;
  }

  public CallPlayCreator legs(final LegSpecifier legs) {
    this.legs = legs;
    return this;
  }

  public CallPlayCreator loop(final Boolean loop) {
    this.loop = loop;
    return this;
  }

  public CallPlayCreator mix(final Boolean mix) {
    this.mix = mix;
    return this;
  }


  @Override
  protected Call obtainCall() {
    return client().getVoiceApiService().callPlayCreate(client().getAuthId(), id, this);
  }

  @Override
  protected Call obtainFallback1Call() {
    return client().getVoiceFallback1Service().callPlayCreate(client().getAuthId(), id, this);
  }

  @Override
  protected Call obtainFallback2Call() {
    return client().getVoiceFallback2Service().callPlayCreate(client().getAuthId(), id, this);
  }

  public CallPlayCreateResponse play() throws IOException, PlivoRestException {
    return create();
  }

  @Override
  public CallPlayCreator client(final PlivoClient plivoClient) {
    this.plivoClient = plivoClient;
    return this;
  }


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy