001package com.plivo.api.models.conference;
002
003import com.plivo.api.PlivoClient;
004import com.plivo.api.exceptions.PlivoRestException;
005import java.io.IOException;
006
007import com.plivo.api.exceptions.PlivoValidationException;
008import retrofit2.Call;
009
010public class ConferenceMemberDeleter extends ConferenceMemberDeleterAction {
011
012  public ConferenceMemberDeleter(String conferenceName, String id) {
013    super(conferenceName, id);
014  }
015
016  @Override
017  protected Call<ConferenceMemberActionResponse> obtainCall() {
018    return client().getVoiceApiService()
019      .conferenceMemberDelete(client().getAuthId(), conferenceName, id);
020  }
021
022  @Override
023  protected Call<ConferenceMemberActionResponse> obtainFallback1Call() {
024    return client().getVoiceFallback1Service()
025      .conferenceMemberDelete(client().getAuthId(), conferenceName, id);
026  }
027
028  @Override
029  protected Call<ConferenceMemberActionResponse> obtainFallback2Call() {
030    return client().getVoiceFallback2Service()
031      .conferenceMemberDelete(client().getAuthId(), conferenceName, id);
032  }
033
034  public void hangup() throws IOException, PlivoRestException, PlivoValidationException {
035    delete();
036  }
037
038  @Override
039  public ConferenceMemberDeleter client(final PlivoClient plivoClient) {
040    this.plivoClient = plivoClient;
041    return this;
042  }
043
044}