1
0
mirror of https://github.com/playit-cloud/playit-api-java synced 2024-11-11 11:29:32 +00:00
Go to file
2024-02-08 12:51:30 -08:00
.github/workflows Initial commit 2024-02-08 12:15:33 -08:00
.openapi-generator Initial commit 2024-02-08 12:15:33 -08:00
api Initial commit 2024-02-08 12:15:33 -08:00
docs Initial commit 2024-02-08 12:15:33 -08:00
gradle/wrapper Initial commit 2024-02-08 12:15:33 -08:00
patches Update auth in ApiClient with patches 2024-02-08 12:51:30 -08:00
res Initial commit 2024-02-08 12:15:33 -08:00
src Update auth in ApiClient with patches 2024-02-08 12:51:30 -08:00
.gitignore Remove generation timestamps to clean up diff 2024-02-08 12:45:09 -08:00
.openapi-generator-ignore Initial commit 2024-02-08 12:15:33 -08:00
.travis.yml Initial commit 2024-02-08 12:15:33 -08:00
build.gradle Initial commit 2024-02-08 12:15:33 -08:00
build.sbt Initial commit 2024-02-08 12:15:33 -08:00
generate.sh Update auth in ApiClient with patches 2024-02-08 12:51:30 -08:00
git_push.sh Initial commit 2024-02-08 12:15:33 -08:00
gradle.properties Initial commit 2024-02-08 12:15:33 -08:00
gradlew Initial commit 2024-02-08 12:15:33 -08:00
gradlew.bat Initial commit 2024-02-08 12:15:33 -08:00
pom.xml Initial commit 2024-02-08 12:15:33 -08:00
README.md Remove generation timestamps to clean up diff 2024-02-08 12:45:09 -08:00
settings.gradle Initial commit 2024-02-08 12:15:33 -08:00

playit-api-java

playit.gg's api

  • API version: unstable

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

Automatically generated by the OpenAPI Generator

Requirements

Building the API client library requires:

  1. Java 1.8+
  2. Maven (3.8.3+)/Gradle (7.2+)

Installation

To install the API client library to your local Maven repository, simply execute:

mvn clean install

To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:

mvn clean deploy

Refer to the OSSRH Guide for more information.

Maven users

Add this dependency to your project's POM:

<dependency>
  <groupId>org.openapitools</groupId>
  <artifactId>playit-api-java</artifactId>
  <version>unstable</version>
  <scope>compile</scope>
</dependency>

Gradle users

Add this dependency to your project's build file:

  repositories {
    mavenCentral()     // Needed if the 'playit-api-java' jar has been published to maven central.
    mavenLocal()       // Needed if the 'playit-api-java' jar has been published to the local maven repo.
  }

  dependencies {
     implementation "org.openapitools:playit-api-java:unstable"
  }

Others

At first generate the JAR by executing:

mvn clean package

Then manually install the following JARs:

  • target/playit-api-java-unstable.jar
  • target/lib/*.jar

Getting Started

Please follow the installation instruction and execute the following Java code:


// Import classes:
import gg.playit.ApiClient;
import gg.playit.ApiException;
import gg.playit.Configuration;
import gg.playit.auth.*;
import gg.playit.models.*;
import gg.playit.api.DefaultPlayitAPI;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.playit.gg");
    
    // Configure API key authorization: AgentKey
    ApiKeyAuth AgentKey = (ApiKeyAuth) defaultClient.getAuthentication("AgentKey");
    AgentKey.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //AgentKey.setApiKeyPrefix("Token");

    // Configure API key authorization: ApiKey
    ApiKeyAuth ApiKey = (ApiKeyAuth) defaultClient.getAuthentication("ApiKey");
    ApiKey.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //ApiKey.setApiKeyPrefix("Token");

    DefaultPlayitAPI apiInstance = new DefaultPlayitAPI(defaultClient);
    ReqAgentsRoutingGet reqAgentsRoutingGet = new ReqAgentsRoutingGet(); // ReqAgentsRoutingGet | 
    try {
      AgentsRoutingGetPost200Response result = apiInstance.agentsRoutingGetPost(reqAgentsRoutingGet);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling DefaultPlayitAPI#agentsRoutingGetPost");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Documentation for API Endpoints

All URIs are relative to https://api.playit.gg

Class Method HTTP request Description
DefaultPlayitAPI agentsRoutingGetPost POST /agents/routing/get
DefaultPlayitAPI agentsRundataPost POST /agents/rundata
DefaultPlayitAPI claimAcceptPost POST /claim/accept
DefaultPlayitAPI claimDetailsPost POST /claim/details
DefaultPlayitAPI claimExchangePost POST /claim/exchange
DefaultPlayitAPI claimRejectPost POST /claim/reject
DefaultPlayitAPI claimSetupPost POST /claim/setup
DefaultPlayitAPI loginGuestPost POST /login/guest
DefaultPlayitAPI protoRegisterPost POST /proto/register
DefaultPlayitAPI tunnelsCreatePost POST /tunnels/create
DefaultPlayitAPI tunnelsDeletePost POST /tunnels/delete
DefaultPlayitAPI tunnelsListPost POST /tunnels/list

Documentation for Models

Documentation for Authorization

Authentication schemes defined for the API:

ApiKey

  • Type: API key
  • API key parameter name: Authorization
  • Location: HTTP header

AgentKey

  • Type: API key
  • API key parameter name: Authorization
  • Location: HTTP header

Recommendation

It's recommended to create an instance of ApiClient per thread in a multithreaded environment to avoid any potential issues.

Author