CollectionsClient - the Ruby gem for the RDA Collections API
The RDA Collections API Recommendation is a unified model and interface specification for CRUD operations on data collections, with particular observance of persistent identification and typing aspects. The recommendation allows building collections within diverse domains and then sharing or expanding them across disciplines.
This SDK is automatically generated by the Swagger Codegen project:
- API version: 1.0.0
- Package version: 1.0.0
- Build date: 2017-08-29T09:09:42.123-04:00
- Build package: class io.swagger.codegen.languages.RubyClientCodegen
To build the Ruby code into a gem:
gem build rda-collections-client.gemspec
Then either install the gem locally:
gem install ./rda-collections-client-1.0.0.gem
(for development, run gem install --dev ./rda-collections-client-1.0.0.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 'rda-collections-client', '~> 1.0.0'
If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:
gem 'rda-collections-client', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'
Include the Ruby code directly using -I
as follows:
ruby -Ilib script.rb
Please follow the installation procedure and then run the following code:
# Load the gem
require 'rda-collections-client'
api_instance = CollectionsClient::CollectionsApi.new
opts = {
f_model_type: "f_model_type_example", # String | Filter response by the modelType property of the collection.
f_member_type: "f_member_type_example", # String | Filter response by the data type of contained collection member. A collection will meet this requirement if any of its members are of the requested type.
f_ownership: "f_ownership_example", # String | Filter response by the ownership property of the collection
cursor: "cursor_example" # String | cursor for iterating a prior response to this query
}
begin
#Get a list of all collections provided by this service. A successful request returns an HTTP 200 response code with a CollectionResultSet object in the response body.
result = api_instance.collections_get(opts)
p result
rescue CollectionsClient::ApiError => e
puts "Exception when calling CollectionsApi->collections_get: #{e}"
end
All URIs are relative to https://api.example.org/v1
Class | Method | HTTP request | Description |
---|---|---|---|
CollectionsClient::CollectionsApi | collections_get | GET /collections | Get a list of all collections provided by this service. A successful request returns an HTTP 200 response code with a CollectionResultSet object in the response body. |
CollectionsClient::CollectionsApi | collections_id_capabilities_get | GET /collections/{id}/capabilities | Get the capabilities of this collection. A successful request returns an HTTP 200 response code with a CollectionCapabilities object in the response body. |
CollectionsClient::CollectionsApi | collections_id_delete | DELETE /collections/{id} | Delete a collection. A successful request returns an HTTP 200 response code with an empty response body. |
CollectionsClient::CollectionsApi | collections_id_get | GET /collections/{id} | Get the properties of a specific collection. A successful request returns an HTTP 200 response code with the requested CollectionObject in the response body. |
CollectionsClient::CollectionsApi | collections_id_ops_find_match_post | POST /collections/{id}/ops/findMatch | Find member objects in a collection which match the supplied member object. A successful request returns an HTTP 200 response code with a CollectionResultSet object in the response body. |
CollectionsClient::CollectionsApi | collections_id_ops_flatten_get | GET /collections/{id}/ops/flatten | Flattens the collection. A successful request returns an HTTP 200 response code with a MemberResultSet object in the response body. |
CollectionsClient::CollectionsApi | collections_id_ops_intersection_other_id_get | GET /collections/{id}/ops/intersection/{otherId} | Retrieve the members at the intersection of two collections. A successful request returns an HTTP 200 response code with a CollectionResultSet object in the response body. |
CollectionsClient::CollectionsApi | collections_id_ops_union_other_id_get | GET /collections/{id}/ops/union/{otherId} | Retrieve the union of two collections. A successful request returns an HTTP 200 response code with a CollectionResultSet object in the response body. |
CollectionsClient::CollectionsApi | collections_id_put | PUT /collections/{id} | Update the properties of a Collection Object. A successful request returns an HTTP 200 response code with the updated CollectionObject in the response body. |
CollectionsClient::CollectionsApi | collections_post | POST /collections | Create one or more new collections. Successful requests will return an HTTP 201 response code with an array of the newly created CollectionObject(s) in the response body. |
CollectionsClient::MembersApi | collections_id_members_get | GET /collections/{id}/members | Get the members in a collection. A successful request returns an HTTP 200 response code with a MemberResultSet object in the response body. |
CollectionsClient::MembersApi | collections_id_members_mid_delete | DELETE /collections/{id}/members/{mid} | Remove a collection member item. A successful request returns an HTTP 200 response code wiht an empty response body. |
CollectionsClient::MembersApi | collections_id_members_mid_get | GET /collections/{id}/members/{mid} | Get the properties of a member item in a collection. A successful request returns an HTTP 200 response code with a MemberItem in the response body. |
CollectionsClient::MembersApi | collections_id_members_mid_properties_property_delete | DELETE /collections/{id}/members/{mid}/properties/{property} | Delete a named property of a member item in a collection. A successful request returns an HTTP 200 response code and empty response body. |
CollectionsClient::MembersApi | collections_id_members_mid_properties_property_get | GET /collections/{id}/members/{mid}/properties/{property} | Get a named property of a member item in a collection. A successful request returns an HTTP 200 response code and the requested MemberItem in teh response body. |
CollectionsClient::MembersApi | collections_id_members_mid_properties_property_put | PUT /collections/{id}/members/{mid}/properties/{property} | Update a named property of a member item in a collection. A successful request returns an HTTP 200 response code and the updated MemberItem in the response body. |
CollectionsClient::MembersApi | collections_id_members_mid_put | PUT /collections/{id}/members/{mid} | Update the properties of a collection member item. A successful request returns an HTTP 200 response code with the updated MemberItem in the response body. |
CollectionsClient::MembersApi | collections_id_members_post | POST /collections/{id}/members | Add one or more new member items to this collection. A successful request returns an HTTP 201 response code with an array of the new added MemberItems in the response body. |
CollectionsClient::ServiceApi | features_get | GET /features | Gets the service-level features. A successful request returns an HTTP 200 response code with the ServiceFeatures object in the response body. |
- CollectionsClient::CollectionCapabilities
- CollectionsClient::CollectionItemMappingMetadata
- CollectionsClient::CollectionObject
- CollectionsClient::CollectionOperations
- CollectionsClient::CollectionProperties
- CollectionsClient::CollectionResultSet
- CollectionsClient::Error
- CollectionsClient::MemberItem
- CollectionsClient::MemberResultSet
- CollectionsClient::ServiceFeatures
- Type: OAuth
- Flow: accessCode
- Authorization URL: http://example.org/oauth/authorize
- Scopes:
- write: Can write collections
- read: Can read collections
- modify: Can modify collections