VipPerkUpdateRequest vip.perk-update-request@1
Generated at from
openvibe-contracts v0.53.0 and
openvibe-sdk v0.11.0.
- Version
- 1.0.0
- Owner
- vip
- Visibility
- first-party
- Status
- active
- Compatibility
- backward
- Schema
https://openvibe.network/contracts/vip/perk-update-request.v1.json
vip.perk-update-request@1: the body of vip.perk.update on OpenVibe.VIP. PATCH /api/v1/perks/:id: { name?, description?, kind?, status?, bindings? } renames, describes or retires a perk, or replaces its product bindings. Published plan versions keep the perk snapshot they were written with. Refusals are problem+json: 404 vip.perk_not_found; 422 vip.invalid_input or vip.text_too_long; 403 capability.denied. Unknown fields are ignored.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
name | string |
| ||
description | string | null |
| ||
kind | enum |
| ||
status | enum |
| ||
bindings | array of object | Replaces the perk's active bindings (a binding left out is removed). Each (product, binding) at most once. |
| |
bindings[].product | string | yes | A service id: live, chat, community, blog, … |
|
bindings[].binding | string | yes | chat_badge, room_access, gated_post, … |
|
bindings[].config | object | null | Under 2 KB of JSON; default {}. |
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: rebind
{
"bindings": [
{
"product": "live",
"binding": "chat_badge"
},
{
"product": "chat",
"binding": "chat_badge",
"config": {
"icon": "crown"
}
}
]
}Valid: retire
{
"status": "retired"
}Rejected: deleted
{
"status": "deleted"
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('vip.perk-update-request@1', value); // { valid, errors: [{ path, message }] }