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 java.util.Map;
020
021/**
022 * {@link com.vonage.client.messages.Channel#RCS}, {@link MessageType#CUSTOM} request.
023 *
024 * @since 8.11.0
025 */
026public final class RcsCustomRequest extends RcsRequest {
027
028        RcsCustomRequest(Builder builder) {
029                super(builder, MessageType.CUSTOM);
030        }
031
032        @Override
033        public Map<String, ?> getCustom() {
034                return super.getCustom();
035        }
036
037        public static Builder builder() {
038                return new Builder();
039        }
040
041        public static final class Builder extends RcsRequest.Builder<RcsCustomRequest, Builder> {
042
043                Builder() {}
044
045                /**
046                 * A custom payload. The schema of a custom object can vary widely.
047                 * <a href=https://developer.vonage.com/en/messages/guides/rcs/rcs-custom-messages>
048                 * Read more about RCS Custom Messages.</a>
049                 *
050                 * @param payload The custom payload properties to send as a Map.
051                 * @return This builder.
052                 */
053                @Override
054                public Builder custom(Map<String, ?> payload) {
055                        return super.custom(payload);
056                }
057
058                @Override
059                public RcsCustomRequest build() {
060                        return new RcsCustomRequest(this);
061                }
062        }
063}