From 19878010e42c8f6ff3f21b7837f9be9b5223d0ec Mon Sep 17 00:00:00 2001 From: Darren Shepherd Date: Tue, 31 Jul 2018 10:14:09 -0700 Subject: [PATCH] Add Replace to generic client --- clientbase/common.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/clientbase/common.go b/clientbase/common.go index f3bb83df3..bad9467e0 100644 --- a/clientbase/common.go +++ b/clientbase/common.go @@ -34,6 +34,7 @@ type APIBaseClientInterface interface { GetLink(resource types.Resource, link string, respObject interface{}) error Create(schemaType string, createObj interface{}, respObject interface{}) error Update(schemaType string, existing *types.Resource, updates interface{}, respObject interface{}) error + Replace(schemaType string, existing *types.Resource, updates interface{}, respObject interface{}) error ByID(schemaType string, id string, respObject interface{}) error Delete(existing *types.Resource) error Reload(existing *types.Resource, output interface{}) error @@ -326,6 +327,10 @@ func (a *APIBaseClient) Update(schemaType string, existing *types.Resource, upda return a.Ops.DoUpdate(schemaType, existing, updates, respObject) } +func (a *APIBaseClient) Replace(schemaType string, existing *types.Resource, updates interface{}, respObject interface{}) error { + return a.Ops.DoReplace(schemaType, existing, updates, respObject) +} + func (a *APIBaseClient) ByID(schemaType string, id string, respObject interface{}) error { return a.Ops.DoByID(schemaType, id, respObject) }