001package com.plivo.api.models.application; 002 003import com.plivo.api.models.base.VoiceDeleter; 004import okhttp3.ResponseBody; 005import retrofit2.Call; 006 007public class ApplicationDeleter extends VoiceDeleter<Application> { 008 009 private Boolean cascade; 010 private String newEndpointApplication; 011 012 public ApplicationDeleter(String id) { 013 super(id); 014 cascade = true; 015 } 016 017 /** 018 * @return Specify if the subaccount should be cascade deleted or not. 019 */ 020 public Boolean cascade() { 021 return this.cascade; 022 } 023 024 /** 025 * @return newEndpointApplication to be associated with associated endpoints 026 */ 027 public String newEndpointApplication() { 028 return this.newEndpointApplication; 029 } 030 031 /** 032 * @param cascade Specify if the subaccount should be cascade or not. 033 */ 034 public ApplicationDeleter cascade(final Boolean cascade) { 035 this.cascade = cascade; 036 return this; 037 } 038 039 /** 040 * @param newEndpointApplication to be associated with endpoints 041 */ 042 public ApplicationDeleter newEndpointApplication(final String newEndpointApplication) { 043 this.newEndpointApplication = newEndpointApplication; 044 return this; 045 } 046 047 @Override 048 protected Call<ResponseBody> obtainCall() { 049 return client().getVoiceApiService().applicationDelete(client().getAuthId(), id, this); 050 } 051 052 @Override 053 protected Call<ResponseBody> obtainFallback1Call() { 054 return client().getVoiceFallback1Service().applicationDelete(client().getAuthId(), id, this); 055 } 056 057 @Override 058 protected Call<ResponseBody> obtainFallback2Call() { 059 return client().getVoiceFallback2Service().applicationDelete(client().getAuthId(), id, this); 060 } 061}