package main
import(
"context"
"os"
latitudeshgosdk "github.com/latitudesh/latitudesh-go-sdk"
"github.com/latitudesh/latitudesh-go-sdk/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := latitudeshgosdk.New(
latitudeshgosdk.WithSecurity(os.Getenv("LATITUDESH_BEARER")),
)
res, err := s.Tags.Create(ctx, operations.CreateTagTagsRequestBody{
Data: &operations.CreateTagTagsData{
Type: operations.CreateTagTagsTypeTags.ToPointer(),
Attributes: &operations.CreateTagTagsAttributes{
Name: latitudeshgosdk.Pointer("Tag Name"),
Description: latitudeshgosdk.Pointer("Tag Description"),
Color: latitudeshgosdk.Pointer("#bebebe"),
},
},
})
if err != nil {
log.Fatal(err)
}
if res.CustomTag != nil {
// handle response
}
}{
"data": {
"id": "tag_7rE4rnrKowTjojXneKprFRjGg19",
"type": "tags",
"attributes": {
"name": "Tag Name",
"slug": "tag-name",
"description": "Tag Description",
"color": "#bebebe",
"team": {
"id": "team_MLv6NBEZrzI5a3XkP5k8cLjYG2o",
"name": "570 Team",
"slug": "570-team",
"description": "570 Team",
"address": "Apt. 638 652 Randall Neck, VonRuedenmouth, KS 94389",
"status": "verified",
"currency": {
"id": "cur_AW6Q2D9lqKLpr",
"code": "BRL",
"name": "Brazilian Real",
"currency_id": null
}
}
}
}
}Create a Tag in the team.
package main
import(
"context"
"os"
latitudeshgosdk "github.com/latitudesh/latitudesh-go-sdk"
"github.com/latitudesh/latitudesh-go-sdk/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := latitudeshgosdk.New(
latitudeshgosdk.WithSecurity(os.Getenv("LATITUDESH_BEARER")),
)
res, err := s.Tags.Create(ctx, operations.CreateTagTagsRequestBody{
Data: &operations.CreateTagTagsData{
Type: operations.CreateTagTagsTypeTags.ToPointer(),
Attributes: &operations.CreateTagTagsAttributes{
Name: latitudeshgosdk.Pointer("Tag Name"),
Description: latitudeshgosdk.Pointer("Tag Description"),
Color: latitudeshgosdk.Pointer("#bebebe"),
},
},
})
if err != nil {
log.Fatal(err)
}
if res.CustomTag != nil {
// handle response
}
}{
"data": {
"id": "tag_7rE4rnrKowTjojXneKprFRjGg19",
"type": "tags",
"attributes": {
"name": "Tag Name",
"slug": "tag-name",
"description": "Tag Description",
"color": "#bebebe",
"team": {
"id": "team_MLv6NBEZrzI5a3XkP5k8cLjYG2o",
"name": "570 Team",
"slug": "570-team",
"description": "570 Team",
"address": "Apt. 638 652 Randall Neck, VonRuedenmouth, KS 94389",
"status": "verified",
"currency": {
"id": "cur_AW6Q2D9lqKLpr",
"code": "BRL",
"name": "Brazilian Real",
"currency_id": null
}
}
}
}
}Show child attributes
Was this page helpful?