public final class InviteRequest
- Object
- InviteRequest
Describes the invite to mint. Immutable; build one with create.
InviteRequest request = InviteRequest.create()
.campaign("spring")
.channel("whatsapp")
.title("Join me")
.description("I am using this and thought of you.")
.payload("room-42")
.build();
title, description and imageUrl drive the preview card the link
service renders, which is what makes a shared link look like an invitation
in a messaging application rather than a bare address.
Builder.build validates and throws IllegalArgumentException naming the
offending field, so a mistake surfaces at the call you can see rather than
as a silently dropped value later.
Nested types
class InviteRequest.Builder | Builds an InviteRequest. |
Fields
public static final int MAX_PAYLOAD_LENGTH = 512 | The longest accepted Builder.payload. |
public static final int MAX_TITLE_LENGTH = 128 | The longest accepted Builder.title. |
public static final int MAX_DESCRIPTION_LENGTH = 256 | The longest accepted Builder.description. |
public static final int MAX_TOKEN_LENGTH = 64 | The longest accepted Builder.campaign or Builder.channel. |
Methods
public static InviteRequest.Builder create() | Starts building a request. |
public String getCampaign() | The campaign, or null. |
public String getChannel() | The channel, or null. |
public String getPayload() | The application defined payload, or null. |
public String getTitle() | The preview card title, or null. |
public String getDescription() | The preview card description, or null. |
public String getImageUrl() | The preview card image address, or null. |
public Map<String, String> getParameters() | The custom parameters carried to the invited device. |
Inherited methods
Field details
MAX_PAYLOAD_LENGTH
public static final int MAX_PAYLOAD_LENGTH = 512The longest accepted
Builder.payload.MAX_TITLE_LENGTH
public static final int MAX_TITLE_LENGTH = 128The longest accepted
Builder.title.MAX_DESCRIPTION_LENGTH
public static final int MAX_DESCRIPTION_LENGTH = 256The longest accepted
Builder.description.MAX_TOKEN_LENGTH
public static final int MAX_TOKEN_LENGTH = 64The longest accepted
Builder.campaign or Builder.channel.Method details
create
public static InviteRequest.Builder create()Starts building a request.
Returns
a new builder
getCampaign
public String getCampaign()The campaign, or null.
Returns
the campaign
getChannel
public String getChannel()The channel, or null.
Returns
the channel
getPayload
public String getPayload()The application defined payload, or null.
Returns
the payload
getTitle
public String getTitle()The preview card title, or null.
Returns
the title
getDescription
public String getDescription()The preview card description, or null.
Returns
the description
getImageUrl
public String getImageUrl()The preview card image address, or null.
Returns
the image address
getParameters
public Map<String, String> getParameters()The custom parameters carried to the invited device.
Returns
an unmodifiable, insertion ordered map, never null