All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.sinch.sdk.domains.verification.models.requests.StartVerificationSMSRequestParameters Maven / Gradle / Ivy

There is a newer version: 1.4.0
Show newest version
package com.sinch.sdk.domains.verification.models.requests;

import com.sinch.sdk.core.models.OptionalValue;
import com.sinch.sdk.domains.verification.models.Identity;
import com.sinch.sdk.domains.verification.models.VerificationMethodType;
import com.sinch.sdk.domains.verification.models.VerificationReference;

/**
 * Dedicated request parameters to be used for an SMS verification
 *
 * @since 1.0
 */
public class StartVerificationSMSRequestParameters extends StartVerificationRequestParameters {

  private final OptionalValue options;

  private StartVerificationSMSRequestParameters(
      OptionalValue identity,
      OptionalValue reference,
      OptionalValue custom,
      OptionalValue options) {
    super(identity, VerificationMethodType.SMS, reference, custom);
    this.options = options;
  }

  /**
   * Getting Builder
   *
   * @return New Builder instance
   * @since 1.0
   */
  public static Builder builder() {
    return new Builder();
  }

  public OptionalValue getOptions() {
    return options;
  }

  @Override
  public String toString() {
    return "StartVerificationSMSRequestParameters{} " + super.toString();
  }

  /**
   * Dedicated Builder
   *
   * @since 1.0
   */
  public static class Builder extends StartVerificationRequestParameters.Builder {

    OptionalValue acceptLanguage = OptionalValue.empty();
    OptionalValue options = OptionalValue.empty();

    private Builder() {}

    /**
     * SMS options to be used
     *
     * @param options Specifies options
     * @return current builder
     * @since 1.0
     */
    public Builder setOptions(StartVerificationSMSOptions options) {
      this.options = OptionalValue.of(options);
      return self();
    }

    /**
     * Create instance
     *
     * @return The instance build with current builder values
     * @since 1.0
     */
    @Override
    public StartVerificationSMSRequestParameters build() {
      return new StartVerificationSMSRequestParameters(identity, reference, custom, options);
    }

    @Override
    protected Builder self() {
      return this;
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy