com.bandwidth.webrtc.models.Participant Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bandwidth-sdk Show documentation
Show all versions of bandwidth-sdk Show documentation
The official client SDK for Bandwidth's Voice, Messaging, MFA, and WebRTC APIs
/*
* BandwidthLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
package com.bandwidth.webrtc.models;
import com.bandwidth.internal.OptionalNullable;
import com.fasterxml.jackson.annotation.JsonGetter;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonSetter;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import java.util.List;
/**
* This is a model class for Participant type.
*/
public class Participant {
@JsonInclude(JsonInclude.Include.NON_NULL)
private String id;
@JsonInclude(JsonInclude.Include.NON_NULL)
private OptionalNullable callbackUrl;
@JsonInclude(JsonInclude.Include.NON_NULL)
private List publishPermissions;
@JsonInclude(JsonInclude.Include.NON_NULL)
private List sessions;
@JsonInclude(JsonInclude.Include.NON_NULL)
private Subscriptions subscriptions;
@JsonInclude(JsonInclude.Include.NON_NULL)
private String tag;
@JsonInclude(JsonInclude.Include.NON_NULL)
private DeviceApiVersionEnum deviceApiVersion;
/**
* Default constructor.
*/
public Participant() {
deviceApiVersion = DeviceApiVersionEnum.V2;
}
/**
* Initialization constructor.
* @param id String value for id.
* @param callbackUrl String value for callbackUrl.
* @param publishPermissions List of PublishPermissionEnum value for publishPermissions.
* @param sessions List of String value for sessions.
* @param subscriptions Subscriptions value for subscriptions.
* @param tag String value for tag.
* @param deviceApiVersion DeviceApiVersionEnum value for deviceApiVersion.
*/
public Participant(
String id,
String callbackUrl,
List publishPermissions,
List sessions,
Subscriptions subscriptions,
String tag,
DeviceApiVersionEnum deviceApiVersion) {
this.id = id;
this.callbackUrl = OptionalNullable.of(callbackUrl);
this.publishPermissions = publishPermissions;
this.sessions = sessions;
this.subscriptions = subscriptions;
this.tag = tag;
this.deviceApiVersion = deviceApiVersion;
}
/**
* Internal initialization constructor.
*/
protected Participant(String id, OptionalNullable callbackUrl,
List publishPermissions, List sessions,
Subscriptions subscriptions, String tag, DeviceApiVersionEnum deviceApiVersion) {
this.id = id;
this.callbackUrl = callbackUrl;
this.publishPermissions = publishPermissions;
this.sessions = sessions;
this.subscriptions = subscriptions;
this.tag = tag;
this.deviceApiVersion = deviceApiVersion;
}
/**
* Getter for Id.
* Unique id of the participant
* @return Returns the String
*/
@JsonGetter("id")
public String getId() {
return id;
}
/**
* Setter for Id.
* Unique id of the participant
* @param id Value for String
*/
@JsonSetter("id")
public void setId(String id) {
this.id = id;
}
/**
* Internal Getter for CallbackUrl.
* Full callback url to use for notifications about this participant
* @return Returns the Internal String
*/
@JsonGetter("callbackUrl")
@JsonSerialize(using = OptionalNullable.Serializer.class)
protected OptionalNullable internalGetCallbackUrl() {
return this.callbackUrl;
}
/**
* Getter for CallbackUrl.
* Full callback url to use for notifications about this participant
* @return Returns the String
*/
public String getCallbackUrl() {
return OptionalNullable.getFrom(callbackUrl);
}
/**
* Setter for CallbackUrl.
* Full callback url to use for notifications about this participant
* @param callbackUrl Value for String
*/
@JsonSetter("callbackUrl")
public void setCallbackUrl(String callbackUrl) {
this.callbackUrl = OptionalNullable.of(callbackUrl);
}
/**
* UnSetter for CallbackUrl.
* Full callback url to use for notifications about this participant
*/
public void unsetCallbackUrl() {
callbackUrl = null;
}
/**
* Getter for PublishPermissions.
* Defines if this participant can publish audio or video
* @return Returns the List of PublishPermissionEnum
*/
@JsonGetter("publishPermissions")
public List getPublishPermissions() {
return publishPermissions;
}
/**
* Setter for PublishPermissions.
* Defines if this participant can publish audio or video
* @param publishPermissions Value for List of PublishPermissionEnum
*/
@JsonSetter("publishPermissions")
public void setPublishPermissions(List publishPermissions) {
this.publishPermissions = publishPermissions;
}
/**
* Getter for Sessions.
* List of session ids this participant is associated with Capped to one
* @return Returns the List of String
*/
@JsonGetter("sessions")
public List getSessions() {
return sessions;
}
/**
* Setter for Sessions.
* List of session ids this participant is associated with Capped to one
* @param sessions Value for List of String
*/
@JsonSetter("sessions")
public void setSessions(List sessions) {
this.sessions = sessions;
}
/**
* Getter for Subscriptions.
* @return Returns the Subscriptions
*/
@JsonGetter("subscriptions")
public Subscriptions getSubscriptions() {
return subscriptions;
}
/**
* Setter for Subscriptions.
* @param subscriptions Value for Subscriptions
*/
@JsonSetter("subscriptions")
public void setSubscriptions(Subscriptions subscriptions) {
this.subscriptions = subscriptions;
}
/**
* Getter for Tag.
* User defined tag to associate with the participant
* @return Returns the String
*/
@JsonGetter("tag")
public String getTag() {
return tag;
}
/**
* Setter for Tag.
* User defined tag to associate with the participant
* @param tag Value for String
*/
@JsonSetter("tag")
public void setTag(String tag) {
this.tag = tag;
}
/**
* Getter for DeviceApiVersion.
* Optional field to define the device api version of this participant
* @return Returns the DeviceApiVersionEnum
*/
@JsonGetter("deviceApiVersion")
public DeviceApiVersionEnum getDeviceApiVersion() {
return deviceApiVersion;
}
/**
* Setter for DeviceApiVersion.
* Optional field to define the device api version of this participant
* @param deviceApiVersion Value for DeviceApiVersionEnum
*/
@JsonSetter("deviceApiVersion")
public void setDeviceApiVersion(DeviceApiVersionEnum deviceApiVersion) {
this.deviceApiVersion = deviceApiVersion;
}
/**
* Converts this Participant into string format.
* @return String representation of this class
*/
@Override
public String toString() {
return "Participant [" + "id=" + id + ", callbackUrl=" + callbackUrl
+ ", publishPermissions=" + publishPermissions + ", sessions=" + sessions
+ ", subscriptions=" + subscriptions + ", tag=" + tag + ", deviceApiVersion="
+ deviceApiVersion + "]";
}
/**
* Builds a new {@link Participant.Builder} object.
* Creates the instance with the state of the current model.
* @return a new {@link Participant.Builder} object
*/
public Builder toBuilder() {
Builder builder = new Builder()
.id(getId())
.publishPermissions(getPublishPermissions())
.sessions(getSessions())
.subscriptions(getSubscriptions())
.tag(getTag())
.deviceApiVersion(getDeviceApiVersion());
builder.callbackUrl = internalGetCallbackUrl();
return builder;
}
/**
* Class to build instances of {@link Participant}.
*/
public static class Builder {
private String id;
private OptionalNullable callbackUrl;
private List publishPermissions;
private List sessions;
private Subscriptions subscriptions;
private String tag;
private DeviceApiVersionEnum deviceApiVersion = DeviceApiVersionEnum.V2;
/**
* Setter for id.
* @param id String value for id.
* @return Builder
*/
public Builder id(String id) {
this.id = id;
return this;
}
/**
* Setter for callbackUrl.
* @param callbackUrl String value for callbackUrl.
* @return Builder
*/
public Builder callbackUrl(String callbackUrl) {
this.callbackUrl = OptionalNullable.of(callbackUrl);
return this;
}
/**
* UnSetter for callbackUrl.
* @return Builder
*/
public Builder unsetCallbackUrl() {
callbackUrl = null;
return this;
}
/**
* Setter for publishPermissions.
* @param publishPermissions List of PublishPermissionEnum value for publishPermissions.
* @return Builder
*/
public Builder publishPermissions(List publishPermissions) {
this.publishPermissions = publishPermissions;
return this;
}
/**
* Setter for sessions.
* @param sessions List of String value for sessions.
* @return Builder
*/
public Builder sessions(List sessions) {
this.sessions = sessions;
return this;
}
/**
* Setter for subscriptions.
* @param subscriptions Subscriptions value for subscriptions.
* @return Builder
*/
public Builder subscriptions(Subscriptions subscriptions) {
this.subscriptions = subscriptions;
return this;
}
/**
* Setter for tag.
* @param tag String value for tag.
* @return Builder
*/
public Builder tag(String tag) {
this.tag = tag;
return this;
}
/**
* Setter for deviceApiVersion.
* @param deviceApiVersion DeviceApiVersionEnum value for deviceApiVersion.
* @return Builder
*/
public Builder deviceApiVersion(DeviceApiVersionEnum deviceApiVersion) {
this.deviceApiVersion = deviceApiVersion;
return this;
}
/**
* Builds a new {@link Participant} object using the set fields.
* @return {@link Participant}
*/
public Participant build() {
return new Participant(id, callbackUrl, publishPermissions, sessions, subscriptions,
tag, deviceApiVersion);
}
}
}