metatron_ruby_client

MetatronClient - the Ruby gem for the Metatron Server

A primitive modelling bibliographic metadata

This SDK is automatically generated by the Swagger Codegen project:

  • API version: 2.0.0
  • Package version: 0.1.3
  • Build date: 2016-08-26T18:06:29.963-04:00
  • Build package: class io.swagger.codegen.languages.RubyClientCodegen

Installation

Build a gem

To build the Ruby code into a gem:

gem build metatron_ruby_client.gemspec

Then either install the gem locally:

gem install ./metatron_ruby_client-0.1.3.gem

(for development, run gem install --dev ./metatron_ruby_client-0.1.3.gem to install the development dependencies)

or publish the gem to a gem hosting service, e.g. RubyGems.

Finally add this to the Gemfile:

gem 'metatron_ruby_client', '~> 0.1.3'

Install from Git

If the Ruby gem is hosted at a git repository: https://github.com/talis/metatron_rb, then add the following in the Gemfile:

gem 'metatron_ruby_client', :git => 'https://github.com/talis/metatron_rb.git'

Include the Ruby code directly

Include the Ruby code directly using -I as follows:

ruby -Ilib script.rb

Getting Started

Please follow the installation procedure and then run the following code:

# Load the gem
require 'metatron_ruby_client'

# Setup authorization
MetatronClient.configure do |config|
  # Configure API key authorization: Authorizer
  config.api_key['Authorization'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'BEARER' (defaults to nil)
  #config.api_key_prefix['Authorization'] = 'BEARER'
end

api_instance = MetatronClient::DefaultApi.new

authorization = "authorization_example" # String | Bearer token

manifestation_id = "manifestation_id_example" # String | 

body = MetatronClient::Asset.new # Asset | node


begin
  result = api_instance.add_manifestation_asset(authorization, manifestation_idbody)
  p result
rescue MetatronClient::ApiError => e
  puts "Exception when calling DefaultApi->add_manifestation_asset: #{e}"
end

Documentation for API Endpoints

All URIs are relative to http://localhost:3000/2

Class Method HTTP request Description
MetatronClient::DefaultApi add_manifestation_asset POST /manifestations/manifestationId/assets
MetatronClient::DefaultApi get_holdings GET /manifestations/manifestationId/items/tenantCode Get local holdings for a given manifestation
MetatronClient::DefaultApi get_manifestation GET /manifestations/manifestationId Get a specific Manifestation from the dataset
MetatronClient::DefaultApi get_manifestation_assets GET /manifestations/manifestationId/assets Get a set of Assets that are associated with a specific Manifestation
MetatronClient::DefaultApi get_manifestation_works GET /manifestations/manifestationId/works 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.
MetatronClient::DefaultApi get_work GET /works/workId/similar Get a set of Works that are similar to a specific Work
MetatronClient::DefaultApi get_work_assets GET /works/workId/assets Get a set of Assets that are associated with a specific Work
MetatronClient::DefaultApi get_work_manifestations GET /works/workId/manifestations Get a set of Manifestations that encompass a specific Work
MetatronClient::DefaultApi manifestation GET /manifestations
MetatronClient::DefaultApi remove_asset DELETE /assets/assetType/assetId
MetatronClient::DefaultApi work GET /works Get the work best matching the given bibliographic data

Documentation for Models

Documentation for Authorization

Authorizer

  • Type: API key
  • API key parameter name: Authorization
  • Location: HTTP header