Commit from m3o/m3o action

This commit is contained in:
m3o-actions
2022-02-24 11:35:45 +00:00
parent 1251b49828
commit e9ccf5fa0f
25 changed files with 1190 additions and 1190 deletions

View File

@@ -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(&notes.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(&notes.UpdateRequest{
Note: &notes.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(&notes.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(&notes.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(&notes.UpdateRequest{
Note: &notes.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(&notes.DeleteRequest{
Id: "63c0cdf8-2121-11ec-a881-0242e36f037a",
})
fmt.Println(rsp, err)
}
```