Class: Bullhorn::Rest::Client
- Inherits:
-
Object
- Object
- Bullhorn::Rest::Client
- Includes:
- Authentication, Entities::Appointment, Entities::AppointmentAttendee, Entities::BusinessSector, Entities::Candidate, Entities::CandidateCertification, Entities::CandidateEducation, Entities::CandidateReference, Entities::CandidateWorkHistory, Entities::Category, Entities::ClientContact, Entities::ClientCorporation, Entities::CorporateUser, Entities::CorporationDepartment, Entities::Country, Entities::CustomAction, Entities::JobOrder, Entities::JobSubmission, Entities::Note, Entities::NoteEntity, Entities::Placement, Entities::PlacementChangeRequest, Entities::PlacementCommission, Entities::Sendout, Entities::Skill, Entities::Specialty, Entities::State, Entities::Task, Entities::Tearsheet, Entities::TearsheetRecipient, Entities::TimeUnit
- Defined in:
- lib/bullhorn/rest/client.rb
Instance Attribute Summary collapse
-
#access_token ⇒ Object
readonly
Returns the value of attribute access_token.
-
#auth_code ⇒ Object
readonly
Returns the value of attribute auth_code.
-
#client_id ⇒ Object
readonly
Returns the value of attribute client_id.
-
#client_secret ⇒ Object
readonly
Returns the value of attribute client_secret.
-
#password ⇒ Object
readonly
Returns the value of attribute password.
-
#refresh_token ⇒ Object
readonly
Returns the value of attribute refresh_token.
-
#rest_token ⇒ Object
readonly
Returns the value of attribute rest_token.
-
#rest_url ⇒ Object
readonly
Returns the value of attribute rest_url.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
Instance Method Summary collapse
- #conn ⇒ Object
-
#initialize(options = {}) ⇒ Client
constructor
Initializes a new Bullhorn REST Client.
Methods included from Entities::Base
Methods included from Authentication
#auth_conn, #authenticate, #authenticated?, #authorize, #login, #retrieve_tokens
Constructor Details
#initialize(options = {}) ⇒ Client
Initializes a new Bullhorn REST Client
48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/bullhorn/rest/client.rb', line 48 def initialize( = {}) @username = [:username] @password = [:password] @client_id = [:client_id] @client_secret = [:client_secret] @auth_code = [:auth_code] @rest_url = [:rest_url] @rest_token = [:rest_token] @access_token = [:access_token] @refresh_token = [:refresh_token] end |
Instance Attribute Details
#access_token ⇒ Object (readonly)
Returns the value of attribute access_token.
45 46 47 |
# File 'lib/bullhorn/rest/client.rb', line 45 def access_token @access_token end |
#auth_code ⇒ Object (readonly)
Returns the value of attribute auth_code.
45 46 47 |
# File 'lib/bullhorn/rest/client.rb', line 45 def auth_code @auth_code end |
#client_id ⇒ Object (readonly)
Returns the value of attribute client_id.
45 46 47 |
# File 'lib/bullhorn/rest/client.rb', line 45 def client_id @client_id end |
#client_secret ⇒ Object (readonly)
Returns the value of attribute client_secret.
45 46 47 |
# File 'lib/bullhorn/rest/client.rb', line 45 def client_secret @client_secret end |
#password ⇒ Object (readonly)
Returns the value of attribute password.
45 46 47 |
# File 'lib/bullhorn/rest/client.rb', line 45 def password @password end |
#refresh_token ⇒ Object (readonly)
Returns the value of attribute refresh_token.
45 46 47 |
# File 'lib/bullhorn/rest/client.rb', line 45 def refresh_token @refresh_token end |
#rest_token ⇒ Object (readonly)
Returns the value of attribute rest_token.
45 46 47 |
# File 'lib/bullhorn/rest/client.rb', line 45 def rest_token @rest_token end |
#rest_url ⇒ Object (readonly)
Returns the value of attribute rest_url.
45 46 47 |
# File 'lib/bullhorn/rest/client.rb', line 45 def rest_url @rest_url end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
45 46 47 |
# File 'lib/bullhorn/rest/client.rb', line 45 def username @username end |
Instance Method Details
#conn ⇒ Object
62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/bullhorn/rest/client.rb', line 62 def conn if !authenticated? authenticate end params = { BhRestToken: rest_token } @conn ||= Faraday.new(url: rest_url, params: params) end |