001/*
002 *   Copyright 2024 Vonage
003 *
004 *   Licensed under the Apache License, Version 2.0 (the "License");
005 *   you may not use this file except in compliance with the License.
006 *   You may obtain a copy of the License at
007 *
008 *        http://www.apache.org/licenses/LICENSE-2.0
009 *
010 *   Unless required by applicable law or agreed to in writing, software
011 *   distributed under the License is distributed on an "AS IS" BASIS,
012 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 *   See the License for the specific language governing permissions and
014 *   limitations under the License.
015 */
016package com.vonage.client.messages.rcs;
017
018import com.vonage.client.messages.MessageType;
019import com.vonage.client.messages.TextMessageRequest;
020
021/**
022 * {@link com.vonage.client.messages.Channel#RCS}, {@link MessageType#TEXT} request.
023 *
024 * @since 8.11.0
025 */
026public final class RcsTextRequest extends RcsRequest implements TextMessageRequest {
027
028        RcsTextRequest(Builder builder) {
029                super(builder, MessageType.TEXT);
030        }
031
032        @Override
033        protected int maxTextLength() {
034                return 3072;
035        }
036
037        @Override
038        public String getText() {
039                return super.getText();
040        }
041
042        public static Builder builder() {
043                return new Builder();
044        }
045
046        public static final class Builder extends RcsRequest.Builder<RcsTextRequest, Builder> implements TextMessageRequest.Builder<Builder> {
047                Builder() {}
048
049                /**
050                 * The text of the message to send. Limited to 3072 characters, including unicode.
051                 *
052                 * @param text The text string.
053                 * @return This builder.
054                 */
055                @Override
056                public Builder text(String text) {
057                        return super.text(text);
058                }
059
060                @Override
061                public RcsTextRequest build() {
062                        return new RcsTextRequest(this);
063                }
064        }
065}