artikcloud 2.0.0 → 2.0.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 (144) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +12 -12
  3. data/README.md +33 -10
  4. data/artikcloud.gemspec +5 -6
  5. data/docs/Action.md +9 -0
  6. data/docs/ActionArray.md +8 -0
  7. data/docs/Actions.md +12 -0
  8. data/docs/DeviceTypesApi.md +10 -10
  9. data/docs/DevicesApi.md +68 -15
  10. data/docs/ExportApi.md +10 -10
  11. data/docs/Message.md +11 -0
  12. data/docs/MessagesApi.md +205 -27
  13. data/docs/NormalizedAction.md +16 -0
  14. data/docs/NormalizedActionsEnvelope.md +17 -0
  15. data/docs/PresenceEnvelope.md +9 -0
  16. data/docs/PresenceModel.md +9 -0
  17. data/docs/RegistrationsApi.md +6 -6
  18. data/docs/RulesApi.md +8 -8
  19. data/docs/RulesEnvelope.md +1 -1
  20. data/docs/SnapshotResponse.md +9 -0
  21. data/docs/SnapshotResponses.md +10 -0
  22. data/docs/SnapshotsResponseEnvelope.md +9 -0
  23. data/docs/TagsApi.md +7 -7
  24. data/docs/TokenInfo.md +11 -0
  25. data/docs/TokenInfoSuccessResponse.md +8 -0
  26. data/docs/TokensApi.md +54 -7
  27. data/docs/UsersApi.md +18 -20
  28. data/git_push.sh +16 -1
  29. data/lib/artikcloud/api/device_types_api.rb +52 -59
  30. data/lib/artikcloud/api/devices_api.rb +120 -76
  31. data/lib/artikcloud/api/export_api.rb +43 -45
  32. data/lib/artikcloud/api/messages_api.rb +285 -103
  33. data/lib/artikcloud/api/registrations_api.rb +34 -34
  34. data/lib/artikcloud/api/rules_api.rb +43 -48
  35. data/lib/artikcloud/api/tags_api.rb +37 -35
  36. data/lib/artikcloud/api/tokens_api.rb +85 -30
  37. data/lib/artikcloud/api/users_api.rb +83 -102
  38. data/lib/artikcloud/api_client.rb +56 -13
  39. data/lib/artikcloud/api_error.rb +13 -4
  40. data/lib/artikcloud/configuration.rb +45 -1
  41. data/lib/artikcloud/models/ack_envelope.rb +59 -24
  42. data/lib/artikcloud/models/acknowledgement.rb +65 -33
  43. data/lib/artikcloud/models/action.rb +212 -0
  44. data/lib/artikcloud/models/action_array.rb +201 -0
  45. data/lib/artikcloud/models/action_details.rb +61 -27
  46. data/lib/artikcloud/models/action_details_array.rb +59 -24
  47. data/lib/artikcloud/models/action_in.rb +69 -39
  48. data/lib/artikcloud/models/action_out.rb +67 -36
  49. data/lib/artikcloud/models/actions.rb +241 -0
  50. data/lib/artikcloud/models/aggregate_data.rb +69 -39
  51. data/lib/artikcloud/models/aggregates_histogram_data.rb +71 -42
  52. data/lib/artikcloud/models/aggregates_histogram_response.rb +71 -42
  53. data/lib/artikcloud/models/aggregates_response.rb +69 -39
  54. data/lib/artikcloud/models/app_properties.rb +64 -30
  55. data/lib/artikcloud/models/check_token_message.rb +59 -24
  56. data/lib/artikcloud/models/check_token_response.rb +59 -24
  57. data/lib/artikcloud/models/device.rb +85 -63
  58. data/lib/artikcloud/models/device_array.rb +59 -24
  59. data/lib/artikcloud/models/device_envelope.rb +60 -24
  60. data/lib/artikcloud/models/device_reg_complete_request.rb +59 -24
  61. data/lib/artikcloud/models/device_reg_confirm_user_request.rb +63 -30
  62. data/lib/artikcloud/models/device_reg_confirm_user_response.rb +59 -24
  63. data/lib/artikcloud/models/device_reg_confirm_user_response_envelope.rb +59 -24
  64. data/lib/artikcloud/models/device_reg_status_response.rb +61 -27
  65. data/lib/artikcloud/models/device_reg_status_response_envelope.rb +59 -24
  66. data/lib/artikcloud/models/device_token.rb +69 -33
  67. data/lib/artikcloud/models/device_token_envelope.rb +60 -24
  68. data/lib/artikcloud/models/device_type.rb +93 -75
  69. data/lib/artikcloud/models/device_type_array.rb +59 -24
  70. data/lib/artikcloud/models/device_type_envelope.rb +60 -24
  71. data/lib/artikcloud/models/device_types_envelope.rb +68 -33
  72. data/lib/artikcloud/models/devices_envelope.rb +68 -33
  73. data/lib/artikcloud/models/error_envelope.rb +59 -24
  74. data/lib/artikcloud/models/export_data.rb +71 -42
  75. data/lib/artikcloud/models/export_data_array.rb +59 -24
  76. data/lib/artikcloud/models/export_history_response.rb +65 -33
  77. data/lib/artikcloud/models/export_normalized_messages_response.rb +83 -60
  78. data/lib/artikcloud/models/export_request.rb +73 -45
  79. data/lib/artikcloud/models/export_request_data.rb +79 -54
  80. data/lib/artikcloud/models/export_request_info.rb +77 -51
  81. data/lib/artikcloud/models/export_request_response.rb +59 -24
  82. data/lib/artikcloud/models/export_response.rb +79 -54
  83. data/lib/artikcloud/models/export_status_response.rb +67 -36
  84. data/lib/artikcloud/models/field_path.rb +59 -24
  85. data/lib/artikcloud/models/field_presence.rb +60 -24
  86. data/lib/artikcloud/models/field_presence_envelope.rb +78 -42
  87. data/lib/artikcloud/models/fields_actions.rb +61 -27
  88. data/lib/artikcloud/models/manifest_properties.rb +60 -24
  89. data/lib/artikcloud/models/manifest_properties_envelope.rb +60 -24
  90. data/lib/artikcloud/models/manifest_versions.rb +60 -24
  91. data/lib/artikcloud/models/manifest_versions_envelope.rb +60 -24
  92. data/lib/artikcloud/models/message.rb +233 -0
  93. data/lib/artikcloud/models/message_action.rb +67 -36
  94. data/lib/artikcloud/models/message_id.rb +59 -24
  95. data/lib/artikcloud/models/message_id_envelope.rb +59 -24
  96. data/lib/artikcloud/models/message_in.rb +69 -39
  97. data/lib/artikcloud/models/message_out.rb +67 -36
  98. data/lib/artikcloud/models/non_empty_string.rb +59 -24
  99. data/lib/artikcloud/models/normalized_action.rb +279 -0
  100. data/lib/artikcloud/models/normalized_actions_envelope.rb +285 -0
  101. data/lib/artikcloud/models/normalized_message.rb +81 -45
  102. data/lib/artikcloud/models/normalized_messages_envelope.rb +80 -51
  103. data/lib/artikcloud/models/output_rule.rb +85 -63
  104. data/lib/artikcloud/models/presence_envelope.rb +208 -0
  105. data/lib/artikcloud/models/presence_model.rb +208 -0
  106. data/lib/artikcloud/models/properties_envelope.rb +60 -24
  107. data/lib/artikcloud/models/refresh_token_response.rb +65 -33
  108. data/lib/artikcloud/models/register_message.rb +67 -36
  109. data/lib/artikcloud/models/rule_array.rb +59 -24
  110. data/lib/artikcloud/models/rule_creation_info.rb +65 -33
  111. data/lib/artikcloud/models/rule_envelope.rb +59 -24
  112. data/lib/artikcloud/models/rule_error.rb +65 -33
  113. data/lib/artikcloud/models/rule_update_info.rb +65 -33
  114. data/lib/artikcloud/models/rule_warning_output.rb +61 -27
  115. data/lib/artikcloud/models/rules_envelope.rb +69 -35
  116. data/lib/artikcloud/models/snapshot_response.rb +210 -0
  117. data/lib/artikcloud/models/snapshot_responses.rb +219 -0
  118. data/lib/artikcloud/models/snapshots_response_envelope.rb +208 -0
  119. data/lib/artikcloud/models/tag.rb +61 -27
  120. data/lib/artikcloud/models/tag_array.rb +59 -24
  121. data/lib/artikcloud/models/tags_envelope.rb +59 -24
  122. data/lib/artikcloud/models/token.rb +65 -33
  123. data/lib/artikcloud/models/token_info.rb +226 -0
  124. data/lib/artikcloud/models/token_info_success_response.rb +199 -0
  125. data/lib/artikcloud/models/token_request.rb +59 -24
  126. data/lib/artikcloud/models/token_response.rb +59 -24
  127. data/lib/artikcloud/models/unregister_device_response.rb +79 -54
  128. data/lib/artikcloud/models/unregister_device_response_envelope.rb +59 -24
  129. data/lib/artikcloud/models/user.rb +77 -42
  130. data/lib/artikcloud/models/user_envelope.rb +60 -24
  131. data/lib/artikcloud/models/web_socket_error.rb +63 -30
  132. data/lib/artikcloud/version.rb +14 -5
  133. data/lib/artikcloud.rb +26 -4
  134. data/spec/api/device_types_api_spec.rb +110 -0
  135. data/spec/api/devices_api_spec.rb +143 -0
  136. data/spec/api/export_api_spec.rb +96 -0
  137. data/spec/api/messages_api_spec.rb +7 -7
  138. data/spec/api/registrations_api_spec.rb +82 -0
  139. data/spec/api/rules_api_spec.rb +96 -0
  140. data/spec/api/tags_api_spec.rb +84 -0
  141. data/spec/api/tokens_api_spec.rb +12 -21
  142. data/spec/api/users_api_spec.rb +1 -1
  143. data/spec/spec_helper.rb +1 -1
  144. metadata +60 -22
@@ -1,14 +1,23 @@
1
1
  =begin
2
- ARTIK Cloud API
2
+ #ARTIK Cloud API
3
+
4
+ #No descripton provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
3
5
 
4
6
  OpenAPI spec version: 2.0.0
5
7
 
6
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
7
9
 
8
- License: MIT
9
- http://en.wikipedia.org/wiki/MIT_License
10
+ Licensed under the Apache License, Version 2.0 (the "License");
11
+ you may not use this file except in compliance with the License.
12
+ You may obtain a copy of the License at
13
+
14
+ http://www.apache.org/licenses/LICENSE-2.0
10
15
 
11
- Terms of Service: http://www.samsung.com/global/business/mobile/info/terms-and-conditions.html
16
+ Unless required by applicable law or agreed to in writing, software
17
+ distributed under the License is distributed on an "AS IS" BASIS,
18
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ See the License for the specific language governing permissions and
20
+ limitations under the License.
12
21
 
13
22
  =end
14
23
 
@@ -31,24 +40,17 @@ module ArtikCloud
31
40
 
32
41
  attr_accessor :start_date
33
42
 
43
+
34
44
  # Attribute mapping from ruby-style variable name to JSON key.
35
45
  def self.attribute_map
36
46
  {
37
-
38
47
  :'data' => :'data',
39
-
40
48
  :'end_date' => :'endDate',
41
-
42
49
  :'field' => :'field',
43
-
44
50
  :'interval' => :'interval',
45
-
46
51
  :'sdid' => :'sdid',
47
-
48
52
  :'size' => :'size',
49
-
50
53
  :'start_date' => :'startDate'
51
-
52
54
  }
53
55
  end
54
56
 
@@ -62,50 +64,64 @@ module ArtikCloud
62
64
  :'sdid' => :'String',
63
65
  :'size' => :'Integer',
64
66
  :'start_date' => :'Integer'
65
-
66
67
  }
67
68
  end
68
69
 
70
+ # Initializes the object
71
+ # @param [Hash] attributes Model attributes in the form of hash
69
72
  def initialize(attributes = {})
70
73
  return unless attributes.is_a?(Hash)
71
74
 
72
75
  # convert string to symbol for hash key
73
- attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
76
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
74
77
 
75
-
76
- if attributes[:'data']
78
+ if attributes.has_key?(:'data')
77
79
  if (value = attributes[:'data']).is_a?(Array)
78
80
  self.data = value
79
81
  end
80
82
  end
81
-
82
- if attributes[:'endDate']
83
+
84
+ if attributes.has_key?(:'endDate')
83
85
  self.end_date = attributes[:'endDate']
84
86
  end
85
-
86
- if attributes[:'field']
87
+
88
+ if attributes.has_key?(:'field')
87
89
  self.field = attributes[:'field']
88
90
  end
89
-
90
- if attributes[:'interval']
91
+
92
+ if attributes.has_key?(:'interval')
91
93
  self.interval = attributes[:'interval']
92
94
  end
93
-
94
- if attributes[:'sdid']
95
+
96
+ if attributes.has_key?(:'sdid')
95
97
  self.sdid = attributes[:'sdid']
96
98
  end
97
-
98
- if attributes[:'size']
99
+
100
+ if attributes.has_key?(:'size')
99
101
  self.size = attributes[:'size']
100
102
  end
101
-
102
- if attributes[:'startDate']
103
+
104
+ if attributes.has_key?(:'startDate')
103
105
  self.start_date = attributes[:'startDate']
104
106
  end
105
-
107
+
108
+ end
109
+
110
+ # Show invalid properties with the reasons. Usually used together with valid?
111
+ # @return Array for valid properies with the reasons
112
+ def list_invalid_properties
113
+ invalid_properties = Array.new
114
+ return invalid_properties
115
+ end
116
+
117
+ # Check to see if the all the properties in the model are valid
118
+ # @return true if the model is valid
119
+ def valid?
120
+ return true
106
121
  end
107
122
 
108
- # Check equality by comparing each attribute.
123
+ # Checks equality by comparing each attribute.
124
+ # @param [Object] Object to be compared
109
125
  def ==(o)
110
126
  return true if self.equal?(o)
111
127
  self.class == o.class &&
@@ -119,35 +135,41 @@ module ArtikCloud
119
135
  end
120
136
 
121
137
  # @see the `==` method
138
+ # @param [Object] Object to be compared
122
139
  def eql?(o)
123
140
  self == o
124
141
  end
125
142
 
126
- # Calculate hash code according to all attributes.
143
+ # Calculates hash code according to all attributes.
144
+ # @return [Fixnum] Hash code
127
145
  def hash
128
146
  [data, end_date, field, interval, sdid, size, start_date].hash
129
147
  end
130
148
 
131
- # build the object from hash
149
+ # Builds the object from hash
150
+ # @param [Hash] attributes Model attributes in the form of hash
151
+ # @return [Object] Returns the model itself
132
152
  def build_from_hash(attributes)
133
153
  return nil unless attributes.is_a?(Hash)
134
154
  self.class.swagger_types.each_pair do |key, type|
135
155
  if type =~ /^Array<(.*)>/i
156
+ # check to ensure the input is an array given that the the attribute
157
+ # is documented as an array but the input is not
136
158
  if attributes[self.class.attribute_map[key]].is_a?(Array)
137
159
  self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
138
- else
139
- #TODO show warning in debug mode
140
160
  end
141
161
  elsif !attributes[self.class.attribute_map[key]].nil?
142
162
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
143
- else
144
- # data not found in attributes(hash), not an issue as the data can be optional
145
- end
163
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
146
164
  end
147
165
 
148
166
  self
149
167
  end
150
168
 
169
+ # Deserializes the data based on type
170
+ # @param string type Data type
171
+ # @param string value Value to be deserialized
172
+ # @return [Object] Deserialized data
151
173
  def _deserialize(type, value)
152
174
  case type.to_sym
153
175
  when :DateTime
@@ -181,21 +203,25 @@ module ArtikCloud
181
203
  end
182
204
  end
183
205
  else # model
184
- _model = ArtikCloud.const_get(type).new
185
- _model.build_from_hash(value)
206
+ temp_model = ArtikCloud.const_get(type).new
207
+ temp_model.build_from_hash(value)
186
208
  end
187
209
  end
188
210
 
211
+ # Returns the string representation of the object
212
+ # @return [String] String presentation of the object
189
213
  def to_s
190
214
  to_hash.to_s
191
215
  end
192
216
 
193
- # to_body is an alias to to_body (backward compatibility))
217
+ # to_body is an alias to to_hash (backward compatibility)
218
+ # @return [Hash] Returns the object in the form of hash
194
219
  def to_body
195
220
  to_hash
196
221
  end
197
222
 
198
- # return the object in the form of hash
223
+ # Returns the object in the form of hash
224
+ # @return [Hash] Returns the object in the form of hash
199
225
  def to_hash
200
226
  hash = {}
201
227
  self.class.attribute_map.each_pair do |attr, param|
@@ -206,8 +232,10 @@ module ArtikCloud
206
232
  hash
207
233
  end
208
234
 
209
- # Method to output non-array value in the form of hash
235
+ # Outputs non-array value in the form of hash
210
236
  # For object, use to_hash. Otherwise, just return the value
237
+ # @param [Object] value Any valid value
238
+ # @return [Hash] Returns the value in the form of hash
211
239
  def _to_hash(value)
212
240
  if value.is_a?(Array)
213
241
  value.compact.map{ |v| _to_hash(v) }
@@ -223,4 +251,5 @@ module ArtikCloud
223
251
  end
224
252
 
225
253
  end
254
+
226
255
  end
@@ -1,14 +1,23 @@
1
1
  =begin
2
- ARTIK Cloud API
2
+ #ARTIK Cloud API
3
+
4
+ #No descripton provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
3
5
 
4
6
  OpenAPI spec version: 2.0.0
5
7
 
6
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
7
9
 
8
- License: MIT
9
- http://en.wikipedia.org/wiki/MIT_License
10
+ Licensed under the Apache License, Version 2.0 (the "License");
11
+ you may not use this file except in compliance with the License.
12
+ You may obtain a copy of the License at
13
+
14
+ http://www.apache.org/licenses/LICENSE-2.0
10
15
 
11
- Terms of Service: http://www.samsung.com/global/business/mobile/info/terms-and-conditions.html
16
+ Unless required by applicable law or agreed to in writing, software
17
+ distributed under the License is distributed on an "AS IS" BASIS,
18
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ See the License for the specific language governing permissions and
20
+ limitations under the License.
12
21
 
13
22
  =end
14
23
 
@@ -29,22 +38,16 @@ module ArtikCloud
29
38
 
30
39
  attr_accessor :start_date
31
40
 
41
+
32
42
  # Attribute mapping from ruby-style variable name to JSON key.
33
43
  def self.attribute_map
34
44
  {
35
-
36
45
  :'data' => :'data',
37
-
38
46
  :'end_date' => :'endDate',
39
-
40
47
  :'field' => :'field',
41
-
42
48
  :'sdid' => :'sdid',
43
-
44
49
  :'size' => :'size',
45
-
46
50
  :'start_date' => :'startDate'
47
-
48
51
  }
49
52
  end
50
53
 
@@ -57,46 +60,60 @@ module ArtikCloud
57
60
  :'sdid' => :'String',
58
61
  :'size' => :'Integer',
59
62
  :'start_date' => :'Integer'
60
-
61
63
  }
62
64
  end
63
65
 
66
+ # Initializes the object
67
+ # @param [Hash] attributes Model attributes in the form of hash
64
68
  def initialize(attributes = {})
65
69
  return unless attributes.is_a?(Hash)
66
70
 
67
71
  # convert string to symbol for hash key
68
- attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
72
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
69
73
 
70
-
71
- if attributes[:'data']
74
+ if attributes.has_key?(:'data')
72
75
  if (value = attributes[:'data']).is_a?(Array)
73
76
  self.data = value
74
77
  end
75
78
  end
76
-
77
- if attributes[:'endDate']
79
+
80
+ if attributes.has_key?(:'endDate')
78
81
  self.end_date = attributes[:'endDate']
79
82
  end
80
-
81
- if attributes[:'field']
83
+
84
+ if attributes.has_key?(:'field')
82
85
  self.field = attributes[:'field']
83
86
  end
84
-
85
- if attributes[:'sdid']
87
+
88
+ if attributes.has_key?(:'sdid')
86
89
  self.sdid = attributes[:'sdid']
87
90
  end
88
-
89
- if attributes[:'size']
91
+
92
+ if attributes.has_key?(:'size')
90
93
  self.size = attributes[:'size']
91
94
  end
92
-
93
- if attributes[:'startDate']
95
+
96
+ if attributes.has_key?(:'startDate')
94
97
  self.start_date = attributes[:'startDate']
95
98
  end
96
-
99
+
100
+ end
101
+
102
+ # Show invalid properties with the reasons. Usually used together with valid?
103
+ # @return Array for valid properies with the reasons
104
+ def list_invalid_properties
105
+ invalid_properties = Array.new
106
+ return invalid_properties
107
+ end
108
+
109
+ # Check to see if the all the properties in the model are valid
110
+ # @return true if the model is valid
111
+ def valid?
112
+ return true
97
113
  end
98
114
 
99
- # Check equality by comparing each attribute.
115
+ # Checks equality by comparing each attribute.
116
+ # @param [Object] Object to be compared
100
117
  def ==(o)
101
118
  return true if self.equal?(o)
102
119
  self.class == o.class &&
@@ -109,35 +126,41 @@ module ArtikCloud
109
126
  end
110
127
 
111
128
  # @see the `==` method
129
+ # @param [Object] Object to be compared
112
130
  def eql?(o)
113
131
  self == o
114
132
  end
115
133
 
116
- # Calculate hash code according to all attributes.
134
+ # Calculates hash code according to all attributes.
135
+ # @return [Fixnum] Hash code
117
136
  def hash
118
137
  [data, end_date, field, sdid, size, start_date].hash
119
138
  end
120
139
 
121
- # build the object from hash
140
+ # Builds the object from hash
141
+ # @param [Hash] attributes Model attributes in the form of hash
142
+ # @return [Object] Returns the model itself
122
143
  def build_from_hash(attributes)
123
144
  return nil unless attributes.is_a?(Hash)
124
145
  self.class.swagger_types.each_pair do |key, type|
125
146
  if type =~ /^Array<(.*)>/i
147
+ # check to ensure the input is an array given that the the attribute
148
+ # is documented as an array but the input is not
126
149
  if attributes[self.class.attribute_map[key]].is_a?(Array)
127
150
  self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
128
- else
129
- #TODO show warning in debug mode
130
151
  end
131
152
  elsif !attributes[self.class.attribute_map[key]].nil?
132
153
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
133
- else
134
- # data not found in attributes(hash), not an issue as the data can be optional
135
- end
154
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
136
155
  end
137
156
 
138
157
  self
139
158
  end
140
159
 
160
+ # Deserializes the data based on type
161
+ # @param string type Data type
162
+ # @param string value Value to be deserialized
163
+ # @return [Object] Deserialized data
141
164
  def _deserialize(type, value)
142
165
  case type.to_sym
143
166
  when :DateTime
@@ -171,21 +194,25 @@ module ArtikCloud
171
194
  end
172
195
  end
173
196
  else # model
174
- _model = ArtikCloud.const_get(type).new
175
- _model.build_from_hash(value)
197
+ temp_model = ArtikCloud.const_get(type).new
198
+ temp_model.build_from_hash(value)
176
199
  end
177
200
  end
178
201
 
202
+ # Returns the string representation of the object
203
+ # @return [String] String presentation of the object
179
204
  def to_s
180
205
  to_hash.to_s
181
206
  end
182
207
 
183
- # to_body is an alias to to_body (backward compatibility))
208
+ # to_body is an alias to to_hash (backward compatibility)
209
+ # @return [Hash] Returns the object in the form of hash
184
210
  def to_body
185
211
  to_hash
186
212
  end
187
213
 
188
- # return the object in the form of hash
214
+ # Returns the object in the form of hash
215
+ # @return [Hash] Returns the object in the form of hash
189
216
  def to_hash
190
217
  hash = {}
191
218
  self.class.attribute_map.each_pair do |attr, param|
@@ -196,8 +223,10 @@ module ArtikCloud
196
223
  hash
197
224
  end
198
225
 
199
- # Method to output non-array value in the form of hash
226
+ # Outputs non-array value in the form of hash
200
227
  # For object, use to_hash. Otherwise, just return the value
228
+ # @param [Object] value Any valid value
229
+ # @return [Hash] Returns the value in the form of hash
201
230
  def _to_hash(value)
202
231
  if value.is_a?(Array)
203
232
  value.compact.map{ |v| _to_hash(v) }
@@ -213,4 +242,5 @@ module ArtikCloud
213
242
  end
214
243
 
215
244
  end
245
+
216
246
  end
@@ -1,14 +1,23 @@
1
1
  =begin
2
- ARTIK Cloud API
2
+ #ARTIK Cloud API
3
+
4
+ #No descripton provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
3
5
 
4
6
  OpenAPI spec version: 2.0.0
5
7
 
6
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
7
9
 
8
- License: MIT
9
- http://en.wikipedia.org/wiki/MIT_License
10
+ Licensed under the Apache License, Version 2.0 (the "License");
11
+ you may not use this file except in compliance with the License.
12
+ You may obtain a copy of the License at
13
+
14
+ http://www.apache.org/licenses/LICENSE-2.0
10
15
 
11
- Terms of Service: http://www.samsung.com/global/business/mobile/info/terms-and-conditions.html
16
+ Unless required by applicable law or agreed to in writing, software
17
+ distributed under the License is distributed on an "AS IS" BASIS,
18
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ See the License for the specific language governing permissions and
20
+ limitations under the License.
12
21
 
13
22
  =end
14
23
 
@@ -23,16 +32,13 @@ module ArtikCloud
23
32
 
24
33
  attr_accessor :properties
25
34
 
35
+
26
36
  # Attribute mapping from ruby-style variable name to JSON key.
27
37
  def self.attribute_map
28
38
  {
29
-
30
39
  :'uid' => :'uid',
31
-
32
40
  :'aid' => :'aid',
33
-
34
41
  :'properties' => :'properties'
35
-
36
42
  }
37
43
  end
38
44
 
@@ -42,32 +48,47 @@ module ArtikCloud
42
48
  :'uid' => :'String',
43
49
  :'aid' => :'String',
44
50
  :'properties' => :'String'
45
-
46
51
  }
47
52
  end
48
53
 
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
49
56
  def initialize(attributes = {})
50
57
  return unless attributes.is_a?(Hash)
51
58
 
52
59
  # convert string to symbol for hash key
53
- attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
60
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
54
61
 
55
-
56
- if attributes[:'uid']
62
+ if attributes.has_key?(:'uid')
57
63
  self.uid = attributes[:'uid']
58
64
  end
59
-
60
- if attributes[:'aid']
65
+
66
+ if attributes.has_key?(:'aid')
61
67
  self.aid = attributes[:'aid']
62
68
  end
63
-
64
- if attributes[:'properties']
69
+
70
+ if attributes.has_key?(:'properties')
65
71
  self.properties = attributes[:'properties']
66
72
  end
67
-
73
+
68
74
  end
69
75
 
70
- # Check equality by comparing each attribute.
76
+ # Show invalid properties with the reasons. Usually used together with valid?
77
+ # @return Array for valid properies with the reasons
78
+ def list_invalid_properties
79
+ invalid_properties = Array.new
80
+ return invalid_properties
81
+ end
82
+
83
+ # Check to see if the all the properties in the model are valid
84
+ # @return true if the model is valid
85
+ def valid?
86
+ return false if @properties.nil?
87
+ return true
88
+ end
89
+
90
+ # Checks equality by comparing each attribute.
91
+ # @param [Object] Object to be compared
71
92
  def ==(o)
72
93
  return true if self.equal?(o)
73
94
  self.class == o.class &&
@@ -77,35 +98,41 @@ module ArtikCloud
77
98
  end
78
99
 
79
100
  # @see the `==` method
101
+ # @param [Object] Object to be compared
80
102
  def eql?(o)
81
103
  self == o
82
104
  end
83
105
 
84
- # Calculate hash code according to all attributes.
106
+ # Calculates hash code according to all attributes.
107
+ # @return [Fixnum] Hash code
85
108
  def hash
86
109
  [uid, aid, properties].hash
87
110
  end
88
111
 
89
- # build the object from hash
112
+ # Builds the object from hash
113
+ # @param [Hash] attributes Model attributes in the form of hash
114
+ # @return [Object] Returns the model itself
90
115
  def build_from_hash(attributes)
91
116
  return nil unless attributes.is_a?(Hash)
92
117
  self.class.swagger_types.each_pair do |key, type|
93
118
  if type =~ /^Array<(.*)>/i
119
+ # check to ensure the input is an array given that the the attribute
120
+ # is documented as an array but the input is not
94
121
  if attributes[self.class.attribute_map[key]].is_a?(Array)
95
122
  self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
96
- else
97
- #TODO show warning in debug mode
98
123
  end
99
124
  elsif !attributes[self.class.attribute_map[key]].nil?
100
125
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
101
- else
102
- # data not found in attributes(hash), not an issue as the data can be optional
103
- end
126
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
104
127
  end
105
128
 
106
129
  self
107
130
  end
108
131
 
132
+ # Deserializes the data based on type
133
+ # @param string type Data type
134
+ # @param string value Value to be deserialized
135
+ # @return [Object] Deserialized data
109
136
  def _deserialize(type, value)
110
137
  case type.to_sym
111
138
  when :DateTime
@@ -139,21 +166,25 @@ module ArtikCloud
139
166
  end
140
167
  end
141
168
  else # model
142
- _model = ArtikCloud.const_get(type).new
143
- _model.build_from_hash(value)
169
+ temp_model = ArtikCloud.const_get(type).new
170
+ temp_model.build_from_hash(value)
144
171
  end
145
172
  end
146
173
 
174
+ # Returns the string representation of the object
175
+ # @return [String] String presentation of the object
147
176
  def to_s
148
177
  to_hash.to_s
149
178
  end
150
179
 
151
- # to_body is an alias to to_body (backward compatibility))
180
+ # to_body is an alias to to_hash (backward compatibility)
181
+ # @return [Hash] Returns the object in the form of hash
152
182
  def to_body
153
183
  to_hash
154
184
  end
155
185
 
156
- # return the object in the form of hash
186
+ # Returns the object in the form of hash
187
+ # @return [Hash] Returns the object in the form of hash
157
188
  def to_hash
158
189
  hash = {}
159
190
  self.class.attribute_map.each_pair do |attr, param|
@@ -164,8 +195,10 @@ module ArtikCloud
164
195
  hash
165
196
  end
166
197
 
167
- # Method to output non-array value in the form of hash
198
+ # Outputs non-array value in the form of hash
168
199
  # For object, use to_hash. Otherwise, just return the value
200
+ # @param [Object] value Any valid value
201
+ # @return [Hash] Returns the value in the form of hash
169
202
  def _to_hash(value)
170
203
  if value.is_a?(Array)
171
204
  value.compact.map{ |v| _to_hash(v) }
@@ -181,4 +214,5 @@ module ArtikCloud
181
214
  end
182
215
 
183
216
  end
217
+
184
218
  end