README.md in oneaccess-0.1.9 vs README.md in oneaccess-0.2.0

- old
+ new

@@ -2,11 +2,11 @@ This is a ruby gem that wraps the ONEAccess API in an easy to use ruby library, so the API can be accesses transparently by invoking methods. The full documentation about the ONEAccess API can be found at: http://apidocs.oneaccess.io/docs -Currently, only the version `v1.1` is supported by this gem. +Currently, only the version `v1.1` and `v3.0` are supported by this gem. ## Installation & Setup Install the gem directly: ``` gem install oneaccess @@ -49,13 +49,13 @@ This method returns a `User` object if it matches the first name, last name, and email. If there's not a match, then a new user is created and returned. #### How to use: ```ruby -resp = ONEAccess::API::User.getByEmail(first_name: 'Alex', last_name: 'Santos', email: 'alex@ae.com') +resp = ONEAccess::API::V1_1::User.getByEmail(first_name: 'Alex', last_name: 'Santos', email: 'alex@ae.com') -resp.data #=> instance of ONEAcess::DataObject::User +resp.data #=> instance of ONEAccess::DataObject::User resp.data.id #=> 305 (id of the user) resp.data.organization.id #=> 805 (id of the company) resp.data.email #=> alex@ae.com ``` @@ -65,13 +65,13 @@ This method retrieves a research document by providing the research ID and the first name, last name, and email of the user requesting access. If the user does not have access to the research, a `ONEAccess::Error:APIError` exception will be raisen. #### How to use: ```ruby begin - resp = ONEAccess::API::Research.document(document_id: 2341, first_name: 'Alex', last_name: 'Santos', email: 'alex@ae.com') + resp = ONEAccess::API::V1_1::Research.document(document_id: 2341, first_name: 'Alex', last_name: 'Santos', email: 'alex@ae.com') - resp.data #=> instance of ONEAcess::DataObject::ResearchDocumentInfo + resp.data #=> instance of ONEAccess::DataObject::ResearchDocumentInfo resp.data.url #=> url of the document resp.data.title #=> document's title resp.data.saml #=> instance of ONEAccess::DataObject::SAMLInfo puts "requires SAML" unless resp.data.saml.nil? @@ -89,13 +89,13 @@ Similar to the previous method, this method retrieves a research document by providing the research ID, but together with the user's ID instead. If the user does not have access to the research, a `ONEAccess::Error:APIError` exception will be raisen. #### How to use: ```ruby begin - resp = ONEAccess::API::Research.document_by_user_id(document_id: 2341, user_id: 805) + resp = ONEAccess::API::V1_1::Research.document_by_user_id(document_id: 2341, user_id: 805) - resp.data #=> instance of ONEAcess::DataObject::ResearchDocumentInfo + resp.data #=> instance of ONEAccess::DataObject::ResearchDocumentInfo resp.data.url #=> url of the document resp.data.title #=> document's title resp.data.saml #=> instance of ONEAccess::DataObject::SAMLInfo puts "requires SAML" unless resp.data.saml.nil? @@ -112,14 +112,14 @@ This method retrieves a list of symbology companies by providing a `IsPrivate`, `PageNumber` and `PageSize`. #### How to use: ```ruby -resp = ONEAccess::API::Symbology.companies(is_private: false, page_number: 0, page_size: 20) +resp = ONEAccess::API::V1_1::Symbology.companies(is_private: false, page_number: 0, page_size: 20) -resp #=> instance of ONEAcess::Response::CompaniesResponse -resp.data #=> instance of Array containing ONEAcess::DataObject::CompanyLight +resp #=> instance of ONEAccess::Response::CompaniesResponse +resp.data #=> instance of Array containing ONEAccess::DataObject::CompanyLight end ``` ### Symbology Company _(/symbology/company/:id)_ @@ -127,14 +127,14 @@ This method retrieves a company by providing an `Id`. #### How to use: ```ruby -resp = ONEAccess::API::Symbology.company(id: 1) +resp = ONEAccess::API::V1_1::Symbology.company(id: 1) -resp #=> instance of ONEAcess::Response::CompanyResponse -resp.data #=> instance of Array containing ONEAcess::DataObject::Company +resp #=> instance of ONEAccess::Response::CompanyResponse +resp.data #=> instance of Array containing ONEAccess::DataObject::Company end ``` ### Get Organization by ID _(/organizations/id)_ @@ -142,13 +142,13 @@ This method returns an Organization by providing the Organization ID. #### How to use: ```ruby -resp = ONEAccess::API::Organizations.get_organization(id: 123) +resp = ONEAccess::API::V1_1::Organizations.get_organization(id: 123) -resp.data #=> instance of ONEAcess::DataObject::Organization +resp.data #=> instance of ONEAccess::DataObject::Organization resp.data.id #=> id of the Organization resp.data.name #=> name of the Organization resp.data.short_name #=> Short Name of the Organization resp.data.active #=> Boolean meaning if the Organization is Active or not resp.data.type #=> type of the Organization (Unspecified = 0, Buyside = 1, Sellside = 2, Advisory = 3, Other = 4, Vendor = 5, Internal = 6) @@ -165,11 +165,11 @@ Creates a new Research Entitlement Request for the given User. #### How to use ```ruby begin - resp = ONEAccess::API::Entitlement::Research::UserRequests.create(user_id:'123', sell_side_org_id:'456', + resp = ONEAccess::API::V1_1::Entitlement::Research::UserRequests.create(user_id:'123', sell_side_org_id:'456', sales_contact_first_name:'John', sales_contact_last_name:'Doe', sales_contact_email:'john.doe@example.com') resp.data #=> ID of the new Request rescue ONEAccess::Error::APIError => e puts "Error creating the Research Entitlement Request: #{e}" @@ -182,13 +182,13 @@ This method returns a list of user entitlement requests based on the specified `UserIds`, `PageNumber`, `PageSize`, `SortBy`, `IsAscending`, `CreateDateFrom`, `CreateDateTo`, `SellSideOrgIds` and `EntitlementStatus` parameter values. #### How to use: ```ruby begin - resp = ONEAccess::API::Entitlement::Research::UserRequests.get_list + resp = ONEAccess::API::V1_1::Entitlement::Research::UserRequests.get_list - resp.data #=> Array of instances of ONEAcess::DataObject::UserEntitlementRequest + resp.data #=> Array of instances of ONEAccess::DataObject::UserEntitlementRequest rescue ONEAccess::Error::APIError => e puts "Error listing the available user entitlement requests" end ``` @@ -199,13 +199,13 @@ to receive updates from. Returns the API Status Code as the result of the subscription operation. #### How to use: ```ruby begin - resp = ONEAccess::API::Entitlement::UserSubscription.subscribe(user_ids: [<user_ids>]) + resp = ONEAccess::API::V1_1::Entitlement::UserSubscription.subscribe(user_ids: [<user_ids>]) - resp #=> instance of ONEAcess::Response::SubscribeToUpdatesResponse + resp #=> instance of ONEAccess::Response::SubscribeToUpdatesResponse rescue ONEAccess::Error::APIError => e puts "Error subscribing users for entitlements updates" end ``` @@ -221,12 +221,28 @@ Use UTC time zone for date parameter. #### How to use: ```ruby begin - resp = ONEAccess::API::Entitlement::UserSubscription.changed_users(from_date: <utc_string_date>) + resp = ONEAccess::API::V1_1::Entitlement::UserSubscription.changed_users(from_date: <utc_string_date>) - resp #=> instance of ONEAcess::Response::ChangedUsersResponse + resp #=> instance of ONEAccess::Response::ChangedUsersResponse rescue ONEAccess::Error::APIError => e puts "Error getting the list of user ids which entitlements have changed" +end +``` + +### Get Contributors _(/references/contributors)_ +Official Documentation: http://apidocs.oneaccess.io/v2.0/docs/referencescontributors + +Reference endpoint to help retrieve contributor IDs from names. + +#### How to use: +```ruby +begin + resp = ONEAccess::API::V3_0::References.contributors(contributor_names: [<names>], limit: <limit>, offset: <offset>) + + resp #=> instance of ONEAccess::Response::ContributorsResponse +rescue ONEAccess::Error::APIError => e + puts "Error getting the list of contributors" end ```