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="page_info_collection.rb">
4
- # Copyright (c) 2003-2018 Aspose Pty Ltd
3
+ # <copyright company="Aspose Pty Ltd" file="file_versions.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,23 +28,23 @@
28
28
  require 'date'
29
29
 
30
30
  module GroupDocsViewerCloud
31
- # Describes pages information.
32
- class PageInfoCollection
31
+ # File versions FileVersion.
32
+ class FileVersions
33
33
 
34
- # Pages list.
35
- attr_accessor :pages
34
+ # File versions FileVersion.
35
+ attr_accessor :value
36
36
 
37
37
  # Attribute mapping from ruby-style variable name to JSON key.
38
38
  def self.attribute_map
39
39
  {
40
- :'pages' => :'pages'
40
+ :'value' => :'Value'
41
41
  }
42
42
  end
43
43
 
44
44
  # Attribute type mapping.
45
45
  def self.swagger_types
46
46
  {
47
- :'pages' => :'Array<PageInfo>'
47
+ :'value' => :'Array<FileVersion>'
48
48
  }
49
49
  end
50
50
 
@@ -56,9 +56,9 @@ module GroupDocsViewerCloud
56
56
  # convert string to symbol for hash key
57
57
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
58
58
 
59
- if attributes.key?(:'pages')
60
- if (value = attributes[:'pages']).is_a?(Array)
61
- self.pages = value
59
+ if attributes.key?(:'Value')
60
+ if (value = attributes[:'Value']).is_a?(Array)
61
+ self.value = value
62
62
  end
63
63
  end
64
64
 
@@ -82,7 +82,7 @@ module GroupDocsViewerCloud
82
82
  def ==(other)
83
83
  return true if self.equal?(other)
84
84
  self.class == other.class &&
85
- pages == other.pages
85
+ value == other.value
86
86
  end
87
87
 
88
88
  # @see the `==` method
@@ -94,7 +94,13 @@ module GroupDocsViewerCloud
94
94
  # Calculates hash code according to all attributes.
95
95
  # @return [Fixnum] Hash code
96
96
  def hash
97
- [pages].hash
97
+ [value].hash
98
+ end
99
+
100
+ # Downcases first letter.
101
+ # @return downcased string
102
+ def uncap(str)
103
+ str[0, 1].downcase + str[1..-1]
98
104
  end
99
105
 
100
106
  # Builds the object from hash
@@ -103,14 +109,16 @@ module GroupDocsViewerCloud
103
109
  def build_from_hash(attributes)
104
110
  return nil unless attributes.is_a?(Hash)
105
111
  self.class.swagger_types.each_pair do |key, type|
112
+ pname = uncap(self.class.attribute_map[key]).intern
113
+ value = attributes[pname]
106
114
  if type =~ /\AArray<(.*)>/i
107
115
  # check to ensure the input is an array given that the the attribute
108
- # is documented as an array but the input is not
109
- if attributes[self.class.attribute_map[key]].is_a?(Array)
110
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
116
+ # is documented as an array but the input is not
117
+ if value.is_a?(Array)
118
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
111
119
  end
112
- elsif !attributes[self.class.attribute_map[key]].nil?
113
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
120
+ elsif !value.nil?
121
+ self.send("#{key}=", _deserialize(type, value))
114
122
  end
115
123
  # or else data not found in attributes(hash), not an issue as the data can be optional
116
124
  end
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
- # <copyright company="Aspose Pty Ltd" file="font_collection.rb">
4
- # Copyright (c) 2003-2018 Aspose Pty Ltd
3
+ # <copyright company="Aspose Pty Ltd" file="files_list.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,23 +28,23 @@
28
28
  require 'date'
29
29
 
30
30
  module GroupDocsViewerCloud
31
- # Describes collection of font families.
32
- class FontCollection
31
+ # Files list
32
+ class FilesList
33
33
 
34
- # Font families.
35
- attr_accessor :families
34
+ # Files and folders contained by folder StorageFile.
35
+ attr_accessor :value
36
36
 
37
37
  # Attribute mapping from ruby-style variable name to JSON key.
38
38
  def self.attribute_map
39
39
  {
40
- :'families' => :'families'
40
+ :'value' => :'Value'
41
41
  }
42
42
  end
43
43
 
44
44
  # Attribute type mapping.
45
45
  def self.swagger_types
46
46
  {
47
- :'families' => :'Array<FontFamily>'
47
+ :'value' => :'Array<StorageFile>'
48
48
  }
49
49
  end
50
50
 
@@ -56,9 +56,9 @@ module GroupDocsViewerCloud
56
56
  # convert string to symbol for hash key
57
57
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
58
58
 
59
- if attributes.key?(:'families')
60
- if (value = attributes[:'families']).is_a?(Array)
61
- self.families = value
59
+ if attributes.key?(:'Value')
60
+ if (value = attributes[:'Value']).is_a?(Array)
61
+ self.value = value
62
62
  end
63
63
  end
64
64
 
@@ -82,7 +82,7 @@ module GroupDocsViewerCloud
82
82
  def ==(other)
83
83
  return true if self.equal?(other)
84
84
  self.class == other.class &&
85
- families == other.families
85
+ value == other.value
86
86
  end
87
87
 
88
88
  # @see the `==` method
@@ -94,7 +94,13 @@ module GroupDocsViewerCloud
94
94
  # Calculates hash code according to all attributes.
95
95
  # @return [Fixnum] Hash code
96
96
  def hash
97
- [families].hash
97
+ [value].hash
98
+ end
99
+
100
+ # Downcases first letter.
101
+ # @return downcased string
102
+ def uncap(str)
103
+ str[0, 1].downcase + str[1..-1]
98
104
  end
99
105
 
100
106
  # Builds the object from hash
@@ -103,14 +109,16 @@ module GroupDocsViewerCloud
103
109
  def build_from_hash(attributes)
104
110
  return nil unless attributes.is_a?(Hash)
105
111
  self.class.swagger_types.each_pair do |key, type|
112
+ pname = uncap(self.class.attribute_map[key]).intern
113
+ value = attributes[pname]
106
114
  if type =~ /\AArray<(.*)>/i
107
115
  # check to ensure the input is an array given that the the attribute
108
- # is documented as an array but the input is not
109
- if attributes[self.class.attribute_map[key]].is_a?(Array)
110
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
116
+ # is documented as an array but the input is not
117
+ if value.is_a?(Array)
118
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
111
119
  end
112
- elsif !attributes[self.class.attribute_map[key]].nil?
113
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
120
+ elsif !value.nil?
121
+ self.send("#{key}=", _deserialize(type, value))
114
122
  end
115
123
  # or else data not found in attributes(hash), not an issue as the data can be optional
116
124
  end
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
- # <copyright company="Aspose Pty Ltd" file="image_page.rb">
4
- # Copyright (c) 2003-2018 Aspose Pty Ltd
3
+ # <copyright company="Aspose Pty Ltd" file="files_upload_result.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,28 @@
28
28
  require 'date'
29
29
 
30
30
  module GroupDocsViewerCloud
31
- # Describes image page.
32
- class ImagePage
31
+ # File upload result
32
+ class FilesUploadResult
33
33
 
34
- # ULR to retrieve resource.
35
- attr_accessor :url
34
+ # List of uploaded file names
35
+ attr_accessor :uploaded
36
36
 
37
- # Page number.
38
- attr_accessor :number
37
+ # List of errors.
38
+ attr_accessor :errors
39
39
 
40
40
  # Attribute mapping from ruby-style variable name to JSON key.
41
41
  def self.attribute_map
42
42
  {
43
- :'url' => :'url',
44
- :'number' => :'number'
43
+ :'uploaded' => :'Uploaded',
44
+ :'errors' => :'Errors'
45
45
  }
46
46
  end
47
47
 
48
48
  # Attribute type mapping.
49
49
  def self.swagger_types
50
50
  {
51
- :'url' => :'String',
52
- :'number' => :'Integer'
51
+ :'uploaded' => :'Array<String>',
52
+ :'errors' => :'Array<Error>'
53
53
  }
54
54
  end
55
55
 
@@ -61,12 +61,16 @@ module GroupDocsViewerCloud
61
61
  # convert string to symbol for hash key
62
62
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
63
63
 
64
- if attributes.key?(:'url')
65
- self.url = attributes[:'url']
64
+ if attributes.key?(:'Uploaded')
65
+ if (value = attributes[:'Uploaded']).is_a?(Array)
66
+ self.uploaded = value
67
+ end
66
68
  end
67
69
 
68
- if attributes.key?(:'number')
69
- self.number = attributes[:'number']
70
+ if attributes.key?(:'Errors')
71
+ if (value = attributes[:'Errors']).is_a?(Array)
72
+ self.errors = value
73
+ end
70
74
  end
71
75
 
72
76
  end
@@ -89,8 +93,8 @@ module GroupDocsViewerCloud
89
93
  def ==(other)
90
94
  return true if self.equal?(other)
91
95
  self.class == other.class &&
92
- url == other.url &&
93
- number == other.number
96
+ uploaded == other.uploaded &&
97
+ errors == other.errors
94
98
  end
95
99
 
96
100
  # @see the `==` method
@@ -102,7 +106,13 @@ module GroupDocsViewerCloud
102
106
  # Calculates hash code according to all attributes.
103
107
  # @return [Fixnum] Hash code
104
108
  def hash
105
- [url, number].hash
109
+ [uploaded, errors].hash
110
+ end
111
+
112
+ # Downcases first letter.
113
+ # @return downcased string
114
+ def uncap(str)
115
+ str[0, 1].downcase + str[1..-1]
106
116
  end
107
117
 
108
118
  # Builds the object from hash
@@ -111,14 +121,16 @@ module GroupDocsViewerCloud
111
121
  def build_from_hash(attributes)
112
122
  return nil unless attributes.is_a?(Hash)
113
123
  self.class.swagger_types.each_pair do |key, type|
124
+ pname = uncap(self.class.attribute_map[key]).intern
125
+ value = attributes[pname]
114
126
  if type =~ /\AArray<(.*)>/i
115
127
  # 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) })
128
+ # is documented as an array but the input is not
129
+ if value.is_a?(Array)
130
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
119
131
  end
120
- elsif !attributes[self.class.attribute_map[key]].nil?
121
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
132
+ elsif !value.nil?
133
+ self.send("#{key}=", _deserialize(type, value))
122
134
  end
123
135
  # or else data not found in attributes(hash), not an issue as the data can be optional
124
136
  end
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="format.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,28 +28,28 @@
28
28
  require 'date'
29
29
 
30
30
  module GroupDocsViewerCloud
31
- # Format description.
31
+ # File-format
32
32
  class Format
33
33
 
34
- # File format.
35
- attr_accessor :file_format
36
-
37
- # File extension.
34
+ # File extension
38
35
  attr_accessor :extension
39
36
 
37
+ # File format
38
+ attr_accessor :file_format
39
+
40
40
  # Attribute mapping from ruby-style variable name to JSON key.
41
41
  def self.attribute_map
42
42
  {
43
- :'file_format' => :'fileFormat',
44
- :'extension' => :'extension'
43
+ :'extension' => :'Extension',
44
+ :'file_format' => :'FileFormat'
45
45
  }
46
46
  end
47
47
 
48
48
  # Attribute type mapping.
49
49
  def self.swagger_types
50
50
  {
51
- :'file_format' => :'String',
52
- :'extension' => :'String'
51
+ :'extension' => :'String',
52
+ :'file_format' => :'String'
53
53
  }
54
54
  end
55
55
 
@@ -61,12 +61,12 @@ module GroupDocsViewerCloud
61
61
  # convert string to symbol for hash key
62
62
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
63
63
 
64
- if attributes.key?(:'fileFormat')
65
- self.file_format = attributes[:'fileFormat']
64
+ if attributes.key?(:'Extension')
65
+ self.extension = attributes[:'Extension']
66
66
  end
67
67
 
68
- if attributes.key?(:'extension')
69
- self.extension = attributes[:'extension']
68
+ if attributes.key?(:'FileFormat')
69
+ self.file_format = attributes[:'FileFormat']
70
70
  end
71
71
 
72
72
  end
@@ -89,8 +89,8 @@ module GroupDocsViewerCloud
89
89
  def ==(other)
90
90
  return true if self.equal?(other)
91
91
  self.class == other.class &&
92
- file_format == other.file_format &&
93
- extension == other.extension
92
+ extension == other.extension &&
93
+ file_format == other.file_format
94
94
  end
95
95
 
96
96
  # @see the `==` method
@@ -102,7 +102,13 @@ module GroupDocsViewerCloud
102
102
  # Calculates hash code according to all attributes.
103
103
  # @return [Fixnum] Hash code
104
104
  def hash
105
- [file_format, extension].hash
105
+ [extension, file_format].hash
106
+ end
107
+
108
+ # Downcases first letter.
109
+ # @return downcased string
110
+ def uncap(str)
111
+ str[0, 1].downcase + str[1..-1]
106
112
  end
107
113
 
108
114
  # Builds the object from hash
@@ -111,14 +117,16 @@ module GroupDocsViewerCloud
111
117
  def build_from_hash(attributes)
112
118
  return nil unless attributes.is_a?(Hash)
113
119
  self.class.swagger_types.each_pair do |key, type|
120
+ pname = uncap(self.class.attribute_map[key]).intern
121
+ value = attributes[pname]
114
122
  if type =~ /\AArray<(.*)>/i
115
123
  # 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) })
124
+ # is documented as an array but the input is not
125
+ if value.is_a?(Array)
126
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
119
127
  end
120
- elsif !attributes[self.class.attribute_map[key]].nil?
121
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
128
+ elsif !value.nil?
129
+ self.send("#{key}=", _deserialize(type, value))
122
130
  end
123
131
  # or else data not found in attributes(hash), not an issue as the data can be optional
124
132
  end
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
- # <copyright company="Aspose Pty Ltd" file="format_collection.rb">
4
- # Copyright (c) 2003-2018 Aspose Pty Ltd
3
+ # <copyright company="Aspose Pty Ltd" file="formats_result.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
@@ -29,7 +29,7 @@ require 'date'
29
29
 
30
30
  module GroupDocsViewerCloud
31
31
  # Describes object which contains list of supported file formats.
32
- class FormatCollection
32
+ class FormatsResult
33
33
 
34
34
  # Supported file formats.
35
35
  attr_accessor :formats
@@ -37,7 +37,7 @@ module GroupDocsViewerCloud
37
37
  # Attribute mapping from ruby-style variable name to JSON key.
38
38
  def self.attribute_map
39
39
  {
40
- :'formats' => :'formats'
40
+ :'formats' => :'Formats'
41
41
  }
42
42
  end
43
43
 
@@ -56,8 +56,8 @@ module GroupDocsViewerCloud
56
56
  # convert string to symbol for hash key
57
57
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
58
58
 
59
- if attributes.key?(:'formats')
60
- if (value = attributes[:'formats']).is_a?(Array)
59
+ if attributes.key?(:'Formats')
60
+ if (value = attributes[:'Formats']).is_a?(Array)
61
61
  self.formats = value
62
62
  end
63
63
  end
@@ -97,20 +97,28 @@ module GroupDocsViewerCloud
97
97
  [formats].hash
98
98
  end
99
99
 
100
+ # Downcases first letter.
101
+ # @return downcased string
102
+ def uncap(str)
103
+ str[0, 1].downcase + str[1..-1]
104
+ end
105
+
100
106
  # Builds the object from hash
101
107
  # @param [Hash] attributes Model attributes in the form of hash
102
108
  # @return [Object] Returns the model itself
103
109
  def build_from_hash(attributes)
104
110
  return nil unless attributes.is_a?(Hash)
105
111
  self.class.swagger_types.each_pair do |key, type|
112
+ pname = uncap(self.class.attribute_map[key]).intern
113
+ value = attributes[pname]
106
114
  if type =~ /\AArray<(.*)>/i
107
115
  # check to ensure the input is an array given that the the attribute
108
- # is documented as an array but the input is not
109
- if attributes[self.class.attribute_map[key]].is_a?(Array)
110
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
116
+ # is documented as an array but the input is not
117
+ if value.is_a?(Array)
118
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
111
119
  end
112
- elsif !attributes[self.class.attribute_map[key]].nil?
113
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
120
+ elsif !value.nil?
121
+ self.send("#{key}=", _deserialize(type, value))
114
122
  end
115
123
  # or else data not found in attributes(hash), not an issue as the data can be optional
116
124
  end