Skip to content

Commit 664d65e

Browse files
committed
generate new client based on 06-03-2023 reset
1 parent 2d338e8 commit 664d65e

11 files changed

+715
-16
lines changed

src/.openapi-generator/FILES

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ models/GetFaction200Response.ts
4444
models/GetFactions200Response.ts
4545
models/GetJumpGate200Response.ts
4646
models/GetMarket200Response.ts
47+
models/GetMounts200Response.ts
4748
models/GetMyAgent200Response.ts
4849
models/GetMyShip200Response.ts
4950
models/GetMyShipCargo200Response.ts
@@ -63,6 +64,10 @@ models/GetSystem200Response.ts
6364
models/GetSystemWaypoints200Response.ts
6465
models/GetSystems200Response.ts
6566
models/GetWaypoint200Response.ts
67+
models/InstallMount201Response.ts
68+
models/InstallMount201ResponseData.ts
69+
models/InstallMount201ResponseDataTransaction.ts
70+
models/InstallMountRequest.ts
6671
models/Jettison200Response.ts
6772
models/Jettison200ResponseData.ts
6873
models/JettisonRequest.ts
@@ -92,6 +97,8 @@ models/RefuelShip200ResponseData.ts
9297
models/Register201Response.ts
9398
models/Register201ResponseData.ts
9499
models/RegisterRequest.ts
100+
models/RemoveMount201Response.ts
101+
models/RemoveMountRequest.ts
95102
models/ScannedShip.ts
96103
models/ScannedShipEngine.ts
97104
models/ScannedShipFrame.ts

src/apis/FleetApi.ts

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,14 @@ import type {
2323
DockShip200Response,
2424
ExtractResources201Response,
2525
ExtractResourcesRequest,
26+
GetMounts200Response,
2627
GetMyShip200Response,
2728
GetMyShipCargo200Response,
2829
GetMyShips200Response,
2930
GetShipCooldown200Response,
3031
GetShipNav200Response,
32+
InstallMount201Response,
33+
InstallMountRequest,
3134
Jettison200Response,
3235
JettisonRequest,
3336
JumpShip200Response,
@@ -42,6 +45,8 @@ import type {
4245
PurchaseShip201Response,
4346
PurchaseShipRequest,
4447
RefuelShip200Response,
48+
RemoveMount201Response,
49+
RemoveMountRequest,
4550
SellCargo201Response,
4651
SellCargoRequest,
4752
ShipRefine200Response,
@@ -66,6 +71,8 @@ import {
6671
ExtractResources201ResponseToJSON,
6772
ExtractResourcesRequestFromJSON,
6873
ExtractResourcesRequestToJSON,
74+
GetMounts200ResponseFromJSON,
75+
GetMounts200ResponseToJSON,
6976
GetMyShip200ResponseFromJSON,
7077
GetMyShip200ResponseToJSON,
7178
GetMyShipCargo200ResponseFromJSON,
@@ -76,6 +83,10 @@ import {
7683
GetShipCooldown200ResponseToJSON,
7784
GetShipNav200ResponseFromJSON,
7885
GetShipNav200ResponseToJSON,
86+
InstallMount201ResponseFromJSON,
87+
InstallMount201ResponseToJSON,
88+
InstallMountRequestFromJSON,
89+
InstallMountRequestToJSON,
7990
Jettison200ResponseFromJSON,
8091
Jettison200ResponseToJSON,
8192
JettisonRequestFromJSON,
@@ -104,6 +115,10 @@ import {
104115
PurchaseShipRequestToJSON,
105116
RefuelShip200ResponseFromJSON,
106117
RefuelShip200ResponseToJSON,
118+
RemoveMount201ResponseFromJSON,
119+
RemoveMount201ResponseToJSON,
120+
RemoveMountRequestFromJSON,
121+
RemoveMountRequestToJSON,
107122
SellCargo201ResponseFromJSON,
108123
SellCargo201ResponseToJSON,
109124
SellCargoRequestFromJSON,
@@ -147,6 +162,10 @@ export interface ExtractResourcesOperationRequest {
147162
extractResourcesRequest?: ExtractResourcesRequest;
148163
}
149164

165+
export interface GetMountsRequest {
166+
shipSymbol: string;
167+
}
168+
150169
export interface GetMyShipRequest {
151170
shipSymbol: string;
152171
}
@@ -168,6 +187,11 @@ export interface GetShipNavRequest {
168187
shipSymbol: string;
169188
}
170189

190+
export interface InstallMountOperationRequest {
191+
shipSymbol: string;
192+
installMountRequest?: InstallMountRequest;
193+
}
194+
171195
export interface JettisonOperationRequest {
172196
shipSymbol: string;
173197
jettisonRequest?: JettisonRequest;
@@ -210,6 +234,11 @@ export interface RefuelShipRequest {
210234
shipSymbol: string;
211235
}
212236

237+
export interface RemoveMountOperationRequest {
238+
shipSymbol: string;
239+
removeMountRequest?: RemoveMountRequest;
240+
}
241+
213242
export interface SellCargoOperationRequest {
214243
shipSymbol: string;
215244
sellCargoRequest?: SellCargoRequest;
@@ -518,6 +547,46 @@ export class FleetApi extends runtime.BaseAPI {
518547
return await response.value();
519548
}
520549

550+
/**
551+
* Get the mounts on a ship.
552+
* Get Mounts
553+
*/
554+
async getMountsRaw(requestParameters: GetMountsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetMounts200Response>> {
555+
if (requestParameters.shipSymbol === null || requestParameters.shipSymbol === undefined) {
556+
throw new runtime.RequiredError('shipSymbol','Required parameter requestParameters.shipSymbol was null or undefined when calling getMounts.');
557+
}
558+
559+
const queryParameters: any = {};
560+
561+
const headerParameters: runtime.HTTPHeaders = {};
562+
563+
if (this.configuration && this.configuration.accessToken) {
564+
const token = this.configuration.accessToken;
565+
const tokenString = await token("AgentToken", []);
566+
567+
if (tokenString) {
568+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
569+
}
570+
}
571+
const response = await this.request({
572+
path: `/my/ships/{shipSymbol}/mounts`.replace(`{${"shipSymbol"}}`, encodeURIComponent(String(requestParameters.shipSymbol))),
573+
method: 'GET',
574+
headers: headerParameters,
575+
query: queryParameters,
576+
}, initOverrides);
577+
578+
return new runtime.JSONApiResponse(response, (jsonValue) => GetMounts200ResponseFromJSON(jsonValue));
579+
}
580+
581+
/**
582+
* Get the mounts on a ship.
583+
* Get Mounts
584+
*/
585+
async getMounts(shipSymbol: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetMounts200Response> {
586+
const response = await this.getMountsRaw({ shipSymbol: shipSymbol }, initOverrides);
587+
return await response.value();
588+
}
589+
521590
/**
522591
* Retrieve the details of your ship.
523592
* Get Ship
@@ -722,6 +791,49 @@ export class FleetApi extends runtime.BaseAPI {
722791
return await response.value();
723792
}
724793

794+
/**
795+
* Install a mount on a ship.
796+
* Install Mount
797+
*/
798+
async installMountRaw(requestParameters: InstallMountOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<InstallMount201Response>> {
799+
if (requestParameters.shipSymbol === null || requestParameters.shipSymbol === undefined) {
800+
throw new runtime.RequiredError('shipSymbol','Required parameter requestParameters.shipSymbol was null or undefined when calling installMount.');
801+
}
802+
803+
const queryParameters: any = {};
804+
805+
const headerParameters: runtime.HTTPHeaders = {};
806+
807+
headerParameters['Content-Type'] = 'application/json';
808+
809+
if (this.configuration && this.configuration.accessToken) {
810+
const token = this.configuration.accessToken;
811+
const tokenString = await token("AgentToken", []);
812+
813+
if (tokenString) {
814+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
815+
}
816+
}
817+
const response = await this.request({
818+
path: `/my/ships/{shipSymbol}/mounts/install`.replace(`{${"shipSymbol"}}`, encodeURIComponent(String(requestParameters.shipSymbol))),
819+
method: 'POST',
820+
headers: headerParameters,
821+
query: queryParameters,
822+
body: InstallMountRequestToJSON(requestParameters.installMountRequest),
823+
}, initOverrides);
824+
825+
return new runtime.JSONApiResponse(response, (jsonValue) => InstallMount201ResponseFromJSON(jsonValue));
826+
}
827+
828+
/**
829+
* Install a mount on a ship.
830+
* Install Mount
831+
*/
832+
async installMount(shipSymbol: string, installMountRequest?: InstallMountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<InstallMount201Response> {
833+
const response = await this.installMountRaw({ shipSymbol: shipSymbol, installMountRequest: installMountRequest }, initOverrides);
834+
return await response.value();
835+
}
836+
725837
/**
726838
* Jettison cargo from your ship\'s cargo hold.
727839
* Jettison Cargo
@@ -1099,6 +1211,49 @@ export class FleetApi extends runtime.BaseAPI {
10991211
return await response.value();
11001212
}
11011213

1214+
/**
1215+
* Remove a mount from a ship.
1216+
* Remove Mount
1217+
*/
1218+
async removeMountRaw(requestParameters: RemoveMountOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RemoveMount201Response>> {
1219+
if (requestParameters.shipSymbol === null || requestParameters.shipSymbol === undefined) {
1220+
throw new runtime.RequiredError('shipSymbol','Required parameter requestParameters.shipSymbol was null or undefined when calling removeMount.');
1221+
}
1222+
1223+
const queryParameters: any = {};
1224+
1225+
const headerParameters: runtime.HTTPHeaders = {};
1226+
1227+
headerParameters['Content-Type'] = 'application/json';
1228+
1229+
if (this.configuration && this.configuration.accessToken) {
1230+
const token = this.configuration.accessToken;
1231+
const tokenString = await token("AgentToken", []);
1232+
1233+
if (tokenString) {
1234+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
1235+
}
1236+
}
1237+
const response = await this.request({
1238+
path: `/my/ships/{shipSymbol}/mounts/remove`.replace(`{${"shipSymbol"}}`, encodeURIComponent(String(requestParameters.shipSymbol))),
1239+
method: 'POST',
1240+
headers: headerParameters,
1241+
query: queryParameters,
1242+
body: RemoveMountRequestToJSON(requestParameters.removeMountRequest),
1243+
}, initOverrides);
1244+
1245+
return new runtime.JSONApiResponse(response, (jsonValue) => RemoveMount201ResponseFromJSON(jsonValue));
1246+
}
1247+
1248+
/**
1249+
* Remove a mount from a ship.
1250+
* Remove Mount
1251+
*/
1252+
async removeMount(shipSymbol: string, removeMountRequest?: RemoveMountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RemoveMount201Response> {
1253+
const response = await this.removeMountRaw({ shipSymbol: shipSymbol, removeMountRequest: removeMountRequest }, initOverrides);
1254+
return await response.value();
1255+
}
1256+
11021257
/**
11031258
* Sell cargo.
11041259
* Sell Cargo

src/models/GetMounts200Response.ts

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
/* tslint:disable */
2+
/* eslint-disable */
3+
/**
4+
* SpaceTraders API
5+
* 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](https://github.com/SpaceTradersAPI/api-docs). You can send your first request right here in your browser to check the status of the game server. ```json http { \"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](https://discord.com/invite/jh6zurdWk5) where you can share your projects, ask questions, and get help from other players.
6+
*
7+
* The version of the OpenAPI document: 2.0.0
8+
* Contact: joel@spacetraders.io
9+
*
10+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11+
* https://openapi-generator.tech
12+
* Do not edit the class manually.
13+
*/
14+
15+
import { exists, mapValues } from '../runtime';
16+
import type { ShipMount } from './ShipMount';
17+
import {
18+
ShipMountFromJSON,
19+
ShipMountFromJSONTyped,
20+
ShipMountToJSON,
21+
} from './ShipMount';
22+
23+
/**
24+
*
25+
* @export
26+
* @interface GetMounts200Response
27+
*/
28+
export interface GetMounts200Response {
29+
/**
30+
*
31+
* @type {Array<ShipMount>}
32+
* @memberof GetMounts200Response
33+
*/
34+
data: Array<ShipMount>;
35+
}
36+
37+
/**
38+
* Check if a given object implements the GetMounts200Response interface.
39+
*/
40+
export function instanceOfGetMounts200Response(value: object): boolean {
41+
let isInstance = true;
42+
isInstance = isInstance && "data" in value;
43+
44+
return isInstance;
45+
}
46+
47+
export function GetMounts200ResponseFromJSON(json: any): GetMounts200Response {
48+
return GetMounts200ResponseFromJSONTyped(json, false);
49+
}
50+
51+
export function GetMounts200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetMounts200Response {
52+
if ((json === undefined) || (json === null)) {
53+
return json;
54+
}
55+
return {
56+
57+
'data': ((json['data'] as Array<any>).map(ShipMountFromJSON)),
58+
};
59+
}
60+
61+
export function GetMounts200ResponseToJSON(value?: GetMounts200Response | null): any {
62+
if (value === undefined) {
63+
return undefined;
64+
}
65+
if (value === null) {
66+
return null;
67+
}
68+
return {
69+
70+
'data': ((value.data as Array<any>).map(ShipMountToJSON)),
71+
};
72+
}
73+

0 commit comments

Comments
 (0)