-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
608 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# Written manually. | ||
|
||
version=5.35.0 | ||
version=5.36.0 | ||
groupId=com.plivo | ||
artifactId=plivo-java | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/main/java/com/plivo/api/models/verify_session/AttemptCharge.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.plivo.api.models.verify_session; | ||
|
||
public class AttemptCharge { | ||
private String attemptUuid; | ||
private String channel; | ||
private String charge; | ||
|
||
public AttemptCharge( String attemptUuid, String channel, String charge) { | ||
this.attemptUuid = attemptUuid; | ||
this.channel = channel; | ||
this.charge = charge; | ||
} | ||
|
||
public AttemptCharge(){} | ||
|
||
public String getAttemptUuid(){ | ||
return attemptUuid; | ||
} | ||
public String getChannel(){ | ||
return channel; | ||
} | ||
public String getCharge(){ | ||
return charge; | ||
} | ||
|
||
} |
30 changes: 30 additions & 0 deletions
30
src/main/java/com/plivo/api/models/verify_session/AttemptDetail.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.plivo.api.models.verify_session; | ||
|
||
public class AttemptDetail { | ||
private String channel; | ||
private String attemptUuid; | ||
private String status; | ||
private String time; | ||
|
||
public AttemptDetail(String channel, String attemptUuid, String status, String time) { | ||
this.channel = channel; | ||
this.attemptUuid = attemptUuid; | ||
this.status = status; | ||
this.time = time; | ||
} | ||
|
||
public AttemptDetail(){} | ||
|
||
public String getChannel(){ | ||
return channel; | ||
} | ||
public String getAttemptUuid(){ | ||
return attemptUuid; | ||
} | ||
public String getStatus(){ | ||
return status; | ||
} | ||
public String getTime(){ | ||
return time; | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
src/main/java/com/plivo/api/models/verify_session/Charges.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.plivo.api.models.verify_session; | ||
|
||
import java.util.List; | ||
|
||
public class Charges { | ||
private String totalCharge; | ||
private String validationCharge; | ||
private List<AttemptCharge> attemptCharges; | ||
|
||
public Charges(String totalCharge, String validationCharge, List<AttemptCharge> attemptCharges) { | ||
this.totalCharge = totalCharge; | ||
this.validationCharge = validationCharge; | ||
this.attemptCharges = attemptCharges; | ||
} | ||
|
||
public Charges(){} | ||
public String getTotalCharge(){ | ||
return totalCharge; | ||
} | ||
public String getValidationCharge(){ | ||
return validationCharge; | ||
} | ||
public List<AttemptCharge> getAttemptCharges(){ | ||
return attemptCharges; | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
src/main/java/com/plivo/api/models/verify_session/SessionCreateResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.plivo.api.models.verify_session; | ||
|
||
import com.plivo.api.models.base.BaseResponse; | ||
|
||
import java.util.List; | ||
|
||
public class SessionCreateResponse extends BaseResponse { | ||
String sessionUuid; | ||
|
||
public String getSessionUuid() { | ||
return sessionUuid; | ||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
src/main/java/com/plivo/api/models/verify_session/SessionCreator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package com.plivo.api.models.verify_session; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.plivo.api.models.base.Creator; | ||
import com.plivo.api.util.Utils; | ||
import retrofit2.Call; | ||
|
||
import java.net.URL; | ||
|
||
public class SessionCreator extends Creator < SessionCreateResponse > { | ||
@JsonProperty("app_uuid") | ||
private String appUUID; | ||
@JsonProperty("recipient") | ||
private String recipient; | ||
@JsonProperty("channel") | ||
private String channel; | ||
@JsonProperty("url") | ||
private String url; | ||
private String method = "POST"; | ||
|
||
SessionCreator(String appUUID,String recipient, String channel, String url, String method) { | ||
if (!Utils.allNotNull(recipient)) { | ||
throw new IllegalArgumentException("recipient should not be null"); | ||
} | ||
this.appUUID = appUUID; | ||
this.recipient = recipient; | ||
this.channel = channel; | ||
this.url = url; | ||
this.method = method; | ||
} | ||
|
||
public String appUUID() { | ||
return this.appUUID; | ||
} | ||
public String recipient() { | ||
return this.recipient; | ||
} | ||
public String channel() { | ||
return this.channel; | ||
} | ||
public String url() { | ||
return this.url; | ||
} | ||
public String method() { | ||
return this.method; | ||
} | ||
|
||
@Override | ||
protected Call<SessionCreateResponse> obtainCall() { | ||
return client().getApiService().sessionSend(client().getAuthId(), this); | ||
} | ||
|
||
} |
16 changes: 16 additions & 0 deletions
16
src/main/java/com/plivo/api/models/verify_session/SessionGetter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.plivo.api.models.verify_session; | ||
|
||
import com.plivo.api.models.base.Getter; | ||
import com.plivo.api.models.message.Message; | ||
import retrofit2.Call; | ||
|
||
public class SessionGetter extends Getter<VerifySession> { | ||
public SessionGetter(String id) { | ||
super(id); | ||
} | ||
|
||
@Override | ||
protected Call<VerifySession> obtainCall() { | ||
return client().getApiService().sessionGet(client().getAuthId(), id); | ||
} | ||
} |
100 changes: 100 additions & 0 deletions
100
src/main/java/com/plivo/api/models/verify_session/SessionLister.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
package com.plivo.api.models.verify_session; | ||
|
||
import com.plivo.api.exceptions.PlivoRestException; | ||
import com.plivo.api.models.base.ListResponse; | ||
import com.plivo.api.util.PropertyFilter; | ||
import retrofit2.Call; | ||
import retrofit2.Response; | ||
|
||
import com.plivo.api.models.base.Lister; | ||
|
||
import java.io.IOException; | ||
import java.lang.reflect.Field; | ||
import java.util.Date; | ||
|
||
public class SessionLister extends Lister<VerifySessionList> { | ||
private String subaccount = null; | ||
private PropertyFilter<Date> sessionTime = null; | ||
private String status = null; | ||
private String country = null; | ||
private String alias = null; | ||
private String appUuid = null; | ||
private String recipient = null; | ||
public String subaccount() { | ||
return this.subaccount; | ||
} | ||
public String status() { | ||
return this.status; | ||
} | ||
public String country() { | ||
return this.country; | ||
} | ||
public String alias() { | ||
return this.alias; | ||
} | ||
public String appUuid() { | ||
return this.appUuid; | ||
} | ||
public String recipient() { | ||
return this.recipient; | ||
} | ||
public PropertyFilter<Date> sessionTime() { | ||
return this.sessionTime; | ||
} | ||
public SessionLister subaccount(final String subaccount) { | ||
this.subaccount = subaccount; | ||
return this; | ||
} | ||
public SessionLister status(final String status) { | ||
this.status = status; | ||
return this; | ||
} | ||
public SessionLister country(final String country) { | ||
this.country = country; | ||
return this; | ||
} | ||
public SessionLister alias(final String alias) { | ||
this.alias = alias; | ||
return this; | ||
} | ||
public SessionLister appUuid(final String appUuid) { | ||
this.appUuid = appUuid; | ||
return this; | ||
} | ||
public SessionLister recipient(final String recipient) { | ||
this.recipient = recipient; | ||
return this; | ||
} | ||
public SessionLister sessionTime(final PropertyFilter<Date> sessionTime) { | ||
this.sessionTime = sessionTime; | ||
return this; | ||
} | ||
@Override | ||
/** | ||
* Actually list instances of the resource. | ||
*/ | ||
public ListResponse<VerifySessionList> list() throws IOException, PlivoRestException { | ||
validate(); | ||
Response<ListResponse<VerifySessionList>> response = obtainCall().execute(); | ||
handleResponse(response); | ||
|
||
try | ||
{ | ||
Field meta = response.body().getClass().getDeclaredField("meta"); | ||
meta.setAccessible(true); | ||
meta.set(response.body(), new SessionMeta(response.body().getMeta())); | ||
} | ||
catch(Exception e) | ||
{ | ||
e.printStackTrace(); | ||
} | ||
|
||
return response.body(); | ||
} | ||
|
||
@Override | ||
protected Call<ListResponse<VerifySessionList>> obtainCall() { | ||
return client().getApiService().sessionList(client().getAuthId(), toMap()); | ||
} | ||
|
||
} |
Oops, something went wrong.