Skip to content

Commit

Permalink
Add Replace to generic client
Browse files Browse the repository at this point in the history
  • Loading branch information
ibuildthecloud committed Jul 31, 2018
1 parent bfc612c commit 1987801
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions clientbase/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit 1987801

Please sign in to comment.