Class BaseRequest

java.lang.Object
com.vonage.client.verify.BaseRequest
Direct Known Subclasses:
Psd2Request, VerifyRequest

public class BaseRequest
extends java.lang.Object
Base request class for VerifyRequest and Psd2Request
Since:
5.5.0
  • Constructor Summary

    Constructors 
    Modifier Constructor Description
      BaseRequest​(java.lang.String number, java.lang.Integer length, java.util.Locale locale)  
    protected BaseRequest​(java.lang.String number, java.lang.Integer length, java.util.Locale locale, java.lang.String country, java.lang.Integer pinExpiry, java.lang.Integer nextEventWait)  
  • Method Summary

    Modifier and Type Method Description
    java.lang.String getCountry()
    The country for the destination phone number.
    java.lang.String getDashedLocale()  
    java.lang.Integer getLength()  
    java.util.Locale getLocale()  
    java.lang.Integer getNextEventWait()  
    java.lang.String getNumber()  
    java.lang.Integer getPinExpiry()  
    void setCountry​(java.lang.String country)
    Deprecated.
    since 5.5.0 use VerifyRequest.Builder to create a 2FA verification request or Psd2Request.Builder to create a PSD2 verification request
    void setLength​(java.lang.Integer length)
    Deprecated.
    since 5.5.0 use VerifyRequest.Builder to create a 2FA verification request or Psd2Request.Builder to create a PSD2 verification request
    void setLocale​(java.util.Locale locale)
    Deprecated.
    since 5.5.0 use VerifyRequest.Builder to create a 2FA verification request or Psd2Request.Builder to create a PSD2 verification request
    void setNextEventWait​(java.lang.Integer nextEventWait)
    Deprecated.
    since 5.5.0 use VerifyRequest.Builder to create a 2FA verification request or Psd2Request.Builder to create a PSD2 verification request
    void setPinExpiry​(java.lang.Integer pinExpiry)
    Deprecated.
    since 5.5.0 use VerifyRequest.Builder to create a 2FA verification request or Psd2Request.Builder to create a PSD2 verification request
    java.lang.String toString()  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • BaseRequest

      public BaseRequest​(java.lang.String number, java.lang.Integer length, java.util.Locale locale)
    • BaseRequest

      protected BaseRequest​(java.lang.String number, java.lang.Integer length, java.util.Locale locale, java.lang.String country, java.lang.Integer pinExpiry, java.lang.Integer nextEventWait)
  • Method Details

    • getNumber

      public java.lang.String getNumber()
      Returns:
      the recipient's phone number provided in the constructor, in E.164 format.
    • getLength

      public java.lang.Integer getLength()
      Returns:
      the length of the verification code to be sent to the user, specified in some VerifyRequest constructors. -1 indicates the default length will be used.
    • setLength

      @Deprecated public void setLength​(java.lang.Integer length)
      Deprecated.
      since 5.5.0 use VerifyRequest.Builder to create a 2FA verification request or Psd2Request.Builder to create a PSD2 verification request
      Parameters:
      length - the length of the verification code to be sent to the user. Options are either 4 or 6.
    • getLocale

      public java.util.Locale getLocale()
      Returns:
      the default locale used for verification. If this value is null, the locale will be determined from the country code included in number
    • setLocale

      public void setLocale​(java.util.Locale locale)
      Deprecated.
      since 5.5.0 use VerifyRequest.Builder to create a 2FA verification request or Psd2Request.Builder to create a PSD2 verification request
      Parameters:
      locale - Override the default locale used for verification. By default the locale is determined from the country code included in number
    • getDashedLocale

      public java.lang.String getDashedLocale()
      Returns:
      the default locale used for verification in snake case. Ex: en-gb If this value is null, the locale will be determined from the country code included in number
    • getCountry

      public java.lang.String getCountry()
      The country for the destination phone number.
      Returns:
      a String containing a 2-character country code
    • setCountry

      public void setCountry​(java.lang.String country)
      Deprecated.
      since 5.5.0 use VerifyRequest.Builder to create a 2FA verification request or Psd2Request.Builder to create a PSD2 verification request
      The country for the destination phone number.

      If you wish to used localised number formats or you are not sure if number is correctly formatted, set this to a two-character country code. For example, GB, US. Verify will work out the international phone number for you.

      Parameters:
      country - a String containing a 2-character country code
    • getPinExpiry

      public java.lang.Integer getPinExpiry()
      Returns:
      PIN expiry time in seconds
    • setPinExpiry

      public void setPinExpiry​(java.lang.Integer pinExpiry)
      Deprecated.
      since 5.5.0 use VerifyRequest.Builder to create a 2FA verification request or Psd2Request.Builder to create a PSD2 verification request
      Parameters:
      pinExpiry - PIN expiry time in seconds.
    • getNextEventWait

      public java.lang.Integer getNextEventWait()
      Returns:
      the wait time between attempts to deliver the PIN. An Integer between 600-900, or null.
    • setNextEventWait

      public void setNextEventWait​(java.lang.Integer nextEventWait)
      Deprecated.
      since 5.5.0 use VerifyRequest.Builder to create a 2FA verification request or Psd2Request.Builder to create a PSD2 verification request
      Set the wait time between attempts to deliver the PIN.
      Parameters:
      nextEventWait - An Integer value between 60 and 900 seconds, or null to use the default duration.
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object