vericite_api 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,153 @@
1
+ =begin
2
+ VeriCiteV1
3
+ =end
4
+
5
+ require 'date'
6
+
7
+ module VeriCiteClient
8
+ class Error
9
+ attr_accessor :message
10
+
11
+ # Attribute mapping from ruby-style variable name to JSON key.
12
+ def self.attribute_map
13
+ {
14
+
15
+ :'message' => :'message'
16
+
17
+ }
18
+ end
19
+
20
+ # Attribute type mapping.
21
+ def self.swagger_types
22
+ {
23
+ :'message' => :'String'
24
+
25
+ }
26
+ end
27
+
28
+ def initialize(attributes = {})
29
+ return unless attributes.is_a?(Hash)
30
+
31
+ # convert string to symbol for hash key
32
+ attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
33
+
34
+
35
+ if attributes[:'message']
36
+ self.message = attributes[:'message']
37
+ end
38
+
39
+ end
40
+
41
+ # Check equality by comparing each attribute.
42
+ def ==(o)
43
+ return true if self.equal?(o)
44
+ self.class == o.class &&
45
+ message == o.message
46
+ end
47
+
48
+ # @see the `==` method
49
+ def eql?(o)
50
+ self == o
51
+ end
52
+
53
+ # Calculate hash code according to all attributes.
54
+ def hash
55
+ [message].hash
56
+ end
57
+
58
+ # build the object from hash
59
+ def build_from_hash(attributes)
60
+ return nil unless attributes.is_a?(Hash)
61
+ self.class.swagger_types.each_pair do |key, type|
62
+ if type =~ /^Array<(.*)>/i
63
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
64
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
65
+ else
66
+ #TODO show warning in debug mode
67
+ end
68
+ elsif !attributes[self.class.attribute_map[key]].nil?
69
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
70
+ else
71
+ # data not found in attributes(hash), not an issue as the data can be optional
72
+ end
73
+ end
74
+
75
+ self
76
+ end
77
+
78
+ def _deserialize(type, value)
79
+ case type.to_sym
80
+ when :DateTime
81
+ DateTime.parse(value)
82
+ when :Date
83
+ Date.parse(value)
84
+ when :String
85
+ value.to_s
86
+ when :Integer
87
+ value.to_i
88
+ when :Float
89
+ value.to_f
90
+ when :BOOLEAN
91
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
92
+ true
93
+ else
94
+ false
95
+ end
96
+ when :Object
97
+ # generic object (usually a Hash), return directly
98
+ value
99
+ when /\AArray<(?<inner_type>.+)>\z/
100
+ inner_type = Regexp.last_match[:inner_type]
101
+ value.map { |v| _deserialize(inner_type, v) }
102
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
103
+ k_type = Regexp.last_match[:k_type]
104
+ v_type = Regexp.last_match[:v_type]
105
+ {}.tap do |hash|
106
+ value.each do |k, v|
107
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
108
+ end
109
+ end
110
+ else # model
111
+ _model = VeriCiteClient.const_get(type).new
112
+ _model.build_from_hash(value)
113
+ end
114
+ end
115
+
116
+ def to_s
117
+ to_hash.to_s
118
+ end
119
+
120
+ # to_body is an alias to to_body (backward compatibility))
121
+ def to_body
122
+ to_hash
123
+ end
124
+
125
+ # return the object in the form of hash
126
+ def to_hash
127
+ hash = {}
128
+ self.class.attribute_map.each_pair do |attr, param|
129
+ value = self.send(attr)
130
+ next if value.nil?
131
+ hash[param] = _to_hash(value)
132
+ end
133
+ hash
134
+ end
135
+
136
+ # Method to output non-array value in the form of hash
137
+ # For object, use to_hash. Otherwise, just return the value
138
+ def _to_hash(value)
139
+ if value.is_a?(Array)
140
+ value.compact.map{ |v| _to_hash(v) }
141
+ elsif value.is_a?(Hash)
142
+ {}.tap do |hash|
143
+ value.each { |k, v| hash[k] = _to_hash(v) }
144
+ end
145
+ elsif value.respond_to? :to_hash
146
+ value.to_hash
147
+ else
148
+ value
149
+ end
150
+ end
151
+
152
+ end
153
+ end
@@ -0,0 +1,187 @@
1
+ =begin
2
+ VeriCiteV1
3
+ =end
4
+
5
+ require 'date'
6
+
7
+ module VeriCiteClient
8
+ class ExternalContentData
9
+ # The name of the file
10
+ attr_accessor :file_name
11
+
12
+ # The content type of the file
13
+ attr_accessor :upload_content_type
14
+
15
+ # The content length of the file
16
+ attr_accessor :upload_content_length
17
+
18
+ # External Content ID
19
+ attr_accessor :external_content_id
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+
25
+ :'file_name' => :'fileName',
26
+
27
+ :'upload_content_type' => :'uploadContentType',
28
+
29
+ :'upload_content_length' => :'uploadContentLength',
30
+
31
+ :'external_content_id' => :'externalContentID'
32
+
33
+ }
34
+ end
35
+
36
+ # Attribute type mapping.
37
+ def self.swagger_types
38
+ {
39
+ :'file_name' => :'String',
40
+ :'upload_content_type' => :'String',
41
+ :'upload_content_length' => :'Integer',
42
+ :'external_content_id' => :'String'
43
+
44
+ }
45
+ end
46
+
47
+ def initialize(attributes = {})
48
+ return unless attributes.is_a?(Hash)
49
+
50
+ # convert string to symbol for hash key
51
+ attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
52
+
53
+
54
+ if attributes[:'fileName']
55
+ self.file_name = attributes[:'fileName']
56
+ end
57
+
58
+ if attributes[:'uploadContentType']
59
+ self.upload_content_type = attributes[:'uploadContentType']
60
+ end
61
+
62
+ if attributes[:'uploadContentLength']
63
+ self.upload_content_length = attributes[:'uploadContentLength']
64
+ end
65
+
66
+ if attributes[:'externalContentID']
67
+ self.external_content_id = attributes[:'externalContentID']
68
+ end
69
+
70
+ end
71
+
72
+ # Check equality by comparing each attribute.
73
+ def ==(o)
74
+ return true if self.equal?(o)
75
+ self.class == o.class &&
76
+ file_name == o.file_name &&
77
+ upload_content_type == o.upload_content_type &&
78
+ upload_content_length == o.upload_content_length &&
79
+ external_content_id == o.external_content_id
80
+ end
81
+
82
+ # @see the `==` method
83
+ def eql?(o)
84
+ self == o
85
+ end
86
+
87
+ # Calculate hash code according to all attributes.
88
+ def hash
89
+ [file_name, upload_content_type, upload_content_length, external_content_id].hash
90
+ end
91
+
92
+ # build the object from hash
93
+ def build_from_hash(attributes)
94
+ return nil unless attributes.is_a?(Hash)
95
+ self.class.swagger_types.each_pair do |key, type|
96
+ if type =~ /^Array<(.*)>/i
97
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
98
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
99
+ else
100
+ #TODO show warning in debug mode
101
+ end
102
+ elsif !attributes[self.class.attribute_map[key]].nil?
103
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
104
+ else
105
+ # data not found in attributes(hash), not an issue as the data can be optional
106
+ end
107
+ end
108
+
109
+ self
110
+ end
111
+
112
+ def _deserialize(type, value)
113
+ case type.to_sym
114
+ when :DateTime
115
+ DateTime.parse(value)
116
+ when :Date
117
+ Date.parse(value)
118
+ when :String
119
+ value.to_s
120
+ when :Integer
121
+ value.to_i
122
+ when :Float
123
+ value.to_f
124
+ when :BOOLEAN
125
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
126
+ true
127
+ else
128
+ false
129
+ end
130
+ when :Object
131
+ # generic object (usually a Hash), return directly
132
+ value
133
+ when /\AArray<(?<inner_type>.+)>\z/
134
+ inner_type = Regexp.last_match[:inner_type]
135
+ value.map { |v| _deserialize(inner_type, v) }
136
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
137
+ k_type = Regexp.last_match[:k_type]
138
+ v_type = Regexp.last_match[:v_type]
139
+ {}.tap do |hash|
140
+ value.each do |k, v|
141
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
142
+ end
143
+ end
144
+ else # model
145
+ _model = VeriCiteClient.const_get(type).new
146
+ _model.build_from_hash(value)
147
+ end
148
+ end
149
+
150
+ def to_s
151
+ to_hash.to_s
152
+ end
153
+
154
+ # to_body is an alias to to_body (backward compatibility))
155
+ def to_body
156
+ to_hash
157
+ end
158
+
159
+ # return the object in the form of hash
160
+ def to_hash
161
+ hash = {}
162
+ self.class.attribute_map.each_pair do |attr, param|
163
+ value = self.send(attr)
164
+ next if value.nil?
165
+ hash[param] = _to_hash(value)
166
+ end
167
+ hash
168
+ end
169
+
170
+ # Method to output non-array value in the form of hash
171
+ # For object, use to_hash. Otherwise, just return the value
172
+ def _to_hash(value)
173
+ if value.is_a?(Array)
174
+ value.compact.map{ |v| _to_hash(v) }
175
+ elsif value.is_a?(Hash)
176
+ {}.tap do |hash|
177
+ value.each { |k, v| hash[k] = _to_hash(v) }
178
+ end
179
+ elsif value.respond_to? :to_hash
180
+ value.to_hash
181
+ else
182
+ value
183
+ end
184
+ end
185
+
186
+ end
187
+ end
@@ -0,0 +1,198 @@
1
+ =begin
2
+ VeriCiteV1
3
+ =end
4
+
5
+ require 'date'
6
+
7
+ module VeriCiteClient
8
+ class ExternalContentUploadInfo
9
+ # ID used to ID the uploaded file
10
+ attr_accessor :external_content_id
11
+
12
+ # URL to submit the attachment to
13
+ attr_accessor :url_post
14
+
15
+ # The file path
16
+ attr_accessor :file_path
17
+
18
+ # The length of the file
19
+ attr_accessor :content_length
20
+
21
+ # The files content type
22
+ attr_accessor :content_type
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+
28
+ :'external_content_id' => :'externalContentID',
29
+
30
+ :'url_post' => :'urlPost',
31
+
32
+ :'file_path' => :'filePath',
33
+
34
+ :'content_length' => :'contentLength',
35
+
36
+ :'content_type' => :'contentType'
37
+
38
+ }
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.swagger_types
43
+ {
44
+ :'external_content_id' => :'String',
45
+ :'url_post' => :'String',
46
+ :'file_path' => :'String',
47
+ :'content_length' => :'Integer',
48
+ :'content_type' => :'String'
49
+
50
+ }
51
+ end
52
+
53
+ def initialize(attributes = {})
54
+ return unless attributes.is_a?(Hash)
55
+
56
+ # convert string to symbol for hash key
57
+ attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
58
+
59
+
60
+ if attributes[:'externalContentID']
61
+ self.external_content_id = attributes[:'externalContentID']
62
+ end
63
+
64
+ if attributes[:'urlPost']
65
+ self.url_post = attributes[:'urlPost']
66
+ end
67
+
68
+ if attributes[:'filePath']
69
+ self.file_path = attributes[:'filePath']
70
+ end
71
+
72
+ if attributes[:'contentLength']
73
+ self.content_length = attributes[:'contentLength']
74
+ end
75
+
76
+ if attributes[:'contentType']
77
+ self.content_type = attributes[:'contentType']
78
+ end
79
+
80
+ end
81
+
82
+ # Check equality by comparing each attribute.
83
+ def ==(o)
84
+ return true if self.equal?(o)
85
+ self.class == o.class &&
86
+ external_content_id == o.external_content_id &&
87
+ url_post == o.url_post &&
88
+ file_path == o.file_path &&
89
+ content_length == o.content_length &&
90
+ content_type == o.content_type
91
+ end
92
+
93
+ # @see the `==` method
94
+ def eql?(o)
95
+ self == o
96
+ end
97
+
98
+ # Calculate hash code according to all attributes.
99
+ def hash
100
+ [external_content_id, url_post, file_path, content_length, content_type].hash
101
+ end
102
+
103
+ # build the object from hash
104
+ def build_from_hash(attributes)
105
+ return nil unless attributes.is_a?(Hash)
106
+ self.class.swagger_types.each_pair do |key, type|
107
+ if type =~ /^Array<(.*)>/i
108
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
109
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
110
+ else
111
+ #TODO show warning in debug mode
112
+ end
113
+ elsif !attributes[self.class.attribute_map[key]].nil?
114
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
115
+ else
116
+ # data not found in attributes(hash), not an issue as the data can be optional
117
+ end
118
+ end
119
+
120
+ self
121
+ end
122
+
123
+ def _deserialize(type, value)
124
+ case type.to_sym
125
+ when :DateTime
126
+ DateTime.parse(value)
127
+ when :Date
128
+ Date.parse(value)
129
+ when :String
130
+ value.to_s
131
+ when :Integer
132
+ value.to_i
133
+ when :Float
134
+ value.to_f
135
+ when :BOOLEAN
136
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
137
+ true
138
+ else
139
+ false
140
+ end
141
+ when :Object
142
+ # generic object (usually a Hash), return directly
143
+ value
144
+ when /\AArray<(?<inner_type>.+)>\z/
145
+ inner_type = Regexp.last_match[:inner_type]
146
+ value.map { |v| _deserialize(inner_type, v) }
147
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
148
+ k_type = Regexp.last_match[:k_type]
149
+ v_type = Regexp.last_match[:v_type]
150
+ {}.tap do |hash|
151
+ value.each do |k, v|
152
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
153
+ end
154
+ end
155
+ else # model
156
+ _model = VeriCiteClient.const_get(type).new
157
+ _model.build_from_hash(value)
158
+ end
159
+ end
160
+
161
+ def to_s
162
+ to_hash.to_s
163
+ end
164
+
165
+ # to_body is an alias to to_body (backward compatibility))
166
+ def to_body
167
+ to_hash
168
+ end
169
+
170
+ # return the object in the form of hash
171
+ def to_hash
172
+ hash = {}
173
+ self.class.attribute_map.each_pair do |attr, param|
174
+ value = self.send(attr)
175
+ next if value.nil?
176
+ hash[param] = _to_hash(value)
177
+ end
178
+ hash
179
+ end
180
+
181
+ # Method to output non-array value in the form of hash
182
+ # For object, use to_hash. Otherwise, just return the value
183
+ def _to_hash(value)
184
+ if value.is_a?(Array)
185
+ value.compact.map{ |v| _to_hash(v) }
186
+ elsif value.is_a?(Hash)
187
+ {}.tap do |hash|
188
+ value.each { |k, v| hash[k] = _to_hash(v) }
189
+ end
190
+ elsif value.respond_to? :to_hash
191
+ value.to_hash
192
+ else
193
+ value
194
+ end
195
+ end
196
+
197
+ end
198
+ end