Skip to contents

The general constructor behind the eleven spec constructors: it builds a spec of kind from its fields and validates it with the kind's validator. Use it for kinds without a constructor (env_alias, setting, service, preset, ...) and for kinds defined by plugins. Unknown fields are kept (forward compatibility); a wrong type of a known field is an error naming the field.

Usage

gptr_spec(kind, name, ...)

Arguments

kind

The kind name, one of the kind.<name> features of gptr_api().

name

The record name within the kind.

...

The kind's fields, named.

Value

A spec: a list of class c("gptr_<kind>", "gptr_spec").

Examples

gptr_spec("env_alias", "SLACK_BOT_TOKEN", aliases = "slack-token")
#> <gptr_env_alias SLACK_BOT_TOKEN>
#>   aliases: slack-token
#>   api_version: 1.0
gptr_spec("setting", "panel.size", default = 3L, description = "Reviewers per panel")
#> <gptr_setting panel.size>
#>   default: 3
#>   description: Reviewers per panel
#>   api_version: 1.0
#>   scope: both