groupdocs 1.6.0 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (171) hide show
  1. data/CHANGELOG.md +34 -0
  2. data/LICENSE.txt +21 -0
  3. data/README.md +3 -0
  4. data/examples/api-samples/public/docs/sample01.html +23 -23
  5. data/examples/api-samples/public/docs/sample02.html +27 -27
  6. data/examples/api-samples/public/docs/sample03.html +81 -69
  7. data/examples/api-samples/public/docs/sample04.html +29 -29
  8. data/examples/api-samples/public/docs/sample05.html +48 -48
  9. data/examples/api-samples/public/docs/sample06.html +47 -46
  10. data/examples/api-samples/public/docs/sample07.html +35 -35
  11. data/examples/api-samples/public/docs/sample08.html +45 -45
  12. data/examples/api-samples/public/docs/sample09.html +57 -57
  13. data/examples/api-samples/public/docs/sample10.html +41 -41
  14. data/examples/api-samples/public/docs/sample11.html +96 -118
  15. data/examples/api-samples/public/docs/sample12.html +29 -50
  16. data/examples/api-samples/public/docs/sample13.html +36 -44
  17. data/examples/api-samples/public/docs/sample14.html +29 -29
  18. data/examples/api-samples/public/docs/sample15.html +24 -24
  19. data/examples/api-samples/public/docs/sample16.html +32 -32
  20. data/examples/api-samples/public/docs/sample17.html +38 -38
  21. data/examples/api-samples/public/docs/sample18.html +105 -101
  22. data/examples/api-samples/public/docs/sample19.html +101 -101
  23. data/examples/api-samples/public/docs/sample20.html +42 -42
  24. data/examples/api-samples/public/docs/sample21.html +109 -109
  25. data/examples/api-samples/public/docs/sample22.html +56 -56
  26. data/examples/api-samples/public/docs/sample23.html +39 -39
  27. data/examples/api-samples/public/docs/sample24.html +36 -36
  28. data/examples/api-samples/public/docs/sample25.html +67 -67
  29. data/examples/api-samples/public/docs/sample26.html +23 -23
  30. data/examples/api-samples/public/docs/sample27.html +72 -72
  31. data/examples/api-samples/public/docs/sample28.html +46 -45
  32. data/examples/api-samples/public/docs/sample29.html +30 -30
  33. data/examples/api-samples/public/docs/sample30.html +30 -30
  34. data/examples/api-samples/public/docs/sample31.html +114 -114
  35. data/examples/api-samples/public/docs/sample32.html +96 -96
  36. data/examples/api-samples/public/docs/sample33.html +56 -56
  37. data/examples/api-samples/public/docs/sample34.html +27 -27
  38. data/examples/api-samples/public/docs/sample35.html +134 -135
  39. data/examples/api-samples/public/docs/sample36.html +32 -32
  40. data/examples/api-samples/public/docs/sample37.html +103 -103
  41. data/examples/api-samples/public/docs/sample38.html +76 -76
  42. data/examples/api-samples/public/docs/sample39.html +136 -136
  43. data/examples/api-samples/public/docs/sample40.html +104 -104
  44. data/examples/api-samples/public/docs/sample41.html +137 -137
  45. data/examples/api-samples/public/docs/sample42.html +61 -61
  46. data/examples/api-samples/public/docs/sample43.html +72 -72
  47. data/examples/api-samples/public/docs/sample44.html +751 -0
  48. data/examples/api-samples/public/docs/sample45.html +236 -0
  49. data/examples/api-samples/public/templates/merge_field3_doc.docx +0 -0
  50. data/examples/api-samples/samples/sample01.rb +2 -2
  51. data/examples/api-samples/samples/sample02.rb +2 -2
  52. data/examples/api-samples/samples/sample03.rb +2 -2
  53. data/examples/api-samples/samples/sample04.rb +2 -2
  54. data/examples/api-samples/samples/sample05.rb +2 -2
  55. data/examples/api-samples/samples/sample06.rb +2 -2
  56. data/examples/api-samples/samples/sample07.rb +2 -2
  57. data/examples/api-samples/samples/sample08.rb +2 -2
  58. data/examples/api-samples/samples/sample09.rb +2 -2
  59. data/examples/api-samples/samples/sample10.rb +2 -2
  60. data/examples/api-samples/samples/sample11.rb +2 -2
  61. data/examples/api-samples/samples/sample12.rb +2 -2
  62. data/examples/api-samples/samples/sample13.rb +2 -2
  63. data/examples/api-samples/samples/sample14.rb +2 -2
  64. data/examples/api-samples/samples/sample15.rb +2 -2
  65. data/examples/api-samples/samples/sample16.rb +2 -2
  66. data/examples/api-samples/samples/sample17.rb +2 -2
  67. data/examples/api-samples/samples/sample18.rb +2 -2
  68. data/examples/api-samples/samples/sample19.rb +2 -2
  69. data/examples/api-samples/samples/sample20.rb +2 -2
  70. data/examples/api-samples/samples/sample21.rb +2 -2
  71. data/examples/api-samples/samples/sample22.rb +2 -2
  72. data/examples/api-samples/samples/sample23.rb +2 -2
  73. data/examples/api-samples/samples/sample24.rb +2 -2
  74. data/examples/api-samples/samples/sample25.rb +2 -2
  75. data/examples/api-samples/samples/sample26.rb +2 -2
  76. data/examples/api-samples/samples/sample27.rb +2 -2
  77. data/examples/api-samples/samples/sample28.rb +2 -2
  78. data/examples/api-samples/samples/sample29.rb +2 -2
  79. data/examples/api-samples/samples/sample30.rb +2 -2
  80. data/examples/api-samples/samples/sample31.rb +2 -2
  81. data/examples/api-samples/samples/sample32.rb +2 -2
  82. data/examples/api-samples/samples/sample33.rb +2 -2
  83. data/examples/api-samples/samples/sample34.rb +2 -2
  84. data/examples/api-samples/samples/sample35.rb +4 -4
  85. data/examples/api-samples/samples/sample36.rb +2 -2
  86. data/examples/api-samples/samples/sample37.rb +2 -2
  87. data/examples/api-samples/samples/sample38.rb +2 -2
  88. data/examples/api-samples/samples/sample39.rb +2 -2
  89. data/examples/api-samples/samples/sample40.rb +2 -2
  90. data/examples/api-samples/samples/sample41.rb +2 -2
  91. data/examples/api-samples/samples/sample42.rb +2 -2
  92. data/examples/api-samples/samples/sample43.rb +2 -2
  93. data/examples/api-samples/samples/sample44.rb +188 -0
  94. data/examples/api-samples/samples/sample45.rb +74 -0
  95. data/examples/api-samples/views/_others_samples.haml +47 -43
  96. data/examples/api-samples/views/index.haml +55 -44
  97. data/examples/api-samples/views/layout.haml +1 -6
  98. data/examples/api-samples/views/sample01.haml +62 -57
  99. data/examples/api-samples/views/sample02.haml +52 -46
  100. data/examples/api-samples/views/sample03.haml +78 -73
  101. data/examples/api-samples/views/sample04.haml +51 -45
  102. data/examples/api-samples/views/sample05.haml +77 -71
  103. data/examples/api-samples/views/sample06.haml +58 -52
  104. data/examples/api-samples/views/sample07.haml +51 -45
  105. data/examples/api-samples/views/sample08.haml +90 -84
  106. data/examples/api-samples/views/sample09.haml +86 -80
  107. data/examples/api-samples/views/sample10.haml +83 -77
  108. data/examples/api-samples/views/sample11.haml +124 -120
  109. data/examples/api-samples/views/sample12.haml +65 -59
  110. data/examples/api-samples/views/sample13.haml +62 -56
  111. data/examples/api-samples/views/sample14.haml +57 -51
  112. data/examples/api-samples/views/sample15.haml +49 -43
  113. data/examples/api-samples/views/sample16.haml +49 -43
  114. data/examples/api-samples/views/sample17.haml +53 -47
  115. data/examples/api-samples/views/sample18.haml +140 -134
  116. data/examples/api-samples/views/sample19.haml +87 -81
  117. data/examples/api-samples/views/sample20.haml +53 -47
  118. data/examples/api-samples/views/sample21.haml +115 -111
  119. data/examples/api-samples/views/sample22.haml +94 -88
  120. data/examples/api-samples/views/sample23.haml +83 -78
  121. data/examples/api-samples/views/sample24.haml +54 -48
  122. data/examples/api-samples/views/sample25.haml +89 -83
  123. data/examples/api-samples/views/sample26.haml +62 -57
  124. data/examples/api-samples/views/sample27.haml +114 -109
  125. data/examples/api-samples/views/sample28.haml +55 -49
  126. data/examples/api-samples/views/sample29.haml +67 -69
  127. data/examples/api-samples/views/sample30.haml +54 -48
  128. data/examples/api-samples/views/sample31.haml +106 -100
  129. data/examples/api-samples/views/sample32.haml +90 -84
  130. data/examples/api-samples/views/sample33.haml +60 -54
  131. data/examples/api-samples/views/sample34.haml +51 -46
  132. data/examples/api-samples/views/sample35.haml +84 -78
  133. data/examples/api-samples/views/sample36.haml +63 -58
  134. data/examples/api-samples/views/sample37.haml +122 -116
  135. data/examples/api-samples/views/sample38.haml +104 -98
  136. data/examples/api-samples/views/sample39.haml +6 -2
  137. data/examples/api-samples/views/sample40.haml +94 -89
  138. data/examples/api-samples/views/sample41.haml +127 -123
  139. data/examples/api-samples/views/sample42.haml +60 -54
  140. data/examples/api-samples/views/sample43.haml +81 -77
  141. data/examples/api-samples/views/sample44.haml +85 -0
  142. data/examples/api-samples/views/sample45.haml +85 -0
  143. data/groupdocs.gemspec +2 -0
  144. data/lib/groupdocs/datasource/field.rb +9 -0
  145. data/lib/groupdocs/document.rb +66 -4
  146. data/lib/groupdocs/document/annotation.rb +11 -6
  147. data/lib/groupdocs/document/editor.rb +53 -0
  148. data/lib/groupdocs/document/field.rb +16 -0
  149. data/lib/groupdocs/document/style.rb +30 -0
  150. data/lib/groupdocs/job.rb +24 -0
  151. data/lib/groupdocs/questionnaire.rb +2 -0
  152. data/lib/groupdocs/questionnaire/collector.rb +52 -0
  153. data/lib/groupdocs/questionnaire/collector_style.rb +54 -0
  154. data/lib/groupdocs/questionnaire/question.rb +9 -0
  155. data/lib/groupdocs/questionnaire/style/base_font.rb +17 -0
  156. data/lib/groupdocs/questionnaire/style/question_title.rb +17 -0
  157. data/lib/groupdocs/questionnaire/style/title.rb +17 -0
  158. data/lib/groupdocs/signature/envelope.rb +43 -8
  159. data/lib/groupdocs/signature/form.rb +113 -12
  160. data/lib/groupdocs/signature/recipient.rb +38 -3
  161. data/lib/groupdocs/signature/shared/field_methods.rb +4 -2
  162. data/lib/groupdocs/signature/template.rb +20 -1
  163. data/lib/groupdocs/storage/file.rb +3 -2
  164. data/lib/groupdocs/user.rb +148 -0
  165. data/lib/groupdocs/version.rb +1 -1
  166. data/spec/groupdocs/api/helpers/access_rights_helper_spec.rb +5 -5
  167. data/spec/groupdocs/document/annotation_spec.rb +1 -1
  168. data/spec/groupdocs/signature/envelope_spec.rb +1 -1
  169. data/spec/groupdocs/user_spec.rb +4 -4
  170. data/spec/support/shared_examples/signature/shared/field_methods.rb +5 -4
  171. metadata +18 -3
data/groupdocs.gemspec CHANGED
@@ -10,6 +10,8 @@ Gem::Specification.new do |s|
10
10
  s.summary = 'Ruby SDK for GroupDocs REST API'
11
11
  s.description = 'Ruby SDK for GroupDocs REST API'
12
12
 
13
+ s.license = 'MIT'
14
+
13
15
  s.files = `git ls-files`.split("\n")
14
16
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
15
17
  s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
@@ -8,6 +8,15 @@ module GroupDocs
8
8
  # @attr [Array<String>] values
9
9
  attr_accessor :values
10
10
 
11
+ # added in release 1.7.0
12
+ # @attr [String] contentType
13
+ attr_accessor :contentType
14
+ # @attr [List<GroupDocs::DataSource::Field>] nested_fields
15
+ attr_accessor :nested_fields
16
+ # @attr [String] regionName
17
+ attr_accessor :regionName
18
+ # @attr [String] dimension
19
+ attr_accessor :dimension
11
20
  #
12
21
  # Updates type with machine-readable format.
13
22
  #
@@ -7,6 +7,8 @@ module GroupDocs
7
7
  require 'groupdocs/document/metadata'
8
8
  require 'groupdocs/document/rectangle'
9
9
  require 'groupdocs/document/view'
10
+ require 'groupdocs/document/editor'
11
+ require 'groupdocs/document/style'
10
12
 
11
13
  ACCESS_MODES = {
12
14
  :private => 0,
@@ -49,18 +51,22 @@ module GroupDocs
49
51
  #
50
52
  # Returns an array of all templates (documents in "Templates" directory).
51
53
  #
54
+ # @param [Hash] options Options
55
+ # @option options [String] :orderBy Order by column
56
+ # @option options [Boolean] :isAscending Order by ascending or descending
52
57
  # @param [Hash] access Access credentials
53
58
  # @option access [String] :client_id
54
59
  # @option access [String] :private_key
55
60
  # @return [Array<GroupDocs::Document>]
56
61
  #
57
62
  def self.templates!(options = {}, access = {})
58
- json = Api::Request.new do |request|
63
+ api = Api::Request.new do |request|
59
64
  request[:access] = access
60
65
  request[:method] = :GET
61
66
  request[:path] = '/merge/{{client_id}}/templates'
62
- end.execute!
63
-
67
+ end
68
+ api.add_params(options)
69
+ json = api.execute!
64
70
  json[:templates].map do |template|
65
71
  template.merge!(:file => Storage::File.new(template))
66
72
  Document.new(template)
@@ -199,7 +205,7 @@ module GroupDocs
199
205
 
200
206
  #added in release 1.6.0
201
207
  # @attr [String] fieldType
202
- attr_accessor :fileType
208
+ attr_accessor :fieldType
203
209
  # @attr [Int] dependent_questionnaires_count
204
210
  attr_accessor :dependent_questionnaires_count
205
211
  # @attr [Long] upload_time
@@ -1462,5 +1468,61 @@ module GroupDocs
1462
1468
  end.execute!
1463
1469
  end
1464
1470
 
1471
+ # added in release 1.7.0
1472
+ #
1473
+ # Get template fields.
1474
+ #
1475
+ # @param [Hash] access Access credentials
1476
+ # @option access [String] :client_id
1477
+ # @option access [String] :private_key
1478
+ #
1479
+ def editor_fields!(access = {})
1480
+ json = Api::Request.new do |request|
1481
+ request[:access] = access
1482
+ request[:method] = :GET
1483
+ request[:path] = "/doc/{{client_id}}/files/#{file.guid}/editor_fields"
1484
+ end.execute!
1485
+ json[:fields].map do |field|
1486
+ TemplateEditorFields.new(field)
1487
+ end
1488
+ end
1489
+
1490
+ # added in release 1.7.0
1491
+ #
1492
+ # Create questionnaire template from file.
1493
+ #
1494
+ # @example
1495
+ #
1496
+ # file = GroupDocs::Storage::File.new({:guid => '3be4e06494caed131d912c75e17d5f22592e3044032e0f81b35f13a8c9fefb49'}).to_document
1497
+ # field = GroupDocs::Document::TemplateEditorFields.new
1498
+ # field.name = 'test'
1499
+ # field.fieldtype = 'TextBox'
1500
+ # field.page = 1
1501
+ # file.questionnaire_template!([field] )
1502
+ #
1503
+ #
1504
+ # @param List[GroupDocs::Document::TemplateEditorFields] fields
1505
+ # @param [Hash] access Access credentials
1506
+ # @option access [String] :client_id
1507
+ # @option access [String] :private_key
1508
+ #
1509
+ def questionnaire_template!(fields, access = {})
1510
+
1511
+ fields.each do |field|
1512
+ field.is_a?(GroupDocs::Document::TemplateEditorFields) or raise ArgumentError,
1513
+ "Fields should be List GroupDocs::Document::TemplateEditorFields objects, received: #{fields.inspect}"
1514
+ end
1515
+
1516
+ json = Api::Request.new do |request|
1517
+ request[:access] = access
1518
+ request[:method] = :POST
1519
+ request[:path] = "/merge/{{client_id}}/files/#{file.guid}/templates"
1520
+ request[:request_body] = fields
1521
+ end.execute!
1522
+ json[:templateFields].map do |field|
1523
+ Document::Field.new(field)
1524
+ end
1525
+ end
1526
+
1465
1527
  end # Document
1466
1528
  end # GroupDocs
@@ -6,10 +6,10 @@ module GroupDocs
6
6
 
7
7
  include Api::Helpers::AccessMode
8
8
 
9
- #AnnotationType = { Text: 0, Area: 1, Point: 2, TextStrikeout: 3, Polyline: 4, TextField: 5, Watermark: 6, TextReplacement: 7, TextRemoval: 8 }
9
+ #AnnotationType = { Text: 0, Area: 1, Point: 2, TextStrikeout: 3, Polyline: 4, TextField: 5, Watermark: 6, TextReplacement: 7, Arrow: 8, TextRedaction 9, ResourceRedaction 10, TextUnderline 11, Distance 12, All 13 }
10
10
 
11
- # updateed in release 1.6.0
12
- TYPES = %w(Text Area Point TextStrikeout Polyline TextField Watermark TextReplacement TextRemoval )
11
+ # updated in release 1.7.0
12
+ TYPES = %w(Text Area Point TextStrikeout Polyline TextField Watermark TextReplacement Arrow TextRedaction ResourceRedaction ResourceRedaction TextUnderline Distance All)
13
13
 
14
14
  # @attr [GroupDocs::Document] document
15
15
  attr_accessor :document
@@ -54,7 +54,7 @@ module GroupDocs
54
54
  attr_accessor :serverTime
55
55
  #attr [Array]
56
56
 
57
- #added in release 1.6.0
57
+ #added in release 1.7.0
58
58
  #@attr [Int] penColor
59
59
  attr_accessor :penColor
60
60
  #@attr [Int] penWidth
@@ -65,7 +65,10 @@ module GroupDocs
65
65
  attr_accessor :creatorName
66
66
  #@attr [Int] creatorEmail
67
67
  attr_accessor :creatorEmail
68
-
68
+ #@attr [Long] penColor
69
+ attr_accessor :layerId
70
+ #@attr [Int] penWidth
71
+ attr_accessor :backgroundColor
69
72
 
70
73
  # Compatibility with response JSON
71
74
  alias_method :annotationGuid=, :guid=
@@ -82,12 +85,14 @@ module GroupDocs
82
85
  alias_accessor :page_number, :pageNumber
83
86
  alias_accessor :server_time, :serverTime
84
87
 
85
- #added in release 1.6.0
88
+ #added in release 1.7.0
86
89
  alias_accessor :pen_color, :penColor
87
90
  alias_accessor :pen_width, :penWidth
88
91
  alias_accessor :pen_style, :penStyle
89
92
  alias_accessor :creator_name, :creatorName
90
93
  alias_accessor :creator_email, :creatorEmail
94
+ alias_accessor :layer_id, :layerId
95
+ alias_accessor :background_color, :backgroundColor
91
96
 
92
97
  #
93
98
  # Creates new GroupDocs::Document::Annotation.
@@ -0,0 +1,53 @@
1
+ # added in release 1.7.0
2
+ module GroupDocs
3
+ class Document::TemplateEditorFields < Api::Entity
4
+
5
+ # @attr [Integer] page
6
+ attr_accessor :page
7
+ # @attr [String] name
8
+ attr_accessor :name
9
+ # @attr [String] type
10
+ attr_accessor :type
11
+ # @attr [GroupDocs::Document::Rectangle] rect
12
+ attr_accessor :rect
13
+ # @attr [String] fieldtype
14
+ attr_accessor :fieldtype
15
+ # @attr [Array] acceptableValues
16
+ attr_accessor :acceptableValues
17
+ # @attr [Int] selectionPosition
18
+ attr_accessor :selectionPosition
19
+ # @attr [Int] selectionLength
20
+ attr_accessor :selectionLength
21
+ # @attr [GroupDocs::Document::Style] style
22
+ attr_accessor :style
23
+ # @attr [Boolean] isTableMarker
24
+ attr_accessor :isTableMarker
25
+
26
+ #
27
+ # Converts passed hash to GroupDocs::Document::Rectangle object.
28
+ # @param [Hash] options
29
+ #
30
+ def rect=(rectangle)
31
+ if rectangle.is_a?(Hash)
32
+ rectangle = GroupDocs::Document::Rectangle.new(rectangle)
33
+ end
34
+
35
+ @rect = rectangle
36
+ end
37
+ #
38
+ # Converts passed hash to GroupDocs::Document::TemplateEditorFieldStyle object.
39
+ # @param [Hash] options
40
+ #
41
+ def style=(style)
42
+ if style.is_a?(Hash)
43
+ style = GroupDocs::Document::TemplateEditorFieldStyle.new(style)
44
+ end
45
+
46
+ @style = style
47
+ end
48
+
49
+ # Human-readable accessors
50
+ alias_accessor :rectangle, :rect
51
+
52
+ end # Document::TemplateEditorFields
53
+ end # GroupDocs
@@ -18,6 +18,22 @@ module GroupDocs
18
18
  # @attr [Array] acceptableValues
19
19
  attr_accessor :acceptableValues
20
20
 
21
+ # added in release 1.7.0
22
+
23
+ # @attr [Int] selectionPosition
24
+ attr_accessor :selectionPosition
25
+ # @attr [Int] selectionLength
26
+ attr_accessor :selectionLength
27
+ # @attr [Boolean] isTableStartMarker
28
+ attr_accessor :isTableStartMarker
29
+ # @attr [Boolean] isTableEndMarker
30
+ attr_accessor :isTableEndMarker
31
+ # @attr [String] regionName
32
+ attr_accessor :regionName
33
+
34
+
35
+
36
+
21
37
  #
22
38
  # Coverts passed hash to GroupDocs::Document::Rectangle object.
23
39
  # @param [Hash] options
@@ -0,0 +1,30 @@
1
+ # added in release 1.7.0
2
+ module GroupDocs
3
+ class Document::TemplateEditorFieldStyle < Api::Entity
4
+
5
+ # @attr [String] fontName
6
+ attr_accessor :fontName
7
+ # @attr [String] fontSize
8
+ attr_accessor :fontSize
9
+ # @attr [String] color
10
+ attr_accessor :color
11
+ # @attr [String] backgroundColor
12
+ attr_accessor :backgroundColor
13
+ # @attr [String] borderWidth
14
+ attr_accessor :borderWidth
15
+ # @attr [String] borderColor
16
+ attr_accessor :borderColor
17
+ # @attr [String] textAlignment
18
+ attr_accessor :textAlignment
19
+
20
+ # Human-readable accessors
21
+ alias_accessor :font_name, :fontName
22
+ alias_accessor :font_size, :fontSize
23
+ alias_accessor :background_color, :backgroundColor
24
+ alias_accessor :border_width, :borderWidth
25
+ alias_accessor :border_color, :borderColor
26
+ alias_accessor :text_alignment, :textAlignment
27
+
28
+
29
+ end # Document::TemplateEditorFieldStyle
30
+ end # GroupDocs
data/lib/groupdocs/job.rb CHANGED
@@ -440,5 +440,29 @@ module GroupDocs
440
440
  byte_from_array(actions, ACTIONS)
441
441
  end
442
442
 
443
+ #added in release 1.7.0
444
+
445
+ #
446
+ # Get Possible Conversions.
447
+ #
448
+ # @example
449
+ # GroupDocs::Job.get_conversions! "pdf"
450
+ #
451
+ #
452
+ # @param [Hash] access Access credentials
453
+ # @option access [String] :client_id
454
+ # @option access [String] :private_key
455
+ # @param [String] file_ext File extension to check
456
+ #
457
+ def self.get_conversions!(access = {}, file_ext)
458
+ api = Api::Request.new do |request|
459
+ request[:access] = access
460
+ request[:method] = :GET
461
+ request[:path] = "/async/{{client_id}}/possibleConversions/#{file_ext}"
462
+ end
463
+ json = api.execute!
464
+ json[:possibleConversions]
465
+ end
466
+
443
467
  end # Job
444
468
  end # GroupDocs
@@ -5,6 +5,8 @@ module GroupDocs
5
5
  require 'groupdocs/questionnaire/execution'
6
6
  require 'groupdocs/questionnaire/page'
7
7
  require 'groupdocs/questionnaire/question'
8
+ require 'groupdocs/questionnaire/collector_style'
9
+
8
10
 
9
11
  include Api::Helpers::Status
10
12
 
@@ -279,5 +279,57 @@ module GroupDocs
279
279
 
280
280
  end
281
281
 
282
+ #
283
+ # Added in release 1.7.0
284
+ #
285
+ # Decorate questionnaire collector
286
+ #
287
+ # @example
288
+ # questionnaire = GroupDocs::Questionnaire.get!(1)
289
+ # collector = questionnaire.collectors!.first
290
+ # style = GroupDocs::Questionnaire::QuestionnaireCollectorStyle.new
291
+ # style.collectorId = collector.id
292
+ # title = GroupDocs::Questionnaire::QuestionnaireCollectorStyle::Title.new
293
+ # title.color = 'blue'
294
+ # style.title = title
295
+ #
296
+ # @param [Hash] access Access credentials
297
+ # @option access [String] :client_id
298
+ # @option access [String] :private_key
299
+ #
300
+ def decorate!(style, access = {})
301
+ style.is_a?(GroupDocs::Questionnaire::QuestionnaireCollectorStyle) or raise ArgumentError,
302
+ "Style should be GroupDocs::Questionnaire::QuestionnaireCollectorStyle object, received: #{style.inspect}"
303
+ Api::Request.new do |request|
304
+ request[:access] = access
305
+ request[:method] = :POST
306
+ request[:path] = "/merge/{{client_id}}/questionnaires/collectors/#{guid}/decorate"
307
+ request[:request_body] = style
308
+ end.execute!
309
+ end
310
+
311
+
312
+ #
313
+ # Added in release 1.7.0
314
+ #
315
+ # Returns questionnaire collector style
316
+ #
317
+ # @example
318
+ # questionnaire = GroupDocs::Questionnaire.get!(1)
319
+ # collector = questionnaire.collectors!.first
320
+ # collector.decorate!
321
+ #
322
+ # @param [Hash] access Access credentials
323
+ # @option access [String] :client_id
324
+ # @option access [String] :private_key
325
+ #
326
+ def get_decorate!(access = {})
327
+ Api::Request.new do |request|
328
+ request[:access] = access
329
+ request[:method] = :GET
330
+ request[:path] = "/merge/{{client_id}}/questionnaires/collector/#{guid}/style"
331
+ end.execute!
332
+ end
333
+
282
334
  end # Questionnaire::Collector
283
335
  end # GroupDocs
@@ -0,0 +1,54 @@
1
+ # added in release 1.7.0
2
+ module GroupDocs
3
+ class Questionnaire::QuestionnaireCollectorStyle < Api::Entity
4
+ require 'groupdocs/questionnaire/style/title'
5
+ require 'groupdocs/questionnaire/style/base_font'
6
+ require 'groupdocs/questionnaire/style/question_title'
7
+
8
+ # @attr [String] page
9
+ attr_accessor :collectorId
10
+ # @attr [GroupDocs::Questionnaire::Rectangle] title
11
+ attr_accessor :title
12
+ # @attr [GroupDocs::Questionnaire::Rectangle] questionTitle
13
+ attr_accessor :questionTitle
14
+ # @attr [GroupDocs::Questionnaire::Rectangle] baseFont
15
+ attr_accessor :baseFont
16
+
17
+ #
18
+ # Converts passed hash to GroupDocs::Questionnaire::QuestionnaireCollectorStyle::Title object.
19
+ # @param [Hash] options
20
+ #
21
+ def title=(title)
22
+ if title.is_a?(Hash)
23
+ title = GroupDocs::Questionnaire::QuestionnaireCollectorStyle::Title.new(title)
24
+ end
25
+
26
+ @title = title
27
+ end
28
+
29
+ #
30
+ # Converts passed hash to GroupDocs::Questionnaire::QuestionnaireCollectorStyle::QuestionTitle object.
31
+ # @param [Hash] options
32
+ #
33
+ def questionTitle=(questionTitle)
34
+ if questionTitle.is_a?(Hash)
35
+ questionTitle = GroupDocs::Questionnaire::QuestionnaireCollectorStyle::QuestionTitle.new(questionTitle)
36
+ end
37
+
38
+ @questionTitle = questionTitle
39
+ end
40
+ #
41
+ # Converts passed hash to GroupDocs::Questionnaire::QuestionnaireCollectorStyle::BaseFont object.
42
+ # @param [Hash] options
43
+ #
44
+ def baseFont=(baseFont)
45
+ if baseFont.is_a?(Hash)
46
+ baseFont = GroupDocs::Questionnaire::QuestionnaireCollectorStyle::BaseFont.new(baseFont)
47
+ end
48
+
49
+ @baseFont = baseFont
50
+ end
51
+
52
+
53
+ end # Document::QuestionnaireCollectorStyle
54
+ end # GroupDocs