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.whatsapp;
017
018import com.fasterxml.jackson.annotation.JsonProperty;
019import com.vonage.client.JsonableBaseObject;
020import java.util.UUID;
021
022/**
023 * This is only present for the Inbound Message where the user is quoting another message.
024 * It provides information about the quoted message and/or the product message being responded to.
025 *
026 * @since 7.2.0
027 */
028public final class Context extends JsonableBaseObject {
029        private String messageFrom;
030        private UUID messageUuid;
031        private ReferredProduct referredProduct;
032
033        Context() {}
034
035        Context(UUID messageUuid) {
036                this.messageUuid = messageUuid;
037        }
038
039        /**
040         * The phone number of the original sender of the message being quoted.
041         *
042         * @return The original sender's phone number in E.164 format.
043         */
044        @JsonProperty("message_from")
045        public String getMessageFrom() {
046                return messageFrom;
047        }
048
049        /**
050         * The UUID of the message being quoted.
051         *
052         * @return The message ID.
053         */
054        @JsonProperty("message_uuid")
055        public UUID getMessageUuid() {
056                return messageUuid;
057        }
058
059        /**
060         * Only applies to Order messages.
061         *
062         * @return The referred product details, or {@code null} if not applicable.
063         *
064         * @deprecated This will be moved in a future release.
065         */
066        @Deprecated
067        @JsonProperty("whatsapp_referred_product")
068        public ReferredProduct getReferredProduct() {
069                return referredProduct;
070        }
071}