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 TypeMethodDescriptionvoid
execute()
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.Methods inherited from class com.github.jamesnetherton.zulip.client.api.core.ZulipApiRequest
client, 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:
-
-
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
SendInvitationsApiRequest
instance
-
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. Whenfalse
the user is not subscribed to any default channels.- Returns:
- This
SendInvitationsApiRequest
instance - See Also:
-
withInviteAs
Sets the organization level role of the user that is created when the invitation is accepted.- Parameters:
role
- TheUserRole
that should apply to the new user- Returns:
- This
SendInvitationsApiRequest
instance - 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
SendInvitationsApiRequest
instance - 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
- Whentrue
the referrer will receive a direct message from notification bot when a user account is created. Whenfalse
no notification is sent- Returns:
- This
SendInvitationsApiRequest
instance - See Also:
-
execute
Executes the Zulip API request for sending user invitations.- Specified by:
execute
in interfaceVoidExecutableApiRequest
- Throws:
ZulipClientException
- if the request was not successful
-