Update updates the given collection object's data.
(ctx context.Context, collection, id string, data map[string]any)
| 106 | |
| 107 | // Update updates the given collection object's data. |
| 108 | func (c *CollectionsClient) Update(ctx context.Context, collection, id string, data map[string]any) (*CollectionObjectResponse, error) { |
| 109 | if collection == "" { |
| 110 | return nil, errors.New("collection name required") |
| 111 | } |
| 112 | endpoint := c.client.makeEndpoint("collections/%s/%s/", collection, id) |
| 113 | reqData := map[string]any{ |
| 114 | "data": data, |
| 115 | } |
| 116 | |
| 117 | return c.decodeObject(c.client.put(ctx, endpoint, reqData, c.client.authenticator.collectionsAuth)) |
| 118 | } |
| 119 | |
| 120 | // Delete removes from a collection the object having the given ID. |
| 121 | func (c *CollectionsClient) Delete(ctx context.Context, collection, id string) (*BaseResponse, error) { |
nothing calls this directly
no test coverage detected