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.
- 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 CheckTokenMessage
|
|
20
29
|
attr_accessor :message
|
|
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
|
:'message' => :'message'
|
|
27
|
-
|
|
28
36
|
}
|
|
29
37
|
end
|
|
30
38
|
|
|
@@ -32,24 +40,38 @@ module ArtikCloud
|
|
|
32
40
|
def self.swagger_types
|
|
33
41
|
{
|
|
34
42
|
:'message' => :'String'
|
|
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[:'message']
|
|
54
|
+
if attributes.has_key?(:'message')
|
|
47
55
|
self.message = attributes[:'message']
|
|
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
|
|
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
|
-
#
|
|
87
|
+
# Calculates hash code according to all attributes.
|
|
88
|
+
# @return [Fixnum] Hash code
|
|
65
89
|
def hash
|
|
66
90
|
[message].hash
|
|
67
91
|
end
|
|
68
92
|
|
|
69
|
-
#
|
|
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
|
-
|
|
123
|
-
|
|
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
|
|
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
|
-
#
|
|
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
|
-
#
|
|
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
|
|
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 CheckTokenResponse
|
|
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' => :'CheckTokenMessage'
|
|
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[:'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
|
|
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
|
-
#
|
|
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
|
-
#
|
|
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
|
-
|
|
123
|
-
|
|
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
|
|
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
|
-
#
|
|
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
|
-
#
|
|
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
|
|
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
|
|
|
@@ -57,38 +66,24 @@ module ArtikCloud
|
|
|
57
66
|
|
|
58
67
|
attr_accessor :provider_credentials
|
|
59
68
|
|
|
69
|
+
|
|
60
70
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
61
71
|
def self.attribute_map
|
|
62
72
|
{
|
|
63
|
-
|
|
64
73
|
:'id' => :'id',
|
|
65
|
-
|
|
66
74
|
:'uid' => :'uid',
|
|
67
|
-
|
|
68
75
|
:'dtid' => :'dtid',
|
|
69
|
-
|
|
70
76
|
:'name' => :'name',
|
|
71
|
-
|
|
72
77
|
:'manifest_version' => :'manifestVersion',
|
|
73
|
-
|
|
74
78
|
:'manifest_version_policy' => :'manifestVersionPolicy',
|
|
75
|
-
|
|
76
79
|
:'need_provider_auth' => :'needProviderAuth',
|
|
77
|
-
|
|
78
80
|
:'properties' => :'properties',
|
|
79
|
-
|
|
80
81
|
:'created_on' => :'createdOn',
|
|
81
|
-
|
|
82
82
|
:'connected' => :'connected',
|
|
83
|
-
|
|
84
83
|
:'certificate_info' => :'certificateInfo',
|
|
85
|
-
|
|
86
84
|
:'certificate_signature' => :'certificateSignature',
|
|
87
|
-
|
|
88
85
|
:'eid' => :'eid',
|
|
89
|
-
|
|
90
86
|
:'provider_credentials' => :'providerCredentials'
|
|
91
|
-
|
|
92
87
|
}
|
|
93
88
|
end
|
|
94
89
|
|
|
@@ -109,80 +104,94 @@ module ArtikCloud
|
|
|
109
104
|
:'certificate_signature' => :'String',
|
|
110
105
|
:'eid' => :'String',
|
|
111
106
|
:'provider_credentials' => :'Hash<String, Object>'
|
|
112
|
-
|
|
113
107
|
}
|
|
114
108
|
end
|
|
115
109
|
|
|
110
|
+
# Initializes the object
|
|
111
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
116
112
|
def initialize(attributes = {})
|
|
117
113
|
return unless attributes.is_a?(Hash)
|
|
118
114
|
|
|
119
115
|
# convert string to symbol for hash key
|
|
120
|
-
attributes = attributes.
|
|
116
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
|
121
117
|
|
|
122
|
-
|
|
123
|
-
if attributes[:'id']
|
|
118
|
+
if attributes.has_key?(:'id')
|
|
124
119
|
self.id = attributes[:'id']
|
|
125
120
|
end
|
|
126
|
-
|
|
127
|
-
if attributes
|
|
121
|
+
|
|
122
|
+
if attributes.has_key?(:'uid')
|
|
128
123
|
self.uid = attributes[:'uid']
|
|
129
124
|
end
|
|
130
|
-
|
|
131
|
-
if attributes
|
|
125
|
+
|
|
126
|
+
if attributes.has_key?(:'dtid')
|
|
132
127
|
self.dtid = attributes[:'dtid']
|
|
133
128
|
end
|
|
134
|
-
|
|
135
|
-
if attributes
|
|
129
|
+
|
|
130
|
+
if attributes.has_key?(:'name')
|
|
136
131
|
self.name = attributes[:'name']
|
|
137
132
|
end
|
|
138
|
-
|
|
139
|
-
if attributes
|
|
133
|
+
|
|
134
|
+
if attributes.has_key?(:'manifestVersion')
|
|
140
135
|
self.manifest_version = attributes[:'manifestVersion']
|
|
141
136
|
end
|
|
142
|
-
|
|
143
|
-
if attributes
|
|
137
|
+
|
|
138
|
+
if attributes.has_key?(:'manifestVersionPolicy')
|
|
144
139
|
self.manifest_version_policy = attributes[:'manifestVersionPolicy']
|
|
145
140
|
end
|
|
146
|
-
|
|
147
|
-
if attributes
|
|
141
|
+
|
|
142
|
+
if attributes.has_key?(:'needProviderAuth')
|
|
148
143
|
self.need_provider_auth = attributes[:'needProviderAuth']
|
|
149
144
|
end
|
|
150
|
-
|
|
151
|
-
if attributes
|
|
145
|
+
|
|
146
|
+
if attributes.has_key?(:'properties')
|
|
152
147
|
if (value = attributes[:'properties']).is_a?(Array)
|
|
153
148
|
self.properties = value
|
|
154
149
|
end
|
|
155
150
|
end
|
|
156
|
-
|
|
157
|
-
if attributes
|
|
151
|
+
|
|
152
|
+
if attributes.has_key?(:'createdOn')
|
|
158
153
|
self.created_on = attributes[:'createdOn']
|
|
159
154
|
end
|
|
160
|
-
|
|
161
|
-
if attributes
|
|
155
|
+
|
|
156
|
+
if attributes.has_key?(:'connected')
|
|
162
157
|
self.connected = attributes[:'connected']
|
|
163
158
|
end
|
|
164
|
-
|
|
165
|
-
if attributes
|
|
159
|
+
|
|
160
|
+
if attributes.has_key?(:'certificateInfo')
|
|
166
161
|
self.certificate_info = attributes[:'certificateInfo']
|
|
167
162
|
end
|
|
168
|
-
|
|
169
|
-
if attributes
|
|
163
|
+
|
|
164
|
+
if attributes.has_key?(:'certificateSignature')
|
|
170
165
|
self.certificate_signature = attributes[:'certificateSignature']
|
|
171
166
|
end
|
|
172
|
-
|
|
173
|
-
if attributes
|
|
167
|
+
|
|
168
|
+
if attributes.has_key?(:'eid')
|
|
174
169
|
self.eid = attributes[:'eid']
|
|
175
170
|
end
|
|
176
|
-
|
|
177
|
-
if attributes
|
|
171
|
+
|
|
172
|
+
if attributes.has_key?(:'providerCredentials')
|
|
178
173
|
if (value = attributes[:'providerCredentials']).is_a?(Array)
|
|
179
174
|
self.provider_credentials = value
|
|
180
175
|
end
|
|
181
176
|
end
|
|
182
|
-
|
|
177
|
+
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
181
|
+
# @return Array for valid properies with the reasons
|
|
182
|
+
def list_invalid_properties
|
|
183
|
+
invalid_properties = Array.new
|
|
184
|
+
return invalid_properties
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
# Check to see if the all the properties in the model are valid
|
|
188
|
+
# @return true if the model is valid
|
|
189
|
+
def valid?
|
|
190
|
+
return true
|
|
183
191
|
end
|
|
184
192
|
|
|
185
|
-
#
|
|
193
|
+
# Checks equality by comparing each attribute.
|
|
194
|
+
# @param [Object] Object to be compared
|
|
186
195
|
def ==(o)
|
|
187
196
|
return true if self.equal?(o)
|
|
188
197
|
self.class == o.class &&
|
|
@@ -203,35 +212,41 @@ module ArtikCloud
|
|
|
203
212
|
end
|
|
204
213
|
|
|
205
214
|
# @see the `==` method
|
|
215
|
+
# @param [Object] Object to be compared
|
|
206
216
|
def eql?(o)
|
|
207
217
|
self == o
|
|
208
218
|
end
|
|
209
219
|
|
|
210
|
-
#
|
|
220
|
+
# Calculates hash code according to all attributes.
|
|
221
|
+
# @return [Fixnum] Hash code
|
|
211
222
|
def hash
|
|
212
223
|
[id, uid, dtid, name, manifest_version, manifest_version_policy, need_provider_auth, properties, created_on, connected, certificate_info, certificate_signature, eid, provider_credentials].hash
|
|
213
224
|
end
|
|
214
225
|
|
|
215
|
-
#
|
|
226
|
+
# Builds the object from hash
|
|
227
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
228
|
+
# @return [Object] Returns the model itself
|
|
216
229
|
def build_from_hash(attributes)
|
|
217
230
|
return nil unless attributes.is_a?(Hash)
|
|
218
231
|
self.class.swagger_types.each_pair do |key, type|
|
|
219
232
|
if type =~ /^Array<(.*)>/i
|
|
233
|
+
# check to ensure the input is an array given that the the attribute
|
|
234
|
+
# is documented as an array but the input is not
|
|
220
235
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
221
236
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
|
222
|
-
else
|
|
223
|
-
#TODO show warning in debug mode
|
|
224
237
|
end
|
|
225
238
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
226
239
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
227
|
-
else
|
|
228
|
-
# data not found in attributes(hash), not an issue as the data can be optional
|
|
229
|
-
end
|
|
240
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
230
241
|
end
|
|
231
242
|
|
|
232
243
|
self
|
|
233
244
|
end
|
|
234
245
|
|
|
246
|
+
# Deserializes the data based on type
|
|
247
|
+
# @param string type Data type
|
|
248
|
+
# @param string value Value to be deserialized
|
|
249
|
+
# @return [Object] Deserialized data
|
|
235
250
|
def _deserialize(type, value)
|
|
236
251
|
case type.to_sym
|
|
237
252
|
when :DateTime
|
|
@@ -265,21 +280,25 @@ module ArtikCloud
|
|
|
265
280
|
end
|
|
266
281
|
end
|
|
267
282
|
else # model
|
|
268
|
-
|
|
269
|
-
|
|
283
|
+
temp_model = ArtikCloud.const_get(type).new
|
|
284
|
+
temp_model.build_from_hash(value)
|
|
270
285
|
end
|
|
271
286
|
end
|
|
272
287
|
|
|
288
|
+
# Returns the string representation of the object
|
|
289
|
+
# @return [String] String presentation of the object
|
|
273
290
|
def to_s
|
|
274
291
|
to_hash.to_s
|
|
275
292
|
end
|
|
276
293
|
|
|
277
|
-
# to_body is an alias to
|
|
294
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
295
|
+
# @return [Hash] Returns the object in the form of hash
|
|
278
296
|
def to_body
|
|
279
297
|
to_hash
|
|
280
298
|
end
|
|
281
299
|
|
|
282
|
-
#
|
|
300
|
+
# Returns the object in the form of hash
|
|
301
|
+
# @return [Hash] Returns the object in the form of hash
|
|
283
302
|
def to_hash
|
|
284
303
|
hash = {}
|
|
285
304
|
self.class.attribute_map.each_pair do |attr, param|
|
|
@@ -290,8 +309,10 @@ module ArtikCloud
|
|
|
290
309
|
hash
|
|
291
310
|
end
|
|
292
311
|
|
|
293
|
-
#
|
|
312
|
+
# Outputs non-array value in the form of hash
|
|
294
313
|
# For object, use to_hash. Otherwise, just return the value
|
|
314
|
+
# @param [Object] value Any valid value
|
|
315
|
+
# @return [Hash] Returns the value in the form of hash
|
|
295
316
|
def _to_hash(value)
|
|
296
317
|
if value.is_a?(Array)
|
|
297
318
|
value.compact.map{ |v| _to_hash(v) }
|
|
@@ -307,4 +328,5 @@ module ArtikCloud
|
|
|
307
328
|
end
|
|
308
329
|
|
|
309
330
|
end
|
|
331
|
+
|
|
310
332
|
end
|