com.sinch.sdk.domains.voice.models.webhooks.CallEvent 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.voice.models.webhooks;
import com.sinch.sdk.domains.sms.models.DeliveryReportBatch.Builder;
import java.time.Instant;
/** Base class for webhooks call event */
public class CallEvent extends WebhooksEvent {
private final Instant timestamp;
private final String custom;
protected CallEvent(String callId, Instant timestamp, Integer version, String custom) {
super(callId, version);
this.timestamp = timestamp;
this.custom = custom;
}
/**
* Event timestamp
*
* @return Timestamp value
*/
public Instant getTimestamp() {
return timestamp;
}
/**
* A string that can be used to pass custom information related to the call.
*
* @return The custom value used for call
*/
public String getCustom() {
return custom;
}
@Override
public String toString() {
return "CallEvent{" + "timestamp=" + timestamp + ", custom='" + custom + '\'' + '}';
}
public static Builder> builder() {
return new Builder<>();
}
public static class Builder> extends WebhooksEvent.Builder {
Instant timestamp;
String custom;
public B setTimestamp(Instant timestamp) {
this.timestamp = timestamp;
return self();
}
public B setCustom(String custom) {
this.custom = custom;
return self();
}
public CallEvent build() {
return new CallEvent(callId, timestamp, version, custom);
}
@Override
@SuppressWarnings("unchecked")
protected B self() {
return (B) this;
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy