001package com.plivo.api.models.application; 002 003import com.plivo.api.models.base.VoiceUpdater; 004import retrofit2.Call; 005 006public class ApplicationUpdater extends VoiceUpdater<ApplicationUpdateResponse> { 007 008 private String answerUrl; 009 private String answerMethod; 010 private String hangupUrl; 011 private String hangupMethod; 012 private String fallbackAnswerUrl; 013 private String fallbackMethod; 014 private String messageUrl; 015 private String messageMethod; 016 private Boolean defaultNumberApp; 017 private Boolean defaultEndpointApp; 018 private String subaccount; 019 private Boolean logIncomingMessages; 020 private Boolean publicUri; 021 022 public ApplicationUpdater(String id) { 023 super(id); 024 } 025 026 public String answerUrl() { 027 return this.answerUrl; 028 } 029 030 public String answerMethod() { 031 return this.answerMethod; 032 } 033 034 public String hangupUrl() { 035 return this.hangupUrl; 036 } 037 038 public String hangupMethod() { 039 return this.hangupMethod; 040 } 041 042 public String fallbackAnswerUrl() { 043 return this.fallbackAnswerUrl; 044 } 045 046 public String fallbackMethod() { 047 return this.fallbackMethod; 048 } 049 050 public String messageUrl() { 051 return this.messageUrl; 052 } 053 054 public String messageMethod() { 055 return this.messageMethod; 056 } 057 058 public Boolean defaultNumberApp() { 059 return this.defaultNumberApp; 060 } 061 062 public Boolean defaultEndpointApp() { 063 return this.defaultEndpointApp; 064 } 065 066 public String subaccount() { 067 return this.subaccount; 068 } 069 070 public Boolean logIncomingMessages() { 071 return this.logIncomingMessages; 072 } 073 074 public Boolean publicUri() { 075 return this.publicUri; 076 } 077 078 public ApplicationUpdater answerUrl(final String answerUrl) { 079 this.answerUrl = answerUrl; 080 return this; 081 } 082 083 public ApplicationUpdater answerMethod(final String answerMethod) { 084 this.answerMethod = answerMethod; 085 return this; 086 } 087 088 public ApplicationUpdater hangupUrl(final String hangupUrl) { 089 this.hangupUrl = hangupUrl; 090 return this; 091 } 092 093 public ApplicationUpdater hangupMethod(final String hangupMethod) { 094 this.hangupMethod = hangupMethod; 095 return this; 096 } 097 098 public ApplicationUpdater fallbackAnswerUrl(final String fallbackAnswerUrl) { 099 this.fallbackAnswerUrl = fallbackAnswerUrl; 100 return this; 101 } 102 103 public ApplicationUpdater fallbackMethod(final String fallbackMethod) { 104 this.fallbackMethod = fallbackMethod; 105 return this; 106 } 107 108 public ApplicationUpdater messageUrl(final String messageUrl) { 109 this.messageUrl = messageUrl; 110 return this; 111 } 112 113 public ApplicationUpdater messageMethod(final String messageMethod) { 114 this.messageMethod = messageMethod; 115 return this; 116 } 117 118 public ApplicationUpdater defaultNumberApp(final Boolean defaultNumberApp) { 119 this.defaultNumberApp = defaultNumberApp; 120 return this; 121 } 122 123 public ApplicationUpdater defaultEndpointApp(final Boolean defaultEndpointApp) { 124 this.defaultEndpointApp = defaultEndpointApp; 125 return this; 126 } 127 128 public ApplicationUpdater subaccount(final String subaccount) { 129 this.subaccount = subaccount; 130 return this; 131 } 132 133 public ApplicationUpdater logIncomingMessages(final Boolean logIncomingMessages) { 134 this.logIncomingMessages = logIncomingMessages; 135 return this; 136 } 137 138 public ApplicationUpdater publicUri(final Boolean publicUri) { 139 this.publicUri = publicUri; 140 return this; 141 } 142 143 144 @Override 145 protected Call<ApplicationUpdateResponse> obtainCall() { 146 return client().getVoiceApiService().applicationUpdate(client().getAuthId(), id, this); 147 } 148 149 @Override 150 protected Call<ApplicationUpdateResponse> obtainFallback1Call() { 151 return client().getVoiceFallback1Service().applicationUpdate(client().getAuthId(), id, this); 152 } 153 154 @Override 155 protected Call<ApplicationUpdateResponse> obtainFallback2Call() { 156 return client().getVoiceFallback2Service().applicationUpdate(client().getAuthId(), id, this); 157 } 158}