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

com.bandwidth.messaging.models.MessageRequest Maven / Gradle / Ivy

Go to download

The official client SDK for Bandwidth's Voice, Messaging, MFA, and WebRTC APIs

There is a newer version: 12.0.1
Show newest version
/*
 * BandwidthLib
 *
 * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
 */

package com.bandwidth.messaging.models;

import com.fasterxml.jackson.annotation.JsonGetter;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonSetter;
import java.util.List;

/**
 * This is a model class for MessageRequest type.
 */
public class MessageRequest {
    private String applicationId;
    private List to;
    private String from;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String text;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private List media;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String tag;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private PriorityEnum priority;

    /**
     * Default constructor.
     */
    public MessageRequest() {
    }

    /**
     * Initialization constructor.
     * @param  applicationId  String value for applicationId.
     * @param  to  List of String value for to.
     * @param  from  String value for from.
     * @param  text  String value for text.
     * @param  media  List of String value for media.
     * @param  tag  String value for tag.
     * @param  priority  PriorityEnum value for priority.
     */
    public MessageRequest(
            String applicationId,
            List to,
            String from,
            String text,
            List media,
            String tag,
            PriorityEnum priority) {
        this.applicationId = applicationId;
        this.to = to;
        this.from = from;
        this.text = text;
        this.media = media;
        this.tag = tag;
        this.priority = priority;
    }

    /**
     * Getter for ApplicationId.
     * The ID of the Application your from number is associated with in the Bandwidth Phone Number
     * Dashboard.
     * @return Returns the String
     */
    @JsonGetter("applicationId")
    public String getApplicationId() {
        return applicationId;
    }

    /**
     * Setter for ApplicationId.
     * The ID of the Application your from number is associated with in the Bandwidth Phone Number
     * Dashboard.
     * @param applicationId Value for String
     */
    @JsonSetter("applicationId")
    public void setApplicationId(String applicationId) {
        this.applicationId = applicationId;
    }

    /**
     * Getter for To.
     * The phone number(s) the message should be sent to in E164 format
     * @return Returns the List of String
     */
    @JsonGetter("to")
    public List getTo() {
        return to;
    }

    /**
     * Setter for To.
     * The phone number(s) the message should be sent to in E164 format
     * @param to Value for List of String
     */
    @JsonSetter("to")
    public void setTo(List to) {
        this.to = to;
    }

    /**
     * Getter for From.
     * One of your telephone numbers the message should come from in E164 format
     * @return Returns the String
     */
    @JsonGetter("from")
    public String getFrom() {
        return from;
    }

    /**
     * Setter for From.
     * One of your telephone numbers the message should come from in E164 format
     * @param from Value for String
     */
    @JsonSetter("from")
    public void setFrom(String from) {
        this.from = from;
    }

    /**
     * Getter for Text.
     * The contents of the text message. Must be 2048 characters or less.
     * @return Returns the String
     */
    @JsonGetter("text")
    public String getText() {
        return text;
    }

    /**
     * Setter for Text.
     * The contents of the text message. Must be 2048 characters or less.
     * @param text Value for String
     */
    @JsonSetter("text")
    public void setText(String text) {
        this.text = text;
    }

    /**
     * Getter for Media.
     * A list of URLs to include as media attachments as part of the message.
     * @return Returns the List of String
     */
    @JsonGetter("media")
    public List getMedia() {
        return media;
    }

    /**
     * Setter for Media.
     * A list of URLs to include as media attachments as part of the message.
     * @param media Value for List of String
     */
    @JsonSetter("media")
    public void setMedia(List media) {
        this.media = media;
    }

    /**
     * Getter for Tag.
     * A custom string that will be included in callback events of the message. Max 1024 characters
     * @return Returns the String
     */
    @JsonGetter("tag")
    public String getTag() {
        return tag;
    }

    /**
     * Setter for Tag.
     * A custom string that will be included in callback events of the message. Max 1024 characters
     * @param tag Value for String
     */
    @JsonSetter("tag")
    public void setTag(String tag) {
        this.tag = tag;
    }

    /**
     * Getter for Priority.
     * The message's priority, currently for toll-free or short code SMS only. Messages with a
     * priority value of `"high"` are given preference over your other traffic.
     * @return Returns the PriorityEnum
     */
    @JsonGetter("priority")
    public PriorityEnum getPriority() {
        return priority;
    }

    /**
     * Setter for Priority.
     * The message's priority, currently for toll-free or short code SMS only. Messages with a
     * priority value of `"high"` are given preference over your other traffic.
     * @param priority Value for PriorityEnum
     */
    @JsonSetter("priority")
    public void setPriority(PriorityEnum priority) {
        this.priority = priority;
    }

    /**
     * Converts this MessageRequest into string format.
     * @return String representation of this class
     */
    @Override
    public String toString() {
        return "MessageRequest [" + "applicationId=" + applicationId + ", to=" + to + ", from="
                + from + ", text=" + text + ", media=" + media + ", tag=" + tag + ", priority="
                + priority + "]";
    }

    /**
     * Builds a new {@link MessageRequest.Builder} object.
     * Creates the instance with the state of the current model.
     * @return a new {@link MessageRequest.Builder} object
     */
    public Builder toBuilder() {
        Builder builder = new Builder(applicationId, to, from)
                .text(getText())
                .media(getMedia())
                .tag(getTag())
                .priority(getPriority());
        return builder;
    }

    /**
     * Class to build instances of {@link MessageRequest}.
     */
    public static class Builder {
        private String applicationId;
        private List to;
        private String from;
        private String text;
        private List media;
        private String tag;
        private PriorityEnum priority;

        /**
         * Initialization constructor.
         */
        public Builder() {
        }

        /**
         * Initialization constructor.
         * @param  applicationId  String value for applicationId.
         * @param  to  List of String value for to.
         * @param  from  String value for from.
         */
        public Builder(String applicationId, List to, String from) {
            this.applicationId = applicationId;
            this.to = to;
            this.from = from;
        }

        /**
         * Setter for applicationId.
         * @param  applicationId  String value for applicationId.
         * @return Builder
         */
        public Builder applicationId(String applicationId) {
            this.applicationId = applicationId;
            return this;
        }

        /**
         * Setter for to.
         * @param  to  List of String value for to.
         * @return Builder
         */
        public Builder to(List to) {
            this.to = to;
            return this;
        }

        /**
         * Setter for from.
         * @param  from  String value for from.
         * @return Builder
         */
        public Builder from(String from) {
            this.from = from;
            return this;
        }

        /**
         * Setter for text.
         * @param  text  String value for text.
         * @return Builder
         */
        public Builder text(String text) {
            this.text = text;
            return this;
        }

        /**
         * Setter for media.
         * @param  media  List of String value for media.
         * @return Builder
         */
        public Builder media(List media) {
            this.media = media;
            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 priority.
         * @param  priority  PriorityEnum value for priority.
         * @return Builder
         */
        public Builder priority(PriorityEnum priority) {
            this.priority = priority;
            return this;
        }

        /**
         * Builds a new {@link MessageRequest} object using the set fields.
         * @return {@link MessageRequest}
         */
        public MessageRequest build() {
            return new MessageRequest(applicationId, to, from, text, media, tag, priority);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy