(Apis)
package main
import(
unkeygo "github.com/unkeyed/unkey-go"
"github.com/unkeyed/unkey-go/models/operations"
"context"
"log"
)
func main() {
s := unkeygo.New(
unkeygo.WithSecurity("UNKEY_ROOT_KEY"),
)
ctx := context.Background()
res, err := s.Apis.GetAPI(ctx, operations.GetAPIRequest{
APIID: "api_1234",
})
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
// handle response
}
}
*operations.GetAPIResponse, error
Error Type |
Status Code |
Content Type |
sdkerrors.ErrBadRequest |
400 |
application/json |
sdkerrors.ErrUnauthorized |
401 |
application/json |
sdkerrors.ErrForbidden |
403 |
application/json |
sdkerrors.ErrNotFound |
404 |
application/json |
sdkerrors.ErrConflict |
409 |
application/json |
sdkerrors.ErrTooManyRequests |
429 |
application/json |
sdkerrors.ErrInternalServerError |
500 |
application/json |
sdkerrors.SDKError |
4XX, 5XX |
*/* |
package main
import(
unkeygo "github.com/unkeyed/unkey-go"
"github.com/unkeyed/unkey-go/models/operations"
"context"
"log"
)
func main() {
s := unkeygo.New(
unkeygo.WithSecurity("UNKEY_ROOT_KEY"),
)
ctx := context.Background()
res, err := s.Apis.CreateAPI(ctx, operations.CreateAPIRequestBody{
Name: "my-api",
})
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
// handle response
}
}
*operations.CreateAPIResponse, error
Error Type |
Status Code |
Content Type |
sdkerrors.ErrBadRequest |
400 |
application/json |
sdkerrors.ErrUnauthorized |
401 |
application/json |
sdkerrors.ErrForbidden |
403 |
application/json |
sdkerrors.ErrNotFound |
404 |
application/json |
sdkerrors.ErrConflict |
409 |
application/json |
sdkerrors.ErrTooManyRequests |
429 |
application/json |
sdkerrors.ErrInternalServerError |
500 |
application/json |
sdkerrors.SDKError |
4XX, 5XX |
*/* |
package main
import(
unkeygo "github.com/unkeyed/unkey-go"
"github.com/unkeyed/unkey-go/models/operations"
"context"
"log"
)
func main() {
s := unkeygo.New(
unkeygo.WithSecurity("UNKEY_ROOT_KEY"),
)
ctx := context.Background()
res, err := s.Apis.ListKeys(ctx, operations.ListKeysRequest{
APIID: "api_1234",
Limit: unkeygo.Int64(100),
})
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
// handle response
}
}
*operations.ListKeysResponse, error
Error Type |
Status Code |
Content Type |
sdkerrors.ErrBadRequest |
400 |
application/json |
sdkerrors.ErrUnauthorized |
401 |
application/json |
sdkerrors.ErrForbidden |
403 |
application/json |
sdkerrors.ErrNotFound |
404 |
application/json |
sdkerrors.ErrConflict |
409 |
application/json |
sdkerrors.ErrTooManyRequests |
429 |
application/json |
sdkerrors.ErrInternalServerError |
500 |
application/json |
sdkerrors.SDKError |
4XX, 5XX |
*/* |
package main
import(
unkeygo "github.com/unkeyed/unkey-go"
"github.com/unkeyed/unkey-go/models/operations"
"context"
"log"
)
func main() {
s := unkeygo.New(
unkeygo.WithSecurity("UNKEY_ROOT_KEY"),
)
ctx := context.Background()
res, err := s.Apis.DeleteAPI(ctx, operations.DeleteAPIRequestBody{
APIID: "api_1234",
})
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
// handle response
}
}
*operations.DeleteAPIResponse, error
Error Type |
Status Code |
Content Type |
sdkerrors.ErrBadRequest |
400 |
application/json |
sdkerrors.ErrUnauthorized |
401 |
application/json |
sdkerrors.ErrForbidden |
403 |
application/json |
sdkerrors.ErrNotFound |
404 |
application/json |
sdkerrors.ErrConflict |
409 |
application/json |
sdkerrors.ErrDeleteProtected |
429 |
application/json |
sdkerrors.ErrInternalServerError |
500 |
application/json |
sdkerrors.SDKError |
4XX, 5XX |
*/* |
package main
import(
unkeygo "github.com/unkeyed/unkey-go"
"github.com/unkeyed/unkey-go/models/operations"
"context"
"log"
)
func main() {
s := unkeygo.New(
unkeygo.WithSecurity("UNKEY_ROOT_KEY"),
)
ctx := context.Background()
res, err := s.Apis.DeleteKeys(ctx, operations.DeleteKeysRequestBody{
APIID: "api_1234",
})
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
// handle response
}
}
*operations.DeleteKeysResponse, error
Error Type |
Status Code |
Content Type |
sdkerrors.ErrBadRequest |
400 |
application/json |
sdkerrors.ErrUnauthorized |
401 |
application/json |
sdkerrors.ErrForbidden |
403 |
application/json |
sdkerrors.ErrNotFound |
404 |
application/json |
sdkerrors.ErrConflict |
409 |
application/json |
sdkerrors.ErrTooManyRequests |
429 |
application/json |
sdkerrors.ErrInternalServerError |
500 |
application/json |
sdkerrors.SDKError |
4XX, 5XX |
*/* |