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,874 @@
|
|
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
|
+
# Please refer to the [DDR Metadata Application Profile](https://duldev.atlassian.net/wiki/spaces/DDRDOC/pages/183730270/DDR+Metadata+Application+Profile) documentation for more detailed descriptive and local usage information. Properties taken from the [DCMI Metadata Terms](http://purl.org/dc/terms) vocabulary provide URIs in lieu of textual descriptions.
|
17
|
+
class DdrAPIResourceEntityMetadata
|
18
|
+
# http://purl.org/dc/terms/abstract
|
19
|
+
attr_accessor :abstract
|
20
|
+
|
21
|
+
# http://purl.org/dc/terms/accessRights
|
22
|
+
attr_accessor :access_rights
|
23
|
+
|
24
|
+
# http://purl.org/dc/terms/alternative
|
25
|
+
attr_accessor :alternative
|
26
|
+
|
27
|
+
# http://purl.org/dc/terms/available
|
28
|
+
attr_accessor :available
|
29
|
+
|
30
|
+
# http://purl.org/dc/terms/contributor
|
31
|
+
attr_accessor :contributor
|
32
|
+
|
33
|
+
# http://purl.org/dc/terms/creator
|
34
|
+
attr_accessor :creator
|
35
|
+
|
36
|
+
# http://purl.org/dc/terms/date
|
37
|
+
attr_accessor :date
|
38
|
+
|
39
|
+
# http://purl.org/dc/terms/description
|
40
|
+
attr_accessor :description
|
41
|
+
|
42
|
+
# http://purl.org/dc/terms/extent
|
43
|
+
attr_accessor :extent
|
44
|
+
|
45
|
+
# http://purl.org/dc/terms/format
|
46
|
+
attr_accessor :format
|
47
|
+
|
48
|
+
# http://purl.org/dc/terms/hasPart
|
49
|
+
attr_accessor :has_part
|
50
|
+
|
51
|
+
# http://purl.org/dc/terms/identifier
|
52
|
+
attr_accessor :identifier
|
53
|
+
|
54
|
+
# http://purl.org/dc/terms/isFormatOf
|
55
|
+
attr_accessor :is_format_of
|
56
|
+
|
57
|
+
# http://purl.org/dc/terms/isPartOf
|
58
|
+
attr_accessor :is_part_of
|
59
|
+
|
60
|
+
# http://purl.org/dc/terms/language
|
61
|
+
attr_accessor :language
|
62
|
+
|
63
|
+
# http://purl.org/dc/terms/medium
|
64
|
+
attr_accessor :medium
|
65
|
+
|
66
|
+
# http://purl.org/dc/terms/provenance
|
67
|
+
attr_accessor :provenance
|
68
|
+
|
69
|
+
# http://purl.org/dc/terms/publisher
|
70
|
+
attr_accessor :publisher
|
71
|
+
|
72
|
+
# http://purl.org/dc/terms/relation
|
73
|
+
attr_accessor :relation
|
74
|
+
|
75
|
+
# http://purl.org/dc/terms/rights
|
76
|
+
attr_accessor :rights
|
77
|
+
|
78
|
+
# http://purl.org/dc/terms/spatial
|
79
|
+
attr_accessor :spatial
|
80
|
+
|
81
|
+
# http://purl.org/dc/terms/subject
|
82
|
+
attr_accessor :subject
|
83
|
+
|
84
|
+
# http://purl.org/dc/terms/title
|
85
|
+
attr_accessor :title
|
86
|
+
|
87
|
+
# http://purl.org/dc/terms/type
|
88
|
+
attr_accessor :type
|
89
|
+
|
90
|
+
# Administrative group to which the collection belongs
|
91
|
+
attr_accessor :admin_set
|
92
|
+
|
93
|
+
# Aleph identifier
|
94
|
+
attr_accessor :aleph_id
|
95
|
+
|
96
|
+
# ArchivesSpace identifier
|
97
|
+
attr_accessor :aspace_id
|
98
|
+
|
99
|
+
# CONTENTdm identifier (deprecated)
|
100
|
+
attr_accessor :contentdm_id
|
101
|
+
|
102
|
+
# Display Format
|
103
|
+
attr_accessor :display_format
|
104
|
+
|
105
|
+
# Digital Object Identifier (doi.org)
|
106
|
+
attr_accessor :doi
|
107
|
+
|
108
|
+
# Source collection identifier
|
109
|
+
attr_accessor :ead_id
|
110
|
+
|
111
|
+
# Resource ID from defunct Fedora 3 repository
|
112
|
+
attr_accessor :fcrepo3_pid
|
113
|
+
|
114
|
+
# Person or entity responsible for ingest
|
115
|
+
attr_accessor :ingested_by
|
116
|
+
|
117
|
+
# Date/time of original ingest (may differ from created_at)
|
118
|
+
attr_accessor :ingestion_date
|
119
|
+
|
120
|
+
# Digital Collections identifier
|
121
|
+
attr_accessor :local_id
|
122
|
+
|
123
|
+
# Path to original file from root ingest folder
|
124
|
+
attr_accessor :nested_path
|
125
|
+
|
126
|
+
# Permanent identifier (ARK) assigned to the resource
|
127
|
+
attr_accessor :permanent_id
|
128
|
+
|
129
|
+
# Permalink to the end-user representation of the resource.
|
130
|
+
attr_accessor :permanent_url
|
131
|
+
|
132
|
+
# Research Help Contact
|
133
|
+
attr_accessor :research_help_contact
|
134
|
+
|
135
|
+
# Rights Note
|
136
|
+
attr_accessor :rights_note
|
137
|
+
|
138
|
+
# Workflow State
|
139
|
+
attr_accessor :workflow_state
|
140
|
+
|
141
|
+
# Biblical Book
|
142
|
+
attr_accessor :biblical_book
|
143
|
+
|
144
|
+
# Category
|
145
|
+
attr_accessor :category
|
146
|
+
|
147
|
+
# Chapter And Verse
|
148
|
+
attr_accessor :chapter_and_verse
|
149
|
+
|
150
|
+
# Company
|
151
|
+
attr_accessor :company
|
152
|
+
|
153
|
+
# Headline
|
154
|
+
attr_accessor :headline
|
155
|
+
|
156
|
+
# Issue Number
|
157
|
+
attr_accessor :issue_number
|
158
|
+
|
159
|
+
# Placement Company
|
160
|
+
attr_accessor :placement_company
|
161
|
+
|
162
|
+
# Product
|
163
|
+
attr_accessor :product
|
164
|
+
|
165
|
+
# Publication
|
166
|
+
attr_accessor :publication
|
167
|
+
|
168
|
+
# Series
|
169
|
+
attr_accessor :series
|
170
|
+
|
171
|
+
# Setting
|
172
|
+
attr_accessor :setting
|
173
|
+
|
174
|
+
# Sponsor
|
175
|
+
attr_accessor :sponsor
|
176
|
+
|
177
|
+
# Tone
|
178
|
+
attr_accessor :tone
|
179
|
+
|
180
|
+
# Volume
|
181
|
+
attr_accessor :volume
|
182
|
+
|
183
|
+
class EnumAttributeValidator
|
184
|
+
attr_reader :datatype
|
185
|
+
attr_reader :allowable_values
|
186
|
+
|
187
|
+
def initialize(datatype, allowable_values)
|
188
|
+
@allowable_values = allowable_values.map do |value|
|
189
|
+
case datatype.to_s
|
190
|
+
when /Integer/i
|
191
|
+
value.to_i
|
192
|
+
when /Float/i
|
193
|
+
value.to_f
|
194
|
+
else
|
195
|
+
value
|
196
|
+
end
|
197
|
+
end
|
198
|
+
end
|
199
|
+
|
200
|
+
def valid?(value)
|
201
|
+
!value || allowable_values.include?(value)
|
202
|
+
end
|
203
|
+
end
|
204
|
+
|
205
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
206
|
+
def self.attribute_map
|
207
|
+
{
|
208
|
+
:'abstract' => :'abstract',
|
209
|
+
:'access_rights' => :'accessRights',
|
210
|
+
:'alternative' => :'alternative',
|
211
|
+
:'available' => :'available',
|
212
|
+
:'contributor' => :'contributor',
|
213
|
+
:'creator' => :'creator',
|
214
|
+
:'date' => :'date',
|
215
|
+
:'description' => :'description',
|
216
|
+
:'extent' => :'extent',
|
217
|
+
:'format' => :'format',
|
218
|
+
:'has_part' => :'hasPart',
|
219
|
+
:'identifier' => :'identifier',
|
220
|
+
:'is_format_of' => :'isFormatOf',
|
221
|
+
:'is_part_of' => :'isPartOf',
|
222
|
+
:'language' => :'language',
|
223
|
+
:'medium' => :'medium',
|
224
|
+
:'provenance' => :'provenance',
|
225
|
+
:'publisher' => :'publisher',
|
226
|
+
:'relation' => :'relation',
|
227
|
+
:'rights' => :'rights',
|
228
|
+
:'spatial' => :'spatial',
|
229
|
+
:'subject' => :'subject',
|
230
|
+
:'title' => :'title',
|
231
|
+
:'type' => :'type',
|
232
|
+
:'admin_set' => :'admin_set',
|
233
|
+
:'aleph_id' => :'aleph_id',
|
234
|
+
:'aspace_id' => :'aspace_id',
|
235
|
+
:'contentdm_id' => :'contentdm_id',
|
236
|
+
:'display_format' => :'display_format',
|
237
|
+
:'doi' => :'doi',
|
238
|
+
:'ead_id' => :'ead_id',
|
239
|
+
:'fcrepo3_pid' => :'fcrepo3_pid',
|
240
|
+
:'ingested_by' => :'ingested_by',
|
241
|
+
:'ingestion_date' => :'ingestion_date',
|
242
|
+
:'local_id' => :'local_id',
|
243
|
+
:'nested_path' => :'nested_path',
|
244
|
+
:'permanent_id' => :'permanent_id',
|
245
|
+
:'permanent_url' => :'permanent_url',
|
246
|
+
:'research_help_contact' => :'research_help_contact',
|
247
|
+
:'rights_note' => :'rights_note',
|
248
|
+
:'workflow_state' => :'workflow_state',
|
249
|
+
:'biblical_book' => :'biblical_book',
|
250
|
+
:'category' => :'category',
|
251
|
+
:'chapter_and_verse' => :'chapter_and_verse',
|
252
|
+
:'company' => :'company',
|
253
|
+
:'headline' => :'headline',
|
254
|
+
:'issue_number' => :'issue_number',
|
255
|
+
:'placement_company' => :'placement_company',
|
256
|
+
:'product' => :'product',
|
257
|
+
:'publication' => :'publication',
|
258
|
+
:'series' => :'series',
|
259
|
+
:'setting' => :'setting',
|
260
|
+
:'sponsor' => :'sponsor',
|
261
|
+
:'tone' => :'tone',
|
262
|
+
:'volume' => :'volume'
|
263
|
+
}
|
264
|
+
end
|
265
|
+
|
266
|
+
# Attribute type mapping.
|
267
|
+
def self.swagger_types
|
268
|
+
{
|
269
|
+
:'abstract' => :'Array<String>',
|
270
|
+
:'access_rights' => :'Array<String>',
|
271
|
+
:'alternative' => :'Array<String>',
|
272
|
+
:'available' => :'DateTime',
|
273
|
+
:'contributor' => :'Array<String>',
|
274
|
+
:'creator' => :'Array<String>',
|
275
|
+
:'date' => :'Array<String>',
|
276
|
+
:'description' => :'Array<String>',
|
277
|
+
:'extent' => :'Array<String>',
|
278
|
+
:'format' => :'Array<String>',
|
279
|
+
:'has_part' => :'Array<String>',
|
280
|
+
:'identifier' => :'Array<String>',
|
281
|
+
:'is_format_of' => :'Array<String>',
|
282
|
+
:'is_part_of' => :'Array<String>',
|
283
|
+
:'language' => :'Array<String>',
|
284
|
+
:'medium' => :'Array<String>',
|
285
|
+
:'provenance' => :'Array<String>',
|
286
|
+
:'publisher' => :'Array<String>',
|
287
|
+
:'relation' => :'Array<String>',
|
288
|
+
:'rights' => :'Array<String>',
|
289
|
+
:'spatial' => :'Array<String>',
|
290
|
+
:'subject' => :'Array<String>',
|
291
|
+
:'title' => :'Array<String>',
|
292
|
+
:'type' => :'Array<String>',
|
293
|
+
:'admin_set' => :'String',
|
294
|
+
:'aleph_id' => :'String',
|
295
|
+
:'aspace_id' => :'String',
|
296
|
+
:'contentdm_id' => :'String',
|
297
|
+
:'display_format' => :'String',
|
298
|
+
:'doi' => :'String',
|
299
|
+
:'ead_id' => :'String',
|
300
|
+
:'fcrepo3_pid' => :'String',
|
301
|
+
:'ingested_by' => :'String',
|
302
|
+
:'ingestion_date' => :'DateTime',
|
303
|
+
:'local_id' => :'String',
|
304
|
+
:'nested_path' => :'String',
|
305
|
+
:'permanent_id' => :'String',
|
306
|
+
:'permanent_url' => :'String',
|
307
|
+
:'research_help_contact' => :'String',
|
308
|
+
:'rights_note' => :'Array<String>',
|
309
|
+
:'workflow_state' => :'String',
|
310
|
+
:'biblical_book' => :'Array<String>',
|
311
|
+
:'category' => :'Array<String>',
|
312
|
+
:'chapter_and_verse' => :'Array<String>',
|
313
|
+
:'company' => :'Array<String>',
|
314
|
+
:'headline' => :'Array<String>',
|
315
|
+
:'issue_number' => :'Array<String>',
|
316
|
+
:'placement_company' => :'Array<String>',
|
317
|
+
:'product' => :'Array<String>',
|
318
|
+
:'publication' => :'Array<String>',
|
319
|
+
:'series' => :'Array<String>',
|
320
|
+
:'setting' => :'Array<String>',
|
321
|
+
:'sponsor' => :'Array<String>',
|
322
|
+
:'tone' => :'Array<String>',
|
323
|
+
:'volume' => :'Array<String>'
|
324
|
+
}
|
325
|
+
end
|
326
|
+
|
327
|
+
# Initializes the object
|
328
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
329
|
+
def initialize(attributes = {})
|
330
|
+
return unless attributes.is_a?(Hash)
|
331
|
+
|
332
|
+
# convert string to symbol for hash key
|
333
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
334
|
+
|
335
|
+
if attributes.has_key?(:'abstract')
|
336
|
+
if (value = attributes[:'abstract']).is_a?(Array)
|
337
|
+
self.abstract = value
|
338
|
+
end
|
339
|
+
end
|
340
|
+
|
341
|
+
if attributes.has_key?(:'accessRights')
|
342
|
+
if (value = attributes[:'accessRights']).is_a?(Array)
|
343
|
+
self.access_rights = value
|
344
|
+
end
|
345
|
+
end
|
346
|
+
|
347
|
+
if attributes.has_key?(:'alternative')
|
348
|
+
if (value = attributes[:'alternative']).is_a?(Array)
|
349
|
+
self.alternative = value
|
350
|
+
end
|
351
|
+
end
|
352
|
+
|
353
|
+
if attributes.has_key?(:'available')
|
354
|
+
self.available = attributes[:'available']
|
355
|
+
end
|
356
|
+
|
357
|
+
if attributes.has_key?(:'contributor')
|
358
|
+
if (value = attributes[:'contributor']).is_a?(Array)
|
359
|
+
self.contributor = value
|
360
|
+
end
|
361
|
+
end
|
362
|
+
|
363
|
+
if attributes.has_key?(:'creator')
|
364
|
+
if (value = attributes[:'creator']).is_a?(Array)
|
365
|
+
self.creator = value
|
366
|
+
end
|
367
|
+
end
|
368
|
+
|
369
|
+
if attributes.has_key?(:'date')
|
370
|
+
if (value = attributes[:'date']).is_a?(Array)
|
371
|
+
self.date = value
|
372
|
+
end
|
373
|
+
end
|
374
|
+
|
375
|
+
if attributes.has_key?(:'description')
|
376
|
+
if (value = attributes[:'description']).is_a?(Array)
|
377
|
+
self.description = value
|
378
|
+
end
|
379
|
+
end
|
380
|
+
|
381
|
+
if attributes.has_key?(:'extent')
|
382
|
+
if (value = attributes[:'extent']).is_a?(Array)
|
383
|
+
self.extent = value
|
384
|
+
end
|
385
|
+
end
|
386
|
+
|
387
|
+
if attributes.has_key?(:'format')
|
388
|
+
if (value = attributes[:'format']).is_a?(Array)
|
389
|
+
self.format = value
|
390
|
+
end
|
391
|
+
end
|
392
|
+
|
393
|
+
if attributes.has_key?(:'hasPart')
|
394
|
+
if (value = attributes[:'hasPart']).is_a?(Array)
|
395
|
+
self.has_part = value
|
396
|
+
end
|
397
|
+
end
|
398
|
+
|
399
|
+
if attributes.has_key?(:'identifier')
|
400
|
+
if (value = attributes[:'identifier']).is_a?(Array)
|
401
|
+
self.identifier = value
|
402
|
+
end
|
403
|
+
end
|
404
|
+
|
405
|
+
if attributes.has_key?(:'isFormatOf')
|
406
|
+
if (value = attributes[:'isFormatOf']).is_a?(Array)
|
407
|
+
self.is_format_of = value
|
408
|
+
end
|
409
|
+
end
|
410
|
+
|
411
|
+
if attributes.has_key?(:'isPartOf')
|
412
|
+
if (value = attributes[:'isPartOf']).is_a?(Array)
|
413
|
+
self.is_part_of = value
|
414
|
+
end
|
415
|
+
end
|
416
|
+
|
417
|
+
if attributes.has_key?(:'language')
|
418
|
+
if (value = attributes[:'language']).is_a?(Array)
|
419
|
+
self.language = value
|
420
|
+
end
|
421
|
+
end
|
422
|
+
|
423
|
+
if attributes.has_key?(:'medium')
|
424
|
+
if (value = attributes[:'medium']).is_a?(Array)
|
425
|
+
self.medium = value
|
426
|
+
end
|
427
|
+
end
|
428
|
+
|
429
|
+
if attributes.has_key?(:'provenance')
|
430
|
+
if (value = attributes[:'provenance']).is_a?(Array)
|
431
|
+
self.provenance = value
|
432
|
+
end
|
433
|
+
end
|
434
|
+
|
435
|
+
if attributes.has_key?(:'publisher')
|
436
|
+
if (value = attributes[:'publisher']).is_a?(Array)
|
437
|
+
self.publisher = value
|
438
|
+
end
|
439
|
+
end
|
440
|
+
|
441
|
+
if attributes.has_key?(:'relation')
|
442
|
+
if (value = attributes[:'relation']).is_a?(Array)
|
443
|
+
self.relation = value
|
444
|
+
end
|
445
|
+
end
|
446
|
+
|
447
|
+
if attributes.has_key?(:'rights')
|
448
|
+
if (value = attributes[:'rights']).is_a?(Array)
|
449
|
+
self.rights = value
|
450
|
+
end
|
451
|
+
end
|
452
|
+
|
453
|
+
if attributes.has_key?(:'spatial')
|
454
|
+
if (value = attributes[:'spatial']).is_a?(Array)
|
455
|
+
self.spatial = value
|
456
|
+
end
|
457
|
+
end
|
458
|
+
|
459
|
+
if attributes.has_key?(:'subject')
|
460
|
+
if (value = attributes[:'subject']).is_a?(Array)
|
461
|
+
self.subject = value
|
462
|
+
end
|
463
|
+
end
|
464
|
+
|
465
|
+
if attributes.has_key?(:'title')
|
466
|
+
if (value = attributes[:'title']).is_a?(Array)
|
467
|
+
self.title = value
|
468
|
+
end
|
469
|
+
end
|
470
|
+
|
471
|
+
if attributes.has_key?(:'type')
|
472
|
+
if (value = attributes[:'type']).is_a?(Array)
|
473
|
+
self.type = value
|
474
|
+
end
|
475
|
+
end
|
476
|
+
|
477
|
+
if attributes.has_key?(:'admin_set')
|
478
|
+
self.admin_set = attributes[:'admin_set']
|
479
|
+
end
|
480
|
+
|
481
|
+
if attributes.has_key?(:'aleph_id')
|
482
|
+
self.aleph_id = attributes[:'aleph_id']
|
483
|
+
end
|
484
|
+
|
485
|
+
if attributes.has_key?(:'aspace_id')
|
486
|
+
self.aspace_id = attributes[:'aspace_id']
|
487
|
+
end
|
488
|
+
|
489
|
+
if attributes.has_key?(:'contentdm_id')
|
490
|
+
self.contentdm_id = attributes[:'contentdm_id']
|
491
|
+
end
|
492
|
+
|
493
|
+
if attributes.has_key?(:'display_format')
|
494
|
+
self.display_format = attributes[:'display_format']
|
495
|
+
end
|
496
|
+
|
497
|
+
if attributes.has_key?(:'doi')
|
498
|
+
self.doi = attributes[:'doi']
|
499
|
+
end
|
500
|
+
|
501
|
+
if attributes.has_key?(:'ead_id')
|
502
|
+
self.ead_id = attributes[:'ead_id']
|
503
|
+
end
|
504
|
+
|
505
|
+
if attributes.has_key?(:'fcrepo3_pid')
|
506
|
+
self.fcrepo3_pid = attributes[:'fcrepo3_pid']
|
507
|
+
end
|
508
|
+
|
509
|
+
if attributes.has_key?(:'ingested_by')
|
510
|
+
self.ingested_by = attributes[:'ingested_by']
|
511
|
+
end
|
512
|
+
|
513
|
+
if attributes.has_key?(:'ingestion_date')
|
514
|
+
self.ingestion_date = attributes[:'ingestion_date']
|
515
|
+
end
|
516
|
+
|
517
|
+
if attributes.has_key?(:'local_id')
|
518
|
+
self.local_id = attributes[:'local_id']
|
519
|
+
end
|
520
|
+
|
521
|
+
if attributes.has_key?(:'nested_path')
|
522
|
+
self.nested_path = attributes[:'nested_path']
|
523
|
+
end
|
524
|
+
|
525
|
+
if attributes.has_key?(:'permanent_id')
|
526
|
+
self.permanent_id = attributes[:'permanent_id']
|
527
|
+
end
|
528
|
+
|
529
|
+
if attributes.has_key?(:'permanent_url')
|
530
|
+
self.permanent_url = attributes[:'permanent_url']
|
531
|
+
end
|
532
|
+
|
533
|
+
if attributes.has_key?(:'research_help_contact')
|
534
|
+
self.research_help_contact = attributes[:'research_help_contact']
|
535
|
+
end
|
536
|
+
|
537
|
+
if attributes.has_key?(:'rights_note')
|
538
|
+
if (value = attributes[:'rights_note']).is_a?(Array)
|
539
|
+
self.rights_note = value
|
540
|
+
end
|
541
|
+
end
|
542
|
+
|
543
|
+
if attributes.has_key?(:'workflow_state')
|
544
|
+
self.workflow_state = attributes[:'workflow_state']
|
545
|
+
else
|
546
|
+
self.workflow_state = 'unpublished'
|
547
|
+
end
|
548
|
+
|
549
|
+
if attributes.has_key?(:'biblical_book')
|
550
|
+
if (value = attributes[:'biblical_book']).is_a?(Array)
|
551
|
+
self.biblical_book = value
|
552
|
+
end
|
553
|
+
end
|
554
|
+
|
555
|
+
if attributes.has_key?(:'category')
|
556
|
+
if (value = attributes[:'category']).is_a?(Array)
|
557
|
+
self.category = value
|
558
|
+
end
|
559
|
+
end
|
560
|
+
|
561
|
+
if attributes.has_key?(:'chapter_and_verse')
|
562
|
+
if (value = attributes[:'chapter_and_verse']).is_a?(Array)
|
563
|
+
self.chapter_and_verse = value
|
564
|
+
end
|
565
|
+
end
|
566
|
+
|
567
|
+
if attributes.has_key?(:'company')
|
568
|
+
if (value = attributes[:'company']).is_a?(Array)
|
569
|
+
self.company = value
|
570
|
+
end
|
571
|
+
end
|
572
|
+
|
573
|
+
if attributes.has_key?(:'headline')
|
574
|
+
if (value = attributes[:'headline']).is_a?(Array)
|
575
|
+
self.headline = value
|
576
|
+
end
|
577
|
+
end
|
578
|
+
|
579
|
+
if attributes.has_key?(:'issue_number')
|
580
|
+
if (value = attributes[:'issue_number']).is_a?(Array)
|
581
|
+
self.issue_number = value
|
582
|
+
end
|
583
|
+
end
|
584
|
+
|
585
|
+
if attributes.has_key?(:'placement_company')
|
586
|
+
if (value = attributes[:'placement_company']).is_a?(Array)
|
587
|
+
self.placement_company = value
|
588
|
+
end
|
589
|
+
end
|
590
|
+
|
591
|
+
if attributes.has_key?(:'product')
|
592
|
+
if (value = attributes[:'product']).is_a?(Array)
|
593
|
+
self.product = value
|
594
|
+
end
|
595
|
+
end
|
596
|
+
|
597
|
+
if attributes.has_key?(:'publication')
|
598
|
+
if (value = attributes[:'publication']).is_a?(Array)
|
599
|
+
self.publication = value
|
600
|
+
end
|
601
|
+
end
|
602
|
+
|
603
|
+
if attributes.has_key?(:'series')
|
604
|
+
if (value = attributes[:'series']).is_a?(Array)
|
605
|
+
self.series = value
|
606
|
+
end
|
607
|
+
end
|
608
|
+
|
609
|
+
if attributes.has_key?(:'setting')
|
610
|
+
if (value = attributes[:'setting']).is_a?(Array)
|
611
|
+
self.setting = value
|
612
|
+
end
|
613
|
+
end
|
614
|
+
|
615
|
+
if attributes.has_key?(:'sponsor')
|
616
|
+
if (value = attributes[:'sponsor']).is_a?(Array)
|
617
|
+
self.sponsor = value
|
618
|
+
end
|
619
|
+
end
|
620
|
+
|
621
|
+
if attributes.has_key?(:'tone')
|
622
|
+
if (value = attributes[:'tone']).is_a?(Array)
|
623
|
+
self.tone = value
|
624
|
+
end
|
625
|
+
end
|
626
|
+
|
627
|
+
if attributes.has_key?(:'volume')
|
628
|
+
if (value = attributes[:'volume']).is_a?(Array)
|
629
|
+
self.volume = value
|
630
|
+
end
|
631
|
+
end
|
632
|
+
end
|
633
|
+
|
634
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
635
|
+
# @return Array for valid properties with the reasons
|
636
|
+
def list_invalid_properties
|
637
|
+
invalid_properties = Array.new
|
638
|
+
invalid_properties
|
639
|
+
end
|
640
|
+
|
641
|
+
# Check to see if the all the properties in the model are valid
|
642
|
+
# @return true if the model is valid
|
643
|
+
def valid?
|
644
|
+
admin_set_validator = EnumAttributeValidator.new('String', ['dc', 'duke_scholarship', 'dul_collections', 'duson', 'dvs', 'ebooks', 'nescent', 'researchdata', 'rubenstein'])
|
645
|
+
return false unless admin_set_validator.valid?(@admin_set)
|
646
|
+
display_format_validator = EnumAttributeValidator.new('String', ['audio', 'folder', 'image', 'video'])
|
647
|
+
return false unless display_format_validator.valid?(@display_format)
|
648
|
+
research_help_contact_validator = EnumAttributeValidator.new('String', ['bingham', 'conservation', 'divinity', 'docarts', 'dvs', 'economists', 'franklin', 'hartman', 'hom', 'humanrights', 'libraries', 'rubenstein', 'uarchives'])
|
649
|
+
return false unless research_help_contact_validator.valid?(@research_help_contact)
|
650
|
+
workflow_state_validator = EnumAttributeValidator.new('String', ['published', 'unpublished', 'nonpublishable'])
|
651
|
+
return false unless workflow_state_validator.valid?(@workflow_state)
|
652
|
+
true
|
653
|
+
end
|
654
|
+
|
655
|
+
# Custom attribute writer method checking allowed values (enum).
|
656
|
+
# @param [Object] admin_set Object to be assigned
|
657
|
+
def admin_set=(admin_set)
|
658
|
+
validator = EnumAttributeValidator.new('String', ['dc', 'duke_scholarship', 'dul_collections', 'duson', 'dvs', 'ebooks', 'nescent', 'researchdata', 'rubenstein'])
|
659
|
+
unless validator.valid?(admin_set)
|
660
|
+
fail ArgumentError, 'invalid value for "admin_set", must be one of #{validator.allowable_values}.'
|
661
|
+
end
|
662
|
+
@admin_set = admin_set
|
663
|
+
end
|
664
|
+
|
665
|
+
# Custom attribute writer method checking allowed values (enum).
|
666
|
+
# @param [Object] display_format Object to be assigned
|
667
|
+
def display_format=(display_format)
|
668
|
+
validator = EnumAttributeValidator.new('String', ['audio', 'folder', 'image', 'video'])
|
669
|
+
unless validator.valid?(display_format)
|
670
|
+
fail ArgumentError, 'invalid value for "display_format", must be one of #{validator.allowable_values}.'
|
671
|
+
end
|
672
|
+
@display_format = display_format
|
673
|
+
end
|
674
|
+
|
675
|
+
# Custom attribute writer method checking allowed values (enum).
|
676
|
+
# @param [Object] research_help_contact Object to be assigned
|
677
|
+
def research_help_contact=(research_help_contact)
|
678
|
+
validator = EnumAttributeValidator.new('String', ['bingham', 'conservation', 'divinity', 'docarts', 'dvs', 'economists', 'franklin', 'hartman', 'hom', 'humanrights', 'libraries', 'rubenstein', 'uarchives'])
|
679
|
+
unless validator.valid?(research_help_contact)
|
680
|
+
fail ArgumentError, 'invalid value for "research_help_contact", must be one of #{validator.allowable_values}.'
|
681
|
+
end
|
682
|
+
@research_help_contact = research_help_contact
|
683
|
+
end
|
684
|
+
|
685
|
+
# Custom attribute writer method checking allowed values (enum).
|
686
|
+
# @param [Object] workflow_state Object to be assigned
|
687
|
+
def workflow_state=(workflow_state)
|
688
|
+
validator = EnumAttributeValidator.new('String', ['published', 'unpublished', 'nonpublishable'])
|
689
|
+
unless validator.valid?(workflow_state)
|
690
|
+
fail ArgumentError, 'invalid value for "workflow_state", must be one of #{validator.allowable_values}.'
|
691
|
+
end
|
692
|
+
@workflow_state = workflow_state
|
693
|
+
end
|
694
|
+
|
695
|
+
# Checks equality by comparing each attribute.
|
696
|
+
# @param [Object] Object to be compared
|
697
|
+
def ==(o)
|
698
|
+
return true if self.equal?(o)
|
699
|
+
self.class == o.class &&
|
700
|
+
abstract == o.abstract &&
|
701
|
+
access_rights == o.access_rights &&
|
702
|
+
alternative == o.alternative &&
|
703
|
+
available == o.available &&
|
704
|
+
contributor == o.contributor &&
|
705
|
+
creator == o.creator &&
|
706
|
+
date == o.date &&
|
707
|
+
description == o.description &&
|
708
|
+
extent == o.extent &&
|
709
|
+
format == o.format &&
|
710
|
+
has_part == o.has_part &&
|
711
|
+
identifier == o.identifier &&
|
712
|
+
is_format_of == o.is_format_of &&
|
713
|
+
is_part_of == o.is_part_of &&
|
714
|
+
language == o.language &&
|
715
|
+
medium == o.medium &&
|
716
|
+
provenance == o.provenance &&
|
717
|
+
publisher == o.publisher &&
|
718
|
+
relation == o.relation &&
|
719
|
+
rights == o.rights &&
|
720
|
+
spatial == o.spatial &&
|
721
|
+
subject == o.subject &&
|
722
|
+
title == o.title &&
|
723
|
+
type == o.type &&
|
724
|
+
admin_set == o.admin_set &&
|
725
|
+
aleph_id == o.aleph_id &&
|
726
|
+
aspace_id == o.aspace_id &&
|
727
|
+
contentdm_id == o.contentdm_id &&
|
728
|
+
display_format == o.display_format &&
|
729
|
+
doi == o.doi &&
|
730
|
+
ead_id == o.ead_id &&
|
731
|
+
fcrepo3_pid == o.fcrepo3_pid &&
|
732
|
+
ingested_by == o.ingested_by &&
|
733
|
+
ingestion_date == o.ingestion_date &&
|
734
|
+
local_id == o.local_id &&
|
735
|
+
nested_path == o.nested_path &&
|
736
|
+
permanent_id == o.permanent_id &&
|
737
|
+
permanent_url == o.permanent_url &&
|
738
|
+
research_help_contact == o.research_help_contact &&
|
739
|
+
rights_note == o.rights_note &&
|
740
|
+
workflow_state == o.workflow_state &&
|
741
|
+
biblical_book == o.biblical_book &&
|
742
|
+
category == o.category &&
|
743
|
+
chapter_and_verse == o.chapter_and_verse &&
|
744
|
+
company == o.company &&
|
745
|
+
headline == o.headline &&
|
746
|
+
issue_number == o.issue_number &&
|
747
|
+
placement_company == o.placement_company &&
|
748
|
+
product == o.product &&
|
749
|
+
publication == o.publication &&
|
750
|
+
series == o.series &&
|
751
|
+
setting == o.setting &&
|
752
|
+
sponsor == o.sponsor &&
|
753
|
+
tone == o.tone &&
|
754
|
+
volume == o.volume
|
755
|
+
end
|
756
|
+
|
757
|
+
# @see the `==` method
|
758
|
+
# @param [Object] Object to be compared
|
759
|
+
def eql?(o)
|
760
|
+
self == o
|
761
|
+
end
|
762
|
+
|
763
|
+
# Calculates hash code according to all attributes.
|
764
|
+
# @return [Fixnum] Hash code
|
765
|
+
def hash
|
766
|
+
[abstract, access_rights, alternative, available, contributor, creator, date, description, extent, format, has_part, identifier, is_format_of, is_part_of, language, medium, provenance, publisher, relation, rights, spatial, subject, title, type, admin_set, aleph_id, aspace_id, contentdm_id, display_format, doi, ead_id, fcrepo3_pid, ingested_by, ingestion_date, local_id, nested_path, permanent_id, permanent_url, research_help_contact, rights_note, workflow_state, biblical_book, category, chapter_and_verse, company, headline, issue_number, placement_company, product, publication, series, setting, sponsor, tone, volume].hash
|
767
|
+
end
|
768
|
+
|
769
|
+
# Builds the object from hash
|
770
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
771
|
+
# @return [Object] Returns the model itself
|
772
|
+
def build_from_hash(attributes)
|
773
|
+
return nil unless attributes.is_a?(Hash)
|
774
|
+
self.class.swagger_types.each_pair do |key, type|
|
775
|
+
if type =~ /\AArray<(.*)>/i
|
776
|
+
# check to ensure the input is an array given that the attribute
|
777
|
+
# is documented as an array but the input is not
|
778
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
779
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
780
|
+
end
|
781
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
782
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
783
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
784
|
+
end
|
785
|
+
|
786
|
+
self
|
787
|
+
end
|
788
|
+
|
789
|
+
# Deserializes the data based on type
|
790
|
+
# @param string type Data type
|
791
|
+
# @param string value Value to be deserialized
|
792
|
+
# @return [Object] Deserialized data
|
793
|
+
def _deserialize(type, value)
|
794
|
+
case type.to_sym
|
795
|
+
when :DateTime
|
796
|
+
DateTime.parse(value)
|
797
|
+
when :Date
|
798
|
+
Date.parse(value)
|
799
|
+
when :String
|
800
|
+
value.to_s
|
801
|
+
when :Integer
|
802
|
+
value.to_i
|
803
|
+
when :Float
|
804
|
+
value.to_f
|
805
|
+
when :BOOLEAN
|
806
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
807
|
+
true
|
808
|
+
else
|
809
|
+
false
|
810
|
+
end
|
811
|
+
when :Object
|
812
|
+
# generic object (usually a Hash), return directly
|
813
|
+
value
|
814
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
815
|
+
inner_type = Regexp.last_match[:inner_type]
|
816
|
+
value.map { |v| _deserialize(inner_type, v) }
|
817
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
818
|
+
k_type = Regexp.last_match[:k_type]
|
819
|
+
v_type = Regexp.last_match[:v_type]
|
820
|
+
{}.tap do |hash|
|
821
|
+
value.each do |k, v|
|
822
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
823
|
+
end
|
824
|
+
end
|
825
|
+
else # model
|
826
|
+
temp_model = DdrClient.const_get(type).new
|
827
|
+
temp_model.build_from_hash(value)
|
828
|
+
end
|
829
|
+
end
|
830
|
+
|
831
|
+
# Returns the string representation of the object
|
832
|
+
# @return [String] String presentation of the object
|
833
|
+
def to_s
|
834
|
+
to_hash.to_s
|
835
|
+
end
|
836
|
+
|
837
|
+
# to_body is an alias to to_hash (backward compatibility)
|
838
|
+
# @return [Hash] Returns the object in the form of hash
|
839
|
+
def to_body
|
840
|
+
to_hash
|
841
|
+
end
|
842
|
+
|
843
|
+
# Returns the object in the form of hash
|
844
|
+
# @return [Hash] Returns the object in the form of hash
|
845
|
+
def to_hash
|
846
|
+
hash = {}
|
847
|
+
self.class.attribute_map.each_pair do |attr, param|
|
848
|
+
value = self.send(attr)
|
849
|
+
next if value.nil?
|
850
|
+
hash[param] = _to_hash(value)
|
851
|
+
end
|
852
|
+
hash
|
853
|
+
end
|
854
|
+
|
855
|
+
# Outputs non-array value in the form of hash
|
856
|
+
# For object, use to_hash. Otherwise, just return the value
|
857
|
+
# @param [Object] value Any valid value
|
858
|
+
# @return [Hash] Returns the value in the form of hash
|
859
|
+
def _to_hash(value)
|
860
|
+
if value.is_a?(Array)
|
861
|
+
value.compact.map { |v| _to_hash(v) }
|
862
|
+
elsif value.is_a?(Hash)
|
863
|
+
{}.tap do |hash|
|
864
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
865
|
+
end
|
866
|
+
elsif value.respond_to? :to_hash
|
867
|
+
value.to_hash
|
868
|
+
else
|
869
|
+
value
|
870
|
+
end
|
871
|
+
end
|
872
|
+
|
873
|
+
end
|
874
|
+
end
|