Sha256: 0df9b96b9302148d4c8280c9a890a9ba1303abe0f074a3c1828a00c1f1309217
Contents?: true
Size: 1009 Bytes
Versions: 2
Compression:
Stored size: 1009 Bytes
Contents
#!/usr/bin/env ruby # frozen_string_literal: true require 'bundler/setup' require 'folio_client' marc_files = *ARGV client = FolioClient.configure( url: ENV.fetch('OKAPI_URL', nil), login_params: { username: ENV.fetch('OKAPI_USER', nil), password: ENV.fetch('OKAPI_PASSWORD', nil) }, okapi_headers: { 'X-Okapi-Tenant': ENV.fetch('OKAPI_TENANT', nil), '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.17.0 | api_test.rb |
folio_client-0.16.0 | api_test.rb |