diff --git a/clientbase/common.go b/clientbase/common.go index a663b3cc..16fa88d3 100644 --- a/clientbase/common.go +++ b/clientbase/common.go @@ -258,8 +258,8 @@ func (a *APIBaseClient) Update(schemaType string, existing *types.Resource, upda return a.Ops.DoUpdate(schemaType, existing, updates, respObject) } -func (a *APIBaseClient) ById(schemaType string, id string, respObject interface{}) error { - return a.Ops.DoById(schemaType, id, respObject) +func (a *APIBaseClient) ByID(schemaType string, id string, respObject interface{}) error { + return a.Ops.DoByID(schemaType, id, respObject) } func (a *APIBaseClient) Delete(existing *types.Resource) error { diff --git a/clientbase/ops.go b/clientbase/ops.go index 7ceca7f1..68fd0265 100644 --- a/clientbase/ops.go +++ b/clientbase/ops.go @@ -212,7 +212,7 @@ func (a *APIOperations) DoUpdate(schemaType string, existing *types.Resource, up return a.DoModify("PUT", selfUrl, updates, respObject) } -func (a *APIOperations) DoById(schemaType string, id string, respObject interface{}) error { +func (a *APIOperations) DoByID(schemaType string, id string, respObject interface{}) error { schema, ok := a.Types[schemaType] if !ok { return errors.New("Unknown schema type [" + schemaType + "]") diff --git a/generator/type_template.go b/generator/type_template.go index dc89b802..7f05c567 100644 --- a/generator/type_template.go +++ b/generator/type_template.go @@ -39,7 +39,7 @@ type {{.schema.CodeName}}Operations interface { List(opts *types.ListOpts) (*{{.schema.CodeName}}Collection, error) Create(opts *{{.schema.CodeName}}) (*{{.schema.CodeName}}, error) Update(existing *{{.schema.CodeName}}, updates interface{}) (*{{.schema.CodeName}}, error) - ById(id string) (*{{.schema.CodeName}}, error) + ByID(id string) (*{{.schema.CodeName}}, error) Delete(container *{{.schema.CodeName}}) error{{range $key, $value := .resourceActions}} {{if eq $value.Input "" }} Action{{$key | capitalize}} (*{{$.schema.CodeName}}) (*{{.Output | capitalize}}, error) @@ -83,9 +83,9 @@ func (cc *{{.schema.CodeName}}Collection) Next() (*{{.schema.CodeName}}Collectio return nil, nil } -func (c *{{.schema.CodeName}}Client) ById(id string) (*{{.schema.CodeName}}, error) { +func (c *{{.schema.CodeName}}Client) ByID(id string) (*{{.schema.CodeName}}, error) { resp := &{{.schema.CodeName}}{} - err := c.apiClient.Ops.DoById({{.schema.CodeName}}Type, id, resp) + err := c.apiClient.Ops.DoByID({{.schema.CodeName}}Type, id, resp) return resp, err }