-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpatch_operation.go
More file actions
23 lines (18 loc) · 832 Bytes
/
patch_operation.go
File metadata and controls
23 lines (18 loc) · 832 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package clcv2
// Patch operation describes a single PATCH operation to be performed on a CLCv2 resource.
type PatchOperation struct {
// The operation to perform on a given property of the resource.
Op string `json:"op"`
// The property of the resource to perform the operation on.
Member string `json:"member"`
// The value to patch - depends on the type of operation.
Value interface{} `json:"value"`
}
// Run patch operation(s) @ops and return Link status.
func (c *Client) patchStatus(path string, ops ...*PatchOperation) (statusId string, err error) {
return c.getStatus("PATCH", path, ops)
}
// Like patchStatus(), but without statusId. For those patch operations that return '204 No Content'.
func (c *Client) patch(path string, ops ...*PatchOperation) error {
return c.getCLCResponse("PATCH", path, ops, nil)
}