artikcloud 2.0.0 → 2.0.5

Sign up to get free protection for your applications and to get access to all the features.
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
 
@@ -19,12 +28,11 @@ module ArtikCloud
19
28
  class MessageIDEnvelope
20
29
  attr_accessor :data
21
30
 
31
+
22
32
  # Attribute mapping from ruby-style variable name to JSON key.
23
33
  def self.attribute_map
24
34
  {
25
-
26
35
  :'data' => :'data'
27
-
28
36
  }
29
37
  end
30
38
 
@@ -32,24 +40,38 @@ module ArtikCloud
32
40
  def self.swagger_types
33
41
  {
34
42
  :'data' => :'MessageID'
35
-
36
43
  }
37
44
  end
38
45
 
46
+ # Initializes the object
47
+ # @param [Hash] attributes Model attributes in the form of hash
39
48
  def initialize(attributes = {})
40
49
  return unless attributes.is_a?(Hash)
41
50
 
42
51
  # convert string to symbol for hash key
43
- attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
52
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
44
53
 
45
-
46
- if attributes[:'data']
54
+ if attributes.has_key?(:'data')
47
55
  self.data = attributes[:'data']
48
56
  end
49
-
57
+
58
+ end
59
+
60
+ # Show invalid properties with the reasons. Usually used together with valid?
61
+ # @return Array for valid properies with the reasons
62
+ def list_invalid_properties
63
+ invalid_properties = Array.new
64
+ return invalid_properties
50
65
  end
51
66
 
52
- # Check equality by comparing each attribute.
67
+ # Check to see if the all the properties in the model are valid
68
+ # @return true if the model is valid
69
+ def valid?
70
+ return true
71
+ end
72
+
73
+ # Checks equality by comparing each attribute.
74
+ # @param [Object] Object to be compared
53
75
  def ==(o)
54
76
  return true if self.equal?(o)
55
77
  self.class == o.class &&
@@ -57,35 +79,41 @@ module ArtikCloud
57
79
  end
58
80
 
59
81
  # @see the `==` method
82
+ # @param [Object] Object to be compared
60
83
  def eql?(o)
61
84
  self == o
62
85
  end
63
86
 
64
- # Calculate hash code according to all attributes.
87
+ # Calculates hash code according to all attributes.
88
+ # @return [Fixnum] Hash code
65
89
  def hash
66
90
  [data].hash
67
91
  end
68
92
 
69
- # build the object from hash
93
+ # Builds the object from hash
94
+ # @param [Hash] attributes Model attributes in the form of hash
95
+ # @return [Object] Returns the model itself
70
96
  def build_from_hash(attributes)
71
97
  return nil unless attributes.is_a?(Hash)
72
98
  self.class.swagger_types.each_pair do |key, type|
73
99
  if type =~ /^Array<(.*)>/i
100
+ # check to ensure the input is an array given that the the attribute
101
+ # is documented as an array but the input is not
74
102
  if attributes[self.class.attribute_map[key]].is_a?(Array)
75
103
  self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
76
- else
77
- #TODO show warning in debug mode
78
104
  end
79
105
  elsif !attributes[self.class.attribute_map[key]].nil?
80
106
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
81
- else
82
- # data not found in attributes(hash), not an issue as the data can be optional
83
- end
107
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
84
108
  end
85
109
 
86
110
  self
87
111
  end
88
112
 
113
+ # Deserializes the data based on type
114
+ # @param string type Data type
115
+ # @param string value Value to be deserialized
116
+ # @return [Object] Deserialized data
89
117
  def _deserialize(type, value)
90
118
  case type.to_sym
91
119
  when :DateTime
@@ -119,21 +147,25 @@ module ArtikCloud
119
147
  end
120
148
  end
121
149
  else # model
122
- _model = ArtikCloud.const_get(type).new
123
- _model.build_from_hash(value)
150
+ temp_model = ArtikCloud.const_get(type).new
151
+ temp_model.build_from_hash(value)
124
152
  end
125
153
  end
126
154
 
155
+ # Returns the string representation of the object
156
+ # @return [String] String presentation of the object
127
157
  def to_s
128
158
  to_hash.to_s
129
159
  end
130
160
 
131
- # to_body is an alias to to_body (backward compatibility))
161
+ # to_body is an alias to to_hash (backward compatibility)
162
+ # @return [Hash] Returns the object in the form of hash
132
163
  def to_body
133
164
  to_hash
134
165
  end
135
166
 
136
- # return the object in the form of hash
167
+ # Returns the object in the form of hash
168
+ # @return [Hash] Returns the object in the form of hash
137
169
  def to_hash
138
170
  hash = {}
139
171
  self.class.attribute_map.each_pair do |attr, param|
@@ -144,8 +176,10 @@ module ArtikCloud
144
176
  hash
145
177
  end
146
178
 
147
- # Method to output non-array value in the form of hash
179
+ # Outputs non-array value in the form of hash
148
180
  # For object, use to_hash. Otherwise, just return the value
181
+ # @param [Object] value Any valid value
182
+ # @return [Hash] Returns the value in the form of hash
149
183
  def _to_hash(value)
150
184
  if value.is_a?(Array)
151
185
  value.compact.map{ |v| _to_hash(v) }
@@ -161,4 +195,5 @@ module ArtikCloud
161
195
  end
162
196
 
163
197
  end
198
+
164
199
  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
 
@@ -35,22 +44,16 @@ module ArtikCloud
35
44
  # Type.
36
45
  attr_accessor :type
37
46
 
47
+
38
48
  # Attribute mapping from ruby-style variable name to JSON key.
39
49
  def self.attribute_map
40
50
  {
41
-
42
51
  :'data' => :'data',
43
-
44
52
  :'cid' => :'cid',
45
-
46
53
  :'ddid' => :'ddid',
47
-
48
54
  :'sdid' => :'sdid',
49
-
50
55
  :'ts' => :'ts',
51
-
52
56
  :'type' => :'type'
53
-
54
57
  }
55
58
  end
56
59
 
@@ -63,48 +66,62 @@ module ArtikCloud
63
66
  :'sdid' => :'String',
64
67
  :'ts' => :'Integer',
65
68
  :'type' => :'String'
66
-
67
69
  }
68
70
  end
69
71
 
72
+ # Initializes the object
73
+ # @param [Hash] attributes Model attributes in the form of hash
70
74
  def initialize(attributes = {})
71
75
  return unless attributes.is_a?(Hash)
72
76
 
73
77
  # convert string to symbol for hash key
74
- attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
78
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
75
79
 
76
-
77
- if attributes[:'data']
80
+ if attributes.has_key?(:'data')
78
81
  if (value = attributes[:'data']).is_a?(Array)
79
82
  self.data = value
80
83
  end
81
84
  end
82
-
83
- if attributes[:'cid']
85
+
86
+ if attributes.has_key?(:'cid')
84
87
  self.cid = attributes[:'cid']
85
88
  end
86
-
87
- if attributes[:'ddid']
89
+
90
+ if attributes.has_key?(:'ddid')
88
91
  self.ddid = attributes[:'ddid']
89
92
  end
90
-
91
- if attributes[:'sdid']
93
+
94
+ if attributes.has_key?(:'sdid')
92
95
  self.sdid = attributes[:'sdid']
93
96
  end
94
-
95
- if attributes[:'ts']
97
+
98
+ if attributes.has_key?(:'ts')
96
99
  self.ts = attributes[:'ts']
97
100
  end
98
-
99
- if attributes[:'type']
101
+
102
+ if attributes.has_key?(:'type')
100
103
  self.type = attributes[:'type']
101
104
  else
102
105
  self.type = "message"
103
106
  end
104
-
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
105
121
  end
106
122
 
107
- # Check equality by comparing each attribute.
123
+ # Checks equality by comparing each attribute.
124
+ # @param [Object] Object to be compared
108
125
  def ==(o)
109
126
  return true if self.equal?(o)
110
127
  self.class == o.class &&
@@ -117,35 +134,41 @@ module ArtikCloud
117
134
  end
118
135
 
119
136
  # @see the `==` method
137
+ # @param [Object] Object to be compared
120
138
  def eql?(o)
121
139
  self == o
122
140
  end
123
141
 
124
- # Calculate hash code according to all attributes.
142
+ # Calculates hash code according to all attributes.
143
+ # @return [Fixnum] Hash code
125
144
  def hash
126
145
  [data, cid, ddid, sdid, ts, type].hash
127
146
  end
128
147
 
129
- # build the object from hash
148
+ # Builds the object from hash
149
+ # @param [Hash] attributes Model attributes in the form of hash
150
+ # @return [Object] Returns the model itself
130
151
  def build_from_hash(attributes)
131
152
  return nil unless attributes.is_a?(Hash)
132
153
  self.class.swagger_types.each_pair do |key, type|
133
154
  if type =~ /^Array<(.*)>/i
155
+ # check to ensure the input is an array given that the the attribute
156
+ # is documented as an array but the input is not
134
157
  if attributes[self.class.attribute_map[key]].is_a?(Array)
135
158
  self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
136
- else
137
- #TODO show warning in debug mode
138
159
  end
139
160
  elsif !attributes[self.class.attribute_map[key]].nil?
140
161
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
141
- else
142
- # data not found in attributes(hash), not an issue as the data can be optional
143
- end
162
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
144
163
  end
145
164
 
146
165
  self
147
166
  end
148
167
 
168
+ # Deserializes the data based on type
169
+ # @param string type Data type
170
+ # @param string value Value to be deserialized
171
+ # @return [Object] Deserialized data
149
172
  def _deserialize(type, value)
150
173
  case type.to_sym
151
174
  when :DateTime
@@ -179,21 +202,25 @@ module ArtikCloud
179
202
  end
180
203
  end
181
204
  else # model
182
- _model = ArtikCloud.const_get(type).new
183
- _model.build_from_hash(value)
205
+ temp_model = ArtikCloud.const_get(type).new
206
+ temp_model.build_from_hash(value)
184
207
  end
185
208
  end
186
209
 
210
+ # Returns the string representation of the object
211
+ # @return [String] String presentation of the object
187
212
  def to_s
188
213
  to_hash.to_s
189
214
  end
190
215
 
191
- # to_body is an alias to to_body (backward compatibility))
216
+ # to_body is an alias to to_hash (backward compatibility)
217
+ # @return [Hash] Returns the object in the form of hash
192
218
  def to_body
193
219
  to_hash
194
220
  end
195
221
 
196
- # return the object in the form of hash
222
+ # Returns the object in the form of hash
223
+ # @return [Hash] Returns the object in the form of hash
197
224
  def to_hash
198
225
  hash = {}
199
226
  self.class.attribute_map.each_pair do |attr, param|
@@ -204,8 +231,10 @@ module ArtikCloud
204
231
  hash
205
232
  end
206
233
 
207
- # Method to output non-array value in the form of hash
234
+ # Outputs non-array value in the form of hash
208
235
  # For object, use to_hash. Otherwise, just return the value
236
+ # @param [Object] value Any valid value
237
+ # @return [Hash] Returns the value in the form of hash
209
238
  def _to_hash(value)
210
239
  if value.is_a?(Array)
211
240
  value.compact.map{ |v| _to_hash(v) }
@@ -221,4 +250,5 @@ module ArtikCloud
221
250
  end
222
251
 
223
252
  end
253
+
224
254
  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
 
@@ -32,20 +41,15 @@ module ArtikCloud
32
41
  # Manifest Version.
33
42
  attr_accessor :mv
34
43
 
44
+
35
45
  # Attribute mapping from ruby-style variable name to JSON key.
36
46
  def self.attribute_map
37
47
  {
38
-
39
48
  :'mid' => :'mid',
40
-
41
49
  :'uid' => :'uid',
42
-
43
50
  :'sdtid' => :'sdtid',
44
-
45
51
  :'cts' => :'cts',
46
-
47
52
  :'mv' => :'mv'
48
-
49
53
  }
50
54
  end
51
55
 
@@ -57,40 +61,54 @@ module ArtikCloud
57
61
  :'sdtid' => :'String',
58
62
  :'cts' => :'Integer',
59
63
  :'mv' => :'Integer'
60
-
61
64
  }
62
65
  end
63
66
 
67
+ # Initializes the object
68
+ # @param [Hash] attributes Model attributes in the form of hash
64
69
  def initialize(attributes = {})
65
70
  return unless attributes.is_a?(Hash)
66
71
 
67
72
  # convert string to symbol for hash key
68
- attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
73
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
69
74
 
70
-
71
- if attributes[:'mid']
75
+ if attributes.has_key?(:'mid')
72
76
  self.mid = attributes[:'mid']
73
77
  end
74
-
75
- if attributes[:'uid']
78
+
79
+ if attributes.has_key?(:'uid')
76
80
  self.uid = attributes[:'uid']
77
81
  end
78
-
79
- if attributes[:'sdtid']
82
+
83
+ if attributes.has_key?(:'sdtid')
80
84
  self.sdtid = attributes[:'sdtid']
81
85
  end
82
-
83
- if attributes[:'cts']
86
+
87
+ if attributes.has_key?(:'cts')
84
88
  self.cts = attributes[:'cts']
85
89
  end
86
-
87
- if attributes[:'mv']
90
+
91
+ if attributes.has_key?(:'mv')
88
92
  self.mv = attributes[:'mv']
89
93
  end
90
-
94
+
91
95
  end
92
96
 
93
- # Check equality by comparing each attribute.
97
+ # Show invalid properties with the reasons. Usually used together with valid?
98
+ # @return Array for valid properies with the reasons
99
+ def list_invalid_properties
100
+ invalid_properties = Array.new
101
+ return invalid_properties
102
+ end
103
+
104
+ # Check to see if the all the properties in the model are valid
105
+ # @return true if the model is valid
106
+ def valid?
107
+ return true
108
+ end
109
+
110
+ # Checks equality by comparing each attribute.
111
+ # @param [Object] Object to be compared
94
112
  def ==(o)
95
113
  return true if self.equal?(o)
96
114
  self.class == o.class &&
@@ -102,35 +120,41 @@ module ArtikCloud
102
120
  end
103
121
 
104
122
  # @see the `==` method
123
+ # @param [Object] Object to be compared
105
124
  def eql?(o)
106
125
  self == o
107
126
  end
108
127
 
109
- # Calculate hash code according to all attributes.
128
+ # Calculates hash code according to all attributes.
129
+ # @return [Fixnum] Hash code
110
130
  def hash
111
131
  [mid, uid, sdtid, cts, mv].hash
112
132
  end
113
133
 
114
- # build the object from hash
134
+ # Builds the object from hash
135
+ # @param [Hash] attributes Model attributes in the form of hash
136
+ # @return [Object] Returns the model itself
115
137
  def build_from_hash(attributes)
116
138
  return nil unless attributes.is_a?(Hash)
117
139
  self.class.swagger_types.each_pair do |key, type|
118
140
  if type =~ /^Array<(.*)>/i
141
+ # check to ensure the input is an array given that the the attribute
142
+ # is documented as an array but the input is not
119
143
  if attributes[self.class.attribute_map[key]].is_a?(Array)
120
144
  self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
121
- else
122
- #TODO show warning in debug mode
123
145
  end
124
146
  elsif !attributes[self.class.attribute_map[key]].nil?
125
147
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
126
- else
127
- # data not found in attributes(hash), not an issue as the data can be optional
128
- end
148
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
129
149
  end
130
150
 
131
151
  self
132
152
  end
133
153
 
154
+ # Deserializes the data based on type
155
+ # @param string type Data type
156
+ # @param string value Value to be deserialized
157
+ # @return [Object] Deserialized data
134
158
  def _deserialize(type, value)
135
159
  case type.to_sym
136
160
  when :DateTime
@@ -164,21 +188,25 @@ module ArtikCloud
164
188
  end
165
189
  end
166
190
  else # model
167
- _model = ArtikCloud.const_get(type).new
168
- _model.build_from_hash(value)
191
+ temp_model = ArtikCloud.const_get(type).new
192
+ temp_model.build_from_hash(value)
169
193
  end
170
194
  end
171
195
 
196
+ # Returns the string representation of the object
197
+ # @return [String] String presentation of the object
172
198
  def to_s
173
199
  to_hash.to_s
174
200
  end
175
201
 
176
- # to_body is an alias to to_body (backward compatibility))
202
+ # to_body is an alias to to_hash (backward compatibility)
203
+ # @return [Hash] Returns the object in the form of hash
177
204
  def to_body
178
205
  to_hash
179
206
  end
180
207
 
181
- # return the object in the form of hash
208
+ # Returns the object in the form of hash
209
+ # @return [Hash] Returns the object in the form of hash
182
210
  def to_hash
183
211
  hash = {}
184
212
  self.class.attribute_map.each_pair do |attr, param|
@@ -189,8 +217,10 @@ module ArtikCloud
189
217
  hash
190
218
  end
191
219
 
192
- # Method to output non-array value in the form of hash
220
+ # Outputs non-array value in the form of hash
193
221
  # For object, use to_hash. Otherwise, just return the value
222
+ # @param [Object] value Any valid value
223
+ # @return [Hash] Returns the value in the form of hash
194
224
  def _to_hash(value)
195
225
  if value.is_a?(Array)
196
226
  value.compact.map{ |v| _to_hash(v) }
@@ -206,4 +236,5 @@ module ArtikCloud
206
236
  end
207
237
 
208
238
  end
239
+
209
240
  end