Package discord4j.rest.entity
Class RestInvite
- java.lang.Object
-
- discord4j.rest.entity.RestInvite
-
public class RestInvite extends Object
Represents a code that can be used to add a user to a guild.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static RestInvitecreate(RestClient restClient, String code)Create aRestInvitewith the given parameters.Mono<discord4j.discordjson.json.InviteData>delete(String reason)Delete this resource from the Discord API.booleanequals(Object o)StringgetCode()Gets the invite code.Mono<discord4j.discordjson.json.InviteData>getData()Retrieve the contents of this REST entity from Discord API.Mono<discord4j.discordjson.json.InviteData>getData(boolean withCounts, boolean withExpiration, Snowflake guildScheduledEventId)Retrieve the contents of this REST entity from Discord API.inthashCode()
-
-
-
Method Detail
-
create
public static RestInvite create(RestClient restClient, String code)
Create aRestInvitewith the given parameters. This method does not perform any API request.- Parameters:
restClient- REST API resourcescode- the ID of this entity- Returns:
- a
RestInviterepresented by the given parameters.
-
getCode
public String getCode()
Gets the invite code.- Returns:
- The invite code
-
getData
public Mono<discord4j.discordjson.json.InviteData> getData()
Retrieve the contents of this REST entity from Discord API.- Returns:
- a Mono with the
InviteDatacontents if successful, otherwise an error Mono
-
getData
public Mono<discord4j.discordjson.json.InviteData> getData(boolean withCounts, boolean withExpiration, @Nullable Snowflake guildScheduledEventId)
Retrieve the contents of this REST entity from Discord API.- Parameters:
withCounts- whether the invite should contain approximate member countswithExpiration- whether the invite should contain the expiration dateguildScheduledEventId- the guild scheduled event to include with the invite, can benull- Returns:
- a Mono with the
InviteDatacontents if successful, otherwise an error Mono
-
delete
public Mono<discord4j.discordjson.json.InviteData> delete(@Nullable String reason)
Delete this resource from the Discord API.- Parameters:
reason- include a reason for audit log purposes, can benull- Returns:
- a Mono with the
InviteDatacontents if successful, otherwise an empty Mono
-
-