List versions of a policy
List versions of a policy
client.Zones.Policies.Versions.List(ctx, policyID, params) (*ZonePolicyVersionListResponse, error)
GET/zones/{zone_id}/policies/{policy_id}/versions
List versions of a policy
Parameters
policyID string
Returns
List versions of a policy
package main
import (
"context"
"fmt"
"github.com/keycardai/keycard-go"
)
func main() {
client := keycard.NewClient(
)
versions, err := client.Zones.Policies.Versions.List(
context.TODO(),
"policy_id",
keycard.ZonePolicyVersionListParams{
ZoneID: "zone_id",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", versions.Items)
}
{
"items": [
{
"id": "id",
"created_at": "2019-12-27T18:11:19.117Z",
"created_by": "created_by",
"owner_type": "platform",
"policy_id": "policy_id",
"schema_version": "schema_version",
"sha": "sha",
"version": 0,
"zone_id": "zone_id",
"archived_at": "2019-12-27T18:11:19.117Z",
"archived_by": "archived_by",
"cedar_json": {},
"cedar_raw": "cedar_raw"
}
],
"pagination": {
"after_cursor": "x",
"before_cursor": "x",
"total_count": 0
}
}Returns Examples
{
"items": [
{
"id": "id",
"created_at": "2019-12-27T18:11:19.117Z",
"created_by": "created_by",
"owner_type": "platform",
"policy_id": "policy_id",
"schema_version": "schema_version",
"sha": "sha",
"version": 0,
"zone_id": "zone_id",
"archived_at": "2019-12-27T18:11:19.117Z",
"archived_by": "archived_by",
"cedar_json": {},
"cedar_raw": "cedar_raw"
}
],
"pagination": {
"after_cursor": "x",
"before_cursor": "x",
"total_count": 0
}
}