cocina-models 0.22.2 → 0.23.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cocina/models/file.rb +4 -4
- data/lib/cocina/models/request_dro.rb +8 -1
- data/lib/cocina/models/request_file_set.rb +16 -0
- data/lib/cocina/models/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2dc7592c5fa321edb532d65c8fbfc414676a369eaa25220621a8f67340dc129f
|
4
|
+
data.tar.gz: 6390945b434de4426e2d12d1d1c046536291bafbb5897114dd1c07eb8c55202b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d893d0989d3bdb6aab1816a140fe0d8d68b2f46371c370e74eedceb0cb9266f0e868eddee407345e0763c0a68fba62d51db7a490c047e4c9be3e759393d1147
|
7
|
+
data.tar.gz: 4c3e96c91e667979dbac2992bee8d469a127401f66c1e0a76fe196310c6e8d5c407af225fbd0405ccc939787560b81ae1ecfacb0447498ca71b26928104a6f85
|
data/lib/cocina/models/file.rb
CHANGED
@@ -46,13 +46,13 @@ module Cocina
|
|
46
46
|
attribute :type, Types::String.enum(*TYPES)
|
47
47
|
attribute :label, Types::Strict::String
|
48
48
|
attribute :filename, Types::String.optional.default(nil)
|
49
|
-
attribute :use, Types::String.enum('original', 'preservation', 'access').optional.
|
49
|
+
attribute :use, Types::String.enum('original', 'preservation', 'access').optional.meta(omittable: true)
|
50
50
|
attribute :size, Types::Coercible::Integer.optional.default(nil)
|
51
51
|
attribute :hasMessageDigests, Types::Strict::Array.of(Fixity).default([].freeze)
|
52
|
-
attribute(:presentation, Presentation.optional.
|
52
|
+
attribute(:presentation, Presentation.optional.meta(omittable: true))
|
53
53
|
attribute :version, Types::Coercible::Integer
|
54
|
-
attribute(:identification, Identification.
|
55
|
-
attribute(:structural, Structural.
|
54
|
+
attribute(:identification, Identification.optional.meta(omittable: true))
|
55
|
+
attribute(:structural, Structural.optional.meta(omittable: true))
|
56
56
|
|
57
57
|
def self.from_dynamic(dyn)
|
58
58
|
File.new(dyn)
|
@@ -6,6 +6,13 @@ module Cocina
|
|
6
6
|
# This is same as a DRO, but without externalIdentifier (as that wouldn't have been created yet)
|
7
7
|
# See http://sul-dlss.github.io/cocina-models/maps/DRO.json
|
8
8
|
class RequestDRO < Struct
|
9
|
+
# Structural sub-schema that contains RequestFileSet (unlike the DRO which contains FileSet)
|
10
|
+
class Structural < Struct
|
11
|
+
attribute :contains, Types::Strict::Array.of(RequestFileSet).meta(omittable: true)
|
12
|
+
attribute :isMemberOf, Types::Strict::String.meta(omittable: true)
|
13
|
+
attribute :hasMemberOrders, Types::Strict::Array.of(Sequence).meta(omittable: true)
|
14
|
+
end
|
15
|
+
|
9
16
|
attribute :type, Types::String.enum(*DRO::TYPES)
|
10
17
|
attribute :label, Types::Strict::String
|
11
18
|
attribute :version, Types::Coercible::Integer
|
@@ -15,7 +22,7 @@ module Cocina
|
|
15
22
|
# but I think it's actually required for every DRO
|
16
23
|
attribute :description, Description.optional.meta(omittable: true)
|
17
24
|
attribute(:identification, DRO::Identification.default { DRO::Identification.new })
|
18
|
-
attribute(:structural,
|
25
|
+
attribute(:structural, Structural.default { Structural.new })
|
19
26
|
|
20
27
|
def self.from_dynamic(dyn)
|
21
28
|
RequestDRO.new(dyn)
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Cocina
|
4
|
+
module Models
|
5
|
+
# A Request to create a FileSet object.
|
6
|
+
# This is same as a FileSet, but without externalIdentifier (as that wouldn't have been created yet)
|
7
|
+
# See http://sul-dlss.github.io/cocina-models/maps/FileSet.json
|
8
|
+
class RequestFileSet < Struct
|
9
|
+
attribute :type, Types::String.enum(*FileSet::TYPES)
|
10
|
+
attribute :label, Types::Strict::String
|
11
|
+
attribute :version, Types::Coercible::Integer
|
12
|
+
attribute(:identification, FileSet::Identification.default { FileSet::Identification.new })
|
13
|
+
attribute(:structural, FileSet::Structural.default { FileSet::Structural.new })
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocina-models
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.23.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Coyne
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-02-
|
11
|
+
date: 2020-02-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-struct
|
@@ -188,6 +188,7 @@ files:
|
|
188
188
|
- lib/cocina/models/request_admin_policy.rb
|
189
189
|
- lib/cocina/models/request_collection.rb
|
190
190
|
- lib/cocina/models/request_dro.rb
|
191
|
+
- lib/cocina/models/request_file_set.rb
|
191
192
|
- lib/cocina/models/sequence.rb
|
192
193
|
- lib/cocina/models/types.rb
|
193
194
|
- lib/cocina/models/version.rb
|
@@ -210,7 +211,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
210
211
|
- !ruby/object:Gem::Version
|
211
212
|
version: '0'
|
212
213
|
requirements: []
|
213
|
-
rubygems_version: 3.
|
214
|
+
rubygems_version: 3.0.3
|
214
215
|
signing_key:
|
215
216
|
specification_version: 4
|
216
217
|
summary: Data models for the SDR
|