This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new 811119af7b39 Add voice message support to incoming message DTO (#20606)
811119af7b39 is described below

commit 811119af7b39eb8a4e7ead6843862fcc81207147
Author: Kirill Byvshev <[email protected]>
AuthorDate: Sun Dec 28 11:50:48 2025 +0400

    Add voice message support to incoming message DTO (#20606)
---
 .../component/telegram/model/IncomingMessage.java  |  12 +++
 .../component/telegram/model/IncomingVoice.java    | 103 +++++++++++++++++++++
 2 files changed, 115 insertions(+)

diff --git 
a/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/IncomingMessage.java
 
b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/IncomingMessage.java
index 0be2a73575df..4c05a61c5946 100644
--- 
a/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/IncomingMessage.java
+++ 
b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/IncomingMessage.java
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.camel.component.telegram.model;
 
 import java.io.Serializable;
@@ -71,6 +72,8 @@ public class IncomingMessage implements Serializable {
 
     private IncomingGame game;
 
+    private IncomingVoice voice;
+
     public IncomingMessage() {
     }
 
@@ -202,6 +205,14 @@ public class IncomingMessage implements Serializable {
         this.game = game;
     }
 
+    public IncomingVoice getVoice() {
+        return voice;
+    }
+
+    public void setVoice(IncomingVoice voice) {
+        this.voice = voice;
+    }
+
     @Override
     public String toString() {
         final StringBuilder sb = new StringBuilder("IncomingMessage{");
@@ -221,6 +232,7 @@ public class IncomingMessage implements Serializable {
         sb.append(", captionEntities=").append(captionEntities);
         sb.append(", replyMarkup=").append(replyMarkup);
         sb.append(", game=").append(game);
+        sb.append(", voice=").append(voice);
         sb.append('}');
         return sb.toString();
     }
diff --git 
a/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/IncomingVoice.java
 
b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/IncomingVoice.java
new file mode 100644
index 000000000000..36fec8979ea7
--- /dev/null
+++ 
b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/IncomingVoice.java
@@ -0,0 +1,103 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.telegram.model;
+
+import java.io.Serializable;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * Message is a voice message, information about the file.
+ *
+ * @see <a 
href="https://core.telegram.org/bots/api#voice";>https://core.telegram.org/bots/api#voice</a>
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class IncomingVoice implements Serializable {
+
+    private static final long serialVersionUID = 8346607899859789612L;
+
+    @JsonProperty("file_id")
+    private String fileId;
+
+    @JsonProperty("file_unique_id")
+    private String fileUniqueId;
+
+    private Integer duration;
+
+    @JsonProperty("mime_type")
+    private String mimeType;
+
+    @JsonProperty("file_size")
+    private Long fileSize;
+
+    public IncomingVoice() {
+    }
+
+    public String getFileId() {
+        return fileId;
+    }
+
+    public void setFileId(String fileId) {
+        this.fileId = fileId;
+    }
+
+    public String getFileUniqueId() {
+        return fileUniqueId;
+    }
+
+    public void setFileUniqueId(String fileUniqueId) {
+        this.fileUniqueId = fileUniqueId;
+    }
+
+    public Integer getDuration() {
+        return duration;
+    }
+
+    public void setDuration(Integer duration) {
+        this.duration = duration;
+    }
+
+    public String getMimeType() {
+        return mimeType;
+    }
+
+    public void setMimeType(String mimeType) {
+        this.mimeType = mimeType;
+    }
+
+    public Long getFileSize() {
+        return fileSize;
+    }
+
+    public void setFileSize(Long fileSize) {
+        this.fileSize = fileSize;
+    }
+
+    @Override
+    public String toString() {
+        final StringBuilder sb = new StringBuilder("IncomingVoice{");
+        sb.append("fileId='").append(fileId).append('\'');
+        sb.append(", fileUniqueId=").append(fileUniqueId);
+        sb.append(", duration=").append(duration);
+        sb.append(", mimeType=").append(mimeType);
+        sb.append(", fileSize=").append(fileSize);
+        sb.append('}');
+        return sb.toString();
+    }
+}

Reply via email to