Class: Echochamber::Widget

Inherits:
Hash
  • Object
show all
Includes:
Validatable
Defined in:
lib/echochamber/widget.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Validatable

#require_exactly_one, #require_keys, #validate_field

Constructor Details

#initialize(user_id = nil, user_email = nil, params) ⇒ Widget

Widget initialization object

Parameters:

  • user_id (String) (defaults to: nil)

    The ID of the user on whose behalf widget is being created.

  • user_email (String) (defaults to: nil)

    The email address of the user on whose behalf widget is being created. If both X-User-Id and X-User-Email are provided then X-User-Id is given preference. If neither is specified then the user is inferred from the access token.

  • params (Hash)

    SYMBOL-referenced Hash containing: (REQUIRED)

  • param (Hash)

    a customizable set of options

Options Hash (params):

  • :name (String)

    The name of the widget that will be used to identify it, in emails and on the website (REQUIRED)

  • :fileInfos (Array)

    Populate with instances of Echochamber::Fileinfo. A list of one or more files (or references to files) that will be used to create the widget. If more than one file is provided, they will be combined before the widget is created. Library documents are not permitted. Note: Only one of the four parameters in every Fileinfo object must be specified (REQUIRED)

  • :formFieldLayerTemplates (Array)

    Populate with instances of Echochamber::Fileinfo. Specifies the form field layer template or source of form fields to apply on the files in this transaction. If specified, the FileInfo for this parameter must refer to a form field layer template via libraryDocumentId or libraryDocumentName, or if specified via transientDocumentId or documentURL, it must be of a supported file type. Note: Only one of the four parameters in every FileInfo object must be specified.

  • :widgetCompletionInfo (Echochamber::WidgetCompletionInfo)

    URL and associated properties for the success page the user will be taken to after filling out the widget

  • :callbackInfo (String)

    A publicly accessible url to which EchoSign will perform an HTTP PUT operation with the final signed PDF file. HTTP authentication is supported using standard embedded syntax - i.e. username:[email protected]/path/to/file. EchoSign can also communicate with your system using HTTP GET, every time there is a new agreement event. Please contact [email protected] if you wish to use this option.

  • :securityOptions (Echochamber::WidgetSecurityOption)

    Sets optional secondary security parameters for your widget

  • :locale (String)

    The locale associated with this widget - specifies the language for the signing page and emails, for example en_US or fr_FR. If none specified, defaults to the language configured for the widget creator

  • :counterSigners (Echochamber::CounterSignerInfo)

    A list of one or more counter signers

  • :vaultingInfo (Echochamber::WidgetVaultingInfo)

    Sets the vaulting properties that allows EchoSign to securely store documents with a vault provider

  • :mergeFieldInfo (Echochamber::WidgetMergefieldInfo)

    Optional default values for fields to merge into the document. The values will be presented to the signers for editable fields; for read-only fields the provided values will not be editable during the signing process. Merging data into fields is currently not supported when used with libraryDocumentId or libraryDocumentName. Only file and url are curently supported

  • :widgetAuthFailureInfo (Echochamber::WidgetCompletionInfo)

    URL and associated properties for the error page the user will be taken after failing to authenticate

  • :widgetSignerSecurityOptions (Echochamber::WidgetSignerSecurityOption)

    Security options that apply to widget signers



33
34
35
36
37
38
39
# File 'lib/echochamber/widget.rb', line 33

def initialize(user_id=nil, user_email=nil, params)
  require_keys([:name, :fileInfos, :signatureFlow], params)
  @user_id = user_id
  @user_email = user_email
  
  merge!({ widgetCreationInfo: params })
end

Instance Attribute Details

#user_emailObject (readonly)

Returns the value of attribute user_email.



13
14
15
# File 'lib/echochamber/widget.rb', line 13

def user_email
  @user_email
end

#user_idObject (readonly)

Returns the value of attribute user_id.



13
14
15
# File 'lib/echochamber/widget.rb', line 13

def user_id
  @user_id
end