Enum RestEndpoint

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<RestEndpoint>

    public enum RestEndpoint
    extends java.lang.Enum<RestEndpoint>
    This enum contains all endpoints which we may use.
    • Enum Constant Detail

      • MESSAGE_DELETE

        public static final RestEndpoint MESSAGE_DELETE
        This is the same endpoint as MESSAGE, but it has a different ratelimit bucket.
      • MESSAGES_BULK_DELETE

        public static final RestEndpoint MESSAGES_BULK_DELETE
      • CHANNEL_TYPING

        public static final RestEndpoint CHANNEL_TYPING
      • CHANNEL_INVITE

        public static final RestEndpoint CHANNEL_INVITE
      • USER_CHANNEL

        public static final RestEndpoint USER_CHANNEL
      • SERVER_PRUNE

        public static final RestEndpoint SERVER_PRUNE
      • SERVER_CHANNEL

        public static final RestEndpoint SERVER_CHANNEL
      • SERVER_MEMBER

        public static final RestEndpoint SERVER_MEMBER
      • SERVER_MEMBER_ROLE

        public static final RestEndpoint SERVER_MEMBER_ROLE
      • OWN_NICKNAME

        public static final RestEndpoint OWN_NICKNAME
      • CHANNEL_WEBHOOK

        public static final RestEndpoint CHANNEL_WEBHOOK
      • SERVER_WEBHOOK

        public static final RestEndpoint SERVER_WEBHOOK
      • SERVER_INVITE

        public static final RestEndpoint SERVER_INVITE
      • WEBHOOK_SEND

        public static final RestEndpoint WEBHOOK_SEND
      • WEBHOOK_MESSAGE

        public static final RestEndpoint WEBHOOK_MESSAGE
      • CURRENT_USER

        public static final RestEndpoint CURRENT_USER
      • CUSTOM_EMOJI

        public static final RestEndpoint CUSTOM_EMOJI
      • STICKER_PACK

        public static final RestEndpoint STICKER_PACK
      • SERVER_STICKER

        public static final RestEndpoint SERVER_STICKER
      • INTERACTION_RESPONSE

        public static final RestEndpoint INTERACTION_RESPONSE
      • ORIGINAL_INTERACTION_RESPONSE

        public static final RestEndpoint ORIGINAL_INTERACTION_RESPONSE
      • APPLICATION_COMMANDS

        public static final RestEndpoint APPLICATION_COMMANDS
      • SERVER_APPLICATION_COMMANDS

        public static final RestEndpoint SERVER_APPLICATION_COMMANDS
      • SERVER_APPLICATION_COMMAND_PERMISSIONS

        public static final RestEndpoint SERVER_APPLICATION_COMMAND_PERMISSIONS
      • APPLICATION_COMMAND_PERMISSIONS

        public static final RestEndpoint APPLICATION_COMMAND_PERMISSIONS
      • START_THREAD_WITH_MESSAGE

        public static final RestEndpoint START_THREAD_WITH_MESSAGE
      • START_THREAD_WITHOUT_MESSAGE

        public static final RestEndpoint START_THREAD_WITHOUT_MESSAGE
      • JOIN_LEAVE_THREAD

        public static final RestEndpoint JOIN_LEAVE_THREAD
      • ADD_REMOVE_THREAD_MEMBER

        public static final RestEndpoint ADD_REMOVE_THREAD_MEMBER
      • LIST_THREAD_MEMBERS

        public static final RestEndpoint LIST_THREAD_MEMBERS
      • LIST_ACTIVE_THREADS

        public static final RestEndpoint LIST_ACTIVE_THREADS
      • LIST_PUBLIC_ARCHIVED_THREADS

        public static final RestEndpoint LIST_PUBLIC_ARCHIVED_THREADS
      • LIST_PRIVATE_ARCHIVED_THREADS

        public static final RestEndpoint LIST_PRIVATE_ARCHIVED_THREADS
      • LIST_JOINED_PRIVATE_ARCHIVED_THREADS

        public static final RestEndpoint LIST_JOINED_PRIVATE_ARCHIVED_THREADS
      • THREAD_MEMBER

        public static final RestEndpoint THREAD_MEMBER
    • Method Detail

      • values

        public static RestEndpoint[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (RestEndpoint c : RestEndpoint.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static RestEndpoint valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • getMajorParameterPosition

        public java.util.Optional<java.lang.Integer> getMajorParameterPosition()
        Gets the major parameter position of the endpoint. If an endpoint has a major parameter, it means that the ratelimits for this endpoint are based on this parameter. The position starts counting at 0!
        Returns:
        An optional which is present, if the endpoint has a major parameter.
      • getEndpointUrl

        public java.lang.String getEndpointUrl()
        Gets the endpoint url (only including the base, not the https://discord.com/api/vXYZ/ "prefix").
        Returns:
        The gateway url.
      • getFullUrl

        public java.lang.String getFullUrl​(java.lang.String... parameters)
        Gets the full url of the endpoint. Parameters which are "too much" are added to the end.
        Parameters:
        parameters - The parameters of the url. E.g. for channel ids.
        Returns:
        The full url of the endpoint.
      • getOkHttpUrl

        public okhttp3.HttpUrl getOkHttpUrl​(java.lang.String... parameters)
        Gets the full http url of the endpoint. Parameters which are "too much" are added to the end.
        Parameters:
        parameters - The parameters of the url. E.g. for channel ids.
        Returns:
        The full http url of the endpoint.