From f5c88d298c8e849acda143242ef4143bf74c57f6 Mon Sep 17 00:00:00 2001 From: Raphael Randschau Date: Wed, 14 Mar 2018 19:27:37 -0700 Subject: [PATCH] update scaleway-sdk preparation to implement #45 --- vendor/github.com/nicolai86/scaleway-sdk/user.go | 16 +++++++++++----- vendor/vendor.json | 6 +++--- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/vendor/github.com/nicolai86/scaleway-sdk/user.go b/vendor/github.com/nicolai86/scaleway-sdk/user.go index d7f94c1ce2..7156c4e3e3 100644 --- a/vendor/github.com/nicolai86/scaleway-sdk/user.go +++ b/vendor/github.com/nicolai86/scaleway-sdk/user.go @@ -62,18 +62,24 @@ type UserPatchSSHKeyDefinition struct { } // PatchUserSSHKey updates a user -func (s *API) PatchUserSSHKey(UserID string, definition UserPatchSSHKeyDefinition) error { +func (s *API) PatchUserSSHKey(UserID string, definition UserPatchSSHKeyDefinition) (*UserDefinition, error) { resp, err := s.PatchResponse(AccountAPI, fmt.Sprintf("users/%s", UserID), definition) if err != nil { - return err + return nil, err } defer resp.Body.Close() - if _, err := s.handleHTTPError([]int{http.StatusOK}, resp); err != nil { - return err + body, err := s.handleHTTPError([]int{http.StatusOK}, resp) + if err != nil { + return nil, err + } + var user UsersDefinition + + if err = json.Unmarshal(body, &user); err != nil { + return nil, err } - return nil + return &user.User, nil } // GetUserID returns the userID diff --git a/vendor/vendor.json b/vendor/vendor.json index 6968c620ef..ad6da75d2c 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -558,10 +558,10 @@ "revisionTime": "2016-10-03T17:45:16Z" }, { - "checksumSHA1": "7ILxxEwddNgVCzVHzLCnPJfEBWg=", + "checksumSHA1": "HHM/BHbGWERr3u0mwCsj+587zBY=", "path": "github.com/nicolai86/scaleway-sdk", - "revision": "6ef8f978a49b7615d7bf9c4f0d2e651f42a41852", - "revisionTime": "2018-02-27T05:29:25Z" + "revision": "1a18b6a1c6a3434c88b908254958f1281cf3ac2c", + "revisionTime": "2018-03-15T02:26:51Z" }, { "checksumSHA1": "u5s2PZ7fzCOqQX7bVPf9IJ+qNLQ=",