001package com.plivo.api.models.account;
002
003import com.plivo.api.models.base.Getter;
004import com.plivo.api.util.Utils;
005import retrofit2.Call;
006
007public class SubaccountGetter extends Getter<Subaccount> {
008
009  public SubaccountGetter(String id) {
010    super(id);
011
012    if (!Utils.isSubaccountIdValid(id)) {
013      throw new IllegalArgumentException("invalid subaccount ID");
014    }
015  }
016
017  @Override
018  protected Call<Subaccount> obtainCall() {
019    return client().getApiService().subaccountGet(client().getAuthId(), id);
020  }
021}