Module: HelloSign::Api::Template
- Included in:
- Client
- Defined in:
- lib/hello_sign/api/template.rb
Overview
Contains all the api calls for the Template resource. Take a look at our template form api document for more information about this.
Instance Method Summary collapse
-
#add_user_to_template(opts) ⇒ Template
Gives the specified Account on your team access to a Template.
-
#get_template(opts) ⇒ HelloSign::Resource::Template
Retrieves the Template specified by the id parameter.
-
#get_templates(opts = {}) ⇒ HelloSign::Resource::ResourceArray
Retrieves the Templates for the current user account.
-
#remove_user_from_template(opts) ⇒ Template
Removes the specified Account’s access to the specified Template.
Instance Method Details
#add_user_to_template(opts) ⇒ Template
Gives the specified Account on your team access to a Template
52 53 54 55 56 |
# File 'lib/hello_sign/api/template.rb', line 52 def add_user_to_template(opts) path = "/template/add_user/#{opts[:template_id]}" opts.delete(:template_id) HelloSign::Resource::Template.new post(path, :body => opts) end |
#get_template(opts) ⇒ HelloSign::Resource::Template
Retrieves the Template specified by the id parameter.
22 23 24 |
# File 'lib/hello_sign/api/template.rb', line 22 def get_template(opts) HelloSign::Resource::Template.new get("/template/#{opts[:template_id]}") end |
#get_templates(opts = {}) ⇒ HelloSign::Resource::ResourceArray
Retrieves the Templates for the current user account.
35 36 37 38 39 |
# File 'lib/hello_sign/api/template.rb', line 35 def get_templates(opts={}) path = '/template/list' path += opts[:page] ? "?page=#{opts[:page]}" : '' HelloSign::Resource::ResourceArray.new get(path, opts), 'templates', HelloSign::Resource::Template end |
#remove_user_from_template(opts) ⇒ Template
Removes the specified Account’s access to the specified Template. The user can be designated using their account ID or email address.
69 70 71 72 73 |
# File 'lib/hello_sign/api/template.rb', line 69 def remove_user_from_template(opts) path = "/template/remove_user/#{opts[:template_id]}" opts.delete(:template_id) HelloSign::Resource::Template.new post(path, :body => opts) end |