Sha256: 6846d4ddc512f3dee97b89f38686255b5bc43ccd8733d99077cc7f5ebdb30725

Contents?: true

Size: 935 Bytes

Versions: 2

Compression:

Stored size: 935 Bytes

Contents

#!/usr/bin/env ruby

require "bundler/setup"
require "folio_client"

marc_files = *ARGV

client =
  FolioClient.configure(
    url: ENV["OKAPI_URL"],
    login_params: {
      username: ENV["OKAPI_USER"],
      password: ENV["OKAPI_PASSWORD"]
    },
    okapi_headers: {
      "X-Okapi-Tenant": ENV["OKAPI_TENANT"],
      "User-Agent": "folio_client gem (testing)"
    }
  )

pp(client.fetch_marc_hash(instance_hrid: "a666"))

puts client.fetch_marc_xml(instance_hrid: "a666")
puts client.fetch_marc_xml(barcode: "20503330279")

puts client.users(query: 'username=="pet*"')

records = marc_files.flat_map do |marc_file_path|
  MARC::Reader.new(marc_file_path).to_a
end

data_importer =
  client.data_import(
    records: records,
    job_profile_id: "e34d7b92-9b83-11eb-a8b3-0242ac130003",
    job_profile_name: "Default - Create instance and SRS MARC Bib"
  )

puts data_importer.wait_until_complete
puts data_importer.instance_hrids

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
folio_client-0.15.0 api_test.rb
folio_client-0.14.0 api_test.rb