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

com.sinch.sdk.domains.sms.models.requests.DeliveryReportBatchGetRequestParameters 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.DeliveryReportStatus;
import com.sinch.sdk.domains.sms.models.DeliveryReportType;
import java.util.Collection;

/**
 * Parameters request to get a Batch Delivery Report
 *
 * @since 1.0
 */
public class DeliveryReportBatchGetRequestParameters {

  private final OptionalValue type;
  private final OptionalValue> statuses;
  private final OptionalValue> codes;

  private DeliveryReportBatchGetRequestParameters(
      OptionalValue type,
      OptionalValue> statuses,
      OptionalValue> codes) {
    this.type = type;
    this.statuses = statuses;
    this.codes = codes;
  }

  public OptionalValue getType() {
    return type;
  }

  public OptionalValue> geStatues() {
    return statuses;
  }

  public OptionalValue> getCodes() {
    return codes;
  }

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

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

  public static class Builder {

    OptionalValue type = OptionalValue.empty();
    OptionalValue> statuses = OptionalValue.empty();
    OptionalValue> codes = OptionalValue.empty();

    private Builder() {}

    private Builder(DeliveryReportBatchGetRequestParameters parameters) {
      this.type = parameters.type;
      this.statuses = parameters.statuses;
      this.codes = parameters.codes;
    }

    /**
     * @param type Filter by type of delivery report.
     *     
    *
  • A summary will count the number of messages sent per status. *
  • A full report give that of a summary report but in addition, lists * phone numbers. *
* * @return current builder */ public Builder setType(DeliveryReportType type) { this.type = OptionalValue.of(type); return this; } /** * @param statuses Filter by list of statuses * to include * @return current builder */ public Builder setStatuses(Collection statuses) { this.statuses = OptionalValue.of(statuses); return this; } /** * @param codes Filter by list of codes * to include * @return current builder */ public Builder setCodes(Collection codes) { this.codes = OptionalValue.of(codes); return this; } public DeliveryReportBatchGetRequestParameters build() { return new DeliveryReportBatchGetRequestParameters(type, statuses, codes); } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy