ch.loway.oss.ari4java.generated.ari_5_1_1.actions.requests.ChannelsRecordPostRequest_impl_ari_5_1_1 Maven / Gradle / Ivy
package ch.loway.oss.ari4java.generated.ari_5_1_1.actions.requests;
// ----------------------------------------------------
// THIS CLASS WAS GENERATED AUTOMATICALLY
// PLEASE DO NOT EDIT
// Generated on: Sat Aug 14 16:51:45 SAST 2021
// ----------------------------------------------------
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import java.util.ArrayList;
import java.net.URLEncoder;
import com.fasterxml.jackson.core.type.TypeReference;
import ch.loway.oss.ari4java.ARI;
import ch.loway.oss.ari4java.tools.*;
import ch.loway.oss.ari4java.generated.*;
import ch.loway.oss.ari4java.generated.actions.*;
import ch.loway.oss.ari4java.generated.actions.requests.*;
import ch.loway.oss.ari4java.generated.models.Module;
import ch.loway.oss.ari4java.generated.models.*;
import ch.loway.oss.ari4java.generated.ari_5_1_1.actions.*;
import ch.loway.oss.ari4java.generated.ari_5_1_1.actions.requests.*;
import ch.loway.oss.ari4java.generated.ari_5_1_1.models.*;
public class ChannelsRecordPostRequest_impl_ari_5_1_1 extends BaseAriAction
implements ChannelsRecordPostRequest {
private String channelId;
private String name;
private String format;
private Integer maxDurationSeconds;
private Integer maxSilenceSeconds;
private String ifExists;
private Boolean beep;
private String terminateOn;
public ChannelsRecordPostRequest_impl_ari_5_1_1(String channelId, String name, String format) {
this.channelId = channelId;
this.name = name;
this.format = format;
}
public ChannelsRecordPostRequest setChannelId(String channelId) {
this.channelId = channelId;
return this;
}
public ChannelsRecordPostRequest setName(String name) {
this.name = name;
return this;
}
public ChannelsRecordPostRequest setFormat(String format) {
this.format = format;
return this;
}
public ChannelsRecordPostRequest setMaxDurationSeconds(int maxDurationSeconds) {
this.maxDurationSeconds = maxDurationSeconds;
return this;
}
public ChannelsRecordPostRequest setMaxSilenceSeconds(int maxSilenceSeconds) {
this.maxSilenceSeconds = maxSilenceSeconds;
return this;
}
public ChannelsRecordPostRequest setIfExists(String ifExists) {
this.ifExists = ifExists;
return this;
}
public ChannelsRecordPostRequest setBeep(boolean beep) {
this.beep = beep;
return this;
}
public ChannelsRecordPostRequest setTerminateOn(String terminateOn) {
this.terminateOn = terminateOn;
return this;
}
private AriRequest build() {
AriRequest ariRequest =
new AriRequest("/channels/" + encodeUrlPart(channelId) + "/record", "POST");
ariRequest.addParamQuery(HttpParam.build("name", name));
ariRequest.addParamQuery(HttpParam.build("format", format));
ariRequest.addParamQuery(HttpParam.build("maxDurationSeconds", maxDurationSeconds));
ariRequest.addParamQuery(HttpParam.build("maxSilenceSeconds", maxSilenceSeconds));
ariRequest.addParamQuery(HttpParam.build("ifExists", ifExists));
ariRequest.addParamQuery(HttpParam.build("beep", beep));
ariRequest.addParamQuery(HttpParam.build("terminateOn", terminateOn));
ariRequest.addErrorResponse(HttpResponse.build(400, "Invalid parameters"));
ariRequest.addErrorResponse(HttpResponse.build(404, "Channel not found"));
ariRequest.addErrorResponse(
HttpResponse.build(
409,
"Channel is not in a Stasis application; the channel is currently bridged with other hcannels; A recording with the same name already exists on the system and can not be overwritten because it is in progress or ifExists=fail"));
ariRequest.addErrorResponse(
HttpResponse.build(422, "The format specified is unknown on this system"));
return ariRequest;
}
public LiveRecording execute() throws RestException {
String json = httpActionSync(build());
return deserializeJson(json, LiveRecording_impl_ari_5_1_1.class);
}
public void execute(AriCallback callback) {
httpActionAsync(build(), callback, LiveRecording_impl_ari_5_1_1.class);
}
/* No missing signatures from interface */
}