artikcloud 2.0.0 → 2.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +12 -12
- data/README.md +33 -10
- data/artikcloud.gemspec +5 -6
- data/docs/Action.md +9 -0
- data/docs/ActionArray.md +8 -0
- data/docs/Actions.md +12 -0
- data/docs/DeviceTypesApi.md +10 -10
- data/docs/DevicesApi.md +68 -15
- data/docs/ExportApi.md +10 -10
- data/docs/Message.md +11 -0
- data/docs/MessagesApi.md +205 -27
- data/docs/NormalizedAction.md +16 -0
- data/docs/NormalizedActionsEnvelope.md +17 -0
- data/docs/PresenceEnvelope.md +9 -0
- data/docs/PresenceModel.md +9 -0
- data/docs/RegistrationsApi.md +6 -6
- data/docs/RulesApi.md +8 -8
- data/docs/RulesEnvelope.md +1 -1
- data/docs/SnapshotResponse.md +9 -0
- data/docs/SnapshotResponses.md +10 -0
- data/docs/SnapshotsResponseEnvelope.md +9 -0
- data/docs/TagsApi.md +7 -7
- data/docs/TokenInfo.md +11 -0
- data/docs/TokenInfoSuccessResponse.md +8 -0
- data/docs/TokensApi.md +54 -7
- data/docs/UsersApi.md +18 -20
- data/git_push.sh +16 -1
- data/lib/artikcloud/api/device_types_api.rb +52 -59
- data/lib/artikcloud/api/devices_api.rb +120 -76
- data/lib/artikcloud/api/export_api.rb +43 -45
- data/lib/artikcloud/api/messages_api.rb +285 -103
- data/lib/artikcloud/api/registrations_api.rb +34 -34
- data/lib/artikcloud/api/rules_api.rb +43 -48
- data/lib/artikcloud/api/tags_api.rb +37 -35
- data/lib/artikcloud/api/tokens_api.rb +85 -30
- data/lib/artikcloud/api/users_api.rb +83 -102
- data/lib/artikcloud/api_client.rb +56 -13
- data/lib/artikcloud/api_error.rb +13 -4
- data/lib/artikcloud/configuration.rb +45 -1
- data/lib/artikcloud/models/ack_envelope.rb +59 -24
- data/lib/artikcloud/models/acknowledgement.rb +65 -33
- data/lib/artikcloud/models/action.rb +212 -0
- data/lib/artikcloud/models/action_array.rb +201 -0
- data/lib/artikcloud/models/action_details.rb +61 -27
- data/lib/artikcloud/models/action_details_array.rb +59 -24
- data/lib/artikcloud/models/action_in.rb +69 -39
- data/lib/artikcloud/models/action_out.rb +67 -36
- data/lib/artikcloud/models/actions.rb +241 -0
- data/lib/artikcloud/models/aggregate_data.rb +69 -39
- data/lib/artikcloud/models/aggregates_histogram_data.rb +71 -42
- data/lib/artikcloud/models/aggregates_histogram_response.rb +71 -42
- data/lib/artikcloud/models/aggregates_response.rb +69 -39
- data/lib/artikcloud/models/app_properties.rb +64 -30
- data/lib/artikcloud/models/check_token_message.rb +59 -24
- data/lib/artikcloud/models/check_token_response.rb +59 -24
- data/lib/artikcloud/models/device.rb +85 -63
- data/lib/artikcloud/models/device_array.rb +59 -24
- data/lib/artikcloud/models/device_envelope.rb +60 -24
- data/lib/artikcloud/models/device_reg_complete_request.rb +59 -24
- data/lib/artikcloud/models/device_reg_confirm_user_request.rb +63 -30
- data/lib/artikcloud/models/device_reg_confirm_user_response.rb +59 -24
- data/lib/artikcloud/models/device_reg_confirm_user_response_envelope.rb +59 -24
- data/lib/artikcloud/models/device_reg_status_response.rb +61 -27
- data/lib/artikcloud/models/device_reg_status_response_envelope.rb +59 -24
- data/lib/artikcloud/models/device_token.rb +69 -33
- data/lib/artikcloud/models/device_token_envelope.rb +60 -24
- data/lib/artikcloud/models/device_type.rb +93 -75
- data/lib/artikcloud/models/device_type_array.rb +59 -24
- data/lib/artikcloud/models/device_type_envelope.rb +60 -24
- data/lib/artikcloud/models/device_types_envelope.rb +68 -33
- data/lib/artikcloud/models/devices_envelope.rb +68 -33
- data/lib/artikcloud/models/error_envelope.rb +59 -24
- data/lib/artikcloud/models/export_data.rb +71 -42
- data/lib/artikcloud/models/export_data_array.rb +59 -24
- data/lib/artikcloud/models/export_history_response.rb +65 -33
- data/lib/artikcloud/models/export_normalized_messages_response.rb +83 -60
- data/lib/artikcloud/models/export_request.rb +73 -45
- data/lib/artikcloud/models/export_request_data.rb +79 -54
- data/lib/artikcloud/models/export_request_info.rb +77 -51
- data/lib/artikcloud/models/export_request_response.rb +59 -24
- data/lib/artikcloud/models/export_response.rb +79 -54
- data/lib/artikcloud/models/export_status_response.rb +67 -36
- data/lib/artikcloud/models/field_path.rb +59 -24
- data/lib/artikcloud/models/field_presence.rb +60 -24
- data/lib/artikcloud/models/field_presence_envelope.rb +78 -42
- data/lib/artikcloud/models/fields_actions.rb +61 -27
- data/lib/artikcloud/models/manifest_properties.rb +60 -24
- data/lib/artikcloud/models/manifest_properties_envelope.rb +60 -24
- data/lib/artikcloud/models/manifest_versions.rb +60 -24
- data/lib/artikcloud/models/manifest_versions_envelope.rb +60 -24
- data/lib/artikcloud/models/message.rb +233 -0
- data/lib/artikcloud/models/message_action.rb +67 -36
- data/lib/artikcloud/models/message_id.rb +59 -24
- data/lib/artikcloud/models/message_id_envelope.rb +59 -24
- data/lib/artikcloud/models/message_in.rb +69 -39
- data/lib/artikcloud/models/message_out.rb +67 -36
- data/lib/artikcloud/models/non_empty_string.rb +59 -24
- data/lib/artikcloud/models/normalized_action.rb +279 -0
- data/lib/artikcloud/models/normalized_actions_envelope.rb +285 -0
- data/lib/artikcloud/models/normalized_message.rb +81 -45
- data/lib/artikcloud/models/normalized_messages_envelope.rb +80 -51
- data/lib/artikcloud/models/output_rule.rb +85 -63
- data/lib/artikcloud/models/presence_envelope.rb +208 -0
- data/lib/artikcloud/models/presence_model.rb +208 -0
- data/lib/artikcloud/models/properties_envelope.rb +60 -24
- data/lib/artikcloud/models/refresh_token_response.rb +65 -33
- data/lib/artikcloud/models/register_message.rb +67 -36
- data/lib/artikcloud/models/rule_array.rb +59 -24
- data/lib/artikcloud/models/rule_creation_info.rb +65 -33
- data/lib/artikcloud/models/rule_envelope.rb +59 -24
- data/lib/artikcloud/models/rule_error.rb +65 -33
- data/lib/artikcloud/models/rule_update_info.rb +65 -33
- data/lib/artikcloud/models/rule_warning_output.rb +61 -27
- data/lib/artikcloud/models/rules_envelope.rb +69 -35
- data/lib/artikcloud/models/snapshot_response.rb +210 -0
- data/lib/artikcloud/models/snapshot_responses.rb +219 -0
- data/lib/artikcloud/models/snapshots_response_envelope.rb +208 -0
- data/lib/artikcloud/models/tag.rb +61 -27
- data/lib/artikcloud/models/tag_array.rb +59 -24
- data/lib/artikcloud/models/tags_envelope.rb +59 -24
- data/lib/artikcloud/models/token.rb +65 -33
- data/lib/artikcloud/models/token_info.rb +226 -0
- data/lib/artikcloud/models/token_info_success_response.rb +199 -0
- data/lib/artikcloud/models/token_request.rb +59 -24
- data/lib/artikcloud/models/token_response.rb +59 -24
- data/lib/artikcloud/models/unregister_device_response.rb +79 -54
- data/lib/artikcloud/models/unregister_device_response_envelope.rb +59 -24
- data/lib/artikcloud/models/user.rb +77 -42
- data/lib/artikcloud/models/user_envelope.rb +60 -24
- data/lib/artikcloud/models/web_socket_error.rb +63 -30
- data/lib/artikcloud/version.rb +14 -5
- data/lib/artikcloud.rb +26 -4
- data/spec/api/device_types_api_spec.rb +110 -0
- data/spec/api/devices_api_spec.rb +143 -0
- data/spec/api/export_api_spec.rb +96 -0
- data/spec/api/messages_api_spec.rb +7 -7
- data/spec/api/registrations_api_spec.rb +82 -0
- data/spec/api/rules_api_spec.rb +96 -0
- data/spec/api/tags_api_spec.rb +84 -0
- data/spec/api/tokens_api_spec.rb +12 -21
- data/spec/api/users_api_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- 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
|
9
|
-
|
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
|
-
|
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 ActionDetailsArray
|
20
29
|
attr_accessor :actions
|
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
|
:'actions' => :'actions'
|
27
|
-
|
28
36
|
}
|
29
37
|
end
|
30
38
|
|
@@ -32,26 +40,40 @@ module ArtikCloud
|
|
32
40
|
def self.swagger_types
|
33
41
|
{
|
34
42
|
:'actions' => :'Array<ActionDetails>'
|
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.
|
52
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
44
53
|
|
45
|
-
|
46
|
-
if attributes[:'actions']
|
54
|
+
if attributes.has_key?(:'actions')
|
47
55
|
if (value = attributes[:'actions']).is_a?(Array)
|
48
56
|
self.actions = value
|
49
57
|
end
|
50
58
|
end
|
51
|
-
|
59
|
+
|
60
|
+
end
|
61
|
+
|
62
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
63
|
+
# @return Array for valid properies with the reasons
|
64
|
+
def list_invalid_properties
|
65
|
+
invalid_properties = Array.new
|
66
|
+
return invalid_properties
|
52
67
|
end
|
53
68
|
|
54
|
-
# Check
|
69
|
+
# Check to see if the all the properties in the model are valid
|
70
|
+
# @return true if the model is valid
|
71
|
+
def valid?
|
72
|
+
return true
|
73
|
+
end
|
74
|
+
|
75
|
+
# Checks equality by comparing each attribute.
|
76
|
+
# @param [Object] Object to be compared
|
55
77
|
def ==(o)
|
56
78
|
return true if self.equal?(o)
|
57
79
|
self.class == o.class &&
|
@@ -59,35 +81,41 @@ module ArtikCloud
|
|
59
81
|
end
|
60
82
|
|
61
83
|
# @see the `==` method
|
84
|
+
# @param [Object] Object to be compared
|
62
85
|
def eql?(o)
|
63
86
|
self == o
|
64
87
|
end
|
65
88
|
|
66
|
-
#
|
89
|
+
# Calculates hash code according to all attributes.
|
90
|
+
# @return [Fixnum] Hash code
|
67
91
|
def hash
|
68
92
|
[actions].hash
|
69
93
|
end
|
70
94
|
|
71
|
-
#
|
95
|
+
# Builds the object from hash
|
96
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
97
|
+
# @return [Object] Returns the model itself
|
72
98
|
def build_from_hash(attributes)
|
73
99
|
return nil unless attributes.is_a?(Hash)
|
74
100
|
self.class.swagger_types.each_pair do |key, type|
|
75
101
|
if type =~ /^Array<(.*)>/i
|
102
|
+
# check to ensure the input is an array given that the the attribute
|
103
|
+
# is documented as an array but the input is not
|
76
104
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
77
105
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
78
|
-
else
|
79
|
-
#TODO show warning in debug mode
|
80
106
|
end
|
81
107
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
82
108
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
83
|
-
else
|
84
|
-
# data not found in attributes(hash), not an issue as the data can be optional
|
85
|
-
end
|
109
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
86
110
|
end
|
87
111
|
|
88
112
|
self
|
89
113
|
end
|
90
114
|
|
115
|
+
# Deserializes the data based on type
|
116
|
+
# @param string type Data type
|
117
|
+
# @param string value Value to be deserialized
|
118
|
+
# @return [Object] Deserialized data
|
91
119
|
def _deserialize(type, value)
|
92
120
|
case type.to_sym
|
93
121
|
when :DateTime
|
@@ -121,21 +149,25 @@ module ArtikCloud
|
|
121
149
|
end
|
122
150
|
end
|
123
151
|
else # model
|
124
|
-
|
125
|
-
|
152
|
+
temp_model = ArtikCloud.const_get(type).new
|
153
|
+
temp_model.build_from_hash(value)
|
126
154
|
end
|
127
155
|
end
|
128
156
|
|
157
|
+
# Returns the string representation of the object
|
158
|
+
# @return [String] String presentation of the object
|
129
159
|
def to_s
|
130
160
|
to_hash.to_s
|
131
161
|
end
|
132
162
|
|
133
|
-
# to_body is an alias to
|
163
|
+
# to_body is an alias to to_hash (backward compatibility)
|
164
|
+
# @return [Hash] Returns the object in the form of hash
|
134
165
|
def to_body
|
135
166
|
to_hash
|
136
167
|
end
|
137
168
|
|
138
|
-
#
|
169
|
+
# Returns the object in the form of hash
|
170
|
+
# @return [Hash] Returns the object in the form of hash
|
139
171
|
def to_hash
|
140
172
|
hash = {}
|
141
173
|
self.class.attribute_map.each_pair do |attr, param|
|
@@ -146,8 +178,10 @@ module ArtikCloud
|
|
146
178
|
hash
|
147
179
|
end
|
148
180
|
|
149
|
-
#
|
181
|
+
# Outputs non-array value in the form of hash
|
150
182
|
# For object, use to_hash. Otherwise, just return the value
|
183
|
+
# @param [Object] value Any valid value
|
184
|
+
# @return [Hash] Returns the value in the form of hash
|
151
185
|
def _to_hash(value)
|
152
186
|
if value.is_a?(Array)
|
153
187
|
value.compact.map{ |v| _to_hash(v) }
|
@@ -163,4 +197,5 @@ module ArtikCloud
|
|
163
197
|
end
|
164
198
|
|
165
199
|
end
|
200
|
+
|
166
201
|
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
|
9
|
-
|
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
|
-
|
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
|
|
@@ -34,22 +43,16 @@ module ArtikCloud
|
|
34
43
|
# Type.
|
35
44
|
attr_accessor :type
|
36
45
|
|
46
|
+
|
37
47
|
# Attribute mapping from ruby-style variable name to JSON key.
|
38
48
|
def self.attribute_map
|
39
49
|
{
|
40
|
-
|
41
50
|
:'data' => :'data',
|
42
|
-
|
43
51
|
:'cid' => :'cid',
|
44
|
-
|
45
52
|
:'ddid' => :'ddid',
|
46
|
-
|
47
53
|
:'sdid' => :'sdid',
|
48
|
-
|
49
54
|
:'ts' => :'ts',
|
50
|
-
|
51
55
|
:'type' => :'type'
|
52
|
-
|
53
56
|
}
|
54
57
|
end
|
55
58
|
|
@@ -62,46 +65,60 @@ module ArtikCloud
|
|
62
65
|
:'sdid' => :'String',
|
63
66
|
:'ts' => :'Integer',
|
64
67
|
:'type' => :'String'
|
65
|
-
|
66
68
|
}
|
67
69
|
end
|
68
70
|
|
71
|
+
# Initializes the object
|
72
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
69
73
|
def initialize(attributes = {})
|
70
74
|
return unless attributes.is_a?(Hash)
|
71
75
|
|
72
76
|
# convert string to symbol for hash key
|
73
|
-
attributes = attributes.
|
77
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
74
78
|
|
75
|
-
|
76
|
-
if attributes[:'data']
|
79
|
+
if attributes.has_key?(:'data')
|
77
80
|
self.data = attributes[:'data']
|
78
81
|
end
|
79
|
-
|
80
|
-
if attributes
|
82
|
+
|
83
|
+
if attributes.has_key?(:'cid')
|
81
84
|
self.cid = attributes[:'cid']
|
82
85
|
end
|
83
|
-
|
84
|
-
if attributes
|
86
|
+
|
87
|
+
if attributes.has_key?(:'ddid')
|
85
88
|
self.ddid = attributes[:'ddid']
|
86
89
|
end
|
87
|
-
|
88
|
-
if attributes
|
90
|
+
|
91
|
+
if attributes.has_key?(:'sdid')
|
89
92
|
self.sdid = attributes[:'sdid']
|
90
93
|
end
|
91
|
-
|
92
|
-
if attributes
|
94
|
+
|
95
|
+
if attributes.has_key?(:'ts')
|
93
96
|
self.ts = attributes[:'ts']
|
94
97
|
end
|
95
|
-
|
96
|
-
if attributes
|
98
|
+
|
99
|
+
if attributes.has_key?(:'type')
|
97
100
|
self.type = attributes[:'type']
|
98
101
|
else
|
99
102
|
self.type = "action"
|
100
103
|
end
|
101
|
-
|
104
|
+
|
105
|
+
end
|
106
|
+
|
107
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
108
|
+
# @return Array for valid properies with the reasons
|
109
|
+
def list_invalid_properties
|
110
|
+
invalid_properties = Array.new
|
111
|
+
return invalid_properties
|
112
|
+
end
|
113
|
+
|
114
|
+
# Check to see if the all the properties in the model are valid
|
115
|
+
# @return true if the model is valid
|
116
|
+
def valid?
|
117
|
+
return true
|
102
118
|
end
|
103
119
|
|
104
|
-
#
|
120
|
+
# Checks equality by comparing each attribute.
|
121
|
+
# @param [Object] Object to be compared
|
105
122
|
def ==(o)
|
106
123
|
return true if self.equal?(o)
|
107
124
|
self.class == o.class &&
|
@@ -114,35 +131,41 @@ module ArtikCloud
|
|
114
131
|
end
|
115
132
|
|
116
133
|
# @see the `==` method
|
134
|
+
# @param [Object] Object to be compared
|
117
135
|
def eql?(o)
|
118
136
|
self == o
|
119
137
|
end
|
120
138
|
|
121
|
-
#
|
139
|
+
# Calculates hash code according to all attributes.
|
140
|
+
# @return [Fixnum] Hash code
|
122
141
|
def hash
|
123
142
|
[data, cid, ddid, sdid, ts, type].hash
|
124
143
|
end
|
125
144
|
|
126
|
-
#
|
145
|
+
# Builds the object from hash
|
146
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
147
|
+
# @return [Object] Returns the model itself
|
127
148
|
def build_from_hash(attributes)
|
128
149
|
return nil unless attributes.is_a?(Hash)
|
129
150
|
self.class.swagger_types.each_pair do |key, type|
|
130
151
|
if type =~ /^Array<(.*)>/i
|
152
|
+
# check to ensure the input is an array given that the the attribute
|
153
|
+
# is documented as an array but the input is not
|
131
154
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
132
155
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
133
|
-
else
|
134
|
-
#TODO show warning in debug mode
|
135
156
|
end
|
136
157
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
137
158
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
138
|
-
else
|
139
|
-
# data not found in attributes(hash), not an issue as the data can be optional
|
140
|
-
end
|
159
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
141
160
|
end
|
142
161
|
|
143
162
|
self
|
144
163
|
end
|
145
164
|
|
165
|
+
# Deserializes the data based on type
|
166
|
+
# @param string type Data type
|
167
|
+
# @param string value Value to be deserialized
|
168
|
+
# @return [Object] Deserialized data
|
146
169
|
def _deserialize(type, value)
|
147
170
|
case type.to_sym
|
148
171
|
when :DateTime
|
@@ -176,21 +199,25 @@ module ArtikCloud
|
|
176
199
|
end
|
177
200
|
end
|
178
201
|
else # model
|
179
|
-
|
180
|
-
|
202
|
+
temp_model = ArtikCloud.const_get(type).new
|
203
|
+
temp_model.build_from_hash(value)
|
181
204
|
end
|
182
205
|
end
|
183
206
|
|
207
|
+
# Returns the string representation of the object
|
208
|
+
# @return [String] String presentation of the object
|
184
209
|
def to_s
|
185
210
|
to_hash.to_s
|
186
211
|
end
|
187
212
|
|
188
|
-
# to_body is an alias to
|
213
|
+
# to_body is an alias to to_hash (backward compatibility)
|
214
|
+
# @return [Hash] Returns the object in the form of hash
|
189
215
|
def to_body
|
190
216
|
to_hash
|
191
217
|
end
|
192
218
|
|
193
|
-
#
|
219
|
+
# Returns the object in the form of hash
|
220
|
+
# @return [Hash] Returns the object in the form of hash
|
194
221
|
def to_hash
|
195
222
|
hash = {}
|
196
223
|
self.class.attribute_map.each_pair do |attr, param|
|
@@ -201,8 +228,10 @@ module ArtikCloud
|
|
201
228
|
hash
|
202
229
|
end
|
203
230
|
|
204
|
-
#
|
231
|
+
# Outputs non-array value in the form of hash
|
205
232
|
# For object, use to_hash. Otherwise, just return the value
|
233
|
+
# @param [Object] value Any valid value
|
234
|
+
# @return [Hash] Returns the value in the form of hash
|
206
235
|
def _to_hash(value)
|
207
236
|
if value.is_a?(Array)
|
208
237
|
value.compact.map{ |v| _to_hash(v) }
|
@@ -218,4 +247,5 @@ module ArtikCloud
|
|
218
247
|
end
|
219
248
|
|
220
249
|
end
|
250
|
+
|
221
251
|
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
|
9
|
-
|
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
|
-
|
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.
|
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
|
78
|
+
|
79
|
+
if attributes.has_key?(:'uid')
|
76
80
|
self.uid = attributes[:'uid']
|
77
81
|
end
|
78
|
-
|
79
|
-
if attributes
|
82
|
+
|
83
|
+
if attributes.has_key?(:'sdtid')
|
80
84
|
self.sdtid = attributes[:'sdtid']
|
81
85
|
end
|
82
|
-
|
83
|
-
if attributes
|
86
|
+
|
87
|
+
if attributes.has_key?(:'cts')
|
84
88
|
self.cts = attributes[:'cts']
|
85
89
|
end
|
86
|
-
|
87
|
-
if attributes
|
90
|
+
|
91
|
+
if attributes.has_key?(:'mv')
|
88
92
|
self.mv = attributes[:'mv']
|
89
93
|
end
|
90
|
-
|
94
|
+
|
91
95
|
end
|
92
96
|
|
93
|
-
#
|
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
|
-
#
|
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
|
-
#
|
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
|
-
|
168
|
-
|
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
|
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
|
-
#
|
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
|
-
#
|
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
|