groupdocs_viewer_cloud 18.11 → 19.3

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 (111) hide show
  1. checksums.yaml +4 -4
  2. data/lib/groupdocs_viewer_cloud.rb +27 -32
  3. data/lib/groupdocs_viewer_cloud/api/file_api.rb +729 -0
  4. data/lib/groupdocs_viewer_cloud/api/folder_api.rb +694 -0
  5. data/lib/groupdocs_viewer_cloud/api/storage_api.rb +541 -0
  6. data/lib/groupdocs_viewer_cloud/api/viewer_api.rb +232 -5069
  7. data/lib/groupdocs_viewer_cloud/api_client.rb +5 -5
  8. data/lib/groupdocs_viewer_cloud/api_error.rb +6 -6
  9. data/lib/groupdocs_viewer_cloud/configuration.rb +4 -4
  10. data/lib/groupdocs_viewer_cloud/models/attachment_info.rb +22 -34
  11. data/lib/groupdocs_viewer_cloud/models/{html_page.rb → attachment_view.rb} +39 -33
  12. data/lib/groupdocs_viewer_cloud/models/cad_options.rb +44 -65
  13. data/lib/groupdocs_viewer_cloud/models/{font_family.rb → delete_view_options.rb} +25 -17
  14. data/lib/groupdocs_viewer_cloud/models/{reorder_options.rb → disc_usage.rb} +42 -34
  15. data/lib/groupdocs_viewer_cloud/models/email_options.rb +23 -25
  16. data/lib/groupdocs_viewer_cloud/models/{image_page_collection.rb → error.rb} +46 -40
  17. data/lib/groupdocs_viewer_cloud/models/{outlook_options.rb → error_details.rb} +40 -17
  18. data/lib/groupdocs_viewer_cloud/models/field_label.rb +20 -12
  19. data/lib/groupdocs_viewer_cloud/models/{transform_options_base.rb → file_info.rb} +49 -21
  20. data/lib/groupdocs_viewer_cloud/models/{html_attachment_page_collection.rb → file_version.rb} +91 -40
  21. data/lib/groupdocs_viewer_cloud/models/{page_info_collection.rb → file_versions.rb} +26 -18
  22. data/lib/groupdocs_viewer_cloud/models/{font_collection.rb → files_list.rb} +26 -18
  23. data/lib/groupdocs_viewer_cloud/models/{image_page.rb → files_upload_result.rb} +36 -24
  24. data/lib/groupdocs_viewer_cloud/models/format.rb +30 -22
  25. data/lib/groupdocs_viewer_cloud/models/{format_collection.rb → formats_result.rb} +19 -11
  26. data/lib/groupdocs_viewer_cloud/models/html_options.rb +108 -209
  27. data/lib/groupdocs_viewer_cloud/models/html_resource.rb +234 -0
  28. data/lib/groupdocs_viewer_cloud/models/image_options.rb +129 -163
  29. data/lib/groupdocs_viewer_cloud/models/{attachment_collection.rb → info_result.rb} +32 -32
  30. data/lib/groupdocs_viewer_cloud/models/{rotate_options.rb → object_exist.rb} +42 -34
  31. data/lib/groupdocs_viewer_cloud/models/page_info.rb +48 -55
  32. data/lib/groupdocs_viewer_cloud/models/{pdf_file_info.rb → page_view.rb} +53 -38
  33. data/lib/groupdocs_viewer_cloud/models/{project_options.rb → project_management_options.rb} +39 -21
  34. data/lib/groupdocs_viewer_cloud/models/render_options.rb +92 -146
  35. data/lib/groupdocs_viewer_cloud/models/resource.rb +30 -22
  36. data/lib/groupdocs_viewer_cloud/models/{row_info.rb → row.rb} +65 -37
  37. data/lib/groupdocs_viewer_cloud/models/{cells_options.rb → spreadsheet_options.rb} +95 -67
  38. data/lib/groupdocs_viewer_cloud/models/{attachment.rb → storage_exist.rb} +30 -27
  39. data/lib/groupdocs_viewer_cloud/models/{image_attachment_page_collection.rb → storage_file.rb} +66 -40
  40. data/lib/groupdocs_viewer_cloud/models/{document_info.rb → view_options.rb} +99 -105
  41. data/lib/groupdocs_viewer_cloud/models/{html_page_collection.rb → view_result.rb} +43 -33
  42. data/lib/groupdocs_viewer_cloud/models/watermark.rb +35 -22
  43. data/lib/groupdocs_viewer_cloud/version.rb +2 -2
  44. metadata +27 -110
  45. data/lib/groupdocs_viewer_cloud/models/document_info_options.rb +0 -358
  46. data/lib/groupdocs_viewer_cloud/models/file_response.rb +0 -196
  47. data/lib/groupdocs_viewer_cloud/models/pdf_file_options.rb +0 -358
  48. data/lib/groupdocs_viewer_cloud/models/pdf_options.rb +0 -236
  49. data/lib/groupdocs_viewer_cloud/models/render_options_base.rb +0 -358
  50. data/lib/groupdocs_viewer_cloud/models/requests/html_create_attachment_pages_cache_request.rb +0 -65
  51. data/lib/groupdocs_viewer_cloud/models/requests/html_create_pages_cache_from_content_request.rb +0 -65
  52. data/lib/groupdocs_viewer_cloud/models/requests/html_create_pages_cache_from_url_request.rb +0 -65
  53. data/lib/groupdocs_viewer_cloud/models/requests/html_create_pages_cache_request.rb +0 -61
  54. data/lib/groupdocs_viewer_cloud/models/requests/html_create_pdf_file_from_content_request.rb +0 -65
  55. data/lib/groupdocs_viewer_cloud/models/requests/html_create_pdf_file_from_url_request.rb +0 -65
  56. data/lib/groupdocs_viewer_cloud/models/requests/html_create_pdf_file_request.rb +0 -61
  57. data/lib/groupdocs_viewer_cloud/models/requests/html_delete_attachment_pages_cache_request.rb +0 -57
  58. data/lib/groupdocs_viewer_cloud/models/requests/html_delete_pages_cache_request.rb +0 -53
  59. data/lib/groupdocs_viewer_cloud/models/requests/html_get_attachment_info_request.rb +0 -65
  60. data/lib/groupdocs_viewer_cloud/models/requests/html_get_attachment_info_with_options_request.rb +0 -61
  61. data/lib/groupdocs_viewer_cloud/models/requests/html_get_attachment_page_request.rb +0 -109
  62. data/lib/groupdocs_viewer_cloud/models/requests/html_get_attachment_page_resource_request.rb +0 -65
  63. data/lib/groupdocs_viewer_cloud/models/requests/html_get_attachment_pages_request.rb +0 -113
  64. data/lib/groupdocs_viewer_cloud/models/requests/html_get_attachment_request.rb +0 -61
  65. data/lib/groupdocs_viewer_cloud/models/requests/html_get_attachments_request.rb +0 -57
  66. data/lib/groupdocs_viewer_cloud/models/requests/html_get_document_info_from_content_request.rb +0 -61
  67. data/lib/groupdocs_viewer_cloud/models/requests/html_get_document_info_from_url_request.rb +0 -69
  68. data/lib/groupdocs_viewer_cloud/models/requests/html_get_document_info_from_url_with_options_request.rb +0 -61
  69. data/lib/groupdocs_viewer_cloud/models/requests/html_get_document_info_request.rb +0 -65
  70. data/lib/groupdocs_viewer_cloud/models/requests/html_get_document_info_with_options_request.rb +0 -57
  71. data/lib/groupdocs_viewer_cloud/models/requests/html_get_page_request.rb +0 -101
  72. data/lib/groupdocs_viewer_cloud/models/requests/html_get_page_resource_request.rb +0 -61
  73. data/lib/groupdocs_viewer_cloud/models/requests/html_get_pages_from_url_request.rb +0 -109
  74. data/lib/groupdocs_viewer_cloud/models/requests/html_get_pages_request.rb +0 -105
  75. data/lib/groupdocs_viewer_cloud/models/requests/html_get_pdf_file_from_url_request.rb +0 -77
  76. data/lib/groupdocs_viewer_cloud/models/requests/html_get_pdf_file_request.rb +0 -73
  77. data/lib/groupdocs_viewer_cloud/models/requests/html_get_zip_with_attachment_pages_request.rb +0 -113
  78. data/lib/groupdocs_viewer_cloud/models/requests/html_get_zip_with_pages_request.rb +0 -105
  79. data/lib/groupdocs_viewer_cloud/models/requests/html_transform_pages_request.rb +0 -57
  80. data/lib/groupdocs_viewer_cloud/models/requests/image_create_attachment_pages_cache_request.rb +0 -65
  81. data/lib/groupdocs_viewer_cloud/models/requests/image_create_pages_cache_from_content_request.rb +0 -65
  82. data/lib/groupdocs_viewer_cloud/models/requests/image_create_pages_cache_from_url_request.rb +0 -65
  83. data/lib/groupdocs_viewer_cloud/models/requests/image_create_pages_cache_request.rb +0 -61
  84. data/lib/groupdocs_viewer_cloud/models/requests/image_create_pdf_file_from_content_request.rb +0 -65
  85. data/lib/groupdocs_viewer_cloud/models/requests/image_create_pdf_file_from_url_request.rb +0 -65
  86. data/lib/groupdocs_viewer_cloud/models/requests/image_create_pdf_file_request.rb +0 -61
  87. data/lib/groupdocs_viewer_cloud/models/requests/image_delete_attachment_pages_cache_request.rb +0 -57
  88. data/lib/groupdocs_viewer_cloud/models/requests/image_delete_pages_cache_request.rb +0 -53
  89. data/lib/groupdocs_viewer_cloud/models/requests/image_get_attachment_info_request.rb +0 -69
  90. data/lib/groupdocs_viewer_cloud/models/requests/image_get_attachment_info_with_options_request.rb +0 -61
  91. data/lib/groupdocs_viewer_cloud/models/requests/image_get_attachment_page_request.rb +0 -105
  92. data/lib/groupdocs_viewer_cloud/models/requests/image_get_attachment_pages_request.rb +0 -109
  93. data/lib/groupdocs_viewer_cloud/models/requests/image_get_attachment_request.rb +0 -61
  94. data/lib/groupdocs_viewer_cloud/models/requests/image_get_attachments_request.rb +0 -57
  95. data/lib/groupdocs_viewer_cloud/models/requests/image_get_document_info_from_content_request.rb +0 -61
  96. data/lib/groupdocs_viewer_cloud/models/requests/image_get_document_info_from_url_request.rb +0 -73
  97. data/lib/groupdocs_viewer_cloud/models/requests/image_get_document_info_from_url_with_options_request.rb +0 -61
  98. data/lib/groupdocs_viewer_cloud/models/requests/image_get_document_info_request.rb +0 -69
  99. data/lib/groupdocs_viewer_cloud/models/requests/image_get_document_info_with_options_request.rb +0 -57
  100. data/lib/groupdocs_viewer_cloud/models/requests/image_get_page_request.rb +0 -97
  101. data/lib/groupdocs_viewer_cloud/models/requests/image_get_pages_from_url_request.rb +0 -105
  102. data/lib/groupdocs_viewer_cloud/models/requests/image_get_pages_request.rb +0 -101
  103. data/lib/groupdocs_viewer_cloud/models/requests/image_get_pdf_file_from_url_request.rb +0 -77
  104. data/lib/groupdocs_viewer_cloud/models/requests/image_get_pdf_file_request.rb +0 -73
  105. data/lib/groupdocs_viewer_cloud/models/requests/image_get_zip_with_attachment_pages_request.rb +0 -109
  106. data/lib/groupdocs_viewer_cloud/models/requests/image_get_zip_with_pages_request.rb +0 -101
  107. data/lib/groupdocs_viewer_cloud/models/requests/image_transform_pages_request.rb +0 -57
  108. data/lib/groupdocs_viewer_cloud/models/resource_url.rb +0 -206
  109. data/lib/groupdocs_viewer_cloud/models/slides_options.rb +0 -206
  110. data/lib/groupdocs_viewer_cloud/models/tile.rb +0 -236
  111. data/lib/groupdocs_viewer_cloud/models/words_options.rb +0 -216
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
- # <copyright company="Aspose Pty Ltd" file="rotate_options.rb">
4
- # Copyright (c) 2003-2018 Aspose Pty Ltd
3
+ # <copyright company="Aspose Pty Ltd" file="object_exist.rb">
4
+ # Copyright (c) 2003-2019 Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -28,33 +28,28 @@
28
28
  require 'date'
29
29
 
30
30
  module GroupDocsViewerCloud
31
- # Provides options for rotating document pages.
32
- class RotateOptions
31
+ # Object exists
32
+ class ObjectExist
33
33
 
34
- # The page number to transform.
35
- attr_accessor :page_number
34
+ # Indicates that the file or folder exists.
35
+ attr_accessor :exists
36
36
 
37
- # Allows to specify document password in case when document is password-protected.
38
- attr_accessor :password
39
-
40
- # The angle in degrees to which the page should be rotated.
41
- attr_accessor :angle
37
+ # True if it is a folder, false if it is a file.
38
+ attr_accessor :is_folder
42
39
 
43
40
  # Attribute mapping from ruby-style variable name to JSON key.
44
41
  def self.attribute_map
45
42
  {
46
- :'page_number' => :'pageNumber',
47
- :'password' => :'password',
48
- :'angle' => :'angle'
43
+ :'exists' => :'Exists',
44
+ :'is_folder' => :'IsFolder'
49
45
  }
50
46
  end
51
47
 
52
48
  # Attribute type mapping.
53
49
  def self.swagger_types
54
50
  {
55
- :'page_number' => :'Integer',
56
- :'password' => :'String',
57
- :'angle' => :'Integer'
51
+ :'exists' => :'BOOLEAN',
52
+ :'is_folder' => :'BOOLEAN'
58
53
  }
59
54
  end
60
55
 
@@ -66,16 +61,12 @@ module GroupDocsViewerCloud
66
61
  # convert string to symbol for hash key
67
62
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
68
63
 
69
- if attributes.key?(:'pageNumber')
70
- self.page_number = attributes[:'pageNumber']
71
- end
72
-
73
- if attributes.key?(:'password')
74
- self.password = attributes[:'password']
64
+ if attributes.key?(:'Exists')
65
+ self.exists = attributes[:'Exists']
75
66
  end
76
67
 
77
- if attributes.key?(:'angle')
78
- self.angle = attributes[:'angle']
68
+ if attributes.key?(:'IsFolder')
69
+ self.is_folder = attributes[:'IsFolder']
79
70
  end
80
71
 
81
72
  end
@@ -84,12 +75,22 @@ module GroupDocsViewerCloud
84
75
  # @return Array for valid properies with the reasons
85
76
  def list_invalid_properties
86
77
  invalid_properties = []
78
+ if @exists.nil?
79
+ invalid_properties.push("invalid value for 'exists', exists cannot be nil.")
80
+ end
81
+
82
+ if @is_folder.nil?
83
+ invalid_properties.push("invalid value for 'is_folder', is_folder cannot be nil.")
84
+ end
85
+
87
86
  return invalid_properties
88
87
  end
89
88
 
90
89
  # Check to see if the all the properties in the model are valid
91
90
  # @return true if the model is valid
92
91
  def valid?
92
+ return false if @exists.nil?
93
+ return false if @is_folder.nil?
93
94
  return true
94
95
  end
95
96
 
@@ -98,9 +99,8 @@ module GroupDocsViewerCloud
98
99
  def ==(other)
99
100
  return true if self.equal?(other)
100
101
  self.class == other.class &&
101
- page_number == other.page_number &&
102
- password == other.password &&
103
- angle == other.angle
102
+ exists == other.exists &&
103
+ is_folder == other.is_folder
104
104
  end
105
105
 
106
106
  # @see the `==` method
@@ -112,7 +112,13 @@ module GroupDocsViewerCloud
112
112
  # Calculates hash code according to all attributes.
113
113
  # @return [Fixnum] Hash code
114
114
  def hash
115
- [page_number, password, angle].hash
115
+ [exists, is_folder].hash
116
+ end
117
+
118
+ # Downcases first letter.
119
+ # @return downcased string
120
+ def uncap(str)
121
+ str[0, 1].downcase + str[1..-1]
116
122
  end
117
123
 
118
124
  # Builds the object from hash
@@ -121,14 +127,16 @@ module GroupDocsViewerCloud
121
127
  def build_from_hash(attributes)
122
128
  return nil unless attributes.is_a?(Hash)
123
129
  self.class.swagger_types.each_pair do |key, type|
130
+ pname = uncap(self.class.attribute_map[key]).intern
131
+ value = attributes[pname]
124
132
  if type =~ /\AArray<(.*)>/i
125
133
  # check to ensure the input is an array given that the the attribute
126
- # is documented as an array but the input is not
127
- if attributes[self.class.attribute_map[key]].is_a?(Array)
128
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
134
+ # is documented as an array but the input is not
135
+ if value.is_a?(Array)
136
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
129
137
  end
130
- elsif !attributes[self.class.attribute_map[key]].nil?
131
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
138
+ elsif !value.nil?
139
+ self.send("#{key}=", _deserialize(type, value))
132
140
  end
133
141
  # or else data not found in attributes(hash), not an issue as the data can be optional
134
142
  end
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="page_info.rb">
4
- # Copyright (c) 2003-2018 Aspose Pty Ltd
4
+ # Copyright (c) 2003-2019 Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -28,40 +28,28 @@
28
28
  require 'date'
29
29
 
30
30
  module GroupDocsViewerCloud
31
- # Page information.
31
+ # Page information
32
32
  class PageInfo
33
33
 
34
- # Page number.
34
+ # Page number
35
35
  attr_accessor :number
36
36
 
37
- # Page name.
38
- attr_accessor :name
39
-
40
- # Page width.
37
+ # Image Page width
41
38
  attr_accessor :width
42
39
 
43
- # Page height.
40
+ # Image Page height
44
41
  attr_accessor :height
45
42
 
46
- # Page angle.
47
- attr_accessor :angle
48
-
49
- # Page visibility.
50
- attr_accessor :visible
51
-
52
- # Page rows.
43
+ # Image Page rows
53
44
  attr_accessor :rows
54
45
 
55
46
  # Attribute mapping from ruby-style variable name to JSON key.
56
47
  def self.attribute_map
57
48
  {
58
- :'number' => :'number',
59
- :'name' => :'name',
60
- :'width' => :'width',
61
- :'height' => :'height',
62
- :'angle' => :'angle',
63
- :'visible' => :'visible',
64
- :'rows' => :'rows'
49
+ :'number' => :'Number',
50
+ :'width' => :'Width',
51
+ :'height' => :'Height',
52
+ :'rows' => :'Rows'
65
53
  }
66
54
  end
67
55
 
@@ -69,12 +57,9 @@ module GroupDocsViewerCloud
69
57
  def self.swagger_types
70
58
  {
71
59
  :'number' => :'Integer',
72
- :'name' => :'String',
73
60
  :'width' => :'Integer',
74
61
  :'height' => :'Integer',
75
- :'angle' => :'Integer',
76
- :'visible' => :'BOOLEAN',
77
- :'rows' => :'Array<RowInfo>'
62
+ :'rows' => :'Array<Row>'
78
63
  }
79
64
  end
80
65
 
@@ -86,32 +71,20 @@ module GroupDocsViewerCloud
86
71
  # convert string to symbol for hash key
87
72
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
88
73
 
89
- if attributes.key?(:'number')
90
- self.number = attributes[:'number']
91
- end
92
-
93
- if attributes.key?(:'name')
94
- self.name = attributes[:'name']
95
- end
96
-
97
- if attributes.key?(:'width')
98
- self.width = attributes[:'width']
99
- end
100
-
101
- if attributes.key?(:'height')
102
- self.height = attributes[:'height']
74
+ if attributes.key?(:'Number')
75
+ self.number = attributes[:'Number']
103
76
  end
104
77
 
105
- if attributes.key?(:'angle')
106
- self.angle = attributes[:'angle']
78
+ if attributes.key?(:'Width')
79
+ self.width = attributes[:'Width']
107
80
  end
108
81
 
109
- if attributes.key?(:'visible')
110
- self.visible = attributes[:'visible']
82
+ if attributes.key?(:'Height')
83
+ self.height = attributes[:'Height']
111
84
  end
112
85
 
113
- if attributes.key?(:'rows')
114
- if (value = attributes[:'rows']).is_a?(Array)
86
+ if attributes.key?(:'Rows')
87
+ if (value = attributes[:'Rows']).is_a?(Array)
115
88
  self.rows = value
116
89
  end
117
90
  end
@@ -122,12 +95,27 @@ module GroupDocsViewerCloud
122
95
  # @return Array for valid properies with the reasons
123
96
  def list_invalid_properties
124
97
  invalid_properties = []
98
+ if @number.nil?
99
+ invalid_properties.push("invalid value for 'number', number cannot be nil.")
100
+ end
101
+
102
+ if @width.nil?
103
+ invalid_properties.push("invalid value for 'width', width cannot be nil.")
104
+ end
105
+
106
+ if @height.nil?
107
+ invalid_properties.push("invalid value for 'height', height cannot be nil.")
108
+ end
109
+
125
110
  return invalid_properties
126
111
  end
127
112
 
128
113
  # Check to see if the all the properties in the model are valid
129
114
  # @return true if the model is valid
130
115
  def valid?
116
+ return false if @number.nil?
117
+ return false if @width.nil?
118
+ return false if @height.nil?
131
119
  return true
132
120
  end
133
121
 
@@ -137,11 +125,8 @@ module GroupDocsViewerCloud
137
125
  return true if self.equal?(other)
138
126
  self.class == other.class &&
139
127
  number == other.number &&
140
- name == other.name &&
141
128
  width == other.width &&
142
129
  height == other.height &&
143
- angle == other.angle &&
144
- visible == other.visible &&
145
130
  rows == other.rows
146
131
  end
147
132
 
@@ -154,7 +139,13 @@ module GroupDocsViewerCloud
154
139
  # Calculates hash code according to all attributes.
155
140
  # @return [Fixnum] Hash code
156
141
  def hash
157
- [number, name, width, height, angle, visible, rows].hash
142
+ [number, width, height, rows].hash
143
+ end
144
+
145
+ # Downcases first letter.
146
+ # @return downcased string
147
+ def uncap(str)
148
+ str[0, 1].downcase + str[1..-1]
158
149
  end
159
150
 
160
151
  # Builds the object from hash
@@ -163,14 +154,16 @@ module GroupDocsViewerCloud
163
154
  def build_from_hash(attributes)
164
155
  return nil unless attributes.is_a?(Hash)
165
156
  self.class.swagger_types.each_pair do |key, type|
157
+ pname = uncap(self.class.attribute_map[key]).intern
158
+ value = attributes[pname]
166
159
  if type =~ /\AArray<(.*)>/i
167
160
  # check to ensure the input is an array given that the the attribute
168
- # is documented as an array but the input is not
169
- if attributes[self.class.attribute_map[key]].is_a?(Array)
170
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
161
+ # is documented as an array but the input is not
162
+ if value.is_a?(Array)
163
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
171
164
  end
172
- elsif !attributes[self.class.attribute_map[key]].nil?
173
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
165
+ elsif !value.nil?
166
+ self.send("#{key}=", _deserialize(type, value))
174
167
  end
175
168
  # or else data not found in attributes(hash), not an issue as the data can be optional
176
169
  end
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
- # <copyright company="Aspose Pty Ltd" file="pdf_file_info.rb">
4
- # Copyright (c) 2003-2018 Aspose Pty Ltd
3
+ # <copyright company="Aspose Pty Ltd" file="page_view.rb">
4
+ # Copyright (c) 2003-2019 Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -28,38 +28,38 @@
28
28
  require 'date'
29
29
 
30
30
  module GroupDocsViewerCloud
31
- # Describes PDF file information.
32
- class PdfFileInfo
31
+ # Page information
32
+ class PageView
33
33
 
34
- # ULR to retrieve resource.
35
- attr_accessor :url
34
+ # Path of resource file in storage
35
+ attr_accessor :path
36
36
 
37
- # File name.
38
- attr_accessor :file_name
37
+ # ULR to retrieve resource.
38
+ attr_accessor :download_url
39
39
 
40
- # File folder.
41
- attr_accessor :folder
40
+ # Page number
41
+ attr_accessor :number
42
42
 
43
- # PDF file name.
44
- attr_accessor :pdf_file_name
43
+ # HTML resources.
44
+ attr_accessor :resources
45
45
 
46
46
  # Attribute mapping from ruby-style variable name to JSON key.
47
47
  def self.attribute_map
48
48
  {
49
- :'url' => :'url',
50
- :'file_name' => :'fileName',
51
- :'folder' => :'folder',
52
- :'pdf_file_name' => :'pdfFileName'
49
+ :'path' => :'Path',
50
+ :'download_url' => :'DownloadUrl',
51
+ :'number' => :'Number',
52
+ :'resources' => :'Resources'
53
53
  }
54
54
  end
55
55
 
56
56
  # Attribute type mapping.
57
57
  def self.swagger_types
58
58
  {
59
- :'url' => :'String',
60
- :'file_name' => :'String',
61
- :'folder' => :'String',
62
- :'pdf_file_name' => :'String'
59
+ :'path' => :'String',
60
+ :'download_url' => :'String',
61
+ :'number' => :'Integer',
62
+ :'resources' => :'Array<HtmlResource>'
63
63
  }
64
64
  end
65
65
 
@@ -71,20 +71,22 @@ module GroupDocsViewerCloud
71
71
  # convert string to symbol for hash key
72
72
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
73
73
 
74
- if attributes.key?(:'url')
75
- self.url = attributes[:'url']
74
+ if attributes.key?(:'Path')
75
+ self.path = attributes[:'Path']
76
76
  end
77
77
 
78
- if attributes.key?(:'fileName')
79
- self.file_name = attributes[:'fileName']
78
+ if attributes.key?(:'DownloadUrl')
79
+ self.download_url = attributes[:'DownloadUrl']
80
80
  end
81
81
 
82
- if attributes.key?(:'folder')
83
- self.folder = attributes[:'folder']
82
+ if attributes.key?(:'Number')
83
+ self.number = attributes[:'Number']
84
84
  end
85
85
 
86
- if attributes.key?(:'pdfFileName')
87
- self.pdf_file_name = attributes[:'pdfFileName']
86
+ if attributes.key?(:'Resources')
87
+ if (value = attributes[:'Resources']).is_a?(Array)
88
+ self.resources = value
89
+ end
88
90
  end
89
91
 
90
92
  end
@@ -93,12 +95,17 @@ module GroupDocsViewerCloud
93
95
  # @return Array for valid properies with the reasons
94
96
  def list_invalid_properties
95
97
  invalid_properties = []
98
+ if @number.nil?
99
+ invalid_properties.push("invalid value for 'number', number cannot be nil.")
100
+ end
101
+
96
102
  return invalid_properties
97
103
  end
98
104
 
99
105
  # Check to see if the all the properties in the model are valid
100
106
  # @return true if the model is valid
101
107
  def valid?
108
+ return false if @number.nil?
102
109
  return true
103
110
  end
104
111
 
@@ -107,10 +114,10 @@ module GroupDocsViewerCloud
107
114
  def ==(other)
108
115
  return true if self.equal?(other)
109
116
  self.class == other.class &&
110
- url == other.url &&
111
- file_name == other.file_name &&
112
- folder == other.folder &&
113
- pdf_file_name == other.pdf_file_name
117
+ path == other.path &&
118
+ download_url == other.download_url &&
119
+ number == other.number &&
120
+ resources == other.resources
114
121
  end
115
122
 
116
123
  # @see the `==` method
@@ -122,7 +129,13 @@ module GroupDocsViewerCloud
122
129
  # Calculates hash code according to all attributes.
123
130
  # @return [Fixnum] Hash code
124
131
  def hash
125
- [url, file_name, folder, pdf_file_name].hash
132
+ [path, download_url, number, resources].hash
133
+ end
134
+
135
+ # Downcases first letter.
136
+ # @return downcased string
137
+ def uncap(str)
138
+ str[0, 1].downcase + str[1..-1]
126
139
  end
127
140
 
128
141
  # Builds the object from hash
@@ -131,14 +144,16 @@ module GroupDocsViewerCloud
131
144
  def build_from_hash(attributes)
132
145
  return nil unless attributes.is_a?(Hash)
133
146
  self.class.swagger_types.each_pair do |key, type|
147
+ pname = uncap(self.class.attribute_map[key]).intern
148
+ value = attributes[pname]
134
149
  if type =~ /\AArray<(.*)>/i
135
150
  # check to ensure the input is an array given that the the attribute
136
- # is documented as an array but the input is not
137
- if attributes[self.class.attribute_map[key]].is_a?(Array)
138
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
151
+ # is documented as an array but the input is not
152
+ if value.is_a?(Array)
153
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
139
154
  end
140
- elsif !attributes[self.class.attribute_map[key]].nil?
141
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
155
+ elsif !value.nil?
156
+ self.send("#{key}=", _deserialize(type, value))
142
157
  end
143
158
  # or else data not found in attributes(hash), not an issue as the data can be optional
144
159
  end