Update a property definition
client.Prism.Properties.Update(ctx, objectType, propertyID, params) (*PropertyDefinition, error)
PATCH/v2/prism/{teamId}/{objectType}/properties/{propertyId}
Patches the editable fields (name, icon, enabled) of a property definition. type and scoping fields are immutable; type must be supplied in the body so the server knows which per-type table to write.
Update a property definition
package main
import (
"context"
"fmt"
"github.com/micro-so/micro-sdk-go"
"github.com/micro-so/micro-sdk-go/option"
)
func main() {
client := micro.NewClient(
option.WithAPIKey("My API Key"),
option.WithTeamID("My Team ID"),
)
propertyDefinition, err := client.Prism.Properties.Update(
context.TODO(),
micro.PrismPropertyUpdateParamsObjectTypeComment,
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
micro.PrismPropertyUpdateParams{
PropertyDefinitionPatch: micro.PropertyDefinitionPatchParam{
Type: micro.F(micro.PropertyDefinitionPatchTypeNum),
},
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", propertyDefinition.ID)
}
{
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"slug": "slug",
"type": "num",
"alias": "app_stage",
"crm_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"list_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"locked": true,
"name": "name",
"native": true,
"options": [
{
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"slug": "slug",
"color_scheme": "color_scheme",
"crm_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"description": "description",
"icon": "icon",
"list_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"option_group": "option_group",
"sort_index": 0,
"value": "value"
}
],
"required": true,
"role_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"team_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
}Returns Examples
{
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"slug": "slug",
"type": "num",
"alias": "app_stage",
"crm_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"list_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"locked": true,
"name": "name",
"native": true,
"options": [
{
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"slug": "slug",
"color_scheme": "color_scheme",
"crm_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"description": "description",
"icon": "icon",
"list_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"option_group": "option_group",
"sort_index": 0,
"value": "value"
}
],
"required": true,
"role_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"team_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
}