MCPcopy Index your code
hub / github.com/coder/coder / UpdateUserSkill

Method UpdateUserSkill

codersdk/userskills.go:96–107  ·  view source on GitHub ↗

UpdateUserSkill replaces a user skill's raw Markdown content.

(ctx context.Context, user string, name string, req UpdateUserSkillRequest)

Source from the content-addressed store, hash-verified

94
95// UpdateUserSkill replaces a user skill's raw Markdown content.
96func (c *ExperimentalClient) UpdateUserSkill(ctx context.Context, user string, name string, req UpdateUserSkillRequest) (UserSkill, error) {
97 res, err := c.Request(ctx, http.MethodPatch, userSkillPath(user, name), req)
98 if err != nil {
99 return UserSkill{}, err
100 }
101 defer res.Body.Close()
102 if res.StatusCode != http.StatusOK {
103 return UserSkill{}, ReadBodyAsError(res)
104 }
105 var skill UserSkill
106 return skill, json.NewDecoder(res.Body).Decode(&skill)
107}
108
109// DeleteUserSkill deletes a user skill by name.
110func (c *ExperimentalClient) DeleteUserSkill(ctx context.Context, user string, name string) error {

Calls 4

ReadBodyAsErrorFunction · 0.85
userSkillPathFunction · 0.70
CloseMethod · 0.65
RequestMethod · 0.45