docs: add examples for apps endpoints to README.md

This commit is contained in:
Stevan Freeborn
2026-03-23 16:31:08 -05:00
parent a543de60db
commit 2ee3506bb3
+57
View File
@@ -89,3 +89,60 @@ if err == nil {
}
```
### Apps
#### Get App by Id
```go
import (
"fmt"
"github.com/StevanFreeborn/onspring-api-sdk-go/onspring"
)
client := onspring.NewClient("your-api-key")
app, err := client.Apps.Get(context.TODO(), 1)
```
#### Get Apps by Page
##### Retrieve a single page
```go
import (
"fmt"
"github.com/StevanFreeborn/onspring-api-sdk-go/onspring"
)
client := onspring.NewClient("your-api-key")
page, err := client.Apps.List(t.Context())
```
##### Retrieve all pages
```go
import (
"fmt"
"github.com/StevanFreeborn/onspring-api-sdk-go/onspring"
)
client := onspring.NewClient("your-api-key")
for app, err := range client.Apps.ListAll(t.Context()) {
// Do stuff
}
```
#### Get Apps by Batch
```go
import (
"fmt"
"github.com/StevanFreeborn/onspring-api-sdk-go/onspring"
)
client := onspring.NewClient("your-api-key")
batch, err := client.Apps.GetMany(t.Context(), []int{ 1 })
```