Class: RepositoryClient::Deposit::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/repository_client/deposit/request.rb

Overview

This represents the metadata that we send to the server for doing a deposit

Constant Summary collapse

CONTEXT =
'http://cocina.sul.stanford.edu/contexts/cocina-base.jsonld'

Instance Method Summary collapse

Constructor Details

#initialize(label:, type: 'http://cocina.sul.stanford.edu/models/object.jsonld', uploads: []) ⇒ Request

Returns a new instance of Request.

Parameters:



12
13
14
15
16
17
18
# File 'lib/repository_client/deposit/request.rb', line 12

def initialize(label:,
               type: 'http://cocina.sul.stanford.edu/models/object.jsonld',
               uploads: [])
  @label = label
  @type = type
  @uploads = uploads
end

Instance Method Details

#as_jsonObject



20
21
22
23
24
25
26
27
28
29
# File 'lib/repository_client/deposit/request.rb', line 20

def as_json
  {
    "@context": CONTEXT,
    "@type": type,
    label: label,
    structural: {
      hasMember: file_sets_as_json
    }
  }
end