groupdocs_viewer_cloud 18.11 → 19.3

Sign up to get free protection for your applications and to get access to all the features.
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="attachment.rb">
4
- # Copyright (c) 2003-2018 Aspose Pty Ltd
3
+ # <copyright company="Aspose Pty Ltd" file="storage_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,28 +28,23 @@
28
28
  require 'date'
29
29
 
30
30
  module GroupDocsViewerCloud
31
- # Describes attachment.
32
- class Attachment
31
+ # Storage exists
32
+ class StorageExist
33
33
 
34
- # ULR to retrieve resource.
35
- attr_accessor :url
36
-
37
- # Attachment name.
38
- attr_accessor :name
34
+ # Shows that the storage exists.
35
+ attr_accessor :exists
39
36
 
40
37
  # Attribute mapping from ruby-style variable name to JSON key.
41
38
  def self.attribute_map
42
39
  {
43
- :'url' => :'url',
44
- :'name' => :'name'
40
+ :'exists' => :'Exists'
45
41
  }
46
42
  end
47
43
 
48
44
  # Attribute type mapping.
49
45
  def self.swagger_types
50
46
  {
51
- :'url' => :'String',
52
- :'name' => :'String'
47
+ :'exists' => :'BOOLEAN'
53
48
  }
54
49
  end
55
50
 
@@ -61,12 +56,8 @@ module GroupDocsViewerCloud
61
56
  # convert string to symbol for hash key
62
57
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
63
58
 
64
- if attributes.key?(:'url')
65
- self.url = attributes[:'url']
66
- end
67
-
68
- if attributes.key?(:'name')
69
- self.name = attributes[:'name']
59
+ if attributes.key?(:'Exists')
60
+ self.exists = attributes[:'Exists']
70
61
  end
71
62
 
72
63
  end
@@ -75,12 +66,17 @@ module GroupDocsViewerCloud
75
66
  # @return Array for valid properies with the reasons
76
67
  def list_invalid_properties
77
68
  invalid_properties = []
69
+ if @exists.nil?
70
+ invalid_properties.push("invalid value for 'exists', exists cannot be nil.")
71
+ end
72
+
78
73
  return invalid_properties
79
74
  end
80
75
 
81
76
  # Check to see if the all the properties in the model are valid
82
77
  # @return true if the model is valid
83
78
  def valid?
79
+ return false if @exists.nil?
84
80
  return true
85
81
  end
86
82
 
@@ -89,8 +85,7 @@ module GroupDocsViewerCloud
89
85
  def ==(other)
90
86
  return true if self.equal?(other)
91
87
  self.class == other.class &&
92
- url == other.url &&
93
- name == other.name
88
+ exists == other.exists
94
89
  end
95
90
 
96
91
  # @see the `==` method
@@ -102,7 +97,13 @@ module GroupDocsViewerCloud
102
97
  # Calculates hash code according to all attributes.
103
98
  # @return [Fixnum] Hash code
104
99
  def hash
105
- [url, name].hash
100
+ [exists].hash
101
+ end
102
+
103
+ # Downcases first letter.
104
+ # @return downcased string
105
+ def uncap(str)
106
+ str[0, 1].downcase + str[1..-1]
106
107
  end
107
108
 
108
109
  # Builds the object from hash
@@ -111,14 +112,16 @@ module GroupDocsViewerCloud
111
112
  def build_from_hash(attributes)
112
113
  return nil unless attributes.is_a?(Hash)
113
114
  self.class.swagger_types.each_pair do |key, type|
115
+ pname = uncap(self.class.attribute_map[key]).intern
116
+ value = attributes[pname]
114
117
  if type =~ /\AArray<(.*)>/i
115
118
  # check to ensure the input is an array given that the the attribute
116
- # is documented as an array but the input is not
117
- if attributes[self.class.attribute_map[key]].is_a?(Array)
118
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
119
+ # is documented as an array but the input is not
120
+ if value.is_a?(Array)
121
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
119
122
  end
120
- elsif !attributes[self.class.attribute_map[key]].nil?
121
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
123
+ elsif !value.nil?
124
+ self.send("#{key}=", _deserialize(type, value))
122
125
  end
123
126
  # or else data not found in attributes(hash), not an issue as the data can be optional
124
127
  end
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
- # <copyright company="Aspose Pty Ltd" file="image_attachment_page_collection.rb">
4
- # Copyright (c) 2003-2018 Aspose Pty Ltd
3
+ # <copyright company="Aspose Pty Ltd" file="storage_file.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,43 @@
28
28
  require 'date'
29
29
 
30
30
  module GroupDocsViewerCloud
31
- # Describes attachment pages.
32
- class ImageAttachmentPageCollection
31
+ # File or folder information
32
+ class StorageFile
33
33
 
34
- # File name.
35
- attr_accessor :file_name
34
+ # File or folder name.
35
+ attr_accessor :name
36
36
 
37
- # File folder.
38
- attr_accessor :folder
37
+ # True if it is a folder.
38
+ attr_accessor :is_folder
39
39
 
40
- # Name of the attachment.
41
- attr_accessor :attachment_name
40
+ # File or folder last modified DateTime.
41
+ attr_accessor :modified_date
42
42
 
43
- # Pages list.
44
- attr_accessor :pages
43
+ # File or folder size.
44
+ attr_accessor :size
45
+
46
+ # File or folder path.
47
+ attr_accessor :path
45
48
 
46
49
  # Attribute mapping from ruby-style variable name to JSON key.
47
50
  def self.attribute_map
48
51
  {
49
- :'file_name' => :'fileName',
50
- :'folder' => :'folder',
51
- :'attachment_name' => :'attachmentName',
52
- :'pages' => :'pages'
52
+ :'name' => :'Name',
53
+ :'is_folder' => :'IsFolder',
54
+ :'modified_date' => :'ModifiedDate',
55
+ :'size' => :'Size',
56
+ :'path' => :'Path'
53
57
  }
54
58
  end
55
59
 
56
60
  # Attribute type mapping.
57
61
  def self.swagger_types
58
62
  {
59
- :'file_name' => :'String',
60
- :'folder' => :'String',
61
- :'attachment_name' => :'String',
62
- :'pages' => :'Array<ImagePage>'
63
+ :'name' => :'String',
64
+ :'is_folder' => :'BOOLEAN',
65
+ :'modified_date' => :'DateTime',
66
+ :'size' => :'Integer',
67
+ :'path' => :'String'
63
68
  }
64
69
  end
65
70
 
@@ -71,22 +76,24 @@ module GroupDocsViewerCloud
71
76
  # convert string to symbol for hash key
72
77
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
73
78
 
74
- if attributes.key?(:'fileName')
75
- self.file_name = attributes[:'fileName']
79
+ if attributes.key?(:'Name')
80
+ self.name = attributes[:'Name']
76
81
  end
77
82
 
78
- if attributes.key?(:'folder')
79
- self.folder = attributes[:'folder']
83
+ if attributes.key?(:'IsFolder')
84
+ self.is_folder = attributes[:'IsFolder']
80
85
  end
81
86
 
82
- if attributes.key?(:'attachmentName')
83
- self.attachment_name = attributes[:'attachmentName']
87
+ if attributes.key?(:'ModifiedDate')
88
+ self.modified_date = attributes[:'ModifiedDate']
84
89
  end
85
90
 
86
- if attributes.key?(:'pages')
87
- if (value = attributes[:'pages']).is_a?(Array)
88
- self.pages = value
89
- end
91
+ if attributes.key?(:'Size')
92
+ self.size = attributes[:'Size']
93
+ end
94
+
95
+ if attributes.key?(:'Path')
96
+ self.path = attributes[:'Path']
90
97
  end
91
98
 
92
99
  end
@@ -95,12 +102,22 @@ module GroupDocsViewerCloud
95
102
  # @return Array for valid properies with the reasons
96
103
  def list_invalid_properties
97
104
  invalid_properties = []
105
+ if @is_folder.nil?
106
+ invalid_properties.push("invalid value for 'is_folder', is_folder cannot be nil.")
107
+ end
108
+
109
+ if @size.nil?
110
+ invalid_properties.push("invalid value for 'size', size cannot be nil.")
111
+ end
112
+
98
113
  return invalid_properties
99
114
  end
100
115
 
101
116
  # Check to see if the all the properties in the model are valid
102
117
  # @return true if the model is valid
103
118
  def valid?
119
+ return false if @is_folder.nil?
120
+ return false if @size.nil?
104
121
  return true
105
122
  end
106
123
 
@@ -109,10 +126,11 @@ module GroupDocsViewerCloud
109
126
  def ==(other)
110
127
  return true if self.equal?(other)
111
128
  self.class == other.class &&
112
- file_name == other.file_name &&
113
- folder == other.folder &&
114
- attachment_name == other.attachment_name &&
115
- pages == other.pages
129
+ name == other.name &&
130
+ is_folder == other.is_folder &&
131
+ modified_date == other.modified_date &&
132
+ size == other.size &&
133
+ path == other.path
116
134
  end
117
135
 
118
136
  # @see the `==` method
@@ -124,7 +142,13 @@ module GroupDocsViewerCloud
124
142
  # Calculates hash code according to all attributes.
125
143
  # @return [Fixnum] Hash code
126
144
  def hash
127
- [file_name, folder, attachment_name, pages].hash
145
+ [name, is_folder, modified_date, size, path].hash
146
+ end
147
+
148
+ # Downcases first letter.
149
+ # @return downcased string
150
+ def uncap(str)
151
+ str[0, 1].downcase + str[1..-1]
128
152
  end
129
153
 
130
154
  # Builds the object from hash
@@ -133,14 +157,16 @@ module GroupDocsViewerCloud
133
157
  def build_from_hash(attributes)
134
158
  return nil unless attributes.is_a?(Hash)
135
159
  self.class.swagger_types.each_pair do |key, type|
160
+ pname = uncap(self.class.attribute_map[key]).intern
161
+ value = attributes[pname]
136
162
  if type =~ /\AArray<(.*)>/i
137
163
  # check to ensure the input is an array given that the the attribute
138
- # is documented as an array but the input is not
139
- if attributes[self.class.attribute_map[key]].is_a?(Array)
140
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
164
+ # is documented as an array but the input is not
165
+ if value.is_a?(Array)
166
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
141
167
  end
142
- elsif !attributes[self.class.attribute_map[key]].nil?
143
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
168
+ elsif !value.nil?
169
+ self.send("#{key}=", _deserialize(type, value))
144
170
  end
145
171
  # or else data not found in attributes(hash), not an issue as the data can be optional
146
172
  end
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
- # <copyright company="Aspose Pty Ltd" file="document_info.rb">
4
- # Copyright (c) 2003-2018 Aspose Pty Ltd
3
+ # <copyright company="Aspose Pty Ltd" file="view_options.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,68 +28,64 @@
28
28
  require 'date'
29
29
 
30
30
  module GroupDocsViewerCloud
31
- # Describes document information.
32
- class DocumentInfo
33
-
34
- # File name.
35
- attr_accessor :file_name
36
-
37
- # Extension
38
- attr_accessor :extension
39
-
40
- # File format.
41
- attr_accessor :file_format
42
-
43
- # Size in bytes.
44
- attr_accessor :size
45
-
46
- # Modification date.
47
- attr_accessor :date_modified
48
-
49
- # Pages information.
50
- attr_accessor :pages
51
-
52
- # List of attachments.
53
- attr_accessor :attachments
54
-
55
- # The list of layers contained in a CAD document.
56
- attr_accessor :layers
57
-
58
- # For MS Project documents, The date time from which the project started.
59
- attr_accessor :start_date
31
+ # View options
32
+ class ViewOptions
33
+
34
+ # File info
35
+ attr_accessor :file_info
36
+
37
+ # View format (HTML, PNG, JPG, BMP or PDF) Default value is HTML.
38
+ attr_accessor :view_format
39
+
40
+ # The path to directory containing custom fonts in storage
41
+ attr_accessor :fonts_path
42
+
43
+ # Text watermark
44
+ attr_accessor :watermark
45
+
46
+ # Rendering options
47
+ attr_accessor :render_options
48
+ class EnumAttributeValidator
49
+ attr_reader :datatype
50
+ attr_reader :allowable_values
51
+
52
+ def initialize(datatype, allowable_values)
53
+ @allowable_values = allowable_values.map do |value|
54
+ case datatype.to_s
55
+ when /Integer/i
56
+ value.to_i
57
+ when /Float/i
58
+ value.to_f
59
+ else
60
+ value
61
+ end
62
+ end
63
+ end
60
64
 
61
- # For MS Project documents, the date time when the project is to be completed.
62
- attr_accessor :end_date
65
+ def valid?(value)
66
+ !value || allowable_values.include?(value)
67
+ end
68
+ end
63
69
 
64
70
  # Attribute mapping from ruby-style variable name to JSON key.
65
71
  def self.attribute_map
66
72
  {
67
- :'file_name' => :'fileName',
68
- :'extension' => :'extension',
69
- :'file_format' => :'fileFormat',
70
- :'size' => :'size',
71
- :'date_modified' => :'dateModified',
72
- :'pages' => :'pages',
73
- :'attachments' => :'attachments',
74
- :'layers' => :'layers',
75
- :'start_date' => :'startDate',
76
- :'end_date' => :'endDate'
73
+ :'file_info' => :'FileInfo',
74
+ :'view_format' => :'ViewFormat',
75
+ :'fonts_path' => :'FontsPath',
76
+ :'watermark' => :'Watermark',
77
+ :'render_options' => :'RenderOptions'
77
78
  }
78
79
  end
79
80
 
80
81
  # Attribute type mapping.
81
82
  def self.swagger_types
82
83
  {
83
- :'file_name' => :'String',
84
- :'extension' => :'String',
85
- :'file_format' => :'String',
86
- :'size' => :'Integer',
87
- :'date_modified' => :'DateTime',
88
- :'pages' => :'Array<PageInfo>',
89
- :'attachments' => :'Array<AttachmentInfo>',
90
- :'layers' => :'Array<String>',
91
- :'start_date' => :'DateTime',
92
- :'end_date' => :'DateTime'
84
+ :'file_info' => :'FileInfo',
85
+ :'view_format' => :'String',
86
+ :'fonts_path' => :'String',
87
+ :'watermark' => :'Watermark',
88
+ :'render_options' => :'RenderOptions'
93
89
  }
94
90
  end
95
91
 
@@ -101,50 +97,24 @@ module GroupDocsViewerCloud
101
97
  # convert string to symbol for hash key
102
98
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
103
99
 
104
- if attributes.key?(:'fileName')
105
- self.file_name = attributes[:'fileName']
106
- end
107
-
108
- if attributes.key?(:'extension')
109
- self.extension = attributes[:'extension']
110
- end
111
-
112
- if attributes.key?(:'fileFormat')
113
- self.file_format = attributes[:'fileFormat']
100
+ if attributes.key?(:'FileInfo')
101
+ self.file_info = attributes[:'FileInfo']
114
102
  end
115
103
 
116
- if attributes.key?(:'size')
117
- self.size = attributes[:'size']
104
+ if attributes.key?(:'ViewFormat')
105
+ self.view_format = attributes[:'ViewFormat']
118
106
  end
119
107
 
120
- if attributes.key?(:'dateModified')
121
- self.date_modified = attributes[:'dateModified']
108
+ if attributes.key?(:'FontsPath')
109
+ self.fonts_path = attributes[:'FontsPath']
122
110
  end
123
111
 
124
- if attributes.key?(:'pages')
125
- if (value = attributes[:'pages']).is_a?(Array)
126
- self.pages = value
127
- end
128
- end
129
-
130
- if attributes.key?(:'attachments')
131
- if (value = attributes[:'attachments']).is_a?(Array)
132
- self.attachments = value
133
- end
134
- end
135
-
136
- if attributes.key?(:'layers')
137
- if (value = attributes[:'layers']).is_a?(Array)
138
- self.layers = value
139
- end
140
- end
141
-
142
- if attributes.key?(:'startDate')
143
- self.start_date = attributes[:'startDate']
112
+ if attributes.key?(:'Watermark')
113
+ self.watermark = attributes[:'Watermark']
144
114
  end
145
115
 
146
- if attributes.key?(:'endDate')
147
- self.end_date = attributes[:'endDate']
116
+ if attributes.key?(:'RenderOptions')
117
+ self.render_options = attributes[:'RenderOptions']
148
118
  end
149
119
 
150
120
  end
@@ -153,30 +123,46 @@ module GroupDocsViewerCloud
153
123
  # @return Array for valid properies with the reasons
154
124
  def list_invalid_properties
155
125
  invalid_properties = []
126
+ if @view_format.nil?
127
+ invalid_properties.push("invalid value for 'view_format', view_format cannot be nil.")
128
+ end
129
+
156
130
  return invalid_properties
157
131
  end
158
132
 
159
133
  # Check to see if the all the properties in the model are valid
160
134
  # @return true if the model is valid
161
135
  def valid?
136
+ return false if @view_format.nil?
137
+ view_format_validator = EnumAttributeValidator.new('String', ["HTML", "PNG", "JPG", "BMP", "PDF"])
138
+ return false unless view_format_validator.valid?(@view_format)
162
139
  return true
163
140
  end
164
141
 
142
+ # Custom attribute writer method checking allowed values (enum).
143
+ # @param [Object] view_format Object to be assigned
144
+ def view_format=(view_format)
145
+ validator = EnumAttributeValidator.new('String', ["HTML", "PNG", "JPG", "BMP", "PDF"])
146
+ if view_format.to_i == 0
147
+ unless validator.valid?(view_format)
148
+ raise ArgumentError, "invalid value for 'view_format', must be one of #{validator.allowable_values}."
149
+ end
150
+ @view_format = view_format
151
+ else
152
+ @view_format = validator.allowable_values[view_format.to_i]
153
+ end
154
+ end
155
+
165
156
  # Checks equality by comparing each attribute.
166
157
  # @param [Object] Object to be compared
167
158
  def ==(other)
168
159
  return true if self.equal?(other)
169
160
  self.class == other.class &&
170
- file_name == other.file_name &&
171
- extension == other.extension &&
172
- file_format == other.file_format &&
173
- size == other.size &&
174
- date_modified == other.date_modified &&
175
- pages == other.pages &&
176
- attachments == other.attachments &&
177
- layers == other.layers &&
178
- start_date == other.start_date &&
179
- end_date == other.end_date
161
+ file_info == other.file_info &&
162
+ view_format == other.view_format &&
163
+ fonts_path == other.fonts_path &&
164
+ watermark == other.watermark &&
165
+ render_options == other.render_options
180
166
  end
181
167
 
182
168
  # @see the `==` method
@@ -188,7 +174,13 @@ module GroupDocsViewerCloud
188
174
  # Calculates hash code according to all attributes.
189
175
  # @return [Fixnum] Hash code
190
176
  def hash
191
- [file_name, extension, file_format, size, date_modified, pages, attachments, layers, start_date, end_date].hash
177
+ [file_info, view_format, fonts_path, watermark, render_options].hash
178
+ end
179
+
180
+ # Downcases first letter.
181
+ # @return downcased string
182
+ def uncap(str)
183
+ str[0, 1].downcase + str[1..-1]
192
184
  end
193
185
 
194
186
  # Builds the object from hash
@@ -197,14 +189,16 @@ module GroupDocsViewerCloud
197
189
  def build_from_hash(attributes)
198
190
  return nil unless attributes.is_a?(Hash)
199
191
  self.class.swagger_types.each_pair do |key, type|
192
+ pname = uncap(self.class.attribute_map[key]).intern
193
+ value = attributes[pname]
200
194
  if type =~ /\AArray<(.*)>/i
201
195
  # check to ensure the input is an array given that the the attribute
202
- # is documented as an array but the input is not
203
- if attributes[self.class.attribute_map[key]].is_a?(Array)
204
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
196
+ # is documented as an array but the input is not
197
+ if value.is_a?(Array)
198
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
205
199
  end
206
- elsif !attributes[self.class.attribute_map[key]].nil?
207
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
200
+ elsif !value.nil?
201
+ self.send("#{key}=", _deserialize(type, value))
208
202
  end
209
203
  # or else data not found in attributes(hash), not an issue as the data can be optional
210
204
  end