Code Monkey home page Code Monkey logo

spacetraders-openapi-generator-api-client's Introduction

openapi-generator-api-client

SpaceTraders API

  • API version: 2.0.0

  • Build date: 2023-06-05T09:25:51.979579Z[Etc/UTC]

SpaceTraders is an open-universe game and learning platform that offers a set of HTTP endpoints to control a fleet of ships and explore a multiplayer universe.

The API is documented using OpenAPI. You can send your first request right here in your browser to check the status of the game server.

{
  \"method\": \"GET\",
  \"url\": \"https://api.spacetraders.io/v2\",
}

Unlike a traditional game, SpaceTraders does not have a first-party client or app to play the game. Instead, you can use the API to build your own client, write a script to automate your ships, or try an app built by the community.

We have a Discord channel where you can share your projects, ask questions, and get help from other players.

Automatically generated by the OpenAPI Generator

Requirements

Building the API client library requires:

  1. Java 1.8+
  2. Maven/Gradle

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>de.elbosso.spacetraders</groupId>
  <artifactId>openapi-generator-api-client</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <scope>compile</scope>
</dependency>

Gradle users

Add this dependency to your project's build file:

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

  dependencies {
     implementation "de.elbosso.spacetraders:openapi-generator-api-client:0.0.1-SNAPSHOT"
  }

Others

At first generate the JAR by executing:

mvn clean package

Then manually install the following JARs:

  • target/openapi-generator-api-client-0.0.1-SNAPSHOT.jar
  • target/lib/*.jar

Getting Started

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

import de.elbosso.spacetraders.client.invoker.*;
import de.elbosso.spacetraders.client.invoker.auth.*;
import de.elbosso.spacetraders.client.model.*;
import de.elbosso.spacetraders.client.api.AgentsApi;

public class AgentsApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        defaultClient.setBasePath("https://api.spacetraders.io/v2");
        
        // Configure HTTP bearer authorization: AgentToken
        HttpBearerAuth AgentToken = (HttpBearerAuth) defaultClient.getAuthentication("AgentToken");
        AgentToken.setBearerToken("BEARER TOKEN");

        AgentsApi apiInstance = new AgentsApi(defaultClient);
        try {
            GetMyAgent200Response result = apiInstance.getMyAgent();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AgentsApi#getMyAgent");
            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.spacetraders.io/v2

Class Method HTTP request Description
AgentsApi getMyAgent GET /my/agent My Agent Details
ContractsApi acceptContract POST /my/contracts/{contractId}/accept Accept Contract
ContractsApi deliverContract POST /my/contracts/{contractId}/deliver Deliver Contract
ContractsApi fulfillContract POST /my/contracts/{contractId}/fulfill Fulfill Contract
ContractsApi getContract GET /my/contracts/{contractId} Get Contract
ContractsApi getContracts GET /my/contracts List Contracts
DefaultApi getStatus GET / Get Status
DefaultApi register POST /register Register New Agent
FactionsApi getFaction GET /factions/{factionSymbol} Get Faction
FactionsApi getFactions GET /factions List Factions
FleetApi createChart POST /my/ships/{shipSymbol}/chart Create Chart
FleetApi createShipShipScan POST /my/ships/{shipSymbol}/scan/ships Scan Ships
FleetApi createShipSystemScan POST /my/ships/{shipSymbol}/scan/systems Scan Systems
FleetApi createShipWaypointScan POST /my/ships/{shipSymbol}/scan/waypoints Scan Waypoints
FleetApi createSurvey POST /my/ships/{shipSymbol}/survey Create Survey
FleetApi dockShip POST /my/ships/{shipSymbol}/dock Dock Ship
FleetApi extractResources POST /my/ships/{shipSymbol}/extract Extract Resources
FleetApi getMounts GET /my/ships/{shipSymbol}/mounts Get Mounts
FleetApi getMyShip GET /my/ships/{shipSymbol} Get Ship
FleetApi getMyShipCargo GET /my/ships/{shipSymbol}/cargo Get Ship Cargo
FleetApi getMyShips GET /my/ships List Ships
FleetApi getShipCooldown GET /my/ships/{shipSymbol}/cooldown Get Ship Cooldown
FleetApi getShipNav GET /my/ships/{shipSymbol}/nav Get Ship Nav
FleetApi installMount POST /my/ships/{shipSymbol}/mounts/install Install Mount
FleetApi jettison POST /my/ships/{shipSymbol}/jettison Jettison Cargo
FleetApi jumpShip POST /my/ships/{shipSymbol}/jump Jump Ship
FleetApi navigateShip POST /my/ships/{shipSymbol}/navigate Navigate Ship
FleetApi negotiateContract POST /my/ships/{shipSymbol}/negotiate/contract Negotiate Contract
FleetApi orbitShip POST /my/ships/{shipSymbol}/orbit Orbit Ship
FleetApi patchShipNav PATCH /my/ships/{shipSymbol}/nav Patch Ship Nav
FleetApi purchaseCargo POST /my/ships/{shipSymbol}/purchase Purchase Cargo
FleetApi purchaseShip POST /my/ships Purchase Ship
FleetApi refuelShip POST /my/ships/{shipSymbol}/refuel Refuel Ship
FleetApi removeMount POST /my/ships/{shipSymbol}/mounts/remove Remove Mount
FleetApi sellCargo POST /my/ships/{shipSymbol}/sell Sell Cargo
FleetApi shipRefine POST /my/ships/{shipSymbol}/refine Ship Refine
FleetApi transferCargo POST /my/ships/{shipSymbol}/transfer Transfer Cargo
FleetApi warpShip POST /my/ships/{shipSymbol}/warp Warp Ship
SystemsApi getJumpGate GET /systems/{systemSymbol}/waypoints/{waypointSymbol}/jump-gate Get Jump Gate
SystemsApi getMarket GET /systems/{systemSymbol}/waypoints/{waypointSymbol}/market Get Market
SystemsApi getShipyard GET /systems/{systemSymbol}/waypoints/{waypointSymbol}/shipyard Get Shipyard
SystemsApi getSystem GET /systems/{systemSymbol} Get System
SystemsApi getSystemWaypoints GET /systems/{systemSymbol}/waypoints List Waypoints
SystemsApi getSystems GET /systems List Systems
SystemsApi getWaypoint GET /systems/{systemSymbol}/waypoints/{waypointSymbol} Get Waypoint

Documentation for Models

Documentation for Authorization

Authentication schemes defined for the API:

AgentToken

  • Type: HTTP Bearer Token authentication

Recommendation

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

Author

[email protected]

spacetraders-openapi-generator-api-client's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.