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

com.sinch.sdk.domains.sms.models.requests.GroupReplaceRequestParameters Maven / Gradle / Ivy

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

import com.sinch.sdk.core.models.OptionalValue;
import java.util.Collection;

/**
 * Parameters request to replace a group
 *
 * @see https://developers.sinch.com/docs/sms/api-reference/sms/tag/Groups/#tag/Groups/operation/ReplaceGroup
 * @since 1.0
 */
public class GroupReplaceRequestParameters {

  private final OptionalValue name;
  private final OptionalValue> members;

  private GroupReplaceRequestParameters(
      OptionalValue name, OptionalValue> members) {
    this.name = name;
    this.members = members;
  }

  public OptionalValue getName() {
    return name;
  }

  public OptionalValue> getMembers() {
    return members;
  }

  @Override
  public String toString() {
    return "GroupCreateRequestParameters{" + "name='" + name + '\'' + ", members=" + members + '}';
  }

  public static Builder builder() {
    return new Builder();
  }

  public static Builder builder(GroupReplaceRequestParameters parameters) {
    return new Builder(parameters);
  }

  public static class Builder {

    OptionalValue name = OptionalValue.empty();
    OptionalValue> members = OptionalValue.empty();

    private Builder() {}

    private Builder(GroupReplaceRequestParameters parameters) {
      this.name = parameters.getName();
      this.members = parameters.getMembers();
    }

    /**
     * @param name Name of the group
     * @return current builder
     */
    public Builder setName(String name) {
      this.name = OptionalValue.of(name);
      return this;
    }

    /**
     * @param members The initial members of the group.
     *     

Constraints: Elements must be phone numbers in E.164 format MSISDNs. * @return current builder */ public Builder setMembers(Collection members) { this.members = OptionalValue.of(members); return this; } public GroupReplaceRequestParameters build() { return new GroupReplaceRequestParameters(name, members); } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy