Class SendInvitationsApiRequest
java.lang.Object
com.github.jamesnetherton.zulip.client.api.core.ZulipApiRequest
com.github.jamesnetherton.zulip.client.api.invitation.request.SendInvitationsApiRequest
- All Implemented Interfaces:
VoidExecutableApiRequest
Zulip API request builder for sending user invitations.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSendInvitationsApiRequest(ZulipHttpClient client, List<String> inviteeEmails, List<Long> streamIds) Constructs aSendInvitationsApiRequest. -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute()Executes the Zulip API request for sending user invitations.inviteExpiresInMinutes(int minutes) Sets the number of minutes before the invitation will expire.withGroupIds(long... groupIds) Sets the ids of groups that the user should be added to upon accepting the invitation.withIncludeRealmDefaultSubscriptions(boolean includeRealmDefaultSubscriptions) Sets whether the newly created user should be subscribed to the default channels for the organization.withInviteAs(UserRole role) Sets the organization level role of the user that is created when the invitation is accepted.withNotifyReferrerOnJoin(boolean notifyReferrerOnJoin) Sets whether the referrer would like to receive a direct message from notification bot when a user account is created.withWelcomeMessageCustomText(String welcomeMessageCustomText) Sets a custom message to be sent by the Welcome Bot to new users that join the organization via this invitation.Methods inherited from class com.github.jamesnetherton.zulip.client.api.core.ZulipApiRequest
client, getParam, getParam, getParams, putParam, putParamAsJsonString, putParamAsWrappedObject
-
Field Details
-
GROUP_IDS
- See Also:
-
INCLUDE_REALM_DEFAULT_SUBSCRIPTIONS
- See Also:
-
INVITEE_EMAILS
- See Also:
-
INVITE_AS
- See Also:
-
INVITE_EXPIRES_IN_MINUTES
- See Also:
-
NOTIFIY_REFERRER_ON_JOIN
- See Also:
-
STREAM_IDS
- See Also:
-
WELCOME_MESSAGE_CUSTOM_TEXT
- See Also:
-
-
Constructor Details
-
SendInvitationsApiRequest
public SendInvitationsApiRequest(ZulipHttpClient client, List<String> inviteeEmails, List<Long> streamIds) Constructs aSendInvitationsApiRequest.- Parameters:
client- The Zulip HTTP clientinviteeEmails- The list of email addresses to invitestreamIds- The list of channel ids that the newly created user will be automatically subscribed to
-
-
Method Details
-
withGroupIds
Sets the ids of groups that the user should be added to upon accepting the invitation.- Parameters:
groupIds- The ids of the invited user should be added to- Returns:
- This
SendInvitationsApiRequestinstance
-
withIncludeRealmDefaultSubscriptions
public SendInvitationsApiRequest withIncludeRealmDefaultSubscriptions(boolean includeRealmDefaultSubscriptions) Sets whether the newly created user should be subscribed to the default channels for the organization.- Parameters:
includeRealmDefaultSubscriptions- Whentrue, the newly created user will be subscribed to the default channels for the organization. Whenfalsethe user is not subscribed to any default channels.- Returns:
- This
SendInvitationsApiRequestinstance - See Also:
-
withInviteAs
Sets the organization level role of the user that is created when the invitation is accepted.- Parameters:
role- TheUserRolethat should apply to the new user- Returns:
- This
SendInvitationsApiRequestinstance - See Also:
-
inviteExpiresInMinutes
Sets the number of minutes before the invitation will expire.- Parameters:
minutes- The number of minutes before the invitation will expire- Returns:
- This
SendInvitationsApiRequestinstance - See Also:
-
withNotifyReferrerOnJoin
Sets whether the referrer would like to receive a direct message from notification bot when a user account is created.- Parameters:
notifyReferrerOnJoin- Whentruethe referrer will receive a direct message from notification bot when a user account is created. Whenfalseno notification is sent- Returns:
- This
SendInvitationsApiRequestinstance - See Also:
-
withWelcomeMessageCustomText
Sets a custom message to be sent by the Welcome Bot to new users that join the organization via this invitation.- Parameters:
welcomeMessageCustomText- The welcome message content- Returns:
- This
SendInvitationsApiRequestinstance - See Also:
-
execute
Executes the Zulip API request for sending user invitations.- Specified by:
executein interfaceVoidExecutableApiRequest- Throws:
ZulipClientException- if the request was not successful
-