001package net.tnemc.plugincore.core.paste;
002/*
003 * The New Plugin Core
004 * Copyright (C) 2022 - 2025 Daniel "creatorfromhell" Vidmar
005 *
006 * This program is free software: you can redistribute it and/or modify
007 * it under the terms of the GNU Affero General Public License as published by
008 * the Free Software Foundation, either version 3 of the License, or
009 * (at your option) any later version.
010 *
011 * This program is distributed in the hope that it will be useful,
012 * but WITHOUT ANY WARRANTY; without even the implied warranty of
013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
014 * GNU Affero General Public License for more details.
015 *
016 * You should have received a copy of the GNU Affero General Public License
017 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
018 */
019
020import java.util.Optional;
021
022/**
023 * PasteClient
024 *
025 * @author creatorfromhell
026 * @since 1.0.0.2
027 */
028public interface IPasteClient {
029
030  /**
031   * Retrieves the identifier associated with this object.
032   *
033   * @return The identifier as a String.
034   */
035  String identifier();
036
037  /**
038   * Retrieves the endpoint associated with this client.
039   *
040   * @return The endpoint as a String.
041   */
042  String endpoint();
043
044  /**
045   * Provides the API key associated with this client.
046   *
047   * @return The API key as a String.
048   */
049  String apiKey();
050
051  /**
052   * Creates a single paste based on the provided IPasteable object.
053   *
054   * @param pasteable the IPasteable object containing the details of the paste to create
055   * @return an Optional of String representing the URL of the created paste, or an empty Optional if creation fails
056   */
057  Optional<String> createSingle(IPasteable pasteable);
058
059  /**
060   * Creates multiple pastes based on the provided IPasteable objects.
061   *
062   * @param pasteables an array of IPasteable objects containing the details of the pastes to create
063   * @return an Optional of String representing the URL of the last created paste, or an empty Optional if creation fails or no pastes were created
064   */
065  Optional<String> createMultiple(IPasteable... pasteables);
066}