Method: Bitly::API::User#update
- Defined in:
- lib/bitly/api/user.rb
#update(name: nil, default_group_guid: nil) ⇒ Bitly::API::User
Allows you to update the authorized user’s name or default group guid. If you update the default group ID and have already loaded the default group, it is nilled out so it can be reloaded with the correct ID. [‘PATCH /v4/user`](dev.bitly.com/api-reference/#updateUser).
91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/bitly/api/user.rb', line 91 def update(name: nil, default_group_guid: nil) params = { "name" => name } if default_group_guid params["default_group_guid"] = default_group_guid @default_group = nil end @response = @client.request( path: "/user", method: "PATCH", params: params ) assign_attributes(@response.body) self end |