Generate clients (#206)

This commit is contained in:
Janos Dobronszki
2021-09-16 12:52:36 +01:00
committed by GitHub
parent 552c321dd7
commit d4d9c1c176
334 changed files with 9334 additions and 45 deletions

29
clients/ts/sms/index.ts Executable file
View File

@@ -0,0 +1,29 @@
import * as m3o from "@m3o/m3o-node";
export class SmsService {
private client: m3o.Client;
constructor(token: string) {
this.client = new m3o.Client({ token: token });
}
// Send an SMS.
send(request: SendRequest): Promise<SendResponse> {
return this.client.call("sms", "Send", request) as Promise<SendResponse>;
}
}
export interface SendRequest {
// who is the message from? The message will be suffixed with "Sent from <from>"
from?: string;
// the main body of the message to send
message?: string;
// the destination phone number including the international dialling code (e.g. +44)
to?: string;
}
export interface SendResponse {
// any additional info
info?: string;
// will return "ok" if successful
status?: string;
}