diff --git a/src/main/lombok/com/restfb/types/whatsapp/platform/SendMessage.java b/src/main/lombok/com/restfb/types/whatsapp/platform/SendMessage.java index 55d0f9538..878e487fd 100644 --- a/src/main/lombok/com/restfb/types/whatsapp/platform/SendMessage.java +++ b/src/main/lombok/com/restfb/types/whatsapp/platform/SendMessage.java @@ -65,6 +65,9 @@ public class SendMessage extends AbstractFacebookType { @Facebook private Interactive interactive; + @Facebook + private Location location; + @Facebook @Setter private Type type = Type.text; @@ -118,7 +121,12 @@ public void setInteractive(Interactive interactive) { this.type = Type.interactive; } + public void setLocation(Location location) { + this.location = location; + this.type = Type.location; + } + public enum Type { - text, reaction, audio, video, document, sticker, image, interactive; + text, reaction, audio, video, document, sticker, image, interactive, location; } } diff --git a/src/main/lombok/com/restfb/types/whatsapp/platform/send/Location.java b/src/main/lombok/com/restfb/types/whatsapp/platform/send/Location.java new file mode 100644 index 000000000..dead60f06 --- /dev/null +++ b/src/main/lombok/com/restfb/types/whatsapp/platform/send/Location.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2010-2022 Mark Allen, Norbert Bartels. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package com.restfb.types.whatsapp.platform.send; + +import com.restfb.Facebook; +import com.restfb.types.AbstractFacebookType; +import lombok.Setter; + +/** + * Location + * object to be used in whatsapp message + */ +public class Location extends AbstractFacebookType { + + @Facebook + private final Double latitude; + + @Facebook + private final Double longitude; + + @Setter + @Facebook + private String name; + + @Setter + @Facebook + private String address; + + public Location(double latitude, double longitude) { + this.latitude = latitude; + this.longitude = longitude; + } +}