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

com.sinch.sdk.domains.sms.models.requests.UpdateSmsBatchMediaRequest 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 com.sinch.sdk.domains.sms.models.DeliveryReportType;
import com.sinch.sdk.domains.sms.models.MediaBody;
import com.sinch.sdk.domains.sms.models.Parameters;
import java.time.Instant;
import java.util.Collection;

public class UpdateSmsBatchMediaRequest extends UpdateBaseBatchRequest {
  private final OptionalValue parameters;
  private final OptionalValue strictValidation;

  public UpdateSmsBatchMediaRequest(
      OptionalValue> toAdd,
      OptionalValue> toRemove,
      OptionalValue from,
      OptionalValue body,
      OptionalValue deliveryReport,
      OptionalValue sendAt,
      OptionalValue expireAt,
      OptionalValue callbackUrl,
      OptionalValue parameters,
      OptionalValue strictValidation) {
    super(toAdd, toRemove, from, body, deliveryReport, sendAt, expireAt, callbackUrl);
    this.parameters = parameters;
    this.strictValidation = strictValidation;
  }

  public OptionalValue getParameters() {
    return parameters;
  }

  public OptionalValue isStrictValidation() {
    return strictValidation;
  }

  @Override
  public String toString() {
    return "UpdateSmsBatchMediaRequest{"
        + "parameters="
        + parameters
        + ", strictValidation="
        + strictValidation
        + "} "
        + super.toString();
  }

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

  public static class Builder extends UpdateBaseBatchRequest.Builder {
    private OptionalValue parameters = OptionalValue.empty();
    private OptionalValue strictValidation = OptionalValue.empty();

    private Builder() {}

    /**
     * @param parameters Contains the parameters that will be used for customizing the message for
     *     each recipient.
     * @return current builder
     */
    public Builder setParameters(Parameters parameters) {
      this.parameters = OptionalValue.of(parameters);
      return this;
    }

    /**
     * @param strictValidation Whether or not you want the media included in your message to be
     *     checked against Sinch MMS channel best practices. If set to true, your message will be
     *     rejected if it doesn't conform to the listed recommendations, otherwise no validation
     *     will be performed
     * @return current builder
     */
    public Builder setStrictValidation(Boolean strictValidation) {
      this.strictValidation = OptionalValue.of(strictValidation);
      return this;
    }

    public UpdateSmsBatchMediaRequest build() {
      return new UpdateSmsBatchMediaRequest(
          toAdd,
          toRemove,
          from,
          body,
          deliveryReportType,
          sendAt,
          expireAt,
          callbackUrl,
          parameters,
          strictValidation);
    }

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy