
com.infobip.model.MessagesApiChannelsDestination 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 java.util.ArrayList;
import java.util.List;
import java.util.Objects;
/**
* Represents a destination which can be specified by a `channel`. It is required for a message failover.
*/
public class MessagesApiChannelsDestination {
private List byChannel = new ArrayList<>();
/**
* Sets byChannel.
*
* Field description:
* Array of substitute destinations distinguished by a `channel` they belong to. Only one substitute destination per `channel` is permitted.
*
* The field is required.
*
* @param byChannel
* @return This {@link MessagesApiChannelsDestination instance}.
*/
public MessagesApiChannelsDestination byChannel(List byChannel) {
this.byChannel = byChannel;
return this;
}
/**
* Adds and item into byChannel.
*
* Field description:
* Array of substitute destinations distinguished by a `channel` they belong to. Only one substitute destination per `channel` is permitted.
*
* The field is required.
*
* @param byChannelItem The item to be added to the list.
* @return This {@link MessagesApiChannelsDestination instance}.
*/
public MessagesApiChannelsDestination addByChannelItem(MessagesApiChannelDestination byChannelItem) {
if (this.byChannel == null) {
this.byChannel = new ArrayList<>();
}
this.byChannel.add(byChannelItem);
return this;
}
/**
* Returns byChannel.
*
* Field description:
* Array of substitute destinations distinguished by a `channel` they belong to. Only one substitute destination per `channel` is permitted.
*
* The field is required.
*
* @return byChannel
*/
@JsonProperty("byChannel")
public List getByChannel() {
return byChannel;
}
/**
* Sets byChannel.
*
* Field description:
* Array of substitute destinations distinguished by a `channel` they belong to. Only one substitute destination per `channel` is permitted.
*
* The field is required.
*
* @param byChannel
*/
@JsonProperty("byChannel")
public void setByChannel(List byChannel) {
this.byChannel = byChannel;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
MessagesApiChannelsDestination messagesApiChannelsDestination = (MessagesApiChannelsDestination) o;
return Objects.equals(this.byChannel, messagesApiChannelsDestination.byChannel);
}
@Override
public int hashCode() {
return Objects.hash(byChannel);
}
@Override
public String toString() {
String newLine = System.lineSeparator();
return new StringBuilder()
.append("class MessagesApiChannelsDestination {")
.append(newLine)
.append(" byChannel: ")
.append(toIndentedString(byChannel))
.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);
}
}