Class: HelloSign::Client
- Inherits:
-
Object
- Object
- HelloSign::Client
- Includes:
- Api::Account, Api::Embedded, Api::OAuth, Api::SignatureRequest, Api::Team, Api::Template, Api::UnclaimedDraft
- Defined in:
- lib/hello_sign/client.rb
Overview
You’ll need the HelloSign::Client to do just about everything, from creating signatures to updating account information.
Constant Summary collapse
- ERRORS =
{ 400 => Error::BadRequest, 401 => Error::, 402 => Error::PaidApiPlanRequired, 403 => Error::Forbidden, 404 => Error::NotFound, 405 => Error::MethodNotAllowed, 409 => Error::Conflict, 410 => Error::Gone, 500 => Error::InternalServerError, 502 => Error::BadGateway, 503 => Error::ServiceUnavailable }
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#api_version ⇒ Object
Returns the value of attribute api_version.
-
#auth_token ⇒ Object
Returns the value of attribute auth_token.
-
#client_id ⇒ Object
Returns the value of attribute client_id.
-
#client_secret ⇒ Object
Returns the value of attribute client_secret.
-
#email_address ⇒ Object
Returns the value of attribute email_address.
-
#end_point ⇒ Object
Returns the value of attribute end_point.
-
#log_level ⇒ Object
Returns the value of attribute log_level.
-
#logging ⇒ Object
Returns the value of attribute logging.
-
#oauth_end_point ⇒ Object
Returns the value of attribute oauth_end_point.
-
#password ⇒ Object
Returns the value of attribute password.
-
#user_agent ⇒ Object
Returns the value of attribute user_agent.
Instance Method Summary collapse
-
#delete(path, options = {}) ⇒ Object
Make a http delete request.
-
#get(path, options = {}) ⇒ Object
Make a http get request.
-
#initialize(opts = {}) ⇒ HelloSign::Client
constructor
A new HelloSign::Client.
-
#post(path, options = {}) ⇒ Object
Make a http post request.
-
#put(path, options = {}) ⇒ Object
Make a http put request.
Methods included from Api::OAuth
#get_oauth_token, #oauth_create_account, #oauth_url, #refresh_oauth_token
Methods included from Api::Embedded
#get_embedded_sign_url, #get_embedded_template_edit_url
Methods included from Api::UnclaimedDraft
#create_embedded_unclaimed_draft, #create_embedded_unclaimed_draft_with_template, #create_unclaimed_draft
Methods included from Api::Team
#add_member_to_team, #create_team, #destroy_team, #get_team, #remove_member_from_team, #update_team
Methods included from Api::Template
#add_user_to_template, #create_embedded_template_draft, #delete_template, #get_template, #get_template_files, #get_templates, #remove_user_from_template
Methods included from Api::SignatureRequest
#cancel_signature_request, #create_embedded_signature_request, #create_embedded_signature_request_with_template, #get_signature_request, #get_signature_requests, #remind_signature_request, #send_signature_request, #send_signature_request_with_template, #signature_request_files
Methods included from Api::Account
#create_account, #get_account, #update_account, #verify
Constructor Details
#initialize(opts = {}) ⇒ HelloSign::Client
Returns a new HelloSign::Client.
76 77 78 79 80 81 |
# File 'lib/hello_sign/client.rb', line 76 def initialize(opts={}) = HelloSign..merge(opts) HelloSign::Configuration::VALID_OPTIONS_KEYS.each do |key| self.send("#{key}=", [key]) end end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
53 54 55 |
# File 'lib/hello_sign/client.rb', line 53 def api_key @api_key end |
#api_version ⇒ Object
Returns the value of attribute api_version.
53 54 55 |
# File 'lib/hello_sign/client.rb', line 53 def api_version @api_version end |
#auth_token ⇒ Object
Returns the value of attribute auth_token.
53 54 55 |
# File 'lib/hello_sign/client.rb', line 53 def auth_token @auth_token end |
#client_id ⇒ Object
Returns the value of attribute client_id.
53 54 55 |
# File 'lib/hello_sign/client.rb', line 53 def client_id @client_id end |
#client_secret ⇒ Object
Returns the value of attribute client_secret.
53 54 55 |
# File 'lib/hello_sign/client.rb', line 53 def client_secret @client_secret end |
#email_address ⇒ Object
Returns the value of attribute email_address.
53 54 55 |
# File 'lib/hello_sign/client.rb', line 53 def email_address @email_address end |
#end_point ⇒ Object
Returns the value of attribute end_point.
53 54 55 |
# File 'lib/hello_sign/client.rb', line 53 def end_point @end_point end |
#log_level ⇒ Object
Returns the value of attribute log_level.
53 54 55 |
# File 'lib/hello_sign/client.rb', line 53 def log_level @log_level end |
#logging ⇒ Object
Returns the value of attribute logging.
53 54 55 |
# File 'lib/hello_sign/client.rb', line 53 def logging @logging end |
#oauth_end_point ⇒ Object
Returns the value of attribute oauth_end_point.
53 54 55 |
# File 'lib/hello_sign/client.rb', line 53 def oauth_end_point @oauth_end_point end |
#password ⇒ Object
Returns the value of attribute password.
53 54 55 |
# File 'lib/hello_sign/client.rb', line 53 def password @password end |
#user_agent ⇒ Object
Returns the value of attribute user_agent.
53 54 55 |
# File 'lib/hello_sign/client.rb', line 53 def user_agent @user_agent end |
Instance Method Details
#delete(path, options = {}) ⇒ Object
Make a http delete request
123 124 125 126 127 |
# File 'lib/hello_sign/client.rb', line 123 def delete(path, ={}) response = request(path, :delete, ) validate response parse response end |
#get(path, options = {}) ⇒ Object
Make a http get request
88 89 90 91 92 |
# File 'lib/hello_sign/client.rb', line 88 def get(path, ={}) response = request(path, :get, ) validate response parse response end |
#post(path, options = {}) ⇒ Object
Make a http post request
100 101 102 103 104 |
# File 'lib/hello_sign/client.rb', line 100 def post(path, ={}) response = request(path, :post, ) validate response parse response end |
#put(path, options = {}) ⇒ Object
Make a http put request
112 113 114 115 116 |
# File 'lib/hello_sign/client.rb', line 112 def put(path, ={}) response = request(path, :put, ) validate response parse response end |