Add this client as project dependency
go get -u go.clever-cloud.dev/client
import "go.clever-cloud.dev/client"
cc := client.New(
client.WithAutoOauthConfig(),
)
type Self struct {
ID string `json:"id"`
}
res := client.Get[Self](context.Background(), cc, "/v2/self")
if res.HasError() {
// handle res.Error()
}
fmt.Println(res.Payload().ID)
if the operation you want to do does not return anything, use:
res := client.Get[client.Nothing](context.Background(), cc, "/v2/self")