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.models.base.Getter; 006import com.plivo.api.util.Utils; 007import retrofit2.Call; 008 009public class ValidateSession extends Creator< SessionCreateResponse > { 010 @JsonProperty("otp") 011 private String otp; 012 013 private String id; 014 015 public ValidateSession(String id, String otp) { 016 if (!Utils.allNotNull(id, otp)) { 017 throw new IllegalArgumentException("session_uuid or otp cannot be null"); 018 } 019 this.otp = otp; 020 this.id = id; 021 } 022 023 public String otp() { 024 return this.otp; 025 } 026 027 @Override 028 protected Call<SessionCreateResponse> obtainCall() { 029 return client().getApiService().validateSession(client().getAuthId(), this.id, this); 030 } 031 032}