Lists and views
Views
Views — Micro Go reference.
Reference for Go SDK 0.8.0.
Release source · Setup and client configuration
New
POST /v2/prism/{teamId}/{viewObjectType}/views
client.Views.New(ctx context.Context, viewObjectType micro.ViewNewParamsViewObjectType, params micro.ViewNewParams) (*micro.ViewNewResponse, error)Create a view bundle (view + select/filter/sort)
Update
PATCH /v2/prism/{teamId}/{viewObjectType}/views/{viewId}
client.Views.Update(ctx context.Context, viewObjectType micro.ViewUpdateParamsViewObjectType, viewID string, params micro.ViewUpdateParams) (*micro.ViewUpdateResponse, error)Update a view bundle (select/filter/sort arrays are replaced wholesale when supplied)
Delete
DELETE /v2/prism/{teamId}/{viewObjectType}/views/{viewId}
client.Views.Delete(ctx context.Context, viewObjectType micro.ViewDeleteParamsViewObjectType, viewID string, body micro.ViewDeleteParams) errorDelete a view bundle
Get
GET /v2/prism/{teamId}/{viewObjectType}/views/{viewId}
client.Views.Get(ctx context.Context, viewObjectType micro.ViewGetParamsViewObjectType, viewID string, params micro.ViewGetParams) (*micro.ViewGetResponse, error)Returns the view bundle. Pass ?include=records to also fetch a page of records selected by the view in the same call; the response is then wrapped as {view, records}.
Parameter and response types
These declarations show the request parameters and response shapes used by the methods above.
ViewNewResponse
type ViewNewResponse struct {
Name string `json:"name" api:"required"`
ViewType string `json:"view_type" api:"required"`
ID string `json:"id" format:"uuid"`
AggregationPropDefID string `json:"aggregation_prop_def_id" api:"nullable" format:"uuid"`
AggregationType string `json:"aggregation_type" api:"nullable"`
ColumnLayout map[string]interface{} `json:"column_layout" api:"nullable"`
Combinator ViewNewResponseCombinator `json:"combinator"`
CreatedAt string `json:"created_at"`
// Each entry is { slug: { comparator: value } }
Filter []map[string]interface{} `json:"filter"`
// Property slug to group by
GroupBy string `json:"group_by" api:"nullable"`
GroupHiddenOptionIDs []interface{} `json:"group_hidden_option_ids" api:"nullable"`
GroupHideEmpty bool `json:"group_hide_empty" api:"nullable"`
GroupSort string `json:"group_sort" api:"nullable"`
Icon string `json:"icon" api:"nullable"`
ListID string `json:"list_id" api:"nullable" format:"uuid"`
// Property slugs (dot-paths permitted for refs)
Select []string `json:"select"`
// Each entry is { slug: 'asc' | 'desc' }
Sort []map[string]interface{} `json:"sort"`
SortOrder int64 `json:"sort_order" api:"nullable"`
TeamID string `json:"team_id" api:"nullable" format:"uuid"`
UpdatedAt string `json:"updated_at" api:"nullable"`
UserID string `json:"user_id" api:"nullable"`
JSON viewNewResponseJSON `json:"-"`
}ViewUpdateResponse
type ViewUpdateResponse struct {
Name string `json:"name" api:"required"`
ViewType string `json:"view_type" api:"required"`
ID string `json:"id" format:"uuid"`
AggregationPropDefID string `json:"aggregation_prop_def_id" api:"nullable" format:"uuid"`
AggregationType string `json:"aggregation_type" api:"nullable"`
ColumnLayout map[string]interface{} `json:"column_layout" api:"nullable"`
Combinator ViewUpdateResponseCombinator `json:"combinator"`
CreatedAt string `json:"created_at"`
// Each entry is { slug: { comparator: value } }
Filter []map[string]interface{} `json:"filter"`
// Property slug to group by
GroupBy string `json:"group_by" api:"nullable"`
GroupHiddenOptionIDs []interface{} `json:"group_hidden_option_ids" api:"nullable"`
GroupHideEmpty bool `json:"group_hide_empty" api:"nullable"`
GroupSort string `json:"group_sort" api:"nullable"`
Icon string `json:"icon" api:"nullable"`
ListID string `json:"list_id" api:"nullable" format:"uuid"`
// Property slugs (dot-paths permitted for refs)
Select []string `json:"select"`
// Each entry is { slug: 'asc' | 'desc' }
Sort []map[string]interface{} `json:"sort"`
SortOrder int64 `json:"sort_order" api:"nullable"`
TeamID string `json:"team_id" api:"nullable" format:"uuid"`
UpdatedAt string `json:"updated_at" api:"nullable"`
UserID string `json:"user_id" api:"nullable"`
JSON viewUpdateResponseJSON `json:"-"`
}ViewGetResponse
type ViewGetResponse struct {
ID string `json:"id" format:"uuid"`
AggregationPropDefID string `json:"aggregation_prop_def_id" api:"nullable" format:"uuid"`
AggregationType string `json:"aggregation_type" api:"nullable"`
// This field can have the runtime type of [map[string]interface{}].
ColumnLayout interface{} `json:"column_layout"`
Combinator ViewGetResponseCombinator `json:"combinator"`
CreatedAt string `json:"created_at"`
// This field can have the runtime type of [[]map[string]interface{}].
Filter interface{} `json:"filter"`
// Property slug to group by
GroupBy string `json:"group_by" api:"nullable"`
// This field can have the runtime type of [[]interface{}].
GroupHiddenOptionIDs interface{} `json:"group_hidden_option_ids"`
GroupHideEmpty bool `json:"group_hide_empty" api:"nullable"`
GroupSort string `json:"group_sort" api:"nullable"`
Icon string `json:"icon" api:"nullable"`
ListID string `json:"list_id" api:"nullable" format:"uuid"`
Name string `json:"name"`
// This field can have the runtime type of
// [ViewGetResponseViewBundleWithRecordsRecords].
Records interface{} `json:"records"`
// This field can have the runtime type of [[]string].
Select interface{} `json:"select"`
// This field can have the runtime type of [[]map[string]interface{}].
Sort interface{} `json:"sort"`
SortOrder int64 `json:"sort_order" api:"nullable"`
TeamID string `json:"team_id" api:"nullable" format:"uuid"`
UpdatedAt string `json:"updated_at" api:"nullable"`
UserID string `json:"user_id" api:"nullable"`
// This field can have the runtime type of
// [ViewGetResponseViewBundleWithRecordsView].
View interface{} `json:"view"`
ViewType string `json:"view_type"`
JSON viewGetResponseJSON `json:"-"`
union ViewGetResponseUnion
}ViewNewParamsViewObjectType
type ViewNewParamsViewObjectType stringViewNewParams
type ViewNewParams struct {
// Use [option.WithTeamID] on the client to set a global default for this field.
PathTeamID param.Field[string] `path:"teamId" api:"required" format:"uuid"`
Name param.Field[string] `json:"name" api:"required"`
ViewType param.Field[string] `json:"view_type" api:"required"`
ID param.Field[string] `json:"id" format:"uuid"`
AggregationPropDefID param.Field[string] `json:"aggregation_prop_def_id" format:"uuid"`
AggregationType param.Field[string] `json:"aggregation_type"`
ColumnLayout param.Field[map[string]interface{}] `json:"column_layout"`
Combinator param.Field[ViewNewParamsCombinator] `json:"combinator"`
CreatedAt param.Field[string] `json:"created_at"`
// Each entry is { slug: { comparator: value } }
Filter param.Field[[]map[string]interface{}] `json:"filter"`
// Property slug to group by
GroupBy param.Field[string] `json:"group_by"`
GroupHiddenOptionIDs param.Field[[]interface{}] `json:"group_hidden_option_ids"`
GroupHideEmpty param.Field[bool] `json:"group_hide_empty"`
GroupSort param.Field[string] `json:"group_sort"`
Icon param.Field[string] `json:"icon"`
ListID param.Field[string] `json:"list_id" format:"uuid"`
// Property slugs (dot-paths permitted for refs)
Select param.Field[[]string] `json:"select"`
// Each entry is { slug: 'asc' | 'desc' }
Sort param.Field[[]map[string]interface{}] `json:"sort"`
SortOrder param.Field[int64] `json:"sort_order"`
BodyTeamID param.Field[string] `json:"team_id" format:"uuid"`
UpdatedAt param.Field[string] `json:"updated_at"`
UserID param.Field[string] `json:"user_id"`
IdempotencyKey param.Field[string] `header:"Idempotency-Key"`
}ViewUpdateParamsViewObjectType
type ViewUpdateParamsViewObjectType stringViewUpdateParams
type ViewUpdateParams struct {
// Use [option.WithTeamID] on the client to set a global default for this field.
PathTeamID param.Field[string] `path:"teamId" api:"required" format:"uuid"`
AggregationPropDefID param.Field[string] `json:"aggregation_prop_def_id" format:"uuid"`
AggregationType param.Field[string] `json:"aggregation_type"`
ColumnLayout param.Field[map[string]interface{}] `json:"column_layout"`
Combinator param.Field[ViewUpdateParamsCombinator] `json:"combinator"`
Filter param.Field[[]map[string]interface{}] `json:"filter"`
GroupBy param.Field[string] `json:"group_by"`
GroupHiddenOptionIDs param.Field[[]interface{}] `json:"group_hidden_option_ids"`
GroupHideEmpty param.Field[bool] `json:"group_hide_empty"`
GroupSort param.Field[string] `json:"group_sort"`
Icon param.Field[string] `json:"icon"`
ListID param.Field[string] `json:"list_id" format:"uuid"`
Name param.Field[string] `json:"name"`
Select param.Field[[]string] `json:"select"`
Sort param.Field[[]map[string]interface{}] `json:"sort"`
SortOrder param.Field[int64] `json:"sort_order"`
BodyTeamID param.Field[string] `json:"team_id" format:"uuid"`
UserID param.Field[string] `json:"user_id"`
ViewType param.Field[string] `json:"view_type"`
IdempotencyKey param.Field[string] `header:"Idempotency-Key"`
}ViewDeleteParamsViewObjectType
type ViewDeleteParamsViewObjectType stringViewDeleteParams
type ViewDeleteParams struct {
// Use [option.WithTeamID] on the client to set a global default for this field.
TeamID param.Field[string] `path:"teamId" api:"required" format:"uuid"`
}ViewGetParamsViewObjectType
type ViewGetParamsViewObjectType stringViewGetParams
type ViewGetParams struct {
// Use [option.WithTeamID] on the client to set a global default for this field.
TeamID param.Field[string] `path:"teamId" api:"required" format:"uuid"`
// Forwarded to the records sub-resource when `include=records`.
Cursor param.Field[string] `query:"cursor"`
// Comma-separated list of optional sub-resources to inline. Currently the only
// recognized value is `records` — when present, the response is `{view, records}`
// rather than the bare view bundle.
Include param.Field[string] `query:"include"`
// Forwarded to the records sub-resource when `include=records`.
Limit param.Field[int64] `query:"limit"`
// Forwarded to the records sub-resource when `include=records`.
Page param.Field[int64] `query:"page"`
}ViewNewResponseCombinator
type ViewNewResponseCombinator stringViewUpdateResponseCombinator
type ViewUpdateResponseCombinator stringViewGetResponseCombinator
type ViewGetResponseCombinator stringViewGetResponseViewBundleWithRecordsRecords
type ViewGetResponseViewBundleWithRecordsRecords struct {
Data []map[string]interface{} `json:"data" api:"required"`
HasMore bool `json:"has_more" api:"required"`
NextCursor string `json:"next_cursor" api:"nullable"`
JSON viewGetResponseViewBundleWithRecordsRecordsJSON `json:"-"`
}ViewGetResponseViewBundleWithRecordsView
type ViewGetResponseViewBundleWithRecordsView struct {
Name string `json:"name" api:"required"`
ViewType string `json:"view_type" api:"required"`
ID string `json:"id" format:"uuid"`
AggregationPropDefID string `json:"aggregation_prop_def_id" api:"nullable" format:"uuid"`
AggregationType string `json:"aggregation_type" api:"nullable"`
ColumnLayout map[string]interface{} `json:"column_layout" api:"nullable"`
Combinator ViewGetResponseViewBundleWithRecordsViewCombinator `json:"combinator"`
CreatedAt string `json:"created_at"`
// Each entry is { slug: { comparator: value } }
Filter []map[string]interface{} `json:"filter"`
// Property slug to group by
GroupBy string `json:"group_by" api:"nullable"`
GroupHiddenOptionIDs []interface{} `json:"group_hidden_option_ids" api:"nullable"`
GroupHideEmpty bool `json:"group_hide_empty" api:"nullable"`
GroupSort string `json:"group_sort" api:"nullable"`
Icon string `json:"icon" api:"nullable"`
ListID string `json:"list_id" api:"nullable" format:"uuid"`
// Property slugs (dot-paths permitted for refs)
Select []string `json:"select"`
// Each entry is { slug: 'asc' | 'desc' }
Sort []map[string]interface{} `json:"sort"`
SortOrder int64 `json:"sort_order" api:"nullable"`
TeamID string `json:"team_id" api:"nullable" format:"uuid"`
UpdatedAt string `json:"updated_at" api:"nullable"`
UserID string `json:"user_id" api:"nullable"`
JSON viewGetResponseViewBundleWithRecordsViewJSON `json:"-"`
}ViewGetResponseUnion
type ViewGetResponseUnion interface {
implementsViewGetResponse()
}ViewNewParamsCombinator
type ViewNewParamsCombinator stringViewUpdateParamsCombinator
type ViewUpdateParamsCombinator stringViewGetResponseViewBundleWithRecordsViewCombinator
type ViewGetResponseViewBundleWithRecordsViewCombinator string