List roles
List roles
client.Zones.Roles.List(ctx, zoneID, query) (*ZoneRoleListResponse, error)
GET/zones/{zoneId}/roles
Returns the roles defined in the specified zone. The full result set is currently returned in a single page; the after/before/limit cursor parameters are reserved and not yet enforced, and pagination cursors are always null.
Parameters
zoneID string
Returns
List roles
package main
import (
"context"
"fmt"
"github.com/keycardai/keycard-go"
"github.com/keycardai/keycard-go/option"
)
func main() {
client := keycard.NewClient(
option.WithAPIKey("My API Key"),
)
roles, err := client.Zones.Roles.List(
context.TODO(),
"zoneId",
keycard.ZoneRoleListParams{
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", roles.Items)
}
{
"items": [
{
"id": "id",
"created_at": "2019-12-27T18:11:19.117Z",
"identifier": "identifier",
"owner_type": "platform",
"updated_at": "2019-12-27T18:11:19.117Z",
"zone_id": "zone_id",
"description": "description"
}
],
"pagination": {
"after_cursor": "x",
"before_cursor": "x",
"total_count": 0
}
}Returns Examples
{
"items": [
{
"id": "id",
"created_at": "2019-12-27T18:11:19.117Z",
"identifier": "identifier",
"owner_type": "platform",
"updated_at": "2019-12-27T18:11:19.117Z",
"zone_id": "zone_id",
"description": "description"
}
],
"pagination": {
"after_cursor": "x",
"before_cursor": "x",
"total_count": 0
}
}