cocina-models 0.58.1 → 0.58.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/lib/cocina/generator/schema.rb +1 -0
  3. data/lib/cocina/generator/schema_base.rb +5 -6
  4. data/lib/cocina/models/access.rb +5 -5
  5. data/lib/cocina/models/admin_policy_administrative.rb +3 -3
  6. data/lib/cocina/models/admin_policy_default_access.rb +3 -3
  7. data/lib/cocina/models/administrative.rb +1 -1
  8. data/lib/cocina/models/collection_identification.rb +1 -1
  9. data/lib/cocina/models/contributor.rb +3 -3
  10. data/lib/cocina/models/description.rb +2 -2
  11. data/lib/cocina/models/descriptive_basic_value.rb +8 -8
  12. data/lib/cocina/models/descriptive_parallel_contributor.rb +3 -3
  13. data/lib/cocina/models/descriptive_parallel_event.rb +2 -2
  14. data/lib/cocina/models/descriptive_value.rb +8 -8
  15. data/lib/cocina/models/descriptive_value_language.rb +4 -4
  16. data/lib/cocina/models/dro_access.rb +7 -7
  17. data/lib/cocina/models/dro_structural.rb +1 -1
  18. data/lib/cocina/models/embargo.rb +1 -1
  19. data/lib/cocina/models/event.rb +2 -2
  20. data/lib/cocina/models/file.rb +3 -3
  21. data/lib/cocina/models/file_access.rb +4 -4
  22. data/lib/cocina/models/identification.rb +2 -2
  23. data/lib/cocina/models/language.rb +7 -7
  24. data/lib/cocina/models/presentation.rb +2 -2
  25. data/lib/cocina/models/related_resource.rb +6 -6
  26. data/lib/cocina/models/release_tag.rb +4 -4
  27. data/lib/cocina/models/request_dro_structural.rb +1 -1
  28. data/lib/cocina/models/request_file.rb +4 -4
  29. data/lib/cocina/models/request_identification.rb +1 -1
  30. data/lib/cocina/models/sequence.rb +1 -1
  31. data/lib/cocina/models/source.rb +4 -4
  32. data/lib/cocina/models/standard.rb +4 -4
  33. data/lib/cocina/models/title.rb +8 -8
  34. data/lib/cocina/models/version.rb +1 -1
  35. data/openapi.yml +4 -0
  36. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2f791f4fb5f53b913b495bcae9bd9918b924f43652e27125c624ffb12ba67e6a
4
- data.tar.gz: f6d42499c81c75870ba3859ddb0241a2ecc4df420677a2d371c775ba3f72efd4
3
+ metadata.gz: 373c87def65c96c5e54fca772ded4c486a26ed1ed2ec5679e4d1f4483241d950
4
+ data.tar.gz: 58fd159bc6341d831d42ffd59cb7c42ff8fb0643c87c724753e69c100ec271f4
5
5
  SHA512:
6
- metadata.gz: ef6a8fcbb2550b49fbcb5fbd09a2d3fafce8f345773387fd12520b654e5e0f810aa805a51aeda04ccf4766eac0108cb4c59467a3d1ff86b9dbf5e337450da5aa
7
- data.tar.gz: 5a7282e082a864bc3e3c223593a01c3c42243f458ba2debc2d4aa72478d945af9e350877aec68073590bf30e0c4080cf882b0f255d190dd901b46f950accb93a
6
+ metadata.gz: 1ef5aec119f9230e8a274d2c97130c1c1fa421acf227f856613e7c2fb93542ef6f2af64b22e87b44448b6f428b37ba9e091bc1ed01acd16058f30329156e0d31
7
+ data.tar.gz: 759e9eee67dc7fc016727e0a4954c07c9d5d1a7a36b5f0eda210b26a12550112210bd7b0b8e59f0ab45e5a57b8e685fb377abb8a78ff74777ebbdc64c474c38a
@@ -97,6 +97,7 @@ module Cocina
97
97
  property_class_for(properties_doc).new(properties_doc,
98
98
  key: key,
99
99
  required: doc.requires?(key),
100
+ nullable: properties_doc.nullable?,
100
101
  parent: self)
101
102
  end
102
103
  end
@@ -4,12 +4,13 @@ module Cocina
4
4
  module Generator
5
5
  # Base class for generating from openapi
6
6
  class SchemaBase
7
- attr_reader :schema_doc, :key, :required, :parent
7
+ attr_reader :schema_doc, :key, :required, :nullable, :parent
8
8
 
9
- def initialize(schema_doc, key: nil, required: false, parent: nil)
9
+ def initialize(schema_doc, key: nil, required: false, nullable: false, parent: nil)
10
10
  @schema_doc = schema_doc
11
11
  @key = key
12
12
  @required = required
13
+ @nullable = nullable
13
14
  @parent = parent
14
15
  end
15
16
 
@@ -29,12 +30,10 @@ module Cocina
29
30
  '.meta(omittable: true)'
30
31
  end
31
32
 
32
- # Allows non-required values to be set to nil. This is useful when doing
33
+ # Allows nillable values to be set to nil. This is useful when doing
33
34
  # an update and you want to clear out a value.
34
35
  def optional
35
- return '' if required
36
-
37
- '.optional'
36
+ nullable ? '.optional' : ''
38
37
  end
39
38
 
40
39
  def quote(item)
@@ -4,17 +4,17 @@ module Cocina
4
4
  module Models
5
5
  class Access < Struct
6
6
  # Access level
7
- attribute :access, Types::Strict::String.optional.default('dark').enum('world', 'stanford', 'location-based', 'citation-only', 'dark').meta(omittable: true)
7
+ attribute :access, Types::Strict::String.default('dark').enum('world', 'stanford', 'location-based', 'citation-only', 'dark').meta(omittable: true)
8
8
  # The human readable copyright statement that applies
9
9
  # example: Copyright World Trade Organization
10
- attribute :copyright, Types::Strict::String.optional.meta(omittable: true)
10
+ attribute :copyright, Types::Strict::String.meta(omittable: true)
11
11
  # If access is "location-based", which location should have access.
12
- attribute :readLocation, Types::Strict::String.optional.enum('spec', 'music', 'ars', 'art', 'hoover', 'm&m').meta(omittable: true)
12
+ attribute :readLocation, Types::Strict::String.enum('spec', 'music', 'ars', 'art', 'hoover', 'm&m').meta(omittable: true)
13
13
  # The human readable use and reproduction statement that applies
14
14
  # example: Property rights reside with the repository. Literary rights reside with the creators of the documents or their heirs. To obtain permission to publish or reproduce, please contact the Public Services Librarian of the Dept. of Special Collections (http://library.stanford.edu/spc).
15
- attribute :useAndReproductionStatement, Types::Strict::String.optional.meta(omittable: true)
15
+ attribute :useAndReproductionStatement, Types::Strict::String.meta(omittable: true)
16
16
  # The license governing reuse of the Collection. Should be an IRI for known licenses (i.e. CC, RightsStatement.org URI, etc.).
17
- attribute :license, Types::Strict::String.optional.meta(omittable: true)
17
+ attribute :license, Types::Strict::String.meta(omittable: true)
18
18
  end
19
19
  end
20
20
  end
@@ -4,17 +4,17 @@ module Cocina
4
4
  module Models
5
5
  class AdminPolicyAdministrative < Struct
6
6
  # This is an XML expression of the default access (see defaultAccess)
7
- attribute :defaultObjectRights, Types::Strict::String.optional.default('<?xml version="1.0" encoding="UTF-8"?><rightsMetadata><access type="discover"><machine><world/></machine></access><access type="read"><machine><world/></machine></access><use><human type="useAndReproduction"/><human type="creativeCommons"/><machine type="creativeCommons" uri=""/><human type="openDataCommons"/><machine type="openDataCommons" uri=""/></use><copyright><human/></copyright></rightsMetadata>').meta(omittable: true)
7
+ attribute :defaultObjectRights, Types::Strict::String.default('<?xml version="1.0" encoding="UTF-8"?><rightsMetadata><access type="discover"><machine><world/></machine></access><access type="read"><machine><world/></machine></access><use><human type="useAndReproduction"/><human type="creativeCommons"/><machine type="creativeCommons" uri=""/><human type="openDataCommons"/><machine type="openDataCommons" uri=""/></use><copyright><human/></copyright></rightsMetadata>').meta(omittable: true)
8
8
  attribute :defaultAccess, AdminPolicyDefaultAccess.optional.meta(omittable: true)
9
9
  attribute :registrationWorkflow, Types::Strict::Array.of(Types::Strict::String).meta(omittable: true)
10
10
  # An additional workflow to start for objects managed by this admin policy once the end-accession workflow step is complete
11
11
  # example: wasCrawlPreassemblyWF
12
- attribute :disseminationWorkflow, Types::Strict::String.optional.meta(omittable: true)
12
+ attribute :disseminationWorkflow, Types::Strict::String.meta(omittable: true)
13
13
  attribute :collectionsForRegistration, Types::Strict::Array.of(Types::Strict::String).meta(omittable: true)
14
14
  # example: druid:bc123df4567
15
15
  attribute :hasAdminPolicy, Types::Strict::String
16
16
  # example: druid:bc123df4567
17
- attribute :referencesAgreement, Types::Strict::String.optional.meta(omittable: true)
17
+ attribute :referencesAgreement, Types::Strict::String.meta(omittable: true)
18
18
  attribute :roles, Types::Strict::Array.of(AccessRole).meta(omittable: true)
19
19
  end
20
20
  end
@@ -3,15 +3,15 @@
3
3
  module Cocina
4
4
  module Models
5
5
  class AdminPolicyDefaultAccess < Struct
6
- attribute :access, Types::Strict::String.optional.enum('world', 'stanford', 'location-based', 'citation-only', 'dark').meta(omittable: true)
6
+ attribute :access, Types::Strict::String.enum('world', 'stanford', 'location-based', 'citation-only', 'dark').meta(omittable: true)
7
7
  # Available for controlled digital lending.
8
- attribute :controlledDigitalLending, Types::Strict::Bool.optional.meta(omittable: true)
8
+ attribute :controlledDigitalLending, Types::Strict::Bool.meta(omittable: true)
9
9
  # The human readable copyright statement that applies
10
10
  # example: Copyright World Trade Organization
11
11
  attribute :copyright, Types::Strict::String.optional.meta(omittable: true)
12
12
  # Download access level. This is used in the transition from Fedora as a way to set a default download level at registration that is copied down to all the files.
13
13
 
14
- attribute :download, Types::Strict::String.optional.enum('world', 'stanford', 'location-based', 'none').meta(omittable: true)
14
+ attribute :download, Types::Strict::String.enum('world', 'stanford', 'location-based', 'none').meta(omittable: true)
15
15
  # If access is "location-based", which location should have access. This is used in the transition from Fedora as a way to set a default readLocation at registration that is copied down to all the files.
16
16
 
17
17
  attribute :readLocation, Types::Strict::String.optional.enum('spec', 'music', 'ars', 'art', 'hoover', 'm&m').meta(omittable: true)
@@ -8,7 +8,7 @@ module Cocina
8
8
  attribute :releaseTags, Types::Strict::Array.of(ReleaseTag).meta(omittable: true)
9
9
  # Administrative or Internal project this resource is a part of
10
10
  # example: Google Books
11
- attribute :partOfProject, Types::Strict::String.optional.meta(omittable: true)
11
+ attribute :partOfProject, Types::Strict::String.meta(omittable: true)
12
12
  end
13
13
  end
14
14
  end
@@ -6,7 +6,7 @@ module Cocina
6
6
  # Unique identifier in some other system. This is because a large proportion of what is deposited in SDR, historically and currently, are representations of objects that are also represented in other systems. For example, digitized paper and A/V collections have physical manifestations, and those physical objects are managed in systems that have their own identifiers. Similarly, books have barcodes, archival materials have collection numbers and physical locations, etc. The sourceId allows determining if an item has been deposited before and where to look for the original item if you're looking at its SDR representation. The format is: "namespace:identifier"
7
7
 
8
8
  # example: sul:PC0170_s3_Fiesta_Bowl_2012-01-02_210609_2026
9
- attribute :sourceId, Types::Strict::String.optional.meta(omittable: true)
9
+ attribute :sourceId, Types::Strict::String.meta(omittable: true)
10
10
  attribute :catalogLinks, Types::Strict::Array.of(CatalogLink).meta(omittable: true)
11
11
  end
12
12
  end
@@ -5,14 +5,14 @@ module Cocina
5
5
  class Contributor < Struct
6
6
  attribute :name, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
7
7
  # Entity type of the contributor (person, organization, etc.).
8
- attribute :type, Types::Strict::String.optional.meta(omittable: true)
8
+ attribute :type, Types::Strict::String.meta(omittable: true)
9
9
  # Status of the contributor relative to other parallel contributors (e.g. the primary author among a group of contributors).
10
- attribute :status, Types::Strict::String.optional.meta(omittable: true)
10
+ attribute :status, Types::Strict::String.meta(omittable: true)
11
11
  attribute :role, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
12
12
  attribute :identifier, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
13
13
  attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
14
14
  # URL or other pointer to the location of the contributor information.
15
- attribute :valueAt, Types::Strict::String.optional.meta(omittable: true)
15
+ attribute :valueAt, Types::Strict::String.meta(omittable: true)
16
16
  attribute :parallelContributor, Types::Strict::Array.of(DescriptiveParallelContributor).meta(omittable: true)
17
17
  end
18
18
  end
@@ -13,13 +13,13 @@ module Cocina
13
13
  attribute :identifier, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
14
14
  attribute :subject, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
15
15
  # Stanford persistent URL associated with the resource.
16
- attribute :purl, Types::Strict::String.optional.meta(omittable: true)
16
+ attribute :purl, Types::Strict::String.meta(omittable: true)
17
17
  attribute :access, DescriptiveAccessMetadata.optional.meta(omittable: true)
18
18
  attribute :relatedResource, Types::Strict::Array.of(RelatedResource).meta(omittable: true)
19
19
  attribute :marcEncodedData, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
20
20
  attribute :adminMetadata, DescriptiveAdminMetadata.optional.meta(omittable: true)
21
21
  # URL or other pointer to the location of the resource description.
22
- attribute :valueAt, Types::Strict::String.optional.meta(omittable: true)
22
+ attribute :valueAt, Types::Strict::String.meta(omittable: true)
23
23
 
24
24
  def self.new(attributes = default_attributes, safe = false, validate = true, &block)
25
25
  Validator.validate(self, attributes.with_indifferent_access) if validate && name
@@ -7,27 +7,27 @@ module Cocina
7
7
  attribute :parallelValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
8
8
  attribute :groupedValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
9
9
  # String or integer value of the descriptive element.
10
- attribute :value, Types::Nominal::Any.optional.meta(omittable: true)
10
+ attribute :value, Types::Nominal::Any.meta(omittable: true)
11
11
  # Type of value provided by the descriptive element.
12
- attribute :type, Types::Strict::String.optional.meta(omittable: true)
12
+ attribute :type, Types::Strict::String.meta(omittable: true)
13
13
  # Status of the descriptive element value relative to other instances of the element.
14
- attribute :status, Types::Strict::String.optional.meta(omittable: true)
14
+ attribute :status, Types::Strict::String.meta(omittable: true)
15
15
  # Code value of the descriptive element.
16
- attribute :code, Types::Strict::String.optional.meta(omittable: true)
16
+ attribute :code, Types::Strict::String.meta(omittable: true)
17
17
  # URI value of the descriptive element.
18
- attribute :uri, Types::Strict::String.optional.meta(omittable: true)
18
+ attribute :uri, Types::Strict::String.meta(omittable: true)
19
19
  attribute :standard, Standard.optional.meta(omittable: true)
20
20
  attribute :encoding, Standard.optional.meta(omittable: true)
21
21
  attribute :identifier, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
22
22
  attribute :source, Source.optional.meta(omittable: true)
23
23
  # The preferred display label to use for the descriptive element in access systems.
24
- attribute :displayLabel, Types::Strict::String.optional.meta(omittable: true)
24
+ attribute :displayLabel, Types::Strict::String.meta(omittable: true)
25
25
  # A term providing information about the circumstances of the statement (e.g., approximate dates).
26
- attribute :qualifier, Types::Strict::String.optional.meta(omittable: true)
26
+ attribute :qualifier, Types::Strict::String.meta(omittable: true)
27
27
  attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
28
28
  attribute :valueLanguage, DescriptiveValueLanguage.optional.meta(omittable: true)
29
29
  # URL or other pointer to the location of the value of the descriptive element.
30
- attribute :valueAt, Types::Strict::String.optional.meta(omittable: true)
30
+ attribute :valueAt, Types::Strict::String.meta(omittable: true)
31
31
  end
32
32
  end
33
33
  end
@@ -5,14 +5,14 @@ module Cocina
5
5
  class DescriptiveParallelContributor < Struct
6
6
  attribute :name, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
7
7
  # Entity type of the contributor (person, organization, etc.).
8
- attribute :type, Types::Strict::String.optional.meta(omittable: true)
8
+ attribute :type, Types::Strict::String.meta(omittable: true)
9
9
  # Status of the contributor relative to other parallel contributors (e.g. the primary author among a group of contributors).
10
- attribute :status, Types::Strict::String.optional.meta(omittable: true)
10
+ attribute :status, Types::Strict::String.meta(omittable: true)
11
11
  attribute :role, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
12
12
  attribute :identifier, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
13
13
  attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
14
14
  # URL or other pointer to the location of the contributor information.
15
- attribute :valueAt, Types::Strict::String.optional.meta(omittable: true)
15
+ attribute :valueAt, Types::Strict::String.meta(omittable: true)
16
16
  attribute :valueLanguage, DescriptiveValueLanguage.optional.meta(omittable: true)
17
17
  end
18
18
  end
@@ -5,9 +5,9 @@ module Cocina
5
5
  class DescriptiveParallelEvent < Struct
6
6
  attribute :structuredValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
7
7
  # Description of the event (creation, publication, etc.).
8
- attribute :type, Types::Strict::String.optional.meta(omittable: true)
8
+ attribute :type, Types::Strict::String.meta(omittable: true)
9
9
  # The preferred display label to use for the event in access systems.
10
- attribute :displayLabel, Types::Strict::String.optional.meta(omittable: true)
10
+ attribute :displayLabel, Types::Strict::String.meta(omittable: true)
11
11
  attribute :date, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
12
12
  attribute :contributor, Types::Strict::Array.of(Contributor).meta(omittable: true)
13
13
  attribute :location, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
@@ -7,27 +7,27 @@ module Cocina
7
7
  attribute :parallelValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
8
8
  attribute :groupedValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
9
9
  # String or integer value of the descriptive element.
10
- attribute :value, Types::Nominal::Any.optional.meta(omittable: true)
10
+ attribute :value, Types::Nominal::Any.meta(omittable: true)
11
11
  # Type of value provided by the descriptive element.
12
- attribute :type, Types::Strict::String.optional.meta(omittable: true)
12
+ attribute :type, Types::Strict::String.meta(omittable: true)
13
13
  # Status of the descriptive element value relative to other instances of the element.
14
- attribute :status, Types::Strict::String.optional.meta(omittable: true)
14
+ attribute :status, Types::Strict::String.meta(omittable: true)
15
15
  # Code value of the descriptive element.
16
- attribute :code, Types::Strict::String.optional.meta(omittable: true)
16
+ attribute :code, Types::Strict::String.meta(omittable: true)
17
17
  # URI value of the descriptive element.
18
- attribute :uri, Types::Strict::String.optional.meta(omittable: true)
18
+ attribute :uri, Types::Strict::String.meta(omittable: true)
19
19
  attribute :standard, Standard.optional.meta(omittable: true)
20
20
  attribute :encoding, Standard.optional.meta(omittable: true)
21
21
  attribute :identifier, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
22
22
  attribute :source, Source.optional.meta(omittable: true)
23
23
  # The preferred display label to use for the descriptive element in access systems.
24
- attribute :displayLabel, Types::Strict::String.optional.meta(omittable: true)
24
+ attribute :displayLabel, Types::Strict::String.meta(omittable: true)
25
25
  # A term providing information about the circumstances of the statement (e.g., approximate dates).
26
- attribute :qualifier, Types::Strict::String.optional.meta(omittable: true)
26
+ attribute :qualifier, Types::Strict::String.meta(omittable: true)
27
27
  attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
28
28
  attribute :valueLanguage, DescriptiveValueLanguage.optional.meta(omittable: true)
29
29
  # URL or other pointer to the location of the value of the descriptive element.
30
- attribute :valueAt, Types::Strict::String.optional.meta(omittable: true)
30
+ attribute :valueAt, Types::Strict::String.meta(omittable: true)
31
31
  attribute :appliesTo, Types::Strict::Array.of(DescriptiveBasicValue).meta(omittable: true)
32
32
  end
33
33
  end
@@ -4,14 +4,14 @@ module Cocina
4
4
  module Models
5
5
  class DescriptiveValueLanguage < Struct
6
6
  # Code representing the standard or encoding.
7
- attribute :code, Types::Strict::String.optional.meta(omittable: true)
7
+ attribute :code, Types::Strict::String.meta(omittable: true)
8
8
  # URI for the standard or encoding.
9
- attribute :uri, Types::Strict::String.optional.meta(omittable: true)
9
+ attribute :uri, Types::Strict::String.meta(omittable: true)
10
10
  # String describing the standard or encoding.
11
- attribute :value, Types::Strict::String.optional.meta(omittable: true)
11
+ attribute :value, Types::Strict::String.meta(omittable: true)
12
12
  attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
13
13
  # The version of the standard or encoding.
14
- attribute :version, Types::Strict::String.optional.meta(omittable: true)
14
+ attribute :version, Types::Strict::String.meta(omittable: true)
15
15
  attribute :source, Source.optional.meta(omittable: true)
16
16
  attribute :valueScript, Standard.optional.meta(omittable: true)
17
17
  end
@@ -3,24 +3,24 @@
3
3
  module Cocina
4
4
  module Models
5
5
  class DROAccess < Struct
6
- attribute :access, Types::Strict::String.optional.default('dark').enum('world', 'stanford', 'location-based', 'citation-only', 'dark').meta(omittable: true)
6
+ attribute :access, Types::Strict::String.default('dark').enum('world', 'stanford', 'location-based', 'citation-only', 'dark').meta(omittable: true)
7
7
  # Available for controlled digital lending.
8
- attribute :controlledDigitalLending, Types::Strict::Bool.optional.meta(omittable: true)
8
+ attribute :controlledDigitalLending, Types::Strict::Bool.meta(omittable: true)
9
9
  # The human readable copyright statement that applies
10
10
  # example: Copyright World Trade Organization
11
- attribute :copyright, Types::Strict::String.optional.meta(omittable: true)
11
+ attribute :copyright, Types::Strict::String.meta(omittable: true)
12
12
  attribute :embargo, Embargo.optional.meta(omittable: true)
13
13
  # Download access level. This is used in the transition from Fedora as a way to set a default download level at registration that is copied down to all the files.
14
14
 
15
- attribute :download, Types::Strict::String.optional.default('none').enum('world', 'stanford', 'location-based', 'none').meta(omittable: true)
15
+ attribute :download, Types::Strict::String.default('none').enum('world', 'stanford', 'location-based', 'none').meta(omittable: true)
16
16
  # If access is "location-based", which location should have access. This is used in the transition from Fedora as a way to set a default readLocation at registration that is copied down to all the files.
17
17
 
18
- attribute :readLocation, Types::Strict::String.optional.enum('spec', 'music', 'ars', 'art', 'hoover', 'm&m').meta(omittable: true)
18
+ attribute :readLocation, Types::Strict::String.enum('spec', 'music', 'ars', 'art', 'hoover', 'm&m').meta(omittable: true)
19
19
  # The human readable use and reproduction statement that applies
20
20
  # example: Property rights reside with the repository. Literary rights reside with the creators of the documents or their heirs. To obtain permission to publish or reproduce, please contact the Public Services Librarian of the Dept. of Special Collections (http://library.stanford.edu/spc).
21
- attribute :useAndReproductionStatement, Types::Strict::String.optional.meta(omittable: true)
21
+ attribute :useAndReproductionStatement, Types::Strict::String.meta(omittable: true)
22
22
  # The license governing reuse of the DRO. Should be an IRI for known licenses (i.e. CC, RightsStatement.org URI, etc.).
23
- attribute :license, Types::Strict::String.optional.meta(omittable: true)
23
+ attribute :license, Types::Strict::String.meta(omittable: true)
24
24
  end
25
25
  end
26
26
  end
@@ -7,7 +7,7 @@ module Cocina
7
7
  attribute :hasMemberOrders, Types::Strict::Array.of(Sequence).meta(omittable: true)
8
8
  attribute :isMemberOf, Types::Strict::Array.of(Druid).meta(omittable: true)
9
9
  # Agreement that covers the deposit of the DRO into SDR.
10
- attribute :hasAgreement, Types::Strict::String.optional.meta(omittable: true)
10
+ attribute :hasAgreement, Types::Strict::String.meta(omittable: true)
11
11
  end
12
12
  end
13
13
  end
@@ -10,7 +10,7 @@ module Cocina
10
10
  attribute :access, Types::Strict::String.enum('world', 'stanford', 'location-based', 'citation-only', 'dark')
11
11
  # The human readable use and reproduction statement that applies when the embargo expires.
12
12
  # example: These materials are in the public domain.
13
- attribute :useAndReproductionStatement, Types::Strict::String.optional.meta(omittable: true)
13
+ attribute :useAndReproductionStatement, Types::Strict::String.meta(omittable: true)
14
14
  end
15
15
  end
16
16
  end
@@ -5,9 +5,9 @@ module Cocina
5
5
  class Event < Struct
6
6
  attribute :structuredValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
7
7
  # Description of the event (creation, publication, etc.).
8
- attribute :type, Types::Strict::String.optional.meta(omittable: true)
8
+ attribute :type, Types::Strict::String.meta(omittable: true)
9
9
  # The preferred display label to use for the event in access systems.
10
- attribute :displayLabel, Types::Strict::String.optional.meta(omittable: true)
10
+ attribute :displayLabel, Types::Strict::String.meta(omittable: true)
11
11
  attribute :date, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
12
12
  attribute :contributor, Types::Strict::Array.of(Contributor).meta(omittable: true)
13
13
  attribute :location, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
@@ -16,13 +16,13 @@ module Cocina
16
16
  # Filename for a file. Can be same as label.
17
17
  attribute :filename, Types::Strict::String
18
18
  # Size of the File (binary) in bytes.
19
- attribute :size, Types::Strict::Integer.optional.meta(omittable: true)
19
+ attribute :size, Types::Strict::Integer.meta(omittable: true)
20
20
  # Version for the File within SDR.
21
21
  attribute :version, Types::Strict::Integer
22
22
  # MIME Type of the File.
23
- attribute :hasMimeType, Types::Strict::String.optional.meta(omittable: true)
23
+ attribute :hasMimeType, Types::Strict::String.meta(omittable: true)
24
24
  # Use for the File.
25
- attribute :use, Types::Strict::String.optional.meta(omittable: true)
25
+ attribute :use, Types::Strict::String.meta(omittable: true)
26
26
  attribute :hasMessageDigests, Types::Strict::Array.of(MessageDigest).default([].freeze)
27
27
  attribute(:access, FileAccess.default { FileAccess.new })
28
28
  attribute(:administrative, FileAdministrative.default { FileAdministrative.new })
@@ -4,13 +4,13 @@ module Cocina
4
4
  module Models
5
5
  class FileAccess < Struct
6
6
  # Access level
7
- attribute :access, Types::Strict::String.optional.default('dark').enum('world', 'stanford', 'location-based', 'citation-only', 'dark').meta(omittable: true)
7
+ attribute :access, Types::Strict::String.default('dark').enum('world', 'stanford', 'location-based', 'citation-only', 'dark').meta(omittable: true)
8
8
  # Available for controlled digital lending.
9
- attribute :controlledDigitalLending, Types::Strict::Bool.optional.meta(omittable: true)
9
+ attribute :controlledDigitalLending, Types::Strict::Bool.meta(omittable: true)
10
10
  # Download access level for a file
11
- attribute :download, Types::Strict::String.optional.default('none').enum('world', 'stanford', 'location-based', 'none').meta(omittable: true)
11
+ attribute :download, Types::Strict::String.default('none').enum('world', 'stanford', 'location-based', 'none').meta(omittable: true)
12
12
  # If access is "location-based", which location should have access.
13
- attribute :readLocation, Types::Strict::String.optional.enum('spec', 'music', 'ars', 'art', 'hoover', 'm&m').meta(omittable: true)
13
+ attribute :readLocation, Types::Strict::String.enum('spec', 'music', 'ars', 'art', 'hoover', 'm&m').meta(omittable: true)
14
14
  end
15
15
  end
16
16
  end
@@ -6,10 +6,10 @@ module Cocina
6
6
  # Unique identifier in some other system. This is because a large proportion of what is deposited in SDR, historically and currently, are representations of objects that are also represented in other systems. For example, digitized paper and A/V collections have physical manifestations, and those physical objects are managed in systems that have their own identifiers. Similarly, books have barcodes, archival materials have collection numbers and physical locations, etc. The sourceId allows determining if an item has been deposited before and where to look for the original item if you're looking at its SDR representation. The format is: "namespace:identifier"
7
7
 
8
8
  # example: sul:PC0170_s3_Fiesta_Bowl_2012-01-02_210609_2026
9
- attribute :sourceId, Types::Strict::String.optional.meta(omittable: true)
9
+ attribute :sourceId, Types::Strict::String.meta(omittable: true)
10
10
  attribute :catalogLinks, Types::Strict::Array.of(CatalogLink).meta(omittable: true)
11
11
  # A barcode
12
- attribute :barcode, Types::Nominal::Any.optional.meta(omittable: true)
12
+ attribute :barcode, Types::Nominal::Any.meta(omittable: true)
13
13
  end
14
14
  end
15
15
  end
@@ -5,27 +5,27 @@ module Cocina
5
5
  class Language < Struct
6
6
  attribute :appliesTo, Types::Strict::Array.of(DescriptiveBasicValue).meta(omittable: true)
7
7
  # Code value of the descriptive element.
8
- attribute :code, Types::Strict::String.optional.meta(omittable: true)
8
+ attribute :code, Types::Strict::String.meta(omittable: true)
9
9
  # The preferred display label to use for the descriptive element in access systems.
10
- attribute :displayLabel, Types::Strict::String.optional.meta(omittable: true)
10
+ attribute :displayLabel, Types::Strict::String.meta(omittable: true)
11
11
  attribute :encoding, Standard.optional.meta(omittable: true)
12
12
  attribute :groupedValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
13
13
  attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
14
14
  attribute :parallelValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
15
15
  # present for mapping to additional schemas in the future and for consistency but not otherwise used
16
- attribute :qualifier, Types::Strict::String.optional.meta(omittable: true)
16
+ attribute :qualifier, Types::Strict::String.meta(omittable: true)
17
17
  attribute :script, DescriptiveValue.optional.meta(omittable: true)
18
18
  attribute :source, Source.optional.meta(omittable: true)
19
19
  # Status of the language relative to other parallel language elements (e.g. the primary language)
20
- attribute :status, Types::Strict::String.optional.enum('primary').meta(omittable: true)
20
+ attribute :status, Types::Strict::String.enum('primary').meta(omittable: true)
21
21
  attribute :standard, Standard.optional.meta(omittable: true)
22
22
  attribute :structuredValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
23
23
  # URI value of the descriptive element.
24
- attribute :uri, Types::Strict::String.optional.meta(omittable: true)
24
+ attribute :uri, Types::Strict::String.meta(omittable: true)
25
25
  # Value of the descriptive element.
26
- attribute :value, Types::Strict::String.optional.meta(omittable: true)
26
+ attribute :value, Types::Strict::String.meta(omittable: true)
27
27
  # URL or other pointer to the location of the language information.
28
- attribute :valueAt, Types::Strict::String.optional.meta(omittable: true)
28
+ attribute :valueAt, Types::Strict::String.meta(omittable: true)
29
29
  attribute :valueLanguage, DescriptiveValueLanguage.optional.meta(omittable: true)
30
30
  end
31
31
  end
@@ -4,9 +4,9 @@ module Cocina
4
4
  module Models
5
5
  class Presentation < Struct
6
6
  # Height in pixels
7
- attribute :height, Types::Strict::Integer.optional.meta(omittable: true)
7
+ attribute :height, Types::Strict::Integer.meta(omittable: true)
8
8
  # Width in pixels
9
- attribute :width, Types::Strict::Integer.optional.meta(omittable: true)
9
+ attribute :width, Types::Strict::Integer.meta(omittable: true)
10
10
  end
11
11
  end
12
12
  end
@@ -4,11 +4,11 @@ module Cocina
4
4
  module Models
5
5
  class RelatedResource < Struct
6
6
  # The relationship of the related resource to the described resource.
7
- attribute :type, Types::Strict::String.optional.meta(omittable: true)
7
+ attribute :type, Types::Strict::String.meta(omittable: true)
8
8
  # Status of the related resource relative to other related resources.
9
- attribute :status, Types::Strict::String.optional.meta(omittable: true)
9
+ attribute :status, Types::Strict::String.meta(omittable: true)
10
10
  # The preferred display label to use for the related resource in access systems.
11
- attribute :displayLabel, Types::Strict::String.optional.meta(omittable: true)
11
+ attribute :displayLabel, Types::Strict::String.meta(omittable: true)
12
12
  attribute :title, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
13
13
  attribute :contributor, Types::Strict::Array.of(Contributor).meta(omittable: true)
14
14
  attribute :event, Types::Strict::Array.of(Event).meta(omittable: true)
@@ -19,14 +19,14 @@ module Cocina
19
19
  attribute :standard, Standard.optional.meta(omittable: true)
20
20
  attribute :subject, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
21
21
  # Stanford persistent URL associated with the related resource.
22
- attribute :purl, Types::Strict::String.optional.meta(omittable: true)
22
+ attribute :purl, Types::Strict::String.meta(omittable: true)
23
23
  attribute :access, DescriptiveAccessMetadata.optional.meta(omittable: true)
24
24
  attribute :relatedResource, Types::Strict::Array.of(RelatedResource).meta(omittable: true)
25
25
  attribute :adminMetadata, DescriptiveAdminMetadata.optional.meta(omittable: true)
26
26
  # The version of the related resource.
27
- attribute :version, Types::Strict::String.optional.meta(omittable: true)
27
+ attribute :version, Types::Strict::String.meta(omittable: true)
28
28
  # URL or other pointer to the location of the related resource information.
29
- attribute :valueAt, Types::Strict::String.optional.meta(omittable: true)
29
+ attribute :valueAt, Types::Strict::String.meta(omittable: true)
30
30
  end
31
31
  end
32
32
  end
@@ -5,15 +5,15 @@ module Cocina
5
5
  class ReleaseTag < Struct
6
6
  # Who did this release
7
7
  # example: petucket
8
- attribute :who, Types::Strict::String.optional.meta(omittable: true)
8
+ attribute :who, Types::Strict::String.meta(omittable: true)
9
9
  # What is being released. This item or the whole collection.
10
10
  # example: self
11
- attribute :what, Types::Strict::String.optional.enum('self', 'collection').meta(omittable: true)
11
+ attribute :what, Types::Strict::String.enum('self', 'collection').meta(omittable: true)
12
12
  # When did this action happen
13
- attribute :date, Types::Params::DateTime.optional.meta(omittable: true)
13
+ attribute :date, Types::Params::DateTime.meta(omittable: true)
14
14
  # What platform is it released to
15
15
  # example: Searchworks
16
- attribute :to, Types::Strict::String.optional.meta(omittable: true)
16
+ attribute :to, Types::Strict::String.meta(omittable: true)
17
17
  attribute :release, Types::Strict::Bool.default(false)
18
18
  end
19
19
  end
@@ -6,7 +6,7 @@ module Cocina
6
6
  attribute :contains, Types::Strict::Array.of(RequestFileSet).meta(omittable: true)
7
7
  attribute :hasMemberOrders, Types::Strict::Array.of(Sequence).meta(omittable: true)
8
8
  attribute :isMemberOf, Types::Strict::Array.of(Druid).meta(omittable: true)
9
- attribute :hasAgreement, Types::Strict::String.optional.meta(omittable: true)
9
+ attribute :hasAgreement, Types::Strict::String.meta(omittable: true)
10
10
  end
11
11
  end
12
12
  end
@@ -10,11 +10,11 @@ module Cocina
10
10
  attribute :type, Types::Strict::String.enum(*RequestFile::TYPES)
11
11
  attribute :label, Types::Strict::String
12
12
  attribute :filename, Types::Strict::String
13
- attribute :size, Types::Strict::Integer.optional.meta(omittable: true)
13
+ attribute :size, Types::Strict::Integer.meta(omittable: true)
14
14
  attribute :version, Types::Strict::Integer
15
- attribute :hasMimeType, Types::Strict::String.optional.meta(omittable: true)
16
- attribute :externalIdentifier, Types::Strict::String.optional.meta(omittable: true)
17
- attribute :use, Types::Strict::String.optional.meta(omittable: true)
15
+ attribute :hasMimeType, Types::Strict::String.meta(omittable: true)
16
+ attribute :externalIdentifier, Types::Strict::String.meta(omittable: true)
17
+ attribute :use, Types::Strict::String.meta(omittable: true)
18
18
  attribute :hasMessageDigests, Types::Strict::Array.of(MessageDigest).default([].freeze)
19
19
  attribute(:access, FileAccess.default { FileAccess.new })
20
20
  attribute(:administrative, FileAdministrative.default { FileAdministrative.new })
@@ -9,7 +9,7 @@ module Cocina
9
9
  attribute :sourceId, Types::Strict::String
10
10
  attribute :catalogLinks, Types::Strict::Array.of(CatalogLink).meta(omittable: true)
11
11
  # A barcode
12
- attribute :barcode, Types::Nominal::Any.optional.meta(omittable: true)
12
+ attribute :barcode, Types::Nominal::Any.meta(omittable: true)
13
13
  end
14
14
  end
15
15
  end
@@ -5,7 +5,7 @@ module Cocina
5
5
  class Sequence < Struct
6
6
  attribute :members, Types::Strict::Array.of(Types::Strict::String).meta(omittable: true)
7
7
  # The direction that a sequence of canvases should be displayed to the user
8
- attribute :viewingDirection, Types::Strict::String.optional.enum('right-to-left', 'left-to-right').meta(omittable: true)
8
+ attribute :viewingDirection, Types::Strict::String.enum('right-to-left', 'left-to-right').meta(omittable: true)
9
9
  end
10
10
  end
11
11
  end
@@ -4,14 +4,14 @@ module Cocina
4
4
  module Models
5
5
  class Source < Struct
6
6
  # Code representing the value source.
7
- attribute :code, Types::Strict::String.optional.meta(omittable: true)
7
+ attribute :code, Types::Strict::String.meta(omittable: true)
8
8
  # URI for the value source.
9
- attribute :uri, Types::Strict::String.optional.meta(omittable: true)
9
+ attribute :uri, Types::Strict::String.meta(omittable: true)
10
10
  # String describing the value source.
11
- attribute :value, Types::Strict::String.optional.meta(omittable: true)
11
+ attribute :value, Types::Strict::String.meta(omittable: true)
12
12
  attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
13
13
  # The version of the value source.
14
- attribute :version, Types::Strict::String.optional.meta(omittable: true)
14
+ attribute :version, Types::Strict::String.meta(omittable: true)
15
15
  end
16
16
  end
17
17
  end
@@ -4,14 +4,14 @@ module Cocina
4
4
  module Models
5
5
  class Standard < Struct
6
6
  # Code representing the standard or encoding.
7
- attribute :code, Types::Strict::String.optional.meta(omittable: true)
7
+ attribute :code, Types::Strict::String.meta(omittable: true)
8
8
  # URI for the standard or encoding.
9
- attribute :uri, Types::Strict::String.optional.meta(omittable: true)
9
+ attribute :uri, Types::Strict::String.meta(omittable: true)
10
10
  # String describing the standard or encoding.
11
- attribute :value, Types::Strict::String.optional.meta(omittable: true)
11
+ attribute :value, Types::Strict::String.meta(omittable: true)
12
12
  attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
13
13
  # The version of the standard or encoding.
14
- attribute :version, Types::Strict::String.optional.meta(omittable: true)
14
+ attribute :version, Types::Strict::String.meta(omittable: true)
15
15
  attribute :source, Source.optional.meta(omittable: true)
16
16
  end
17
17
  end
@@ -7,27 +7,27 @@ module Cocina
7
7
  attribute :parallelValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
8
8
  attribute :groupedValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
9
9
  # String or integer value of the descriptive element.
10
- attribute :value, Types::Nominal::Any.optional.meta(omittable: true)
10
+ attribute :value, Types::Nominal::Any.meta(omittable: true)
11
11
  # Type of value provided by the descriptive element.
12
- attribute :type, Types::Strict::String.optional.meta(omittable: true)
12
+ attribute :type, Types::Strict::String.meta(omittable: true)
13
13
  # Status of the descriptive element value relative to other instances of the element.
14
- attribute :status, Types::Strict::String.optional.meta(omittable: true)
14
+ attribute :status, Types::Strict::String.meta(omittable: true)
15
15
  # Code value of the descriptive element.
16
- attribute :code, Types::Strict::String.optional.meta(omittable: true)
16
+ attribute :code, Types::Strict::String.meta(omittable: true)
17
17
  # URI value of the descriptive element.
18
- attribute :uri, Types::Strict::String.optional.meta(omittable: true)
18
+ attribute :uri, Types::Strict::String.meta(omittable: true)
19
19
  attribute :standard, Standard.optional.meta(omittable: true)
20
20
  attribute :encoding, Standard.optional.meta(omittable: true)
21
21
  attribute :identifier, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
22
22
  attribute :source, Source.optional.meta(omittable: true)
23
23
  # The preferred display label to use for the descriptive element in access systems.
24
- attribute :displayLabel, Types::Strict::String.optional.meta(omittable: true)
24
+ attribute :displayLabel, Types::Strict::String.meta(omittable: true)
25
25
  # A term providing information about the circumstances of the statement (e.g., approximate dates).
26
- attribute :qualifier, Types::Strict::String.optional.meta(omittable: true)
26
+ attribute :qualifier, Types::Strict::String.meta(omittable: true)
27
27
  attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
28
28
  attribute :valueLanguage, DescriptiveValueLanguage.optional.meta(omittable: true)
29
29
  # URL or other pointer to the location of the value of the descriptive element.
30
- attribute :valueAt, Types::Strict::String.optional.meta(omittable: true)
30
+ attribute :valueAt, Types::Strict::String.meta(omittable: true)
31
31
  attribute :appliesTo, Types::Strict::Array.of(DescriptiveBasicValue).meta(omittable: true)
32
32
  end
33
33
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Cocina
4
4
  module Models
5
- VERSION = '0.58.1'
5
+ VERSION = '0.58.2'
6
6
  end
7
7
  end
data/openapi.yml CHANGED
@@ -275,6 +275,7 @@ components:
275
275
  description: The human readable copyright statement that applies
276
276
  example: Copyright World Trade Organization
277
277
  type: string
278
+ nullable: true
278
279
  download:
279
280
  description: >
280
281
  Download access level. This is used in the transition from Fedora as
@@ -294,6 +295,7 @@ components:
294
295
  readLocation at registration that is copied down to all the files.
295
296
 
296
297
  type: string
298
+ nullable: true
297
299
  enum:
298
300
  - 'spec'
299
301
  - 'music'
@@ -305,9 +307,11 @@ components:
305
307
  description: The human readable use and reproduction statement that applies
306
308
  example: Property rights reside with the repository. Literary rights reside with the creators of the documents or their heirs. To obtain permission to publish or reproduce, please contact the Public Services Librarian of the Dept. of Special Collections (http://library.stanford.edu/spc).
307
309
  type: string
310
+ nullable: true
308
311
  license:
309
312
  description: The license governing reuse of the Collection. Should be an IRI for known licenses (i.e. CC, RightsStatement.org URI, etc.).
310
313
  type: string
314
+ nullable: true
311
315
  AppliesTo:
312
316
  description: Property model for indicating the parts, aspects, or versions of the resource to which a
313
317
  descriptive element is applicable.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocina-models
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.58.1
4
+ version: 0.58.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Coyne