From f6a6c065b13c4ef5164680089c11f832057ec65c Mon Sep 17 00:00:00 2001 From: m3o-actions <> Date: Thu, 9 Dec 2021 15:06:12 +0000 Subject: [PATCH] Commit from m3o/m3o action --- .../lookupPostcode/lookupPostcode/main.go | 1 - examples/answer/question/askAQuestion/main.go | 1 - examples/app/reserve/reserveAppName/main.go | 1 - examples/app/vote/voteForTheApi/main.go | 1 - .../cache/decrement/decrementAValue/main.go | 1 - examples/cache/delete/deleteAValue/main.go | 1 - examples/cache/get/getAValue/main.go | 1 - .../cache/increment/incrementAValue/main.go | 1 - examples/cache/set/setAValue/main.go | 1 - examples/crypto/README.md | 112 ++--- .../crypto/history/getPreviousClose/main.go | 1 - .../crypto/news/getCryptocurrencyNews/main.go | 1 - .../price/getCryptocurrencyPrice/main.go | 1 - .../quote/getACryptocurrencyQuote/main.go | 1 - .../currency/codes/getSupportedCodes/main.go | 1 - .../convert/convert10UsdToGbp/main.go | 1 - .../currency/convert/convertUsdToGbp/main.go | 1 - .../history/historicRatesForACurrency/main.go | 1 - .../currency/rates/getRatesForUsd/main.go | 1 - examples/db/README.md | 288 ++++++------- .../db/count/countEntriesInATable/main.go | 1 - examples/db/create/createARecord/main.go | 5 +- examples/db/delete/deleteARecord/main.go | 1 - examples/db/dropTable/dropTable/main.go | 1 - examples/db/listTables/listTables/main.go | 1 - examples/db/read/readRecords/main.go | 1 - examples/db/renameTable/renameTable/main.go | 1 - examples/db/truncate/truncateTable/main.go | 1 - examples/db/update/updateARecord/main.go | 3 +- examples/email/send/sendEmail/main.go | 1 - examples/emoji/find/findEmoji/main.go | 1 - .../emoji/flag/getFlagByCountryCode/main.go | 1 - .../print/printTextIncludingEmoji/main.go | 1 - .../main.go | 1 - examples/evchargers/README.md | 54 +-- .../referenceData/getReferenceData/main.go | 1 - .../search/searchByBoundingBox/main.go | 1 - .../search/searchByLocation/main.go | 1 - .../searchWithFiltersFastChargersOnly/main.go | 1 - .../event/consume/consumeFromATopic/main.go | 1 - examples/event/publish/publishAnEvent/main.go | 1 - .../event/read/readEventsOnATopic/main.go | 1 - examples/file/README.md | 116 +++--- examples/file/delete/deleteFile/main.go | 1 - examples/file/list/listFiles/main.go | 1 - examples/file/read/readFile/main.go | 1 - examples/file/save/saveFile/main.go | 1 - .../forex/history/getPreviousClose/main.go | 1 - examples/forex/price/getAnFxPrice/main.go | 1 - examples/forex/quote/getAFxQuote/main.go | 1 - examples/function/README.md | 54 +-- examples/function/call/callAFunction/main.go | 1 - .../function/delete/deleteAFunction/main.go | 1 - .../function/deploy/deployAFunction/main.go | 1 - .../describe/describeFunctionStatus/main.go | 1 - examples/function/list/listFunctions/main.go | 1 - examples/geocoding/README.md | 58 +-- .../geocoding/lookup/geocodeAnAddress/main.go | 1 - .../reverse/reverseGeocodeLocation/main.go | 1 - examples/gifs/search/search/main.go | 1 - .../google/search/searchForVideos/main.go | 1 - examples/helloworld/README.md | 56 +-- .../call/callTheHelloworldService/main.go | 1 - .../main.go | 1 - .../holidays/countries/listCountries/main.go | 1 - examples/holidays/list/getHolidays/main.go | 1 - .../id/generate/generateABigflakeId/main.go | 1 - examples/id/generate/generateAShortId/main.go | 1 - .../id/generate/generateASnowflakeId/main.go | 1 - .../id/generate/generateAUniqueId/main.go | 1 - .../types/listTheTypesOfIdsAvailable/main.go | 1 - .../main.go | 1 - .../delete/deleteAnUploadedImage/main.go | 1 - .../image/resize/base64ToBase64Image/main.go | 1 - .../base64ToBase64ImageWithCropping/main.go | 1 - .../image/resize/base64ToHostedImage/main.go | 1 - .../uploadABase64ImageToMicrosCdn/main.go | 1 - .../uploadAnImageFromAUrlToMicrosCdn/main.go | 1 - examples/ip/lookup/lookupIpInfo/main.go | 1 - examples/joke/random/getRandomNJokes/main.go | 1 - examples/location/README.md | 72 ++-- .../location/read/getLocationById/main.go | 1 - examples/location/save/saveAnEntity/main.go | 1 - .../search/searchForLocations/main.go | 1 - examples/movie/search/searchForMovies/main.go | 1 - examples/mq/README.md | 66 +-- examples/mq/publish/publishAMessage/main.go | 3 +- .../mq/subscribe/subscribeToATopic/main.go | 1 - .../news/headlines/getNewsHeadlines/main.go | 1 - examples/nft/README.md | 56 +-- examples/nft/assets/getAListOfAssets/main.go | 1 - .../nft/collections/listCollections/main.go | 1 - examples/nft/create/createAnNft/main.go | 1 - examples/notes/README.md | 174 ++++---- examples/notes/create/createANote/main.go | 1 - examples/notes/delete/deleteANote/main.go | 1 - .../notes/events/subscribeToEvents/main.go | 1 - examples/notes/list/listAllNotes/main.go | 1 - examples/notes/read/readANote/main.go | 1 - examples/notes/update/updateANote/main.go | 1 - examples/otp/generate/generateOtp/main.go | 1 - examples/otp/validate/validateOtp/main.go | 1 - .../postcode/lookup/lookupPostcode/main.go | 1 - .../main.go | 1 - .../main.go | 1 - examples/prayer/times/prayerTimes/main.go | 1 - examples/qr/generate/generateAQrCode/main.go | 1 - examples/quran/README.md | 56 +-- examples/quran/chapters/listChapters/main.go | 1 - examples/quran/search/searchTheQuran/main.go | 1 - .../quran/summary/getChapterSummary/main.go | 1 - .../quran/verses/getVersesOfAChapter/main.go | 1 - .../directions/turnByTurnDirections/main.go | 1 - .../routing/eta/etaFromPointAToPointB/main.go | 1 - .../routing/route/gpsPointsForARoute/main.go | 1 - examples/rss/add/addANewFeed/main.go | 1 - examples/rss/feed/readAFeed/main.go | 1 - examples/rss/list/listRssFeeds/main.go | 1 - examples/rss/remove/removeAFeed/main.go | 1 - examples/search/vote/voteForTheApi/main.go | 1 - .../analyze/analyzeAPieceOfText/main.go | 1 - examples/sms/send/sendSms/main.go | 1 - examples/space/create/createAnObject/main.go | 1 - examples/space/delete/deleteAnObject/main.go | 1 - examples/space/head/headAnObject/main.go | 1 - .../space/list/listObjectsWithPrefix/main.go | 1 - examples/space/read/readAnObject/main.go | 1 - examples/space/update/updateAnObject/main.go | 1 - .../spam/classify/classifyAnEmail/main.go | 1 - .../classifyAnEmailUsingTheRawData/main.go | 1 - examples/stock/README.md | 112 ++--- .../stock/history/getHistoricData/main.go | 1 - .../stock/orderBook/orderBookHistory/main.go | 1 - examples/stock/price/getAStockPrice/main.go | 1 - examples/stock/quote/getAStockQuote/main.go | 1 - .../createChannel/createChannel/main.go | 1 - .../stream/listChannels/listChannels/main.go | 1 - .../stream/listMessages/listMessages/main.go | 1 - .../stream/sendMessage/sendMessage/main.go | 1 - examples/sunnah/README.md | 58 +-- .../getTheBooksWithinACollection/main.go | 1 - .../chapters/listTheChaptersInABook/main.go | 1 - .../listAvailableCollections/main.go | 1 - .../hadiths/listTheHadithsInABook/main.go | 1 - .../screenshot/takeScreenshotOfAUrl/main.go | 1 - examples/time/README.md | 54 +-- .../main.go | 1 - .../main.go | 1 - .../twitter/search/searchForTweets/main.go | 1 - .../timeline/getATwitterTimeline/main.go | 1 - .../getTheCurrentGlobalTrendingTopics/main.go | 1 - .../user/getAUsersTwitterProfile/main.go | 1 - examples/url/README.md | 54 +-- .../url/list/listYourShortenedUrls/main.go | 1 - .../main.go | 1 - examples/url/shorten/shortenALongUrl/main.go | 1 - examples/user/README.md | 388 +++++++++--------- examples/user/create/createAnAccount/main.go | 1 - .../user/delete/deleteUserAccount/main.go | 1 - examples/user/list/listAllUsers/main.go | 1 - examples/user/login/logAUserIn/main.go | 1 - examples/user/logout/logAUserOut/main.go | 1 - examples/user/read/readAccountByEmail/main.go | 1 - .../read/readAccountByUsernameOrEmail/main.go | 1 - examples/user/read/readAnAccountById/main.go | 1 - .../readASessionByTheSessionId/main.go | 1 - .../user/resetPassword/resetPassword/main.go | 1 - .../sendPasswordResetEmail/main.go | 1 - .../sendVerificationEmail/main.go | 1 - examples/user/update/updateAnAccount/main.go | 1 - .../updateTheAccountPassword/main.go | 1 - examples/user/verifyEmail/verifyEmail/main.go | 1 - examples/vehicle/lookup/lookupVehicle/main.go | 1 - .../weather/forecast/forecastWeather/main.go | 1 - .../weather/now/getCurrentWeather/main.go | 1 - .../youtube/search/searchForVideos/main.go | 1 - 176 files changed, 918 insertions(+), 1077 deletions(-) diff --git a/examples/address/lookupPostcode/lookupPostcode/main.go b/examples/address/lookupPostcode/lookupPostcode/main.go index 2bbb521..f1e2135 100755 --- a/examples/address/lookupPostcode/lookupPostcode/main.go +++ b/examples/address/lookupPostcode/lookupPostcode/main.go @@ -14,5 +14,4 @@ func main() { Postcode: "SW1A 2AA", }) fmt.Println(rsp, err) - } diff --git a/examples/answer/question/askAQuestion/main.go b/examples/answer/question/askAQuestion/main.go index 1a19218..48f6322 100755 --- a/examples/answer/question/askAQuestion/main.go +++ b/examples/answer/question/askAQuestion/main.go @@ -14,5 +14,4 @@ func main() { Query: "microsoft", }) fmt.Println(rsp, err) - } diff --git a/examples/app/reserve/reserveAppName/main.go b/examples/app/reserve/reserveAppName/main.go index c8d1e76..2cb5156 100755 --- a/examples/app/reserve/reserveAppName/main.go +++ b/examples/app/reserve/reserveAppName/main.go @@ -14,5 +14,4 @@ func main() { Name: "helloworld", }) fmt.Println(rsp, err) - } diff --git a/examples/app/vote/voteForTheApi/main.go b/examples/app/vote/voteForTheApi/main.go index edb5e70..09064e3 100755 --- a/examples/app/vote/voteForTheApi/main.go +++ b/examples/app/vote/voteForTheApi/main.go @@ -14,5 +14,4 @@ func main() { Message: "Launch it!", }) fmt.Println(rsp, err) - } diff --git a/examples/cache/decrement/decrementAValue/main.go b/examples/cache/decrement/decrementAValue/main.go index ed3d078..ed25786 100755 --- a/examples/cache/decrement/decrementAValue/main.go +++ b/examples/cache/decrement/decrementAValue/main.go @@ -15,5 +15,4 @@ func main() { Value: 2, }) fmt.Println(rsp, err) - } diff --git a/examples/cache/delete/deleteAValue/main.go b/examples/cache/delete/deleteAValue/main.go index b5aff23..b36bb01 100755 --- a/examples/cache/delete/deleteAValue/main.go +++ b/examples/cache/delete/deleteAValue/main.go @@ -14,5 +14,4 @@ func main() { Key: "foo", }) fmt.Println(rsp, err) - } diff --git a/examples/cache/get/getAValue/main.go b/examples/cache/get/getAValue/main.go index 9f99299..4eb45f6 100755 --- a/examples/cache/get/getAValue/main.go +++ b/examples/cache/get/getAValue/main.go @@ -14,5 +14,4 @@ func main() { Key: "foo", }) fmt.Println(rsp, err) - } diff --git a/examples/cache/increment/incrementAValue/main.go b/examples/cache/increment/incrementAValue/main.go index c7852f4..0444c51 100755 --- a/examples/cache/increment/incrementAValue/main.go +++ b/examples/cache/increment/incrementAValue/main.go @@ -15,5 +15,4 @@ func main() { Value: 2, }) fmt.Println(rsp, err) - } diff --git a/examples/cache/set/setAValue/main.go b/examples/cache/set/setAValue/main.go index d589106..de832c1 100755 --- a/examples/cache/set/setAValue/main.go +++ b/examples/cache/set/setAValue/main.go @@ -15,5 +15,4 @@ func main() { Value: "bar", }) fmt.Println(rsp, err) - } diff --git a/examples/crypto/README.md b/examples/crypto/README.md index ce76fc8..b836e92 100755 --- a/examples/crypto/README.md +++ b/examples/crypto/README.md @@ -4,62 +4,6 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/Crypto/api](ht Endpoints: -## Quote - -Get the last quote for a given crypto ticker - - -[https://m3o.com/crypto/api#Quote](https://m3o.com/crypto/api#Quote) - -```go -package example - -import( - "fmt" - "os" - - "go.m3o.com/crypto" -) - -// Get the last quote for a given crypto ticker -func GetAcryptocurrencyQuote() { - cryptoService := crypto.NewCryptoService(os.Getenv("M3O_API_TOKEN")) - rsp, err := cryptoService.Quote(&crypto.QuoteRequest{ - Symbol: "BTCUSD", - - }) - fmt.Println(rsp, err) - -} -``` -## History - -Returns the history for the previous close - - -[https://m3o.com/crypto/api#History](https://m3o.com/crypto/api#History) - -```go -package example - -import( - "fmt" - "os" - - "go.m3o.com/crypto" -) - -// Returns the history for the previous close -func GetPreviousClose() { - cryptoService := crypto.NewCryptoService(os.Getenv("M3O_API_TOKEN")) - rsp, err := cryptoService.History(&crypto.HistoryRequest{ - Symbol: "BTCUSD", - - }) - fmt.Println(rsp, err) - -} -``` ## News Get news related to a currency @@ -116,3 +60,59 @@ func GetCryptocurrencyPrice() { } ``` +## Quote + +Get the last quote for a given crypto ticker + + +[https://m3o.com/crypto/api#Quote](https://m3o.com/crypto/api#Quote) + +```go +package example + +import( + "fmt" + "os" + + "go.m3o.com/crypto" +) + +// Get the last quote for a given crypto ticker +func GetAcryptocurrencyQuote() { + cryptoService := crypto.NewCryptoService(os.Getenv("M3O_API_TOKEN")) + rsp, err := cryptoService.Quote(&crypto.QuoteRequest{ + Symbol: "BTCUSD", + + }) + fmt.Println(rsp, err) + +} +``` +## History + +Returns the history for the previous close + + +[https://m3o.com/crypto/api#History](https://m3o.com/crypto/api#History) + +```go +package example + +import( + "fmt" + "os" + + "go.m3o.com/crypto" +) + +// Returns the history for the previous close +func GetPreviousClose() { + cryptoService := crypto.NewCryptoService(os.Getenv("M3O_API_TOKEN")) + rsp, err := cryptoService.History(&crypto.HistoryRequest{ + Symbol: "BTCUSD", + + }) + fmt.Println(rsp, err) + +} +``` diff --git a/examples/crypto/history/getPreviousClose/main.go b/examples/crypto/history/getPreviousClose/main.go index ae800f9..3edca22 100755 --- a/examples/crypto/history/getPreviousClose/main.go +++ b/examples/crypto/history/getPreviousClose/main.go @@ -14,5 +14,4 @@ func main() { Symbol: "BTCUSD", }) fmt.Println(rsp, err) - } diff --git a/examples/crypto/news/getCryptocurrencyNews/main.go b/examples/crypto/news/getCryptocurrencyNews/main.go index 8976ac6..af5412c 100755 --- a/examples/crypto/news/getCryptocurrencyNews/main.go +++ b/examples/crypto/news/getCryptocurrencyNews/main.go @@ -14,5 +14,4 @@ func main() { Symbol: "BTCUSD", }) fmt.Println(rsp, err) - } diff --git a/examples/crypto/price/getCryptocurrencyPrice/main.go b/examples/crypto/price/getCryptocurrencyPrice/main.go index 1dea531..4bba4fe 100755 --- a/examples/crypto/price/getCryptocurrencyPrice/main.go +++ b/examples/crypto/price/getCryptocurrencyPrice/main.go @@ -14,5 +14,4 @@ func main() { Symbol: "BTCUSD", }) fmt.Println(rsp, err) - } diff --git a/examples/crypto/quote/getACryptocurrencyQuote/main.go b/examples/crypto/quote/getACryptocurrencyQuote/main.go index 4714abc..464fce7 100755 --- a/examples/crypto/quote/getACryptocurrencyQuote/main.go +++ b/examples/crypto/quote/getACryptocurrencyQuote/main.go @@ -14,5 +14,4 @@ func main() { Symbol: "BTCUSD", }) fmt.Println(rsp, err) - } diff --git a/examples/currency/codes/getSupportedCodes/main.go b/examples/currency/codes/getSupportedCodes/main.go index 1e9f1d2..17d658e 100755 --- a/examples/currency/codes/getSupportedCodes/main.go +++ b/examples/currency/codes/getSupportedCodes/main.go @@ -12,5 +12,4 @@ func main() { currencyService := currency.NewCurrencyService(os.Getenv("M3O_API_TOKEN")) rsp, err := currencyService.Codes(¤cy.CodesRequest{}) fmt.Println(rsp, err) - } diff --git a/examples/currency/convert/convert10UsdToGbp/main.go b/examples/currency/convert/convert10UsdToGbp/main.go index c7f2227..75aa7b5 100755 --- a/examples/currency/convert/convert10UsdToGbp/main.go +++ b/examples/currency/convert/convert10UsdToGbp/main.go @@ -16,5 +16,4 @@ func main() { To: "GBP", }) fmt.Println(rsp, err) - } diff --git a/examples/currency/convert/convertUsdToGbp/main.go b/examples/currency/convert/convertUsdToGbp/main.go index 4ad634a..2a87d8d 100755 --- a/examples/currency/convert/convertUsdToGbp/main.go +++ b/examples/currency/convert/convertUsdToGbp/main.go @@ -15,5 +15,4 @@ func main() { To: "GBP", }) fmt.Println(rsp, err) - } diff --git a/examples/currency/history/historicRatesForACurrency/main.go b/examples/currency/history/historicRatesForACurrency/main.go index 6643c7a..1a6de42 100755 --- a/examples/currency/history/historicRatesForACurrency/main.go +++ b/examples/currency/history/historicRatesForACurrency/main.go @@ -15,5 +15,4 @@ func main() { Date: "2021-05-30", }) fmt.Println(rsp, err) - } diff --git a/examples/currency/rates/getRatesForUsd/main.go b/examples/currency/rates/getRatesForUsd/main.go index b2d1bb3..5d86627 100755 --- a/examples/currency/rates/getRatesForUsd/main.go +++ b/examples/currency/rates/getRatesForUsd/main.go @@ -14,5 +14,4 @@ func main() { Code: "USD", }) fmt.Println(rsp, err) - } diff --git a/examples/db/README.md b/examples/db/README.md index e4ee868..0335272 100755 --- a/examples/db/README.md +++ b/examples/db/README.md @@ -4,6 +4,118 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/Db/api](https: Endpoints: +## DropTable + +Drop a table in the DB + + +[https://m3o.com/db/api#DropTable](https://m3o.com/db/api#DropTable) + +```go +package example + +import( + "fmt" + "os" + + "go.m3o.com/db" +) + +// Drop a table in the DB +func DropTable() { + dbService := db.NewDbService(os.Getenv("M3O_API_TOKEN")) + rsp, err := dbService.DropTable(&db.DropTableRequest{ + Table: "example", + + }) + fmt.Println(rsp, err) + +} +``` +## Count + +Count records in a table + + +[https://m3o.com/db/api#Count](https://m3o.com/db/api#Count) + +```go +package example + +import( + "fmt" + "os" + + "go.m3o.com/db" +) + +// Count records in a table +func CountEntriesInAtable() { + dbService := db.NewDbService(os.Getenv("M3O_API_TOKEN")) + rsp, err := dbService.Count(&db.CountRequest{ + Table: "example", + + }) + fmt.Println(rsp, err) + +} +``` +## ListTables + +List tables in the DB + + +[https://m3o.com/db/api#ListTables](https://m3o.com/db/api#ListTables) + +```go +package example + +import( + "fmt" + "os" + + "go.m3o.com/db" +) + +// List tables in the DB +func ListTables() { + dbService := db.NewDbService(os.Getenv("M3O_API_TOKEN")) + rsp, err := dbService.ListTables(&db.ListTablesRequest{ + + }) + fmt.Println(rsp, err) + +} +``` +## RenameTable + +Rename a table + + +[https://m3o.com/db/api#RenameTable](https://m3o.com/db/api#RenameTable) + +```go +package example + +import( + "fmt" + "os" + + "go.m3o.com/db" +) + +// Rename a table +func RenameTable() { + dbService := db.NewDbService(os.Getenv("M3O_API_TOKEN")) + rsp, err := dbService.RenameTable(&db.RenameTableRequest{ + From: "examples2", +To: "examples3", + + }) + fmt.Println(rsp, err) + +} +``` ## Create Create a record in the database. Optionally include an "id" field otherwise it's set automatically. @@ -36,6 +148,38 @@ Table: "example", }) fmt.Println(rsp, err) +} +``` +## Update + +Update a record in the database. Include an "id" in the record to update. + + +[https://m3o.com/db/api#Update](https://m3o.com/db/api#Update) + +```go +package example + +import( + "fmt" + "os" + + "go.m3o.com/db" +) + +// Update a record in the database. Include an "id" in the record to update. +func UpdateArecord() { + dbService := db.NewDbService(os.Getenv("M3O_API_TOKEN")) + rsp, err := dbService.Update(&db.UpdateRequest{ + Record: map[string]interface{}{ + "id": "1", + "age": 43, +}, +Table: "example", + + }) + fmt.Println(rsp, err) + } ``` ## Read @@ -124,147 +268,3 @@ func TruncateTable() { } ``` -## DropTable - -Drop a table in the DB - - -[https://m3o.com/db/api#DropTable](https://m3o.com/db/api#DropTable) - -```go -package example - -import( - "fmt" - "os" - - "go.m3o.com/db" -) - -// Drop a table in the DB -func DropTable() { - dbService := db.NewDbService(os.Getenv("M3O_API_TOKEN")) - rsp, err := dbService.DropTable(&db.DropTableRequest{ - Table: "example", - - }) - fmt.Println(rsp, err) - -} -``` -## ListTables - -List tables in the DB - - -[https://m3o.com/db/api#ListTables](https://m3o.com/db/api#ListTables) - -```go -package example - -import( - "fmt" - "os" - - "go.m3o.com/db" -) - -// List tables in the DB -func ListTables() { - dbService := db.NewDbService(os.Getenv("M3O_API_TOKEN")) - rsp, err := dbService.ListTables(&db.ListTablesRequest{ - - }) - fmt.Println(rsp, err) - -} -``` -## RenameTable - -Rename a table - - -[https://m3o.com/db/api#RenameTable](https://m3o.com/db/api#RenameTable) - -```go -package example - -import( - "fmt" - "os" - - "go.m3o.com/db" -) - -// Rename a table -func RenameTable() { - dbService := db.NewDbService(os.Getenv("M3O_API_TOKEN")) - rsp, err := dbService.RenameTable(&db.RenameTableRequest{ - From: "examples2", -To: "examples3", - - }) - fmt.Println(rsp, err) - -} -``` -## Update - -Update a record in the database. Include an "id" in the record to update. - - -[https://m3o.com/db/api#Update](https://m3o.com/db/api#Update) - -```go -package example - -import( - "fmt" - "os" - - "go.m3o.com/db" -) - -// Update a record in the database. Include an "id" in the record to update. -func UpdateArecord() { - dbService := db.NewDbService(os.Getenv("M3O_API_TOKEN")) - rsp, err := dbService.Update(&db.UpdateRequest{ - Record: map[string]interface{}{ - "id": "1", - "age": 43, -}, -Table: "example", - - }) - fmt.Println(rsp, err) - -} -``` -## Count - -Count records in a table - - -[https://m3o.com/db/api#Count](https://m3o.com/db/api#Count) - -```go -package example - -import( - "fmt" - "os" - - "go.m3o.com/db" -) - -// Count records in a table -func CountEntriesInAtable() { - dbService := db.NewDbService(os.Getenv("M3O_API_TOKEN")) - rsp, err := dbService.Count(&db.CountRequest{ - Table: "example", - - }) - fmt.Println(rsp, err) - -} -``` diff --git a/examples/db/count/countEntriesInATable/main.go b/examples/db/count/countEntriesInATable/main.go index 45624d4..3e482dc 100755 --- a/examples/db/count/countEntriesInATable/main.go +++ b/examples/db/count/countEntriesInATable/main.go @@ -14,5 +14,4 @@ func main() { Table: "example", }) fmt.Println(rsp, err) - } diff --git a/examples/db/create/createARecord/main.go b/examples/db/create/createARecord/main.go index 025221b..0e113b7 100755 --- a/examples/db/create/createARecord/main.go +++ b/examples/db/create/createARecord/main.go @@ -12,13 +12,12 @@ func main() { dbService := db.NewDbService(os.Getenv("M3O_API_TOKEN")) rsp, err := dbService.Create(&db.CreateRequest{ Record: map[string]interface{}{ - "name": "Jane", - "age": 42, "isActive": true, "id": "1", + "name": "Jane", + "age": 42, }, Table: "example", }) fmt.Println(rsp, err) - } diff --git a/examples/db/delete/deleteARecord/main.go b/examples/db/delete/deleteARecord/main.go index 5614d31..d0d2215 100755 --- a/examples/db/delete/deleteARecord/main.go +++ b/examples/db/delete/deleteARecord/main.go @@ -15,5 +15,4 @@ func main() { Table: "example", }) fmt.Println(rsp, err) - } diff --git a/examples/db/dropTable/dropTable/main.go b/examples/db/dropTable/dropTable/main.go index 70bc6c8..065efce 100755 --- a/examples/db/dropTable/dropTable/main.go +++ b/examples/db/dropTable/dropTable/main.go @@ -14,5 +14,4 @@ func main() { Table: "example", }) fmt.Println(rsp, err) - } diff --git a/examples/db/listTables/listTables/main.go b/examples/db/listTables/listTables/main.go index ceab86e..34e7341 100755 --- a/examples/db/listTables/listTables/main.go +++ b/examples/db/listTables/listTables/main.go @@ -12,5 +12,4 @@ func main() { dbService := db.NewDbService(os.Getenv("M3O_API_TOKEN")) rsp, err := dbService.ListTables(&db.ListTablesRequest{}) fmt.Println(rsp, err) - } diff --git a/examples/db/read/readRecords/main.go b/examples/db/read/readRecords/main.go index 6e77572..0f5a6e1 100755 --- a/examples/db/read/readRecords/main.go +++ b/examples/db/read/readRecords/main.go @@ -15,5 +15,4 @@ func main() { Table: "example", }) fmt.Println(rsp, err) - } diff --git a/examples/db/renameTable/renameTable/main.go b/examples/db/renameTable/renameTable/main.go index 74b24ef..d788796 100755 --- a/examples/db/renameTable/renameTable/main.go +++ b/examples/db/renameTable/renameTable/main.go @@ -15,5 +15,4 @@ func main() { To: "examples3", }) fmt.Println(rsp, err) - } diff --git a/examples/db/truncate/truncateTable/main.go b/examples/db/truncate/truncateTable/main.go index 94076fa..70378ac 100755 --- a/examples/db/truncate/truncateTable/main.go +++ b/examples/db/truncate/truncateTable/main.go @@ -14,5 +14,4 @@ func main() { Table: "example", }) fmt.Println(rsp, err) - } diff --git a/examples/db/update/updateARecord/main.go b/examples/db/update/updateARecord/main.go index e6fdba0..f14eea3 100755 --- a/examples/db/update/updateARecord/main.go +++ b/examples/db/update/updateARecord/main.go @@ -12,11 +12,10 @@ func main() { dbService := db.NewDbService(os.Getenv("M3O_API_TOKEN")) rsp, err := dbService.Update(&db.UpdateRequest{ Record: map[string]interface{}{ - "age": 43, "id": "1", + "age": 43, }, Table: "example", }) fmt.Println(rsp, err) - } diff --git a/examples/email/send/sendEmail/main.go b/examples/email/send/sendEmail/main.go index 48a6d31..51a86b4 100755 --- a/examples/email/send/sendEmail/main.go +++ b/examples/email/send/sendEmail/main.go @@ -18,5 +18,4 @@ func main() { Please verify your email by clicking this link: $micro_verification_link`, }) fmt.Println(rsp, err) - } diff --git a/examples/emoji/find/findEmoji/main.go b/examples/emoji/find/findEmoji/main.go index 4e3557e..941278e 100755 --- a/examples/emoji/find/findEmoji/main.go +++ b/examples/emoji/find/findEmoji/main.go @@ -14,5 +14,4 @@ func main() { Alias: ":beer:", }) fmt.Println(rsp, err) - } diff --git a/examples/emoji/flag/getFlagByCountryCode/main.go b/examples/emoji/flag/getFlagByCountryCode/main.go index e9955b0..d8d302e 100755 --- a/examples/emoji/flag/getFlagByCountryCode/main.go +++ b/examples/emoji/flag/getFlagByCountryCode/main.go @@ -12,5 +12,4 @@ func main() { emojiService := emoji.NewEmojiService(os.Getenv("M3O_API_TOKEN")) rsp, err := emojiService.Flag(&emoji.FlagRequest{}) fmt.Println(rsp, err) - } diff --git a/examples/emoji/print/printTextIncludingEmoji/main.go b/examples/emoji/print/printTextIncludingEmoji/main.go index c88e66f..ed604d7 100755 --- a/examples/emoji/print/printTextIncludingEmoji/main.go +++ b/examples/emoji/print/printTextIncludingEmoji/main.go @@ -15,5 +15,4 @@ func main() { Text: "let's grab a :beer:", }) fmt.Println(rsp, err) - } diff --git a/examples/emoji/send/sendATextContainingAnEmojiToAnyoneViaSms/main.go b/examples/emoji/send/sendATextContainingAnEmojiToAnyoneViaSms/main.go index 74b84e7..459dde3 100755 --- a/examples/emoji/send/sendATextContainingAnEmojiToAnyoneViaSms/main.go +++ b/examples/emoji/send/sendATextContainingAnEmojiToAnyoneViaSms/main.go @@ -16,5 +16,4 @@ func main() { To: "+44782669123", }) fmt.Println(rsp, err) - } diff --git a/examples/evchargers/README.md b/examples/evchargers/README.md index 5aa9e11..335b9e3 100755 --- a/examples/evchargers/README.md +++ b/examples/evchargers/README.md @@ -4,33 +4,6 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/Evchargers/api Endpoints: -## ReferenceData - -Retrieve reference data as used by this API and in conjunction with the Search endpoint - - -[https://m3o.com/evchargers/api#ReferenceData](https://m3o.com/evchargers/api#ReferenceData) - -```go -package example - -import( - "fmt" - "os" - - "go.m3o.com/evchargers" -) - -// Retrieve reference data as used by this API and in conjunction with the Search endpoint -func GetReferenceData() { - evchargersService := evchargers.NewEvchargersService(os.Getenv("M3O_API_TOKEN")) - rsp, err := evchargersService.ReferenceData(&evchargers.ReferenceDataRequest{ - - }) - fmt.Println(rsp, err) - -} -``` ## Search Search by giving a coordinate and a max distance, or bounding box and optional filters @@ -125,3 +98,30 @@ Location: &evchargers.Coordinates{ } ``` +## ReferenceData + +Retrieve reference data as used by this API and in conjunction with the Search endpoint + + +[https://m3o.com/evchargers/api#ReferenceData](https://m3o.com/evchargers/api#ReferenceData) + +```go +package example + +import( + "fmt" + "os" + + "go.m3o.com/evchargers" +) + +// Retrieve reference data as used by this API and in conjunction with the Search endpoint +func GetReferenceData() { + evchargersService := evchargers.NewEvchargersService(os.Getenv("M3O_API_TOKEN")) + rsp, err := evchargersService.ReferenceData(&evchargers.ReferenceDataRequest{ + + }) + fmt.Println(rsp, err) + +} +``` diff --git a/examples/evchargers/referenceData/getReferenceData/main.go b/examples/evchargers/referenceData/getReferenceData/main.go index ff34397..5860273 100755 --- a/examples/evchargers/referenceData/getReferenceData/main.go +++ b/examples/evchargers/referenceData/getReferenceData/main.go @@ -12,5 +12,4 @@ func main() { evchargersService := evchargers.NewEvchargersService(os.Getenv("M3O_API_TOKEN")) rsp, err := evchargersService.ReferenceData(&evchargers.ReferenceDataRequest{}) fmt.Println(rsp, err) - } diff --git a/examples/evchargers/search/searchByBoundingBox/main.go b/examples/evchargers/search/searchByBoundingBox/main.go index f6ba190..ec4095f 100755 --- a/examples/evchargers/search/searchByBoundingBox/main.go +++ b/examples/evchargers/search/searchByBoundingBox/main.go @@ -14,5 +14,4 @@ func main() { Box: &evchargers.BoundingBox{}, }) fmt.Println(rsp, err) - } diff --git a/examples/evchargers/search/searchByLocation/main.go b/examples/evchargers/search/searchByLocation/main.go index 9ec143e..1bcc6eb 100755 --- a/examples/evchargers/search/searchByLocation/main.go +++ b/examples/evchargers/search/searchByLocation/main.go @@ -18,5 +18,4 @@ func main() { }, }) fmt.Println(rsp, err) - } diff --git a/examples/evchargers/search/searchWithFiltersFastChargersOnly/main.go b/examples/evchargers/search/searchWithFiltersFastChargersOnly/main.go index 7dd30d5..b35f129 100755 --- a/examples/evchargers/search/searchWithFiltersFastChargersOnly/main.go +++ b/examples/evchargers/search/searchWithFiltersFastChargersOnly/main.go @@ -19,5 +19,4 @@ func main() { }, }) fmt.Println(rsp, err) - } diff --git a/examples/event/consume/consumeFromATopic/main.go b/examples/event/consume/consumeFromATopic/main.go index 35a0ab7..e2a5317 100755 --- a/examples/event/consume/consumeFromATopic/main.go +++ b/examples/event/consume/consumeFromATopic/main.go @@ -10,7 +10,6 @@ import ( // Consume events from a given topic. func main() { eventService := event.NewEventService(os.Getenv("M3O_API_TOKEN")) - stream, err := eventService.Consume(&event.ConsumeRequest{ Topic: "user", }) diff --git a/examples/event/publish/publishAnEvent/main.go b/examples/event/publish/publishAnEvent/main.go index 49e4e18..287af64 100755 --- a/examples/event/publish/publishAnEvent/main.go +++ b/examples/event/publish/publishAnEvent/main.go @@ -19,5 +19,4 @@ func main() { Topic: "user", }) fmt.Println(rsp, err) - } diff --git a/examples/event/read/readEventsOnATopic/main.go b/examples/event/read/readEventsOnATopic/main.go index 831db83..3d0e67a 100755 --- a/examples/event/read/readEventsOnATopic/main.go +++ b/examples/event/read/readEventsOnATopic/main.go @@ -14,5 +14,4 @@ func main() { Topic: "user", }) fmt.Println(rsp, err) - } diff --git a/examples/file/README.md b/examples/file/README.md index 6b3ff5e..f07c5f3 100755 --- a/examples/file/README.md +++ b/examples/file/README.md @@ -4,6 +4,64 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/File/api](http Endpoints: +## Delete + +Delete a file by project name/path + + +[https://m3o.com/file/api#Delete](https://m3o.com/file/api#Delete) + +```go +package example + +import( + "fmt" + "os" + + "go.m3o.com/file" +) + +// Delete a file by project name/path +func DeleteFile() { + fileService := file.NewFileService(os.Getenv("M3O_API_TOKEN")) + rsp, err := fileService.Delete(&file.DeleteRequest{ + Path: "/document/text-files/file.txt", +Project: "examples", + + }) + fmt.Println(rsp, err) + +} +``` +## Read + +Read a file by path + + +[https://m3o.com/file/api#Read](https://m3o.com/file/api#Read) + +```go +package example + +import( + "fmt" + "os" + + "go.m3o.com/file" +) + +// Read a file by path +func ReadFile() { + fileService := file.NewFileService(os.Getenv("M3O_API_TOKEN")) + rsp, err := fileService.Read(&file.ReadRequest{ + Path: "/document/text-files/file.txt", +Project: "examples", + + }) + fmt.Println(rsp, err) + +} +``` ## Save Save a file @@ -64,61 +122,3 @@ func ListFiles() { } ``` -## Delete - -Delete a file by project name/path - - -[https://m3o.com/file/api#Delete](https://m3o.com/file/api#Delete) - -```go -package example - -import( - "fmt" - "os" - - "go.m3o.com/file" -) - -// Delete a file by project name/path -func DeleteFile() { - fileService := file.NewFileService(os.Getenv("M3O_API_TOKEN")) - rsp, err := fileService.Delete(&file.DeleteRequest{ - Path: "/document/text-files/file.txt", -Project: "examples", - - }) - fmt.Println(rsp, err) - -} -``` -## Read - -Read a file by path - - -[https://m3o.com/file/api#Read](https://m3o.com/file/api#Read) - -```go -package example - -import( - "fmt" - "os" - - "go.m3o.com/file" -) - -// Read a file by path -func ReadFile() { - fileService := file.NewFileService(os.Getenv("M3O_API_TOKEN")) - rsp, err := fileService.Read(&file.ReadRequest{ - Path: "/document/text-files/file.txt", -Project: "examples", - - }) - fmt.Println(rsp, err) - -} -``` diff --git a/examples/file/delete/deleteFile/main.go b/examples/file/delete/deleteFile/main.go index 90ef85a..841ed3b 100755 --- a/examples/file/delete/deleteFile/main.go +++ b/examples/file/delete/deleteFile/main.go @@ -15,5 +15,4 @@ func main() { Project: "examples", }) fmt.Println(rsp, err) - } diff --git a/examples/file/list/listFiles/main.go b/examples/file/list/listFiles/main.go index fd56a41..cbc502c 100755 --- a/examples/file/list/listFiles/main.go +++ b/examples/file/list/listFiles/main.go @@ -14,5 +14,4 @@ func main() { Project: "examples", }) fmt.Println(rsp, err) - } diff --git a/examples/file/read/readFile/main.go b/examples/file/read/readFile/main.go index 9a5dce4..a64f84c 100755 --- a/examples/file/read/readFile/main.go +++ b/examples/file/read/readFile/main.go @@ -15,5 +15,4 @@ func main() { Project: "examples", }) fmt.Println(rsp, err) - } diff --git a/examples/file/save/saveFile/main.go b/examples/file/save/saveFile/main.go index 16ba9bd..178b924 100755 --- a/examples/file/save/saveFile/main.go +++ b/examples/file/save/saveFile/main.go @@ -18,5 +18,4 @@ func main() { }, }) fmt.Println(rsp, err) - } diff --git a/examples/forex/history/getPreviousClose/main.go b/examples/forex/history/getPreviousClose/main.go index d50b774..63da6aa 100755 --- a/examples/forex/history/getPreviousClose/main.go +++ b/examples/forex/history/getPreviousClose/main.go @@ -14,5 +14,4 @@ func main() { Symbol: "GBPUSD", }) fmt.Println(rsp, err) - } diff --git a/examples/forex/price/getAnFxPrice/main.go b/examples/forex/price/getAnFxPrice/main.go index a0de2fa..291f0ae 100755 --- a/examples/forex/price/getAnFxPrice/main.go +++ b/examples/forex/price/getAnFxPrice/main.go @@ -14,5 +14,4 @@ func main() { Symbol: "GBPUSD", }) fmt.Println(rsp, err) - } diff --git a/examples/forex/quote/getAFxQuote/main.go b/examples/forex/quote/getAFxQuote/main.go index 1a1430c..3dc6e99 100755 --- a/examples/forex/quote/getAFxQuote/main.go +++ b/examples/forex/quote/getAFxQuote/main.go @@ -14,5 +14,4 @@ func main() { Symbol: "GBPUSD", }) fmt.Println(rsp, err) - } diff --git a/examples/function/README.md b/examples/function/README.md index 88380c1..0cf9bd4 100755 --- a/examples/function/README.md +++ b/examples/function/README.md @@ -4,33 +4,6 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/Function/api]( Endpoints: -## List - -List all the deployed functions - - -[https://m3o.com/function/api#List](https://m3o.com/function/api#List) - -```go -package example - -import( - "fmt" - "os" - - "go.m3o.com/function" -) - -// List all the deployed functions -func ListFunctions() { - functionService := function.NewFunctionService(os.Getenv("M3O_API_TOKEN")) - rsp, err := functionService.List(&function.ListRequest{ - - }) - fmt.Println(rsp, err) - -} -``` ## Delete Delete a function by name @@ -148,3 +121,30 @@ Request: map[string]interface{}{ } ``` +## List + +List all the deployed functions + + +[https://m3o.com/function/api#List](https://m3o.com/function/api#List) + +```go +package example + +import( + "fmt" + "os" + + "go.m3o.com/function" +) + +// List all the deployed functions +func ListFunctions() { + functionService := function.NewFunctionService(os.Getenv("M3O_API_TOKEN")) + rsp, err := functionService.List(&function.ListRequest{ + + }) + fmt.Println(rsp, err) + +} +``` diff --git a/examples/function/call/callAFunction/main.go b/examples/function/call/callAFunction/main.go index e0144ae..6a91181 100755 --- a/examples/function/call/callAFunction/main.go +++ b/examples/function/call/callAFunction/main.go @@ -15,5 +15,4 @@ func main() { Request: map[string]interface{}{}, }) fmt.Println(rsp, err) - } diff --git a/examples/function/delete/deleteAFunction/main.go b/examples/function/delete/deleteAFunction/main.go index de3a5ad..be8f665 100755 --- a/examples/function/delete/deleteAFunction/main.go +++ b/examples/function/delete/deleteAFunction/main.go @@ -14,5 +14,4 @@ func main() { Name: "helloworld", }) fmt.Println(rsp, err) - } diff --git a/examples/function/deploy/deployAFunction/main.go b/examples/function/deploy/deployAFunction/main.go index 19f423d..0c2130d 100755 --- a/examples/function/deploy/deployAFunction/main.go +++ b/examples/function/deploy/deployAFunction/main.go @@ -17,5 +17,4 @@ func main() { Runtime: "nodejs14", }) fmt.Println(rsp, err) - } diff --git a/examples/function/describe/describeFunctionStatus/main.go b/examples/function/describe/describeFunctionStatus/main.go index 6eb149c..f35472d 100755 --- a/examples/function/describe/describeFunctionStatus/main.go +++ b/examples/function/describe/describeFunctionStatus/main.go @@ -14,5 +14,4 @@ func main() { Name: "helloworld", }) fmt.Println(rsp, err) - } diff --git a/examples/function/list/listFunctions/main.go b/examples/function/list/listFunctions/main.go index 38aeb6e..109cd6a 100755 --- a/examples/function/list/listFunctions/main.go +++ b/examples/function/list/listFunctions/main.go @@ -12,5 +12,4 @@ func main() { functionService := function.NewFunctionService(os.Getenv("M3O_API_TOKEN")) rsp, err := functionService.List(&function.ListRequest{}) fmt.Println(rsp, err) - } diff --git a/examples/geocoding/README.md b/examples/geocoding/README.md index ad1daf9..3ee6de8 100755 --- a/examples/geocoding/README.md +++ b/examples/geocoding/README.md @@ -4,6 +4,35 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/Geocoding/api] Endpoints: +## Reverse + +Reverse lookup an address from gps coordinates + + +[https://m3o.com/geocoding/api#Reverse](https://m3o.com/geocoding/api#Reverse) + +```go +package example + +import( + "fmt" + "os" + + "go.m3o.com/geocoding" +) + +// Reverse lookup an address from gps coordinates +func ReverseGeocodeLocation() { + geocodingService := geocoding.NewGeocodingService(os.Getenv("M3O_API_TOKEN")) + rsp, err := geocodingService.Reverse(&geocoding.ReverseRequest{ + Latitude: 51.5123064, +Longitude: -0.1216235, + + }) + fmt.Println(rsp, err) + +} +``` ## Lookup Lookup returns a geocoded address including normalized address and gps coordinates. All fields are optional, provide more to get more accurate results @@ -35,32 +64,3 @@ Postcode: "wc2b", } ``` -## Reverse - -Reverse lookup an address from gps coordinates - - -[https://m3o.com/geocoding/api#Reverse](https://m3o.com/geocoding/api#Reverse) - -```go -package example - -import( - "fmt" - "os" - - "go.m3o.com/geocoding" -) - -// Reverse lookup an address from gps coordinates -func ReverseGeocodeLocation() { - geocodingService := geocoding.NewGeocodingService(os.Getenv("M3O_API_TOKEN")) - rsp, err := geocodingService.Reverse(&geocoding.ReverseRequest{ - Latitude: 51.5123064, -Longitude: -0.1216235, - - }) - fmt.Println(rsp, err) - -} -``` diff --git a/examples/geocoding/lookup/geocodeAnAddress/main.go b/examples/geocoding/lookup/geocodeAnAddress/main.go index c3e1ebc..eeb3ae9 100755 --- a/examples/geocoding/lookup/geocodeAnAddress/main.go +++ b/examples/geocoding/lookup/geocodeAnAddress/main.go @@ -17,5 +17,4 @@ func main() { Postcode: "wc2b", }) fmt.Println(rsp, err) - } diff --git a/examples/geocoding/reverse/reverseGeocodeLocation/main.go b/examples/geocoding/reverse/reverseGeocodeLocation/main.go index efffb69..1285f0e 100755 --- a/examples/geocoding/reverse/reverseGeocodeLocation/main.go +++ b/examples/geocoding/reverse/reverseGeocodeLocation/main.go @@ -15,5 +15,4 @@ func main() { Longitude: -0.1216235, }) fmt.Println(rsp, err) - } diff --git a/examples/gifs/search/search/main.go b/examples/gifs/search/search/main.go index 672867c..60535bb 100755 --- a/examples/gifs/search/search/main.go +++ b/examples/gifs/search/search/main.go @@ -15,5 +15,4 @@ func main() { Query: "dogs", }) fmt.Println(rsp, err) - } diff --git a/examples/google/search/searchForVideos/main.go b/examples/google/search/searchForVideos/main.go index 9497c56..f305ce8 100755 --- a/examples/google/search/searchForVideos/main.go +++ b/examples/google/search/searchForVideos/main.go @@ -14,5 +14,4 @@ func main() { Query: "how to make donuts", }) fmt.Println(rsp, err) - } diff --git a/examples/helloworld/README.md b/examples/helloworld/README.md index 8f0aa43..3593fb7 100755 --- a/examples/helloworld/README.md +++ b/examples/helloworld/README.md @@ -4,34 +4,6 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/Helloworld/api Endpoints: -## Call - -Call returns a personalised "Hello $name" response - - -[https://m3o.com/helloworld/api#Call](https://m3o.com/helloworld/api#Call) - -```go -package example - -import( - "fmt" - "os" - - "go.m3o.com/helloworld" -) - -// Call returns a personalised "Hello $name" response -func CallTheHelloworldService() { - helloworldService := helloworld.NewHelloworldService(os.Getenv("M3O_API_TOKEN")) - rsp, err := helloworldService.Call(&helloworld.CallRequest{ - Name: "John", - - }) - fmt.Println(rsp, err) - -} -``` ## Stream Stream returns a stream of "Hello $name" responses @@ -74,3 +46,31 @@ Name: "John", } } ``` +## Call + +Call returns a personalised "Hello $name" response + + +[https://m3o.com/helloworld/api#Call](https://m3o.com/helloworld/api#Call) + +```go +package example + +import( + "fmt" + "os" + + "go.m3o.com/helloworld" +) + +// Call returns a personalised "Hello $name" response +func CallTheHelloworldService() { + helloworldService := helloworld.NewHelloworldService(os.Getenv("M3O_API_TOKEN")) + rsp, err := helloworldService.Call(&helloworld.CallRequest{ + Name: "John", + + }) + fmt.Println(rsp, err) + +} +``` diff --git a/examples/helloworld/call/callTheHelloworldService/main.go b/examples/helloworld/call/callTheHelloworldService/main.go index f79fa5e..886f101 100755 --- a/examples/helloworld/call/callTheHelloworldService/main.go +++ b/examples/helloworld/call/callTheHelloworldService/main.go @@ -14,5 +14,4 @@ func main() { Name: "John", }) fmt.Println(rsp, err) - } diff --git a/examples/helloworld/stream/streamsResponsesFromTheServerUsingWebsockets/main.go b/examples/helloworld/stream/streamsResponsesFromTheServerUsingWebsockets/main.go index 8262d0a..c4a1f64 100755 --- a/examples/helloworld/stream/streamsResponsesFromTheServerUsingWebsockets/main.go +++ b/examples/helloworld/stream/streamsResponsesFromTheServerUsingWebsockets/main.go @@ -10,7 +10,6 @@ import ( // Stream returns a stream of "Hello $name" responses func main() { helloworldService := helloworld.NewHelloworldService(os.Getenv("M3O_API_TOKEN")) - stream, err := helloworldService.Stream(&helloworld.StreamRequest{ Messages: 10, Name: "John", diff --git a/examples/holidays/countries/listCountries/main.go b/examples/holidays/countries/listCountries/main.go index 676b6db..3dc2dc6 100755 --- a/examples/holidays/countries/listCountries/main.go +++ b/examples/holidays/countries/listCountries/main.go @@ -12,5 +12,4 @@ func main() { holidaysService := holidays.NewHolidaysService(os.Getenv("M3O_API_TOKEN")) rsp, err := holidaysService.Countries(&holidays.CountriesRequest{}) fmt.Println(rsp, err) - } diff --git a/examples/holidays/list/getHolidays/main.go b/examples/holidays/list/getHolidays/main.go index f40051c..1391a60 100755 --- a/examples/holidays/list/getHolidays/main.go +++ b/examples/holidays/list/getHolidays/main.go @@ -14,5 +14,4 @@ func main() { Year: 2022, }) fmt.Println(rsp, err) - } diff --git a/examples/id/generate/generateABigflakeId/main.go b/examples/id/generate/generateABigflakeId/main.go index e62e3e8..8d8bc5f 100755 --- a/examples/id/generate/generateABigflakeId/main.go +++ b/examples/id/generate/generateABigflakeId/main.go @@ -14,5 +14,4 @@ func main() { Type: "bigflake", }) fmt.Println(rsp, err) - } diff --git a/examples/id/generate/generateAShortId/main.go b/examples/id/generate/generateAShortId/main.go index 37a638e..c68843e 100755 --- a/examples/id/generate/generateAShortId/main.go +++ b/examples/id/generate/generateAShortId/main.go @@ -14,5 +14,4 @@ func main() { Type: "shortid", }) fmt.Println(rsp, err) - } diff --git a/examples/id/generate/generateASnowflakeId/main.go b/examples/id/generate/generateASnowflakeId/main.go index df5d120..4194e0c 100755 --- a/examples/id/generate/generateASnowflakeId/main.go +++ b/examples/id/generate/generateASnowflakeId/main.go @@ -14,5 +14,4 @@ func main() { Type: "snowflake", }) fmt.Println(rsp, err) - } diff --git a/examples/id/generate/generateAUniqueId/main.go b/examples/id/generate/generateAUniqueId/main.go index 596586c..934d6c4 100755 --- a/examples/id/generate/generateAUniqueId/main.go +++ b/examples/id/generate/generateAUniqueId/main.go @@ -14,5 +14,4 @@ func main() { Type: "uuid", }) fmt.Println(rsp, err) - } diff --git a/examples/id/types/listTheTypesOfIdsAvailable/main.go b/examples/id/types/listTheTypesOfIdsAvailable/main.go index 10709b0..ce5f77e 100755 --- a/examples/id/types/listTheTypesOfIdsAvailable/main.go +++ b/examples/id/types/listTheTypesOfIdsAvailable/main.go @@ -12,5 +12,4 @@ func main() { idService := id.NewIdService(os.Getenv("M3O_API_TOKEN")) rsp, err := idService.Types(&id.TypesRequest{}) fmt.Println(rsp, err) - } diff --git a/examples/image/convert/convertAPngImageToAJpegTakenFromAUrlAndSavedToAUrlOnMicrosCdn/main.go b/examples/image/convert/convertAPngImageToAJpegTakenFromAUrlAndSavedToAUrlOnMicrosCdn/main.go index efbcfe4..18b98e3 100755 --- a/examples/image/convert/convertAPngImageToAJpegTakenFromAUrlAndSavedToAUrlOnMicrosCdn/main.go +++ b/examples/image/convert/convertAPngImageToAJpegTakenFromAUrlAndSavedToAUrlOnMicrosCdn/main.go @@ -18,5 +18,4 @@ func main() { Url: "somewebsite.com/cat.png", }) fmt.Println(rsp, err) - } diff --git a/examples/image/delete/deleteAnUploadedImage/main.go b/examples/image/delete/deleteAnUploadedImage/main.go index 51bf67c..8443fa6 100755 --- a/examples/image/delete/deleteAnUploadedImage/main.go +++ b/examples/image/delete/deleteAnUploadedImage/main.go @@ -14,5 +14,4 @@ func main() { Url: "https://cdn.m3ocontent.com/micro/images/micro/41e23b39-48dd-42b6-9738-79a313414bb8/cat.png", }) fmt.Println(rsp, err) - } diff --git a/examples/image/resize/base64ToBase64Image/main.go b/examples/image/resize/base64ToBase64Image/main.go index adc2153..b2db724 100755 --- a/examples/image/resize/base64ToBase64Image/main.go +++ b/examples/image/resize/base64ToBase64Image/main.go @@ -20,5 +20,4 @@ func main() { Width: 100, }) fmt.Println(rsp, err) - } diff --git a/examples/image/resize/base64ToBase64ImageWithCropping/main.go b/examples/image/resize/base64ToBase64ImageWithCropping/main.go index 5a7a759..e5b0d85 100755 --- a/examples/image/resize/base64ToBase64ImageWithCropping/main.go +++ b/examples/image/resize/base64ToBase64ImageWithCropping/main.go @@ -24,5 +24,4 @@ func main() { Width: 100, }) fmt.Println(rsp, err) - } diff --git a/examples/image/resize/base64ToHostedImage/main.go b/examples/image/resize/base64ToHostedImage/main.go index 94eee64..734ff07 100755 --- a/examples/image/resize/base64ToHostedImage/main.go +++ b/examples/image/resize/base64ToHostedImage/main.go @@ -21,5 +21,4 @@ func main() { Width: 100, }) fmt.Println(rsp, err) - } diff --git a/examples/image/upload/uploadABase64ImageToMicrosCdn/main.go b/examples/image/upload/uploadABase64ImageToMicrosCdn/main.go index 0a4866a..6528e03 100755 --- a/examples/image/upload/uploadABase64ImageToMicrosCdn/main.go +++ b/examples/image/upload/uploadABase64ImageToMicrosCdn/main.go @@ -18,5 +18,4 @@ func main() { Name: "cat.jpeg", }) fmt.Println(rsp, err) - } diff --git a/examples/image/upload/uploadAnImageFromAUrlToMicrosCdn/main.go b/examples/image/upload/uploadAnImageFromAUrlToMicrosCdn/main.go index 598724b..62cdc7c 100755 --- a/examples/image/upload/uploadAnImageFromAUrlToMicrosCdn/main.go +++ b/examples/image/upload/uploadAnImageFromAUrlToMicrosCdn/main.go @@ -18,5 +18,4 @@ func main() { Url: "somewebsite.com/cat.png", }) fmt.Println(rsp, err) - } diff --git a/examples/ip/lookup/lookupIpInfo/main.go b/examples/ip/lookup/lookupIpInfo/main.go index d586e3c..75269c6 100755 --- a/examples/ip/lookup/lookupIpInfo/main.go +++ b/examples/ip/lookup/lookupIpInfo/main.go @@ -14,5 +14,4 @@ func main() { Ip: "93.148.214.31", }) fmt.Println(rsp, err) - } diff --git a/examples/joke/random/getRandomNJokes/main.go b/examples/joke/random/getRandomNJokes/main.go index e284044..70717ec 100755 --- a/examples/joke/random/getRandomNJokes/main.go +++ b/examples/joke/random/getRandomNJokes/main.go @@ -14,5 +14,4 @@ func main() { Count: 3, }) fmt.Println(rsp, err) - } diff --git a/examples/location/README.md b/examples/location/README.md index 9d51b7a..83046bb 100755 --- a/examples/location/README.md +++ b/examples/location/README.md @@ -4,6 +4,42 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/Location/api]( Endpoints: +## Save + +Save an entity's current position + + +[https://m3o.com/location/api#Save](https://m3o.com/location/api#Save) + +```go +package example + +import( + "fmt" + "os" + + "go.m3o.com/location" +) + +// Save an entity's current position +func SaveAnEntity() { + locationService := location.NewLocationService(os.Getenv("M3O_API_TOKEN")) + rsp, err := locationService.Save(&location.SaveRequest{ + Entity: &location.Entity{ + Id: "1", + Location: &location.Point{ + Latitude: 51.511061, + Longitude: -0.120022, + Timestamp: 1622802761, +}, + Type: "bike", +}, + + }) + fmt.Println(rsp, err) + +} +``` ## Read Read an entity by its ID @@ -66,39 +102,3 @@ Type: "bike", } ``` -## Save - -Save an entity's current position - - -[https://m3o.com/location/api#Save](https://m3o.com/location/api#Save) - -```go -package example - -import( - "fmt" - "os" - - "go.m3o.com/location" -) - -// Save an entity's current position -func SaveAnEntity() { - locationService := location.NewLocationService(os.Getenv("M3O_API_TOKEN")) - rsp, err := locationService.Save(&location.SaveRequest{ - Entity: &location.Entity{ - Id: "1", - Location: &location.Point{ - Latitude: 51.511061, - Longitude: -0.120022, - Timestamp: 1622802761, -}, - Type: "bike", -}, - - }) - fmt.Println(rsp, err) - -} -``` diff --git a/examples/location/read/getLocationById/main.go b/examples/location/read/getLocationById/main.go index 627f3a1..bbc21cd 100755 --- a/examples/location/read/getLocationById/main.go +++ b/examples/location/read/getLocationById/main.go @@ -14,5 +14,4 @@ func main() { Id: "1", }) fmt.Println(rsp, err) - } diff --git a/examples/location/save/saveAnEntity/main.go b/examples/location/save/saveAnEntity/main.go index 3f42638..dc9ff51 100755 --- a/examples/location/save/saveAnEntity/main.go +++ b/examples/location/save/saveAnEntity/main.go @@ -22,5 +22,4 @@ func main() { }, }) fmt.Println(rsp, err) - } diff --git a/examples/location/search/searchForLocations/main.go b/examples/location/search/searchForLocations/main.go index 1d143e9..a0aec8b 100755 --- a/examples/location/search/searchForLocations/main.go +++ b/examples/location/search/searchForLocations/main.go @@ -20,5 +20,4 @@ func main() { Type: "bike", }) fmt.Println(rsp, err) - } diff --git a/examples/movie/search/searchForMovies/main.go b/examples/movie/search/searchForMovies/main.go index 367af7c..2807052 100755 --- a/examples/movie/search/searchForMovies/main.go +++ b/examples/movie/search/searchForMovies/main.go @@ -18,5 +18,4 @@ func main() { Year: 2010, }) fmt.Println(rsp, err) - } diff --git a/examples/mq/README.md b/examples/mq/README.md index c905321..8153f1c 100755 --- a/examples/mq/README.md +++ b/examples/mq/README.md @@ -4,6 +4,39 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/Mq/api](https: Endpoints: +## Publish + +Publish a message. Specify a topic to group messages for a specific topic. + + +[https://m3o.com/mq/api#Publish](https://m3o.com/mq/api#Publish) + +```go +package example + +import( + "fmt" + "os" + + "go.m3o.com/mq" +) + +// Publish a message. Specify a topic to group messages for a specific topic. +func PublishAmessage() { + mqService := mq.NewMqService(os.Getenv("M3O_API_TOKEN")) + rsp, err := mqService.Publish(&mq.PublishRequest{ + Message: map[string]interface{}{ + "type": "signup", + "user": "john", + "id": "1", +}, +Topic: "events", + + }) + fmt.Println(rsp, err) + +} +``` ## Subscribe Subscribe to messages for a given topic. @@ -45,36 +78,3 @@ func SubscribeToAtopic() { } } ``` -## Publish - -Publish a message. Specify a topic to group messages for a specific topic. - - -[https://m3o.com/mq/api#Publish](https://m3o.com/mq/api#Publish) - -```go -package example - -import( - "fmt" - "os" - - "go.m3o.com/mq" -) - -// Publish a message. Specify a topic to group messages for a specific topic. -func PublishAmessage() { - mqService := mq.NewMqService(os.Getenv("M3O_API_TOKEN")) - rsp, err := mqService.Publish(&mq.PublishRequest{ - Message: map[string]interface{}{ - "user": "john", - "id": "1", - "type": "signup", -}, -Topic: "events", - - }) - fmt.Println(rsp, err) - -} -``` diff --git a/examples/mq/publish/publishAMessage/main.go b/examples/mq/publish/publishAMessage/main.go index d5d14f2..e6a7451 100755 --- a/examples/mq/publish/publishAMessage/main.go +++ b/examples/mq/publish/publishAMessage/main.go @@ -12,12 +12,11 @@ func main() { mqService := mq.NewMqService(os.Getenv("M3O_API_TOKEN")) rsp, err := mqService.Publish(&mq.PublishRequest{ Message: map[string]interface{}{ - "id": "1", "type": "signup", "user": "john", + "id": "1", }, Topic: "events", }) fmt.Println(rsp, err) - } diff --git a/examples/mq/subscribe/subscribeToATopic/main.go b/examples/mq/subscribe/subscribeToATopic/main.go index 0144ae4..5b50e1d 100755 --- a/examples/mq/subscribe/subscribeToATopic/main.go +++ b/examples/mq/subscribe/subscribeToATopic/main.go @@ -10,7 +10,6 @@ import ( // Subscribe to messages for a given topic. func main() { mqService := mq.NewMqService(os.Getenv("M3O_API_TOKEN")) - stream, err := mqService.Subscribe(&mq.SubscribeRequest{ Topic: "events", }) diff --git a/examples/news/headlines/getNewsHeadlines/main.go b/examples/news/headlines/getNewsHeadlines/main.go index befe4a1..37e380d 100755 --- a/examples/news/headlines/getNewsHeadlines/main.go +++ b/examples/news/headlines/getNewsHeadlines/main.go @@ -16,5 +16,4 @@ func main() { Locale: "us", }) fmt.Println(rsp, err) - } diff --git a/examples/nft/README.md b/examples/nft/README.md index 0075be9..4450c3a 100755 --- a/examples/nft/README.md +++ b/examples/nft/README.md @@ -4,6 +4,34 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/Nft/api](https Endpoints: +## Assets + +Return a list of assets + + +[https://m3o.com/nft/api#Assets](https://m3o.com/nft/api#Assets) + +```go +package example + +import( + "fmt" + "os" + + "go.m3o.com/nft" +) + +// Return a list of assets +func GetAlistOfAssets() { + nftService := nft.NewNftService(os.Getenv("M3O_API_TOKEN")) + rsp, err := nftService.Assets(&nft.AssetsRequest{ + Limit: 1, + + }) + fmt.Println(rsp, err) + +} +``` ## Create Create your own NFT (coming soon) @@ -61,31 +89,3 @@ func ListCollections() { } ``` -## Assets - -Return a list of assets - - -[https://m3o.com/nft/api#Assets](https://m3o.com/nft/api#Assets) - -```go -package example - -import( - "fmt" - "os" - - "go.m3o.com/nft" -) - -// Return a list of assets -func GetAlistOfAssets() { - nftService := nft.NewNftService(os.Getenv("M3O_API_TOKEN")) - rsp, err := nftService.Assets(&nft.AssetsRequest{ - Limit: 1, - - }) - fmt.Println(rsp, err) - -} -``` diff --git a/examples/nft/assets/getAListOfAssets/main.go b/examples/nft/assets/getAListOfAssets/main.go index bcb8698..3415079 100755 --- a/examples/nft/assets/getAListOfAssets/main.go +++ b/examples/nft/assets/getAListOfAssets/main.go @@ -14,5 +14,4 @@ func main() { Limit: 1, }) fmt.Println(rsp, err) - } diff --git a/examples/nft/collections/listCollections/main.go b/examples/nft/collections/listCollections/main.go index 7999fc6..90377ef 100755 --- a/examples/nft/collections/listCollections/main.go +++ b/examples/nft/collections/listCollections/main.go @@ -14,5 +14,4 @@ func main() { Limit: 1, }) fmt.Println(rsp, err) - } diff --git a/examples/nft/create/createAnNft/main.go b/examples/nft/create/createAnNft/main.go index 92924c8..9c7807a 100755 --- a/examples/nft/create/createAnNft/main.go +++ b/examples/nft/create/createAnNft/main.go @@ -15,5 +15,4 @@ func main() { Name: "Guybrush Threepwood", }) fmt.Println(rsp, err) - } diff --git a/examples/notes/README.md b/examples/notes/README.md index d3734ad..9407f43 100755 --- a/examples/notes/README.md +++ b/examples/notes/README.md @@ -4,6 +4,93 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/Notes/api](htt Endpoints: +## List + +List all the notes + + +[https://m3o.com/notes/api#List](https://m3o.com/notes/api#List) + +```go +package example + +import( + "fmt" + "os" + + "go.m3o.com/notes" +) + +// List all the notes +func ListAllNotes() { + notesService := notes.NewNotesService(os.Getenv("M3O_API_TOKEN")) + rsp, err := notesService.List(¬es.ListRequest{ + + }) + fmt.Println(rsp, err) + +} +``` +## Update + +Update a note + + +[https://m3o.com/notes/api#Update](https://m3o.com/notes/api#Update) + +```go +package example + +import( + "fmt" + "os" + + "go.m3o.com/notes" +) + +// Update a note +func UpdateAnote() { + notesService := notes.NewNotesService(os.Getenv("M3O_API_TOKEN")) + rsp, err := notesService.Update(¬es.UpdateRequest{ + Note: ¬es.Note{ + Id: "63c0cdf8-2121-11ec-a881-0242e36f037a", + Text: "Updated note text", + Title: "Update Note", + }, + + }) + fmt.Println(rsp, err) + +} +``` +## Delete + +Delete a note + + +[https://m3o.com/notes/api#Delete](https://m3o.com/notes/api#Delete) + +```go +package example + +import( + "fmt" + "os" + + "go.m3o.com/notes" +) + +// Delete a note +func DeleteAnote() { + notesService := notes.NewNotesService(os.Getenv("M3O_API_TOKEN")) + rsp, err := notesService.Delete(¬es.DeleteRequest{ + Id: "63c0cdf8-2121-11ec-a881-0242e36f037a", + + }) + fmt.Println(rsp, err) + +} +``` ## Events Subscribe to notes events @@ -102,90 +189,3 @@ func ReadAnote() { } ``` -## List - -List all the notes - - -[https://m3o.com/notes/api#List](https://m3o.com/notes/api#List) - -```go -package example - -import( - "fmt" - "os" - - "go.m3o.com/notes" -) - -// List all the notes -func ListAllNotes() { - notesService := notes.NewNotesService(os.Getenv("M3O_API_TOKEN")) - rsp, err := notesService.List(¬es.ListRequest{ - - }) - fmt.Println(rsp, err) - -} -``` -## Update - -Update a note - - -[https://m3o.com/notes/api#Update](https://m3o.com/notes/api#Update) - -```go -package example - -import( - "fmt" - "os" - - "go.m3o.com/notes" -) - -// Update a note -func UpdateAnote() { - notesService := notes.NewNotesService(os.Getenv("M3O_API_TOKEN")) - rsp, err := notesService.Update(¬es.UpdateRequest{ - Note: ¬es.Note{ - Id: "63c0cdf8-2121-11ec-a881-0242e36f037a", - Text: "Updated note text", - Title: "Update Note", - }, - - }) - fmt.Println(rsp, err) - -} -``` -## Delete - -Delete a note - - -[https://m3o.com/notes/api#Delete](https://m3o.com/notes/api#Delete) - -```go -package example - -import( - "fmt" - "os" - - "go.m3o.com/notes" -) - -// Delete a note -func DeleteAnote() { - notesService := notes.NewNotesService(os.Getenv("M3O_API_TOKEN")) - rsp, err := notesService.Delete(¬es.DeleteRequest{ - Id: "63c0cdf8-2121-11ec-a881-0242e36f037a", - - }) - fmt.Println(rsp, err) - -} -``` diff --git a/examples/notes/create/createANote/main.go b/examples/notes/create/createANote/main.go index 92aecbf..56ab7ca 100755 --- a/examples/notes/create/createANote/main.go +++ b/examples/notes/create/createANote/main.go @@ -15,5 +15,4 @@ func main() { Title: "New Note", }) fmt.Println(rsp, err) - } diff --git a/examples/notes/delete/deleteANote/main.go b/examples/notes/delete/deleteANote/main.go index edff5b7..a102cb0 100755 --- a/examples/notes/delete/deleteANote/main.go +++ b/examples/notes/delete/deleteANote/main.go @@ -14,5 +14,4 @@ func main() { Id: "63c0cdf8-2121-11ec-a881-0242e36f037a", }) fmt.Println(rsp, err) - } diff --git a/examples/notes/events/subscribeToEvents/main.go b/examples/notes/events/subscribeToEvents/main.go index 4f67395..c871a79 100755 --- a/examples/notes/events/subscribeToEvents/main.go +++ b/examples/notes/events/subscribeToEvents/main.go @@ -10,7 +10,6 @@ import ( // Subscribe to notes events func main() { notesService := notes.NewNotesService(os.Getenv("M3O_API_TOKEN")) - stream, err := notesService.Events(¬es.EventsRequest{ Id: "63c0cdf8-2121-11ec-a881-0242e36f037a", }) diff --git a/examples/notes/list/listAllNotes/main.go b/examples/notes/list/listAllNotes/main.go index 0c89c17..9fc1dca 100755 --- a/examples/notes/list/listAllNotes/main.go +++ b/examples/notes/list/listAllNotes/main.go @@ -12,5 +12,4 @@ func main() { notesService := notes.NewNotesService(os.Getenv("M3O_API_TOKEN")) rsp, err := notesService.List(¬es.ListRequest{}) fmt.Println(rsp, err) - } diff --git a/examples/notes/read/readANote/main.go b/examples/notes/read/readANote/main.go index 7068056..8c292bf 100755 --- a/examples/notes/read/readANote/main.go +++ b/examples/notes/read/readANote/main.go @@ -14,5 +14,4 @@ func main() { Id: "63c0cdf8-2121-11ec-a881-0242e36f037a", }) fmt.Println(rsp, err) - } diff --git a/examples/notes/update/updateANote/main.go b/examples/notes/update/updateANote/main.go index 3f3bbe4..c2fbc16 100755 --- a/examples/notes/update/updateANote/main.go +++ b/examples/notes/update/updateANote/main.go @@ -18,5 +18,4 @@ func main() { }, }) fmt.Println(rsp, err) - } diff --git a/examples/otp/generate/generateOtp/main.go b/examples/otp/generate/generateOtp/main.go index a90d729..4085622 100755 --- a/examples/otp/generate/generateOtp/main.go +++ b/examples/otp/generate/generateOtp/main.go @@ -14,5 +14,4 @@ func main() { Id: "asim@example.com", }) fmt.Println(rsp, err) - } diff --git a/examples/otp/validate/validateOtp/main.go b/examples/otp/validate/validateOtp/main.go index 89e63c6..4b27d65 100755 --- a/examples/otp/validate/validateOtp/main.go +++ b/examples/otp/validate/validateOtp/main.go @@ -15,5 +15,4 @@ func main() { Id: "asim@example.com", }) fmt.Println(rsp, err) - } diff --git a/examples/postcode/lookup/lookupPostcode/main.go b/examples/postcode/lookup/lookupPostcode/main.go index 0b641be..5903e45 100755 --- a/examples/postcode/lookup/lookupPostcode/main.go +++ b/examples/postcode/lookup/lookupPostcode/main.go @@ -14,5 +14,4 @@ func main() { Postcode: "SW1A 2AA", }) fmt.Println(rsp, err) - } diff --git a/examples/postcode/random/returnARandomPostcodeAndItsInformation/main.go b/examples/postcode/random/returnARandomPostcodeAndItsInformation/main.go index dc40bc2..a150b95 100755 --- a/examples/postcode/random/returnARandomPostcodeAndItsInformation/main.go +++ b/examples/postcode/random/returnARandomPostcodeAndItsInformation/main.go @@ -12,5 +12,4 @@ func main() { postcodeService := postcode.NewPostcodeService(os.Getenv("M3O_API_TOKEN")) rsp, err := postcodeService.Random(&postcode.RandomRequest{}) fmt.Println(rsp, err) - } diff --git a/examples/postcode/validate/returnARandomPostcodeAndItsInformation/main.go b/examples/postcode/validate/returnARandomPostcodeAndItsInformation/main.go index 17ccbc0..55f04f0 100755 --- a/examples/postcode/validate/returnARandomPostcodeAndItsInformation/main.go +++ b/examples/postcode/validate/returnARandomPostcodeAndItsInformation/main.go @@ -14,5 +14,4 @@ func main() { Postcode: "SW1A 2AA", }) fmt.Println(rsp, err) - } diff --git a/examples/prayer/times/prayerTimes/main.go b/examples/prayer/times/prayerTimes/main.go index 35d5810..9b127c5 100755 --- a/examples/prayer/times/prayerTimes/main.go +++ b/examples/prayer/times/prayerTimes/main.go @@ -14,5 +14,4 @@ func main() { Location: "london", }) fmt.Println(rsp, err) - } diff --git a/examples/qr/generate/generateAQrCode/main.go b/examples/qr/generate/generateAQrCode/main.go index 2490887..21fd932 100755 --- a/examples/qr/generate/generateAQrCode/main.go +++ b/examples/qr/generate/generateAQrCode/main.go @@ -15,5 +15,4 @@ func main() { Text: "https://m3o.com/qr", }) fmt.Println(rsp, err) - } diff --git a/examples/quran/README.md b/examples/quran/README.md index 927b4b4..03a059b 100755 --- a/examples/quran/README.md +++ b/examples/quran/README.md @@ -4,6 +4,34 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/Quran/api](htt Endpoints: +## Chapters + +List the Chapters (surahs) of the Quran + + +[https://m3o.com/quran/api#Chapters](https://m3o.com/quran/api#Chapters) + +```go +package example + +import( + "fmt" + "os" + + "go.m3o.com/quran" +) + +// List the Chapters (surahs) of the Quran +func ListChapters() { + quranService := quran.NewQuranService(os.Getenv("M3O_API_TOKEN")) + rsp, err := quranService.Chapters(&quran.ChaptersRequest{ + Language: "en", + + }) + fmt.Println(rsp, err) + +} +``` ## Summary Get a summary for a given chapter (surah) @@ -92,31 +120,3 @@ func SearchTheQuran() { } ``` -## Chapters - -List the Chapters (surahs) of the Quran - - -[https://m3o.com/quran/api#Chapters](https://m3o.com/quran/api#Chapters) - -```go -package example - -import( - "fmt" - "os" - - "go.m3o.com/quran" -) - -// List the Chapters (surahs) of the Quran -func ListChapters() { - quranService := quran.NewQuranService(os.Getenv("M3O_API_TOKEN")) - rsp, err := quranService.Chapters(&quran.ChaptersRequest{ - Language: "en", - - }) - fmt.Println(rsp, err) - -} -``` diff --git a/examples/quran/chapters/listChapters/main.go b/examples/quran/chapters/listChapters/main.go index 364aacf..6b70221 100755 --- a/examples/quran/chapters/listChapters/main.go +++ b/examples/quran/chapters/listChapters/main.go @@ -14,5 +14,4 @@ func main() { Language: "en", }) fmt.Println(rsp, err) - } diff --git a/examples/quran/search/searchTheQuran/main.go b/examples/quran/search/searchTheQuran/main.go index ed635a1..55ff062 100755 --- a/examples/quran/search/searchTheQuran/main.go +++ b/examples/quran/search/searchTheQuran/main.go @@ -14,5 +14,4 @@ func main() { Query: "messenger", }) fmt.Println(rsp, err) - } diff --git a/examples/quran/summary/getChapterSummary/main.go b/examples/quran/summary/getChapterSummary/main.go index 39c7fc0..6dca3fa 100755 --- a/examples/quran/summary/getChapterSummary/main.go +++ b/examples/quran/summary/getChapterSummary/main.go @@ -14,5 +14,4 @@ func main() { Chapter: 1, }) fmt.Println(rsp, err) - } diff --git a/examples/quran/verses/getVersesOfAChapter/main.go b/examples/quran/verses/getVersesOfAChapter/main.go index ebcfc01..5ea0718 100755 --- a/examples/quran/verses/getVersesOfAChapter/main.go +++ b/examples/quran/verses/getVersesOfAChapter/main.go @@ -16,5 +16,4 @@ func main() { Chapter: 1, }) fmt.Println(rsp, err) - } diff --git a/examples/routing/directions/turnByTurnDirections/main.go b/examples/routing/directions/turnByTurnDirections/main.go index c62178f..e9526af 100755 --- a/examples/routing/directions/turnByTurnDirections/main.go +++ b/examples/routing/directions/turnByTurnDirections/main.go @@ -21,5 +21,4 @@ func main() { }, }) fmt.Println(rsp, err) - } diff --git a/examples/routing/eta/etaFromPointAToPointB/main.go b/examples/routing/eta/etaFromPointAToPointB/main.go index ade9e0e..10ac617 100755 --- a/examples/routing/eta/etaFromPointAToPointB/main.go +++ b/examples/routing/eta/etaFromPointAToPointB/main.go @@ -21,5 +21,4 @@ func main() { }, }) fmt.Println(rsp, err) - } diff --git a/examples/routing/route/gpsPointsForARoute/main.go b/examples/routing/route/gpsPointsForARoute/main.go index 99b900a..0970236 100755 --- a/examples/routing/route/gpsPointsForARoute/main.go +++ b/examples/routing/route/gpsPointsForARoute/main.go @@ -21,5 +21,4 @@ func main() { }, }) fmt.Println(rsp, err) - } diff --git a/examples/rss/add/addANewFeed/main.go b/examples/rss/add/addANewFeed/main.go index 64df6c1..87191ea 100755 --- a/examples/rss/add/addANewFeed/main.go +++ b/examples/rss/add/addANewFeed/main.go @@ -16,5 +16,4 @@ func main() { Url: "http://feeds.bbci.co.uk/news/rss.xml", }) fmt.Println(rsp, err) - } diff --git a/examples/rss/feed/readAFeed/main.go b/examples/rss/feed/readAFeed/main.go index 6c1b3d7..4c9a358 100755 --- a/examples/rss/feed/readAFeed/main.go +++ b/examples/rss/feed/readAFeed/main.go @@ -14,5 +14,4 @@ func main() { Name: "bbc", }) fmt.Println(rsp, err) - } diff --git a/examples/rss/list/listRssFeeds/main.go b/examples/rss/list/listRssFeeds/main.go index 0383c11..853a946 100755 --- a/examples/rss/list/listRssFeeds/main.go +++ b/examples/rss/list/listRssFeeds/main.go @@ -12,5 +12,4 @@ func main() { rssService := rss.NewRssService(os.Getenv("M3O_API_TOKEN")) rsp, err := rssService.List(&rss.ListRequest{}) fmt.Println(rsp, err) - } diff --git a/examples/rss/remove/removeAFeed/main.go b/examples/rss/remove/removeAFeed/main.go index 51b0d38..594472e 100755 --- a/examples/rss/remove/removeAFeed/main.go +++ b/examples/rss/remove/removeAFeed/main.go @@ -14,5 +14,4 @@ func main() { Name: "bbc", }) fmt.Println(rsp, err) - } diff --git a/examples/search/vote/voteForTheApi/main.go b/examples/search/vote/voteForTheApi/main.go index 0db303b..43c4154 100755 --- a/examples/search/vote/voteForTheApi/main.go +++ b/examples/search/vote/voteForTheApi/main.go @@ -14,5 +14,4 @@ func main() { Message: "Launch it!", }) fmt.Println(rsp, err) - } diff --git a/examples/sentiment/analyze/analyzeAPieceOfText/main.go b/examples/sentiment/analyze/analyzeAPieceOfText/main.go index a7887f5..a7446d9 100755 --- a/examples/sentiment/analyze/analyzeAPieceOfText/main.go +++ b/examples/sentiment/analyze/analyzeAPieceOfText/main.go @@ -14,5 +14,4 @@ func main() { Text: "this is amazing", }) fmt.Println(rsp, err) - } diff --git a/examples/sms/send/sendSms/main.go b/examples/sms/send/sendSms/main.go index 188c0f0..edda18c 100755 --- a/examples/sms/send/sendSms/main.go +++ b/examples/sms/send/sendSms/main.go @@ -16,5 +16,4 @@ func main() { To: "+447681129", }) fmt.Println(rsp, err) - } diff --git a/examples/space/create/createAnObject/main.go b/examples/space/create/createAnObject/main.go index 3310651..8c202d5 100755 --- a/examples/space/create/createAnObject/main.go +++ b/examples/space/create/createAnObject/main.go @@ -18,5 +18,4 @@ func main() { Visibility: "public", }) fmt.Println(rsp, err) - } diff --git a/examples/space/delete/deleteAnObject/main.go b/examples/space/delete/deleteAnObject/main.go index 5782b33..1398b1f 100755 --- a/examples/space/delete/deleteAnObject/main.go +++ b/examples/space/delete/deleteAnObject/main.go @@ -14,5 +14,4 @@ func main() { Name: "images/file.jpg", }) fmt.Println(rsp, err) - } diff --git a/examples/space/head/headAnObject/main.go b/examples/space/head/headAnObject/main.go index 3d5213c..2d7b40f 100755 --- a/examples/space/head/headAnObject/main.go +++ b/examples/space/head/headAnObject/main.go @@ -14,5 +14,4 @@ func main() { Name: "images/file.jpg", }) fmt.Println(rsp, err) - } diff --git a/examples/space/list/listObjectsWithPrefix/main.go b/examples/space/list/listObjectsWithPrefix/main.go index 9495439..6f257c1 100755 --- a/examples/space/list/listObjectsWithPrefix/main.go +++ b/examples/space/list/listObjectsWithPrefix/main.go @@ -14,5 +14,4 @@ func main() { Prefix: "images/", }) fmt.Println(rsp, err) - } diff --git a/examples/space/read/readAnObject/main.go b/examples/space/read/readAnObject/main.go index 621a96a..a0f31e8 100755 --- a/examples/space/read/readAnObject/main.go +++ b/examples/space/read/readAnObject/main.go @@ -14,5 +14,4 @@ func main() { Name: "images/file.jpg", }) fmt.Println(rsp, err) - } diff --git a/examples/space/update/updateAnObject/main.go b/examples/space/update/updateAnObject/main.go index 69e63e3..465c3f9 100755 --- a/examples/space/update/updateAnObject/main.go +++ b/examples/space/update/updateAnObject/main.go @@ -18,5 +18,4 @@ func main() { Visibility: "public", }) fmt.Println(rsp, err) - } diff --git a/examples/spam/classify/classifyAnEmail/main.go b/examples/spam/classify/classifyAnEmail/main.go index 8cbfb88..a76e84b 100755 --- a/examples/spam/classify/classifyAnEmail/main.go +++ b/examples/spam/classify/classifyAnEmail/main.go @@ -16,5 +16,4 @@ func main() { To: "hello@example.com", }) fmt.Println(rsp, err) - } diff --git a/examples/spam/classify/classifyAnEmailUsingTheRawData/main.go b/examples/spam/classify/classifyAnEmailUsingTheRawData/main.go index a921f00..9f0bfa7 100755 --- a/examples/spam/classify/classifyAnEmailUsingTheRawData/main.go +++ b/examples/spam/classify/classifyAnEmailUsingTheRawData/main.go @@ -12,5 +12,4 @@ func main() { spamService := spam.NewSpamService(os.Getenv("M3O_API_TOKEN")) rsp, err := spamService.Classify(&spam.ClassifyRequest{}) fmt.Println(rsp, err) - } diff --git a/examples/stock/README.md b/examples/stock/README.md index b627a34..ed80709 100755 --- a/examples/stock/README.md +++ b/examples/stock/README.md @@ -4,62 +4,6 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/Stock/api](htt Endpoints: -## Price - -Get the last price for a given stock ticker - - -[https://m3o.com/stock/api#Price](https://m3o.com/stock/api#Price) - -```go -package example - -import( - "fmt" - "os" - - "go.m3o.com/stock" -) - -// Get the last price for a given stock ticker -func GetAstockPrice() { - stockService := stock.NewStockService(os.Getenv("M3O_API_TOKEN")) - rsp, err := stockService.Price(&stock.PriceRequest{ - Symbol: "AAPL", - - }) - fmt.Println(rsp, err) - -} -``` -## Quote - -Get the last quote for the stock - - -[https://m3o.com/stock/api#Quote](https://m3o.com/stock/api#Quote) - -```go -package example - -import( - "fmt" - "os" - - "go.m3o.com/stock" -) - -// Get the last quote for the stock -func GetAstockQuote() { - stockService := stock.NewStockService(os.Getenv("M3O_API_TOKEN")) - rsp, err := stockService.Quote(&stock.QuoteRequest{ - Symbol: "AAPL", - - }) - fmt.Println(rsp, err) - -} -``` ## History Get the historic open-close for a given day @@ -121,3 +65,59 @@ Stock: "AAPL", } ``` +## Price + +Get the last price for a given stock ticker + + +[https://m3o.com/stock/api#Price](https://m3o.com/stock/api#Price) + +```go +package example + +import( + "fmt" + "os" + + "go.m3o.com/stock" +) + +// Get the last price for a given stock ticker +func GetAstockPrice() { + stockService := stock.NewStockService(os.Getenv("M3O_API_TOKEN")) + rsp, err := stockService.Price(&stock.PriceRequest{ + Symbol: "AAPL", + + }) + fmt.Println(rsp, err) + +} +``` +## Quote + +Get the last quote for the stock + + +[https://m3o.com/stock/api#Quote](https://m3o.com/stock/api#Quote) + +```go +package example + +import( + "fmt" + "os" + + "go.m3o.com/stock" +) + +// Get the last quote for the stock +func GetAstockQuote() { + stockService := stock.NewStockService(os.Getenv("M3O_API_TOKEN")) + rsp, err := stockService.Quote(&stock.QuoteRequest{ + Symbol: "AAPL", + + }) + fmt.Println(rsp, err) + +} +``` diff --git a/examples/stock/history/getHistoricData/main.go b/examples/stock/history/getHistoricData/main.go index e4bf2cb..5898d67 100755 --- a/examples/stock/history/getHistoricData/main.go +++ b/examples/stock/history/getHistoricData/main.go @@ -15,5 +15,4 @@ func main() { Stock: "AAPL", }) fmt.Println(rsp, err) - } diff --git a/examples/stock/orderBook/orderBookHistory/main.go b/examples/stock/orderBook/orderBookHistory/main.go index db305f6..4e14b0d 100755 --- a/examples/stock/orderBook/orderBookHistory/main.go +++ b/examples/stock/orderBook/orderBookHistory/main.go @@ -18,5 +18,4 @@ func main() { Stock: "AAPL", }) fmt.Println(rsp, err) - } diff --git a/examples/stock/price/getAStockPrice/main.go b/examples/stock/price/getAStockPrice/main.go index 0559928..ea3dcba 100755 --- a/examples/stock/price/getAStockPrice/main.go +++ b/examples/stock/price/getAStockPrice/main.go @@ -14,5 +14,4 @@ func main() { Symbol: "AAPL", }) fmt.Println(rsp, err) - } diff --git a/examples/stock/quote/getAStockQuote/main.go b/examples/stock/quote/getAStockQuote/main.go index e191381..2702907 100755 --- a/examples/stock/quote/getAStockQuote/main.go +++ b/examples/stock/quote/getAStockQuote/main.go @@ -14,5 +14,4 @@ func main() { Symbol: "AAPL", }) fmt.Println(rsp, err) - } diff --git a/examples/stream/createChannel/createChannel/main.go b/examples/stream/createChannel/createChannel/main.go index afff88f..e8310d7 100755 --- a/examples/stream/createChannel/createChannel/main.go +++ b/examples/stream/createChannel/createChannel/main.go @@ -16,5 +16,4 @@ func main() { Name: "general", }) fmt.Println(rsp, err) - } diff --git a/examples/stream/listChannels/listChannels/main.go b/examples/stream/listChannels/listChannels/main.go index 05b1adc..85a5de6 100755 --- a/examples/stream/listChannels/listChannels/main.go +++ b/examples/stream/listChannels/listChannels/main.go @@ -12,5 +12,4 @@ func main() { streamService := stream.NewStreamService(os.Getenv("M3O_API_TOKEN")) rsp, err := streamService.ListChannels(&stream.ListChannelsRequest{}) fmt.Println(rsp, err) - } diff --git a/examples/stream/listMessages/listMessages/main.go b/examples/stream/listMessages/listMessages/main.go index 3ae50f2..a8f75f5 100755 --- a/examples/stream/listMessages/listMessages/main.go +++ b/examples/stream/listMessages/listMessages/main.go @@ -14,5 +14,4 @@ func main() { Channel: "general", }) fmt.Println(rsp, err) - } diff --git a/examples/stream/sendMessage/sendMessage/main.go b/examples/stream/sendMessage/sendMessage/main.go index 967c037..679e5bb 100755 --- a/examples/stream/sendMessage/sendMessage/main.go +++ b/examples/stream/sendMessage/sendMessage/main.go @@ -15,5 +15,4 @@ func main() { Text: "Hey checkout this tweet https://twitter.com/m3oservices/status/1455291054295498752", }) fmt.Println(rsp, err) - } diff --git a/examples/sunnah/README.md b/examples/sunnah/README.md index 0b5cf6e..7b24889 100755 --- a/examples/sunnah/README.md +++ b/examples/sunnah/README.md @@ -4,35 +4,6 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/Sunnah/api](ht Endpoints: -## Collections - -Get a list of available collections. A collection is -a compilation of hadiths collected and written by an author. - - -[https://m3o.com/sunnah/api#Collections](https://m3o.com/sunnah/api#Collections) - -```go -package example - -import( - "fmt" - "os" - - "go.m3o.com/sunnah" -) - -// Get a list of available collections. A collection is -// a compilation of hadiths collected and written by an author. -func ListAvailableCollections() { - sunnahService := sunnah.NewSunnahService(os.Getenv("M3O_API_TOKEN")) - rsp, err := sunnahService.Collections(&sunnah.CollectionsRequest{ - - }) - fmt.Println(rsp, err) - -} -``` ## Books Get a list of books from within a collection. A book can contain many chapters @@ -123,3 +94,32 @@ Collection: "bukhari", } ``` +## Collections + +Get a list of available collections. A collection is +a compilation of hadiths collected and written by an author. + + +[https://m3o.com/sunnah/api#Collections](https://m3o.com/sunnah/api#Collections) + +```go +package example + +import( + "fmt" + "os" + + "go.m3o.com/sunnah" +) + +// Get a list of available collections. A collection is +// a compilation of hadiths collected and written by an author. +func ListAvailableCollections() { + sunnahService := sunnah.NewSunnahService(os.Getenv("M3O_API_TOKEN")) + rsp, err := sunnahService.Collections(&sunnah.CollectionsRequest{ + + }) + fmt.Println(rsp, err) + +} +``` diff --git a/examples/sunnah/books/getTheBooksWithinACollection/main.go b/examples/sunnah/books/getTheBooksWithinACollection/main.go index 8df4a5c..397bd23 100755 --- a/examples/sunnah/books/getTheBooksWithinACollection/main.go +++ b/examples/sunnah/books/getTheBooksWithinACollection/main.go @@ -15,5 +15,4 @@ func main() { Collection: "bukhari", }) fmt.Println(rsp, err) - } diff --git a/examples/sunnah/chapters/listTheChaptersInABook/main.go b/examples/sunnah/chapters/listTheChaptersInABook/main.go index ea670a7..d38375c 100755 --- a/examples/sunnah/chapters/listTheChaptersInABook/main.go +++ b/examples/sunnah/chapters/listTheChaptersInABook/main.go @@ -15,5 +15,4 @@ func main() { Collection: "bukhari", }) fmt.Println(rsp, err) - } diff --git a/examples/sunnah/collections/listAvailableCollections/main.go b/examples/sunnah/collections/listAvailableCollections/main.go index 403d502..d97caa8 100755 --- a/examples/sunnah/collections/listAvailableCollections/main.go +++ b/examples/sunnah/collections/listAvailableCollections/main.go @@ -13,5 +13,4 @@ func main() { sunnahService := sunnah.NewSunnahService(os.Getenv("M3O_API_TOKEN")) rsp, err := sunnahService.Collections(&sunnah.CollectionsRequest{}) fmt.Println(rsp, err) - } diff --git a/examples/sunnah/hadiths/listTheHadithsInABook/main.go b/examples/sunnah/hadiths/listTheHadithsInABook/main.go index e7f4ed0..897ffc5 100755 --- a/examples/sunnah/hadiths/listTheHadithsInABook/main.go +++ b/examples/sunnah/hadiths/listTheHadithsInABook/main.go @@ -16,5 +16,4 @@ func main() { Collection: "bukhari", }) fmt.Println(rsp, err) - } diff --git a/examples/thumbnail/screenshot/takeScreenshotOfAUrl/main.go b/examples/thumbnail/screenshot/takeScreenshotOfAUrl/main.go index 9df378b..f473021 100755 --- a/examples/thumbnail/screenshot/takeScreenshotOfAUrl/main.go +++ b/examples/thumbnail/screenshot/takeScreenshotOfAUrl/main.go @@ -16,5 +16,4 @@ func main() { Width: 600, }) fmt.Println(rsp, err) - } diff --git a/examples/time/README.md b/examples/time/README.md index 73de990..29b28b8 100755 --- a/examples/time/README.md +++ b/examples/time/README.md @@ -4,6 +4,33 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/Time/api](http Endpoints: +## Now + +Get the current time + + +[https://m3o.com/time/api#Now](https://m3o.com/time/api#Now) + +```go +package example + +import( + "fmt" + "os" + + "go.m3o.com/time" +) + +// Get the current time +func ReturnsCurrentTimeOptionallyWithLocation() { + timeService := time.NewTimeService(os.Getenv("M3O_API_TOKEN")) + rsp, err := timeService.Now(&time.NowRequest{ + + }) + fmt.Println(rsp, err) + +} +``` ## Zone Get the timezone info for a specific location @@ -32,30 +59,3 @@ func GetTheTimezoneInfoForAspecificLocation() { } ``` -## Now - -Get the current time - - -[https://m3o.com/time/api#Now](https://m3o.com/time/api#Now) - -```go -package example - -import( - "fmt" - "os" - - "go.m3o.com/time" -) - -// Get the current time -func ReturnsCurrentTimeOptionallyWithLocation() { - timeService := time.NewTimeService(os.Getenv("M3O_API_TOKEN")) - rsp, err := timeService.Now(&time.NowRequest{ - - }) - fmt.Println(rsp, err) - -} -``` diff --git a/examples/time/now/returnsCurrentTimeOptionallyWithLocation/main.go b/examples/time/now/returnsCurrentTimeOptionallyWithLocation/main.go index baee4d9..5770dc1 100755 --- a/examples/time/now/returnsCurrentTimeOptionallyWithLocation/main.go +++ b/examples/time/now/returnsCurrentTimeOptionallyWithLocation/main.go @@ -12,5 +12,4 @@ func main() { timeService := time.NewTimeService(os.Getenv("M3O_API_TOKEN")) rsp, err := timeService.Now(&time.NowRequest{}) fmt.Println(rsp, err) - } diff --git a/examples/time/zone/getTheTimezoneInfoForASpecificLocation/main.go b/examples/time/zone/getTheTimezoneInfoForASpecificLocation/main.go index eaa1678..9a2a98f 100755 --- a/examples/time/zone/getTheTimezoneInfoForASpecificLocation/main.go +++ b/examples/time/zone/getTheTimezoneInfoForASpecificLocation/main.go @@ -14,5 +14,4 @@ func main() { Location: "London", }) fmt.Println(rsp, err) - } diff --git a/examples/twitter/search/searchForTweets/main.go b/examples/twitter/search/searchForTweets/main.go index 82455c3..ad8aa8d 100755 --- a/examples/twitter/search/searchForTweets/main.go +++ b/examples/twitter/search/searchForTweets/main.go @@ -14,5 +14,4 @@ func main() { Query: "cats", }) fmt.Println(rsp, err) - } diff --git a/examples/twitter/timeline/getATwitterTimeline/main.go b/examples/twitter/timeline/getATwitterTimeline/main.go index 92297d8..c1be363 100755 --- a/examples/twitter/timeline/getATwitterTimeline/main.go +++ b/examples/twitter/timeline/getATwitterTimeline/main.go @@ -15,5 +15,4 @@ func main() { Username: "m3oservices", }) fmt.Println(rsp, err) - } diff --git a/examples/twitter/trends/getTheCurrentGlobalTrendingTopics/main.go b/examples/twitter/trends/getTheCurrentGlobalTrendingTopics/main.go index 2be453a..eacab68 100755 --- a/examples/twitter/trends/getTheCurrentGlobalTrendingTopics/main.go +++ b/examples/twitter/trends/getTheCurrentGlobalTrendingTopics/main.go @@ -12,5 +12,4 @@ func main() { twitterService := twitter.NewTwitterService(os.Getenv("M3O_API_TOKEN")) rsp, err := twitterService.Trends(&twitter.TrendsRequest{}) fmt.Println(rsp, err) - } diff --git a/examples/twitter/user/getAUsersTwitterProfile/main.go b/examples/twitter/user/getAUsersTwitterProfile/main.go index f31cbcc..7fb502e 100755 --- a/examples/twitter/user/getAUsersTwitterProfile/main.go +++ b/examples/twitter/user/getAUsersTwitterProfile/main.go @@ -14,5 +14,4 @@ func main() { Username: "crufter", }) fmt.Println(rsp, err) - } diff --git a/examples/url/README.md b/examples/url/README.md index 9cb9280..20c224a 100755 --- a/examples/url/README.md +++ b/examples/url/README.md @@ -4,6 +4,33 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/Url/api](https Endpoints: +## Proxy + +Proxy returns the destination URL of a short URL. + + +[https://m3o.com/url/api#Proxy](https://m3o.com/url/api#Proxy) + +```go +package example + +import( + "fmt" + "os" + + "go.m3o.com/url" +) + +// Proxy returns the destination URL of a short URL. +func ResolveAshortUrlToAlongDestinationUrl() { + urlService := url.NewUrlService(os.Getenv("M3O_API_TOKEN")) + rsp, err := urlService.Proxy(&url.ProxyRequest{ + + }) + fmt.Println(rsp, err) + +} +``` ## List List information on all the shortened URLs that you have created @@ -58,30 +85,3 @@ func ShortenAlongUrl() { } ``` -## Proxy - -Proxy returns the destination URL of a short URL. - - -[https://m3o.com/url/api#Proxy](https://m3o.com/url/api#Proxy) - -```go -package example - -import( - "fmt" - "os" - - "go.m3o.com/url" -) - -// Proxy returns the destination URL of a short URL. -func ResolveAshortUrlToAlongDestinationUrl() { - urlService := url.NewUrlService(os.Getenv("M3O_API_TOKEN")) - rsp, err := urlService.Proxy(&url.ProxyRequest{ - - }) - fmt.Println(rsp, err) - -} -``` diff --git a/examples/url/list/listYourShortenedUrls/main.go b/examples/url/list/listYourShortenedUrls/main.go index ac507e3..51656af 100755 --- a/examples/url/list/listYourShortenedUrls/main.go +++ b/examples/url/list/listYourShortenedUrls/main.go @@ -12,5 +12,4 @@ func main() { urlService := url.NewUrlService(os.Getenv("M3O_API_TOKEN")) rsp, err := urlService.List(&url.ListRequest{}) fmt.Println(rsp, err) - } diff --git a/examples/url/proxy/resolveAShortUrlToALongDestinationUrl/main.go b/examples/url/proxy/resolveAShortUrlToALongDestinationUrl/main.go index 03637b7..91414c4 100755 --- a/examples/url/proxy/resolveAShortUrlToALongDestinationUrl/main.go +++ b/examples/url/proxy/resolveAShortUrlToALongDestinationUrl/main.go @@ -12,5 +12,4 @@ func main() { urlService := url.NewUrlService(os.Getenv("M3O_API_TOKEN")) rsp, err := urlService.Proxy(&url.ProxyRequest{}) fmt.Println(rsp, err) - } diff --git a/examples/url/shorten/shortenALongUrl/main.go b/examples/url/shorten/shortenALongUrl/main.go index 25029f3..fcec9c6 100755 --- a/examples/url/shorten/shortenALongUrl/main.go +++ b/examples/url/shorten/shortenALongUrl/main.go @@ -12,5 +12,4 @@ func main() { urlService := url.NewUrlService(os.Getenv("M3O_API_TOKEN")) rsp, err := urlService.Shorten(&url.ShortenRequest{}) fmt.Println(rsp, err) - } diff --git a/examples/user/README.md b/examples/user/README.md index 6e6ad3b..1a1b509 100755 --- a/examples/user/README.md +++ b/examples/user/README.md @@ -4,6 +4,37 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/User/api](http Endpoints: +## Login + +Login using username or email. The response will return a new session for successful login, +401 in the case of login failure and 500 for any other error + + +[https://m3o.com/user/api#Login](https://m3o.com/user/api#Login) + +```go +package example + +import( + "fmt" + "os" + + "go.m3o.com/user" +) + +// Login using username or email. The response will return a new session for successful login, +// 401 in the case of login failure and 500 for any other error +func LogAuserIn() { + userService := user.NewUserService(os.Getenv("M3O_API_TOKEN")) + rsp, err := userService.Login(&user.LoginRequest{ + Email: "joe@example.com", +Password: "Password1", + + }) + fmt.Println(rsp, err) + +} +``` ## ReadSession Read a session by the session id. In the event it has expired or is not found and error is returned. @@ -90,172 +121,6 @@ Id: "user-1", }) fmt.Println(rsp, err) -} -``` -## SendVerificationEmail - -Send a verification email -to the user being signed up. Email from will be from 'noreply@email.m3ocontent.com', -but you can provide the title and contents. -The verification link will be injected in to the email as a template variable, $micro_verification_link. -Example: 'Hi there, welcome onboard! Use the link below to verify your email: $micro_verification_link' -The variable will be replaced with an actual url that will look similar to this: -'https://user.m3o.com/user/verify?token=a-verification-token&redirectUrl=your-redir-url' - - -[https://m3o.com/user/api#SendVerificationEmail](https://m3o.com/user/api#SendVerificationEmail) - -```go -package example - -import( - "fmt" - "os" - - "go.m3o.com/user" -) - -// Send a verification email -// to the user being signed up. Email from will be from 'noreply@email.m3ocontent.com', -// but you can provide the title and contents. -// The verification link will be injected in to the email as a template variable, $micro_verification_link. -// Example: 'Hi there, welcome onboard! Use the link below to verify your email: $micro_verification_link' -// The variable will be replaced with an actual url that will look similar to this: -// 'https://user.m3o.com/user/verify?token=a-verification-token&redirectUrl=your-redir-url' -func SendVerificationEmail() { - userService := user.NewUserService(os.Getenv("M3O_API_TOKEN")) - rsp, err := userService.SendVerificationEmail(&user.SendVerificationEmailRequest{ - Email: "joe@example.com", -FailureRedirectUrl: "https://m3o.com/verification-failed", -FromName: "Awesome Dot Com", -RedirectUrl: "https://m3o.com", -Subject: "Email verification", -TextContent: `Hi there, - -Please verify your email by clicking this link: $micro_verification_link`, - - }) - fmt.Println(rsp, err) - -} -``` -## ResetPassword - -Reset password with the code sent by the "SendPasswordResetEmail" endoint. - - -[https://m3o.com/user/api#ResetPassword](https://m3o.com/user/api#ResetPassword) - -```go -package example - -import( - "fmt" - "os" - - "go.m3o.com/user" -) - -// Reset password with the code sent by the "SendPasswordResetEmail" endoint. -func ResetPassword() { - userService := user.NewUserService(os.Getenv("M3O_API_TOKEN")) - rsp, err := userService.ResetPassword(&user.ResetPasswordRequest{ - Code: "012345", -ConfirmPassword: "NewPassword1", -Email: "joe@example.com", -NewPassword: "NewPassword1", - - }) - fmt.Println(rsp, err) - -} -``` -## VerifyEmail - -Verify the email address of an account from a token sent in an email to the user. - - -[https://m3o.com/user/api#VerifyEmail](https://m3o.com/user/api#VerifyEmail) - -```go -package example - -import( - "fmt" - "os" - - "go.m3o.com/user" -) - -// Verify the email address of an account from a token sent in an email to the user. -func VerifyEmail() { - userService := user.NewUserService(os.Getenv("M3O_API_TOKEN")) - rsp, err := userService.VerifyEmail(&user.VerifyEmailRequest{ - Email: "joe@example.com", -Token: "012345", - - }) - fmt.Println(rsp, err) - -} -``` -## Login - -Login using username or email. The response will return a new session for successful login, -401 in the case of login failure and 500 for any other error - - -[https://m3o.com/user/api#Login](https://m3o.com/user/api#Login) - -```go -package example - -import( - "fmt" - "os" - - "go.m3o.com/user" -) - -// Login using username or email. The response will return a new session for successful login, -// 401 in the case of login failure and 500 for any other error -func LogAuserIn() { - userService := user.NewUserService(os.Getenv("M3O_API_TOKEN")) - rsp, err := userService.Login(&user.LoginRequest{ - Email: "joe@example.com", -Password: "Password1", - - }) - fmt.Println(rsp, err) - -} -``` -## Logout - -Logout a user account - - -[https://m3o.com/user/api#Logout](https://m3o.com/user/api#Logout) - -```go -package example - -import( - "fmt" - "os" - - "go.m3o.com/user" -) - -// Logout a user account -func LogAuserOut() { - userService := user.NewUserService(os.Getenv("M3O_API_TOKEN")) - rsp, err := userService.Logout(&user.LogoutRequest{ - SessionId: "df91a612-5b24-4634-99ff-240220ab8f55", - - }) - fmt.Println(rsp, err) - } ``` ## UpdatePassword @@ -370,6 +235,53 @@ func ReadAccountByEmail() { }) fmt.Println(rsp, err) +} +``` +## SendVerificationEmail + +Send a verification email +to the user being signed up. Email from will be from 'noreply@email.m3ocontent.com', +but you can provide the title and contents. +The verification link will be injected in to the email as a template variable, $micro_verification_link. +Example: 'Hi there, welcome onboard! Use the link below to verify your email: $micro_verification_link' +The variable will be replaced with an actual url that will look similar to this: +'https://user.m3o.com/user/verify?token=a-verification-token&redirectUrl=your-redir-url' + + +[https://m3o.com/user/api#SendVerificationEmail](https://m3o.com/user/api#SendVerificationEmail) + +```go +package example + +import( + "fmt" + "os" + + "go.m3o.com/user" +) + +// Send a verification email +// to the user being signed up. Email from will be from 'noreply@email.m3ocontent.com', +// but you can provide the title and contents. +// The verification link will be injected in to the email as a template variable, $micro_verification_link. +// Example: 'Hi there, welcome onboard! Use the link below to verify your email: $micro_verification_link' +// The variable will be replaced with an actual url that will look similar to this: +// 'https://user.m3o.com/user/verify?token=a-verification-token&redirectUrl=your-redir-url' +func SendVerificationEmail() { + userService := user.NewUserService(os.Getenv("M3O_API_TOKEN")) + rsp, err := userService.SendVerificationEmail(&user.SendVerificationEmailRequest{ + Email: "joe@example.com", +FailureRedirectUrl: "https://m3o.com/verification-failed", +FromName: "Awesome Dot Com", +RedirectUrl: "https://m3o.com", +Subject: "Email verification", +TextContent: `Hi there, + +Please verify your email by clicking this link: $micro_verification_link`, + + }) + fmt.Println(rsp, err) + } ``` ## SendPasswordResetEmail @@ -404,34 +316,6 @@ TextContent: `Hi there, }) fmt.Println(rsp, err) -} -``` -## Delete - -Delete an account by id - - -[https://m3o.com/user/api#Delete](https://m3o.com/user/api#Delete) - -```go -package example - -import( - "fmt" - "os" - - "go.m3o.com/user" -) - -// Delete an account by id -func DeleteUserAccount() { - userService := user.NewUserService(os.Getenv("M3O_API_TOKEN")) - rsp, err := userService.Delete(&user.DeleteRequest{ - Id: "8b98acbe-0b6a-4d66-a414-5ffbf666786f", - - }) - fmt.Println(rsp, err) - } ``` ## List @@ -463,3 +347,119 @@ Offset: 0, } ``` +## ResetPassword + +Reset password with the code sent by the "SendPasswordResetEmail" endoint. + + +[https://m3o.com/user/api#ResetPassword](https://m3o.com/user/api#ResetPassword) + +```go +package example + +import( + "fmt" + "os" + + "go.m3o.com/user" +) + +// Reset password with the code sent by the "SendPasswordResetEmail" endoint. +func ResetPassword() { + userService := user.NewUserService(os.Getenv("M3O_API_TOKEN")) + rsp, err := userService.ResetPassword(&user.ResetPasswordRequest{ + Code: "012345", +ConfirmPassword: "NewPassword1", +Email: "joe@example.com", +NewPassword: "NewPassword1", + + }) + fmt.Println(rsp, err) + +} +``` +## VerifyEmail + +Verify the email address of an account from a token sent in an email to the user. + + +[https://m3o.com/user/api#VerifyEmail](https://m3o.com/user/api#VerifyEmail) + +```go +package example + +import( + "fmt" + "os" + + "go.m3o.com/user" +) + +// Verify the email address of an account from a token sent in an email to the user. +func VerifyEmail() { + userService := user.NewUserService(os.Getenv("M3O_API_TOKEN")) + rsp, err := userService.VerifyEmail(&user.VerifyEmailRequest{ + Email: "joe@example.com", +Token: "012345", + + }) + fmt.Println(rsp, err) + +} +``` +## Delete + +Delete an account by id + + +[https://m3o.com/user/api#Delete](https://m3o.com/user/api#Delete) + +```go +package example + +import( + "fmt" + "os" + + "go.m3o.com/user" +) + +// Delete an account by id +func DeleteUserAccount() { + userService := user.NewUserService(os.Getenv("M3O_API_TOKEN")) + rsp, err := userService.Delete(&user.DeleteRequest{ + Id: "8b98acbe-0b6a-4d66-a414-5ffbf666786f", + + }) + fmt.Println(rsp, err) + +} +``` +## Logout + +Logout a user account + + +[https://m3o.com/user/api#Logout](https://m3o.com/user/api#Logout) + +```go +package example + +import( + "fmt" + "os" + + "go.m3o.com/user" +) + +// Logout a user account +func LogAuserOut() { + userService := user.NewUserService(os.Getenv("M3O_API_TOKEN")) + rsp, err := userService.Logout(&user.LogoutRequest{ + SessionId: "df91a612-5b24-4634-99ff-240220ab8f55", + + }) + fmt.Println(rsp, err) + +} +``` diff --git a/examples/user/create/createAnAccount/main.go b/examples/user/create/createAnAccount/main.go index 544e754..b04f3a5 100755 --- a/examples/user/create/createAnAccount/main.go +++ b/examples/user/create/createAnAccount/main.go @@ -17,5 +17,4 @@ func main() { Username: "joe", }) fmt.Println(rsp, err) - } diff --git a/examples/user/delete/deleteUserAccount/main.go b/examples/user/delete/deleteUserAccount/main.go index 04b6c4a..378a23d 100755 --- a/examples/user/delete/deleteUserAccount/main.go +++ b/examples/user/delete/deleteUserAccount/main.go @@ -14,5 +14,4 @@ func main() { Id: "8b98acbe-0b6a-4d66-a414-5ffbf666786f", }) fmt.Println(rsp, err) - } diff --git a/examples/user/list/listAllUsers/main.go b/examples/user/list/listAllUsers/main.go index 314e333..8d210a9 100755 --- a/examples/user/list/listAllUsers/main.go +++ b/examples/user/list/listAllUsers/main.go @@ -15,5 +15,4 @@ func main() { Offset: 0, }) fmt.Println(rsp, err) - } diff --git a/examples/user/login/logAUserIn/main.go b/examples/user/login/logAUserIn/main.go index e44c9fb..0ff0b27 100755 --- a/examples/user/login/logAUserIn/main.go +++ b/examples/user/login/logAUserIn/main.go @@ -16,5 +16,4 @@ func main() { Password: "Password1", }) fmt.Println(rsp, err) - } diff --git a/examples/user/logout/logAUserOut/main.go b/examples/user/logout/logAUserOut/main.go index 1dd45a0..079df02 100755 --- a/examples/user/logout/logAUserOut/main.go +++ b/examples/user/logout/logAUserOut/main.go @@ -14,5 +14,4 @@ func main() { SessionId: "df91a612-5b24-4634-99ff-240220ab8f55", }) fmt.Println(rsp, err) - } diff --git a/examples/user/read/readAccountByEmail/main.go b/examples/user/read/readAccountByEmail/main.go index 4f1b825..f5b9f0a 100755 --- a/examples/user/read/readAccountByEmail/main.go +++ b/examples/user/read/readAccountByEmail/main.go @@ -14,5 +14,4 @@ func main() { Email: "joe@example.com", }) fmt.Println(rsp, err) - } diff --git a/examples/user/read/readAccountByUsernameOrEmail/main.go b/examples/user/read/readAccountByUsernameOrEmail/main.go index e097129..c5004e8 100755 --- a/examples/user/read/readAccountByUsernameOrEmail/main.go +++ b/examples/user/read/readAccountByUsernameOrEmail/main.go @@ -14,5 +14,4 @@ func main() { Username: "joe", }) fmt.Println(rsp, err) - } diff --git a/examples/user/read/readAnAccountById/main.go b/examples/user/read/readAnAccountById/main.go index 0f90d60..50097cb 100755 --- a/examples/user/read/readAnAccountById/main.go +++ b/examples/user/read/readAnAccountById/main.go @@ -14,5 +14,4 @@ func main() { Id: "user-1", }) fmt.Println(rsp, err) - } diff --git a/examples/user/readSession/readASessionByTheSessionId/main.go b/examples/user/readSession/readASessionByTheSessionId/main.go index 5530648..250ca2c 100755 --- a/examples/user/readSession/readASessionByTheSessionId/main.go +++ b/examples/user/readSession/readASessionByTheSessionId/main.go @@ -14,5 +14,4 @@ func main() { SessionId: "df91a612-5b24-4634-99ff-240220ab8f55", }) fmt.Println(rsp, err) - } diff --git a/examples/user/resetPassword/resetPassword/main.go b/examples/user/resetPassword/resetPassword/main.go index 2bace80..7548de3 100755 --- a/examples/user/resetPassword/resetPassword/main.go +++ b/examples/user/resetPassword/resetPassword/main.go @@ -17,5 +17,4 @@ func main() { NewPassword: "NewPassword1", }) fmt.Println(rsp, err) - } diff --git a/examples/user/sendPasswordResetEmail/sendPasswordResetEmail/main.go b/examples/user/sendPasswordResetEmail/sendPasswordResetEmail/main.go index ae47412..6dc1215 100755 --- a/examples/user/sendPasswordResetEmail/sendPasswordResetEmail/main.go +++ b/examples/user/sendPasswordResetEmail/sendPasswordResetEmail/main.go @@ -19,5 +19,4 @@ func main() { click here to reset your password: myapp.com/reset/code?=$code`, }) fmt.Println(rsp, err) - } diff --git a/examples/user/sendVerificationEmail/sendVerificationEmail/main.go b/examples/user/sendVerificationEmail/sendVerificationEmail/main.go index 8f3d3f3..f61446d 100755 --- a/examples/user/sendVerificationEmail/sendVerificationEmail/main.go +++ b/examples/user/sendVerificationEmail/sendVerificationEmail/main.go @@ -27,5 +27,4 @@ func main() { Please verify your email by clicking this link: $micro_verification_link`, }) fmt.Println(rsp, err) - } diff --git a/examples/user/update/updateAnAccount/main.go b/examples/user/update/updateAnAccount/main.go index e6c9284..ca76bf8 100755 --- a/examples/user/update/updateAnAccount/main.go +++ b/examples/user/update/updateAnAccount/main.go @@ -15,5 +15,4 @@ func main() { Id: "user-1", }) fmt.Println(rsp, err) - } diff --git a/examples/user/updatePassword/updateTheAccountPassword/main.go b/examples/user/updatePassword/updateTheAccountPassword/main.go index 2c12313..d14e2e3 100755 --- a/examples/user/updatePassword/updateTheAccountPassword/main.go +++ b/examples/user/updatePassword/updateTheAccountPassword/main.go @@ -16,5 +16,4 @@ func main() { OldPassword: "Password1", }) fmt.Println(rsp, err) - } diff --git a/examples/user/verifyEmail/verifyEmail/main.go b/examples/user/verifyEmail/verifyEmail/main.go index d9c40ed..668c977 100755 --- a/examples/user/verifyEmail/verifyEmail/main.go +++ b/examples/user/verifyEmail/verifyEmail/main.go @@ -15,5 +15,4 @@ func main() { Token: "012345", }) fmt.Println(rsp, err) - } diff --git a/examples/vehicle/lookup/lookupVehicle/main.go b/examples/vehicle/lookup/lookupVehicle/main.go index 4e93eee..f5e2383 100755 --- a/examples/vehicle/lookup/lookupVehicle/main.go +++ b/examples/vehicle/lookup/lookupVehicle/main.go @@ -14,5 +14,4 @@ func main() { Registration: "LC60OTA", }) fmt.Println(rsp, err) - } diff --git a/examples/weather/forecast/forecastWeather/main.go b/examples/weather/forecast/forecastWeather/main.go index 9753116..d8d2841 100755 --- a/examples/weather/forecast/forecastWeather/main.go +++ b/examples/weather/forecast/forecastWeather/main.go @@ -15,5 +15,4 @@ func main() { Location: "London", }) fmt.Println(rsp, err) - } diff --git a/examples/weather/now/getCurrentWeather/main.go b/examples/weather/now/getCurrentWeather/main.go index 4bd8fd0..7c9ca4e 100755 --- a/examples/weather/now/getCurrentWeather/main.go +++ b/examples/weather/now/getCurrentWeather/main.go @@ -14,5 +14,4 @@ func main() { Location: "london", }) fmt.Println(rsp, err) - } diff --git a/examples/youtube/search/searchForVideos/main.go b/examples/youtube/search/searchForVideos/main.go index 1694902..af5292e 100755 --- a/examples/youtube/search/searchForVideos/main.go +++ b/examples/youtube/search/searchForVideos/main.go @@ -14,5 +14,4 @@ func main() { Query: "donuts", }) fmt.Println(rsp, err) - }