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

com.sinch.sdk.domains.voice.models.requests.ApplicationsUpdateNumbersRequestParameters Maven / Gradle / Ivy

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

import com.sinch.sdk.core.models.OptionalValue;
import com.sinch.sdk.domains.voice.models.CapabilityType;
import com.sinch.sdk.models.E164PhoneNumber;
import java.util.Collection;

/**
 * Request parameters when updating a numbers list
 *
 * @since 1.0
 */
public class ApplicationsUpdateNumbersRequestParameters {

  private final OptionalValue> numbers;
  private final OptionalValue applicationKey;
  private final OptionalValue capability;

  private ApplicationsUpdateNumbersRequestParameters(
      OptionalValue> numbers,
      OptionalValue applicationKey,
      OptionalValue capability) {
    this.numbers = numbers;
    this.applicationKey = applicationKey;
    this.capability = capability;
  }

  /**
   * Number list to be edited
   *
   * @return The numbers list
   * @see Builder#getNumbers() getter
   * @since 1.0
   */
  public OptionalValue> getNumbers() {
    return numbers;
  }

  /**
   * Application key to be assigned to numbers
   *
   * @return The application key
   * @see Builder#getApplicationKey() getter
   * @since 1.0
   */
  public OptionalValue getApplicationKey() {
    return applicationKey;
  }

  /**
   * Capability to be set
   *
   * @return The capability
   * @see Builder#getCapability() () getter
   * @since 1.0
   */
  public OptionalValue getCapability() {
    return capability;
  }

  @Override
  public String toString() {
    return "ApplicationsUpdateNumbersRequestParameters{"
        + "numbers="
        + numbers
        + ", applicationKey='"
        + applicationKey
        + '\''
        + ", capability="
        + capability
        + '}';
  }

  /**
   * Create a builder instance
   *
   * @return Dedicated builder
   */
  public static Builder builder() {
    return new Builder();
  }

  public static class Builder {

    OptionalValue> numbers = OptionalValue.empty();
    OptionalValue applicationKey = OptionalValue.empty();
    OptionalValue capability = OptionalValue.empty();

    /**
     * The phone number list to be updated or assigned to application
     *
     * @param numbers The phone number list
     * @return Current builder
     * @since 1.0
     */
    public Builder setNumbers(Collection numbers) {
      this.numbers = OptionalValue.of(numbers);
      return this;
    }

    /**
     * Indicates the application where the numbers will be assigned.
     *
     * 

If empty, the application key that is used to authenticate * * @param applicationKey The application where the numbers will be assigned * @return Current builder * @since 1.0 */ public Builder setApplicationKey(String applicationKey) { this.applicationKey = OptionalValue.of(applicationKey); return this; } /** * Indicates the DID capability that needs to be assigned to the chosen application. * *

Please note that the DID needs to support the selected capability. * * @param capability The capability value * @return Current builder * @since 1.0 */ public Builder setCapability(CapabilityType capability) { this.capability = OptionalValue.of(capability); return this; } public ApplicationsUpdateNumbersRequestParameters build() { return new ApplicationsUpdateNumbersRequestParameters(numbers, applicationKey, capability); } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy