groupdocs_annotation_cloud 18.7 → 19.5

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 (50) hide show
  1. checksums.yaml +4 -4
  2. data/lib/groupdocs_annotation_cloud.rb +23 -39
  3. data/lib/groupdocs_annotation_cloud/api/annotate_api.rb +664 -0
  4. data/lib/groupdocs_annotation_cloud/api/file_api.rb +729 -0
  5. data/lib/groupdocs_annotation_cloud/api/folder_api.rb +694 -0
  6. data/lib/groupdocs_annotation_cloud/api/{pdf_file_api.rb → info_api.rb} +101 -105
  7. data/lib/groupdocs_annotation_cloud/api/preview_api.rb +380 -0
  8. data/lib/groupdocs_annotation_cloud/api/storage_api.rb +541 -0
  9. data/lib/groupdocs_annotation_cloud/api_client.rb +7 -17
  10. data/lib/groupdocs_annotation_cloud/api_error.rb +5 -3
  11. data/lib/groupdocs_annotation_cloud/configuration.rb +3 -3
  12. data/lib/groupdocs_annotation_cloud/models/annotation_api_link.rb +24 -16
  13. data/lib/groupdocs_annotation_cloud/models/annotation_info.rb +97 -82
  14. data/lib/groupdocs_annotation_cloud/models/annotation_reply_info.rb +31 -23
  15. data/lib/groupdocs_annotation_cloud/models/disc_usage.rb +234 -0
  16. data/lib/groupdocs_annotation_cloud/models/document_info.rb +44 -22
  17. data/lib/groupdocs_annotation_cloud/models/error.rb +244 -0
  18. data/lib/groupdocs_annotation_cloud/models/error_details.rb +229 -0
  19. data/lib/groupdocs_annotation_cloud/models/file_version.rb +289 -0
  20. data/lib/groupdocs_annotation_cloud/models/{value_type.rb → file_versions.rb} +33 -13
  21. data/lib/groupdocs_annotation_cloud/models/files_list.rb +216 -0
  22. data/lib/groupdocs_annotation_cloud/models/files_upload_result.rb +228 -0
  23. data/lib/groupdocs_annotation_cloud/models/format.rb +224 -0
  24. data/lib/groupdocs_annotation_cloud/models/formats_result.rb +216 -0
  25. data/lib/groupdocs_annotation_cloud/models/link.rb +24 -16
  26. data/lib/groupdocs_annotation_cloud/models/link_element.rb +18 -10
  27. data/lib/groupdocs_annotation_cloud/models/object_exist.rb +234 -0
  28. data/lib/groupdocs_annotation_cloud/models/{image_page.rb → page_image.rb} +28 -13
  29. data/lib/groupdocs_annotation_cloud/models/{image_pages.rb → page_images.rb} +26 -14
  30. data/lib/groupdocs_annotation_cloud/models/page_info.rb +41 -23
  31. data/lib/groupdocs_annotation_cloud/models/point.rb +31 -13
  32. data/lib/groupdocs_annotation_cloud/models/rectangle.rb +45 -17
  33. data/lib/groupdocs_annotation_cloud/models/row_info.rb +38 -16
  34. data/lib/groupdocs_annotation_cloud/models/storage_exist.rb +219 -0
  35. data/lib/groupdocs_annotation_cloud/models/storage_file.rb +264 -0
  36. data/lib/groupdocs_annotation_cloud/version.rb +2 -2
  37. metadata +22 -39
  38. data/lib/groupdocs_annotation_cloud/api/annotation_api.rb +0 -344
  39. data/lib/groupdocs_annotation_cloud/api/image_info_api.rb +0 -218
  40. data/lib/groupdocs_annotation_cloud/api/image_pages_api.rb +0 -395
  41. data/lib/groupdocs_annotation_cloud/models/requests/delete_clean_document_request.rb +0 -53
  42. data/lib/groupdocs_annotation_cloud/models/requests/delete_pages_request.rb +0 -49
  43. data/lib/groupdocs_annotation_cloud/models/requests/get_import_request.rb +0 -53
  44. data/lib/groupdocs_annotation_cloud/models/requests/get_info_request.rb +0 -53
  45. data/lib/groupdocs_annotation_cloud/models/requests/get_page_request.rb +0 -53
  46. data/lib/groupdocs_annotation_cloud/models/requests/get_pages_request.rb +0 -49
  47. data/lib/groupdocs_annotation_cloud/models/requests/get_pdf_request.rb +0 -53
  48. data/lib/groupdocs_annotation_cloud/models/requests/get_pdf_stream_request.rb +0 -53
  49. data/lib/groupdocs_annotation_cloud/models/requests/post_pages_request.rb +0 -53
  50. data/lib/groupdocs_annotation_cloud/models/requests/put_export_request.rb +0 -57
@@ -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="page_image.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,18 +28,20 @@
28
28
  require 'date'
29
29
 
30
30
  module GroupDocsAnnotationCloud
31
-
32
- class ImagePage
31
+ # The document page image representatoin
32
+ class PageImage
33
33
 
34
- # Link to the document.
34
+ # Link to the document
35
35
  attr_accessor :link
36
+
37
+ # Gets or sets the page number
36
38
  attr_accessor :number
37
39
 
38
40
  # Attribute mapping from ruby-style variable name to JSON key.
39
41
  def self.attribute_map
40
42
  {
41
43
  :'link' => :'link',
42
- :'number' => :'number'
44
+ :'number' => :'Number'
43
45
  }
44
46
  end
45
47
 
@@ -73,12 +75,17 @@ module GroupDocsAnnotationCloud
73
75
  # @return Array for valid properies with the reasons
74
76
  def list_invalid_properties
75
77
  invalid_properties = []
78
+ if @number.nil?
79
+ invalid_properties.push("invalid value for 'number', number cannot be nil.")
80
+ end
81
+
76
82
  return invalid_properties
77
83
  end
78
84
 
79
85
  # Check to see if the all the properties in the model are valid
80
86
  # @return true if the model is valid
81
87
  def valid?
88
+ return false if @number.nil?
82
89
  return true
83
90
  end
84
91
 
@@ -103,20 +110,28 @@ module GroupDocsAnnotationCloud
103
110
  [link, number].hash
104
111
  end
105
112
 
113
+ # Downcases first letter.
114
+ # @return downcased string
115
+ def uncap(str)
116
+ str[0, 1].downcase + str[1..-1]
117
+ end
118
+
106
119
  # Builds the object from hash
107
120
  # @param [Hash] attributes Model attributes in the form of hash
108
121
  # @return [Object] Returns the model itself
109
122
  def build_from_hash(attributes)
110
123
  return nil unless attributes.is_a?(Hash)
111
124
  self.class.swagger_types.each_pair do |key, type|
125
+ pname = uncap(self.class.attribute_map[key]).intern
126
+ value = attributes[pname]
112
127
  if type =~ /\AArray<(.*)>/i
113
128
  # check to ensure the input is an array given that the the attribute
114
- # is documented as an array but the input is not
115
- if attributes[self.class.attribute_map[key]].is_a?(Array)
116
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
129
+ # is documented as an array but the input is not
130
+ if value.is_a?(Array)
131
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
117
132
  end
118
- elsif !attributes[self.class.attribute_map[key]].nil?
119
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
133
+ elsif !value.nil?
134
+ self.send("#{key}=", _deserialize(type, value))
120
135
  end
121
136
  # or else data not found in attributes(hash), not an issue as the data can be optional
122
137
  end
@@ -131,9 +146,9 @@ module GroupDocsAnnotationCloud
131
146
  def _deserialize(type, value)
132
147
  case type.to_sym
133
148
  when :DateTime
134
- Time.at(/\d/.match(value)[0].to_f).to_datetime
149
+ Date.parse value
135
150
  when :Date
136
- Time.at(/\d/.match(value)[0].to_f).to_date
151
+ Date.parse value
137
152
  when :String
138
153
  value.to_s
139
154
  when :Integer
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
- # <copyright company="Aspose Pty Ltd" file="image_pages.rb">
4
- # Copyright (c) 2003-2018 Aspose Pty Ltd
3
+ # <copyright company="Aspose Pty Ltd" file="page_images.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,16 +28,20 @@
28
28
  require 'date'
29
29
 
30
30
  module GroupDocsAnnotationCloud
31
-
32
- class ImagePages
31
+ # Represents collection of document pages image representations
32
+ class PageImages
33
+
34
+ # The total count of page image entries in collection
33
35
  attr_accessor :total_count
36
+
37
+ # The collection of pages image representations
34
38
  attr_accessor :entries
35
39
 
36
40
  # Attribute mapping from ruby-style variable name to JSON key.
37
41
  def self.attribute_map
38
42
  {
39
- :'total_count' => :'totalCount',
40
- :'entries' => :'entries'
43
+ :'total_count' => :'TotalCount',
44
+ :'entries' => :'Entries'
41
45
  }
42
46
  end
43
47
 
@@ -45,7 +49,7 @@ module GroupDocsAnnotationCloud
45
49
  def self.swagger_types
46
50
  {
47
51
  :'total_count' => :'Integer',
48
- :'entries' => :'Array<ImagePage>'
52
+ :'entries' => :'Array<PageImage>'
49
53
  }
50
54
  end
51
55
 
@@ -108,20 +112,28 @@ module GroupDocsAnnotationCloud
108
112
  [total_count, entries].hash
109
113
  end
110
114
 
115
+ # Downcases first letter.
116
+ # @return downcased string
117
+ def uncap(str)
118
+ str[0, 1].downcase + str[1..-1]
119
+ end
120
+
111
121
  # Builds the object from hash
112
122
  # @param [Hash] attributes Model attributes in the form of hash
113
123
  # @return [Object] Returns the model itself
114
124
  def build_from_hash(attributes)
115
125
  return nil unless attributes.is_a?(Hash)
116
126
  self.class.swagger_types.each_pair do |key, type|
127
+ pname = uncap(self.class.attribute_map[key]).intern
128
+ value = attributes[pname]
117
129
  if type =~ /\AArray<(.*)>/i
118
130
  # check to ensure the input is an array given that the the attribute
119
- # is documented as an array but the input is not
120
- if attributes[self.class.attribute_map[key]].is_a?(Array)
121
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
131
+ # is documented as an array but the input is not
132
+ if value.is_a?(Array)
133
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
122
134
  end
123
- elsif !attributes[self.class.attribute_map[key]].nil?
124
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
135
+ elsif !value.nil?
136
+ self.send("#{key}=", _deserialize(type, value))
125
137
  end
126
138
  # or else data not found in attributes(hash), not an issue as the data can be optional
127
139
  end
@@ -136,9 +148,9 @@ module GroupDocsAnnotationCloud
136
148
  def _deserialize(type, value)
137
149
  case type.to_sym
138
150
  when :DateTime
139
- Time.at(/\d/.match(value)[0].to_f).to_datetime
151
+ Date.parse value
140
152
  when :Date
141
- Time.at(/\d/.match(value)[0].to_f).to_date
153
+ Date.parse value
142
154
  when :String
143
155
  value.to_s
144
156
  when :Integer
@@ -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,22 +28,32 @@
28
28
  require 'date'
29
29
 
30
30
  module GroupDocsAnnotationCloud
31
-
31
+ # Describes page information
32
32
  class PageInfo
33
+
34
+ # Gets or sets the page number
33
35
  attr_accessor :number
36
+
37
+ # Gets or sets the page width
34
38
  attr_accessor :width
39
+
40
+ # Gets or sets the page height
35
41
  attr_accessor :height
36
- attr_accessor :visible
42
+
43
+ # Indicates whether page is visible or not
44
+ attr_accessor :is_visible
45
+
46
+ # Gets or sets the list of text rows
37
47
  attr_accessor :rows
38
48
 
39
49
  # Attribute mapping from ruby-style variable name to JSON key.
40
50
  def self.attribute_map
41
51
  {
42
- :'number' => :'number',
43
- :'width' => :'width',
44
- :'height' => :'height',
45
- :'visible' => :'visible',
46
- :'rows' => :'rows'
52
+ :'number' => :'Number',
53
+ :'width' => :'Width',
54
+ :'height' => :'Height',
55
+ :'is_visible' => :'IsVisible',
56
+ :'rows' => :'Rows'
47
57
  }
48
58
  end
49
59
 
@@ -53,7 +63,7 @@ module GroupDocsAnnotationCloud
53
63
  :'number' => :'Integer',
54
64
  :'width' => :'Integer',
55
65
  :'height' => :'Integer',
56
- :'visible' => :'BOOLEAN',
66
+ :'is_visible' => :'BOOLEAN',
57
67
  :'rows' => :'Array<RowInfo>'
58
68
  }
59
69
  end
@@ -78,8 +88,8 @@ module GroupDocsAnnotationCloud
78
88
  self.height = attributes[:'Height']
79
89
  end
80
90
 
81
- if attributes.key?(:'Visible')
82
- self.visible = attributes[:'Visible']
91
+ if attributes.key?(:'IsVisible')
92
+ self.is_visible = attributes[:'IsVisible']
83
93
  end
84
94
 
85
95
  if attributes.key?(:'Rows')
@@ -106,8 +116,8 @@ module GroupDocsAnnotationCloud
106
116
  invalid_properties.push("invalid value for 'height', height cannot be nil.")
107
117
  end
108
118
 
109
- if @visible.nil?
110
- invalid_properties.push("invalid value for 'visible', visible cannot be nil.")
119
+ if @is_visible.nil?
120
+ invalid_properties.push("invalid value for 'is_visible', is_visible cannot be nil.")
111
121
  end
112
122
 
113
123
  return invalid_properties
@@ -119,7 +129,7 @@ module GroupDocsAnnotationCloud
119
129
  return false if @number.nil?
120
130
  return false if @width.nil?
121
131
  return false if @height.nil?
122
- return false if @visible.nil?
132
+ return false if @is_visible.nil?
123
133
  return true
124
134
  end
125
135
 
@@ -131,7 +141,7 @@ module GroupDocsAnnotationCloud
131
141
  number == other.number &&
132
142
  width == other.width &&
133
143
  height == other.height &&
134
- visible == other.visible &&
144
+ is_visible == other.is_visible &&
135
145
  rows == other.rows
136
146
  end
137
147
 
@@ -144,7 +154,13 @@ module GroupDocsAnnotationCloud
144
154
  # Calculates hash code according to all attributes.
145
155
  # @return [Fixnum] Hash code
146
156
  def hash
147
- [number, width, height, visible, rows].hash
157
+ [number, width, height, is_visible, rows].hash
158
+ end
159
+
160
+ # Downcases first letter.
161
+ # @return downcased string
162
+ def uncap(str)
163
+ str[0, 1].downcase + str[1..-1]
148
164
  end
149
165
 
150
166
  # Builds the object from hash
@@ -153,14 +169,16 @@ module GroupDocsAnnotationCloud
153
169
  def build_from_hash(attributes)
154
170
  return nil unless attributes.is_a?(Hash)
155
171
  self.class.swagger_types.each_pair do |key, type|
172
+ pname = uncap(self.class.attribute_map[key]).intern
173
+ value = attributes[pname]
156
174
  if type =~ /\AArray<(.*)>/i
157
175
  # check to ensure the input is an array given that the the attribute
158
- # is documented as an array but the input is not
159
- if attributes[self.class.attribute_map[key]].is_a?(Array)
160
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
176
+ # is documented as an array but the input is not
177
+ if value.is_a?(Array)
178
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
161
179
  end
162
- elsif !attributes[self.class.attribute_map[key]].nil?
163
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
180
+ elsif !value.nil?
181
+ self.send("#{key}=", _deserialize(type, value))
164
182
  end
165
183
  # or else data not found in attributes(hash), not an issue as the data can be optional
166
184
  end
@@ -175,9 +193,9 @@ module GroupDocsAnnotationCloud
175
193
  def _deserialize(type, value)
176
194
  case type.to_sym
177
195
  when :DateTime
178
- Time.at(/\d/.match(value)[0].to_f).to_datetime
196
+ Date.parse value
179
197
  when :Date
180
- Time.at(/\d/.match(value)[0].to_f).to_date
198
+ Date.parse value
181
199
  when :String
182
200
  value.to_s
183
201
  when :Integer
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="point.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,20 +28,20 @@
28
28
  require 'date'
29
29
 
30
30
  module GroupDocsAnnotationCloud
31
-
31
+ # Describes point where annotation will be placed
32
32
  class Point
33
33
 
34
- # Gets or sets the x.
34
+ # Gets or sets the x coordinate
35
35
  attr_accessor :x
36
36
 
37
- # Gets or sets the y.
37
+ # Gets or sets the y coordinate
38
38
  attr_accessor :y
39
39
 
40
40
  # Attribute mapping from ruby-style variable name to JSON key.
41
41
  def self.attribute_map
42
42
  {
43
- :'x' => :'x',
44
- :'y' => :'y'
43
+ :'x' => :'X',
44
+ :'y' => :'Y'
45
45
  }
46
46
  end
47
47
 
@@ -75,12 +75,22 @@ module GroupDocsAnnotationCloud
75
75
  # @return Array for valid properies with the reasons
76
76
  def list_invalid_properties
77
77
  invalid_properties = []
78
+ if @x.nil?
79
+ invalid_properties.push("invalid value for 'x', x cannot be nil.")
80
+ end
81
+
82
+ if @y.nil?
83
+ invalid_properties.push("invalid value for 'y', y cannot be nil.")
84
+ end
85
+
78
86
  return invalid_properties
79
87
  end
80
88
 
81
89
  # Check to see if the all the properties in the model are valid
82
90
  # @return true if the model is valid
83
91
  def valid?
92
+ return false if @x.nil?
93
+ return false if @y.nil?
84
94
  return true
85
95
  end
86
96
 
@@ -105,20 +115,28 @@ module GroupDocsAnnotationCloud
105
115
  [x, y].hash
106
116
  end
107
117
 
118
+ # Downcases first letter.
119
+ # @return downcased string
120
+ def uncap(str)
121
+ str[0, 1].downcase + str[1..-1]
122
+ end
123
+
108
124
  # Builds the object from hash
109
125
  # @param [Hash] attributes Model attributes in the form of hash
110
126
  # @return [Object] Returns the model itself
111
127
  def build_from_hash(attributes)
112
128
  return nil unless attributes.is_a?(Hash)
113
129
  self.class.swagger_types.each_pair do |key, type|
130
+ pname = uncap(self.class.attribute_map[key]).intern
131
+ value = attributes[pname]
114
132
  if type =~ /\AArray<(.*)>/i
115
133
  # 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) })
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) })
119
137
  end
120
- elsif !attributes[self.class.attribute_map[key]].nil?
121
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
138
+ elsif !value.nil?
139
+ self.send("#{key}=", _deserialize(type, value))
122
140
  end
123
141
  # or else data not found in attributes(hash), not an issue as the data can be optional
124
142
  end
@@ -133,9 +151,9 @@ module GroupDocsAnnotationCloud
133
151
  def _deserialize(type, value)
134
152
  case type.to_sym
135
153
  when :DateTime
136
- Time.at(/\d/.match(value)[0].to_f).to_datetime
154
+ Date.parse value
137
155
  when :Date
138
- Time.at(/\d/.match(value)[0].to_f).to_date
156
+ Date.parse value
139
157
  when :String
140
158
  value.to_s
141
159
  when :Integer
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="rectangle.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 GroupDocsAnnotationCloud
31
-
31
+ # Describes rectangle where annotation will be placed
32
32
  class Rectangle
33
33
 
34
- # Gets or sets the x.
34
+ # Gets or sets the x coordinate of the rectangle upper left corner
35
35
  attr_accessor :x
36
36
 
37
- # Gets or sets the y.
37
+ # Gets or sets the y coordinate of the rectangle upper left corner
38
38
  attr_accessor :y
39
39
 
40
- # Gets or sets the width.
40
+ # Gets or sets the rectangle width
41
41
  attr_accessor :width
42
42
 
43
- # Gets or sets the height.
43
+ # Gets or sets the rectangle height
44
44
  attr_accessor :height
45
45
 
46
46
  # Attribute mapping from ruby-style variable name to JSON key.
47
47
  def self.attribute_map
48
48
  {
49
- :'x' => :'x',
50
- :'y' => :'y',
51
- :'width' => :'width',
52
- :'height' => :'height'
49
+ :'x' => :'X',
50
+ :'y' => :'Y',
51
+ :'width' => :'Width',
52
+ :'height' => :'Height'
53
53
  }
54
54
  end
55
55
 
@@ -93,12 +93,32 @@ module GroupDocsAnnotationCloud
93
93
  # @return Array for valid properies with the reasons
94
94
  def list_invalid_properties
95
95
  invalid_properties = []
96
+ if @x.nil?
97
+ invalid_properties.push("invalid value for 'x', x cannot be nil.")
98
+ end
99
+
100
+ if @y.nil?
101
+ invalid_properties.push("invalid value for 'y', y cannot be nil.")
102
+ end
103
+
104
+ if @width.nil?
105
+ invalid_properties.push("invalid value for 'width', width cannot be nil.")
106
+ end
107
+
108
+ if @height.nil?
109
+ invalid_properties.push("invalid value for 'height', height cannot be nil.")
110
+ end
111
+
96
112
  return invalid_properties
97
113
  end
98
114
 
99
115
  # Check to see if the all the properties in the model are valid
100
116
  # @return true if the model is valid
101
117
  def valid?
118
+ return false if @x.nil?
119
+ return false if @y.nil?
120
+ return false if @width.nil?
121
+ return false if @height.nil?
102
122
  return true
103
123
  end
104
124
 
@@ -125,20 +145,28 @@ module GroupDocsAnnotationCloud
125
145
  [x, y, width, height].hash
126
146
  end
127
147
 
148
+ # Downcases first letter.
149
+ # @return downcased string
150
+ def uncap(str)
151
+ str[0, 1].downcase + str[1..-1]
152
+ end
153
+
128
154
  # Builds the object from hash
129
155
  # @param [Hash] attributes Model attributes in the form of hash
130
156
  # @return [Object] Returns the model itself
131
157
  def build_from_hash(attributes)
132
158
  return nil unless attributes.is_a?(Hash)
133
159
  self.class.swagger_types.each_pair do |key, type|
160
+ pname = uncap(self.class.attribute_map[key]).intern
161
+ value = attributes[pname]
134
162
  if type =~ /\AArray<(.*)>/i
135
163
  # 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) })
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) })
139
167
  end
140
- elsif !attributes[self.class.attribute_map[key]].nil?
141
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
168
+ elsif !value.nil?
169
+ self.send("#{key}=", _deserialize(type, value))
142
170
  end
143
171
  # or else data not found in attributes(hash), not an issue as the data can be optional
144
172
  end
@@ -153,9 +181,9 @@ module GroupDocsAnnotationCloud
153
181
  def _deserialize(type, value)
154
182
  case type.to_sym
155
183
  when :DateTime
156
- Time.at(/\d/.match(value)[0].to_f).to_datetime
184
+ Date.parse value
157
185
  when :Date
158
- Time.at(/\d/.match(value)[0].to_f).to_date
186
+ Date.parse value
159
187
  when :String
160
188
  value.to_s
161
189
  when :Integer