cocina-models 0.47.2 → 0.52.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cf7d1d0d676c42b4331df2079f9b8cdede0bc8b92c85478700dadc15ba972d92
4
- data.tar.gz: df0756d9ab7cc3dd3b999c0427a18859df2470476069a347468a4805bf8f88b8
3
+ metadata.gz: 2a9f53ca8dbbb3649b0dad155b0ad42fa6901f3c9b7a7082ef1571197b006b6e
4
+ data.tar.gz: 806294c0697f580c59beb6d8ced0e7b738c843576621c4c60ffb29632305e09b
5
5
  SHA512:
6
- metadata.gz: ebd2278320311858eed8ee824f64336f2bade54bbb711de95e36cb2148f94307585b530ce770d4626fa75cc09285b563b3bc9583bd322e3782b66a5417eaef06
7
- data.tar.gz: 724f8d92f5978f2a395b954dc4c7004a85f4198f43595244a900e7638b6860a0270b03d766bc6a61fb2b0d596cdbc2fc0a15b9dab667ca61b4fff5ca8273d0ec
6
+ metadata.gz: 8047d6f2a4d16f0c8269440d3ba6db3e616c4cf93c1a7071d62e70c40614f60740f724c03351d579f009b0957e0a658f5bf6a10ef5f256e00621e615f31991c0
7
+ data.tar.gz: ebeb2ef783b0ada2f5e23dc181a28ed07cf03be4262917cab39c163179314bf35c255c656d65d02c7cc6b05c7a680789a7d8ec2bcf29ce7c0cd46290417fd76a
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cocina
4
+ module Models
5
+ class AccessRole < Struct
6
+ # Name of role
7
+ attribute :name, Types::Strict::String.enum('sdr-administrator', 'sdr-viewer', 'dor-apo-manager', 'hydrus-collection-creator', 'hydrus-collection-manager', 'hydrus-collection-depositor', 'hydrus-collection-item-depositor', 'hydrus-collection-reviewer', 'hydrus-collection-viewer')
8
+ attribute :members, Types::Strict::Array.of(AccessRoleMember).default([].freeze)
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cocina
4
+ module Models
5
+ class AccessRoleMember < Struct
6
+ include Checkable
7
+
8
+ TYPES = %w[sunetid
9
+ workgroup].freeze
10
+
11
+ # Name of role
12
+ attribute :type, Types::Strict::String.enum(*AccessRoleMember::TYPES)
13
+ attribute :identifier, Types::Strict::String
14
+ end
15
+ end
16
+ end
@@ -4,7 +4,12 @@ module Cocina
4
4
  module Models
5
5
  class AdminPolicyAdministrative < Struct
6
6
  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)
7
- attribute :registrationWorkflow, Types::Strict::String.meta(omittable: true)
7
+ attribute :registrationWorkflow, Types::Strict::Array.of(Types::Strict::String).meta(omittable: true)
8
+ # An additional workflow to start for objects managed by this admin policy once the end-accession workflow step is complete
9
+ # example: wasCrawlPreassemblyWF
10
+ attribute :disseminationWorkflow, Types::Strict::String.meta(omittable: true)
11
+ attribute :collectionsForRegistration, Types::Strict::Array.of(Types::Strict::String).meta(omittable: true)
12
+ attribute :roles, Types::Strict::Array.of(AccessRole).meta(omittable: true)
8
13
  attribute :hasAdminPolicy, Types::Strict::String
9
14
  end
10
15
  end
@@ -3,6 +3,10 @@
3
3
  module Cocina
4
4
  module Models
5
5
  class CollectionIdentification < Struct
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
+
8
+ # example: sul:PC0170_s3_Fiesta_Bowl_2012-01-02_210609_2026
9
+ attribute :sourceId, Types::Strict::String.meta(omittable: true)
6
10
  attribute :catalogLinks, Types::Strict::Array.of(CatalogLink).meta(omittable: true)
7
11
  end
8
12
  end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cocina
4
+ module Models
5
+ class DescriptiveParallelEvent < Struct
6
+ # Code representing the standard or encoding.
7
+ attribute :code, Types::Strict::String.meta(omittable: true)
8
+ # URI for the standard or encoding.
9
+ attribute :uri, Types::Strict::String.meta(omittable: true)
10
+ # String describing the standard or encoding.
11
+ attribute :value, Types::Strict::String.meta(omittable: true)
12
+ attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
13
+ # The version of the standard or encoding.
14
+ attribute :version, Types::Strict::String.meta(omittable: true)
15
+ attribute :source, Source.optional.meta(omittable: true)
16
+ attribute :valueScript, Standard.optional.meta(omittable: true)
17
+ attribute :structuredValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
18
+ # Description of the event (creation, publication, etc.).
19
+ attribute :type, Types::Strict::String.meta(omittable: true)
20
+ # The preferred display label to use for the event in access systems.
21
+ attribute :displayLabel, Types::Strict::String.meta(omittable: true)
22
+ attribute :date, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
23
+ attribute :contributor, Types::Strict::Array.of(Contributor).meta(omittable: true)
24
+ attribute :location, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
25
+ attribute :identifier, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
26
+ end
27
+ end
28
+ end
@@ -4,6 +4,17 @@ module Cocina
4
4
  module Models
5
5
  class Event < Struct
6
6
  attribute :structuredValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
7
+ # Code representing the standard or encoding.
8
+ attribute :code, Types::Strict::String.meta(omittable: true)
9
+ # URI for the standard or encoding.
10
+ attribute :uri, Types::Strict::String.meta(omittable: true)
11
+ # String describing the standard or encoding.
12
+ attribute :value, Types::Strict::String.meta(omittable: true)
13
+ attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
14
+ # The version of the standard or encoding.
15
+ attribute :version, Types::Strict::String.meta(omittable: true)
16
+ attribute :source, Source.optional.meta(omittable: true)
17
+ attribute :valueScript, Standard.optional.meta(omittable: true)
7
18
  # Description of the event (creation, publication, etc.).
8
19
  attribute :type, Types::Strict::String.meta(omittable: true)
9
20
  # The preferred display label to use for the event in access systems.
@@ -12,7 +23,7 @@ module Cocina
12
23
  attribute :contributor, Types::Strict::Array.of(Contributor).meta(omittable: true)
13
24
  attribute :location, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
14
25
  attribute :identifier, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
15
- attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
26
+ attribute :parallelEvent, Types::Strict::Array.of(DescriptiveParallelEvent).meta(omittable: true)
16
27
  end
17
28
  end
18
29
  end
@@ -7,7 +7,8 @@ module Cocina
7
7
  def self.validate(clazz, attributes)
8
8
  method_name = clazz.name.split('::').last
9
9
  request_operation = root.request_operation(:post, "/validate/#{method_name}")
10
- request_operation.validate_request_body('application/json', attributes)
10
+ # JSON.parse forces serialization of objects like DateTime.
11
+ request_operation.validate_request_body('application/json', JSON.parse(attributes.to_json))
11
12
  rescue OpenAPIParser::OpenAPIError => e
12
13
  raise ValidationError, e.message
13
14
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Cocina
4
4
  module Models
5
- VERSION = '0.47.2'
5
+ VERSION = '0.52.0'
6
6
  end
7
7
  end
data/openapi.yml CHANGED
@@ -118,6 +118,48 @@ components:
118
118
  - 'art'
119
119
  - 'hoover'
120
120
  - 'm&m'
121
+ AccessRole:
122
+ description: Access role conferred by an AdminPolicy to objects within it. (used by Argo)
123
+ type: object
124
+ additionalProperties: false
125
+ properties:
126
+ name:
127
+ description: Name of role
128
+ type: string
129
+ enum:
130
+ - 'sdr-administrator'
131
+ - 'sdr-viewer'
132
+ - 'dor-apo-manager'
133
+ - 'hydrus-collection-creator'
134
+ - 'hydrus-collection-manager'
135
+ - 'hydrus-collection-depositor'
136
+ - 'hydrus-collection-item-depositor'
137
+ - 'hydrus-collection-reviewer'
138
+ - 'hydrus-collection-viewer'
139
+ members:
140
+ description: The users and groups that are members of the role
141
+ type: array
142
+ items:
143
+ $ref: '#/components/schemas/AccessRoleMember'
144
+ required:
145
+ - members
146
+ - name
147
+ AccessRoleMember:
148
+ description: Represents a user or group that is a member of an AccessRole
149
+ type: object
150
+ additionalProperties: false
151
+ properties:
152
+ type:
153
+ description: Name of role
154
+ type: string
155
+ enum:
156
+ - 'sunetid'
157
+ - 'workgroup'
158
+ identifier:
159
+ type: string
160
+ required:
161
+ - identifier
162
+ - type
121
163
  Administrative:
122
164
  type: object
123
165
  additionalProperties: false
@@ -161,6 +203,7 @@ components:
161
203
  - type
162
204
  - version
163
205
  AdminPolicyAdministrative:
206
+ description: Administrative properties for an AdminPolicy
164
207
  type: object
165
208
  additionalProperties: false
166
209
  properties:
@@ -168,7 +211,24 @@ components:
168
211
  type: string
169
212
  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>
170
213
  registrationWorkflow:
214
+ description: When you register an item with this admin policy, these are the workflows that are available.
215
+ type: array
216
+ items:
217
+ type: string
218
+ disseminationWorkflow:
219
+ description: An additional workflow to start for objects managed by this admin policy once the end-accession workflow step is complete
220
+ example: wasCrawlPreassemblyWF
171
221
  type: string
222
+ collectionsForRegistration:
223
+ description: When you register an item with this admin policy, these are the collections that are available.
224
+ type: array
225
+ items:
226
+ type: string
227
+ roles:
228
+ description: The access roles conferred by this AdminPolicy (used by Argo)
229
+ type: array
230
+ items:
231
+ $ref: '#/components/schemas/AccessRole'
172
232
  hasAdminPolicy:
173
233
  type: string
174
234
  required:
@@ -239,6 +299,8 @@ components:
239
299
  type: object
240
300
  additionalProperties: false
241
301
  properties:
302
+ sourceId:
303
+ $ref: '#/components/schemas/SourceId'
242
304
  catalogLinks:
243
305
  type: array
244
306
  items:
@@ -514,6 +576,47 @@ components:
514
576
  type: array
515
577
  items:
516
578
  $ref: "#/components/schemas/DescriptiveValue"
579
+ DescriptiveParallelEvent:
580
+ description: Value model for multiple representations of information about the same event (e.g. in different languages).
581
+ type: object
582
+ additionalProperties: false
583
+ allOf:
584
+ - $ref: "#/components/schemas/DescriptiveValueLanguage"
585
+ - $ref: "#/components/schemas/DescriptiveStructuredValue"
586
+ - type: object
587
+ additionalProperties: false
588
+ properties:
589
+ type:
590
+ description: Description of the event (creation, publication, etc.).
591
+ type: string
592
+ displayLabel:
593
+ description: The preferred display label to use for the event in access systems.
594
+ type: string
595
+ date:
596
+ description: Dates associated with the event.
597
+ type: array
598
+ items:
599
+ $ref: "#/components/schemas/DescriptiveValue"
600
+ contributor:
601
+ description: Contributors associated with the event.
602
+ type: array
603
+ items:
604
+ $ref: "#/components/schemas/Contributor"
605
+ location:
606
+ description: Locations associated with the event.
607
+ type: array
608
+ items:
609
+ $ref: "#/components/schemas/DescriptiveValue"
610
+ identifier:
611
+ description: Identifiers and URIs associated with the event.
612
+ type: array
613
+ items:
614
+ $ref: "#/components/schemas/DescriptiveValue"
615
+ note:
616
+ description: Other information about the event.
617
+ type: array
618
+ items:
619
+ $ref: "#/components/schemas/DescriptiveValue"
517
620
  DescriptiveParallelValue:
518
621
  description: Value model for multiple representations of the same information (e.g. in different languages).
519
622
  type: object
@@ -736,6 +839,7 @@ components:
736
839
  additionalProperties: false
737
840
  allOf:
738
841
  - $ref: "#/components/schemas/DescriptiveStructuredValue"
842
+ - $ref: "#/components/schemas/DescriptiveValueLanguage"
739
843
  - type: object
740
844
  additionalProperties: false
741
845
  properties:
@@ -770,6 +874,11 @@ components:
770
874
  type: array
771
875
  items:
772
876
  $ref: "#/components/schemas/DescriptiveValue"
877
+ parallelEvent:
878
+ description: For multiple representations of information about the same event (e.g. in different languages)
879
+ type: array
880
+ items:
881
+ $ref: "#/components/schemas/DescriptiveParallelEvent"
773
882
  File:
774
883
  description: Binaries that are the basis of what our domain manages. Binaries here do not include metadata files generated for the domain's own management purposes.
775
884
  type: object
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.47.2
4
+ version: 0.52.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Coyne
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-02-13 00:00:00.000000000 Z
11
+ date: 2021-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -254,6 +254,8 @@ files:
254
254
  - lib/cocina/generator/vocab.rb
255
255
  - lib/cocina/models.rb
256
256
  - lib/cocina/models/access.rb
257
+ - lib/cocina/models/access_role.rb
258
+ - lib/cocina/models/access_role_member.rb
257
259
  - lib/cocina/models/admin_policy.rb
258
260
  - lib/cocina/models/admin_policy_administrative.rb
259
261
  - lib/cocina/models/administrative.rb
@@ -269,6 +271,7 @@ files:
269
271
  - lib/cocina/models/descriptive_basic_value.rb
270
272
  - lib/cocina/models/descriptive_geographic_metadata.rb
271
273
  - lib/cocina/models/descriptive_grouped_value.rb
274
+ - lib/cocina/models/descriptive_parallel_event.rb
272
275
  - lib/cocina/models/descriptive_parallel_value.rb
273
276
  - lib/cocina/models/descriptive_structured_value.rb
274
277
  - lib/cocina/models/descriptive_value.rb
@@ -326,7 +329,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
326
329
  - !ruby/object:Gem::Version
327
330
  version: '0'
328
331
  requirements: []
329
- rubygems_version: 3.0.3
332
+ rubygems_version: 3.1.2
330
333
  signing_key:
331
334
  specification_version: 4
332
335
  summary: Data models for the SDR