From d9af92705c8421be1bdf8821f468010f2417ab2f Mon Sep 17 00:00:00 2001 From: Daniel AM Date: Tue, 28 May 2024 12:03:09 +0100 Subject: [PATCH] =?UTF-8?q?Issue-256:=20Updated=20the=20checkHeader=20to?= =?UTF-8?q?=20allow=20header=5Furl=20in=20both=20video=20and=20image=20a?= =?UTF-8?q?=E2=80=A6=20(#257)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * updated the checkHeader to allow header_url in both video and image as it is supported * added document format --------- Co-authored-by: denizkilic --- .../com/messagebird/objects/integrations/HSMComponent.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/api/src/main/java/com/messagebird/objects/integrations/HSMComponent.java b/api/src/main/java/com/messagebird/objects/integrations/HSMComponent.java index c13f276..4e3fe64 100644 --- a/api/src/main/java/com/messagebird/objects/integrations/HSMComponent.java +++ b/api/src/main/java/com/messagebird/objects/integrations/HSMComponent.java @@ -166,10 +166,9 @@ private void checkHeaderText() throws IllegalArgumentException { * @throws IllegalArgumentException Occurs when type is not {@code HEADER} and format is not {@code IMAGE}. */ private void checkHeaderUrl() throws IllegalArgumentException { - if (!(type.equals(HSMComponentType.HEADER) - && format.equals(HSMComponentFormat.IMAGE)) - ) { - throw new IllegalArgumentException("\"header_url\" is available for only HEADER type and IMAGE format."); + if (!(type.equals(HSMComponentType.HEADER) && + (format.equals(HSMComponentFormat.IMAGE) || format.equals(HSMComponentFormat.VIDEO) || format.equals(HSMComponentFormat.DOCUMENT)))) { + throw new IllegalArgumentException("\"header_url\" is available for only HEADER type and IMAGE, VIDEO and DOCUMENT format."); } } }