Sha256: fdd4d052492aec3b78fbad83107d9c52b3b8fa35a3b32839aed6de49ea0bd2c1

Contents?: true

Size: 867 Bytes

Versions: 4

Compression:

Stored size: 867 Bytes

Contents

module Fog
  module Identity
    class HuaweiCloud
      class V2
        class Real
          def update_user(user_id, options = {})
            url = options.delete('url') || "/users/#{user_id}"
            request(
              :body    => Fog::JSON.encode('user' => options),
              :expects => 200,
              :method  => 'PUT',
              :path    => url
            )
          end
        end

        class Mock
          def update_user(user_id, options)
            response = Excon::Response.new
            if user = data[:users][user_id]
              if options['name']
                user['name'] = options['name']
              end
              response.status = 200
              response
            else
              raise Fog::Identity::HuaweiCloud::NotFound
            end
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fog-huaweicloud-0.0.3 lib/fog/identity/huaweicloud/v2/requests/update_user.rb
fog-huaweicloud-0.0.2 lib/fog/identity/huaweicloud/v2/requests/update_user.rb
fog-huaweicloud-0.1.3 lib/fog/identity/huaweicloud/v2/requests/update_user.rb
fog-huaweicloud-0.1.2 lib/fog/identity/huaweicloud/v2/requests/update_user.rb