class GroupDocs::Document::Annotation::Reviewer

Attributes

emailAddress[RW]

@attr [String] emailAddress

firstName[RW]

Added in release 2.1.0 @attr [String] firstName

lastName[RW]

@attr [String] lastName

Public Class Methods

all!(access = {}) click to toggle source

Returns all reviewer contacts.

@param [Hash] access Access credentials @option access [String] :client_id @option access [String] :private_key @return [Array<GroupDocs::Document::Annotation::Reviewer>]

# File lib/groupdocs/document/annotation/reviewer.rb, line 12
def self.all!(access = {})
  json = Api::Request.new do |request|
    request[:access] = access
    request[:method] = :GET
    request[:path] = '/ant/{{client_id}}/contacts'
  end.execute!

  json[:reviewerContacts].map do |reviewer|
    new(reviewer)
  end
end
set!(reviewers, access = {}) click to toggle source

Sets reviewer contacts to passed array.

Please, note that it removes existing reviewer contacts.

@example Add new reviewer contact

reviewers = GroupDocs::Document::Annotation::Reviewer.all!
reviewers << GroupDocs::Document::Annotation::Reviewer.new(full_name: 'John Smith', email_address: 'john@smith.com')
GroupDocs::Document::Annotation::Reviewer.set! reviewers

@param [Array<GroupDocs::Document::Annotation::Reviewer>] reviewers @param [Hash] access Access credentials @option access [String] :client_id @option access [String] :private_key

# File lib/groupdocs/document/annotation/reviewer.rb, line 39
def self.set!(reviewers, access = {})
  Api::Request.new do |request|
    request[:access] = access
    request[:method] = :PUT
    request[:path] = '/ant/{{client_id}}/reviewerContacts'
    request[:request_body] = reviewers.each.map(&:to_hash)
  end.execute!
end