MCPcopy
hub / github.com/cloudfoundry/cli / Delete

Method Delete

cf/api/users.go:200–215  ·  view source on GitHub ↗
(userGUID string)

Source from the content-addressed store, hash-verified

198}
199
200func (repo CloudControllerUserRepository) Delete(userGUID string) (apiErr error) {
201 path := fmt.Sprintf("/v2/users/%s", userGUID)
202
203 apiErr = repo.ccGateway.DeleteResource(repo.config.APIEndpoint(), path)
204
205 if httpErr, ok := apiErr.(errors.HTTPError); ok && httpErr.ErrorCode() != errors.UserNotFound {
206 return
207 }
208 uaaEndpoint, apiErr := repo.getAuthEndpoint()
209 if apiErr != nil {
210 return
211 }
212
213 path = fmt.Sprintf("/Users/%s", userGUID)
214 return repo.uaaGateway.DeleteResource(uaaEndpoint, path)
215}
216
217func (repo CloudControllerUserRepository) SetOrgRoleByGUID(userGUID string, orgGUID string, role models.Role) (err error) {
218 path, err := userGUIDPath(repo.config.APIEndpoint(), userGUID, orgGUID, role)

Callers

nothing calls this directly

Calls 4

getAuthEndpointMethod · 0.95
DeleteResourceMethod · 0.80
APIEndpointMethod · 0.65
ErrorCodeMethod · 0.65

Tested by

no test coverage detected