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