cocina-models 0.22.2 → 0.23.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 93d0b9a2418a1c864d36b39293f1e89935519609a9e592594494bc332c0cf601
4
- data.tar.gz: 59d36afc29361ed9fb1c8d26eb4506bf60b13f697a246a482ac08ef89adaf12c
3
+ metadata.gz: 2dc7592c5fa321edb532d65c8fbfc414676a369eaa25220621a8f67340dc129f
4
+ data.tar.gz: 6390945b434de4426e2d12d1d1c046536291bafbb5897114dd1c07eb8c55202b
5
5
  SHA512:
6
- metadata.gz: e0b4a1d3455d766b58fd3888b84917844a1854e1949bfc201089cfe88eb5893863f2f6d479fe33ddd62165feba1b3777bf5cb5d688f90a48ca6ec7099e92918b
7
- data.tar.gz: 58d2204a1b24673dd719c51ee1b2623e48a94f6d72b47aea4a33ae1a7687d58ff13ccc3e01f47e919b30bedeb6f8f48709e03b072cde91b695683598a15b7d9e
6
+ metadata.gz: 8d893d0989d3bdb6aab1816a140fe0d8d68b2f46371c370e74eedceb0cb9266f0e868eddee407345e0763c0a68fba62d51db7a490c047e4c9be3e759393d1147
7
+ data.tar.gz: 4c3e96c91e667979dbac2992bee8d469a127401f66c1e0a76fe196310c6e8d5c407af225fbd0405ccc939787560b81ae1ecfacb0447498ca71b26928104a6f85
@@ -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.default(nil)
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.default { Presentation.new })
52
+ attribute(:presentation, Presentation.optional.meta(omittable: true))
53
53
  attribute :version, Types::Coercible::Integer
54
- attribute(:identification, Identification.default { Identification.new })
55
- attribute(:structural, Structural.default { Structural.new })
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, DRO::Structural.default { DRO::Structural.new })
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Cocina
4
4
  module Models
5
- VERSION = '0.22.2'
5
+ VERSION = '0.23.0'
6
6
  end
7
7
  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.22.2
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-14 00:00:00.000000000 Z
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.1.2
214
+ rubygems_version: 3.0.3
214
215
  signing_key:
215
216
  specification_version: 4
216
217
  summary: Data models for the SDR