001package com.plivo.api.models.call;
002
003import com.plivo.api.models.base.Getter;
004import retrofit2.Call;
005
006public class LiveCallListGetter extends Getter<LiveCallListResponse> {
007
008  private CallDirection callDirection;
009  private String fromNumber;
010  private String toNumber;
011
012  public LiveCallListGetter() {
013    super(""); // Special case where we don't care about the id
014  }
015
016  public CallDirection callDirection() {
017    return this.callDirection;
018  }
019
020  public String fromNumber() {
021    return this.fromNumber;
022  }
023
024  public String toNumber() {
025    return this.toNumber;
026  }
027
028  /**
029   * @param callDirection Filter the results by call direction. The valid inputs are inbound and
030   * outbound.
031   */
032  public LiveCallListGetter callDirection(final CallDirection callDirection) {
033    this.callDirection = callDirection;
034    return this;
035  }
036
037  /**
038   * @param fromNumber Filter the results by the number from where the call originated.
039   */
040  public LiveCallListGetter fromNumber(final String fromNumber) {
041    this.fromNumber = fromNumber;
042    return this;
043  }
044
045  /**
046   * @param toNumber Filter the results by the number to which the call was made.
047   */
048  public LiveCallListGetter toNumber(final String toNumber) {
049    this.toNumber = toNumber;
050    return this;
051  }
052
053  @Override
054  protected Call<LiveCallListResponse> obtainCall() {
055    return client().getApiService().liveCallListGet(client().getAuthId(), toMap());
056  }
057}