ddr_client 2.0.0.d9f2bd2b
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +7 -0
- data/README.md +168 -0
- data/Rakefile +8 -0
- data/ddr_client.gemspec +46 -0
- data/docs/BatchObjectsApi.md +125 -0
- data/docs/BatchesApi.md +305 -0
- data/docs/DdrAPIBatchEntity.md +24 -0
- data/docs/DdrAPIBatchEntityLogfile.md +11 -0
- data/docs/DdrAPIBatchObjectAttributeEntity.md +16 -0
- data/docs/DdrAPIBatchObjectDatastreamEntity.md +17 -0
- data/docs/DdrAPIBatchObjectEntity.md +26 -0
- data/docs/DdrAPIBatchObjectMessageEntity.md +13 -0
- data/docs/DdrAPIBatchObjectRelationshipEntity.md +15 -0
- data/docs/DdrAPIBatchObjectRoleEntity.md +15 -0
- data/docs/DdrAPIEventEntity.md +17 -0
- data/docs/DdrAPIFileEntity.md +11 -0
- data/docs/DdrAPIGroupEntity.md +10 -0
- data/docs/DdrAPIGroupMemberEntity.md +10 -0
- data/docs/DdrAPILinkEntity.md +9 -0
- data/docs/DdrAPIResourceEntity.md +17 -0
- data/docs/DdrAPIResourceEntityFiles.md +17 -0
- data/docs/DdrAPIResourceEntityMetadata.md +62 -0
- data/docs/DdrAPIResourceEntityRelated.md +11 -0
- data/docs/DdrAPIRoleEntity.md +10 -0
- data/docs/DdrAPITechnicalMetadataEntity.md +24 -0
- data/docs/DdrAPIUserEntity.md +19 -0
- data/docs/EventsApi.md +131 -0
- data/docs/GroupsApi.md +63 -0
- data/docs/IndexApi.md +161 -0
- data/docs/PatchResources.md +11 -0
- data/docs/PatchResourcesMetadata.md +62 -0
- data/docs/PatchResourcesRelated.md +11 -0
- data/docs/PatchResourcesRoles.md +10 -0
- data/docs/PostResources.md +12 -0
- data/docs/QueuesApi.md +102 -0
- data/docs/ReportsApi.md +177 -0
- data/docs/ResourcesApi.md +1003 -0
- data/docs/SchemaApi.md +128 -0
- data/docs/UsersApi.md +131 -0
- data/git_push.sh +55 -0
- data/lib/ddr_client/api/batch_objects_api.rb +138 -0
- data/lib/ddr_client/api/batches_api.rb +306 -0
- data/lib/ddr_client/api/events_api.rb +147 -0
- data/lib/ddr_client/api/groups_api.rb +70 -0
- data/lib/ddr_client/api/index_api.rb +164 -0
- data/lib/ddr_client/api/queues_api.rb +109 -0
- data/lib/ddr_client/api/reports_api.rb +179 -0
- data/lib/ddr_client/api/resources_api.rb +1098 -0
- data/lib/ddr_client/api/schema_api.rb +152 -0
- data/lib/ddr_client/api/users_api.rb +141 -0
- data/lib/ddr_client/api_client.rb +391 -0
- data/lib/ddr_client/api_error.rb +38 -0
- data/lib/ddr_client/configuration.rb +209 -0
- data/lib/ddr_client/models/ddr_api_batch_entity.rb +333 -0
- data/lib/ddr_client/models/ddr_api_batch_entity_logfile.rb +211 -0
- data/lib/ddr_client/models/ddr_api_batch_object_attribute_entity.rb +256 -0
- data/lib/ddr_client/models/ddr_api_batch_object_datastream_entity.rb +265 -0
- data/lib/ddr_client/models/ddr_api_batch_object_entity.rb +349 -0
- data/lib/ddr_client/models/ddr_api_batch_object_message_entity.rb +230 -0
- data/lib/ddr_client/models/ddr_api_batch_object_relationship_entity.rb +247 -0
- data/lib/ddr_client/models/ddr_api_batch_object_role_entity.rb +247 -0
- data/lib/ddr_client/models/ddr_api_event_entity.rb +325 -0
- data/lib/ddr_client/models/ddr_api_file_entity.rb +215 -0
- data/lib/ddr_client/models/ddr_api_group_entity.rb +203 -0
- data/lib/ddr_client/models/ddr_api_group_member_entity.rb +202 -0
- data/lib/ddr_client/models/ddr_api_link_entity.rb +193 -0
- data/lib/ddr_client/models/ddr_api_resource_entity.rb +310 -0
- data/lib/ddr_client/models/ddr_api_resource_entity_files.rb +276 -0
- data/lib/ddr_client/models/ddr_api_resource_entity_metadata.rb +874 -0
- data/lib/ddr_client/models/ddr_api_resource_entity_related.rb +216 -0
- data/lib/ddr_client/models/ddr_api_role_entity.rb +251 -0
- data/lib/ddr_client/models/ddr_api_technical_metadata_entity.rb +329 -0
- data/lib/ddr_client/models/ddr_api_user_entity.rb +296 -0
- data/lib/ddr_client/models/patch_resources.rb +221 -0
- data/lib/ddr_client/models/patch_resources_metadata.rb +726 -0
- data/lib/ddr_client/models/patch_resources_related.rb +216 -0
- data/lib/ddr_client/models/patch_resources_roles.rb +220 -0
- data/lib/ddr_client/models/post_resources.rb +265 -0
- data/lib/ddr_client/version.rb +15 -0
- data/lib/ddr_client.rb +74 -0
- data/spec/api/batch_objects_api_spec.rb +61 -0
- data/spec/api/batches_api_spec.rb +100 -0
- data/spec/api/events_api_spec.rb +64 -0
- data/spec/api/groups_api_spec.rb +46 -0
- data/spec/api/index_api_spec.rb +67 -0
- data/spec/api/queues_api_spec.rb +55 -0
- data/spec/api/reports_api_spec.rb +70 -0
- data/spec/api/resources_api_spec.rb +271 -0
- data/spec/api/schema_api_spec.rb +65 -0
- data/spec/api/users_api_spec.rb +64 -0
- data/spec/api_client_spec.rb +243 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/ddr_api_batch_entity_logfile_spec.rb +59 -0
- data/spec/models/ddr_api_batch_entity_spec.rb +137 -0
- data/spec/models/ddr_api_batch_object_attribute_entity_spec.rb +89 -0
- data/spec/models/ddr_api_batch_object_datastream_entity_spec.rb +95 -0
- data/spec/models/ddr_api_batch_object_entity_spec.rb +149 -0
- data/spec/models/ddr_api_batch_object_message_entity_spec.rb +71 -0
- data/spec/models/ddr_api_batch_object_relationship_entity_spec.rb +83 -0
- data/spec/models/ddr_api_batch_object_role_entity_spec.rb +83 -0
- data/spec/models/ddr_api_event_entity_spec.rb +103 -0
- data/spec/models/ddr_api_file_entity_spec.rb +59 -0
- data/spec/models/ddr_api_group_entity_spec.rb +53 -0
- data/spec/models/ddr_api_group_member_entity_spec.rb +53 -0
- data/spec/models/ddr_api_link_entity_spec.rb +47 -0
- data/spec/models/ddr_api_resource_entity_files_spec.rb +95 -0
- data/spec/models/ddr_api_resource_entity_metadata_spec.rb +389 -0
- data/spec/models/ddr_api_resource_entity_related_spec.rb +59 -0
- data/spec/models/ddr_api_resource_entity_spec.rb +99 -0
- data/spec/models/ddr_api_role_entity_spec.rb +61 -0
- data/spec/models/ddr_api_technical_metadata_entity_spec.rb +137 -0
- data/spec/models/ddr_api_user_entity_spec.rb +107 -0
- data/spec/models/patch_resources_metadata_spec.rb +365 -0
- data/spec/models/patch_resources_related_spec.rb +59 -0
- data/spec/models/patch_resources_roles_spec.rb +53 -0
- data/spec/models/patch_resources_spec.rb +59 -0
- data/spec/models/post_resources_spec.rb +69 -0
- data/spec/spec_helper.rb +111 -0
- metadata +399 -0
@@ -0,0 +1,265 @@
|
|
1
|
+
=begin
|
2
|
+
#Duke Digital Repository API
|
3
|
+
|
4
|
+
#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
5
|
+
|
6
|
+
OpenAPI spec version: v1
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.4.36
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module DdrClient
|
16
|
+
class DdrAPIBatchObjectDatastreamEntity
|
17
|
+
attr_accessor :id
|
18
|
+
|
19
|
+
attr_accessor :batch_object_id
|
20
|
+
|
21
|
+
attr_accessor :operation
|
22
|
+
|
23
|
+
attr_accessor :name
|
24
|
+
|
25
|
+
attr_accessor :payload
|
26
|
+
|
27
|
+
attr_accessor :payload_type
|
28
|
+
|
29
|
+
attr_accessor :created_at
|
30
|
+
|
31
|
+
attr_accessor :updated_at
|
32
|
+
|
33
|
+
attr_accessor :checksum
|
34
|
+
|
35
|
+
attr_accessor :checksum_type
|
36
|
+
|
37
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
38
|
+
def self.attribute_map
|
39
|
+
{
|
40
|
+
:'id' => :'id',
|
41
|
+
:'batch_object_id' => :'batch_object_id',
|
42
|
+
:'operation' => :'operation',
|
43
|
+
:'name' => :'name',
|
44
|
+
:'payload' => :'payload',
|
45
|
+
:'payload_type' => :'payload_type',
|
46
|
+
:'created_at' => :'created_at',
|
47
|
+
:'updated_at' => :'updated_at',
|
48
|
+
:'checksum' => :'checksum',
|
49
|
+
:'checksum_type' => :'checksum_type'
|
50
|
+
}
|
51
|
+
end
|
52
|
+
|
53
|
+
# Attribute type mapping.
|
54
|
+
def self.swagger_types
|
55
|
+
{
|
56
|
+
:'id' => :'String',
|
57
|
+
:'batch_object_id' => :'String',
|
58
|
+
:'operation' => :'String',
|
59
|
+
:'name' => :'String',
|
60
|
+
:'payload' => :'String',
|
61
|
+
:'payload_type' => :'String',
|
62
|
+
:'created_at' => :'String',
|
63
|
+
:'updated_at' => :'String',
|
64
|
+
:'checksum' => :'String',
|
65
|
+
:'checksum_type' => :'String'
|
66
|
+
}
|
67
|
+
end
|
68
|
+
|
69
|
+
# Initializes the object
|
70
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
71
|
+
def initialize(attributes = {})
|
72
|
+
return unless attributes.is_a?(Hash)
|
73
|
+
|
74
|
+
# convert string to symbol for hash key
|
75
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
76
|
+
|
77
|
+
if attributes.has_key?(:'id')
|
78
|
+
self.id = attributes[:'id']
|
79
|
+
end
|
80
|
+
|
81
|
+
if attributes.has_key?(:'batch_object_id')
|
82
|
+
self.batch_object_id = attributes[:'batch_object_id']
|
83
|
+
end
|
84
|
+
|
85
|
+
if attributes.has_key?(:'operation')
|
86
|
+
self.operation = attributes[:'operation']
|
87
|
+
end
|
88
|
+
|
89
|
+
if attributes.has_key?(:'name')
|
90
|
+
self.name = attributes[:'name']
|
91
|
+
end
|
92
|
+
|
93
|
+
if attributes.has_key?(:'payload')
|
94
|
+
self.payload = attributes[:'payload']
|
95
|
+
end
|
96
|
+
|
97
|
+
if attributes.has_key?(:'payload_type')
|
98
|
+
self.payload_type = attributes[:'payload_type']
|
99
|
+
end
|
100
|
+
|
101
|
+
if attributes.has_key?(:'created_at')
|
102
|
+
self.created_at = attributes[:'created_at']
|
103
|
+
end
|
104
|
+
|
105
|
+
if attributes.has_key?(:'updated_at')
|
106
|
+
self.updated_at = attributes[:'updated_at']
|
107
|
+
end
|
108
|
+
|
109
|
+
if attributes.has_key?(:'checksum')
|
110
|
+
self.checksum = attributes[:'checksum']
|
111
|
+
end
|
112
|
+
|
113
|
+
if attributes.has_key?(:'checksum_type')
|
114
|
+
self.checksum_type = attributes[:'checksum_type']
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
118
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
119
|
+
# @return Array for valid properties with the reasons
|
120
|
+
def list_invalid_properties
|
121
|
+
invalid_properties = Array.new
|
122
|
+
invalid_properties
|
123
|
+
end
|
124
|
+
|
125
|
+
# Check to see if the all the properties in the model are valid
|
126
|
+
# @return true if the model is valid
|
127
|
+
def valid?
|
128
|
+
true
|
129
|
+
end
|
130
|
+
|
131
|
+
# Checks equality by comparing each attribute.
|
132
|
+
# @param [Object] Object to be compared
|
133
|
+
def ==(o)
|
134
|
+
return true if self.equal?(o)
|
135
|
+
self.class == o.class &&
|
136
|
+
id == o.id &&
|
137
|
+
batch_object_id == o.batch_object_id &&
|
138
|
+
operation == o.operation &&
|
139
|
+
name == o.name &&
|
140
|
+
payload == o.payload &&
|
141
|
+
payload_type == o.payload_type &&
|
142
|
+
created_at == o.created_at &&
|
143
|
+
updated_at == o.updated_at &&
|
144
|
+
checksum == o.checksum &&
|
145
|
+
checksum_type == o.checksum_type
|
146
|
+
end
|
147
|
+
|
148
|
+
# @see the `==` method
|
149
|
+
# @param [Object] Object to be compared
|
150
|
+
def eql?(o)
|
151
|
+
self == o
|
152
|
+
end
|
153
|
+
|
154
|
+
# Calculates hash code according to all attributes.
|
155
|
+
# @return [Fixnum] Hash code
|
156
|
+
def hash
|
157
|
+
[id, batch_object_id, operation, name, payload, payload_type, created_at, updated_at, checksum, checksum_type].hash
|
158
|
+
end
|
159
|
+
|
160
|
+
# Builds the object from hash
|
161
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
162
|
+
# @return [Object] Returns the model itself
|
163
|
+
def build_from_hash(attributes)
|
164
|
+
return nil unless attributes.is_a?(Hash)
|
165
|
+
self.class.swagger_types.each_pair do |key, type|
|
166
|
+
if type =~ /\AArray<(.*)>/i
|
167
|
+
# check to ensure the input is an array given that the attribute
|
168
|
+
# is documented as an array but the input is not
|
169
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
170
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
171
|
+
end
|
172
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
173
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
174
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
175
|
+
end
|
176
|
+
|
177
|
+
self
|
178
|
+
end
|
179
|
+
|
180
|
+
# Deserializes the data based on type
|
181
|
+
# @param string type Data type
|
182
|
+
# @param string value Value to be deserialized
|
183
|
+
# @return [Object] Deserialized data
|
184
|
+
def _deserialize(type, value)
|
185
|
+
case type.to_sym
|
186
|
+
when :DateTime
|
187
|
+
DateTime.parse(value)
|
188
|
+
when :Date
|
189
|
+
Date.parse(value)
|
190
|
+
when :String
|
191
|
+
value.to_s
|
192
|
+
when :Integer
|
193
|
+
value.to_i
|
194
|
+
when :Float
|
195
|
+
value.to_f
|
196
|
+
when :BOOLEAN
|
197
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
198
|
+
true
|
199
|
+
else
|
200
|
+
false
|
201
|
+
end
|
202
|
+
when :Object
|
203
|
+
# generic object (usually a Hash), return directly
|
204
|
+
value
|
205
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
206
|
+
inner_type = Regexp.last_match[:inner_type]
|
207
|
+
value.map { |v| _deserialize(inner_type, v) }
|
208
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
209
|
+
k_type = Regexp.last_match[:k_type]
|
210
|
+
v_type = Regexp.last_match[:v_type]
|
211
|
+
{}.tap do |hash|
|
212
|
+
value.each do |k, v|
|
213
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
214
|
+
end
|
215
|
+
end
|
216
|
+
else # model
|
217
|
+
temp_model = DdrClient.const_get(type).new
|
218
|
+
temp_model.build_from_hash(value)
|
219
|
+
end
|
220
|
+
end
|
221
|
+
|
222
|
+
# Returns the string representation of the object
|
223
|
+
# @return [String] String presentation of the object
|
224
|
+
def to_s
|
225
|
+
to_hash.to_s
|
226
|
+
end
|
227
|
+
|
228
|
+
# to_body is an alias to to_hash (backward compatibility)
|
229
|
+
# @return [Hash] Returns the object in the form of hash
|
230
|
+
def to_body
|
231
|
+
to_hash
|
232
|
+
end
|
233
|
+
|
234
|
+
# Returns the object in the form of hash
|
235
|
+
# @return [Hash] Returns the object in the form of hash
|
236
|
+
def to_hash
|
237
|
+
hash = {}
|
238
|
+
self.class.attribute_map.each_pair do |attr, param|
|
239
|
+
value = self.send(attr)
|
240
|
+
next if value.nil?
|
241
|
+
hash[param] = _to_hash(value)
|
242
|
+
end
|
243
|
+
hash
|
244
|
+
end
|
245
|
+
|
246
|
+
# Outputs non-array value in the form of hash
|
247
|
+
# For object, use to_hash. Otherwise, just return the value
|
248
|
+
# @param [Object] value Any valid value
|
249
|
+
# @return [Hash] Returns the value in the form of hash
|
250
|
+
def _to_hash(value)
|
251
|
+
if value.is_a?(Array)
|
252
|
+
value.compact.map { |v| _to_hash(v) }
|
253
|
+
elsif value.is_a?(Hash)
|
254
|
+
{}.tap do |hash|
|
255
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
256
|
+
end
|
257
|
+
elsif value.respond_to? :to_hash
|
258
|
+
value.to_hash
|
259
|
+
else
|
260
|
+
value
|
261
|
+
end
|
262
|
+
end
|
263
|
+
|
264
|
+
end
|
265
|
+
end
|
@@ -0,0 +1,349 @@
|
|
1
|
+
=begin
|
2
|
+
#Duke Digital Repository API
|
3
|
+
|
4
|
+
#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
5
|
+
|
6
|
+
OpenAPI spec version: v1
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.4.36
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module DdrClient
|
16
|
+
# Ddr_API_BatchObjectEntity model
|
17
|
+
class DdrAPIBatchObjectEntity
|
18
|
+
attr_accessor :id
|
19
|
+
|
20
|
+
attr_accessor :batch_id
|
21
|
+
|
22
|
+
attr_accessor :identifier
|
23
|
+
|
24
|
+
attr_accessor :model
|
25
|
+
|
26
|
+
attr_accessor :label
|
27
|
+
|
28
|
+
attr_accessor :resource_id
|
29
|
+
|
30
|
+
attr_accessor :created_at
|
31
|
+
|
32
|
+
attr_accessor :updated_at
|
33
|
+
|
34
|
+
attr_accessor :type
|
35
|
+
|
36
|
+
attr_accessor :verified
|
37
|
+
|
38
|
+
attr_accessor :handled
|
39
|
+
|
40
|
+
attr_accessor :processed
|
41
|
+
|
42
|
+
attr_accessor :validated
|
43
|
+
|
44
|
+
attr_accessor :attributes
|
45
|
+
|
46
|
+
attr_accessor :files
|
47
|
+
|
48
|
+
attr_accessor :messages
|
49
|
+
|
50
|
+
attr_accessor :relationships
|
51
|
+
|
52
|
+
attr_accessor :roles
|
53
|
+
|
54
|
+
attr_accessor :links
|
55
|
+
|
56
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
57
|
+
def self.attribute_map
|
58
|
+
{
|
59
|
+
:'id' => :'id',
|
60
|
+
:'batch_id' => :'batch_id',
|
61
|
+
:'identifier' => :'identifier',
|
62
|
+
:'model' => :'model',
|
63
|
+
:'label' => :'label',
|
64
|
+
:'resource_id' => :'resource_id',
|
65
|
+
:'created_at' => :'created_at',
|
66
|
+
:'updated_at' => :'updated_at',
|
67
|
+
:'type' => :'type',
|
68
|
+
:'verified' => :'verified',
|
69
|
+
:'handled' => :'handled',
|
70
|
+
:'processed' => :'processed',
|
71
|
+
:'validated' => :'validated',
|
72
|
+
:'attributes' => :'attributes',
|
73
|
+
:'files' => :'files',
|
74
|
+
:'messages' => :'messages',
|
75
|
+
:'relationships' => :'relationships',
|
76
|
+
:'roles' => :'roles',
|
77
|
+
:'links' => :'links'
|
78
|
+
}
|
79
|
+
end
|
80
|
+
|
81
|
+
# Attribute type mapping.
|
82
|
+
def self.swagger_types
|
83
|
+
{
|
84
|
+
:'id' => :'String',
|
85
|
+
:'batch_id' => :'String',
|
86
|
+
:'identifier' => :'String',
|
87
|
+
:'model' => :'String',
|
88
|
+
:'label' => :'String',
|
89
|
+
:'resource_id' => :'String',
|
90
|
+
:'created_at' => :'String',
|
91
|
+
:'updated_at' => :'String',
|
92
|
+
:'type' => :'String',
|
93
|
+
:'verified' => :'String',
|
94
|
+
:'handled' => :'String',
|
95
|
+
:'processed' => :'String',
|
96
|
+
:'validated' => :'String',
|
97
|
+
:'attributes' => :'DdrAPIBatchObjectAttributeEntity',
|
98
|
+
:'files' => :'DdrAPIBatchObjectDatastreamEntity',
|
99
|
+
:'messages' => :'DdrAPIBatchObjectMessageEntity',
|
100
|
+
:'relationships' => :'DdrAPIBatchObjectRelationshipEntity',
|
101
|
+
:'roles' => :'DdrAPIBatchObjectRoleEntity',
|
102
|
+
:'links' => :'Array<DdrAPILinkEntity>'
|
103
|
+
}
|
104
|
+
end
|
105
|
+
|
106
|
+
# Initializes the object
|
107
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
108
|
+
def initialize(attributes = {})
|
109
|
+
return unless attributes.is_a?(Hash)
|
110
|
+
|
111
|
+
# convert string to symbol for hash key
|
112
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
113
|
+
|
114
|
+
if attributes.has_key?(:'id')
|
115
|
+
self.id = attributes[:'id']
|
116
|
+
end
|
117
|
+
|
118
|
+
if attributes.has_key?(:'batch_id')
|
119
|
+
self.batch_id = attributes[:'batch_id']
|
120
|
+
end
|
121
|
+
|
122
|
+
if attributes.has_key?(:'identifier')
|
123
|
+
self.identifier = attributes[:'identifier']
|
124
|
+
end
|
125
|
+
|
126
|
+
if attributes.has_key?(:'model')
|
127
|
+
self.model = attributes[:'model']
|
128
|
+
end
|
129
|
+
|
130
|
+
if attributes.has_key?(:'label')
|
131
|
+
self.label = attributes[:'label']
|
132
|
+
end
|
133
|
+
|
134
|
+
if attributes.has_key?(:'resource_id')
|
135
|
+
self.resource_id = attributes[:'resource_id']
|
136
|
+
end
|
137
|
+
|
138
|
+
if attributes.has_key?(:'created_at')
|
139
|
+
self.created_at = attributes[:'created_at']
|
140
|
+
end
|
141
|
+
|
142
|
+
if attributes.has_key?(:'updated_at')
|
143
|
+
self.updated_at = attributes[:'updated_at']
|
144
|
+
end
|
145
|
+
|
146
|
+
if attributes.has_key?(:'type')
|
147
|
+
self.type = attributes[:'type']
|
148
|
+
end
|
149
|
+
|
150
|
+
if attributes.has_key?(:'verified')
|
151
|
+
self.verified = attributes[:'verified']
|
152
|
+
end
|
153
|
+
|
154
|
+
if attributes.has_key?(:'handled')
|
155
|
+
self.handled = attributes[:'handled']
|
156
|
+
end
|
157
|
+
|
158
|
+
if attributes.has_key?(:'processed')
|
159
|
+
self.processed = attributes[:'processed']
|
160
|
+
end
|
161
|
+
|
162
|
+
if attributes.has_key?(:'validated')
|
163
|
+
self.validated = attributes[:'validated']
|
164
|
+
end
|
165
|
+
|
166
|
+
if attributes.has_key?(:'attributes')
|
167
|
+
self.attributes = attributes[:'attributes']
|
168
|
+
end
|
169
|
+
|
170
|
+
if attributes.has_key?(:'files')
|
171
|
+
self.files = attributes[:'files']
|
172
|
+
end
|
173
|
+
|
174
|
+
if attributes.has_key?(:'messages')
|
175
|
+
self.messages = attributes[:'messages']
|
176
|
+
end
|
177
|
+
|
178
|
+
if attributes.has_key?(:'relationships')
|
179
|
+
self.relationships = attributes[:'relationships']
|
180
|
+
end
|
181
|
+
|
182
|
+
if attributes.has_key?(:'roles')
|
183
|
+
self.roles = attributes[:'roles']
|
184
|
+
end
|
185
|
+
|
186
|
+
if attributes.has_key?(:'links')
|
187
|
+
if (value = attributes[:'links']).is_a?(Array)
|
188
|
+
self.links = value
|
189
|
+
end
|
190
|
+
end
|
191
|
+
end
|
192
|
+
|
193
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
194
|
+
# @return Array for valid properties with the reasons
|
195
|
+
def list_invalid_properties
|
196
|
+
invalid_properties = Array.new
|
197
|
+
invalid_properties
|
198
|
+
end
|
199
|
+
|
200
|
+
# Check to see if the all the properties in the model are valid
|
201
|
+
# @return true if the model is valid
|
202
|
+
def valid?
|
203
|
+
true
|
204
|
+
end
|
205
|
+
|
206
|
+
# Checks equality by comparing each attribute.
|
207
|
+
# @param [Object] Object to be compared
|
208
|
+
def ==(o)
|
209
|
+
return true if self.equal?(o)
|
210
|
+
self.class == o.class &&
|
211
|
+
id == o.id &&
|
212
|
+
batch_id == o.batch_id &&
|
213
|
+
identifier == o.identifier &&
|
214
|
+
model == o.model &&
|
215
|
+
label == o.label &&
|
216
|
+
resource_id == o.resource_id &&
|
217
|
+
created_at == o.created_at &&
|
218
|
+
updated_at == o.updated_at &&
|
219
|
+
type == o.type &&
|
220
|
+
verified == o.verified &&
|
221
|
+
handled == o.handled &&
|
222
|
+
processed == o.processed &&
|
223
|
+
validated == o.validated &&
|
224
|
+
attributes == o.attributes &&
|
225
|
+
files == o.files &&
|
226
|
+
messages == o.messages &&
|
227
|
+
relationships == o.relationships &&
|
228
|
+
roles == o.roles &&
|
229
|
+
links == o.links
|
230
|
+
end
|
231
|
+
|
232
|
+
# @see the `==` method
|
233
|
+
# @param [Object] Object to be compared
|
234
|
+
def eql?(o)
|
235
|
+
self == o
|
236
|
+
end
|
237
|
+
|
238
|
+
# Calculates hash code according to all attributes.
|
239
|
+
# @return [Fixnum] Hash code
|
240
|
+
def hash
|
241
|
+
[id, batch_id, identifier, model, label, resource_id, created_at, updated_at, type, verified, handled, processed, validated, attributes, files, messages, relationships, roles, links].hash
|
242
|
+
end
|
243
|
+
|
244
|
+
# Builds the object from hash
|
245
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
246
|
+
# @return [Object] Returns the model itself
|
247
|
+
def build_from_hash(attributes)
|
248
|
+
return nil unless attributes.is_a?(Hash)
|
249
|
+
self.class.swagger_types.each_pair do |key, type|
|
250
|
+
if type =~ /\AArray<(.*)>/i
|
251
|
+
# check to ensure the input is an array given that the attribute
|
252
|
+
# is documented as an array but the input is not
|
253
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
254
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
255
|
+
end
|
256
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
257
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
258
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
259
|
+
end
|
260
|
+
|
261
|
+
self
|
262
|
+
end
|
263
|
+
|
264
|
+
# Deserializes the data based on type
|
265
|
+
# @param string type Data type
|
266
|
+
# @param string value Value to be deserialized
|
267
|
+
# @return [Object] Deserialized data
|
268
|
+
def _deserialize(type, value)
|
269
|
+
case type.to_sym
|
270
|
+
when :DateTime
|
271
|
+
DateTime.parse(value)
|
272
|
+
when :Date
|
273
|
+
Date.parse(value)
|
274
|
+
when :String
|
275
|
+
value.to_s
|
276
|
+
when :Integer
|
277
|
+
value.to_i
|
278
|
+
when :Float
|
279
|
+
value.to_f
|
280
|
+
when :BOOLEAN
|
281
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
282
|
+
true
|
283
|
+
else
|
284
|
+
false
|
285
|
+
end
|
286
|
+
when :Object
|
287
|
+
# generic object (usually a Hash), return directly
|
288
|
+
value
|
289
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
290
|
+
inner_type = Regexp.last_match[:inner_type]
|
291
|
+
value.map { |v| _deserialize(inner_type, v) }
|
292
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
293
|
+
k_type = Regexp.last_match[:k_type]
|
294
|
+
v_type = Regexp.last_match[:v_type]
|
295
|
+
{}.tap do |hash|
|
296
|
+
value.each do |k, v|
|
297
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
298
|
+
end
|
299
|
+
end
|
300
|
+
else # model
|
301
|
+
temp_model = DdrClient.const_get(type).new
|
302
|
+
temp_model.build_from_hash(value)
|
303
|
+
end
|
304
|
+
end
|
305
|
+
|
306
|
+
# Returns the string representation of the object
|
307
|
+
# @return [String] String presentation of the object
|
308
|
+
def to_s
|
309
|
+
to_hash.to_s
|
310
|
+
end
|
311
|
+
|
312
|
+
# to_body is an alias to to_hash (backward compatibility)
|
313
|
+
# @return [Hash] Returns the object in the form of hash
|
314
|
+
def to_body
|
315
|
+
to_hash
|
316
|
+
end
|
317
|
+
|
318
|
+
# Returns the object in the form of hash
|
319
|
+
# @return [Hash] Returns the object in the form of hash
|
320
|
+
def to_hash
|
321
|
+
hash = {}
|
322
|
+
self.class.attribute_map.each_pair do |attr, param|
|
323
|
+
value = self.send(attr)
|
324
|
+
next if value.nil?
|
325
|
+
hash[param] = _to_hash(value)
|
326
|
+
end
|
327
|
+
hash
|
328
|
+
end
|
329
|
+
|
330
|
+
# Outputs non-array value in the form of hash
|
331
|
+
# For object, use to_hash. Otherwise, just return the value
|
332
|
+
# @param [Object] value Any valid value
|
333
|
+
# @return [Hash] Returns the value in the form of hash
|
334
|
+
def _to_hash(value)
|
335
|
+
if value.is_a?(Array)
|
336
|
+
value.compact.map { |v| _to_hash(v) }
|
337
|
+
elsif value.is_a?(Hash)
|
338
|
+
{}.tap do |hash|
|
339
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
340
|
+
end
|
341
|
+
elsif value.respond_to? :to_hash
|
342
|
+
value.to_hash
|
343
|
+
else
|
344
|
+
value
|
345
|
+
end
|
346
|
+
end
|
347
|
+
|
348
|
+
end
|
349
|
+
end
|