lib/groupdocs/user.rb in groupdocs-0.3.11 vs lib/groupdocs/user.rb in groupdocs-1.0.0

- old
+ new

@@ -1,12 +1,12 @@ module GroupDocs - class User < GroupDocs::Api::Entity + class User < Api::Entity # # Returns current user profile. # - # @example Get fill + # @example # user = GroupDocs::User.get! # user.first_name # #=> "John" # # @param [Hash] access Access credentials @@ -93,9 +93,29 @@ request[:access] = access request[:method] = :PUT request[:path] = '/mgmt/{{client_id}}/profile' request[:request_body] = to_hash end.execute! + end + + # + # Returns an array of users associated to current user account. + # + # @param [Hash] access Access credentials + # @option access [String] :client_id + # @option access [String] :private_key + # @return [Array<GroupDocs::User>] + # + def users!(access = {}) + json = Api::Request.new do |request| + request[:access] = access + request[:method] = :GET + request[:path] = '/mgmt/{{client_id}}/account/users' + end.execute! + + json[:users].map do |user| + GroupDocs::User.new(user) + end end end # User end # GroupDocs