| name | warp-go-sdk |
| description | Go SDK for Warp API. Use when writing Go code that calls Warp API with the github.com/TeamWarp/warp-go-sdk package: installing it, constructing and authenticating the client, and calling API operations. |
Warp Go SDK
Generated Go client for Warp API, published as github.com/TeamWarp/warp-go-sdk. Use the generated client instead of hand-writing HTTP requests.
Install
go get github.com/TeamWarp/warp-go-sdk
Client setup and authentication
import (
"context"
"fmt"
sdk "github.com/TeamWarp/warp-go-sdk"
)
client := sdk.NewClient()
Provide credentials using the options below. Environment variables are read automatically when the target runtime supports them:
option.WithAPIKey (env: WARP_API_KEY) — The API key for header authorization.
Calling operations
package main
import (
"context"
"fmt"
"os"
sdk "github.com/TeamWarp/warp-go-sdk"
"github.com/TeamWarp/warp-go-sdk/option"
)
func main() {
client := sdk.NewClient(
option.WithAPIKey(os.Getenv("WARP_API_KEY")),
)
healthPlan, err := client.Benefits.HealthPlans.List(context.Background(), sdk.BenefitHealthPlanListParams{
Statuses: sdk.F[[]sdk.BenefitHealthPlanListParamsStatus]([]sdk.BenefitHealthPlanListParamsStatus{}),
})
err != {
(err)
}
fmt.Println(healthPlan)
}