groupdocs_signature_cloud 20.7 → 21.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/lib/groupdocs_signature_cloud.rb +7 -1
  3. data/lib/groupdocs_signature_cloud/api/file_api.rb +6 -6
  4. data/lib/groupdocs_signature_cloud/api/folder_api.rb +6 -6
  5. data/lib/groupdocs_signature_cloud/api/info_api.rb +2 -2
  6. data/lib/groupdocs_signature_cloud/api/preview_api.rb +217 -0
  7. data/lib/groupdocs_signature_cloud/api/sign_api.rb +6 -6
  8. data/lib/groupdocs_signature_cloud/api/storage_api.rb +5 -5
  9. data/lib/groupdocs_signature_cloud/api_client.rb +1 -1
  10. data/lib/groupdocs_signature_cloud/api_error.rb +18 -5
  11. data/lib/groupdocs_signature_cloud/configuration.rb +1 -1
  12. data/lib/groupdocs_signature_cloud/models/barcode_signature.rb +1 -1
  13. data/lib/groupdocs_signature_cloud/models/barcode_type.rb +1 -1
  14. data/lib/groupdocs_signature_cloud/models/barcodes_result.rb +1 -1
  15. data/lib/groupdocs_signature_cloud/models/base_settings.rb +1 -1
  16. data/lib/groupdocs_signature_cloud/models/border_line.rb +1 -1
  17. data/lib/groupdocs_signature_cloud/models/brush.rb +1 -1
  18. data/lib/groupdocs_signature_cloud/models/color.rb +1 -1
  19. data/lib/groupdocs_signature_cloud/models/delete_options.rb +1 -1
  20. data/lib/groupdocs_signature_cloud/models/delete_result.rb +2 -2
  21. data/lib/groupdocs_signature_cloud/models/delete_settings.rb +1 -1
  22. data/lib/groupdocs_signature_cloud/models/digital_signature.rb +15 -5
  23. data/lib/groupdocs_signature_cloud/models/disc_usage.rb +1 -1
  24. data/lib/groupdocs_signature_cloud/models/error.rb +1 -1
  25. data/lib/groupdocs_signature_cloud/models/error_details.rb +1 -1
  26. data/lib/groupdocs_signature_cloud/models/file_info.rb +1 -1
  27. data/lib/groupdocs_signature_cloud/models/file_version.rb +1 -1
  28. data/lib/groupdocs_signature_cloud/models/file_versions.rb +1 -1
  29. data/lib/groupdocs_signature_cloud/models/files_list.rb +1 -1
  30. data/lib/groupdocs_signature_cloud/models/files_upload_result.rb +1 -1
  31. data/lib/groupdocs_signature_cloud/models/format.rb +1 -1
  32. data/lib/groupdocs_signature_cloud/models/formats_result.rb +1 -1
  33. data/lib/groupdocs_signature_cloud/models/image_signature.rb +1 -1
  34. data/lib/groupdocs_signature_cloud/models/info_result.rb +2 -2
  35. data/lib/groupdocs_signature_cloud/models/info_settings.rb +1 -1
  36. data/lib/groupdocs_signature_cloud/models/linear_gradient_brush.rb +1 -1
  37. data/lib/groupdocs_signature_cloud/models/object_exist.rb +1 -1
  38. data/lib/groupdocs_signature_cloud/models/options_base.rb +1 -1
  39. data/lib/groupdocs_signature_cloud/models/padding.rb +1 -1
  40. data/lib/groupdocs_signature_cloud/models/page_info.rb +1 -1
  41. data/lib/groupdocs_signature_cloud/models/pages_setup.rb +1 -1
  42. data/lib/groupdocs_signature_cloud/models/pdf_digital_signature.rb +321 -0
  43. data/lib/groupdocs_signature_cloud/models/preview_page.rb +259 -0
  44. data/lib/groupdocs_signature_cloud/models/preview_result.rb +261 -0
  45. data/lib/groupdocs_signature_cloud/models/preview_settings.rb +338 -0
  46. data/lib/groupdocs_signature_cloud/models/qr_code_signature.rb +1 -1
  47. data/lib/groupdocs_signature_cloud/models/qr_code_type.rb +1 -1
  48. data/lib/groupdocs_signature_cloud/models/qr_codes_result.rb +1 -1
  49. data/lib/groupdocs_signature_cloud/models/radial_gradient_brush.rb +1 -1
  50. data/lib/groupdocs_signature_cloud/models/save_options.rb +1 -1
  51. data/lib/groupdocs_signature_cloud/models/search_barcode_options.rb +1 -1
  52. data/lib/groupdocs_signature_cloud/models/search_digital_options.rb +1 -1
  53. data/lib/groupdocs_signature_cloud/models/search_options.rb +1 -1
  54. data/lib/groupdocs_signature_cloud/models/search_qr_code_options.rb +1 -1
  55. data/lib/groupdocs_signature_cloud/models/search_result.rb +1 -1
  56. data/lib/groupdocs_signature_cloud/models/search_settings.rb +1 -1
  57. data/lib/groupdocs_signature_cloud/models/sign_barcode_options.rb +17 -2
  58. data/lib/groupdocs_signature_cloud/models/sign_digital_options.rb +1 -1
  59. data/lib/groupdocs_signature_cloud/models/sign_image_options.rb +1 -1
  60. data/lib/groupdocs_signature_cloud/models/sign_options.rb +1 -1
  61. data/lib/groupdocs_signature_cloud/models/sign_qr_code_options.rb +17 -2
  62. data/lib/groupdocs_signature_cloud/models/sign_result.rb +2 -2
  63. data/lib/groupdocs_signature_cloud/models/sign_settings.rb +1 -1
  64. data/lib/groupdocs_signature_cloud/models/sign_stamp_options.rb +1 -1
  65. data/lib/groupdocs_signature_cloud/models/sign_text_options.rb +20 -5
  66. data/lib/groupdocs_signature_cloud/models/signature.rb +1 -1
  67. data/lib/groupdocs_signature_cloud/models/signature_font.rb +1 -1
  68. data/lib/groupdocs_signature_cloud/models/solid_brush.rb +1 -1
  69. data/lib/groupdocs_signature_cloud/models/stamp_line.rb +1 -1
  70. data/lib/groupdocs_signature_cloud/models/storage_exist.rb +1 -1
  71. data/lib/groupdocs_signature_cloud/models/storage_file.rb +1 -1
  72. data/lib/groupdocs_signature_cloud/models/text_signature.rb +1 -1
  73. data/lib/groupdocs_signature_cloud/models/texture_brush.rb +1 -1
  74. data/lib/groupdocs_signature_cloud/models/time_stamp.rb +239 -0
  75. data/lib/groupdocs_signature_cloud/models/update_options.rb +1 -1
  76. data/lib/groupdocs_signature_cloud/models/update_result.rb +2 -2
  77. data/lib/groupdocs_signature_cloud/models/update_settings.rb +1 -1
  78. data/lib/groupdocs_signature_cloud/models/verify_barcode_options.rb +1 -1
  79. data/lib/groupdocs_signature_cloud/models/verify_digital_options.rb +1 -1
  80. data/lib/groupdocs_signature_cloud/models/verify_options.rb +1 -1
  81. data/lib/groupdocs_signature_cloud/models/verify_qr_code_options.rb +1 -1
  82. data/lib/groupdocs_signature_cloud/models/verify_result.rb +2 -2
  83. data/lib/groupdocs_signature_cloud/models/verify_settings.rb +1 -1
  84. data/lib/groupdocs_signature_cloud/models/verify_text_options.rb +1 -1
  85. data/lib/groupdocs_signature_cloud/version.rb +2 -2
  86. metadata +8 -16
@@ -1,6 +1,6 @@
1
1
  # -----------------------------------------------------------------------------------
2
2
  # <copyright company="Aspose Pty Ltd" file="api_client.rb">
3
- # Copyright (c) 2003-2020 Aspose Pty Ltd
3
+ # Copyright (c) 2003-2021 Aspose Pty Ltd
4
4
  # </copyright>
5
5
  # <summary>
6
6
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,6 +1,6 @@
1
1
  # -----------------------------------------------------------------------------------
2
2
  # <copyright company="Aspose Pty Ltd" file="api_error.rb">
3
- # Copyright (c) 2003-2020 Aspose Pty Ltd
3
+ # Copyright (c) 2003-2021 Aspose Pty Ltd
4
4
  # </copyright>
5
5
  # <summary>
6
6
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -39,10 +39,23 @@ module GroupDocsSignatureCloud
39
39
 
40
40
  if arg.key?(:response_body) then
41
41
  data = JSON.parse(arg[:response_body], :symbolize_names => true)
42
- if !data.nil? && !data[:error].nil? then
43
- @message = data[:error]
44
- elsif !data.nil? && !data[:Error].nil? && !data[:Error][:Message].nil? then
45
- @message = data[:Error][:Message]
42
+ if !data.nil? then
43
+ if !data[:error].nil? then
44
+ error = data[:error]
45
+ if error.kind_of?(String) then
46
+ @message = error
47
+ else
48
+ @message = error[:message]
49
+ end
50
+ else
51
+ message = data[:message]
52
+ if !message.nil? && message.kind_of?(String) then
53
+ @message = message
54
+ @code = data[:code]
55
+ else
56
+ @message = data
57
+ end
58
+ end
46
59
  end
47
60
  end
48
61
 
@@ -1,6 +1,6 @@
1
1
  # ------------------------------------------------------------------------------------
2
2
  # <copyright company="Aspose Pty Ltd" file="configuration.rb">
3
- # Copyright (c) 2003-2020 Aspose Pty Ltd
3
+ # Copyright (c) 2003-2021 Aspose Pty Ltd
4
4
  # </copyright>
5
5
  # <summary>
6
6
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="barcode_signature.rb">
4
- # Copyright (c) 2003-2020 Aspose Pty Ltd
4
+ # Copyright (c) 2003-2021 Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="barcode_type.rb">
4
- # Copyright (c) 2003-2020 Aspose Pty Ltd
4
+ # Copyright (c) 2003-2021 Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="barcodes_result.rb">
4
- # Copyright (c) 2003-2020 Aspose Pty Ltd
4
+ # Copyright (c) 2003-2021 Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="base_settings.rb">
4
- # Copyright (c) 2003-2020 Aspose Pty Ltd
4
+ # Copyright (c) 2003-2021 Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="border_line.rb">
4
- # Copyright (c) 2003-2020 Aspose Pty Ltd
4
+ # Copyright (c) 2003-2021 Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="brush.rb">
4
- # Copyright (c) 2003-2020 Aspose Pty Ltd
4
+ # Copyright (c) 2003-2021 Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="color.rb">
4
- # Copyright (c) 2003-2020 Aspose Pty Ltd
4
+ # Copyright (c) 2003-2021 Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="delete_options.rb">
4
- # Copyright (c) 2003-2020 Aspose Pty Ltd
4
+ # Copyright (c) 2003-2021 Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="delete_result.rb">
4
- # Copyright (c) 2003-2020 Aspose Pty Ltd
4
+ # Copyright (c) 2003-2021 Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -31,7 +31,7 @@ module GroupDocsSignatureCloud
31
31
  # Delete result information
32
32
  class DeleteResult
33
33
 
34
- # Source document basic info
34
+ # Source document file info
35
35
  attr_accessor :file_info
36
36
 
37
37
  # Source document size in bytes
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="delete_settings.rb">
4
- # Copyright (c) 2003-2020 Aspose Pty Ltd
4
+ # Copyright (c) 2003-2021 Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="digital_signature.rb">
4
- # Copyright (c) 2003-2020 Aspose Pty Ltd
4
+ # Copyright (c) 2003-2021 Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -69,6 +69,9 @@ module GroupDocsSignatureCloud
69
69
 
70
70
  # Gets or sets the time the document was signed
71
71
  attr_accessor :sign_time
72
+
73
+ # Pdf digital signature properties
74
+ attr_accessor :pdf_digital_signature
72
75
  class EnumAttributeValidator
73
76
  attr_reader :datatype
74
77
  attr_reader :allowable_values
@@ -106,7 +109,8 @@ module GroupDocsSignatureCloud
106
109
  :'height' => :'Height',
107
110
  :'comments' => :'Comments',
108
111
  :'is_valid' => :'IsValid',
109
- :'sign_time' => :'SignTime'
112
+ :'sign_time' => :'SignTime',
113
+ :'pdf_digital_signature' => :'PdfDigitalSignature'
110
114
  }
111
115
  end
112
116
 
@@ -125,7 +129,8 @@ module GroupDocsSignatureCloud
125
129
  :'height' => :'Integer',
126
130
  :'comments' => :'String',
127
131
  :'is_valid' => :'BOOLEAN',
128
- :'sign_time' => :'DateTime'
132
+ :'sign_time' => :'DateTime',
133
+ :'pdf_digital_signature' => :'PdfDigitalSignature'
129
134
  }
130
135
  end
131
136
 
@@ -189,6 +194,10 @@ module GroupDocsSignatureCloud
189
194
  self.sign_time = attributes[:'SignTime']
190
195
  end
191
196
 
197
+ if attributes.key?(:'PdfDigitalSignature')
198
+ self.pdf_digital_signature = attributes[:'PdfDigitalSignature']
199
+ end
200
+
192
201
  end
193
202
 
194
203
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -287,7 +296,8 @@ module GroupDocsSignatureCloud
287
296
  height == other.height &&
288
297
  comments == other.comments &&
289
298
  is_valid == other.is_valid &&
290
- sign_time == other.sign_time
299
+ sign_time == other.sign_time &&
300
+ pdf_digital_signature == other.pdf_digital_signature
291
301
  end
292
302
 
293
303
  # @see the `==` method
@@ -299,7 +309,7 @@ module GroupDocsSignatureCloud
299
309
  # Calculates hash code according to all attributes.
300
310
  # @return [Fixnum] Hash code
301
311
  def hash
302
- [signature_type, page_number, signature_id, is_signature, created_on, modified_on, top, left, width, height, comments, is_valid, sign_time].hash
312
+ [signature_type, page_number, signature_id, is_signature, created_on, modified_on, top, left, width, height, comments, is_valid, sign_time, pdf_digital_signature].hash
303
313
  end
304
314
 
305
315
  # Downcases first letter.
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="disc_usage.rb">
4
- # Copyright (c) 2003-2020 Aspose Pty Ltd
4
+ # Copyright (c) 2003-2021 Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="error.rb">
4
- # Copyright (c) 2003-2020 Aspose Pty Ltd
4
+ # Copyright (c) 2003-2021 Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="error_details.rb">
4
- # Copyright (c) 2003-2020 Aspose Pty Ltd
4
+ # Copyright (c) 2003-2021 Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="file_info.rb">
4
- # Copyright (c) 2003-2020 Aspose Pty Ltd
4
+ # Copyright (c) 2003-2021 Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="file_version.rb">
4
- # Copyright (c) 2003-2020 Aspose Pty Ltd
4
+ # Copyright (c) 2003-2021 Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="file_versions.rb">
4
- # Copyright (c) 2003-2020 Aspose Pty Ltd
4
+ # Copyright (c) 2003-2021 Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="files_list.rb">
4
- # Copyright (c) 2003-2020 Aspose Pty Ltd
4
+ # Copyright (c) 2003-2021 Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="files_upload_result.rb">
4
- # Copyright (c) 2003-2020 Aspose Pty Ltd
4
+ # Copyright (c) 2003-2021 Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="format.rb">
4
- # Copyright (c) 2003-2020 Aspose Pty Ltd
4
+ # Copyright (c) 2003-2021 Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="formats_result.rb">
4
- # Copyright (c) 2003-2020 Aspose Pty Ltd
4
+ # Copyright (c) 2003-2021 Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="image_signature.rb">
4
- # Copyright (c) 2003-2020 Aspose Pty Ltd
4
+ # Copyright (c) 2003-2021 Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="info_result.rb">
4
- # Copyright (c) 2003-2020 Aspose Pty Ltd
4
+ # Copyright (c) 2003-2021 Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -31,7 +31,7 @@ module GroupDocsSignatureCloud
31
31
  # Document info result
32
32
  class InfoResult
33
33
 
34
- # File info
34
+ # Input File info
35
35
  attr_accessor :file_info
36
36
 
37
37
  # Document extension
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="info_settings.rb">
4
- # Copyright (c) 2003-2020 Aspose Pty Ltd
4
+ # Copyright (c) 2003-2021 Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="linear_gradient_brush.rb">
4
- # Copyright (c) 2003-2020 Aspose Pty Ltd
4
+ # Copyright (c) 2003-2021 Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="object_exist.rb">
4
- # Copyright (c) 2003-2020 Aspose Pty Ltd
4
+ # Copyright (c) 2003-2021 Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="options_base.rb">
4
- # Copyright (c) 2003-2020 Aspose Pty Ltd
4
+ # Copyright (c) 2003-2021 Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="padding.rb">
4
- # Copyright (c) 2003-2020 Aspose Pty Ltd
4
+ # Copyright (c) 2003-2021 Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="page_info.rb">
4
- # Copyright (c) 2003-2020 Aspose Pty Ltd
4
+ # Copyright (c) 2003-2021 Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="pages_setup.rb">
4
- # Copyright (c) 2003-2020 Aspose Pty Ltd
4
+ # Copyright (c) 2003-2021 Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -0,0 +1,321 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="pdf_digital_signature.rb">
4
+ # Copyright (c) 2003-2021 Aspose Pty Ltd
5
+ # </copyright>
6
+ # <summary>
7
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ # of this software and associated documentation files (the "Software"), to deal
9
+ # in the Software without restriction, including without limitation the rights
10
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ # copies of the Software, and to permit persons to whom the Software is
12
+ # furnished to do so, subject to the following conditions:
13
+ #
14
+ # The above copyright notice and this permission notice shall be included in all
15
+ # copies or substantial portions of the Software.
16
+ #
17
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ # SOFTWARE.
24
+ # </summary>
25
+ # --------------------------------------------------------------------------------------------------------------------
26
+ #
27
+
28
+ require 'date'
29
+
30
+ module GroupDocsSignatureCloud
31
+ # Contains pdf digital Signature properties
32
+ class PdfDigitalSignature
33
+
34
+ # Information provided by the signer to enable a recipient to contact the signer
35
+ attr_accessor :contact_info
36
+
37
+ # The CPU host name or physical location of the signing.
38
+ attr_accessor :location
39
+
40
+ # The reason for the signing, such as (I agree…).
41
+ attr_accessor :reason
42
+
43
+ # Type of Pdf digital signature.
44
+ attr_accessor :type
45
+
46
+ # Time stamp for Pdf digital signature. Default value is null.
47
+ attr_accessor :time_stamp
48
+
49
+ # Force to show/hide signature properties
50
+ attr_accessor :show_properties
51
+ class EnumAttributeValidator
52
+ attr_reader :datatype
53
+ attr_reader :allowable_values
54
+
55
+ def initialize(datatype, allowable_values)
56
+ @allowable_values = allowable_values.map do |value|
57
+ case datatype.to_s
58
+ when /Integer/i
59
+ value.to_i
60
+ when /Float/i
61
+ value.to_f
62
+ else
63
+ value
64
+ end
65
+ end
66
+ end
67
+
68
+ def valid?(value)
69
+ !value || allowable_values.include?(value)
70
+ end
71
+ end
72
+
73
+ # Attribute mapping from ruby-style variable name to JSON key.
74
+ def self.attribute_map
75
+ {
76
+ :'contact_info' => :'ContactInfo',
77
+ :'location' => :'Location',
78
+ :'reason' => :'Reason',
79
+ :'type' => :'Type',
80
+ :'time_stamp' => :'TimeStamp',
81
+ :'show_properties' => :'ShowProperties'
82
+ }
83
+ end
84
+
85
+ # Attribute type mapping.
86
+ def self.swagger_types
87
+ {
88
+ :'contact_info' => :'String',
89
+ :'location' => :'String',
90
+ :'reason' => :'String',
91
+ :'type' => :'String',
92
+ :'time_stamp' => :'TimeStamp',
93
+ :'show_properties' => :'BOOLEAN'
94
+ }
95
+ end
96
+
97
+ # Initializes the object
98
+ # @param [Hash] attributes Model attributes in the form of hash
99
+ def initialize(attributes = {})
100
+ return unless attributes.is_a?(Hash)
101
+
102
+ # convert string to symbol for hash key
103
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
104
+
105
+ if attributes.key?(:'ContactInfo')
106
+ self.contact_info = attributes[:'ContactInfo']
107
+ end
108
+
109
+ if attributes.key?(:'Location')
110
+ self.location = attributes[:'Location']
111
+ end
112
+
113
+ if attributes.key?(:'Reason')
114
+ self.reason = attributes[:'Reason']
115
+ end
116
+
117
+ if attributes.key?(:'Type')
118
+ self.type = attributes[:'Type']
119
+ end
120
+
121
+ if attributes.key?(:'TimeStamp')
122
+ self.time_stamp = attributes[:'TimeStamp']
123
+ end
124
+
125
+ if attributes.key?(:'ShowProperties')
126
+ self.show_properties = attributes[:'ShowProperties']
127
+ end
128
+
129
+ end
130
+
131
+ # Show invalid properties with the reasons. Usually used together with valid?
132
+ # @return Array for valid properies with the reasons
133
+ def list_invalid_properties
134
+ invalid_properties = []
135
+ if @type.nil?
136
+ invalid_properties.push("invalid value for 'type', type cannot be nil.")
137
+ end
138
+
139
+ if @time_stamp.nil?
140
+ invalid_properties.push("invalid value for 'time_stamp', time_stamp cannot be nil.")
141
+ end
142
+
143
+ if @show_properties.nil?
144
+ invalid_properties.push("invalid value for 'show_properties', show_properties cannot be nil.")
145
+ end
146
+
147
+ return invalid_properties
148
+ end
149
+
150
+ # Check to see if the all the properties in the model are valid
151
+ # @return true if the model is valid
152
+ def valid?
153
+ return false if @type.nil?
154
+ type_validator = EnumAttributeValidator.new('String', ["Signature", "Certificate"])
155
+ return false unless type_validator.valid?(@type)
156
+ return false if @time_stamp.nil?
157
+ return false if @show_properties.nil?
158
+ return true
159
+ end
160
+
161
+ # Custom attribute writer method checking allowed values (enum).
162
+ # @param [Object] type Object to be assigned
163
+ def type=(type)
164
+ validator = EnumAttributeValidator.new('String', ["Signature", "Certificate"])
165
+ if type.to_i == 0
166
+ unless validator.valid?(type)
167
+ raise ArgumentError, "invalid value for 'type', must be one of #{validator.allowable_values}."
168
+ end
169
+ @type = type
170
+ else
171
+ @type = validator.allowable_values[type.to_i]
172
+ end
173
+ end
174
+
175
+ # Checks equality by comparing each attribute.
176
+ # @param [Object] Object to be compared
177
+ def ==(other)
178
+ return true if self.equal?(other)
179
+ self.class == other.class &&
180
+ contact_info == other.contact_info &&
181
+ location == other.location &&
182
+ reason == other.reason &&
183
+ type == other.type &&
184
+ time_stamp == other.time_stamp &&
185
+ show_properties == other.show_properties
186
+ end
187
+
188
+ # @see the `==` method
189
+ # @param [Object] Object to be compared
190
+ def eql?(other)
191
+ self == other
192
+ end
193
+
194
+ # Calculates hash code according to all attributes.
195
+ # @return [Fixnum] Hash code
196
+ def hash
197
+ [contact_info, location, reason, type, time_stamp, show_properties].hash
198
+ end
199
+
200
+ # Downcases first letter.
201
+ # @return downcased string
202
+ def uncap(str)
203
+ str[0, 1].downcase + str[1..-1]
204
+ end
205
+
206
+ # Builds the object from hash
207
+ # @param [Hash] attributes Model attributes in the form of hash
208
+ # @return [Object] Returns the model itself
209
+ def build_from_hash(attributes)
210
+ return nil unless attributes.is_a?(Hash)
211
+ self.class.swagger_types.each_pair do |key, type|
212
+ pname = uncap(self.class.attribute_map[key]).intern
213
+ value = attributes[pname]
214
+ if type =~ /\AArray<(.*)>/i
215
+ # check to ensure the input is an array given that the the attribute
216
+ # is documented as an array but the input is not
217
+ if value.is_a?(Array)
218
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
219
+ end
220
+ elsif !value.nil?
221
+ self.send("#{key}=", _deserialize(type, value))
222
+ end
223
+ # or else data not found in attributes(hash), not an issue as the data can be optional
224
+ end
225
+
226
+ self
227
+ end
228
+
229
+ # Deserializes the data based on type
230
+ # @param string type Data type
231
+ # @param string value Value to be deserialized
232
+ # @return [Object] Deserialized data
233
+ def _deserialize(type, value)
234
+ case type.to_sym
235
+ when :DateTime
236
+ Date.parse value
237
+ when :Date
238
+ Date.parse value
239
+ when :String
240
+ value.to_s
241
+ when :Integer
242
+ value.to_i
243
+ when :Float
244
+ value.to_f
245
+ when :BOOLEAN
246
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
247
+ true
248
+ else
249
+ false
250
+ end
251
+ when :Object
252
+ # generic object (usually a Hash), return directly
253
+ value
254
+ when /\AArray<(?<inner_type>.+)>\z/
255
+ inner_type = Regexp.last_match[:inner_type]
256
+ value.map { |v| _deserialize(inner_type, v) }
257
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
258
+ k_type = Regexp.last_match[:k_type]
259
+ v_type = Regexp.last_match[:v_type]
260
+ {}.tap do |hash|
261
+ value.each do |k, v|
262
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
263
+ end
264
+ end
265
+ else
266
+ # model
267
+ # Signature type fix
268
+ ttype = type
269
+ if value.is_a?(Hash) and !value[:signatureType].nil?
270
+ ttype = value[:signatureType] + 'Signature'
271
+ end
272
+ temp_model = GroupDocsSignatureCloud.const_get(ttype).new
273
+ temp_model.build_from_hash(value)
274
+ end
275
+ end
276
+
277
+ # Returns the string representation of the object
278
+ # @return [String] String presentation of the object
279
+ def to_s
280
+ to_hash.to_s
281
+ end
282
+
283
+ # to_body is an alias to to_hash (backward compatibility)
284
+ # @return [Hash] Returns the object in the form of hash
285
+ def to_body
286
+ to_hash
287
+ end
288
+
289
+ # Returns the object in the form of hash
290
+ # @return [Hash] Returns the object in the form of hash
291
+ def to_hash
292
+ hash = {}
293
+ self.class.attribute_map.each_pair do |attr, param|
294
+ value = self.send(attr)
295
+ next if value.nil?
296
+ hash[param] = _to_hash(value)
297
+ end
298
+ hash
299
+ end
300
+
301
+ # Outputs non-array value in the form of hash
302
+ # For object, use to_hash. Otherwise, just return the value
303
+ # @param [Object] value Any valid value
304
+ # @return [Hash] Returns the value in the form of hash
305
+ def _to_hash(value)
306
+ if value.is_a?(Array)
307
+ value.compact.map { |v| _to_hash(v) }
308
+ elsif value.is_a?(Hash)
309
+ {}.tap do |hash|
310
+ value.each { |k, v| hash[k] = _to_hash(v) }
311
+ end
312
+ elsif value.respond_to? :to_hash
313
+ value.to_hash
314
+ else
315
+ value
316
+ end
317
+ end
318
+
319
+ end
320
+
321
+ end