Class PatchOperation
java.lang.Object
com.eqixiac.equinix.core.http.request.PatchOperation
A single RFC 6902 (JSON Patch)
operation -
{"op": ..., "path": ..., "value": ...}.
Several Equinix endpoints model resource updates as a JSON Patch document: an ordered array of
these operations sent with content-type application/json-patch+json (for example Fabric's
PATCH /fabric/v4/networks/{id} and PATCH /fabric/v4/routers/{id}). SDK users do not
normally construct these directly - the fluent resource.update().field(value).save()
builders translate field changes into the appropriate operations - but the type is public so the
raw patch surface is available when needed.
- Author:
- ianjones
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PatchOperationCreates anaddoperation, addingvalueatpath.getOp()getPath()getValue()static PatchOperationCreates aremoveoperation, removing the member atpath.static PatchOperationCreates areplaceoperation, settingpathtovalue.
-
Field Details
-
CONTENT_TYPE
- See Also:
-
-
Constructor Details
-
PatchOperation
-
-
Method Details
-
replace
Creates areplaceoperation, settingpathtovalue.- Parameters:
path- the JSON Pointer to the target member (e.g./name)value- the replacement value- Returns:
- the operation
-
add
Creates anaddoperation, addingvalueatpath.- Parameters:
path- the JSON Pointer to the target membervalue- the value to add- Returns:
- the operation
-
remove
Creates aremoveoperation, removing the member atpath.- Parameters:
path- the JSON Pointer to the target member- Returns:
- the operation
-
getOp
- Returns:
- the operation name
-
getPath
- Returns:
- the JSON Pointer path
-
getValue
- Returns:
- the operation value, or
nullforremove
-