com.sinch.sdk.domains.sms.models.BaseDeliveryReport Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sinch-sdk-java Show documentation
Show all versions of sinch-sdk-java Show documentation
SDK providing a Java API for the Sinch REST APIs.
package com.sinch.sdk.domains.sms.models;
import com.sinch.sdk.domains.sms.models.webhooks.WebhooksEvent;
import java.util.Objects;
import java.util.Optional;
/**
* Base class for Delivery Report WebHook
*
* @since 1.0
*/
public abstract class BaseDeliveryReport implements WebhooksEvent {
private final String batchId;
private final String clientReference;
/**
* @param batchId Required.
The ID of the batch this delivery report belongs to.
* @param clientReference The client identifier of the batch this delivery report belongs to, if
* set when submitting batch.
*/
public BaseDeliveryReport(String batchId, String clientReference) {
Objects.requireNonNull(batchId);
this.batchId = batchId;
this.clientReference = clientReference;
}
public String getBatchId() {
return batchId;
}
public Optional getClientReference() {
return Optional.ofNullable(clientReference);
}
@Override
public String toString() {
return "BaseDeliveryReport{"
+ "batchId='"
+ batchId
+ '\''
+ ", clientReference='"
+ clientReference
+ '\''
+ '}';
}
public abstract static class Builder> {
protected String batchId;
protected String clientReference;
public B setBatchId(String batchId) {
this.batchId = batchId;
return self();
}
public B setClientReference(String clientReference) {
this.clientReference = clientReference;
return self();
}
@SuppressWarnings("unchecked")
protected B self() {
return (B) this;
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy