mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-22 23:35:26 +00:00
Generate clients (#206)
This commit is contained in:
6
examples/quran/chapters/curl/listChapters.sh
Executable file
6
examples/quran/chapters/curl/listChapters.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
curl "https://api.m3o.com/v1/quran/Chapters" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Authorization: Bearer $MICRO_API_TOKEN" \
|
||||
-d '{
|
||||
"language": "en"
|
||||
}'
|
||||
16
examples/quran/chapters/go/listChapters.go
Executable file
16
examples/quran/chapters/go/listChapters.go
Executable file
@@ -0,0 +1,16 @@
|
||||
package example
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/micro/services/clients/go/quran"
|
||||
"os"
|
||||
)
|
||||
|
||||
// List the Chapters (surahs) of the Quran
|
||||
func ListChapters() {
|
||||
quranService := quran.NewQuranService(os.Getenv("MICRO_API_TOKEN"))
|
||||
rsp, err := quranService.Chapters(&quran.ChaptersRequest{
|
||||
Language: "en",
|
||||
})
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
12
examples/quran/chapters/node/listChapters.js
Executable file
12
examples/quran/chapters/node/listChapters.js
Executable file
@@ -0,0 +1,12 @@
|
||||
import * as quran from "m3o/quran";
|
||||
|
||||
// List the Chapters (surahs) of the Quran
|
||||
async function ListChapters() {
|
||||
let quranService = new quran.QuranService(process.env.MICRO_API_TOKEN);
|
||||
let rsp = await quranService.chapters({
|
||||
language: "en",
|
||||
});
|
||||
console.log(rsp);
|
||||
}
|
||||
|
||||
await ListChapters();
|
||||
6
examples/quran/search/curl/searchTheQuran.sh
Executable file
6
examples/quran/search/curl/searchTheQuran.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
curl "https://api.m3o.com/v1/quran/Search" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Authorization: Bearer $MICRO_API_TOKEN" \
|
||||
-d '{
|
||||
"query": "messenger"
|
||||
}'
|
||||
16
examples/quran/search/go/searchTheQuran.go
Executable file
16
examples/quran/search/go/searchTheQuran.go
Executable file
@@ -0,0 +1,16 @@
|
||||
package example
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/micro/services/clients/go/quran"
|
||||
"os"
|
||||
)
|
||||
|
||||
// Search the Quran for any form of query or questions
|
||||
func SearchTheQuran() {
|
||||
quranService := quran.NewQuranService(os.Getenv("MICRO_API_TOKEN"))
|
||||
rsp, err := quranService.Search(&quran.SearchRequest{
|
||||
Query: "messenger",
|
||||
})
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
12
examples/quran/search/node/searchTheQuran.js
Executable file
12
examples/quran/search/node/searchTheQuran.js
Executable file
@@ -0,0 +1,12 @@
|
||||
import * as quran from "m3o/quran";
|
||||
|
||||
// Search the Quran for any form of query or questions
|
||||
async function SearchTheQuran() {
|
||||
let quranService = new quran.QuranService(process.env.MICRO_API_TOKEN);
|
||||
let rsp = await quranService.search({
|
||||
query: "messenger",
|
||||
});
|
||||
console.log(rsp);
|
||||
}
|
||||
|
||||
await SearchTheQuran();
|
||||
6
examples/quran/summary/curl/getChapterSummary.sh
Executable file
6
examples/quran/summary/curl/getChapterSummary.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
curl "https://api.m3o.com/v1/quran/Summary" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Authorization: Bearer $MICRO_API_TOKEN" \
|
||||
-d '{
|
||||
"chapter": 1
|
||||
}'
|
||||
16
examples/quran/summary/go/getChapterSummary.go
Executable file
16
examples/quran/summary/go/getChapterSummary.go
Executable file
@@ -0,0 +1,16 @@
|
||||
package example
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/micro/services/clients/go/quran"
|
||||
"os"
|
||||
)
|
||||
|
||||
// Get a summary for a given chapter (surah)
|
||||
func GetChapterSummary() {
|
||||
quranService := quran.NewQuranService(os.Getenv("MICRO_API_TOKEN"))
|
||||
rsp, err := quranService.Summary(&quran.SummaryRequest{
|
||||
Chapter: 1,
|
||||
})
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
12
examples/quran/summary/node/getChapterSummary.js
Executable file
12
examples/quran/summary/node/getChapterSummary.js
Executable file
@@ -0,0 +1,12 @@
|
||||
import * as quran from "m3o/quran";
|
||||
|
||||
// Get a summary for a given chapter (surah)
|
||||
async function GetChapterSummary() {
|
||||
let quranService = new quran.QuranService(process.env.MICRO_API_TOKEN);
|
||||
let rsp = await quranService.summary({
|
||||
chapter: 1,
|
||||
});
|
||||
console.log(rsp);
|
||||
}
|
||||
|
||||
await GetChapterSummary();
|
||||
6
examples/quran/verses/curl/getVersesOfAChapter.sh
Executable file
6
examples/quran/verses/curl/getVersesOfAChapter.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
curl "https://api.m3o.com/v1/quran/Verses" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Authorization: Bearer $MICRO_API_TOKEN" \
|
||||
-d '{
|
||||
"chapter": 1
|
||||
}'
|
||||
16
examples/quran/verses/go/getVersesOfAChapter.go
Executable file
16
examples/quran/verses/go/getVersesOfAChapter.go
Executable file
@@ -0,0 +1,16 @@
|
||||
package example
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/micro/services/clients/go/quran"
|
||||
"os"
|
||||
)
|
||||
|
||||
// Lookup the verses (ayahs) for a chapter
|
||||
func GetVersesOfAchapter() {
|
||||
quranService := quran.NewQuranService(os.Getenv("MICRO_API_TOKEN"))
|
||||
rsp, err := quranService.Verses(&quran.VersesRequest{
|
||||
Chapter: 1,
|
||||
})
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
12
examples/quran/verses/node/getVersesOfAChapter.js
Executable file
12
examples/quran/verses/node/getVersesOfAChapter.js
Executable file
@@ -0,0 +1,12 @@
|
||||
import * as quran from "m3o/quran";
|
||||
|
||||
// Lookup the verses (ayahs) for a chapter
|
||||
async function GetVersesOfAchapter() {
|
||||
let quranService = new quran.QuranService(process.env.MICRO_API_TOKEN);
|
||||
let rsp = await quranService.verses({
|
||||
chapter: 1,
|
||||
});
|
||||
console.log(rsp);
|
||||
}
|
||||
|
||||
await GetVersesOfAchapter();
|
||||
Reference in New Issue
Block a user