001package com.plivo.api.models.verify_session; 002 003import com.fasterxml.jackson.annotation.JsonProperty; 004import com.plivo.api.models.base.Creator; 005import com.plivo.api.util.Utils; 006import retrofit2.Call; 007 008import java.net.URL; 009 010public class SessionCreator extends Creator < SessionCreateResponse > { 011 @JsonProperty("app_uuid") 012 private String appUUID; 013 @JsonProperty("recipient") 014 private String recipient; 015 @JsonProperty("channel") 016 private String channel; 017 @JsonProperty("url") 018 private String url; 019 private String method = "POST"; 020 021 SessionCreator(String appUUID,String recipient, String channel, String url, String method) { 022 if (!Utils.allNotNull(recipient)) { 023 throw new IllegalArgumentException("recipient should not be null"); 024 } 025 this.appUUID = appUUID; 026 this.recipient = recipient; 027 this.channel = channel; 028 this.url = url; 029 this.method = method; 030 } 031 032 public String appUUID() { 033 return this.appUUID; 034 } 035 public String recipient() { 036 return this.recipient; 037 } 038 public String channel() { 039 return this.channel; 040 } 041 public String url() { 042 return this.url; 043 } 044 public String method() { 045 return this.method; 046 } 047 048 @Override 049 protected Call<SessionCreateResponse> obtainCall() { 050 return client().getApiService().sessionSend(client().getAuthId(), this); 051 } 052 053}