cocina-models 0.57.0 → 0.59.1

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: 327ee6c2265a055d884305f09a8e6ef984ef97890b133bf01c84ef11c4cb587f
4
- data.tar.gz: 727bfd13e69b3aee8f6d4820dc5a212eacb64ee8cb9d5a9d016f7de3d98493fb
3
+ metadata.gz: 044d66e2aee509ce5f2970efb3babce3edcef1548b632858ea7afe77f02375d5
4
+ data.tar.gz: 3ff6f328220ccb4cbf6206ab2dc75841990aca08121d34ac8f138af312a2083b
5
5
  SHA512:
6
- metadata.gz: 9438bc21b55a4f921314bcd77245bad9d023f40fd58bdae273ff8bc41658eec4aba38a4c670a71e747ab040583f0c16426a0e7dd3383f9d73288ce52c6040f8b
7
- data.tar.gz: 80b8dcd260337bc8c210ecec957435bebc0b4dfa9318e4ddd9de1a6cf15525e3202c2c21f1366f7e21372560e5a3ba304abde55930898025031d5fe5ba326149
6
+ metadata.gz: ed457c74141c2ed64b4727da01c5f118239695efd6b98e3b90fbf2fb799aab0083cb2adb0f5364fed97d83e83a0a3a4251d58f2b5445f84d06afc63c0967314d
7
+ data.tar.gz: 16498a071ed1c97111f1d960f444fd8f289ef5d69d115a43535796cadaf3f1c6f9ee3cd46f3a106026ddb0b0ca291766c0c19a0320e3c386f9d6f84dded9add7
data/.rubocop.yml CHANGED
@@ -79,6 +79,8 @@ Metrics/BlockLength:
79
79
 
80
80
  Metrics/MethodLength:
81
81
  Max: 14
82
+ Exclude:
83
+ - 'spec/cocina/models/file_access_spec.rb'
82
84
 
83
85
  # ----- RSpec ------
84
86
 
data/.rubocop_todo.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2020-09-08 19:05:09 UTC using RuboCop version 0.89.1.
3
+ # on 2021-04-16 17:25:55 UTC using RuboCop version 0.93.1.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
@@ -8,15 +8,15 @@
8
8
 
9
9
  # Offense count: 1
10
10
  # Configuration parameters: AllowedMethods.
11
- # AllowedMethods: present?, blank?, presence, try, try!
11
+ # AllowedMethods: present?, blank?, presence, try, try!, in?
12
12
  Lint/SafeNavigationChain:
13
13
  Exclude:
14
14
  - 'lib/cocina/generator/schema_base.rb'
15
15
 
16
16
  # Offense count: 1
17
- # Configuration parameters: IgnoredMethods.
18
- Metrics/CyclomaticComplexity:
19
- Max: 8
17
+ # Configuration parameters: CountKeywordArgs.
18
+ Metrics/ParameterLists:
19
+ Max: 6
20
20
 
21
21
  # Offense count: 1
22
22
  # Configuration parameters: MinBodyLength.
data/README.md CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
  This is a Ruby implementation of the SDR data model (named "COCINA"). The data being modeled includes digital repository objects.
10
10
 
11
- Validation is performed by openapi (using OpenAPIParser). Modeling is provided by dry-struct and dry-types. Together, these provide a way for consumers to validate objects against models and to manipulate thos objects.
11
+ Validation is performed by openapi (using OpenAPIParser). Modeling is provided by dry-struct and dry-types. Together, these provide a way for consumers to validate objects against models and to manipulate those objects.
12
12
 
13
13
  This is a work in progress that will ultimately implement the full [COCINA data model](http://sul-dlss.github.io/cocina-models/). See also [architecture documentation](https://sul-dlss.github.io/taco-truck/COCINA.html#cocina-data-models--shapes).
14
14
 
@@ -34,44 +34,53 @@ Beyond what is necessary to test the generator, the Cocina model classes are not
34
34
 
35
35
  ## Releasing
36
36
 
37
+ ### Step 0: Share intent to change the models
38
+
39
+ Send a note to `#dlss-infra-chg-mgmt` on Slack to let people know what is changing and when.
40
+
41
+ ### Step 1: Cut the release
42
+
37
43
  The release process is much like any other gem. First bump the version in `lib/cocina/models/version.rb`, and commit the result. Then run:
38
44
  ```
39
45
  bundle exec rake release
40
46
  ```
41
47
  which pushes the gem to rubygems.org. Next write up the release notes: https://github.com/sul-dlss/cocina-models/releases .
42
48
 
43
- Finally, you must release versions of [sdr-client](https://github.com/sul-dlss/sdr-client) and [dor-services-client](https://github.com/sul-dlss/dor-services-client/) pinned to this version because [Argo](https://github.com/sul-dlss/argo) depends on both of those. When [dor-services-app](https://github.com/sul-dlss/dor-services-app) is updated to use the new models (via the auto-update script), the clients must be updated at the same time or there is risk of models produced by dor-services-app not being acceptable to the clients.
49
+ ### Step 2: Update client gems coupled to the models
44
50
 
45
- ### Communicate
51
+ Next, you should release versions of [sdr-client](https://github.com/sul-dlss/sdr-client) and [dor-services-client](https://github.com/sul-dlss/dor-services-client/) pinned to this version because applications such as [Argo](https://github.com/sul-dlss/argo) depend on both of these gems using the same models.
46
52
 
47
- Send a note to `#dlss-infra-chg-mgmt` on Slack to let people know what is changing and when.
53
+ ### Step 3: Update service API specifications and gems
54
+
55
+ The cocina-models gem is used in applications that have an API specification that accepts Cocina models. Next, make sure that the `openapi.yml` for these applications include the `openapi.yml` schema changes made in cocina-models. This list of services is known to include:
56
+
57
+ * [sul-dlss/sdr-api](https://github.com/sul-dlss/sdr-api)
58
+ * [sul-dlss/dor-services-app](https://github.com/sul-dlss/dor-services-app/)
48
59
 
49
- ### Dependent Services
60
+ This can be accomplished by copying and pasting these schemas. By convention, these schemas are listed first in the `openapi.yml` of the associated projects, followed by the application-specific schemas.
50
61
 
51
- Once the above listed gems are updated all the following services that use cocina-models should be updated and released at the same time:
62
+ #### Step 3b: Bump gems
52
63
 
53
- * sul-dlss/sdr-api
54
- * sul-dlss/dor-services-app
55
- * sul-dlss/google-books
56
- * sul-dlss/common-accessioning
57
- * sul-dlss/argo
58
- * sul-dlss/pre-assembly
59
- * sul-dlss/hydrus
60
- * sul-dlss/happy-heron
61
- * sul-dlss/infrastructure-integration-test
62
- * sul-dlss/dor_indexing_app
64
+ At the same, we have found it convenient to use these PRs to also bump the versions of cocina-models, sdr-client, and dor-services-client in these applications/services. Why? When [dor-services-app](https://github.com/sul-dlss/dor-services-app), for example, is updated to use the new models (via the auto-update script), these clients should be updated at the same time or there is risk of models produced by dor-services-app not being acceptable to the clients.
63
65
 
64
- ## Using this gem
66
+ ### Step 4: Update other dependent applications
65
67
 
66
- If you are using this gem in an application that has an API that accepts Cocina models (e.g., SDR API, Dor-Services-App), make sure that the `openapi.yml` for the application includes the schemas that match the schemas in this `openapi.yml`.
68
+ Once the above listed steps have been completed, all the following applications that use cocina-models should be updated and released at the same time:
67
69
 
68
- This can be accomplished by cutting and pasting these schemas. By convention, these schemas are listed first in the `openapi.yml` of the associated projects, followed by the application-specific schemas.
70
+ * [sul-dlss/dor_indexing_app](https://github.com/sul-dlss/dor_indexing_app/)
71
+ * [sul-dlss/common-accessioning](https://github.com/sul-dlss/common-accessioning/)
72
+ * [sul-dlss/google-books](https://github.com/sul-dlss/google-books/)
73
+ * [sul-dlss/argo](https://github.com/sul-dlss/argo/)
74
+ * [sul-dlss/pre-assembly](https://github.com/sul-dlss/pre-assembly/)
75
+ * [sul-dlss/hydrus](https://github.com/sul-dlss/hydrus/)
76
+ * [sul-dlss/happy-heron](https://github.com/sul-dlss/happy-heron/)
77
+ * [sul-dlss/infrastructure-integration-test](https://github.com/sul-dlss/infrastructure-integration-test/)
69
78
 
70
- ### Usage conventions
79
+ ## Usage conventions
71
80
 
72
81
  The following are the recommended naming conventions for code using Cocina models:
73
82
 
74
- * cocina_item: Cocina::Models::DRO instance
75
- * cocina_admin_policy: Cocina::Models::AdminPolicy instance
76
- * cocina_collection: Cocina::Models::Collection instance
77
- * cocina_object: Cocina::Models::DRO or Cocina::Models::AdminPolicy or Cocina::Models::Collection instance
83
+ * `cocina_item`: `Cocina::Models::DRO` instance
84
+ * `cocina_admin_policy`: `Cocina::Models::AdminPolicy` instance
85
+ * `cocina_collection`: `Cocina::Models::Collection` instance
86
+ * `cocina_object`: `Cocina::Models::DRO` or `Cocina::Models::AdminPolicy` or `Cocina::Models::Collection` instance
@@ -5,7 +5,7 @@ module Cocina
5
5
  # Class for generating from an openapi schema
6
6
  class Schema < SchemaBase
7
7
  def schema_properties
8
- @schema_properties ||= (properties + all_of_properties).uniq(&:key)
8
+ @schema_properties ||= (properties + all_of_properties + one_of_properties).uniq(&:key)
9
9
  end
10
10
 
11
11
  def generate
@@ -83,20 +83,48 @@ module Cocina
83
83
  all_of_properties_for(schema_doc)
84
84
  end
85
85
 
86
+ def one_of_properties
87
+ one_of_properties_for(schema_doc)
88
+ end
89
+
86
90
  def all_of_properties_for(doc)
87
91
  return [] if doc.all_of.nil?
88
92
 
89
93
  doc.all_of.map do |all_of_schema|
90
94
  # All of for this + recurse
91
- schema_properties_for(all_of_schema) + all_of_properties_for(all_of_schema)
95
+ schema_properties_for(all_of_schema) +
96
+ all_of_properties_for(all_of_schema) +
97
+ one_of_properties_for(all_of_schema)
92
98
  end.flatten
93
99
  end
94
100
 
101
+ def one_of_properties_for(doc)
102
+ return [] if doc.one_of.nil?
103
+
104
+ # All properties must be objects.
105
+ unless doc.one_of.all? { |schema| schema.type == 'object' }
106
+ raise 'All properties for oneOf must be objects'
107
+ end
108
+
109
+ doc.one_of.flat_map do |one_of_doc|
110
+ one_of_doc.properties.map do |key, properties_doc|
111
+ property_class_for(properties_doc).new(properties_doc,
112
+ key: key,
113
+ # The property does less validation because may vary between
114
+ # different oneOf schemas. Validation is still performed
115
+ # by openAPI.
116
+ relaxed: true,
117
+ parent: self)
118
+ end
119
+ end
120
+ end
121
+
95
122
  def schema_properties_for(doc)
96
123
  doc.properties.map do |key, properties_doc|
97
124
  property_class_for(properties_doc).new(properties_doc,
98
125
  key: key,
99
126
  required: doc.requires?(key),
127
+ nullable: properties_doc.nullable?,
100
128
  parent: self)
101
129
  end
102
130
  end
@@ -9,7 +9,7 @@ module Cocina
9
9
  end
10
10
 
11
11
  def omittable
12
- if required
12
+ if required && !relaxed
13
13
  '.default([].freeze)'
14
14
  else
15
15
  '.meta(omittable: true)'
@@ -4,13 +4,15 @@ 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, :relaxed
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, relaxed: false)
10
10
  @schema_doc = schema_doc
11
11
  @key = key
12
12
  @required = required
13
+ @nullable = nullable
13
14
  @parent = parent
15
+ @relaxed = relaxed
14
16
  end
15
17
 
16
18
  def filename
@@ -21,12 +23,20 @@ module Cocina
21
23
  key || schema_doc.name
22
24
  end
23
25
 
26
+ # Allows non-required values to not be provided. This allows smaller
27
+ # requests as not every field needs to be present.
24
28
  def omittable
25
- return '' if required
29
+ return '' if required && !relaxed
26
30
 
27
31
  '.meta(omittable: true)'
28
32
  end
29
33
 
34
+ # Allows nillable values to be set to nil. This is useful when doing
35
+ # an update and you want to clear out a value.
36
+ def optional
37
+ nullable || relaxed ? '.optional' : ''
38
+ end
39
+
30
40
  def quote(item)
31
41
  return item unless schema_doc.type == 'string'
32
42
 
@@ -45,6 +55,12 @@ module Cocina
45
55
  "# example: #{schema_doc.example}\n"
46
56
  end
47
57
 
58
+ def relaxed_comment
59
+ return '' unless relaxed
60
+
61
+ "# Validation of this property is relaxed. See the openapi for full validation.\n"
62
+ end
63
+
48
64
  def dry_datatype(doc)
49
65
  case doc.type
50
66
  when 'integer'
@@ -54,7 +70,7 @@ module Cocina
54
70
  when 'boolean'
55
71
  'Strict::Bool'
56
72
  else
57
- if doc.one_of&.map(&:type).all? { |o| %w[integer string].include?(o) }
73
+ if any_datatype?(doc)
58
74
  'Nominal::Any'
59
75
  else
60
76
  raise "#{schema_doc.type} not supported"
@@ -62,6 +78,10 @@ module Cocina
62
78
  end
63
79
  end
64
80
 
81
+ def any_datatype?(doc)
82
+ relaxed || doc.one_of&.map(&:type).all? { |o| %w[integer string].include?(o) }
83
+ end
84
+
65
85
  def string_dry_datatype(doc)
66
86
  case doc.format
67
87
  when 'date-time'
@@ -5,7 +5,7 @@ module Cocina
5
5
  # Class for generating from an openapi reference
6
6
  class SchemaRef < SchemaBase
7
7
  def generate
8
- if required
8
+ if required && !relaxed
9
9
  "attribute(:#{name.camelize(:lower)}, #{schema_doc.name}.default { #{schema_doc.name}.new })"
10
10
  else
11
11
  "attribute :#{name.camelize(:lower)}, #{schema_doc.name}.optional.meta(omittable: true)"
@@ -6,14 +6,15 @@ module Cocina
6
6
  class SchemaValue < SchemaBase
7
7
  # rubocop:disable Layout/LineLength
8
8
  def generate
9
- "#{description}#{example}attribute :#{name.camelize(:lower)}, Types::#{dry_datatype(schema_doc)}#{default}#{enum}#{omittable}"
9
+ # optional has to come before default or the default value that gets set will be nil.
10
+ "#{description}#{example}#{relaxed_comment}attribute :#{name.camelize(:lower)}, Types::#{dry_datatype(schema_doc)}#{optional}#{default}#{enum}#{omittable}"
10
11
  end
11
12
  # rubocop:enable Layout/LineLength
12
13
 
13
14
  private
14
15
 
15
16
  def enum
16
- return '' unless schema_doc.enum
17
+ return '' if !schema_doc.enum || relaxed
17
18
 
18
19
  items = use_types? ? "*#{parent.name}::TYPES" : schema_doc.enum.map { |item| quote(item) }.join(', ')
19
20
 
@@ -3,18 +3,17 @@
3
3
  module Cocina
4
4
  module Models
5
5
  class Access < Struct
6
- # Access level
7
- attribute :access, Types::Strict::String.default('dark').enum('world', 'stanford', 'location-based', 'citation-only', 'dark').meta(omittable: true)
8
- # The human readable copyright statement that applies
9
- # example: Copyright World Trade Organization
10
- attribute :copyright, Types::Strict::String.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)
11
12
  # If access is "location-based", which location should have access.
12
- attribute :readLocation, Types::Strict::String.enum('spec', 'music', 'ars', 'art', 'hoover', 'm&m').meta(omittable: true)
13
- # The human readable use and reproduction statement that applies
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.meta(omittable: true)
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.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)
18
17
  end
19
18
  end
20
19
  end
@@ -8,18 +8,18 @@ module Cocina
8
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.meta(omittable: true)
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
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
- attribute :readLocation, Types::Strict::String.enum('spec', 'music', 'ars', 'art', 'hoover', 'm&m').meta(omittable: true)
17
+ attribute :readLocation, Types::Strict::String.optional.enum('spec', 'music', 'ars', 'art', 'hoover', 'm&m').meta(omittable: true)
18
18
  # The human readable use and reproduction statement that applies
19
19
  # 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).
20
- attribute :useAndReproductionStatement, Types::Strict::String.meta(omittable: true)
20
+ attribute :useAndReproductionStatement, Types::Strict::String.optional.meta(omittable: true)
21
21
  # The license governing reuse of the Collection. Should be an IRI for known licenses (i.e. CC, RightsStatement.org URI, etc.).
22
- attribute :license, Types::Strict::String.meta(omittable: true)
22
+ attribute :license, Types::Strict::String.optional.meta(omittable: true)
23
23
  end
24
24
  end
25
25
  end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cocina
4
+ module Models
5
+ class CitationOnlyAccess < Struct
6
+ # Access level.
7
+ attribute :access, Types::Strict::String.enum('citation-only')
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
+ attribute :controlledDigitalLending, Types::Strict::Bool.enum(false).meta(omittable: true)
13
+ end
14
+ end
15
+ end
@@ -20,7 +20,7 @@ module Cocina
20
20
  attribute :label, Types::Strict::String
21
21
  # Version for the Collection within SDR.
22
22
  attribute :version, Types::Strict::Integer
23
- attribute(:access, Access.default { Access.new })
23
+ attribute(:access, CollectionAccess.default { CollectionAccess.new })
24
24
  attribute :administrative, Administrative.optional.meta(omittable: true)
25
25
  attribute :description, Description.optional.meta(omittable: true)
26
26
  attribute :identification, CollectionIdentification.optional.meta(omittable: true)
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cocina
4
+ module Models
5
+ class CollectionAccess < Struct
6
+ # Access level
7
+ attribute :access, Types::Strict::String.default('dark').enum('world', 'dark').meta(omittable: true)
8
+ # The human readable copyright statement that applies
9
+ # example: Copyright World Trade Organization
10
+ attribute :copyright, Types::Strict::String.optional.meta(omittable: true)
11
+ # The human readable use and reproduction statement that applies
12
+ # 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).
13
+ attribute :useAndReproductionStatement, Types::Strict::String.meta(omittable: true)
14
+ # The license governing reuse of the Collection. Should be an IRI for known licenses (i.e. CC, RightsStatement.org URI, etc.).
15
+ attribute :license, Types::Strict::String.meta(omittable: true)
16
+ end
17
+ end
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
@@ -3,19 +3,21 @@
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').meta(omittable: true)
7
- # Available for controlled digital lending.
8
- attribute :controlledDigitalLending, Types::Strict::Bool.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
+ # 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)
9
17
  # The human readable copyright statement that applies
10
18
  # example: Copyright World Trade Organization
11
- attribute :copyright, Types::Strict::String.meta(omittable: true)
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').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').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
23
  attribute :useAndReproductionStatement, Types::Strict::String.meta(omittable: true)
@@ -3,11 +3,20 @@
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
22
  attribute :useAndReproductionStatement, Types::Strict::String.meta(omittable: true)
@@ -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').meta(omittable: true)
8
- # Available for controlled digital lending.
9
- attribute :controlledDigitalLending, Types::Strict::Bool.meta(omittable: true)
10
- # Download access level for a file
11
- attribute :download, Types::Strict::String.default('none').enum('world', 'stanford', 'location-based', 'none').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').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
@@ -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
@@ -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
@@ -15,7 +15,7 @@ module Cocina
15
15
  attribute :type, Types::Strict::String.enum(*RequestCollection::TYPES)
16
16
  attribute :label, Types::Strict::String
17
17
  attribute :version, Types::Strict::Integer
18
- attribute(:access, Access.default { Access.new })
18
+ attribute(:access, CollectionAccess.default { CollectionAccess.new })
19
19
  attribute(:administrative, Administrative.default { Administrative.new })
20
20
  attribute :description, Description.optional.meta(omittable: true)
21
21
  attribute :identification, CollectionIdentification.optional.meta(omittable: true)
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cocina
4
+ module Models
5
+ class StanfordAccess < Struct
6
+ # Access level.
7
+ attribute :access, Types::Strict::String.enum('stanford')
8
+ # Download access level.
9
+ attribute :download, Types::Strict::String.enum('stanford')
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Cocina
4
4
  module Models
5
- VERSION = '0.57.0'
5
+ VERSION = '0.59.1'
6
6
  end
7
7
  end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cocina
4
+ module Models
5
+ class WorldAccess < Struct
6
+ # Access level.
7
+ attribute :access, Types::Strict::String.enum('world')
8
+ # Download access level.
9
+ attribute :download, Types::Strict::String.enum('none', 'stanford', 'world')
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
data/openapi.yml CHANGED
@@ -94,41 +94,16 @@ paths:
94
94
  components:
95
95
  schemas:
96
96
  Access:
97
- description: Access metadata for collections
98
97
  type: object
99
- additionalProperties: false
100
- properties:
101
- access:
102
- description: Access level
103
- type: string
104
- enum:
105
- - 'world'
106
- - 'stanford'
107
- - 'location-based'
108
- - 'citation-only'
109
- - 'dark'
110
- default: 'dark'
111
- copyright:
112
- description: The human readable copyright statement that applies
113
- example: Copyright World Trade Organization
114
- type: string
115
- readLocation:
116
- description: If access is "location-based", which location should have access.
117
- type: string
118
- enum:
119
- - 'spec'
120
- - 'music'
121
- - 'ars'
122
- - 'art'
123
- - 'hoover'
124
- - 'm&m'
125
- useAndReproductionStatement:
126
- description: The human readable use and reproduction statement that applies
127
- 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).
128
- type: string
129
- license:
130
- description: The license governing reuse of the Collection. Should be an IRI for known licenses (i.e. CC, RightsStatement.org URI, etc.).
131
- type: string
98
+ oneOf:
99
+ # Being first, makes DarkAccess the default.
100
+ - $ref: '#/components/schemas/DarkAccess'
101
+ - $ref: '#/components/schemas/CitationOnlyAccess'
102
+ - $ref: '#/components/schemas/ControlledDigitalLendingAccess'
103
+ - $ref: '#/components/schemas/LocationBasedAccess'
104
+ - $ref: '#/components/schemas/LocationBasedDownloadAccess'
105
+ - $ref: '#/components/schemas/StanfordAccess'
106
+ - $ref: '#/components/schemas/WorldAccess'
132
107
  AccessRole:
133
108
  description: Access role conferred by an AdminPolicy to objects within it. (used by Argo)
134
109
  type: object
@@ -275,6 +250,7 @@ components:
275
250
  description: The human readable copyright statement that applies
276
251
  example: Copyright World Trade Organization
277
252
  type: string
253
+ nullable: true
278
254
  download:
279
255
  description: >
280
256
  Download access level. This is used in the transition from Fedora as
@@ -294,6 +270,7 @@ components:
294
270
  readLocation at registration that is copied down to all the files.
295
271
 
296
272
  type: string
273
+ nullable: true
297
274
  enum:
298
275
  - 'spec'
299
276
  - 'music'
@@ -305,9 +282,11 @@ components:
305
282
  description: The human readable use and reproduction statement that applies
306
283
  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
284
  type: string
285
+ nullable: true
308
286
  license:
309
287
  description: The license governing reuse of the Collection. Should be an IRI for known licenses (i.e. CC, RightsStatement.org URI, etc.).
310
288
  type: string
289
+ nullable: true
311
290
  AppliesTo:
312
291
  description: Property model for indicating the parts, aspects, or versions of the resource to which a
313
292
  descriptive element is applicable.
@@ -322,6 +301,7 @@ components:
322
301
  description: 'A barcode'
323
302
  oneOf:
324
303
  - $ref: '#/components/schemas/BusinessBarcode'
304
+ - $ref: '#/components/schemas/LaneMedicalBarcode'
325
305
  - $ref: '#/components/schemas/CatkeyBarcode'
326
306
  - $ref: '#/components/schemas/StandardBarcode'
327
307
  BusinessBarcode:
@@ -329,6 +309,11 @@ components:
329
309
  type: string
330
310
  pattern: '^2050[0-9]{7}$'
331
311
  example: 20503740296
312
+ LaneMedicalBarcode:
313
+ description: The barcode associated with a Lane Medical Library DRO object, prefixed with 245
314
+ type: string
315
+ pattern: '^245[0-9]{8}$'
316
+ example: 24503259768
332
317
  CatalogLink:
333
318
  type: object
334
319
  additionalProperties: false
@@ -349,6 +334,33 @@ components:
349
334
  type: string
350
335
  pattern: '^[0-9]+-[0-9]+$'
351
336
  example: 6772719-1001
337
+ CitationOnlyAccess:
338
+ type: object
339
+ properties:
340
+ access:
341
+ description: Access level.
342
+ type: string
343
+ enum:
344
+ - citation-only
345
+ download:
346
+ description: Download access level.
347
+ type: string
348
+ enum:
349
+ - 'none'
350
+ readLocation:
351
+ description: If access is "location-based", which location should have access.
352
+ type: string
353
+ nullable: true
354
+ enum:
355
+ - null
356
+ controlledDigitalLending:
357
+ type: boolean
358
+ default: false
359
+ enum:
360
+ - false
361
+ required:
362
+ - access
363
+ - download
352
364
  Collection:
353
365
  description: A group of Digital Repository Objects that indicate some type of conceptual grouping within the domain that is worth reusing across the system.
354
366
  type: object
@@ -373,7 +385,7 @@ components:
373
385
  description: Version for the Collection within SDR.
374
386
  type: integer
375
387
  access:
376
- $ref: '#/components/schemas/Access'
388
+ $ref: '#/components/schemas/CollectionAccess'
377
389
  administrative:
378
390
  $ref: '#/components/schemas/Administrative'
379
391
  description:
@@ -386,6 +398,30 @@ components:
386
398
  - type
387
399
  - version
388
400
  - access
401
+ CollectionAccess:
402
+ description: Access metadata for collections
403
+ type: object
404
+ additionalProperties: false
405
+ properties:
406
+ access:
407
+ description: Access level
408
+ type: string
409
+ enum:
410
+ - 'world'
411
+ - 'dark'
412
+ default: 'dark'
413
+ copyright:
414
+ description: The human readable copyright statement that applies
415
+ example: Copyright World Trade Organization
416
+ type: string
417
+ nullable: true
418
+ useAndReproductionStatement:
419
+ description: The human readable use and reproduction statement that applies
420
+ 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).
421
+ type: string
422
+ license:
423
+ description: The license governing reuse of the Collection. Should be an IRI for known licenses (i.e. CC, RightsStatement.org URI, etc.).
424
+ type: string
389
425
  CollectionIdentification:
390
426
  type: object
391
427
  additionalProperties: false
@@ -438,6 +474,60 @@ components:
438
474
  type: array
439
475
  items:
440
476
  $ref: "#/components/schemas/DescriptiveParallelContributor"
477
+ ControlledDigitalLendingAccess:
478
+ type: object
479
+ properties:
480
+ access:
481
+ description: Access level.
482
+ type: string
483
+ enum:
484
+ - stanford
485
+ download:
486
+ description: Download access level.
487
+ type: string
488
+ enum:
489
+ - none
490
+ readLocation:
491
+ description: If access is "location-based", which location should have access.
492
+ type: string
493
+ nullable: true
494
+ enum:
495
+ - null
496
+ controlledDigitalLending:
497
+ description: Available for controlled digital lending.
498
+ type: boolean
499
+ default: false
500
+ required:
501
+ - access
502
+ - download
503
+ - controlledDigitalLending
504
+ DarkAccess:
505
+ type: object
506
+ properties:
507
+ access:
508
+ description: Access level.
509
+ type: string
510
+ default: 'dark'
511
+ enum:
512
+ - dark
513
+ download:
514
+ description: Download access level.
515
+ type: string
516
+ default: 'none'
517
+ enum:
518
+ - 'none'
519
+ readLocation:
520
+ description: If access is "location-based", which location should have access.
521
+ type: string
522
+ nullable: true
523
+ default: null
524
+ enum:
525
+ - null
526
+ controlledDigitalLending:
527
+ type: boolean
528
+ default: false
529
+ enum:
530
+ - false
441
531
  Description:
442
532
  type: object
443
533
  additionalProperties: false
@@ -844,60 +934,24 @@ components:
844
934
  DROAccess:
845
935
  type: object
846
936
  additionalProperties: false
847
- properties:
848
- access:
849
- type: string
850
- enum:
851
- - 'world'
852
- - 'stanford'
853
- - 'location-based'
854
- - 'citation-only'
855
- - 'dark'
856
- default: 'dark'
857
- controlledDigitalLending:
858
- description: Available for controlled digital lending.
859
- type: boolean
860
- default: false
861
- copyright:
862
- description: The human readable copyright statement that applies
863
- example: Copyright World Trade Organization
864
- type: string
865
- embargo:
866
- $ref: '#/components/schemas/Embargo'
867
- download:
868
- description: >
869
- Download access level. This is used in the transition from Fedora as
870
- a way to set a default download level at registration that is copied
871
- down to all the files.
872
-
873
- type: string
874
- enum:
875
- - 'world'
876
- - 'stanford'
877
- - 'location-based'
878
- - 'none'
879
- default: 'none'
880
- readLocation:
881
- description: >
882
- If access is "location-based", which location should have access.
883
- This is used in the transition from Fedora as a way to set a default
884
- readLocation at registration that is copied down to all the files.
885
-
886
- type: string
887
- enum:
888
- - 'spec'
889
- - 'music'
890
- - 'ars'
891
- - 'art'
892
- - 'hoover'
893
- - 'm&m'
894
- useAndReproductionStatement:
895
- description: The human readable use and reproduction statement that applies
896
- 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).
897
- type: string
898
- license:
899
- description: The license governing reuse of the DRO. Should be an IRI for known licenses (i.e. CC, RightsStatement.org URI, etc.).
900
- type: string
937
+ allOf:
938
+ - $ref: "#/components/schemas/Access"
939
+ - type: object
940
+ properties:
941
+ copyright:
942
+ description: The human readable copyright statement that applies
943
+ example: Copyright World Trade Organization
944
+ type: string
945
+ nullable: true
946
+ embargo:
947
+ $ref: '#/components/schemas/Embargo'
948
+ useAndReproductionStatement:
949
+ description: The human readable use and reproduction statement that applies
950
+ 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).
951
+ type: string
952
+ license:
953
+ description: The license governing reuse of the DRO. Should be an IRI for known licenses (i.e. CC, RightsStatement.org URI, etc.).
954
+ type: string
901
955
  DROStructural:
902
956
  description: Structural metadata
903
957
  type: object
@@ -928,28 +982,21 @@ components:
928
982
  Embargo:
929
983
  type: object
930
984
  additionalProperties: false
931
- properties:
932
- releaseDate:
933
- description: Date when the Collection is released from an embargo.
934
- type: string
935
- format: date-time
936
- example: '2029-06-22T07:00:00.000+00:00'
937
- access:
938
- description: Access level that applies when embargo expires.
939
- type: string
940
- enum:
941
- - world
942
- - stanford
943
- - location-based
944
- - citation-only
945
- - dark
946
- useAndReproductionStatement:
947
- description: The human readable use and reproduction statement that applies when the embargo expires.
948
- example: These materials are in the public domain.
949
- type: string
950
- required:
951
- - releaseDate
952
- - access
985
+ allOf:
986
+ - $ref: "#/components/schemas/Access"
987
+ - type: object
988
+ properties:
989
+ releaseDate:
990
+ description: Date when the Collection is released from an embargo.
991
+ type: string
992
+ format: date-time
993
+ example: '2029-06-22T07:00:00.000+00:00'
994
+ useAndReproductionStatement:
995
+ description: The human readable use and reproduction statement that applies when the embargo expires.
996
+ example: These materials are in the public domain.
997
+ type: string
998
+ required:
999
+ - releaseDate
953
1000
  Event:
954
1001
  description: Property model for describing events in the history of the resource.
955
1002
  type: object
@@ -1052,40 +1099,14 @@ components:
1052
1099
  description: Access metadata for files
1053
1100
  type: object
1054
1101
  additionalProperties: false
1055
- properties:
1056
- access:
1057
- description: Access level
1058
- type: string
1059
- enum:
1060
- - 'world'
1061
- - 'stanford'
1062
- - 'location-based'
1063
- - 'citation-only'
1064
- - 'dark'
1065
- default: 'dark'
1066
- controlledDigitalLending:
1067
- description: Available for controlled digital lending.
1068
- type: boolean
1069
- default: false
1070
- download:
1071
- description: Download access level for a file
1072
- type: string
1073
- enum:
1074
- - 'world'
1075
- - 'stanford'
1076
- - 'location-based'
1077
- - 'none'
1078
- default: 'none'
1079
- readLocation:
1080
- description: If access is "location-based", which location should have access.
1081
- type: string
1082
- enum:
1083
- - 'spec'
1084
- - 'music'
1085
- - 'ars'
1086
- - 'art'
1087
- - 'hoover'
1088
- - 'm&m'
1102
+ oneOf:
1103
+ # Being first, makes DarkAccess the default.
1104
+ - $ref: '#/components/schemas/DarkAccess'
1105
+ - $ref: '#/components/schemas/ControlledDigitalLendingAccess'
1106
+ - $ref: '#/components/schemas/LocationBasedAccess'
1107
+ - $ref: '#/components/schemas/LocationBasedDownloadAccess'
1108
+ - $ref: '#/components/schemas/StanfordAccess'
1109
+ - $ref: '#/components/schemas/WorldAccess'
1089
1110
  FileAdministrative:
1090
1111
  type: object
1091
1112
  additionalProperties: false
@@ -1243,6 +1264,72 @@ components:
1243
1264
  valueLanguage:
1244
1265
  # description: present for mapping to additional schemas in the future and for consistency but not otherwise used
1245
1266
  $ref: "#/components/schemas/DescriptiveValueLanguage"
1267
+ LocationBasedAccess:
1268
+ type: object
1269
+ properties:
1270
+ access:
1271
+ description: Access level.
1272
+ type: string
1273
+ enum:
1274
+ - location-based
1275
+ download:
1276
+ description: Download access level.
1277
+ type: string
1278
+ enum:
1279
+ - location-based
1280
+ - none
1281
+ readLocation:
1282
+ description: If access is "location-based", which location should have access.
1283
+ type: string
1284
+ enum:
1285
+ - 'spec'
1286
+ - 'music'
1287
+ - 'ars'
1288
+ - 'art'
1289
+ - 'hoover'
1290
+ - 'm&m'
1291
+ controlledDigitalLending:
1292
+ type: boolean
1293
+ default: false
1294
+ enum:
1295
+ - false
1296
+ required:
1297
+ - access
1298
+ - download
1299
+ - readLocation
1300
+ LocationBasedDownloadAccess:
1301
+ type: object
1302
+ properties:
1303
+ access:
1304
+ description: Access level.
1305
+ type: string
1306
+ enum:
1307
+ - stanford
1308
+ - world
1309
+ download:
1310
+ description: Download access level.
1311
+ type: string
1312
+ enum:
1313
+ - location-based
1314
+ readLocation:
1315
+ description: If access is "location-based", which location should have access.
1316
+ type: string
1317
+ enum:
1318
+ - 'spec'
1319
+ - 'music'
1320
+ - 'ars'
1321
+ - 'art'
1322
+ - 'hoover'
1323
+ - 'm&m'
1324
+ controlledDigitalLending:
1325
+ type: boolean
1326
+ default: false
1327
+ enum:
1328
+ - false
1329
+ required:
1330
+ - access
1331
+ - download
1332
+ - readLocation
1246
1333
  MessageDigest:
1247
1334
  description: The output of the message digest algorithm.
1248
1335
  type: object
@@ -1420,7 +1507,7 @@ components:
1420
1507
  version:
1421
1508
  type: integer
1422
1509
  access:
1423
- $ref: '#/components/schemas/Access'
1510
+ $ref: '#/components/schemas/CollectionAccess'
1424
1511
  administrative:
1425
1512
  $ref: '#/components/schemas/Administrative'
1426
1513
  description:
@@ -1700,3 +1787,59 @@ components:
1700
1787
  - type: object
1701
1788
  required:
1702
1789
  - valueAt
1790
+ StanfordAccess:
1791
+ type: object
1792
+ properties:
1793
+ access:
1794
+ description: Access level.
1795
+ type: string
1796
+ enum:
1797
+ - stanford
1798
+ download:
1799
+ description: Download access level.
1800
+ type: string
1801
+ enum:
1802
+ - stanford
1803
+ readLocation:
1804
+ description: If access is "location-based", which location should have access.
1805
+ type: string
1806
+ nullable: true
1807
+ enum:
1808
+ - null
1809
+ controlledDigitalLending:
1810
+ type: boolean
1811
+ default: false
1812
+ enum:
1813
+ - false
1814
+ required:
1815
+ - access
1816
+ - download
1817
+ WorldAccess:
1818
+ type: object
1819
+ properties:
1820
+ access:
1821
+ description: Access level.
1822
+ type: string
1823
+ enum:
1824
+ - world
1825
+ download:
1826
+ description: Download access level.
1827
+ type: string
1828
+ enum:
1829
+ - none
1830
+ - stanford
1831
+ - world
1832
+ readLocation:
1833
+ description: If access is "location-based", which location should have access.
1834
+ type: string
1835
+ nullable: true
1836
+ enum:
1837
+ - null
1838
+ controlledDigitalLending:
1839
+ type: boolean
1840
+ default: false
1841
+ enum:
1842
+ - false
1843
+ required:
1844
+ - access
1845
+ - download
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.57.0
4
+ version: 0.59.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Coyne
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-03-30 00:00:00.000000000 Z
11
+ date: 2021-06-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -265,9 +265,13 @@ files:
265
265
  - lib/cocina/models/catalog_link.rb
266
266
  - lib/cocina/models/catkey_barcode.rb
267
267
  - lib/cocina/models/checkable.rb
268
+ - lib/cocina/models/citation_only_access.rb
268
269
  - lib/cocina/models/collection.rb
270
+ - lib/cocina/models/collection_access.rb
269
271
  - lib/cocina/models/collection_identification.rb
270
272
  - lib/cocina/models/contributor.rb
273
+ - lib/cocina/models/controlled_digital_lending_access.rb
274
+ - lib/cocina/models/dark_access.rb
271
275
  - lib/cocina/models/description.rb
272
276
  - lib/cocina/models/descriptive_access_metadata.rb
273
277
  - lib/cocina/models/descriptive_admin_metadata.rb
@@ -293,7 +297,10 @@ files:
293
297
  - lib/cocina/models/file_set_structural.rb
294
298
  - lib/cocina/models/geographic.rb
295
299
  - lib/cocina/models/identification.rb
300
+ - lib/cocina/models/lane_medical_barcode.rb
296
301
  - lib/cocina/models/language.rb
302
+ - lib/cocina/models/location_based_access.rb
303
+ - lib/cocina/models/location_based_download_access.rb
297
304
  - lib/cocina/models/message_digest.rb
298
305
  - lib/cocina/models/presentation.rb
299
306
  - lib/cocina/models/related_resource.rb
@@ -311,15 +318,17 @@ files:
311
318
  - lib/cocina/models/source_id.rb
312
319
  - lib/cocina/models/standard.rb
313
320
  - lib/cocina/models/standard_barcode.rb
321
+ - lib/cocina/models/stanford_access.rb
314
322
  - lib/cocina/models/title.rb
315
323
  - lib/cocina/models/validator.rb
316
324
  - lib/cocina/models/version.rb
317
325
  - lib/cocina/models/vocab.rb
326
+ - lib/cocina/models/world_access.rb
318
327
  - openapi.yml
319
328
  homepage: https://github.com/sul-dlss/cocina-models
320
329
  licenses: []
321
330
  metadata: {}
322
- post_install_message:
331
+ post_install_message:
323
332
  rdoc_options: []
324
333
  require_paths:
325
334
  - lib
@@ -334,8 +343,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
334
343
  - !ruby/object:Gem::Version
335
344
  version: '0'
336
345
  requirements: []
337
- rubygems_version: 3.2.2
338
- signing_key:
346
+ rubygems_version: 3.2.16
347
+ signing_key:
339
348
  specification_version: 4
340
349
  summary: Data models for the SDR
341
350
  test_files: []