diff --git a/lib/hello_sign.rb b/lib/hello_sign.rb index 0d57f04..0f2e870 100644 --- a/lib/hello_sign.rb +++ b/lib/hello_sign.rb @@ -1,8 +1,8 @@ # # The MIT License (MIT) -# +# # Copyright (C) 2014 hellosign.com -# +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights @@ -28,9 +28,8 @@ module HelloSign extend Configuration - # - # # If HelloSign module don't respond_to? method, then delegate it to HelloSign::Client + # # If HelloSign module doesn't respond to method, then delegates it to HelloSign::Client # @param method [Symbol] method name # @param *args [Array] arguments passed into the method # @param &block [Block] a block passed into the method @@ -41,7 +40,7 @@ def self.method_missing(method, *args, &block) end # - # If HelloSign module don't respond_to? method, ask HelloSign::Client whether it respond or not + # If HelloSign module don't respond to method, asks HelloSign::Client whether it responded or not # @param method [Symbol] method name # def self.respond_to?(method, include_all=false) diff --git a/lib/hello_sign/api/account.rb b/lib/hello_sign/api/account.rb index 89632ca..62a4434 100644 --- a/lib/hello_sign/api/account.rb +++ b/lib/hello_sign/api/account.rb @@ -26,14 +26,13 @@ module HelloSign module Api # - # Contains all the api calls for the Account resource. - # Take a look at our {https://app.hellosign.com/api/reference#Account account api document} + # Contains all the API calls for the Account resource. + # Take a look at our API Documentation on the Account resource (https://app.hellosign.com/api/reference#Account) # for more information about this. # # @author [hellosign] # module Account - # # Returns the current user's account information. # @@ -47,7 +46,7 @@ def get_account end # - # Creates a new HelloSign account. The user will still need to confirm their email address + # Creates a new HelloSign account. The user will still need to confirm the email address # to complete the creation process. # # Note: This request does not require authentication. diff --git a/lib/hello_sign/api/api_app.rb b/lib/hello_sign/api/api_app.rb index 4989511..880585a 100644 --- a/lib/hello_sign/api/api_app.rb +++ b/lib/hello_sign/api/api_app.rb @@ -24,10 +24,9 @@ module HelloSign module Api - # - # Contains all the api calls for the ApiApp resource. - # Take a look at our {https://app.hellosign.com/api/reference#Team team api document} + # Contains all the API calls for the ApiApp resource. + # Take a look at our API Documentation for ApiApps (https://app.hellosign.com/api/reference#ApiApp) # for more information about this. # # @author [hellosign] @@ -36,8 +35,9 @@ module ApiApp # # Retrieves information about a specific API App by a given ID + # @option opts [String] client_id The Client ID of the ApiApp. # - # @return [HelloSign::Resource::ApiApp] the API App + # @return [HelloSign::Resource::ApiApp] the ApiApp # # @example # app = @client.get_api_app :client_id => 'fa5c8a0b0f492d768749333ad6fcc214c111e967' @@ -48,8 +48,8 @@ def get_api_app(opts) # # Returns a list of ApiApps that you currently have access to on your account - # @option opts [Integer] page (1) Which page number of the list to return. - # @option opts [Integer] page_size (5) Number of results for each page + # @option opts [Integer] page Sets the page number of the list to return. Defaults to 1. (optional) + # @option opts [Integer] page_size Determines the number of ApiApps returned per page. Defaults to 20. (optional) # # @return [HelloSign::Resource::ResourceArray] # @@ -65,12 +65,14 @@ def get_api_apps(opts={}) # # Creates a new API Application on your account - # @option opts [String] name The name you want to assign to the ApiApp. - # @option opts [String] domain The domain name the ApiApp will be associated with. - # @option opts [String] callback_url (optional) The URL at which the ApiApp should receive event callbacks. - # @option opts [String] custom_logo_file (optional) An image file to use as a custom logo in embedded contexts. (Only applies to some API plans) - # @option opts [String] oauth[callback_url] (optional) The callback URL to be used for OAuth flows. (Required if oauth[scopes] is provided) - # @option opts [String] oauth[scopes] (optional) A comma-separated list of OAuth scopes to be granted to the app. (Required if oauth[callback_url] is provided) + # @option opts [String] name The name assigned to the ApiApp. + # @option opts [String] domain The domain associated with the ApiApp. + # @option opts [String] callback_url The URL that will receive callback events for the ApiApp. (optional) + # @option opts [String] custom_logo_file An image file to use as a custom logo in embedded workflows, if available in the API subscription. (optional) + # @option opts [String] oauth[callback_url] The callback URL to be used for OAuth flows. (optional) + # @option opts [String] oauth[scopes] A comma-separated list of OAuth scopes to be granted to the app. (optional) + # @option opts [String] white_labeling_options Object with elements and values serialized to a string to customize the signer page, if available in the API subscription. (optional) + # @option opts [Boolean] options[can_insert_everywhere] Determines if signers can "Insert Everywhere" when signing a document. (optional) # # @return [HelloSign::Resource::ApiApp] newly created ApiApp object # @@ -81,14 +83,16 @@ def create_api_app(opts) end # - # Updates parameters for a specific API Application on your account, referenced by ID - # @oprion opts [String] client_id (REQUIRED) The ID of the app you want to update - # @option opts [String] name (optional) The name you want to assign to the ApiApp. - # @option opts [String] domain (optional) The domain name the ApiApp will be associated with. - # @option opts [String] callback_url (optional) The URL at which the ApiApp should receive event callbacks. - # @option opts [String] custom_logo_file (optional) An image file to use as a custom logo in embedded contexts. (Only applies to some API plans) - # @option opts [String] oauth[callback_url] (optional) The callback URL to be used for OAuth flows. (Required if oauth[scopes] is provided) - # @option opts [String] oauth[scopes] (optional) A comma-separated list of OAuth scopes to be granted to the app. (Required if oauth[callback_url] is provided) + # Updates settings for a specific ApiApp on your account + # @option opts [String] client_id The Client ID of the ApiApp you want to update. + # @option opts [String] name The name assigned to the ApiApp. (optional) + # @option opts [String] domain The domain associated with the ApiApp. (optional) + # @option opts [String] callback_url The URL that will receive callback events for the ApiApp. (optional) + # @option opts [String] custom_logo_file An image file to use as a custom logo in embedded workflows, if available in the API subscription. (optional) + # @option opts [String] oauth[callback_url] The callback URL to be used for OAuth flows. (optional) + # @option opts [String] oauth[scopes] A comma-separated list of OAuth scopes to be granted to the app. (optional) + # @option opts [String] white_labeling_options Object with elements and values serialized to a string to customize the signer page, if available in the API subscription. (optional) + # @option opts [Boolean] options[can_insert_everywhere] Determines if signers can "Insert Everywhere" when signing a document. (optional) # # @return [HelloSign::Resource::ApiApp] an ApiApp object # @@ -101,10 +105,11 @@ def update_api_app(opts) end # - # Deletes an API App. Can only be invoked for apps you own. + # Deletes an ApiApp. Only available for ApiApps you own. + # @option opts [String] client_id The Client ID of the ApiApp you want to delete. # # @example - # result = @client.delete_api_app :client_id => 'hdialuhfilaudshfa' + # result = @client.delete_api_app :client_id => 'fa5c8a0b0f492d768749333ad6fcc214c111e967' def delete_api_app(opts) path = '/api_app/' + opts[:client_id] delete(path) diff --git a/lib/hello_sign/api/embedded.rb b/lib/hello_sign/api/embedded.rb index c82c97c..0dc586a 100644 --- a/lib/hello_sign/api/embedded.rb +++ b/lib/hello_sign/api/embedded.rb @@ -24,11 +24,10 @@ module HelloSign module Api - # # HelloSign allows you to embed the signing page on your site in an iFrame - # without the need for the end-user to create a HelloSign account. - # Take a look at our {https://app.hellosign.com/api/embeddedSigningWalkthrough embedded signing walkthrough} + # without the need for the signer/preparer to create a HelloSign account. + # Take a look at our Embedded Signing Walkthrough (https://app.hellosign.com/api/embeddedSigningWalkthrough) # for more information about this. # # @author [hellosign] @@ -36,8 +35,9 @@ module Api module Embedded # - # Retrieves the embedded signature request url. - # @option opts [String] signature_id The id of the signature to get a signature url for + # Retrieves the embedded signature sign_url. + # + # @option opts [String] signature_id The Signature ID to retrieve the embedded sign_url for. # # @return [HelloSign::Resource::Embedded] Returns an Embedded object # @example @@ -47,11 +47,15 @@ def get_embedded_sign_url(opts) HelloSign::Resource::Embedded.new get("/embedded/sign_url/#{opts[:signature_id]}") end # - # Retrieves the edit url for an embedded template. - # @option opts [String] template_id The id of the template to get a edit url for - # @option opts [Integer] skip_signer_roles Whether editing signer roles should be skipped - # @option opts [Integer] skip_subject_message Whether editing subject/message should be skipped - # @option opts [Array] merge_fields Merge fields that can be placed in the template + # Retrieves the edit_url for an embedded template. + # @option opts [Boolean] test_mode Indicates if this is a test Embedded Template. A boolean value is also accepted. Defaults to 0. (optional) + # @option opts [String] template_id The Template ID to retreive the embedded edit_url for. + # @option opts [Array] cc_roles The CC roles that must be assigned when using the Embedded Template to create a SignatureRequest. (optional) + # @option opts [String] merge_fields List of fields that can be pre-populated by your application when using the Embedded Template to send a SignatureRequest. (optional) + # * :name (String) Merge field name + # * :type (String) Field type - either "text" or "checkbox" + # @option opts [Boolean] skip_signer_roles Removes the prompt to edit signer roles, if already provided. Defaults to 0. (optional) + # @option opts [Boolean] skip_subject_message Removes the prompt to edit the subject and message, if already provided. Defaults to 0. (optional) # # @return [HelloSign::Resource::Embedded] Returns an Embedded object # @example diff --git a/lib/hello_sign/api/oauth.rb b/lib/hello_sign/api/oauth.rb index 7cf78f3..12cdcf3 100644 --- a/lib/hello_sign/api/oauth.rb +++ b/lib/hello_sign/api/oauth.rb @@ -27,18 +27,19 @@ module Api # # OAuth allows you to perform actions on behalf of other users after they grant you the authorization to do so. - # For example, you could send signature requests on behalf of your users. This page lays out the basic steps to do that. - # IMPORTANT + # For example, you could send signature requests on behalf of your users. + # For more information, see our OAuth API documentation (https://app.hellosign.com/api/oauthWalkthrough). # - # With OAuth, you (the app owner) will be charged for all signature requests sent on behalf of other users via your app. + # IMPORTANT: With some OAuth scopes, you (the app owner) will be charged for all signature requests sent on behalf of other users via your app. # # @author [hellosign] # module OAuth # - # Return the oath url where users can give permission for your application to perform actions on their behalf. - # @param state [String] used for security and must match throughout the flow for a given user. + # Returns the OAuth URL where users can give permission for your application to perform actions on their behalf. + # + # @param state [String] used for security and must match throughout the flow for a given user. # It can be set to the value of your choice (preferably something random). You should verify it matches the expected value when validating the OAuth callback. # @return [type] [description] def oauth_url(state) @@ -46,12 +47,14 @@ def oauth_url(state) end # - # Retrieving the OAuth token + # Retrieves the OAuth token # - # @option opts [String] state variable that was used when you created oauth_url for a specific user - # @option opts [String] code The authorization code passed to your callback when the user granted access + # @option opts [String] state Random value that was used when you created oauth_url for a specific user. + # @option opts [String] code The code passed to your callback when the user granted access. + # @option opts [String] client_id The API App Client ID. + # @option opts [String] client_secret The secret token of your API App. # - # @return [Hash] oauth data of the user + # @return [Hash] OAuth data of the user # # @example # client = HelloSign::Client.new :api_key => '%apikey%', :client_id => 'cc91c61d00f8bb2ece1428035716b', :client_secret => '1d14434088507ffa390e6f5528465' @@ -64,11 +67,11 @@ def get_oauth_token(opts) end # - # refresh user oauth token. + # Refreshes the user's OAuth token. # - # @return [Hash] refreshed oauth info - # @example - # client = HelloSign::Client.new :api_key => '%apikey%', :client_id => 'cc91c61d00f8bb2ece1428035716b', :client_secret => '1d14434088507ffa390e6f5528465' + # @option opts [String] refresh_token The refresh provided when the access token has expired. + # + # @return [Hash] Refreshed OAuth info # # @example # client.refresh_oauth_token :refresh_token => 'hNTI2MTFmM2VmZDQxZTZjOWRmZmFjZmVmMGMyNGFjMzI2MGI5YzgzNmE3' @@ -79,12 +82,16 @@ def refresh_oauth_token(opts) post('/oauth/token', { :body => opts, :oauth_request => true }) end - # - # Create new user and get their OAuth token. The user will receive an email asking them to confirm the access being granted. Your app will not be able to perform actions on behalf of this user until they confirm. - # @option opts [String] email_address new user email address + # Create new user and get their OAuth token. The user will receive an email asking them to confirm the access being granted. + # Your app will not be able to perform actions on behalf of this user until they confirm. + # + # @option opts [String] email_address New user email address. + # + # @example + # client.oauth_create_account :email_address => 'new_user@example.com' # - # @return [Hash] details about new user, including oath data + # @return [Hash] details about new user, including OAuth data def oauth_create_account(opts) opts[:client_id] = self.client_id opts[:client_secret] = self.client_secret diff --git a/lib/hello_sign/api/signature_request.rb b/lib/hello_sign/api/signature_request.rb index 1aedf12..570dcf0 100644 --- a/lib/hello_sign/api/signature_request.rb +++ b/lib/hello_sign/api/signature_request.rb @@ -26,8 +26,8 @@ module HelloSign module Api # - # Contains all the api about the SignatureRequest resource. - # Take a look at our {https://app.hellosign.com/api/reference#SignatureRequest signature request api document} + # Contains all the API calls for the SignatureRequest resource. + # Take a look at our API Documentation for sending Signature Requests (https://app.hellosign.com/api/reference#SignatureRequest) # for more information about this. # # @author [hellosign] @@ -37,7 +37,6 @@ module SignatureRequest # # Retrieves a Signature Request with the given ID. # @option opts [String] signature_request_id The id of the SignatureRequest to retrieve. - # @option opts [Integer] ux_version sets the version of the signer page to use # # @return [HelloSign::Resource::SignatureRequest] a SignatureRequest object # @@ -52,10 +51,11 @@ def get_signature_request(opts) end # - # Returns a list of SignatureRequests that you can access. This includes SignatureRequests you have sent as well as received, but not ones that you have been CCed on. - # @option opts[:page] [Integer] page (1) Which page number of the Template List to return. - # @option opts[:ux_version] [Integer] ux_version sets the version of the signer page to use - # @option opts[:query] [String] query string to search on, such as "title:Field Trip Release AND from:me" + # Returns a list of SignatureRequests that you can access. This includes SignatureRequests you have sent as well as received, but not ones that you have been CC'd on. + # @option opts [String] account_id Indicates which account to return SignatureRequests for. Defaults to your account. (optional) + # @option opts [Integer] page Sets the page number of the list to return. Defaults to 1. (optional) + # @option opts [Integer] page_size Determines the number of SignatureRequests returned per page. Defaults to 20. (optional) + # @option opts [String] query Search terms and/or fields to filter the SignatureRequests. (optional) # # @return [HelloSign::Resource::ResourceArray] # @@ -72,23 +72,33 @@ def get_signature_requests(opts={}) # # Creates and sends a new SignatureRequest with the submitted documents. - # If form_fields_per_document is not specified, a signature page will be affixed at the end + # If form_fields_per_document is not specified or use_text_tags is not enabled, a signature page will be affixed at the end # and all signers will be required to add their signature there. - # @option opts [Integer] test_mode (0) Whether this is a test, the signature request will not be legally binding if set to 1. - # @option opts [Array] files Use files to indicate the uploaded file(s) to send for signature. Currently we only support use of either the files parameter or file_urls parameter, not both. - # @option opts [Array] file_urls Use file_urls to have HelloSign download the file(s) to send for signature. Currently we only support use of either the files parameter or file_urls parameter, not both. - # @option opts [String] title The title you want to assign to the SignatureRequest. - # @option opts [String] subject The subject in the email that will be sent to the signers. - # @option opts [String] message The custom message in the email that will be sent to the signers. - # @option opts [String] signing_redirect_url The URL you want the signer redirected to after they successfully sign. (optional) + # @option opts [Boolean] test_mode Indicates if this is a test SignatureRequest, it will not be legally binding if set to 1. A boolean value is also accepted. Defaults to 0. (optional) + # @option opts [Array] files Specified file path(s) to upload file(s) to send for signature. Currently we only support use of either the files parameter or file_urls parameter, not both. + # @option opts [Array] file_urls URL(s) for HelloSign to download the file(s) to send for signature. Currently we only support use of either the files parameter or file_urls parameter, not both. + # @option opts [String] title The title you want to assign to the SignatureRequest. (optional) + # @option opts [String] subject The subject in the email that will be sent to the signer(s). (optional) + # @option opts [String] message The custom message in the email that will be sent to the signer(s). (optional) + # @option opts [String] signing_redirect_url The URL you want the signer(s) redirected to after they successfully sign. (optional) # @option opts [Array] signers List of signers, each item is a Hash with these keys: - # * :name (String) Sender' name - # * :email_address (String) Sender's email address - # * :order (Integer) The order the signer is required to sign in - # * :pin (Integer) The 4- to 12-character access code that will secure this signer's signature page. You must have a business plan to use this feature. - # @option opts [Array] cc_email_addresses The email addresses that should be CCed. - # @option opts [Array] custom_fields An array of custom merge fields, representing those present on the document with Text Tags. - # @option opts [String] form_fields_per_document + # * :name (String) Signer's name + # * :email_address (String) Signer's email address + # * :order (Integer) The order the signers are required to sign in (optional) + # * :pin (Integer) The 4- to 12-character access code that will secure this signer's signature page. You must have a business plan to use this feature. (optional) + # @option opts [Array] custom_fields An array of custom merge fields, representing those present on the document with Text Tags or form_fields_per_document (optional) + # * :name (String) Custom field name or "Field Label" + # * :value (String) The value of the field. This data will appear on the SignatureRequest. + # * :editor (String) The signer name indicated on the Text Tag or form_fields_per_document that can edit the value of the field. (optional) + # * :required (Boolean) Determines if the field is required or not. (optional) + # @option opts [Array] cc_email_addresses The email addresses that should be CCed on the SignatureRequest. (optional) + # @option opts [Boolean] use_text_tags Indicates whether the SignatureRequest should have Text Tags enabled. Defaults to 0. (optional) + # @option opts [Boolean] hide_text_tags Indicates whether the Text Tags should be removed automatically. Note that this is not the preferred method. Defaults to 0. (optional) + # @option opts [Hash] metadata Key-value data attached to the SignatureRequest. (optional) + # @option opts [String] client_id The API App Client ID associated with the SignatureRequest. (optional) + # @option opts [Boolean] allow_decline Allows signers to decline the SignatureRequest. Defaults to 0. (optional) + # @option opts [Boolean] allow_reassign Allows signers to reassign the SignatureRequest to another signer. Defaults to 0. (optional) + # @option opts [Array] form_fields_per_document The fields that should appear on the document. (optional) # # @return [HelloSign::Resource::SignatureRequest] a SignatureRequest # @@ -114,7 +124,31 @@ def get_signature_requests(opts={}) # } # ], # :cc_email_addresses => ['lawyer@example.com', 'lawyer@example2.com'], - # :files => ['NDA.pdf', 'AppendixA.pdf'] + # :files => ['NDA.pdf', 'AppendixA.pdf'], + # :form_fields_per_document => [ + # [ + # { + # "name": "address", + # "type": "text", + # "x": 160, + # "y": 80, + # "width": 206, + # "height": 32, + # "signer": 0 + # } + # ], + # [ + # { + # "name": "phone", + # "type": "text", + # "x": 160, + # "y": 150, + # "width": 206, + # "height": 32, + # "signer": 1 + # } + # ] + # ] # ) # @@ -129,22 +163,30 @@ def send_signature_request(opts) # # Creates and sends a new SignatureRequest based off of the Template specified with the template_id parameter. - # @option opts [Integer] test_mode (0) Whether this is a test, the signature request will not be legally binding if set to 1. - # @option opts [String] template_id The id of the Template to use when creating the SignatureRequest. - # @option opts [String] title The title you want to assign to the SignatureRequest. - # @option opts [String] subject The subject in the email that will be sent to the signers. - # @option opts [String] message The custom message in the email that will be sent to the signers. - # @option opts [String] signing_redirect_url The URL you want the signer redirected to after they successfully sign. (optional) + # @option opts [Boolean] test_mode Indicates if this is a test SignatureRequest, it will not be legally binding if set to 1. A boolean value is also accepted. Defaults to 0. (optional) + # @option opts [String] template_id The Template ID to use when creating the SignatureRequest. + # * Use template_ids[%i%] if using multiple templates, replacing %i% with an integer to indicate the order of the Templates + # @option opts [String] title The title you want to assign to the SignatureRequest. (optional) + # @option opts [String] subject The subject in the email that will be sent to the signer(s). (optional) + # @option opts [String] message The custom message in the email that will be sent to the signer(s). (optional) + # @option opts [String] signing_redirect_url The URL you want the signer(s) redirected to after they successfully sign. (optional) # @option opts [Array] signers List of signers - # * :name (String) Sender' name - # * :email_address (String) Sender's email address - # * :order (Integer) The order the signer is required to sign in - # * :pin (Integer) The 4- to 12-character access code that will secure this signer's signature page. You must have a business plan to use this feature. - # @option opts [Array] ccs The email addresses CC destinations. Required when a CC role exists for the Template. - # @option opts [Hash] custom_fields (deprecated) The value to fill in for the custom field with the name of CustomFieldName. - # @option opts [Array] custom_fields An array of custom merge fields, representing those present in the template. Only specify this when NOT specifying custom_fields by hash (the old way). - # @option opts [Integer] ux_version sets the version of the signer page to use - # + # * :role (String) The signer role indicated on the Template. Note that the role name is case sensitive. + # * :name (String) Signer's name + # * :email_address (String) Signer's email address + # * :pin (Integer) The 4- to 12-character access code that will secure this signer's signature page. You must have a business plan to use this feature. (optional) + # @option opts [Array] ccs The individual(s) to be CC'd on the SignatureRequest. Required when a CC role exists for the Template. + # * :role (String) The CC role indicated on the Template. Note that the role name is case sensitive. + # * :email_address (String) CC Recipient's email address + # @option opts [Array] custom_fields An array of custom merge fields, representing those present in the Template. (optional) + # * :name (String) Custom field name or "Field Label" + # * :value (String) The value of the field. This data will appear on the SignatureRequest. + # * :editor (String) The signer name indicated on the Text Tag or form_fields_per_document that can edit the value of the field. (optional) + # * :required (Boolean) Determines if the field is required or not. (optional) + # @option opts [Hash] metadata Key-value data attached to the SignatureRequest. (optional) + # @option opts [String] client_id The API App Client ID associated with the SignatureRequest. (optional) + # @option opts [Array] files Use files to indicate the uploaded file(s) to append to the SignatureRequest. (optional) + # @option opts [Array] file_urls Use file_urls to have HelloSign download the file(s) to append to the SignatureRequest. (optional) # @return [HelloSign::Resource::SignatureRequest] a SignatureRequest # @example # signature_request = @client.send_signature_request_with_template( @@ -200,10 +242,11 @@ def send_signature_request(opts) # :role => "Accounting" # } # ], - # :custom_fields => - # { - # :CustomFieldName => '$20,000' - # } + # :custom_fields => [ + # { + # :CustomFieldName => '$20,000' + # } + # ] # ) # def send_signature_request_with_template(opts) @@ -218,9 +261,9 @@ def send_signature_request_with_template(opts) # # Sends an email to the signer reminding them to sign the signature request. - # @option opts [String] signature_request_id The id of the SignatureRequest to send a reminder for. - # @option opts [String] email_address The email address of the signer to send a reminder to. - # @option opts [Integer] ux_version sets the version of the signer page to use + # @option opts [String] signature_request_id Indicates the ID of the SignatureRequest to send a reminder. + # @option opts [String] email_address The email address of the signer who will receive a reminder. + # @option opts [String] name The name of the signer who will receive a reminder. (optional) # # @return [HelloSign::Resource::SignatureRequest] a SignatureRequest # @example @@ -232,7 +275,7 @@ def remind_signature_request(opts) # # Cancels a SignatureRequest. - # @option opts [String] signature_request_id The id of the SignatureRequest to cancel. + # @option opts [String] signature_request_id The ID of the incomplete SignatureRequest to cancel. # # @example # @client.cancel_signature_request :signature_request_id => '75cdf7dc8b323d43b347e4a3614d1f822bd09491' @@ -242,7 +285,7 @@ def cancel_signature_request(opts) # # Removes your access to a completed a SignatureRequest. - # @option opts [String] signature_request_id The id of the SignatureRequest to remove. + # @option opts [String] signature_request_id The ID of the completed SignatureRequest to remove access. # # @example # @client.remove_signature_request :signature_request_id => '75cdf7dc8b323d43b347e4a3614d1f822bd09491' @@ -251,12 +294,12 @@ def remove_signature_request(opts) end # - # Download the PDF copy of the current documents specified by the signature_request_id parameter. - # @option opts [String] file_type Either 'pdf' or 'zip' depending on the file type desired. Defaults to pdf. - # @option opts [String] get_url Boolean. If true, the response will contain a url link to the file instead. Links are only available for PDFs and have a TTL of 3 days.Either 'pdf' or 'zip' depending on the file type desired. Defaults to false. - # @option opts [String] signature_request_id The id of the SignatureRequest to retrieve. + # Download a copy of the SignatureRequest documents specified by the signature_request_id parameter. + # @option opts [String] signature_request_id The ID of the SignatureRequest to download. + # @option opts [String] file_type Determines the format of the file - either 'pdf' or 'zip' depending on the file type desired. Defaults to pdf. (optional) + # @option opts [Boolean] get_url Response contains a URL link to the file if set to true. Links are only available for PDFs and have a TTL of 3 days. Defaults to false. (optional) # - # @return a PDF + # @return a PDF or Zip # # @example # pdf = @client.signature_request_files :signature_request_id => '75cdf7dc8b323d43b347e4a3614d1f822bd09491' @@ -275,25 +318,34 @@ def signature_request_files(opts) # # Creates a new SignatureRequest with the submitted documents to be signed in an embedded iFrame. - # If form_fields_per_document is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. - # Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on HelloSign. - # @option opts [Integer] test_mode (0) Whether this is a test, the signature request will not be legally binding if set to 1. - # @option opts [String] client_id Client id of the app you're using to create this embedded signature request. Visit our {https://app.hellosign.com/api/reference#Embedded embedded page} page to learn more about this parameter. + # If form_fields_per_document is not specified or use_text_tags is not enabled, a signature page will be affixed at the end + # and all signers will be required to add their signature there. + # Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on HelloSign.com. + # See our Embedded Signing Walkthrough for more information on Embedded Signing: https://app.hellosign.com/api/embeddedSigningWalkthrough + # @option opts [Boolean] test_mode Indicates if this is a test SignatureRequest, it will not be legally binding if set to 1. A boolean value is also accepted. Defaults to 0. (optional) + # @option opts [String] client_id The API App Client ID associated with the this embedded SignatureRequest. # @option opts [Array] files Use files to indicate the uploaded file(s) to send for signature. Currently we only support use of either the files parameter or file_urls parameter, not both. # @option opts [Array] file_urls Use file_urls to have HelloSign download the file(s) to send for signature. Currently we only support use of either the files parameter or file_urls parameter, not both. - # @option opts [String] title The title you want to assign to the SignatureRequest. - # @option opts [String] subject The subject in the email that will be sent to the signers. - # @option opts [String] message The custom message in the email that will be sent to the signers. - # @option opts [String] signing_redirect_url The URL you want the signer redirected to after they successfully sign. (optional) + # @option opts [String] title The title you want to assign to the SignatureRequest. (optional) + # @option opts [String] subject The subject in the email that will be sent to the signer(s). (optional) + # @option opts [String] message The custom message in the email that will be sent to the signer(s). (optional) # @option opts [Array] signers List of signers, each item is a Hash with these keys: - # * :name (String) Sender' name - # * :email_address (String) Sender's email address - # * :order (Integer) The order the signer is required to sign in - # * :pin (Integer) The 4- to 12-character access code that will secure this signer's signature page. You must have a business plan to use this feature. - # @option opts [Array] cc_email_addresses The email addresses that should be CCed. - # @option opts [Array] custom_fields An array of custom merge fields, representing those present on the document with Text Tags. - # @option opts [String] form_fields_per_document - # @option opts [Integer] ux_version sets the version of the signer page to use + # * :name (String) Signer's name + # * :email_address (String) Signer's email address + # * :order (Integer) The order the signers are required to sign in (optional) + # * :pin (Integer) The 4- to 12-character access code that will secure this signer's signature page. You must have a business plan to use this feature. (optional) + # @option opts [Array] custom_fields An array of custom merge fields, representing those present on the document with Text Tags or form_fields_per_document (optional) + # * :name (String) Custom field name or "Field Label" + # * :value (String) The value of the field. This data will appear on the SignatureRequest + # * :editor (String) The signer name indicated on the Text Tag or form_fields_per_document that can edit the value of the field. (optional) + # * :required (Boolean) Determines if the field is required or not. (optional) + # @option opts [Array] cc_email_addresses The email addresses that should be CCed on the SignatureRequest. (optional) + # @option opts [Boolean] use_text_tags Indicates whether the SignatureRequest should have Text Tags enabled. Defaults to 0. (optional) + # @option opts [Boolean] hide_text_tags Indicates whether the Text Tags should be removed automatically. Note that this is not the preferred method. Defaults to 0. (optional) + # @option opts [Hash] metadata Key-value data attached to the SignatureRequest. (optional) + # @option opts [Boolean] allow_decline Allows signers to decline the SignatureRequest. Defaults to 0. (optional) + # @option opts [Boolean] allow_reassign Allows signers to reassign the SignatureRequest to another signer. Defaults to 0. (optional) + # @option opts [Array] form_fields_per_document The fields that should appear on the document. (optional) # # @return [HelloSign::Resource::SignatureRequest] a SignatureRequest # @example @@ -335,24 +387,29 @@ def create_embedded_signature_request(opts) # # Creates a new SignatureRequest based on the given Template to be signed in an embedded iFrame. # Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on HelloSign. - # @option opts [Integer] test_mode (0) Whether this is a test, the signature request will not be legally binding if set to 1. - # @option opts [String] client_id Client id of the app you're using to create this embedded signature request. Visit our {https://app.hellosign.com/api/reference#Embedded embedded page} page to learn more about this parameter. - # @option opts [String] template_id The id of the Template to use when creating the SignatureRequest. - # @option opts [String] title The title you want to assign to the SignatureRequest. - # @option opts [String] subject The subject in the email that will be sent to the signers. - # @option opts [String] message The custom message in the email that will be sent to the signers. - # @option opts [String] signing_redirect_url The URL you want the signer redirected to after they successfully sign. (optional) - # @option opts [Integer] hide_text_tags Whether or not your text tags hidden after parsing - # @option opts [Integer] use_text_tags Whether or not your document contains parseable text-tags - # @option opts [Array] signers List of signers, each item is a Hash with these keys: - # * :name (String) Sender' name - # * :email_address (String) Sender's email address - # * :order (Integer) The order the signer is required to sign in - # * :pin (Integer) The 4- to 12-character access code that will secure this signer's signature page. You must have a business plan to use this feature. - # @option opts [Hash] ccs The email address of the CC filling the role of RoleName. Required when a CC role exists for the Template. - # @option opts [Hash] custom_fields (deprecated) The value to fill in for custom field with the name of CustomFieldName. - # @option opts [Array] custom_fields An array of custom merge fields, representing those present in the template. Only specify this when NOT specifying custom_fields by hash (the old way) - # @option opts [Integer] ux_version sets the version of the signer page to use + # @option opts [Boolean] test_mode Indicates if this is a test SignatureRequest, it will not be legally binding if set to 1. A boolean value is also accepted. Defaults to 0. (optional) + # @option opts [String] client_id The API App Client ID associated with the this embedded SignatureRequest. + # @option opts [String] template_id The Template ID to use when creating the SignatureRequest. + # * Use template_ids[%i%] if using multiple templates, replacing %i% with an integer to indicate the order of the Templates + # @option opts [String] title The title you want to assign to the SignatureRequest. (optional) + # @option opts [String] subject The subject in the email that will be sent to the signer(s). (optional) + # @option opts [String] message The custom message in the email that will be sent to the signer(s). (optional) + # @option opts [Array] signers List of signers + # * :role (String) The signer role indicated on the Template. Note that the role name is case sensitive. + # * :name (String) Signer's name + # * :email_address (String) Signer's email address + # * :pin (Integer) The 4- to 12-character access code that will secure this signer's signature page. You must have a business plan to use this feature. (optional) + # @option opts [Array] ccs The individual(s) to be CC'd on the SignatureRequest. Required when a CC role exists for the Template. + # * :role (String) The CC role indicated on the Template. Note that the role name is case sensitive. + # * :email_address (String) CC Recipient's email address + # @option opts [Array] custom_fields An array of custom merge fields, representing those present in the Template. (optional) + # * :name (String) Custom field name or "Field Label" + # * :value (String) The value of the field. This data will appear on the SignatureRequest. + # * :editor (String) The signer name indicated on the Text Tag or form_fields_per_document that can edit the value of the field. (optional) + # * :required (Boolean) Determines if the field is required or not. (optional) + # @option opts [Hash] metadata Key-value data attached to the SignatureRequest. (optional) + # @option opts [Array] files Use files to indicate the uploaded file(s) to append to the SignatureRequest. (optional) + # @option opts [Array] file_urls Use file_urls to have HelloSign download the file(s) to append to the SignatureRequest. (optional) # # @return [HelloSign::Resource::SignatureRequest] a SignatureRequest # @example @@ -398,6 +455,19 @@ def create_embedded_signature_request_with_template(opts) HelloSign::Resource::SignatureRequest.new post('/signature_request/create_embedded_with_template', :body => opts) end + # + # Updates the email address on a SignatureRequest. + # @option opts [String] signature_request_id The ID of the SignatureRequest to update. + # @option opts [String] signature_id The Signature ID of the recipient to update. + # @option opts [String] email_address The new email address of the recipient. + # + # @example + # @client.update_signature_request( + # :signature_request_id => '75cdf7dc8b323d43b347e4a3614d1f822bd09491', + # :signature_id => '5064ca698bde9581ad75f6d62450eb4b', + # :email_address => 'newEmail@example.com' + # ) + def update_signature_request(opts) signature_request_id = opts.delete(:signature_request_id) path = "/signature_request/update/#{signature_request_id}" diff --git a/lib/hello_sign/api/team.rb b/lib/hello_sign/api/team.rb index 5e1702d..6b00285 100644 --- a/lib/hello_sign/api/team.rb +++ b/lib/hello_sign/api/team.rb @@ -1,8 +1,8 @@ # # The MIT License (MIT) -# +# # Copyright (C) 2014 hellosign.com -# +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights @@ -24,16 +24,14 @@ module HelloSign module Api - # - # Contains all the api calls for the Team resource. - # Take a look at our {https://app.hellosign.com/api/reference#Team team api document} + # Contains all the API calls for the Team resource. + # Take a look at our API Documentation on the Team Resource (https://app.hellosign.com/api/reference#Team) # for more information about this. # # @author [hellosign] # module Team - # # Returns information about your Team as well as a list of its members. # If you do not belong to a Team, HelloSign::Error::NotFound will be raised @@ -48,9 +46,9 @@ def get_team # # Creates a new Team and makes you a member. You must not currently belong to a Team to invoke. - # @option opts [String] name The name of your Team + # @option opts [String] name The name of the Team. # - # @return [HelloSign::Resource::Team] new created Team + # @return [HelloSign::Resource::Team] new created Team object # # @example # team = @client.create_team :name => 'Team America World Police' @@ -60,7 +58,7 @@ def create_team(opts) # # Updates the name of your Team. - # @option opts [String] name The name of your Team + # @option opts [String] name The name of your Team. # # @return [HelloSign::Resource::Team] a Team object # @@ -71,7 +69,7 @@ def update_team(opts) end # - # Deletes your Team. Can only be invoked when you have a Team with only one member (yourself). + # Deletes your Team. Can only be invoked with a Team with one member (yourself). # # @example # team = @client.destroy_team @@ -80,12 +78,13 @@ def destroy_team end # - # Adds or invites a user (specified using the email_address parameter) to your Team. + # Adds or invites a user (specified using the email_address parameter) to the Team. # If the user does not currently have a HelloSign Account, a new one will be created for them. - # If the user currently has a paid subscription, they will not automatically join the Team but instead will be sent an invitation to join. - # If a user is already a part of another Team, a "team_invite_failed" error will be returned. - # @option opts [String] account_id The id of the Account of the user to invite to your Team. The account id prevails if both email_address and acccount_id are provided. - # @option opts [String] email_address The email address of the Account of the user to invite to your Team. The account id prevails if both email_address and acccount_id are provided. + # If the user currently has a paid subscription, they will be emailed an invitation to join the Team. + # If a user is already a part of a Team, a "team_invite_failed" error will be returned. + # @option opts [String] account_id The user's Account ID to invite to the Team. + # @option opts [String] email_address The user's email address to invite to your Team. + # Note: The account_id prevails if both email_address and acccount_id are provided. # # @return [HelloSign::Resource::Team] updated Team object # @@ -95,11 +94,12 @@ def add_member_to_team(opts) HelloSign::Resource::Team.new post('/team/add_member', :body => opts) end - # - # Removes a user from your Team. If the user had an outstanding invitation to your Team the invitation will be expired. - # @option opts [String] account_id The id of the Account of the user to invite to your Team. The account id prevails if both email_address and acccount_id are provided. - # @option opts [String] email_address The email address of the Account of the user to invite to your Team. The account id prevails if both email_address and acccount_id are provided. + # Removes a user from the Team. If the user had an outstanding invitation to your Team, the original invitation will expire. + # @option opts [String] account_id The user's Account ID to remove from the Team. + # @option opts [String] email_address The user's email address to remove from your Team. + # @option opts [String] new_owner_email_address The Account's email address to receive all documents, API Apps (if applicable), and API key from removed account. (optional) + # Note: The account_id prevails if both email_address and acccount_id are provided. # # @return [HelloSign::Resource::Team] updated Team object # @example diff --git a/lib/hello_sign/api/template.rb b/lib/hello_sign/api/template.rb index b3ccef7..bf15fe6 100644 --- a/lib/hello_sign/api/template.rb +++ b/lib/hello_sign/api/template.rb @@ -26,8 +26,8 @@ module HelloSign module Api # - # Contains all the api calls for the Template resource. - # Take a look at our {https://app.hellosign.com/api/embeddedTemplatesWalkthrough template form api document} + # Contains all the API calls for the Template resource. + # Take a look at our API Documentation for Templates (https://app.hellosign.com/api/reference#Template) # for more information about this. # # @author [hellosign] @@ -36,7 +36,7 @@ module Template # # Retrieves the Template specified by the id parameter. - # @option opts [String] template_id The id of the Template to retrieve. + # @option opts [String] template_id The Template ID to retrieve. # # @return [HelloSign::Resource::Template] a Template object # @@ -48,20 +48,23 @@ def get_template(opts) end # - # Deletes the Template specified by the id parameter. - # @option opts [String] template_id The id of the Template to delete. - ## + # Deletes the specified Template. + # @option opts [String] template_id The Template ID to delete. + # # @example - # template = @client.get_template :template_id => 'f57db65d3f933b5316d398057a36176831451a35' + # template = @client.delete_template :template_id => 'f57db65d3f933b5316d398057a36176831451a35' # def delete_template(opts) post("/template/delete/#{opts[:template_id]}") end # - # Retrieves the Templates for the current user account. + # Retrieves the Templates for the accessible by the current user. # - # @option opts [Integer] page (1) Which page number of the Template List to return. + # @option opts [String] acount_id The Account ID to return Templates for and must be a team member. Use "all" for all team members. Defaults to current account. (optional) + # @option opts [Integer] page Sets the page number of the list to return. Defaults to 1. (optional) + # @option opts [Integer] page_size Determines the number of Templates returned per page. Defaults to 20. (optional) + # @option opts [String] query Search terms and/or fields to filter the Templates. (optional) # # @return [HelloSign::Resource::ResourceArray] a ResourceArray object # @example @@ -75,11 +78,12 @@ def get_templates(opts={}) end # - # Gives the specified Account on your team access to a Template + # Gives the specified Account access to a Template. The Account must be part of your Team. # - # @option opts [String] template_id The id of the Template to give access to. - # @option opts [String] account_id The id of the Account to get access. The account_id prevails if account_id and email_address are both provided. - # @option opts [String] email_address The email address of the Account to give access to the Template. The account_id prevails if account_id and email_address are both provided. + # @option opts [String] template_id The Template ID to give access to. + # @option opts [String] account_id The Account ID to receive access to the Template. + # @option opts [String] email_address The email address of the Account to receive access to the Template. + # Note: The account_id prevails if both email_address and acccount_id are provided. # # @return [Template] a Template object # @example @@ -92,11 +96,12 @@ def add_user_to_template(opts) end # - # Removes the specified Account's access to the specified Template. - # The user can be designated using their account ID or email address. - # @option opts [String] template_id The id of the Template to remove the Account access to. - # @option opts [String] account_id The id of the Account to remove access to the Template. The account_id prevails if account_id and email_address are both provided. - # @option opts [String] email_address The email address of the Account to remove access to the Template. The account_id prevails if account_id and email_address are both provided. + # Removes the specified Account access to the specified Template. + # + # @option opts [String] template_id The Template ID to remove access to. + # @option opts [String] account_id The Account ID to remove access to the Template. + # @option opts [String] email_address The email address of the Account to remove access to the Template. + # Note: The account_id prevails if both email_address and acccount_id are provided. # # @return [Template] a Template object # @example @@ -109,21 +114,25 @@ def remove_user_from_template(opts) end # - # Creates a new embedded template draft object that can be launched in an iframe using the claim URL. - # @option opts [Integer] test_mode (0) Whether this is a test, the signature request will not be legally binding if set to 1. - # @option opts [Array] files Use files to indicate the uploaded file(s) to send for signature. Currently we only support use of either the files parameter or file_urls parameter, not both. - # @option opts [Array] file_urls Use file_urls to have HelloSign download the file(s) to send for signature. Currently we only support use of either the files parameter or file_urls parameter, not both. - # @option opts [String] title The default template email subject. - # @option opts [String] subject The subject in the email that will be sent to the signers. - # @option opts [String] requester_email_address The email address of the requester. - # @option opts [String] message The custom message in the email that will be sent to the signers. - # @option opts [Array] signers List of signer_roles, each item is a Hash with these keys: - # * :name (String) signer's role name - # * :order (Integer) The order the signer is required to sign in (optional) - # @option opts [Array] cc_roles The email addresses CC roles. Will mean the CC role will be Required when sending the template. - # @option opts [Array] merge_fields List of fields that can be pre-populated by your application when using the resulting template to send a signature request - # * :name (String) merge field name - # * :type (String) + # Creates a new embedded template draft object that can be launched in an iFrame using the claim_url. + # @option opts [Boolean] test_mode Indicates if this is a test Template draft. SignatureRequests using this Template will not be legally binding if set to 1. Defaults to 0. (optional) + # @option opts [String] client_id The API App Client ID associated with the Template draft. (optional) + # @option opts [Array] files Specified file path(s) to upload file(s) to send for signature. Currently we only support use of either the files parameter or file_urls parameter, not both. + # @option opts [Array] file_urls URL(s) for HelloSign to download the file(s) to send for signature. Currently we only support use of either the files parameter or file_urls parameter, not both. + # @option opts [String] title The default Template title. (optional) + # @option opts [String] subject The default Template title alias. (optional) + # @option opts [String] message The default message in the email that will be sent to the signer(s). (optional) + # @option opts [Array] signers List of signers displayed when the Template is used to create a SignatureRequest + # * :name (String) Signer role name + # * :order (Integer) The order the signer role is required to sign in. (optional) + # @option opts [Array] cc_roles The CC roles that must be assigned when using the Template to create a SignatureRequest. (optional) + # @option opts [String] merge_fields List of fields that can be pre-populated by your application when using the Template to send a SignatureRequest. (optional) + # * :name (String) Merge field name + # * :type (String) Field type - either "text" or "checkbox" + # @option opts [Boolean] skip_me_now Sets the "Me (Now)" option for the Template preparer. Defaults to 0. (optional) + # @option opts [Boolean] use_preexisting_fields Sets the detection of predefined PDF fields. Defaults to 0. (optional) + # @option opts [Hash] metadata Key-value data attached to the Template and all SignatureRequests created from the Template. (optional) + # @option opts [Boolean] allow_reassign Sets the ability for signers to reassign the SignatureRequest to other signers. Defaults to 0. (optional) # # @example create_embedded_draft # template_draft = @client.create_embedded_template_draft( @@ -158,6 +167,17 @@ def create_embedded_template_draft(opts) HelloSign::Resource::TemplateDraft.new post("/template/create_embedded_draft", :body => opts) end + # + # Downloads the original files of a specified Template. + # + # @option opts [String] template_id The Template ID to retrieve. + # @option opts [String] file_type Determines the format of the file - either 'pdf' or 'zip' depending on the file type desired. Defaults to pdf. (optional) + # @option opts [Boolean] get_url Response contains a URL link to the file if set to true. Links are only available for PDFs and have a TTL of 3 days. Defaults to false. (optional) + # + # @return a PDF or Zip + # @example + # templates = @client.get_template_files :template_id => 'f57db65d3f933b5316d398057a36176831451a35', :file_type => 'zip' + # def get_template_files(opts) path = "/template/files/#{opts[:template_id]}" if opts[:file_type] @@ -171,6 +191,21 @@ def get_template_files(opts) get(path) end + # + # Overlays a new file with the overlay of the specified Template. + # + # @option opts [String] template_id The Template ID to update. + # @option opts [Array] files Specified file path(s) to upload file(s) to send for signature. Currently we only support use of either the files parameter or file_urls parameter, not both. + # @option opts [Array] file_urls URL(s) for HelloSign to download the file(s) to send for signature. Currently we only support use of either the files parameter or file_urls parameter, not both. + # @option opts [String] subject The updated default Template title alias. (optional) + # @option opts [String] message The updated default message in the email that will be sent to the signer(s). (optional) + # @option opts [String] client_id The API App Client ID associated with the Template draft. (optional) + # @option opts [Boolean] test_mode Indicates if this is a test Template draft. SignatureRequests using this Template will not be legally binding if set to 1. Defaults to 0. (optional) + # + # @return a Template ID + # @example + # templates = @client.update_template_files :template_id => 'f57db65d3f933b5316d398057a36176831451a35', :file => '@NDA.pdf' + # def update_template_files(opts) template_id = opts.delete(:template_id) path = "/template/update_files/#{template_id}" diff --git a/lib/hello_sign/api/unclaimed_draft.rb b/lib/hello_sign/api/unclaimed_draft.rb index 372a527..aeae572 100644 --- a/lib/hello_sign/api/unclaimed_draft.rb +++ b/lib/hello_sign/api/unclaimed_draft.rb @@ -25,47 +25,52 @@ module HelloSign module Api - # - # Contains all the api calls for the UnclaimedDraft resource. - # Take a look at our {https://app.hellosign.com/api/reference#UnclaimedDraft unclaimed draft document} - # for more information about this. - # - # @author [hellosign] - # - module UnclaimedDraft - # - # Creates a new Draft that can be claimed using the claim URL. - # The first authenticated user to access the URL will claim the Draft and will be shown either the "Sign and send" or the "Request signature" page with the Draft loaded. - # Subsequent access to the claim URL will result in a 404 not found. - # If the type is "send_document" then only the file parameter is required. - # If the type is "request_signature", then the identities of the signers and optionally - # the location of signing elements on the page are also required. - # @option opts [Integer] test_mode (0) Whether this is a test, the signature request will not be legally binding if set to 1. - # @option opts [Array] files Use files to indicate the uploaded file(s) to send for signature. Currently we only support use of either the files parameter or file_urls parameter, not both. - # @option opts [Array] file_urls Use file_urls to have HelloSign download the file(s) to send for signature. Currently we only support use of either the files parameter or file_urls parameter, not both. - # @option opts [String] type The type of unclaimed draft to create. Use "send_document" to create a claimable file, and "request_signature" for a claimable signature request. If the type is "request_signature" then signers name and email_address are not optional. - # @option opts [String] subject The subject in the email that will be sent to the signers. - # @option opts [String] message The custom message in the email that will be sent to the signers. - # @option opts [String] signing_redirect_url The URL you want the signer redirected to after they successfully sign. (optional) + # Contains all the API calls for the UnclaimedDraft resource. + # Take a look at our API documentation for creating UnclaimedDrafts (https://app.hellosign.com/api/reference#UnclaimedDraft) + # for more information about this. + # + # @author [hellosign] + # + module UnclaimedDraft + # - # @option opts [Array] signers List of signers, each item is a Hash with these keys: - # * :name (String) Sender' name - # * :email_address (String) Sender's email address - # * :order (Integer) The order the signer is required to sign in (optional) - # * :pin (Integer) The 4-digit code that will secure this signer's signature page. You must have a business plan to use this feature. (optional) - # @option opts [Array] cc_email_addresses The email addresses that should be CCed. - # @option opts [Array] custom_fields An array of custom merge fields, representing those present on the document with Text Tags. - # @option opts [String] form_fields_per_document + # Creates a new UnclaimedDraft that can be claimed using the claim_url. + # The first authenticated user to access the claim_url claims the Draft and will be shown either the "Sign and send" or the "Request signature" page with the Draft loaded. + # Subsequent access to the claim_url will result in a 404 not found error. + # @option opts [Boolean] test_mode Indicates if this is a test SignatureRequest, it will not be legally binding if set to 1. A boolean value is also accepted. Defaults to 0. (optional) + # @option opts [Array] files Specified file path(s) to upload file(s) to send for signature. Currently we only support use of either the files parameter or file_urls parameter, not both. + # @option opts [Array] file_urls URL(s) for HelloSign to download the file(s) to send for signature. Currently we only support use of either the files parameter or file_urls parameter, not both. + # @option opts [String] type The type of UnclaimedDraft to create. Use "send_document" to create a claimable file, and "request_signature" for a claimable signature request. + # * For "send_document," only the file parameter is required. + # * For "request_signature," then signer name and email_address are required. + # @option opts [String] subject The subject in the email that will be sent to the signer(s). (optional) + # @option opts [String] message The custom message in the email that will be sent to the signer(s). (optional) + # @option opts [Array] signers List of signers, each item is a Hash with these keys: (optional) + # * :name (String) Signer's name + # * :email_address (String) Signer's email address + # * :order (Integer) The order the signers are required to sign in (optional) + # @option opts [Array] custom_fields An array of custom merge fields, representing those present on the document with Text Tags or form_fields_per_document (optional) + # * :name (String) Custom field name or "Field Label" + # * :value (String) The value of the field. This data will appear on the SignatureRequest. + # @option opts [Array] cc_email_addresses The email addresses that should be CCed. (optional) + # @option opts [String] signing_redirect_url The URL you want the signer(s) redirected to after they successfully sign. (optional) + # @option opts [Boolean] use_text_tags Indicates whether the SignatureRequest should have Text Tags enabled. Defaults to 0. (optional) + # @option opts [Boolean] hide_text_tags Indicates whether the Text Tags should be removed automatically. Note that this is not the preferred method. Defaults to 0. (optional) + # @option opts [Boolean] use_preexisting_fields Sets the detection of predefined PDF fields. Defaults to 0. (optional) + # @option opts [Hash] metadata Key-value data attached to the SignatureRequest. (optional) + # @option opts [Boolean] allow_decline Allows signers to decline the SignatureRequest. Defaults to 0. (optional) + # @option opts [Boolean] allow_reassign Allows signers to reassign the SignatureRequest to another signer. Defaults to 0. (optional) + # @option opts [Array] form_fields_per_document The fields that should appear on the document. (optional) # - # @return [HelloSign::Resource::UnclaimedDraft] a UnclaimedDraft object + # @return [HelloSign::Resource::UnclaimedDraft] an UnclaimedDraft object # - # @example send_document + # @example type: send_document # unclaimed_draft = @client.create_unclaimed_draft( # :test_mode => 1, # :files => ['NDA.pdf', 'AppendixA.pdf'] # ) - # @example request_signature + # @example type: request_signature # unclaimed_draft = @client.create_unclaimed_draft( # :test_mode => 1, # :type => 'request_signature', @@ -102,26 +107,37 @@ def create_unclaimed_draft opts end # - # Creates a new embedded unclaimed draft object that can be launched in an iframe using the claim URL. - # @option opts [Integer] test_mode (0) Whether this is a test, the signature request will not be legally binding if set to 1. - # @option opts [Integer] is_for_embedded_signing set this to 1 to to mix embedded requesting and embedded signing. - # @option opts [Array] files Use files to indicate the uploaded file(s) to send for signature. Currently we only support use of either the files parameter or file_urls parameter, not both. - # @option opts [Array] file_urls Use file_urls to have HelloSign download the file(s) to send for signature. Currently we only support use of either the files parameter or file_urls parameter, not both. - # @option opts [String] type The type of unclaimed draft to create. Should be "request_signature" for a claimable signature request. If the type is "request_signature" then signers name and email_address are not optional. - # @option opts [String] subject The subject in the email that will be sent to the signers. - # @option opts [String] requester_email_address The email address of the requester. - # @option opts [String] message The custom message in the email that will be sent to the signers. + # Creates a new Embedded UnclaimedDraft object that can be launched in an iFrame using the claim_url. + # @option opts [Boolean] test_mode Indicates if this is a test SignatureRequest, it will not be legally binding if set to 1. A boolean value is also accepted. Defaults to 0. (optional) + # @option opts [String] client_id The API App Client ID associated with the UnclaimedDraft. + # @option opts [Array] files Specified file path(s) to upload file(s) to send for signature. Currently we only support use of either the files parameter or file_urls parameter, not both. + # @option opts [Array] file_urls URL(s) for HelloSign to download the file(s) to send for signature. Currently we only support use of either the files parameter or file_urls parameter, not both. + # @option opts [String] requester_email_address The email address of the requester, if "request_signature" type. + # @option opts [String] type The type of UnclaimedDraft to create. Use "send_document" to create a claimable file, and "request_signature" for a claimable signature request. + # * For "send_document," only the file parameter is required. + # * For "request_signature," then signer name and email_address are required. + # @option opts [String] subject The subject in the email that will be sent to the signer(s). (optional) + # @option opts [String] message The custom message in the email that will be sent to the signer(s). (optional) + # @option opts [Array] signers List of signers, each item is a Hash with these keys: (optional) + # * :name (String) Signer's name + # * :email_address (String) Signer's email address + # * :order (Integer) The order the signers are required to sign in (optional) + # @option opts [Array] cc_email_addresses The email addresses that should be CCed. (optional) # @option opts [String] signing_redirect_url The URL you want the signer redirected to after they successfully sign. (optional) + # @option opts [Array] custom_fields An array of custom merge fields, representing those present on the document with Text Tags or form_fields_per_document (optional) + # * :name (String) Custom field name or "Field Label" + # * :value (String) The value of the field. This data will appear on the SignatureRequest. + # @option opts [Boolean] use_text_tags Indicates whether the SignatureRequest should have Text Tags enabled. Defaults to 0. (optional) + # @option opts [Boolean] hide_text_tags Indicates whether the Text Tags should be removed automatically. Note that this is not the preferred method. Defaults to 0. (optional) + # @option opts [Boolean] use_preexisting_fields Sets the detection of predefined PDF fields. Defaults to 0. (optional) + # @option opts [Boolean] is_for_embedded_signing Enable the UnclaimedDraft to be used for an Embedded SignatureRequest. Defaults to 0. (optional) + # @option opts [Boolean] skip_me_now Disables the "Me (Now)" option for the preparer. Not available for type "send_document." Defaults to 0. (optional) + # @option opts [Hash] metadata Key-value data attached to the SignatureRequest. (optional) + # @option opts [Boolean] allow_decline Allows signers to decline the SignatureRequest. Defaults to 0. (optional) + # @option opts [Boolean] allow_reassign Allows signers to reassign the SignatureRequest to another signer. Defaults to 0. (optional) + # @option opts [Array] form_fields_per_document The fields that should appear on the document. (optional) # - # @option opts [Array] signers List of signers, each item is a Hash with these keys: - # * :name (String) Sender' name - # * :email_address (String) Sender's email address - # * :order (Integer) The order the signer is required to sign in (optional) - # * :pin (Integer) The 4-digit code that will secure this signer's signature page. You must have a business plan to use this feature. (optional) - # @option opts [Array] cc_email_addresses The email addresses that should be CCed. - # @option opts [Array] custom_fields An array of custom merge fields, representing those present on the document with Text Tags. - # - # @return [HelloSign::Resource::UnclaimedDraft] a UnclaimedDraft object + # @return [HelloSign::Resource::UnclaimedDraft] an UnclaimedDraft object # # @example request_signature # unclaimed_draft = @client.create_embedded_unclaimed_draft( @@ -152,7 +168,7 @@ def create_embedded_unclaimed_draft(opts) opts[:client_id] ||= self.client_id prepare_files opts prepare_custom_fields opts - + if opts[:type] == 'request_signature' || opts[:type] == 'send_document' prepare_signers opts end @@ -160,23 +176,36 @@ def create_embedded_unclaimed_draft(opts) HelloSign::Resource::UnclaimedDraft.new post('/unclaimed_draft/create_embedded', :body => opts) end - # - # Creates a new embedded unclaimed draft object from a template that can be launched in an iframe using the claim URL. - # @option opts [Integer] test_mode (0) Whether this is a test, the signature request will not be legally binding if set to 1. - # @option opts [String] subject The subject in the email that will be sent to the signers. - # @option opts [String] requester_email_address The email address of the requester. - # @option opts [String] message The custom message in the email that will be sent to the signers. + # Creates a new Embedded UnclaimedDraft object from a Template that can be launched in an iFrame using the claim_url. + # @option opts [Boolean] test_mode Indicates if this is a test SignatureRequest, it will not be legally binding if set to 1. A boolean value is also accepted. Defaults to 0. (optional) + # @option opts [String] client_id The API App Client ID associated with the UnclaimedDraft. + # @option opts [String] template_id The Template ID to use when creating the UnclaimedDraft. + # * Use template_ids[%i%] if using multiple templates, replacing %i% with an integer to indicate the order of the Templates + # @option opts [String] requester_email_address The email address of the requester, if "request_signature" type. + # @option opts [String] title The title you want to assign to the SignatureRequest. (optional) + # @option opts [String] subject The subject in the email that will be sent to the signer(s). (optional) + # @option opts [String] message The custom message in the email that will be sent to the signer(s). (optional) + # @option opts [Array] signers List of signers + # * :role (String) The signer role indicated on the Template. Note that the role name is case sensitive. + # * :name (String) Signer's name + # * :email_address (String) Signer's email address + # @option opts [Array] ccs The individual(s) to be CC'd on the SignatureRequest. Required when a CC role exists for the Template. + # * :role (String) The CC role indicated on the Template. Note that the role name is case sensitive. + # * :email_address (String) CC Recipient's email address # @option opts [String] signing_redirect_url The URL you want the signer redirected to after they successfully sign. (optional) + # @option opts [String] requesting_redirect_url The URL you want the requester redirected to after they successfully request a SignatureRequest. (optional) + # @option opts [Hash] metadata Key-value data attached to the SignatureRequest. (optional) + # @option opts [Array] custom_fields An array of custom merge fields, representing those present in the Template. (optional) + # * :name (String) Custom field name or "Field Label" + # * :value (String) The value of the field. This data will appear on the SignatureRequest. + # @option opts [Array] files Use files to indicate the uploaded file(s) to append to the SignatureRequest. (optional) + # @option opts [Array] file_urls Use file_urls to have HelloSign download the file(s) to append to the SignatureRequest. (optional) + # @option opts [Boolean] skip_me_now Disables the "Me (Now)" option for the preparer. Not available for type "send_document." Defaults to 0. (optional) + # @option opts [Boolean] allow_decline Allows signers to decline the SignatureRequest. Defaults to 0. (optional) + # @option opts [Boolean] allow_reassign Allows signers to reassign the SignatureRequest to another signer. Defaults to 0. (optional) # - # @option opts [Array] signers List of signers, each item is a Hash with these keys: - # * :name (String) Sender' name - # * :email_address (String) Sender's email address - # * :order (Integer) The order the signer is required to sign in (optional) - # * :pin (Integer) The 4-digit code that will secure this signer's signature page. You must have a business plan to use this feature. (optional) - # @option opts [Array] cc_email_addresses The email addresses that should be CCed. - # - # @return [HelloSign::Resource::UnclaimedDraft] a UnclaimedDraft object + # @return [HelloSign::Resource::UnclaimedDraft] an UnclaimedDraft object # # @example request_signature # unclaimed_draft = @client.create_embedded_unclaimed_draft_with_template( @@ -218,6 +247,25 @@ def create_embedded_unclaimed_draft_with_template(opts) HelloSign::Resource::UnclaimedDraft.new post('/unclaimed_draft/create_embedded_with_template', :body => opts) end + # + # Creates a new SignatureRequest from an Embedded UnclaimedDraft. This UnclaimedDraft can be + # edited using the claim_url. + # @option opts [String] signature_request_id The SignatureRequest ID to edit and resend. + # @option opts [String] client_id The API App Client ID associated with the UnclaimedDraft. + # @option opts [Boolean] test_mode Indicates if this is a test SignatureRequest, it will not be legally binding if set to 1. A boolean value is also accepted. Defaults to 0. (optional) + # @option opts [String] requesting_redirect_url The URL you want the requester redirected to after they successfully request a SignatureRequest. (optional) + # @option opts [String] signing_redirect_url The URL you want the signer redirected to after they successfully sign. (optional) + # @option opts [Boolean] is_for_embedded_signing Enable the UnclaimedDraft to be used for an Embedded SignatureRequest. Defaults to 0. (optional) + # + # @return [HelloSign::Resource::UnclaimedDraft] an UnclaimedDraft object + # + # @example + # unclaimed_draft = @client.edit_and_resend_unclaimed_draft( + # :signature_request_id => '75cdf7dc8b323d43b347e4a3614d1f822bd09491', + # :test_mode => 1, + # :client_id => 'b6b8e7deaf8f0b95c029dca049356d4a2cf9710a', + # ) + # def edit_and_resend_unclaimed_draft(opts) signature_request_id = opts.delete(:signature_request_id) path = "/unclaimed_draft/edit_and_resend/#{signature_request_id}" diff --git a/lib/hello_sign/client.rb b/lib/hello_sign/client.rb index e799d62..b54fa4e 100644 --- a/lib/hello_sign/client.rb +++ b/lib/hello_sign/client.rb @@ -32,7 +32,6 @@ require 'logger' module HelloSign - # # You'll need the HelloSign::Client to do just about everything, from creating # signatures to updating account information. @@ -69,11 +68,11 @@ class Client } # - # Creates a new HelloSign Client + # Initiates a new HelloSign Client - # @option opts [String] email_address email address - # @option opts [String] password password - # @option opts [String] api_key Api key + # @option opts [String] email_address The account's email address. (optional) + # @option opts [String] password The account's password, if authenticating with an email_address. (optional) + # @option opts [String] api_key The account's API key. # @return [HelloSign::Client] a new HelloSign::Client def initialize(opts={}) options = HelloSign.options.merge(opts) @@ -83,9 +82,9 @@ def initialize(opts={}) end # - # Make a http get request - # @param path [String] relative path of the request - # @option options [Hash] params params of the url + # Makes an HTTP GET request + # @param path [String] Relative path of the request. + # @option options [Hash] params Params of the URL. # def get(path, options={}) response = request(path, :get, options) @@ -95,10 +94,10 @@ def get(path, options={}) end # - # Make a http post request - # @param path [String] relative path of the request - # @option options [Hash] params params of the url - # @option options [Hash] body request body + # Makes an HTTP POST request + # @param path [String] Relative path of the request. + # @option options [Hash] params Params of the URL. + # @option options [Hash] body Body of the request. # def post(path, options={}) response = request(path, :post, options) @@ -108,10 +107,10 @@ def post(path, options={}) end # - # Make a http put request - # @param path [String] relative path of the request - # @option options [Hash] params params of the url - # @option options [Hash] body request body + # Makes an HTTP PUT request + # @param path [String] Relative path of the request. + # @option options [Hash] params Params of the URL. + # @option options [Hash] body Body of the request. # def put(path, options={}) response = request(path, :put, options) @@ -121,9 +120,9 @@ def put(path, options={}) end # - # Make a http delete request - # @param path [String] relative path of the request - # @option options [Hash] params params of the url + # Make an HTTP DELETE request + # @param path [String] Relative path of the request. + # @option options [Hash] Params of the URL. # def delete(path, options={}) response = request(path, :delete, options) @@ -160,6 +159,7 @@ def make_connection options faraday.adapter :net_http faraday.options[:timeout] = timeout if timeout end + if options[:no_auth] elsif auth_token connection.authorization :Bearer, auth_token @@ -183,9 +183,6 @@ def validate(response) if response.status >= 400 error_class = ERRORS[response.status] || HelloSign::Error::UnknownError error = error_class.new(response.status, response.body, response.to_hash[:url].to_s) - # error.response_status = response.status - # error.response_body = response.body - # error.request_uri = response.to_hash[:url].to_s raise error end end @@ -204,7 +201,7 @@ def parse(response) def MIMEfromName(name) parts = name.split('.') - #default to pdf if no extension + # defaults to pdf if no extension provided if parts.length < 2 return 'application/pdf' end @@ -299,21 +296,21 @@ def prepare_form_fields(opts) if (opts[:form_fields_per_document] and opts[:form_fields_per_document].is_a? Array) opts[:form_fields_per_document] = MultiJson.dump(opts[:form_fields_per_document]) end - #ignore if it's already a string, or not present + # ignore if it's already a string, or not present end def prepare_custom_fields(opts) if (opts[:custom_fields] and opts[:custom_fields].is_a? Array) opts[:custom_fields] = MultiJson.dump(opts[:custom_fields]) end - #ignore if it's already a string, or not present + # ignore if it's already a string, or not present end def prepare_merge_fields(opts) if (opts[:merge_fields] and opts[:merge_fields].is_a? Array) opts[:merge_fields] = MultiJson.dump(opts[:merge_fields]) end - #ignore if it's already a string, or not present + # ignore if it's already a string, or not present end def prepare(opts, key) diff --git a/lib/hello_sign/configuration.rb b/lib/hello_sign/configuration.rb index c093ca2..ed96585 100644 --- a/lib/hello_sign/configuration.rb +++ b/lib/hello_sign/configuration.rb @@ -23,7 +23,6 @@ # module HelloSign - # # Define config attributes and default values for HelloSign module # diff --git a/lib/hello_sign/resource/account.rb b/lib/hello_sign/resource/account.rb index 87f7f7a..a0a22e3 100644 --- a/lib/hello_sign/resource/account.rb +++ b/lib/hello_sign/resource/account.rb @@ -1,8 +1,8 @@ # # The MIT License (MIT) -# +# # Copyright (C) 2014 hellosign.com -# +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights @@ -24,22 +24,20 @@ module HelloSign module Resource - # - # Contains information about an account and its settings. - # Take a look at our {https://app.hellosign.com/api/reference#Account account resource document} + # Contains information about an Account and its settings. + # Take a look at our API Documentation on the Account resource (https://app.hellosign.com/api/reference#Account) # for more information about this. # # @author [hellosign] # class Account < BaseResource - # - # Create a new Account from a hash. If key defined then account data with be the value of hash[key], otherwise the hash itself - # @param hash [Hash] account's data - # @param key [String] (account) key of the hash, point to where account data is. If nil then the hash itself + # Creates a new Account from a hash. If key defined then account data with be the value of hash[key], otherwise the hash itself. + # @param hash [Hash] Account's data + # @param key [String] (account) key of the hash, point to where Account data is. If nil, then the hash itself. # - # @return [HelloSign::Resource:Account] a Account resource + # @return [HelloSign::Resource:Account] an Account resource def initialize(hash, key='account') super end diff --git a/lib/hello_sign/resource/api_app.rb b/lib/hello_sign/resource/api_app.rb index 596200c..cb55766 100644 --- a/lib/hello_sign/resource/api_app.rb +++ b/lib/hello_sign/resource/api_app.rb @@ -24,20 +24,18 @@ module HelloSign module Resource - # - # Contains information about an team and its members. - # Take a look at our {https://app.hellosign.com/api/reference#ApiApp API Application resource document} + # Contains information about the ApiApp resource. + # Take a look at our API Documentation for ApiApps (https://app.hellosign.com/api/reference#ApiApp) # for more information about this. # # @author [hellosign] # class ApiApp < BaseResource - # - # create a new ApiApp from a hash. If a key is defined then team data with be the value of hash[key], otherwise the hash itself - # @param hash [Hash] API Application data - # @param key [String] (api_app) key of the hash, point to where API application data is. If nil then the hash itself + # Creates a new ApiApp from a hash. If a key is defined then ApiApp data with be the value of hash[key], otherwise the hash itself. + # @param hash [Hash] ApiApp data + # @param key [String] (api_app) key of the hash, point to where ApiApp data is. If nil, then the hash itself. # # @return [HelloSign::Resource:ApiApp] an ApiApp resource def initialize(hash, key='api_app') diff --git a/lib/hello_sign/resource/base_resource.rb b/lib/hello_sign/resource/base_resource.rb index e44c320..2a9aa73 100644 --- a/lib/hello_sign/resource/base_resource.rb +++ b/lib/hello_sign/resource/base_resource.rb @@ -24,21 +24,19 @@ module HelloSign module Resource - # - # Store the value of a hash. Use missing_method to create method to access it like an object + # Stores the value of a hash. Use missing_method to create method to access it like an object # # @author [hellosign] # class BaseResource attr_reader :data, :raw_data, :warnings, :headers - # # recursively convert hash data into BaseResource. # - # @param hash [Hash] data of the resource - # @param key [String] (nil) key of the hash, point to where resource data is. If nil then the hash itself + # @param hash [Hash] Data of the resource + # @param key [String] (nil) Key of the hash, point to where resource data is. If nil, then the hash itself. # # @return [HelloSign::Resource::BaseResource] a new BaseResource def initialize(hash, key=nil) @@ -47,7 +45,7 @@ def initialize(hash, key=nil) if hash[:body] @warnings = hash[:body]['warnings'] ? hash[:body]['warnings'] : nil end - + @data = @raw_data.inject({}) do |data, (key, value)| data[key.to_s] = if value.is_a? Hash value = BaseResource.new(value) @@ -62,17 +60,15 @@ def initialize(hash, key=nil) # # Magic method, give class dynamic methods based on hash keys. - # # If initialized hash has a key which matches the method name, return value of that key. - # - # Otherwise, return nil + # Otherwise, return nil. # # @param method [Symbol] Method's name # # @example - # resource = BaseResource.new :email_address => "me@example.com" - # resource.email_address # => "me@example.com" - # resource.not_in_hash_keys # => nil + # resource = BaseResource.new :email_address => "me@example.com" + # resource.email_address => "me@example.com" + # resource.not_in_hash_keys => nil def method_missing(method) @data.key?(method.to_s) ? @data[method.to_s] : nil end diff --git a/lib/hello_sign/resource/embedded.rb b/lib/hello_sign/resource/embedded.rb index 065fff1..b1c23ee 100644 --- a/lib/hello_sign/resource/embedded.rb +++ b/lib/hello_sign/resource/embedded.rb @@ -1,8 +1,8 @@ # # The MIT License (MIT) -# +# # Copyright (C) 2014 hellosign.com -# +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights @@ -24,22 +24,20 @@ module HelloSign module Resource - # - # An object that contains necessary information to set up embedded signing. - # Take a look at our {https://app.hellosign.com/api/reference#Embedded account resource document} + # An object that contains necessary information to set up Embedded signing. + # Take a look at our Embedded Signing Walkthrough (https://app.hellosign.com/api/embeddedSigningWalkthrough) # for more information about this. # # @author [hellosign] # class Embedded < BaseResource - # - # create a new Embedded resource from a hash. If a key is defined then embedded data with be the value of hash[key], otherwise the hash itself - # @param hash [Hash] embedded's data - # @param key [String] (embedded) key of the hash, point to where embedded data is. If nil then the hash itself + # create a new Embedded resource from a hash. If a key is defined then embedded data with be the value of hash[key], otherwise the hash itself. + # @param hash [Hash] Embedded's data + # @param key [String] (embedded) Key of the hash, point to where Embedded data is. If nil, then the hash itself. # - # @return [HelloSign::Resource:Embedded] a Embedded resource + # @return [HelloSign::Resource:Embedded] an Embedded resource def initialize(hash, key='embedded') super end diff --git a/lib/hello_sign/resource/resource_array.rb b/lib/hello_sign/resource/resource_array.rb index 573ea12..320540e 100644 --- a/lib/hello_sign/resource/resource_array.rb +++ b/lib/hello_sign/resource/resource_array.rb @@ -24,7 +24,6 @@ module HelloSign module Resource - # # Stores an array of HelloSign BaseResource with paging information # @@ -32,13 +31,12 @@ module Resource # class ResourceArray < Array attr_reader :page, :num_pages, :num_results, :page_size, :warnings, :headers, :list_info - # # create a new ResourceArray from a hash # - # @param hash [Hash] data of the array - # @param key [String] key of the hash, point to where resource array data is - # @param resource_class [Class] a Resource Class object inherited from BaseResource. Use the created array item from hash[key] + # @param hash [Hash] Data of the array. + # @param key [String] Key of the hash, point to where resource array data is. + # @param resource_class [Class] a ResourceClass object inherited from BaseResource. Uses the created array item from hash[key]. # # @return [type] [description] def initialize(hash, key, resource_class) diff --git a/lib/hello_sign/resource/signature_request.rb b/lib/hello_sign/resource/signature_request.rb index 8d724aa..c6234fc 100644 --- a/lib/hello_sign/resource/signature_request.rb +++ b/lib/hello_sign/resource/signature_request.rb @@ -1,8 +1,8 @@ # # The MIT License (MIT) -# +# # Copyright (C) 2014 hellosign.com -# +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights @@ -24,21 +24,18 @@ module HelloSign module Resource - # - # Contains information regarding documents that need to be signed - # Take a look at our {https://app.hellosign.com/api/reference#SignatureRequest signature request resource document} + # Contains information regarding documents that need to be signed. + # Take a look at our API Documentation for sending Signature Requests (https://app.hellosign.com/api/reference#SignatureRequest) # for more information about this. # # @author [hellosign] # class SignatureRequest < BaseResource - - # - # create a new SignatureRequest from a hash. If a key is defined then account data with be the value of hash[key], otherwise the hash itself - # @param hash [Hash] signature request's data - # @param key [String] (signature_request) key of the hash, point to where signature request data is. If nil then the hash itself # + # create a new SignatureRequest from a hash. If a key is defined then account data with be the value of hash[key], otherwise the hash itself. + # @param hash [Hash] SignatureRequest's data + # @param key [String] (signature_request) Key of the hash, point to where SignatureRequest data is. If nil, then the hash itself. # # @return [HelloSign::Resource::SignatureRequest] a SignatureRequest resource def initialize(hash, key='signature_request') diff --git a/lib/hello_sign/resource/team.rb b/lib/hello_sign/resource/team.rb index 11f1428..12ad79d 100644 --- a/lib/hello_sign/resource/team.rb +++ b/lib/hello_sign/resource/team.rb @@ -1,8 +1,8 @@ # # The MIT License (MIT) -# +# # Copyright (C) 2014 hellosign.com -# +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights @@ -24,20 +24,18 @@ module HelloSign module Resource - # - # Contains information about an team and its members. - # Take a look at our {https://app.hellosign.com/api/reference#Team team resource document} + # Contains information about a Team and its members. + # Take a look at our API Documentation on the Team Resource (https://app.hellosign.com/api/reference#Team) # for more information about this. # # @author [hellosign] # class Team < BaseResource - # - # create a new Team from a hash. If a key is defined then team data with be the value of hash[key], otherwise the hash itself - # @param hash [Hash] team's data - # @param key [String] (team) key of the hash, point to where team data is. If nil then the hash itself + # Creates a new Team from a hash. If a key is defined then team data with be the value of hash[key], otherwise the hash itself. + # @param hash [Hash] Team's data + # @param key [String] (team) Key of the hash, point to where Team data is. If nil, then the hash itself. # # @return [HelloSign::Resource:Team] a Team resource def initialize(hash, key='team') diff --git a/lib/hello_sign/resource/template.rb b/lib/hello_sign/resource/template.rb index 08c6a2c..157d69b 100644 --- a/lib/hello_sign/resource/template.rb +++ b/lib/hello_sign/resource/template.rb @@ -1,8 +1,8 @@ # # The MIT License (MIT) -# +# # Copyright (C) 2014 hellosign.com -# +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights @@ -24,22 +24,20 @@ module HelloSign module Resource - # # Contains information about the templates you and your team have created - # Take a look at our {https://app.hellosign.com/api/reference#Template Template resource document} + # Take a look at our API Documentation for Templates (https://app.hellosign.com/api/reference#Template) # for more information about this. # # @author [hellosign] # class Template < BaseResource - # - # create a new Template from a hash. If a key is defined then template data will be the value of hash[key], otherwise the hash itself - # @param hash [Hash] template's data - # @param key [String] (template) key of the hash, point to where template data is. If nil then the hash itself + # Creates a new Template from a hash. If a key is defined then template data will be the value of hash[key], otherwise the hash itself. + # @param hash [Hash] Template's data + # @param key [String] (template) Key of the hash, point to where Template data is. If nil, then the hash itself. # - # @return [HelloSign::Resource:Team] a Team resource + # @return [HelloSign::Resource:Team] a Template resource def initialize(hash, key='template') super end diff --git a/lib/hello_sign/resource/template_draft.rb b/lib/hello_sign/resource/template_draft.rb index 6c10f99..7370905 100644 --- a/lib/hello_sign/resource/template_draft.rb +++ b/lib/hello_sign/resource/template_draft.rb @@ -1,8 +1,8 @@ # # The MIT License (MIT) -# +# # Copyright (C) 2014 hellosign.com -# +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights @@ -24,20 +24,18 @@ module HelloSign module Resource - # - # A group of documents that a user can take ownership of by going to the claim URL - # Take a look at our {https://app.hellosign.com/api/reference} + # A group of documents that a user can take ownership of by going to the claim_url. + # Take a look at our API Documentation for Templates (https://app.hellosign.com/api/reference#Template) # for more information about this. # # @author [hellosign] # class TemplateDraft < BaseResource - # - # create a new TemplateDraft from a hash. If a key is defined then template draft data will be the value of hash[key], otherwise the hash itself - # @param hash [Hash] template draft's data - # @param key [String] (template_draft) key of the hash, point to where template draft data is. If nil then the hash itself + # Creates a new TemplateDraft from a hash. If a key is defined then TemplateDraft data will be the value of hash[key], otherwise the hash itself. + # @param hash [Hash] TemplateDraft's data + # @param key [String] (template_draft) Key of the hash, point to where TemplateDraft data is. If nil, then the hash itself. # # @return [HelloSign::Resource:Team] a Team resource def initialize(hash, key='template') diff --git a/lib/hello_sign/resource/unclaimed_draft.rb b/lib/hello_sign/resource/unclaimed_draft.rb index 23c812e..1e8050d 100644 --- a/lib/hello_sign/resource/unclaimed_draft.rb +++ b/lib/hello_sign/resource/unclaimed_draft.rb @@ -1,8 +1,8 @@ # # The MIT License (MIT) -# +# # Copyright (C) 2014 hellosign.com -# +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights @@ -26,8 +26,8 @@ module HelloSign module Resource # - # A group of documents that a user can take ownership of by going to the claim URL - # Take a look at our {https://app.hellosign.com/api/reference#UnclaimedDraft unclaimed draft resource document} + # A group of documents that a user can take ownership of by going to the claim_url. + # Take a look at our API documentation for creating UnclaimedDrafts (https://app.hellosign.com/api/reference#UnclaimedDraft) # for more information about this. # # @author [hellosign] @@ -35,11 +35,11 @@ module Resource class UnclaimedDraft < BaseResource # - # create a new UnclaimedDraft from a hash. If a key is defined then unclaimed draft data with be the value of hash[key], otherwise the hash itself - # @param hash [Hash] unclaimed draft's data - # @param key [String] (unclaimed_draft) key of the hash, point to where unclaimed draft data is. If nil then the hash itself + # create a new UnclaimedDraft from a hash. If a key is defined then UnclaimedDraft data with be the value of hash[key], otherwise the hash itself. + # @param hash [Hash] UnclaimedDraft's data + # @param key [String] (unclaimed_draft) Key of the hash, point to where UnclaimedDraft data is. If nil, then the hash itself. # - # @return [HelloSign::Resource:Team] a Team resource + # @return [HelloSign::Resource:Team] an UnclaimedDraft resource def initialize(hash, key='unclaimed_draft') super end diff --git a/lib/hello_sign/version.rb b/lib/hello_sign/version.rb index f71422b..09e708a 100644 --- a/lib/hello_sign/version.rb +++ b/lib/hello_sign/version.rb @@ -23,5 +23,5 @@ # module HelloSign - VERSION = '3.7.0' + VERSION = '3.7.1' end