Add a new pet to the store.
Parameters
Returns
Add a new pet to the store.
package main
import (
"context"
"fmt"
"github.com/pedro/barkend"
"github.com/pedro/barkend/option"
)
func main() {
client := barkend.NewClient(
option.WithBearerToken("My Bearer Token"),
)
pet, err := client.Pets.New(context.TODO(), barkend.PetNewParams{
Pet: barkend.PetParam{
Name: "doggie",
PhotoURLs: []string{"string"},
},
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", pet.ID)
}
{
"id": 10,
"name": "doggie",
"photoUrls": [
"https://example.com/dog.jpg"
],
"category": {
"id": 1,
"name": "Dogs"
},
"tags": [
{
"id": 1,
"name": "friendly"
}
],
"status": "available"
}{
"error": {
"id": "invalid_input",
"message": "Invalid input - name and photoUrls required"
}
}{
"error": {
"id": "duplicate_name",
"message": "A pet with this name already exists"
}
}Returns Examples
{
"id": 10,
"name": "doggie",
"photoUrls": [
"https://example.com/dog.jpg"
],
"category": {
"id": 1,
"name": "Dogs"
},
"tags": [
{
"id": 1,
"name": "friendly"
}
],
"status": "available"
}{
"error": {
"id": "invalid_input",
"message": "Invalid input - name and photoUrls required"
}
}{
"error": {
"id": "duplicate_name",
"message": "A pet with this name already exists"
}
}