mirror of
https://github.com/foomo/gotsrpc.git
synced 2026-04-28 16:44:26 +00:00
51 lines
2.8 KiB
TypeScript
51 lines
2.8 KiB
TypeScript
/* eslint:disable */
|
|
// Code generated by gotsrpc https://github.com/foomo/gotsrpc/v2 - DO NOT EDIT.
|
|
import * as github_com_foomo_gotsrpc_v2 from './vo-gotsrpc'; // ./client/client.ts to ./client/vo-gotsrpc.ts
|
|
import * as github_com_foomo_gotsrpc_v2_tests_errors_server from './vo'; // ./client/client.ts to ./client/vo.ts
|
|
|
|
export class ServiceClient {
|
|
public static defaultEndpoint = "/service";
|
|
constructor(
|
|
public transport:<T>(method: string, data?: any[]) => Promise<T>
|
|
) {}
|
|
async customError():Promise<github_com_foomo_gotsrpc_v2.Error> {
|
|
return (await this.transport<{0:github_com_foomo_gotsrpc_v2.Error}>("CustomError", []))[0]
|
|
}
|
|
async error():Promise<github_com_foomo_gotsrpc_v2.Error> {
|
|
return (await this.transport<{0:github_com_foomo_gotsrpc_v2.Error}>("Error", []))[0]
|
|
}
|
|
async errors():Promise<{e1:github_com_foomo_gotsrpc_v2.Error; e2:github_com_foomo_gotsrpc_v2.Error}> {
|
|
const response = await this.transport<{0:github_com_foomo_gotsrpc_v2.Error; 1:github_com_foomo_gotsrpc_v2.Error}>("Errors", [])
|
|
return {e1 : response[0], e2 : response[1]};
|
|
}
|
|
async multiScalar():Promise<github_com_foomo_gotsrpc_v2_tests_errors_server.MultiScalar|null> {
|
|
return (await this.transport<{0:github_com_foomo_gotsrpc_v2_tests_errors_server.MultiScalar|null}>("MultiScalar", []))[0]
|
|
}
|
|
async scalar():Promise<github_com_foomo_gotsrpc_v2_tests_errors_server.ScalarError|null> {
|
|
return (await this.transport<{0:github_com_foomo_gotsrpc_v2_tests_errors_server.ScalarError|null}>("Scalar", []))[0]
|
|
}
|
|
async scalarError():Promise<github_com_foomo_gotsrpc_v2.Error> {
|
|
return (await this.transport<{0:github_com_foomo_gotsrpc_v2.Error}>("ScalarError", []))[0]
|
|
}
|
|
async struct():Promise<github_com_foomo_gotsrpc_v2_tests_errors_server.StructError|null> {
|
|
return (await this.transport<{0:github_com_foomo_gotsrpc_v2_tests_errors_server.StructError|null}>("Struct", []))[0]
|
|
}
|
|
async structError():Promise<github_com_foomo_gotsrpc_v2.Error> {
|
|
return (await this.transport<{0:github_com_foomo_gotsrpc_v2.Error}>("StructError", []))[0]
|
|
}
|
|
async typedCustomError():Promise<github_com_foomo_gotsrpc_v2.Error> {
|
|
return (await this.transport<{0:github_com_foomo_gotsrpc_v2.Error}>("TypedCustomError", []))[0]
|
|
}
|
|
async typedError():Promise<github_com_foomo_gotsrpc_v2.Error> {
|
|
return (await this.transport<{0:github_com_foomo_gotsrpc_v2.Error}>("TypedError", []))[0]
|
|
}
|
|
async typedScalarError():Promise<github_com_foomo_gotsrpc_v2.Error> {
|
|
return (await this.transport<{0:github_com_foomo_gotsrpc_v2.Error}>("TypedScalarError", []))[0]
|
|
}
|
|
async typedWrappedError():Promise<github_com_foomo_gotsrpc_v2.Error> {
|
|
return (await this.transport<{0:github_com_foomo_gotsrpc_v2.Error}>("TypedWrappedError", []))[0]
|
|
}
|
|
async wrappedError():Promise<github_com_foomo_gotsrpc_v2.Error> {
|
|
return (await this.transport<{0:github_com_foomo_gotsrpc_v2.Error}>("WrappedError", []))[0]
|
|
}
|
|
} |