lib/cocina/models/request_admin_policy.rb in cocina-models-0.19.0 vs lib/cocina/models/request_admin_policy.rb in cocina-models-0.20.0
- old
+ new
@@ -2,11 +2,11 @@
module Cocina
module Models
# An request to create an AdminPolicy object.
# This is the same as AdminPolicy, except it doesn't have externalIdentifier.
- class RequestAdminPolicy < Dry::Struct
+ class RequestAdminPolicy < Struct
attribute :type, Types::String.enum(*AdminPolicy::TYPES)
attribute :label, Types::Strict::String
attribute :version, Types::Coercible::Integer
attribute(:access, AdminPolicy::Access.default { AdminPolicy::Access.new })
attribute(:administrative, AdminPolicy::Administrative.default { AdminPolicy::Administrative.new })
@@ -15,10 +15,10 @@
attribute :description, Description.optional.default(nil)
attribute(:identification, AdminPolicy::Identification.default { AdminPolicy::Identification.new })
attribute(:structural, AdminPolicy::Structural.default { AdminPolicy::Structural.new })
def self.from_dynamic(dyn)
- AdminPolicyBuilder.build(self, dyn)
+ RequestAdminPolicy.new(dyn)
end
def self.from_json(json)
from_dynamic(JSON.parse(json))
end