mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-23 07:41:25 +00:00
Generate clients (#206)
This commit is contained in:
6
examples/emoji/find/curl/findEmoji.sh
Executable file
6
examples/emoji/find/curl/findEmoji.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
curl "https://api.m3o.com/v1/emoji/Find" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Authorization: Bearer $MICRO_API_TOKEN" \
|
||||
-d '{
|
||||
"alias": ":beer:"
|
||||
}'
|
||||
16
examples/emoji/find/go/findEmoji.go
Executable file
16
examples/emoji/find/go/findEmoji.go
Executable file
@@ -0,0 +1,16 @@
|
||||
package example
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/micro/services/clients/go/emoji"
|
||||
"os"
|
||||
)
|
||||
|
||||
// Find an emoji by its alias e.g :beer:
|
||||
func FindEmoji() {
|
||||
emojiService := emoji.NewEmojiService(os.Getenv("MICRO_API_TOKEN"))
|
||||
rsp, err := emojiService.Find(&emoji.FindRequest{
|
||||
Alias: ":beer:",
|
||||
})
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
12
examples/emoji/find/node/findEmoji.js
Executable file
12
examples/emoji/find/node/findEmoji.js
Executable file
@@ -0,0 +1,12 @@
|
||||
import * as emoji from "m3o/emoji";
|
||||
|
||||
// Find an emoji by its alias e.g :beer:
|
||||
async function FindEmoji() {
|
||||
let emojiService = new emoji.EmojiService(process.env.MICRO_API_TOKEN);
|
||||
let rsp = await emojiService.find({
|
||||
alias: ":beer:",
|
||||
});
|
||||
console.log(rsp);
|
||||
}
|
||||
|
||||
await FindEmoji();
|
||||
6
examples/emoji/flag/curl/getFlagByCountryCode.sh
Executable file
6
examples/emoji/flag/curl/getFlagByCountryCode.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
curl "https://api.m3o.com/v1/emoji/Flag" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Authorization: Bearer $MICRO_API_TOKEN" \
|
||||
-d '{
|
||||
"alias": "GB"
|
||||
}'
|
||||
14
examples/emoji/flag/go/getFlagByCountryCode.go
Executable file
14
examples/emoji/flag/go/getFlagByCountryCode.go
Executable file
@@ -0,0 +1,14 @@
|
||||
package example
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/micro/services/clients/go/emoji"
|
||||
"os"
|
||||
)
|
||||
|
||||
// Get the flag for a country. Requires country code e.g GB for great britain
|
||||
func GetFlagByCountryCode() {
|
||||
emojiService := emoji.NewEmojiService(os.Getenv("MICRO_API_TOKEN"))
|
||||
rsp, err := emojiService.Flag(&emoji.FlagRequest{})
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
12
examples/emoji/flag/node/getFlagByCountryCode.js
Executable file
12
examples/emoji/flag/node/getFlagByCountryCode.js
Executable file
@@ -0,0 +1,12 @@
|
||||
import * as emoji from "m3o/emoji";
|
||||
|
||||
// Get the flag for a country. Requires country code e.g GB for great britain
|
||||
async function GetFlagByCountryCode() {
|
||||
let emojiService = new emoji.EmojiService(process.env.MICRO_API_TOKEN);
|
||||
let rsp = await emojiService.flag({
|
||||
alias: "GB",
|
||||
});
|
||||
console.log(rsp);
|
||||
}
|
||||
|
||||
await GetFlagByCountryCode();
|
||||
6
examples/emoji/print/curl/printTextIncludingEmoji.sh
Executable file
6
examples/emoji/print/curl/printTextIncludingEmoji.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
curl "https://api.m3o.com/v1/emoji/Print" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Authorization: Bearer $MICRO_API_TOKEN" \
|
||||
-d '{
|
||||
"text": "let's grab a :beer:"
|
||||
}'
|
||||
17
examples/emoji/print/go/printTextIncludingEmoji.go
Executable file
17
examples/emoji/print/go/printTextIncludingEmoji.go
Executable file
@@ -0,0 +1,17 @@
|
||||
package example
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/micro/services/clients/go/emoji"
|
||||
"os"
|
||||
)
|
||||
|
||||
// Print text and renders the emojis with aliases e.g
|
||||
// let's grab a :beer: becomes let's grab a 🍺
|
||||
func PrintTextIncludingEmoji() {
|
||||
emojiService := emoji.NewEmojiService(os.Getenv("MICRO_API_TOKEN"))
|
||||
rsp, err := emojiService.Print(&emoji.PrintRequest{
|
||||
Text: "let's grab a :beer:",
|
||||
})
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
13
examples/emoji/print/node/printTextIncludingEmoji.js
Executable file
13
examples/emoji/print/node/printTextIncludingEmoji.js
Executable file
@@ -0,0 +1,13 @@
|
||||
import * as emoji from "m3o/emoji";
|
||||
|
||||
// Print text and renders the emojis with aliases e.g
|
||||
// let's grab a :beer: becomes let's grab a 🍺
|
||||
async function PrintTextIncludingEmoji() {
|
||||
let emojiService = new emoji.EmojiService(process.env.MICRO_API_TOKEN);
|
||||
let rsp = await emojiService.print({
|
||||
text: "let's grab a :beer:",
|
||||
});
|
||||
console.log(rsp);
|
||||
}
|
||||
|
||||
await PrintTextIncludingEmoji();
|
||||
8
examples/emoji/send/curl/sendATextContainingAnEmojiToAnyoneViaSms.sh
Executable file
8
examples/emoji/send/curl/sendATextContainingAnEmojiToAnyoneViaSms.sh
Executable file
@@ -0,0 +1,8 @@
|
||||
curl "https://api.m3o.com/v1/emoji/Send" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Authorization: Bearer $MICRO_API_TOKEN" \
|
||||
-d '{
|
||||
"from": "Alice",
|
||||
"message": "let's grab a :beer:",
|
||||
"to": "+44782669123"
|
||||
}'
|
||||
18
examples/emoji/send/go/sendATextContainingAnEmojiToAnyoneViaSms.go
Executable file
18
examples/emoji/send/go/sendATextContainingAnEmojiToAnyoneViaSms.go
Executable file
@@ -0,0 +1,18 @@
|
||||
package example
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/micro/services/clients/go/emoji"
|
||||
"os"
|
||||
)
|
||||
|
||||
// Send an emoji to anyone via SMS. Messages are sent in the form '<message> Sent from <from>'
|
||||
func SendAtextContainingAnEmojiToAnyoneViaSms() {
|
||||
emojiService := emoji.NewEmojiService(os.Getenv("MICRO_API_TOKEN"))
|
||||
rsp, err := emojiService.Send(&emoji.SendRequest{
|
||||
From: "Alice",
|
||||
Message: "let's grab a :beer:",
|
||||
To: "+44782669123",
|
||||
})
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
14
examples/emoji/send/node/sendATextContainingAnEmojiToAnyoneViaSms.js
Executable file
14
examples/emoji/send/node/sendATextContainingAnEmojiToAnyoneViaSms.js
Executable file
@@ -0,0 +1,14 @@
|
||||
import * as emoji from "m3o/emoji";
|
||||
|
||||
// Send an emoji to anyone via SMS. Messages are sent in the form '<message> Sent from <from>'
|
||||
async function SendAtextContainingAnEmojiToAnyoneViaSms() {
|
||||
let emojiService = new emoji.EmojiService(process.env.MICRO_API_TOKEN);
|
||||
let rsp = await emojiService.send({
|
||||
from: "Alice",
|
||||
message: "let's grab a :beer:",
|
||||
to: "+44782669123",
|
||||
});
|
||||
console.log(rsp);
|
||||
}
|
||||
|
||||
await SendAtextContainingAnEmojiToAnyoneViaSms();
|
||||
Reference in New Issue
Block a user