All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.huaweicloud.sdk.dms.v2.model.SendMessagesReq Maven / Gradle / Ivy

There is a newer version: 3.1.42
Show newest version
package com.huaweicloud.sdk.dms.v2.model;





import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.huaweicloud.sdk.dms.v2.model.SendMessageEntity;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Consumer;
import java.util.Objects;

/**
 * SendMessagesReq
 */
public class SendMessagesReq  {



    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty(value="return_id")
    
    private Boolean returnId;


    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty(value="messages")
    
    private List messages = new ArrayList<>();
    
    public SendMessagesReq withReturnId(Boolean returnId) {
        this.returnId = returnId;
        return this;
    }

    


    /**
     * 发送消息成功后,是否返回Message ID,默认为false,设置为true时,返回参数才有Message ID。
     * @return returnId
     */
    public Boolean getReturnId() {
        return returnId;
    }

    public void setReturnId(Boolean returnId) {
        this.returnId = returnId;
    }

    public SendMessagesReq withMessages(List messages) {
        this.messages = messages;
        return this;
    }

    
    public SendMessagesReq addMessagesItem(SendMessageEntity messagesItem) {
        this.messages.add(messagesItem);
        return this;
    }

    public SendMessagesReq withMessages(Consumer> messagesSetter) {
        if(this.messages == null ){
            this.messages = new ArrayList<>();
        }
        messagesSetter.accept(this.messages);
        return this;
    }

    /**
     * 消息列表。
     * @return messages
     */
    public List getMessages() {
        return messages;
    }

    public void setMessages(List messages) {
        this.messages = messages;
    }
    @Override
    public boolean equals(java.lang.Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        SendMessagesReq sendMessagesReq = (SendMessagesReq) o;
        return Objects.equals(this.returnId, sendMessagesReq.returnId) &&
            Objects.equals(this.messages, sendMessagesReq.messages);
    }
    @Override
    public int hashCode() {
        return Objects.hash(returnId, messages);
    }
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("class SendMessagesReq {\n");
        sb.append("    returnId: ").append(toIndentedString(returnId)).append("\n");
        sb.append("    messages: ").append(toIndentedString(messages)).append("\n");
        sb.append("}");
        return sb.toString();
    }
    /**
     * Convert the given object to string with each line indented by 4 spaces
     * (except the first line).
     */
    private String toIndentedString(java.lang.Object o) {
        if (o == null) {
            return "null";
        }
        return o.toString().replace("\n", "\n    ");
    }
    
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy