Interface AttachmentService

    • Method Detail

      • getAttachments

        java.util.List<Attachment> getAttachments​(Match match)
                                           throws DataAccessException
        Retrieve a match's attachments.
        Parameters:
        match - The match to get the attachments from. Must contain the tournament- and match id
        Returns:
        The match attachments
        Throws:
        DataAccessException - Exchange with the rest api failed
      • getAttachments

        void getAttachments​(Match match,
                            Callback<java.util.List<Attachment>> onSuccess,
                            Callback<DataAccessException> onFailure)
        Retrieve a match's attachments.
        Parameters:
        match - The match to get the attachments from. Must contain the tournament- and match id
        onSuccess - Called with result if call was successful
        onFailure - Called with exception if call was not successful
      • getAttachment

        Attachment getAttachment​(Match match,
                                 long attachmentId)
                          throws DataAccessException
        Retrieve a single match attachment record.
        Parameters:
        match - The match to get the attachment from. Must contain the tournament- and match id
        attachmentId - The attachment's unique ID
        Returns:
        The requested attachment
        Throws:
        DataAccessException - Exchange with the rest api failed
      • getAttachment

        void getAttachment​(Match match,
                           long attachmentId,
                           Callback<Attachment> onSuccess,
                           Callback<DataAccessException> onFailure)
        Retrieve a single match attachment record.
        Parameters:
        match - The match to get the attachment from. Must contain the tournament- and match id
        attachmentId - The attachment's unique ID
        onSuccess - Called with result if call was successful
        onFailure - Called with exception if call was not successful
      • createAttachment

        Attachment createAttachment​(Match match,
                                    AttachmentQuery data)
                             throws DataAccessException
        Add a file, link, or text attachment to a match. NOTE: The associated tournament's "accept_attachments" attribute must be true for this action to succeed.

        At least 1 of the 3 optional parameters (asset, url or description in the enumeration object) must be provided. Files up to 25MB are allowed for tournaments hosted by Challonge Premier subscribers.

        Parameters:
        match - The match to create the attachment for. Must contain the tournament- and match id
        data - The attachment to create
        Returns:
        The created attachment
        Throws:
        DataAccessException - Exchange with the rest api failed
      • createAttachment

        void createAttachment​(Match match,
                              AttachmentQuery data,
                              Callback<Attachment> onSuccess,
                              Callback<DataAccessException> onFailure)
        Add a file, link, or text attachment to a match. NOTE: The associated tournament's "accept_attachments" attribute must be true for this action to succeed.

        At least 1 of the 3 optional parameters (asset, url or description in the enumeration object) must be provided. Files up to 25MB are allowed for tournaments hosted by Challonge Premier subscribers.

        Parameters:
        match - The match to create the attachment for. Must contain the tournament- and match id
        data - The attachment to create
        onSuccess - Called with result if call was successful
        onFailure - Called with exception if call was not successful
      • updateAttachment

        Attachment updateAttachment​(Match match,
                                    Attachment attachment,
                                    AttachmentQuery data)
                             throws DataAccessException
        Update the attributes of a match attachment.

        Sending the asset does neither work with base64 nor with a multipart-form-data request

        At least 1 of the 3 optional parameters (asset, url or description in the enumeration object) must be provided. Files up to 25MB are allowed for tournaments hosted by Challonge Premier subscribers.

        Parameters:
        match - The match to delete the attachment from. Must contain the tournament- and match id
        attachment - The attachment to update. Must contain the tournament- and match id
        data - The attachment to update
        Returns:
        The updated attachment
        Throws:
        DataAccessException - Exchange with the rest api failed
      • updateAttachment

        void updateAttachment​(Match match,
                              Attachment attachment,
                              AttachmentQuery data,
                              Callback<Attachment> onSuccess,
                              Callback<DataAccessException> onFailure)
        Update the attributes of a match attachment.

        Sending the asset does neither work with base64 nor with a multipart-form-data request

        At least 1 of the 3 optional parameters (asset, url or description in the enumeration object) must be provided. Files up to 25MB are allowed for tournaments hosted by Challonge Premier subscribers.

        Parameters:
        match - The match to delete the attachment from. Must contain the tournament- and match id
        attachment - The attachment to update. Must contain the tournament- and match id
        data - The attachment to update
        onSuccess - Called with result if call was successful
        onFailure - Called with exception if call was not successful
      • deleteAttachment

        Attachment deleteAttachment​(Match match,
                                    Attachment attachment)
                             throws DataAccessException
        Delete a match attachment.
        Parameters:
        match - The match to delete the attachment from. Must contain the tournament- and match id
        attachment - The attachment to delete. Must contain the tournament- and match id
        Returns:
        The deleted attachment
        Throws:
        DataAccessException - Exchange with the rest api failed
      • deleteAttachment

        void deleteAttachment​(Match match,
                              Attachment attachment,
                              Callback<Attachment> onSuccess,
                              Callback<DataAccessException> onFailure)
        Delete a match attachment.
        Parameters:
        match - The match to delete the attachment from. Must contain the tournament- and match id
        attachment - The attachment to delete. Must contain the tournament- and match id
        onSuccess - Called with result if call was successful
        onFailure - Called with exception if call was not successful