Class: HelloSign::Client
- Inherits:
-
Object
- Object
- HelloSign::Client
- Includes:
- Api::Account, Api::ApiApp, Api::BulkSendJob, 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::Unauthorized, 402 => Error::PaidApiPlanRequired, 403 => Error::Forbidden, 404 => Error::NotFound, 405 => Error::MethodNotAllowed, 409 => Error::Conflict, 410 => Error::Gone, 429 => Error::ExceededRate, 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.
-
#proxy_pass ⇒ Object
Returns the value of attribute proxy_pass.
-
#proxy_uri ⇒ Object
Returns the value of attribute proxy_uri.
-
#proxy_user ⇒ Object
Returns the value of attribute proxy_user.
-
#timeout ⇒ Object
Returns the value of attribute timeout.
-
#user_agent ⇒ Object
Returns the value of attribute user_agent.
Instance Method Summary collapse
-
#delete(path, options = {}) ⇒ Object
Makes an HTTP DELETE request.
-
#get(path, options = {}) ⇒ Object
Makes an HTTP GET request.
-
#initialize(opts = {}) ⇒ HelloSign::Client
constructor
Initiates a new HelloSign Client.
-
#post(path, options = {}) ⇒ Object
Makes an HTTP POST request.
-
#put(path, options = {}) ⇒ Object
Makes an HTTP PUT request.
Methods included from Api::BulkSendJob
#get_bulk_send_job, #get_bulk_send_jobs
Methods included from Api::ApiApp
#create_api_app, #delete_api_app, #get_api_app, #get_api_apps, #update_api_app
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, #edit_and_resend_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, #update_template_files
Methods included from Api::SignatureRequest
#bulk_send_with_template, #cancel_signature_request, #create_embedded_signature_request, #create_embedded_signature_request_with_template, #embedded_bulk_send_with_template, #get_signature_request, #get_signature_requests, #release_hold_signature_request, #release_on_hold_signature_request, #remind_signature_request, #remove_signature_request, #send_signature_request, #send_signature_request_with_template, #signature_request_files, #update_signature_request
Methods included from Api::Account
#create_account, #get_account, #update_account, #verify
Constructor Details
#initialize(opts = {}) ⇒ HelloSign::Client
Initiates a new HelloSign Client
79 80 81 82 83 84 |
# File 'lib/hello_sign/client.rb', line 79 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.
50 51 52 |
# File 'lib/hello_sign/client.rb', line 50 def api_key @api_key end |
#api_version ⇒ Object
Returns the value of attribute api_version.
50 51 52 |
# File 'lib/hello_sign/client.rb', line 50 def api_version @api_version end |
#auth_token ⇒ Object
Returns the value of attribute auth_token.
50 51 52 |
# File 'lib/hello_sign/client.rb', line 50 def auth_token @auth_token end |
#client_id ⇒ Object
Returns the value of attribute client_id.
50 51 52 |
# File 'lib/hello_sign/client.rb', line 50 def client_id @client_id end |
#client_secret ⇒ Object
Returns the value of attribute client_secret.
50 51 52 |
# File 'lib/hello_sign/client.rb', line 50 def client_secret @client_secret end |
#email_address ⇒ Object
Returns the value of attribute email_address.
50 51 52 |
# File 'lib/hello_sign/client.rb', line 50 def email_address @email_address end |
#end_point ⇒ Object
Returns the value of attribute end_point.
50 51 52 |
# File 'lib/hello_sign/client.rb', line 50 def end_point @end_point end |
#log_level ⇒ Object
Returns the value of attribute log_level.
50 51 52 |
# File 'lib/hello_sign/client.rb', line 50 def log_level @log_level end |
#logging ⇒ Object
Returns the value of attribute logging.
50 51 52 |
# File 'lib/hello_sign/client.rb', line 50 def logging @logging end |
#oauth_end_point ⇒ Object
Returns the value of attribute oauth_end_point.
50 51 52 |
# File 'lib/hello_sign/client.rb', line 50 def oauth_end_point @oauth_end_point end |
#password ⇒ Object
Returns the value of attribute password.
50 51 52 |
# File 'lib/hello_sign/client.rb', line 50 def password @password end |
#proxy_pass ⇒ Object
Returns the value of attribute proxy_pass.
50 51 52 |
# File 'lib/hello_sign/client.rb', line 50 def proxy_pass @proxy_pass end |
#proxy_uri ⇒ Object
Returns the value of attribute proxy_uri.
50 51 52 |
# File 'lib/hello_sign/client.rb', line 50 def proxy_uri @proxy_uri end |
#proxy_user ⇒ Object
Returns the value of attribute proxy_user.
50 51 52 |
# File 'lib/hello_sign/client.rb', line 50 def proxy_user @proxy_user end |
#timeout ⇒ Object
Returns the value of attribute timeout.
50 51 52 |
# File 'lib/hello_sign/client.rb', line 50 def timeout @timeout end |
#user_agent ⇒ Object
Returns the value of attribute user_agent.
50 51 52 |
# File 'lib/hello_sign/client.rb', line 50 def user_agent @user_agent end |
Instance Method Details
#delete(path, options = {}) ⇒ Object
Makes an HTTP DELETE request
121 122 123 124 125 126 |
# File 'lib/hello_sign/client.rb', line 121 def delete(path, ={}) response = request(path, :delete, ) validate response parsed_response = parse response data = { headers: response.headers, body: parsed_response } end |
#get(path, options = {}) ⇒ Object
Makes an HTTP GET request
89 90 91 92 93 94 |
# File 'lib/hello_sign/client.rb', line 89 def get(path, ={}) response = request(path, :get, ) validate response parsed_response = parse response data = { headers: response.headers, body: parsed_response } end |
#post(path, options = {}) ⇒ Object
Makes an HTTP POST request
100 101 102 103 104 105 |
# File 'lib/hello_sign/client.rb', line 100 def post(path, ={}) response = request(path, :post, ) validate response parsed_response = parse response data = { headers: response.headers, body: parsed_response } end |
#put(path, options = {}) ⇒ Object
Makes an HTTP PUT request
111 112 113 114 115 116 |
# File 'lib/hello_sign/client.rb', line 111 def put(path, ={}) response = request(path, :put, ) validate response responsed_response = parse response data = { headers: response.headers, body: parsed_response } end |