cocina-models 0.51.0 → 0.54.0.beta.2

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: f26933441485daf9b322a702e2e72955a2632ff9ea840ed4b700a8130361dfb2
4
- data.tar.gz: 877293aa8b242869413b025634e1c44e52ea1cc9aaf856b82a8986a170fedd0c
3
+ metadata.gz: c3647bdfe1efdf9e51abdd4136d455eac3962cbd38a1d29fd32aa037ca9c8481
4
+ data.tar.gz: c5ddfe3f1eab351ac6eb0fe4b20ecb9b6597397d00600dcd1fdce2ebff4bf86b
5
5
  SHA512:
6
- metadata.gz: 1e6919371f789202c7f17b5c8a6036ab68b3ce1dc4486ec8b1f62cf60a5eb3c4857b424b3a19198c74f4fcc1265e5de32a84085aaa11eaa405f41df13f7728b9
7
- data.tar.gz: f287df923a3d9bdf37f7c012e5aa222197e953f9e8ed0c86c65df64a5345b402e399b9d6515fc12e5d605f0fc38d7e801393096cdb55d67c856365ef80b8ec34
6
+ metadata.gz: 5b6e644d13d139fcb672b66979d5ba55e8031e06fe691e0beedd3105180f948133f8c37e1d92ed496934fa4947ac4c623c2e6fa3b1474043e9fb7691e125c2d0
7
+ data.tar.gz: df4b09ffd691bc52f6fda5d90dd0ae99510261cd73c7017fba9aa3f665643efe8699ae0b2e55e5e30281318391079847e2059d5af29471c4dd2b23fa09477aed
data/README.md CHANGED
@@ -66,3 +66,12 @@ Once the above listed gems are updated all the following services that use cocin
66
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`.
67
67
 
68
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.
69
+
70
+ ### Usage conventions
71
+
72
+ The following are the recommended naming conventions for code using Cocina models:
73
+
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
@@ -4,7 +4,7 @@ module Cocina
4
4
  module Models
5
5
  class AccessRole < Struct
6
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')
7
+ attribute :name, Types::Strict::String.enum('dor-apo-creator', 'dor-apo-depositor', 'dor-apo-manager', 'dor-apo-metadata', 'dor-apo-reviewer', 'dor-apo-viewer', 'sdr-administrator', 'sdr-viewer', 'hydrus-collection-creator', 'hydrus-collection-manager', 'hydrus-collection-depositor', 'hydrus-collection-item-depositor', 'hydrus-collection-reviewer', 'hydrus-collection-viewer')
8
8
  attribute :members, Types::Strict::Array.of(AccessRoleMember).default([].freeze)
9
9
  end
10
10
  end
@@ -3,17 +3,6 @@
3
3
  module Cocina
4
4
  module Models
5
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
6
  attribute :structuredValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
18
7
  # Description of the event (creation, publication, etc.).
19
8
  attribute :type, Types::Strict::String.meta(omittable: true)
@@ -23,6 +12,8 @@ module Cocina
23
12
  attribute :contributor, Types::Strict::Array.of(Contributor).meta(omittable: true)
24
13
  attribute :location, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
25
14
  attribute :identifier, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
15
+ attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
16
+ attribute :valueLanguage, DescriptiveValueLanguage.optional.meta(omittable: true)
26
17
  end
27
18
  end
28
19
  end
@@ -13,6 +13,7 @@ module Cocina
13
13
  attribute :location, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
14
14
  attribute :identifier, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
15
15
  attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
16
+ attribute :valueLanguage, DescriptiveValueLanguage.optional.meta(omittable: true)
16
17
  attribute :parallelEvent, Types::Strict::Array.of(DescriptiveParallelEvent).meta(omittable: true)
17
18
  end
18
19
  end
@@ -3,6 +3,7 @@
3
3
  module Cocina
4
4
  module Models
5
5
  class FileAdministrative < Struct
6
+ attribute :publish, Types::Strict::Bool.default(false)
6
7
  attribute :sdrPreserve, Types::Strict::Bool.default(true)
7
8
  attribute :shelve, Types::Strict::Bool.default(false)
8
9
  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.51.0'
5
+ VERSION = '0.54.0.beta.2'
6
6
  end
7
7
  end
data/openapi.yml CHANGED
@@ -127,9 +127,14 @@ components:
127
127
  description: Name of role
128
128
  type: string
129
129
  enum:
130
+ - 'dor-apo-creator'
131
+ - 'dor-apo-depositor'
132
+ - 'dor-apo-manager'
133
+ - 'dor-apo-metadata'
134
+ - 'dor-apo-reviewer'
135
+ - 'dor-apo-viewer'
130
136
  - 'sdr-administrator'
131
137
  - 'sdr-viewer'
132
- - 'dor-apo-manager'
133
138
  - 'hydrus-collection-creator'
134
139
  - 'hydrus-collection-manager'
135
140
  - 'hydrus-collection-depositor'
@@ -581,7 +586,6 @@ components:
581
586
  type: object
582
587
  additionalProperties: false
583
588
  allOf:
584
- - $ref: "#/components/schemas/DescriptiveValueLanguage"
585
589
  - $ref: "#/components/schemas/DescriptiveStructuredValue"
586
590
  - type: object
587
591
  additionalProperties: false
@@ -617,6 +621,9 @@ components:
617
621
  type: array
618
622
  items:
619
623
  $ref: "#/components/schemas/DescriptiveValue"
624
+ valueLanguage:
625
+ # description: Language of the descriptive element value
626
+ $ref: "#/components/schemas/DescriptiveValueLanguage"
620
627
  DescriptiveParallelValue:
621
628
  description: Value model for multiple representations of the same information (e.g. in different languages).
622
629
  type: object
@@ -654,27 +661,6 @@ components:
654
661
  $ref: '#/components/schemas/Standard'
655
662
  # description: An alphabet or other notation used to represent a
656
663
  # language or other symbolic system of the descriptive element value.
657
- Title:
658
- type: object
659
- additionalProperties: false
660
- allOf:
661
- - $ref: "#/components/schemas/DescriptiveValue"
662
- - anyOf:
663
- - type: object
664
- required:
665
- - value
666
- - type: object
667
- required:
668
- - structuredValue
669
- - type: object
670
- required:
671
- - parallelValue
672
- - type: object
673
- required:
674
- - groupedValue
675
- - type: object
676
- required:
677
- - valueAt
678
664
  DRO:
679
665
  description: Domain-defined abstraction of a 'work'. Digital Repository Objects' abstraction is describable for our domain’s purposes, i.e. for management needs within our system.
680
666
  type: object
@@ -873,6 +859,9 @@ components:
873
859
  type: array
874
860
  items:
875
861
  $ref: "#/components/schemas/DescriptiveValue"
862
+ valueLanguage:
863
+ # description: Language of the descriptive element value
864
+ $ref: "#/components/schemas/DescriptiveValueLanguage"
876
865
  parallelEvent:
877
866
  description: For multiple representations of information about the same event (e.g. in different languages)
878
867
  type: array
@@ -970,6 +959,9 @@ components:
970
959
  type: object
971
960
  additionalProperties: false
972
961
  properties:
962
+ publish:
963
+ type: boolean
964
+ default: false
973
965
  sdrPreserve:
974
966
  type: boolean
975
967
  default: true
@@ -977,6 +969,7 @@ components:
977
969
  type: boolean
978
970
  default: false
979
971
  required:
972
+ - publish
980
973
  - sdrPreserve
981
974
  - shelve
982
975
  FileSet:
@@ -1516,3 +1509,24 @@ components:
1516
1509
  type: string
1517
1510
  source:
1518
1511
  $ref: "#/components/schemas/Source"
1512
+ Title:
1513
+ type: object
1514
+ additionalProperties: false
1515
+ allOf:
1516
+ - $ref: "#/components/schemas/DescriptiveValue"
1517
+ - anyOf:
1518
+ - type: object
1519
+ required:
1520
+ - value
1521
+ - type: object
1522
+ required:
1523
+ - structuredValue
1524
+ - type: object
1525
+ required:
1526
+ - parallelValue
1527
+ - type: object
1528
+ required:
1529
+ - groupedValue
1530
+ - type: object
1531
+ required:
1532
+ - valueAt
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.51.0
4
+ version: 0.54.0.beta.2
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-04 00:00:00.000000000 Z
11
+ date: 2021-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -314,7 +314,7 @@ files:
314
314
  homepage: https://github.com/sul-dlss/cocina-models
315
315
  licenses: []
316
316
  metadata: {}
317
- post_install_message:
317
+ post_install_message:
318
318
  rdoc_options: []
319
319
  require_paths:
320
320
  - lib
@@ -325,12 +325,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
325
325
  version: '2.5'
326
326
  required_rubygems_version: !ruby/object:Gem::Requirement
327
327
  requirements:
328
- - - ">="
328
+ - - ">"
329
329
  - !ruby/object:Gem::Version
330
- version: '0'
330
+ version: 1.3.1
331
331
  requirements: []
332
- rubygems_version: 3.1.2
333
- signing_key:
332
+ rubygems_version: 3.0.6
333
+ signing_key:
334
334
  specification_version: 4
335
335
  summary: Data models for the SDR
336
336
  test_files: []