cocina-models 0.58.0 → 0.60.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +2 -0
  3. data/.rubocop_todo.yml +5 -5
  4. data/README.md +33 -24
  5. data/lib/cocina/generator/schema.rb +30 -2
  6. data/lib/cocina/generator/schema_array.rb +1 -1
  7. data/lib/cocina/generator/schema_base.rb +18 -8
  8. data/lib/cocina/generator/schema_ref.rb +1 -1
  9. data/lib/cocina/generator/schema_value.rb +2 -2
  10. data/lib/cocina/models/access.rb +10 -11
  11. data/lib/cocina/models/admin_policy_administrative.rb +3 -3
  12. data/lib/cocina/models/admin_policy_default_access.rb +4 -4
  13. data/lib/cocina/models/administrative.rb +1 -1
  14. data/lib/cocina/models/citation_only_access.rb +15 -0
  15. data/lib/cocina/models/collection.rb +1 -1
  16. data/lib/cocina/models/collection_access.rb +18 -0
  17. data/lib/cocina/models/collection_identification.rb +1 -1
  18. data/lib/cocina/models/contributor.rb +3 -3
  19. data/lib/cocina/models/controlled_digital_lending_access.rb +16 -0
  20. data/lib/cocina/models/dark_access.rb +15 -0
  21. data/lib/cocina/models/description.rb +2 -2
  22. data/lib/cocina/models/descriptive_basic_value.rb +8 -8
  23. data/lib/cocina/models/descriptive_parallel_contributor.rb +3 -3
  24. data/lib/cocina/models/descriptive_parallel_event.rb +2 -2
  25. data/lib/cocina/models/descriptive_value.rb +8 -8
  26. data/lib/cocina/models/descriptive_value_language.rb +4 -4
  27. data/lib/cocina/models/dro_access.rb +12 -10
  28. data/lib/cocina/models/dro_structural.rb +1 -1
  29. data/lib/cocina/models/embargo.rb +12 -3
  30. data/lib/cocina/models/event.rb +2 -2
  31. data/lib/cocina/models/file.rb +3 -3
  32. data/lib/cocina/models/file_access.rb +10 -7
  33. data/lib/cocina/models/identification.rb +2 -2
  34. data/lib/cocina/models/lane_medical_barcode.rb +9 -0
  35. data/lib/cocina/models/language.rb +7 -7
  36. data/lib/cocina/models/location_based_access.rb +15 -0
  37. data/lib/cocina/models/location_based_download_access.rb +15 -0
  38. data/lib/cocina/models/presentation.rb +2 -2
  39. data/lib/cocina/models/related_resource.rb +6 -6
  40. data/lib/cocina/models/release_tag.rb +4 -4
  41. data/lib/cocina/models/request_collection.rb +1 -1
  42. data/lib/cocina/models/request_dro_structural.rb +1 -1
  43. data/lib/cocina/models/request_file.rb +4 -4
  44. data/lib/cocina/models/request_identification.rb +1 -1
  45. data/lib/cocina/models/sequence.rb +1 -1
  46. data/lib/cocina/models/source.rb +4 -4
  47. data/lib/cocina/models/standard.rb +4 -4
  48. data/lib/cocina/models/stanford_access.rb +15 -0
  49. data/lib/cocina/models/title.rb +8 -8
  50. data/lib/cocina/models/version.rb +1 -1
  51. data/lib/cocina/models/world_access.rb +15 -0
  52. data/openapi.yml +320 -146
  53. metadata +11 -2
@@ -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
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cocina
4
+ module Models
5
+ class ControlledDigitalLendingAccess < Struct
6
+ # Access level.
7
+ attribute :access, Types::Strict::String.enum('stanford')
8
+ # Download access level.
9
+ attribute :download, Types::Strict::String.enum('none')
10
+ # If access is "location-based", which location should have access.
11
+ attribute :readLocation, Types::Strict::String.optional.enum('').meta(omittable: true)
12
+ # Available for controlled digital lending.
13
+ attribute :controlledDigitalLending, Types::Strict::Bool.default(false)
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cocina
4
+ module Models
5
+ class DarkAccess < Struct
6
+ # Access level.
7
+ attribute :access, Types::Strict::String.default('dark').enum('dark').meta(omittable: true)
8
+ # Download access level.
9
+ attribute :download, Types::Strict::String.default('none').enum('none').meta(omittable: true)
10
+ # If access is "location-based", which location should have access.
11
+ attribute :readLocation, Types::Strict::String.optional.enum('').meta(omittable: true)
12
+ attribute :controlledDigitalLending, Types::Strict::Bool.enum(false).meta(omittable: true)
13
+ end
14
+ end
15
+ 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,26 @@
3
3
  module Cocina
4
4
  module Models
5
5
  class DROAccess < Struct
6
- attribute :access, Types::Strict::String.default('dark').enum('world', 'stanford', 'location-based', 'citation-only', 'dark').optional.meta(omittable: true)
7
- # Available for controlled digital lending.
6
+ # Access level.
7
+ # Validation of this property is relaxed. See the openapi for full validation.
8
+ attribute :access, Types::Strict::String.optional.default('dark').meta(omittable: true)
9
+ # Download access level.
10
+ # Validation of this property is relaxed. See the openapi for full validation.
11
+ attribute :download, Types::Strict::String.optional.default('none').meta(omittable: true)
12
+ # If access is "location-based", which location should have access.
13
+ # Validation of this property is relaxed. See the openapi for full validation.
14
+ attribute :readLocation, Types::Strict::String.optional.meta(omittable: true)
15
+ # Validation of this property is relaxed. See the openapi for full validation.
8
16
  attribute :controlledDigitalLending, Types::Strict::Bool.optional.meta(omittable: true)
9
17
  # The human readable copyright statement that applies
10
18
  # example: Copyright World Trade Organization
11
19
  attribute :copyright, Types::Strict::String.optional.meta(omittable: true)
12
20
  attribute :embargo, Embargo.optional.meta(omittable: true)
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
-
15
- attribute :download, Types::Strict::String.default('none').enum('world', 'stanford', 'location-based', 'none').optional.meta(omittable: true)
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
-
18
- attribute :readLocation, Types::Strict::String.enum('spec', 'music', 'ars', 'art', 'hoover', 'm&m').optional.meta(omittable: true)
19
21
  # The human readable use and reproduction statement that applies
20
22
  # 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)
23
+ attribute :useAndReproductionStatement, Types::Strict::String.meta(omittable: true)
22
24
  # 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)
25
+ attribute :license, Types::Strict::String.enum('https://www.gnu.org/licenses/agpl.txt', 'https://www.apache.org/licenses/LICENSE-2.0', 'https://opensource.org/licenses/BSD-2-Clause', 'https://opensource.org/licenses/BSD-3-Clause', 'https://creativecommons.org/licenses/by/4.0/legalcode', 'https://creativecommons.org/licenses/by-nc/4.0/legalcode', 'https://creativecommons.org/licenses/by-nc-nd/4.0/legalcode', 'https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode', 'https://creativecommons.org/licenses/by-nd/4.0/legalcode', 'https://creativecommons.org/licenses/by-sa/4.0/legalcode', 'https://creativecommons.org/publicdomain/zero/1.0/legalcode', 'https://opensource.org/licenses/cddl1', 'https://www.eclipse.org/legal/epl-2.0', 'https://www.gnu.org/licenses/gpl-3.0-standalone.html', 'https://www.isc.org/downloads/software-support-policy/isc-license/', 'https://www.gnu.org/licenses/lgpl-3.0-standalone.html', 'https://opensource.org/licenses/MIT', 'https://www.mozilla.org/MPL/2.0/', 'https://opendatacommons.org/licenses/by/1-0/', 'http://opendatacommons.org/licenses/odbl/1.0/', 'https://opendatacommons.org/licenses/odbl/1-0/', 'https://creativecommons.org/publicdomain/mark/1.0/', 'https://opendatacommons.org/licenses/pddl/1-0/', 'https://creativecommons.org/licenses/by/3.0/legalcode', 'https://creativecommons.org/licenses/by-sa/3.0/legalcode', 'https://creativecommons.org/licenses/by-nd/3.0/legalcode', 'https://creativecommons.org/licenses/by-nc/3.0/legalcode', 'https://creativecommons.org/licenses/by-nc-sa/3.0/legalcode', 'https://creativecommons.org/licenses/by-nc-nd/3.0/legalcode', 'http://cocina.sul.stanford.edu/licenses/none').meta(omittable: true)
24
26
  end
25
27
  end
26
28
  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
@@ -3,14 +3,23 @@
3
3
  module Cocina
4
4
  module Models
5
5
  class Embargo < Struct
6
+ # Access level.
7
+ # Validation of this property is relaxed. See the openapi for full validation.
8
+ attribute :access, Types::Strict::String.optional.default('dark').meta(omittable: true)
9
+ # Download access level.
10
+ # Validation of this property is relaxed. See the openapi for full validation.
11
+ attribute :download, Types::Strict::String.optional.default('none').meta(omittable: true)
12
+ # If access is "location-based", which location should have access.
13
+ # Validation of this property is relaxed. See the openapi for full validation.
14
+ attribute :readLocation, Types::Strict::String.optional.meta(omittable: true)
15
+ # Validation of this property is relaxed. See the openapi for full validation.
16
+ attribute :controlledDigitalLending, Types::Strict::Bool.optional.meta(omittable: true)
6
17
  # Date when the Collection is released from an embargo.
7
18
  # example: 2029-06-22T07:00:00.000+00:00
8
19
  attribute :releaseDate, Types::Params::DateTime
9
- # Access level that applies when embargo expires.
10
- attribute :access, Types::Strict::String.enum('world', 'stanford', 'location-based', 'citation-only', 'dark')
11
20
  # The human readable use and reproduction statement that applies when the embargo expires.
12
21
  # example: These materials are in the public domain.
13
- attribute :useAndReproductionStatement, Types::Strict::String.optional.meta(omittable: true)
22
+ attribute :useAndReproductionStatement, Types::Strict::String.meta(omittable: true)
14
23
  end
15
24
  end
16
25
  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 })
@@ -3,14 +3,17 @@
3
3
  module Cocina
4
4
  module Models
5
5
  class FileAccess < Struct
6
- # Access level
7
- attribute :access, Types::Strict::String.default('dark').enum('world', 'stanford', 'location-based', 'citation-only', 'dark').optional.meta(omittable: true)
8
- # Available for controlled digital lending.
9
- attribute :controlledDigitalLending, Types::Strict::Bool.optional.meta(omittable: true)
10
- # Download access level for a file
11
- attribute :download, Types::Strict::String.default('none').enum('world', 'stanford', 'location-based', 'none').optional.meta(omittable: true)
6
+ # Access level.
7
+ # Validation of this property is relaxed. See the openapi for full validation.
8
+ attribute :access, Types::Strict::String.optional.default('dark').meta(omittable: true)
9
+ # Download access level.
10
+ # Validation of this property is relaxed. See the openapi for full validation.
11
+ attribute :download, Types::Strict::String.optional.default('none').meta(omittable: true)
12
12
  # If access is "location-based", which location should have access.
13
- attribute :readLocation, Types::Strict::String.enum('spec', 'music', 'ars', 'art', 'hoover', 'm&m').optional.meta(omittable: true)
13
+ # Validation of this property is relaxed. See the openapi for full validation.
14
+ attribute :readLocation, Types::Strict::String.optional.meta(omittable: true)
15
+ # Validation of this property is relaxed. See the openapi for full validation.
16
+ attribute :controlledDigitalLending, Types::Strict::Bool.optional.meta(omittable: true)
14
17
  end
15
18
  end
16
19
  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
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cocina
4
+ module Models
5
+ LaneMedicalBarcode = Types::String.constrained(
6
+ format: /^245[0-9]{8}$/i
7
+ )
8
+ end
9
+ 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.enum('primary').optional.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
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cocina
4
+ module Models
5
+ class LocationBasedAccess < Struct
6
+ # Access level.
7
+ attribute :access, Types::Strict::String.enum('location-based')
8
+ # Download access level.
9
+ attribute :download, Types::Strict::String.enum('location-based', 'none')
10
+ # If access is "location-based", which location should have access.
11
+ attribute :readLocation, Types::Strict::String.enum('spec', 'music', 'ars', 'art', 'hoover', 'm&m')
12
+ attribute :controlledDigitalLending, Types::Strict::Bool.enum(false).meta(omittable: true)
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cocina
4
+ module Models
5
+ class LocationBasedDownloadAccess < Struct
6
+ # Access level.
7
+ attribute :access, Types::Strict::String.enum('stanford', 'world')
8
+ # Download access level.
9
+ attribute :download, Types::Strict::String.enum('location-based')
10
+ # If access is "location-based", which location should have access.
11
+ attribute :readLocation, Types::Strict::String.enum('spec', 'music', 'ars', 'art', 'hoover', 'm&m')
12
+ attribute :controlledDigitalLending, Types::Strict::Bool.enum(false).meta(omittable: true)
13
+ end
14
+ end
15
+ 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