
com.infobip.model.CallsSipTrunkUpdateRequest Maven / Gradle / Ivy
/*
* This class is auto generated from the Infobip OpenAPI specification
* through the OpenAPI Specification Client API libraries (Re)Generator (OSCAR),
* powered by the OpenAPI Generator (https://openapi-generator.tech).
*
* Do not edit manually. To learn how to raise an issue, see the CONTRIBUTING guide
* or contact us @ [email protected].
*/
package com.infobip.model;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
/**
* Represents CallsSipTrunkUpdateRequest model.
*/
@JsonTypeInfo(
use = JsonTypeInfo.Id.NAME,
include = JsonTypeInfo.As.EXISTING_PROPERTY,
property = "type",
visible = true)
@JsonSubTypes({
@JsonSubTypes.Type(value = CallsRegisteredSipTrunkUpdateRequest.class, name = "REGISTERED"),
@JsonSubTypes.Type(value = CallsStaticSipTrunkUpdateRequest.class, name = "STATIC"),
})
public abstract class CallsSipTrunkUpdateRequest {
protected final CallsPegasusSipTrunkType type;
/**
* Constructs a new {@link CallsSipTrunkUpdateRequest} instance.
*/
public CallsSipTrunkUpdateRequest(String type) {
this.type = CallsPegasusSipTrunkType.fromValue(type);
}
private String name;
private List codecs = null;
private CallsDtmfType dtmf;
private CallsFaxType fax;
private CallsNumberPresentationFormat numberFormat;
private Boolean internationalCallsAllowed;
private Integer channelLimit;
private CallsAnonymizationType anonymization;
/**
* Returns type.
*
* @return type
*/
@JsonProperty("type")
public CallsPegasusSipTrunkType getType() {
return type;
}
/**
* Sets name.
*
* Field description:
* SIP trunk name.
*
* The field is required.
*
* @param name
* @return This {@link CallsSipTrunkUpdateRequest instance}.
*/
public CallsSipTrunkUpdateRequest name(String name) {
this.name = name;
return this;
}
/**
* Returns name.
*
* Field description:
* SIP trunk name.
*
* The field is required.
*
* @return name
*/
@JsonProperty("name")
public String getName() {
return name;
}
/**
* Sets name.
*
* Field description:
* SIP trunk name.
*
* The field is required.
*
* @param name
*/
@JsonProperty("name")
public void setName(String name) {
this.name = name;
}
/**
* Sets codecs.
*
* Field description:
* List of audio codecs supported by a SIP trunk.
*
* @param codecs
* @return This {@link CallsSipTrunkUpdateRequest instance}.
*/
public CallsSipTrunkUpdateRequest codecs(List codecs) {
this.codecs = codecs;
return this;
}
/**
* Adds and item into codecs.
*
* Field description:
* List of audio codecs supported by a SIP trunk.
*
* @param codecsItem The item to be added to the list.
* @return This {@link CallsSipTrunkUpdateRequest instance}.
*/
public CallsSipTrunkUpdateRequest addCodecsItem(CallsAudioCodec codecsItem) {
if (this.codecs == null) {
this.codecs = new ArrayList<>();
}
this.codecs.add(codecsItem);
return this;
}
/**
* Returns codecs.
*
* Field description:
* List of audio codecs supported by a SIP trunk.
*
* @return codecs
*/
@JsonProperty("codecs")
public List getCodecs() {
return codecs;
}
/**
* Sets codecs.
*
* Field description:
* List of audio codecs supported by a SIP trunk.
*
* @param codecs
*/
@JsonProperty("codecs")
public void setCodecs(List codecs) {
this.codecs = codecs;
}
/**
* Sets dtmf.
*
* @param dtmf
* @return This {@link CallsSipTrunkUpdateRequest instance}.
*/
public CallsSipTrunkUpdateRequest dtmf(CallsDtmfType dtmf) {
this.dtmf = dtmf;
return this;
}
/**
* Returns dtmf.
*
* @return dtmf
*/
@JsonProperty("dtmf")
public CallsDtmfType getDtmf() {
return dtmf;
}
/**
* Sets dtmf.
*
* @param dtmf
*/
@JsonProperty("dtmf")
public void setDtmf(CallsDtmfType dtmf) {
this.dtmf = dtmf;
}
/**
* Sets fax.
*
* @param fax
* @return This {@link CallsSipTrunkUpdateRequest instance}.
*/
public CallsSipTrunkUpdateRequest fax(CallsFaxType fax) {
this.fax = fax;
return this;
}
/**
* Returns fax.
*
* @return fax
*/
@JsonProperty("fax")
public CallsFaxType getFax() {
return fax;
}
/**
* Sets fax.
*
* @param fax
*/
@JsonProperty("fax")
public void setFax(CallsFaxType fax) {
this.fax = fax;
}
/**
* Sets numberFormat.
*
* @param numberFormat
* @return This {@link CallsSipTrunkUpdateRequest instance}.
*/
public CallsSipTrunkUpdateRequest numberFormat(CallsNumberPresentationFormat numberFormat) {
this.numberFormat = numberFormat;
return this;
}
/**
* Returns numberFormat.
*
* @return numberFormat
*/
@JsonProperty("numberFormat")
public CallsNumberPresentationFormat getNumberFormat() {
return numberFormat;
}
/**
* Sets numberFormat.
*
* @param numberFormat
*/
@JsonProperty("numberFormat")
public void setNumberFormat(CallsNumberPresentationFormat numberFormat) {
this.numberFormat = numberFormat;
}
/**
* Sets internationalCallsAllowed.
*
* Field description:
* Indicates whether international calls should be allowed. Calls between different countries are considered international.
*
* @param internationalCallsAllowed
* @return This {@link CallsSipTrunkUpdateRequest instance}.
*/
public CallsSipTrunkUpdateRequest internationalCallsAllowed(Boolean internationalCallsAllowed) {
this.internationalCallsAllowed = internationalCallsAllowed;
return this;
}
/**
* Returns internationalCallsAllowed.
*
* Field description:
* Indicates whether international calls should be allowed. Calls between different countries are considered international.
*
* @return internationalCallsAllowed
*/
@JsonProperty("internationalCallsAllowed")
public Boolean getInternationalCallsAllowed() {
return internationalCallsAllowed;
}
/**
* Sets internationalCallsAllowed.
*
* Field description:
* Indicates whether international calls should be allowed. Calls between different countries are considered international.
*
* @param internationalCallsAllowed
*/
@JsonProperty("internationalCallsAllowed")
public void setInternationalCallsAllowed(Boolean internationalCallsAllowed) {
this.internationalCallsAllowed = internationalCallsAllowed;
}
/**
* Sets channelLimit.
*
* Field description:
* Maximum number of concurrent channels.
*
* @param channelLimit
* @return This {@link CallsSipTrunkUpdateRequest instance}.
*/
public CallsSipTrunkUpdateRequest channelLimit(Integer channelLimit) {
this.channelLimit = channelLimit;
return this;
}
/**
* Returns channelLimit.
*
* Field description:
* Maximum number of concurrent channels.
*
* @return channelLimit
*/
@JsonProperty("channelLimit")
public Integer getChannelLimit() {
return channelLimit;
}
/**
* Sets channelLimit.
*
* Field description:
* Maximum number of concurrent channels.
*
* @param channelLimit
*/
@JsonProperty("channelLimit")
public void setChannelLimit(Integer channelLimit) {
this.channelLimit = channelLimit;
}
/**
* Sets anonymization.
*
* @param anonymization
* @return This {@link CallsSipTrunkUpdateRequest instance}.
*/
public CallsSipTrunkUpdateRequest anonymization(CallsAnonymizationType anonymization) {
this.anonymization = anonymization;
return this;
}
/**
* Returns anonymization.
*
* @return anonymization
*/
@JsonProperty("anonymization")
public CallsAnonymizationType getAnonymization() {
return anonymization;
}
/**
* Sets anonymization.
*
* @param anonymization
*/
@JsonProperty("anonymization")
public void setAnonymization(CallsAnonymizationType anonymization) {
this.anonymization = anonymization;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CallsSipTrunkUpdateRequest callsSipTrunkUpdateRequest = (CallsSipTrunkUpdateRequest) o;
return Objects.equals(this.type, callsSipTrunkUpdateRequest.type)
&& Objects.equals(this.name, callsSipTrunkUpdateRequest.name)
&& Objects.equals(this.codecs, callsSipTrunkUpdateRequest.codecs)
&& Objects.equals(this.dtmf, callsSipTrunkUpdateRequest.dtmf)
&& Objects.equals(this.fax, callsSipTrunkUpdateRequest.fax)
&& Objects.equals(this.numberFormat, callsSipTrunkUpdateRequest.numberFormat)
&& Objects.equals(this.internationalCallsAllowed, callsSipTrunkUpdateRequest.internationalCallsAllowed)
&& Objects.equals(this.channelLimit, callsSipTrunkUpdateRequest.channelLimit)
&& Objects.equals(this.anonymization, callsSipTrunkUpdateRequest.anonymization);
}
@Override
public int hashCode() {
return Objects.hash(
type, name, codecs, dtmf, fax, numberFormat, internationalCallsAllowed, channelLimit, anonymization);
}
@Override
public String toString() {
String newLine = System.lineSeparator();
return new StringBuilder()
.append("class CallsSipTrunkUpdateRequest {")
.append(newLine)
.append(" type: ")
.append(toIndentedString(type))
.append(newLine)
.append(" name: ")
.append(toIndentedString(name))
.append(newLine)
.append(" codecs: ")
.append(toIndentedString(codecs))
.append(newLine)
.append(" dtmf: ")
.append(toIndentedString(dtmf))
.append(newLine)
.append(" fax: ")
.append(toIndentedString(fax))
.append(newLine)
.append(" numberFormat: ")
.append(toIndentedString(numberFormat))
.append(newLine)
.append(" internationalCallsAllowed: ")
.append(toIndentedString(internationalCallsAllowed))
.append(newLine)
.append(" channelLimit: ")
.append(toIndentedString(channelLimit))
.append(newLine)
.append(" anonymization: ")
.append(toIndentedString(anonymization))
.append(newLine)
.append("}")
.toString();
}
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
String lineSeparator = System.lineSeparator();
String lineSeparatorFollowedByIndentation = lineSeparator + " ";
return o.toString().replace(lineSeparator, lineSeparatorFollowedByIndentation);
}
}