lib/groupdocs/signature/shared/field_methods.rb in groupdocs-1.6.0 vs lib/groupdocs/signature/shared/field_methods.rb in groupdocs-1.7.0

- old
+ new

@@ -140,24 +140,26 @@ # @option access [String] :client_id # @option access [String] :private_key # @raise [ArgumentError] if field is not GroupDocs::Signature::Field # @raise [ArgumentError] if document is not GroupDocs::Document # - def modify_field!(field, document, access = {}) + def modify_field!(field, document, recipient, access = {}) field.is_a?(GroupDocs::Signature::Field) or raise ArgumentError, "Field should be GroupDocs::Signature::Field object, received: #{field.inspect}" document.is_a?(GroupDocs::Document) or raise ArgumentError, "Document should be GroupDocs::Document object, received: #{document.inspect}" + recipient.is_a?(GroupDocs::Signature::Recipient) or raise ArgumentError, + "Recipient should be GroupDocs::Signature::Recipient object, received: #{recipient.inspect}" # prepare payload payload = field.to_hash # field itself payload.delete(:locations) # remove locations array payload.merge!(field.locations.first.to_hash) # location should added in plain view (i.e. not "locations": [{...}]) Api::Request.new do |request| request[:access] = access request[:method] = :PUT - request[:path] = "/signature/{{client_id}}/#{class_name.pluralize}/#{id}/documents/#{document.file.guid}/field/#{field.id}" + request[:path] = "/signature/{{client_id}}/#{class_name.pluralize}/#{id}/documents/#{document.file.guid}/recipientGuid/#{recipient.id}field/#{field.id}" request[:request_body] = payload end.execute! end #