Class: MetatronClient::DefaultApi

Inherits:
Object
  • Object
show all
Defined in:
lib/metatron_ruby_client/api/default_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ DefaultApi

Returns a new instance of DefaultApi.



19
20
21
# File 'lib/metatron_ruby_client/api/default_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/metatron_ruby_client/api/default_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#add_manifestation_asset(authorization, manifestation_id, body, opts = {}) ⇒ Asset

Add an asset to the relevant manifestation

Parameters:

  • authorization

    Bearer token

  • manifestation_id
  • body

    node

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



30
31
32
33
# File 'lib/metatron_ruby_client/api/default_api.rb', line 30

def add_manifestation_asset(authorization, manifestation_id, body, opts = {})
  data, _status_code, _headers = add_manifestation_asset_with_http_info(authorization, manifestation_id, body, opts)
  return data
end

#add_manifestation_asset_with_http_info(authorization, manifestation_id, body, opts = {}) ⇒ Array<(Asset, Fixnum, Hash)>

Add an asset to the relevant manifestation

Parameters:

  • authorization

    Bearer token

  • manifestation_id
  • body

    node

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Asset, Fixnum, Hash)>)

    Asset data, response status code and response headers



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# File 'lib/metatron_ruby_client/api/default_api.rb', line 42

def add_manifestation_asset_with_http_info(authorization, manifestation_id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: DefaultApi.add_manifestation_asset ..."
  end
  
  
  # verify the required parameter 'authorization' is set
  fail ArgumentError, "Missing the required parameter 'authorization' when calling DefaultApi.add_manifestation_asset" if authorization.nil?
  
  
  
  
  
  
  # verify the required parameter 'manifestation_id' is set
  fail ArgumentError, "Missing the required parameter 'manifestation_id' when calling DefaultApi.add_manifestation_asset" if manifestation_id.nil?
  
  
  
  
  
  
  # verify the required parameter 'body' is set
  fail ArgumentError, "Missing the required parameter 'body' when calling DefaultApi.add_manifestation_asset" if body.nil?
  
  
  
  
  
  # resource path
  local_var_path = "/manifestations/{manifestationId}/assets".sub('{format}','json').sub('{' + 'manifestationId' + '}', manifestation_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/vnd.api+json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
  header_params[:'Authorization'] = authorization

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  
  auth_names = ['Authorizer']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Asset')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#add_manifestation_asset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_holdings(authorization, manifestation_id, tenant_code, opts = {}) ⇒ ItemResultSet

Get local holdings for a given manifestation

Parameters:

  • authorization

    Bearer token

  • manifestation_id
  • tenant_code
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



116
117
118
119
# File 'lib/metatron_ruby_client/api/default_api.rb', line 116

def get_holdings(authorization, manifestation_id, tenant_code, opts = {})
  data, _status_code, _headers = get_holdings_with_http_info(authorization, manifestation_id, tenant_code, opts)
  return data
end

#get_holdings_with_http_info(authorization, manifestation_id, tenant_code, opts = {}) ⇒ Array<(ItemResultSet, Fixnum, Hash)>

Get local holdings for a given manifestation

Parameters:

  • authorization

    Bearer token

  • manifestation_id
  • tenant_code
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ItemResultSet, Fixnum, Hash)>)

    ItemResultSet data, response status code and response headers



128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
# File 'lib/metatron_ruby_client/api/default_api.rb', line 128

def get_holdings_with_http_info(authorization, manifestation_id, tenant_code, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: DefaultApi.get_holdings ..."
  end
  
  
  # verify the required parameter 'authorization' is set
  fail ArgumentError, "Missing the required parameter 'authorization' when calling DefaultApi.get_holdings" if authorization.nil?
  
  
  
  
  
  
  # verify the required parameter 'manifestation_id' is set
  fail ArgumentError, "Missing the required parameter 'manifestation_id' when calling DefaultApi.get_holdings" if manifestation_id.nil?
  
  
  
  
  
  
  # verify the required parameter 'tenant_code' is set
  fail ArgumentError, "Missing the required parameter 'tenant_code' when calling DefaultApi.get_holdings" if tenant_code.nil?
  
  
  
  
  
  # resource path
  local_var_path = "/manifestations/{manifestationId}/items/{tenantCode}".sub('{format}','json').sub('{' + 'manifestationId' + '}', manifestation_id.to_s).sub('{' + 'tenantCode' + '}', tenant_code.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/vnd.api+json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
  header_params[:'Authorization'] = authorization

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  
  auth_names = ['Authorizer']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ItemResultSet')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#get_holdings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_manifestation(authorization, manifestation_id, opts = {}) ⇒ nil

Get a specific Manifestation from the dataset

Parameters:

  • authorization

    Bearer token

  • manifestation_id
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


201
202
203
204
# File 'lib/metatron_ruby_client/api/default_api.rb', line 201

def get_manifestation(authorization, manifestation_id, opts = {})
  get_manifestation_with_http_info(authorization, manifestation_id, opts)
  return nil
end

#get_manifestation_assets(authorization, manifestation_id, opts = {}) ⇒ AssetResultSet

Get a set of Assets that are associated with a specific Manifestation

Parameters:

  • authorization

    Bearer token

  • manifestation_id
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



276
277
278
279
# File 'lib/metatron_ruby_client/api/default_api.rb', line 276

def get_manifestation_assets(authorization, manifestation_id, opts = {})
  data, _status_code, _headers = get_manifestation_assets_with_http_info(authorization, manifestation_id, opts)
  return data
end

#get_manifestation_assets_with_http_info(authorization, manifestation_id, opts = {}) ⇒ Array<(AssetResultSet, Fixnum, Hash)>

Get a set of Assets that are associated with a specific Manifestation

Parameters:

  • authorization

    Bearer token

  • manifestation_id
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(AssetResultSet, Fixnum, Hash)>)

    AssetResultSet data, response status code and response headers



287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
# File 'lib/metatron_ruby_client/api/default_api.rb', line 287

def get_manifestation_assets_with_http_info(authorization, manifestation_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: DefaultApi.get_manifestation_assets ..."
  end
  
  
  # verify the required parameter 'authorization' is set
  fail ArgumentError, "Missing the required parameter 'authorization' when calling DefaultApi.get_manifestation_assets" if authorization.nil?
  
  
  
  
  
  
  # verify the required parameter 'manifestation_id' is set
  fail ArgumentError, "Missing the required parameter 'manifestation_id' when calling DefaultApi.get_manifestation_assets" if manifestation_id.nil?
  
  
  
  
  
  # resource path
  local_var_path = "/manifestations/{manifestationId}/assets".sub('{format}','json').sub('{' + 'manifestationId' + '}', manifestation_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/vnd.api+json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
  header_params[:'Authorization'] = authorization

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  
  auth_names = ['Authorizer']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'AssetResultSet')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#get_manifestation_assets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_manifestation_with_http_info(authorization, manifestation_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Get a specific Manifestation from the dataset

Parameters:

  • authorization

    Bearer token

  • manifestation_id
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
# File 'lib/metatron_ruby_client/api/default_api.rb', line 212

def get_manifestation_with_http_info(authorization, manifestation_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: DefaultApi.get_manifestation ..."
  end
  
  
  # verify the required parameter 'authorization' is set
  fail ArgumentError, "Missing the required parameter 'authorization' when calling DefaultApi.get_manifestation" if authorization.nil?
  
  
  
  
  
  
  # verify the required parameter 'manifestation_id' is set
  fail ArgumentError, "Missing the required parameter 'manifestation_id' when calling DefaultApi.get_manifestation" if manifestation_id.nil?
  
  
  
  
  
  # resource path
  local_var_path = "/manifestations/{manifestationId}".sub('{format}','json').sub('{' + 'manifestationId' + '}', manifestation_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/vnd.api+json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
  header_params[:'Authorization'] = authorization

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  
  auth_names = ['Authorizer']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#get_manifestation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_manifestation_works(authorization, manifestation_id, opts = {}) ⇒ nil

Get a set of Works relating to a given Manifestation. Usually there will be one current work, but due to previous titles there might be more than one Work.

Parameters:

  • authorization

    Bearer token

  • manifestation_id
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


352
353
354
355
# File 'lib/metatron_ruby_client/api/default_api.rb', line 352

def get_manifestation_works(authorization, manifestation_id, opts = {})
  get_manifestation_works_with_http_info(authorization, manifestation_id, opts)
  return nil
end

#get_manifestation_works_with_http_info(authorization, manifestation_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Get a set of Works relating to a given Manifestation. Usually there will be one current work, but due to previous titles there might be more than one Work.

Parameters:

  • authorization

    Bearer token

  • manifestation_id
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
# File 'lib/metatron_ruby_client/api/default_api.rb', line 363

def get_manifestation_works_with_http_info(authorization, manifestation_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: DefaultApi.get_manifestation_works ..."
  end
  
  
  # verify the required parameter 'authorization' is set
  fail ArgumentError, "Missing the required parameter 'authorization' when calling DefaultApi.get_manifestation_works" if authorization.nil?
  
  
  
  
  
  
  # verify the required parameter 'manifestation_id' is set
  fail ArgumentError, "Missing the required parameter 'manifestation_id' when calling DefaultApi.get_manifestation_works" if manifestation_id.nil?
  
  
  
  
  
  # resource path
  local_var_path = "/manifestations/{manifestationId}/works".sub('{format}','json').sub('{' + 'manifestationId' + '}', manifestation_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/vnd.api+json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
  header_params[:'Authorization'] = authorization

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  
  auth_names = ['Authorizer']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#get_manifestation_works\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_work(authorization, work_id, opts = {}) ⇒ WorkResultSet

Get a set of Works that are similar to a specific Work

Parameters:

  • authorization

    Bearer token

  • work_id
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



427
428
429
430
# File 'lib/metatron_ruby_client/api/default_api.rb', line 427

def get_work(authorization, work_id, opts = {})
  data, _status_code, _headers = get_work_with_http_info(authorization, work_id, opts)
  return data
end

#get_work_assets(authorization, work_id, opts = {}) ⇒ AssetResultSet

Get a set of Assets that are associated with a specific Work

Parameters:

  • authorization

    Bearer token

  • work_id
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



503
504
505
506
# File 'lib/metatron_ruby_client/api/default_api.rb', line 503

def get_work_assets(authorization, work_id, opts = {})
  data, _status_code, _headers = get_work_assets_with_http_info(authorization, work_id, opts)
  return data
end

#get_work_assets_with_http_info(authorization, work_id, opts = {}) ⇒ Array<(AssetResultSet, Fixnum, Hash)>

Get a set of Assets that are associated with a specific Work

Parameters:

  • authorization

    Bearer token

  • work_id
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(AssetResultSet, Fixnum, Hash)>)

    AssetResultSet data, response status code and response headers



514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
# File 'lib/metatron_ruby_client/api/default_api.rb', line 514

def get_work_assets_with_http_info(authorization, work_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: DefaultApi.get_work_assets ..."
  end
  
  
  # verify the required parameter 'authorization' is set
  fail ArgumentError, "Missing the required parameter 'authorization' when calling DefaultApi.get_work_assets" if authorization.nil?
  
  
  
  
  
  
  # verify the required parameter 'work_id' is set
  fail ArgumentError, "Missing the required parameter 'work_id' when calling DefaultApi.get_work_assets" if work_id.nil?
  
  
  
  
  
  # resource path
  local_var_path = "/works/{workId}/assets".sub('{format}','json').sub('{' + 'workId' + '}', work_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/vnd.api+json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
  header_params[:'Authorization'] = authorization

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  
  auth_names = ['Authorizer']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'AssetResultSet')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#get_work_assets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_work_manifestations(authorization, work_id, opts = {}) ⇒ nil

Get a set of Manifestations that encompass a specific Work

Parameters:

  • authorization

    Bearer token

  • work_id
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


579
580
581
582
# File 'lib/metatron_ruby_client/api/default_api.rb', line 579

def get_work_manifestations(authorization, work_id, opts = {})
  get_work_manifestations_with_http_info(authorization, work_id, opts)
  return nil
end

#get_work_manifestations_with_http_info(authorization, work_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Get a set of Manifestations that encompass a specific Work

Parameters:

  • authorization

    Bearer token

  • work_id
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
# File 'lib/metatron_ruby_client/api/default_api.rb', line 590

def get_work_manifestations_with_http_info(authorization, work_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: DefaultApi.get_work_manifestations ..."
  end
  
  
  # verify the required parameter 'authorization' is set
  fail ArgumentError, "Missing the required parameter 'authorization' when calling DefaultApi.get_work_manifestations" if authorization.nil?
  
  
  
  
  
  
  # verify the required parameter 'work_id' is set
  fail ArgumentError, "Missing the required parameter 'work_id' when calling DefaultApi.get_work_manifestations" if work_id.nil?
  
  
  
  
  
  # resource path
  local_var_path = "/works/{workId}/manifestations".sub('{format}','json').sub('{' + 'workId' + '}', work_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/vnd.api+json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
  header_params[:'Authorization'] = authorization

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  
  auth_names = ['Authorizer']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#get_work_manifestations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_work_with_http_info(authorization, work_id, opts = {}) ⇒ Array<(WorkResultSet, Fixnum, Hash)>

Get a set of Works that are similar to a specific Work

Parameters:

  • authorization

    Bearer token

  • work_id
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(WorkResultSet, Fixnum, Hash)>)

    WorkResultSet data, response status code and response headers



438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
# File 'lib/metatron_ruby_client/api/default_api.rb', line 438

def get_work_with_http_info(authorization, work_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: DefaultApi.get_work ..."
  end
  
  
  # verify the required parameter 'authorization' is set
  fail ArgumentError, "Missing the required parameter 'authorization' when calling DefaultApi.get_work" if authorization.nil?
  
  
  
  
  
  
  # verify the required parameter 'work_id' is set
  fail ArgumentError, "Missing the required parameter 'work_id' when calling DefaultApi.get_work" if work_id.nil?
  
  
  
  
  
  # resource path
  local_var_path = "/works/{workId}/similar".sub('{format}','json').sub('{' + 'workId' + '}', work_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/vnd.api+json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
  header_params[:'Authorization'] = authorization

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  
  auth_names = ['Authorizer']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'WorkResultSet')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#get_work\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#manifestation(authorization, opts = {}) ⇒ ManifestationResultSet

Get the manifestation set best matching the given bibliographic data

Parameters:

  • authorization

    Bearer token

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :isbn (String)

    The isbn

  • :work_id (String)

    The ID of a work

Returns:



655
656
657
658
# File 'lib/metatron_ruby_client/api/default_api.rb', line 655

def manifestation(authorization, opts = {})
  data, _status_code, _headers = manifestation_with_http_info(authorization, opts)
  return data
end

#manifestation_with_http_info(authorization, opts = {}) ⇒ Array<(ManifestationResultSet, Fixnum, Hash)>

Get the manifestation set best matching the given bibliographic data

Parameters:

  • authorization

    Bearer token

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :isbn (String)

    The isbn

  • :work_id (String)

    The ID of a work

Returns:

  • (Array<(ManifestationResultSet, Fixnum, Hash)>)

    ManifestationResultSet data, response status code and response headers



667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
# File 'lib/metatron_ruby_client/api/default_api.rb', line 667

def manifestation_with_http_info(authorization, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: DefaultApi.manifestation ..."
  end
  
  
  # verify the required parameter 'authorization' is set
  fail ArgumentError, "Missing the required parameter 'authorization' when calling DefaultApi.manifestation" if authorization.nil?
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  # resource path
  local_var_path = "/manifestations".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'isbn'] = opts[:'isbn'] if opts[:'isbn']
  query_params[:'work_id'] = opts[:'work_id'] if opts[:'work_id']

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/vnd.api+json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
  header_params[:'Authorization'] = authorization

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  
  auth_names = ['Authorizer']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ManifestationResultSet')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#manifestation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#remove_asset(authorization, asset_id, asset_type, opts = {}) ⇒ nil

Remove an asset

Parameters:

  • authorization

    Bearer token

  • asset_id
  • asset_type
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


739
740
741
742
# File 'lib/metatron_ruby_client/api/default_api.rb', line 739

def remove_asset(authorization, asset_id, asset_type, opts = {})
  remove_asset_with_http_info(authorization, asset_id, asset_type, opts)
  return nil
end

#remove_asset_with_http_info(authorization, asset_id, asset_type, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Remove an asset

Parameters:

  • authorization

    Bearer token

  • asset_id
  • asset_type
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
# File 'lib/metatron_ruby_client/api/default_api.rb', line 751

def remove_asset_with_http_info(authorization, asset_id, asset_type, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: DefaultApi.remove_asset ..."
  end
  
  
  # verify the required parameter 'authorization' is set
  fail ArgumentError, "Missing the required parameter 'authorization' when calling DefaultApi.remove_asset" if authorization.nil?
  
  
  
  
  
  
  # verify the required parameter 'asset_id' is set
  fail ArgumentError, "Missing the required parameter 'asset_id' when calling DefaultApi.remove_asset" if asset_id.nil?
  
  
  
  
  
  
  # verify the required parameter 'asset_type' is set
  fail ArgumentError, "Missing the required parameter 'asset_type' when calling DefaultApi.remove_asset" if asset_type.nil?
  
  
  
  
  
  # resource path
  local_var_path = "/assets/{assetType}/{assetId}".sub('{format}','json').sub('{' + 'assetId' + '}', asset_id.to_s).sub('{' + 'assetType' + '}', asset_type.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/vnd.api+json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
  header_params[:'Authorization'] = authorization

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  
  auth_names = ['Authorizer']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#remove_asset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#work(authorization, q, limit, offset, opts = {}) ⇒ WorkResultSet

Get the work best matching the given bibliographic data

Parameters:

  • authorization

    Bearer token

  • q

    Search works for the supplied term

  • limit

    Limit the results to n results

  • offset

    Offset the results to position n

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :include (Array<String>)

    Define which relationships to include, comma separated

Returns:



826
827
828
829
# File 'lib/metatron_ruby_client/api/default_api.rb', line 826

def work(authorization, q, limit, offset, opts = {})
  data, _status_code, _headers = work_with_http_info(authorization, q, limit, offset, opts)
  return data
end

#work_with_http_info(authorization, q, limit, offset, opts = {}) ⇒ Array<(WorkResultSet, Fixnum, Hash)>

Get the work best matching the given bibliographic data

Parameters:

  • authorization

    Bearer token

  • q

    Search works for the supplied term

  • limit

    Limit the results to n results

  • offset

    Offset the results to position n

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :include (Array<String>)

    Define which relationships to include, comma separated

Returns:

  • (Array<(WorkResultSet, Fixnum, Hash)>)

    WorkResultSet data, response status code and response headers



840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
# File 'lib/metatron_ruby_client/api/default_api.rb', line 840

def work_with_http_info(authorization, q, limit, offset, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: DefaultApi.work ..."
  end
  
  
  # verify the required parameter 'authorization' is set
  fail ArgumentError, "Missing the required parameter 'authorization' when calling DefaultApi.work" if authorization.nil?
  
  
  
  
  
  
  # verify the required parameter 'q' is set
  fail ArgumentError, "Missing the required parameter 'q' when calling DefaultApi.work" if q.nil?
  
  
  
  
  
  
  # verify the required parameter 'limit' is set
  fail ArgumentError, "Missing the required parameter 'limit' when calling DefaultApi.work" if limit.nil?
  
  
  
  
  
  
  # verify the required parameter 'offset' is set
  fail ArgumentError, "Missing the required parameter 'offset' when calling DefaultApi.work" if offset.nil?
  
  
  
  
  
  
  
  
  
  
  
  # resource path
  local_var_path = "/works".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'q'] = q
  query_params[:'limit'] = limit
  query_params[:'offset'] = offset
  query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if opts[:'include']

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/vnd.api+json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
  header_params[:'Authorization'] = authorization

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  
  auth_names = ['Authorizer']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'WorkResultSet')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#work\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end