cocina-models 0.23.0 → 0.24.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2dc7592c5fa321edb532d65c8fbfc414676a369eaa25220621a8f67340dc129f
4
- data.tar.gz: 6390945b434de4426e2d12d1d1c046536291bafbb5897114dd1c07eb8c55202b
3
+ metadata.gz: 8c6b4efbb7b00b50917226878c29e277c094ee69955057a496cd6312537e9df8
4
+ data.tar.gz: 598a325c1d38d3659bc90157627cddda36964170d299a97d197733389a03f3cb
5
5
  SHA512:
6
- metadata.gz: 8d893d0989d3bdb6aab1816a140fe0d8d68b2f46371c370e74eedceb0cb9266f0e868eddee407345e0763c0a68fba62d51db7a490c047e4c9be3e759393d1147
7
- data.tar.gz: 4c3e96c91e667979dbac2992bee8d469a127401f66c1e0a76fe196310c6e8d5c407af225fbd0405ccc939787560b81ae1ecfacb0447498ca71b26928104a6f85
6
+ metadata.gz: cd45defafa80ee0ce55c980852cf4a43224bc5a399bd81b0d813e5153fcf71629282bf66db9f35e943195d126ad62f5d2765ca46d0f9bb96025e74ba698c0177
7
+ data.tar.gz: beae94115b974ea72217be89e604873ab5034be0dbf905cd6198a985ac3833559f392dcaa892e5854256be909b14fe084b5b1290f650f7fec301fc36b2874247
@@ -46,9 +46,10 @@ 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.meta(omittable: true)
49
+ attribute :use, Types::String.enum('transcription').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 :hasMimeType, Types::String.optional.meta(omittable: true)
52
53
  attribute(:presentation, Presentation.optional.meta(omittable: true))
53
54
  attribute :version, Types::Coercible::Integer
54
55
  attribute(:identification, Identification.optional.meta(omittable: true))
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cocina
4
+ module Models
5
+ # A request to create a file.
6
+ # This is same as a File, but without externalIdentifier (as that wouldn't have been created yet)
7
+ # See http://sul-dlss.github.io/cocina-models/maps/File.json
8
+ class RequestFile < Struct
9
+ attribute(:access, File::Access.optional.default { File::Access.new })
10
+ attribute(:administrative, File::Administrative.default { File::Administrative.new })
11
+ attribute :type, Types::String.enum(*File::TYPES)
12
+ attribute :label, Types::Strict::String
13
+ attribute :filename, Types::String.optional.default(nil)
14
+ attribute :use, Types::String.enum('transcription').optional.meta(omittable: true)
15
+ attribute :size, Types::Coercible::Integer.optional.default(nil)
16
+ attribute :hasMessageDigests, Types::Strict::Array.of(File::Fixity).default([].freeze)
17
+ attribute :hasMimeType, Types::String.optional.meta(omittable: true)
18
+ attribute(:presentation, File::Presentation.optional.meta(omittable: true))
19
+ attribute :version, Types::Coercible::Integer
20
+ attribute(:identification, File::Identification.optional.meta(omittable: true))
21
+ attribute(:structural, File::Structural.optional.meta(omittable: true))
22
+
23
+ def self.from_dynamic(dyn)
24
+ new(dyn)
25
+ end
26
+
27
+ def self.from_json(json)
28
+ from_dynamic(JSON.parse(json))
29
+ end
30
+ end
31
+ end
32
+ end
@@ -6,6 +6,10 @@ module Cocina
6
6
  # This is same as a FileSet, but without externalIdentifier (as that wouldn't have been created yet)
7
7
  # See http://sul-dlss.github.io/cocina-models/maps/FileSet.json
8
8
  class RequestFileSet < Struct
9
+ # Structural sub-schema that contains RequestFile (unlike the FileSet which contains File)
10
+ class Structural < Struct
11
+ attribute :contains, Types::Strict::Array.of(RequestFile).meta(omittable: true)
12
+ end
9
13
  attribute :type, Types::String.enum(*FileSet::TYPES)
10
14
  attribute :label, Types::Strict::String
11
15
  attribute :version, Types::Coercible::Integer
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Cocina
4
4
  module Models
5
- VERSION = '0.23.0'
5
+ VERSION = '0.24.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.23.0
4
+ version: 0.24.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-21 00:00:00.000000000 Z
11
+ date: 2020-02-25 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.rb
191
192
  - lib/cocina/models/request_file_set.rb
192
193
  - lib/cocina/models/sequence.rb
193
194
  - lib/cocina/models/types.rb