=begin
#Docusign eSignature REST API

#The Docusign eSignature REST API provides you with a powerful, convenient, and simple Web services API for interacting with Docusign.

OpenAPI spec version: v2.1
Contact: devcenter@docusign.com
Generated by: https://github.com/swagger-api/swagger-codegen.git

=end

require "uri"

module DocuSign_eSign

  class CreateRecipientsOptions
    # 
    attr_accessor :resend_envelope

    def self.default
      @@default ||= CreateRecipientsOptions.new
    end
  end

  class GetOptions
    # 
    attr_accessor :include

    def self.default
      @@default ||= GetOptions.new
    end
  end

  class GetDocumentOptions
    # 
    attr_accessor :encrypt

    # 
    attr_accessor :file_type

    # 
    attr_accessor :show_changes

    def self.default
      @@default ||= GetDocumentOptions.new
    end
  end

  class GetDocumentPageImageOptions
    # 
    attr_accessor :dpi

    # 
    attr_accessor :max_height

    # 
    attr_accessor :max_width

    # 
    attr_accessor :show_changes

    def self.default
      @@default ||= GetDocumentPageImageOptions.new
    end
  end

  class GetDocumentTabsOptions
    # 
    attr_accessor :page_numbers

    def self.default
      @@default ||= GetDocumentTabsOptions.new
    end
  end

  class GetPagesOptions
    # 
    attr_accessor :count

    # 
    attr_accessor :dpi

    # 
    attr_accessor :max_height

    # 
    attr_accessor :max_width

    # 
    attr_accessor :nocache

    # 
    attr_accessor :show_changes

    # 
    attr_accessor :start_position

    def self.default
      @@default ||= GetPagesOptions.new
    end
  end

  class ListDocumentsOptions
    # 
    attr_accessor :include_agreement_type

    # 
    attr_accessor :include_tabs

    def self.default
      @@default ||= ListDocumentsOptions.new
    end
  end

  class ListRecipientsOptions
    #  When set to **true** and `include_tabs` is set to **true**, all tabs with anchor tab properties are included in the response. 
    attr_accessor :include_anchor_tab_locations

    #  When set to **true**, the extended properties are included in the response. 
    attr_accessor :include_extended

    # When set to **true**, the tab information associated with the recipient is included in the response.
    attr_accessor :include_tabs

    def self.default
      @@default ||= ListRecipientsOptions.new
    end
  end

  class ListTabsOptions
    # When set to **true**, all tabs with anchor tab properties are included in the response. 
    attr_accessor :include_anchor_tab_locations

    # 
    attr_accessor :include_metadata

    def self.default
      @@default ||= ListTabsOptions.new
    end
  end

  class ListTemplatesOptions
    # Number of records to return in the cache.
    attr_accessor :count

    # 
    attr_accessor :created_from_date

    # 
    attr_accessor :created_to_date

    # A comma separated list of folder ID GUIDs.
    attr_accessor :folder_ids

    # 
    attr_accessor :folder_types

    # Start of the search date range. Only returns templates created on or after this date/time. If no value is specified, there is no limit on the earliest date created.
    attr_accessor :from_date

    # A comma separated list of additional template attributes to include in the response. Valid values are: recipients, folders, documents, custom_fields, and notifications.
    attr_accessor :include

    # 
    attr_accessor :is_deleted_template_only

    # 
    attr_accessor :is_download

    # 
    attr_accessor :modified_from_date

    # 
    attr_accessor :modified_to_date

    # Sets the direction order used to sort the list. Valid values are: -asc = ascending sort order (a to z)  -desc = descending sort order (z to a)
    attr_accessor :order

    # Sets the file attribute used to sort the list. Valid values are:  -name: template name  -modified: date/time template was last modified.  -used: date/time the template was last used.
    attr_accessor :order_by

    # 
    attr_accessor :search_fields

    # The search text used to search the names of templates.
    attr_accessor :search_text

    # If true, the response only includes templates shared by the user. If false, the response only returns template not shared by the user. If not specified, the response is not affected.
    attr_accessor :shared_by_me

    # The starting index for the first template shown in the response. This must be greater than or equal to 0 (zero).
    attr_accessor :start_position

    # 
    attr_accessor :template_ids

    # End of the search date range. Only returns templates created up to this date/time. If no value is provided, this defaults to the current date.
    attr_accessor :to_date

    # Start of the search date range. Only returns templates used or edited on or after this date/time. If no value is specified, there is no limit on the earliest date used.
    attr_accessor :used_from_date

    # End of the search date range. Only returns templates used or edited up to this date/time. If no value is provided, this defaults to the current date.
    attr_accessor :used_to_date

    # Sets if the templates shown in the response Valid values are:  -owned_by_me: only shows templates the user owns.  -shared_with_me: only shows templates that are shared with the user.  -all: shows all templates owned or shared with the user.
    attr_accessor :user_filter

    # 
    attr_accessor :user_id

    def self.default
      @@default ||= ListTemplatesOptions.new
    end
  end

  class UpdateDocumentOptions
    # 
    attr_accessor :is_envelope_definition

    def self.default
      @@default ||= UpdateDocumentOptions.new
    end
  end

  class UpdateRecipientsOptions
    # 
    attr_accessor :resend_envelope

    def self.default
      @@default ||= UpdateRecipientsOptions.new
    end
  end


  class TemplatesApi
    attr_accessor :api_client

    def initialize(api_client = TemplatesApi.default)
      @api_client = api_client
    end

    # Creates custom document fields in an existing template document.
    # Creates custom document fields in an existing template document.
    # @param account_id The external account number (int) or account ID Guid.
    # @param template_id The ID of the template being accessed.
    # @param template_custom_fields  (optional parameter)
    # @return [CustomFields]
    def create_custom_fields(account_id, template_id, template_custom_fields)
      data, _status_code, _headers = create_custom_fields_with_http_info(account_id, template_id,  template_custom_fields)
      return data
    end

    # Creates custom document fields in an existing template document.
    # Creates custom document fields in an existing template document.
    # @param account_id The external account number (int) or account ID Guid.
    # @param template_id The ID of the template being accessed.
    # @param template_custom_fields  (optional parameter)
    # @return [Array<(CustomFields, Fixnum, Hash)>] CustomFields data, response status code and response headers
    def create_custom_fields_with_http_info(account_id, template_id, template_custom_fields)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: TemplatesApi.create_custom_fields ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling TemplatesApi.create_custom_fields" if account_id.nil?
      # verify the required parameter 'template_id' is set
      fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplatesApi.create_custom_fields" if template_id.nil?
      # resource path
      local_var_path = "/v2.1/accounts/{accountId}/templates/{templateId}/custom_fields".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'templateId' + '}', template_id.to_s)

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = @api_client.object_to_http_body(template_custom_fields)
      auth_names = []
      data, status_code, headers = @api_client.call_api(:POST, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'CustomFields')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TemplatesApi#create_custom_fields\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Creates custom document fields in an existing template document.
    # Creates custom document fields in an existing template document.
    # @param account_id The external account number (int) or account ID Guid.
    # @param document_id The ID of the document being accessed.
    # @param template_id The ID of the template being accessed.
    # @param document_fields_information  (optional parameter)
    # @return [DocumentFieldsInformation]
    def create_document_fields(account_id, document_id, template_id, document_fields_information)
      data, _status_code, _headers = create_document_fields_with_http_info(account_id, document_id, template_id,  document_fields_information)
      return data
    end

    # Creates custom document fields in an existing template document.
    # Creates custom document fields in an existing template document.
    # @param account_id The external account number (int) or account ID Guid.
    # @param document_id The ID of the document being accessed.
    # @param template_id The ID of the template being accessed.
    # @param document_fields_information  (optional parameter)
    # @return [Array<(DocumentFieldsInformation, Fixnum, Hash)>] DocumentFieldsInformation data, response status code and response headers
    def create_document_fields_with_http_info(account_id, document_id, template_id, document_fields_information)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: TemplatesApi.create_document_fields ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling TemplatesApi.create_document_fields" if account_id.nil?
      # verify the required parameter 'document_id' is set
      fail ArgumentError, "Missing the required parameter 'document_id' when calling TemplatesApi.create_document_fields" if document_id.nil?
      # verify the required parameter 'template_id' is set
      fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplatesApi.create_document_fields" if template_id.nil?
      # resource path
      local_var_path = "/v2.1/accounts/{accountId}/templates/{templateId}/documents/{documentId}/fields".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'documentId' + '}', document_id.to_s).sub('{' + 'templateId' + '}', template_id.to_s)

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = @api_client.object_to_http_body(document_fields_information)
      auth_names = []
      data, status_code, headers = @api_client.call_api(:POST, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'DocumentFieldsInformation')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TemplatesApi#create_document_fields\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Provides a URL to start an edit view of the Template UI
    # This method returns a URL for starting an edit view of a template that uses the DocuSign Template UI.
    # @param account_id The external account number (int) or account ID Guid.
    # @param template_id The ID of the template being accessed.
    # @param template_view_request  (optional parameter)
    # @return [ViewUrl]
    def create_edit_view(account_id, template_id, template_view_request)
      data, _status_code, _headers = create_edit_view_with_http_info(account_id, template_id,  template_view_request)
      return data
    end

    # Provides a URL to start an edit view of the Template UI
    # This method returns a URL for starting an edit view of a template that uses the DocuSign Template UI.
    # @param account_id The external account number (int) or account ID Guid.
    # @param template_id The ID of the template being accessed.
    # @param template_view_request  (optional parameter)
    # @return [Array<(ViewUrl, Fixnum, Hash)>] ViewUrl data, response status code and response headers
    def create_edit_view_with_http_info(account_id, template_id, template_view_request)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: TemplatesApi.create_edit_view ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling TemplatesApi.create_edit_view" if account_id.nil?
      # verify the required parameter 'template_id' is set
      fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplatesApi.create_edit_view" if template_id.nil?
      # resource path
      local_var_path = "/v2.1/accounts/{accountId}/templates/{templateId}/views/edit".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'templateId' + '}', template_id.to_s)

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = @api_client.object_to_http_body(template_view_request)
      auth_names = []
      data, status_code, headers = @api_client.call_api(:POST, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'ViewUrl')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TemplatesApi#create_edit_view\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Lock a template.
    # Locks the specified template, and sets the time until the lock expires, to prevent other users or recipients from accessing and changing the template.  ###### Note: Users must have envelope locking capability enabled to use this function (the userSetting property `canLockEnvelopes` must be set to **true** for the user).
    # @param account_id The external account number (int) or account ID Guid.
    # @param template_id The ID of the template being accessed.
    # @param lock_request  (optional parameter)
    # @return [LockInformation]
    def create_lock(account_id, template_id, lock_request)
      data, _status_code, _headers = create_lock_with_http_info(account_id, template_id,  lock_request)
      return data
    end

    # Lock a template.
    # Locks the specified template, and sets the time until the lock expires, to prevent other users or recipients from accessing and changing the template.  ###### Note: Users must have envelope locking capability enabled to use this function (the userSetting property &#x60;canLockEnvelopes&#x60; must be set to **true** for the user).
    # @param account_id The external account number (int) or account ID Guid.
    # @param template_id The ID of the template being accessed.
    # @param lock_request  (optional parameter)
    # @return [Array<(LockInformation, Fixnum, Hash)>] LockInformation data, response status code and response headers
    def create_lock_with_http_info(account_id, template_id, lock_request)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: TemplatesApi.create_lock ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling TemplatesApi.create_lock" if account_id.nil?
      # verify the required parameter 'template_id' is set
      fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplatesApi.create_lock" if template_id.nil?
      # resource path
      local_var_path = "/v2.1/accounts/{accountId}/templates/{templateId}/lock".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'templateId' + '}', template_id.to_s)

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = @api_client.object_to_http_body(lock_request)
      auth_names = []
      data, status_code, headers = @api_client.call_api(:POST, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'LockInformation')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TemplatesApi#create_lock\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Adds tabs for a recipient.
    # Adds one or more recipients to a template.
    # @param account_id The external account number (int) or account ID Guid.
    # @param template_id The ID of the template being accessed.
    # @param template_recipients  (optional parameter)
    # @param DocuSign_eSign::CreateRecipientsOptions Options for modifying the behavior of the function.
    # @return [Recipients]
    def create_recipients(account_id, template_id, template_recipients, options = DocuSign_eSign::CreateRecipientsOptions.default)
      data, _status_code, _headers = create_recipients_with_http_info(account_id, template_id,  template_recipients, options)
      return data
    end

    # Adds tabs for a recipient.
    # Adds one or more recipients to a template.
    # @param account_id The external account number (int) or account ID Guid.
    # @param template_id The ID of the template being accessed.
    # @param template_recipients  (optional parameter)
    # @param DocuSign_eSign::CreateRecipientsOptions Options for modifying the behavior of the function.
    # @return [Array<(Recipients, Fixnum, Hash)>] Recipients data, response status code and response headers
    def create_recipients_with_http_info(account_id, template_id, template_recipients, options = DocuSign_eSign::CreateRecipientsOptions.default)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: TemplatesApi.create_recipients ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling TemplatesApi.create_recipients" if account_id.nil?
      # verify the required parameter 'template_id' is set
      fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplatesApi.create_recipients" if template_id.nil?
      # resource path
      local_var_path = "/v2.1/accounts/{accountId}/templates/{templateId}/recipients".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'templateId' + '}', template_id.to_s)

      # query parameters
      query_params = {}
      query_params[:'resend_envelope'] = options.resend_envelope if !options.resend_envelope.nil?

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = @api_client.object_to_http_body(template_recipients)
      auth_names = []
      data, status_code, headers = @api_client.call_api(:POST, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'Recipients')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TemplatesApi#create_recipients\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Adds tabs for a recipient.
    # Adds one or more tabs for a recipient.
    # @param account_id The external account number (int) or account ID Guid.
    # @param recipient_id The ID of the recipient being accessed.
    # @param template_id The ID of the template being accessed.
    # @param template_tabs  (optional parameter)
    # @return [Tabs]
    def create_tabs(account_id, recipient_id, template_id, template_tabs)
      data, _status_code, _headers = create_tabs_with_http_info(account_id, recipient_id, template_id,  template_tabs)
      return data
    end

    # Adds tabs for a recipient.
    # Adds one or more tabs for a recipient.
    # @param account_id The external account number (int) or account ID Guid.
    # @param recipient_id The ID of the recipient being accessed.
    # @param template_id The ID of the template being accessed.
    # @param template_tabs  (optional parameter)
    # @return [Array<(Tabs, Fixnum, Hash)>] Tabs data, response status code and response headers
    def create_tabs_with_http_info(account_id, recipient_id, template_id, template_tabs)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: TemplatesApi.create_tabs ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling TemplatesApi.create_tabs" if account_id.nil?
      # verify the required parameter 'recipient_id' is set
      fail ArgumentError, "Missing the required parameter 'recipient_id' when calling TemplatesApi.create_tabs" if recipient_id.nil?
      # verify the required parameter 'template_id' is set
      fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplatesApi.create_tabs" if template_id.nil?
      # resource path
      local_var_path = "/v2.1/accounts/{accountId}/templates/{templateId}/recipients/{recipientId}/tabs".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'recipientId' + '}', recipient_id.to_s).sub('{' + 'templateId' + '}', template_id.to_s)

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = @api_client.object_to_http_body(template_tabs)
      auth_names = []
      data, status_code, headers = @api_client.call_api(:POST, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'Tabs')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TemplatesApi#create_tabs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Creates an envelope from a template.
    # Creates a template definition using a multipart request.  ###Template Email Subject Merge Fields  Call this endpoint to insert a recipient name and email address merge fields into the email subject line when creating or sending from a template.  The merge fields, based on the recipient's role name, are added to the `emailSubject` property when the template is created or when the template is used to create an envelope. After a template sender adds the name and email information for the recipient and sends the envelope, the recipient information is automatically merged into the appropriate fields in the email subject line.  Both the sender and the recipients will see the information in the email subject line for any emails associated with the template. This provides an easy way for senders to organize their envelope emails without having to open an envelope to check the recipient. ###### Note: If merging the recipient information into the subject line causes the subject line to exceed 100 characters, then any characters over the 100 character limit are not included in the subject line. For cases where the recipient name or email is expected to be long, you should consider placing the merge field at the start of the email subject.  To add a recipient's name in the subject line add the following text in the `emailSubject` property when creating the template or when sending an envelope from a template:  [[<roleName>_UserName]]  Example:  `\"emailSubject\":\"[[Signer 1_UserName]], Please sign this NDA\",`  To add a recipient's email address in the subject line add the following text in the `emailSubject` property when creating the template or when sending an envelope from a template:  [[<roleName>_Email]]  Example:  `\"emailSubject\":\"[[Signer 1_Email]], Please sign this NDA\",`   In both cases the <roleName> is the recipient's contents of the `roleName` property in the template.  For cases where another recipient (such as an Agent, Editor, or Intermediary recipient) is entering the name and email information for the recipient included in the email subject, then [[<roleName>_UserName]] or [[<roleName>_Email]] is shown in the email subject.
    # @param account_id The external account number (int) or account ID Guid.
    # @param envelope_template  (optional parameter)
    # @return [TemplateSummary]
    def create_template(account_id, envelope_template)
      data, _status_code, _headers = create_template_with_http_info(account_id,  envelope_template)
      return data
    end

    # Creates an envelope from a template.
    # Creates a template definition using a multipart request.  ###Template Email Subject Merge Fields  Call this endpoint to insert a recipient name and email address merge fields into the email subject line when creating or sending from a template.  The merge fields, based on the recipient&#39;s role name, are added to the &#x60;emailSubject&#x60; property when the template is created or when the template is used to create an envelope. After a template sender adds the name and email information for the recipient and sends the envelope, the recipient information is automatically merged into the appropriate fields in the email subject line.  Both the sender and the recipients will see the information in the email subject line for any emails associated with the template. This provides an easy way for senders to organize their envelope emails without having to open an envelope to check the recipient. ###### Note: If merging the recipient information into the subject line causes the subject line to exceed 100 characters, then any characters over the 100 character limit are not included in the subject line. For cases where the recipient name or email is expected to be long, you should consider placing the merge field at the start of the email subject.  To add a recipient&#39;s name in the subject line add the following text in the &#x60;emailSubject&#x60; property when creating the template or when sending an envelope from a template:  [[&lt;roleName&gt;_UserName]]  Example:  &#x60;\&quot;emailSubject\&quot;:\&quot;[[Signer 1_UserName]], Please sign this NDA\&quot;,&#x60;  To add a recipient&#39;s email address in the subject line add the following text in the &#x60;emailSubject&#x60; property when creating the template or when sending an envelope from a template:  [[&lt;roleName&gt;_Email]]  Example:  &#x60;\&quot;emailSubject\&quot;:\&quot;[[Signer 1_Email]], Please sign this NDA\&quot;,&#x60;   In both cases the &lt;roleName&gt; is the recipient&#39;s contents of the &#x60;roleName&#x60; property in the template.  For cases where another recipient (such as an Agent, Editor, or Intermediary recipient) is entering the name and email information for the recipient included in the email subject, then [[&lt;roleName&gt;_UserName]] or [[&lt;roleName&gt;_Email]] is shown in the email subject.
    # @param account_id The external account number (int) or account ID Guid.
    # @param envelope_template  (optional parameter)
    # @return [Array<(TemplateSummary, Fixnum, Hash)>] TemplateSummary data, response status code and response headers
    def create_template_with_http_info(account_id, envelope_template)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: TemplatesApi.create_template ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling TemplatesApi.create_template" if account_id.nil?
      # resource path
      local_var_path = "/v2.1/accounts/{accountId}/templates".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s)

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = @api_client.object_to_http_body(envelope_template)
      auth_names = []
      data, status_code, headers = @api_client.call_api(:POST, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'TemplateSummary')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TemplatesApi#create_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Post Responsive HTML Preview for a document in a template.
    # Creates a preview of the [responsive](/docs/esign-rest-api/esign101/concepts/responsive/), HTML version of a specific template document. This method enables you to preview a PDF document conversion to responsive HTML across device types prior to sending.  The request body is a `documentHtmlDefinition` object, which holds the responsive signing parameters that define how to generate the HTML version of the signing document.
    # @param account_id The external account number (int) or account ID Guid.
    # @param document_id The ID of the document being accessed.
    # @param template_id The ID of the template being accessed.
    # @param document_html_definition  (optional parameter)
    # @return [DocumentHtmlDefinitions]
    def create_template_document_responsive_html_preview(account_id, document_id, template_id, document_html_definition)
      data, _status_code, _headers = create_template_document_responsive_html_preview_with_http_info(account_id, document_id, template_id,  document_html_definition)
      return data
    end

    # Post Responsive HTML Preview for a document in a template.
    # Creates a preview of the [responsive](/docs/esign-rest-api/esign101/concepts/responsive/), HTML version of a specific template document. This method enables you to preview a PDF document conversion to responsive HTML across device types prior to sending.  The request body is a &#x60;documentHtmlDefinition&#x60; object, which holds the responsive signing parameters that define how to generate the HTML version of the signing document.
    # @param account_id The external account number (int) or account ID Guid.
    # @param document_id The ID of the document being accessed.
    # @param template_id The ID of the template being accessed.
    # @param document_html_definition  (optional parameter)
    # @return [Array<(DocumentHtmlDefinitions, Fixnum, Hash)>] DocumentHtmlDefinitions data, response status code and response headers
    def create_template_document_responsive_html_preview_with_http_info(account_id, document_id, template_id, document_html_definition)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: TemplatesApi.create_template_document_responsive_html_preview ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling TemplatesApi.create_template_document_responsive_html_preview" if account_id.nil?
      # verify the required parameter 'document_id' is set
      fail ArgumentError, "Missing the required parameter 'document_id' when calling TemplatesApi.create_template_document_responsive_html_preview" if document_id.nil?
      # verify the required parameter 'template_id' is set
      fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplatesApi.create_template_document_responsive_html_preview" if template_id.nil?
      # resource path
      local_var_path = "/v2.1/accounts/{accountId}/templates/{templateId}/documents/{documentId}/responsive_html_preview".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'documentId' + '}', document_id.to_s).sub('{' + 'templateId' + '}', template_id.to_s)

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = @api_client.object_to_http_body(document_html_definition)
      auth_names = []
      data, status_code, headers = @api_client.call_api(:POST, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'DocumentHtmlDefinitions')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TemplatesApi#create_template_document_responsive_html_preview\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Adds the tabs to a tempate
    # Adds tabs to the document specified by `documentId` in the template specified by `templateId`.  In the request body, you only need to specify the tabs that your are adding. For example, to add a text [prefill tab](/docs/esign-rest-api/reference/templates/templatedocumenttabs/create/#definition__templatetabs_prefilltabs), your request body might look like this:  ``` {   \"prefillTabs\": {     \"textTabs\": [       {         \"value\": \"a prefill text tab\",         \"pageNumber\": \"1\",         \"documentId\": \"1\",         \"xPosition\": 316,         \"yPosition\": 97       }     ]   } } ``` 
    # @param account_id The external account number (int) or account ID Guid.
    # @param document_id The ID of the document being accessed.
    # @param template_id The ID of the template being accessed.
    # @param template_tabs  (optional parameter)
    # @return [Tabs]
    def create_template_document_tabs(account_id, document_id, template_id, template_tabs)
      data, _status_code, _headers = create_template_document_tabs_with_http_info(account_id, document_id, template_id,  template_tabs)
      return data
    end

    # Adds the tabs to a tempate
    # Adds tabs to the document specified by &#x60;documentId&#x60; in the template specified by &#x60;templateId&#x60;.  In the request body, you only need to specify the tabs that your are adding. For example, to add a text [prefill tab](/docs/esign-rest-api/reference/templates/templatedocumenttabs/create/#definition__templatetabs_prefilltabs), your request body might look like this:  &#x60;&#x60;&#x60; {   \&quot;prefillTabs\&quot;: {     \&quot;textTabs\&quot;: [       {         \&quot;value\&quot;: \&quot;a prefill text tab\&quot;,         \&quot;pageNumber\&quot;: \&quot;1\&quot;,         \&quot;documentId\&quot;: \&quot;1\&quot;,         \&quot;xPosition\&quot;: 316,         \&quot;yPosition\&quot;: 97       }     ]   } } &#x60;&#x60;&#x60; 
    # @param account_id The external account number (int) or account ID Guid.
    # @param document_id The ID of the document being accessed.
    # @param template_id The ID of the template being accessed.
    # @param template_tabs  (optional parameter)
    # @return [Array<(Tabs, Fixnum, Hash)>] Tabs data, response status code and response headers
    def create_template_document_tabs_with_http_info(account_id, document_id, template_id, template_tabs)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: TemplatesApi.create_template_document_tabs ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling TemplatesApi.create_template_document_tabs" if account_id.nil?
      # verify the required parameter 'document_id' is set
      fail ArgumentError, "Missing the required parameter 'document_id' when calling TemplatesApi.create_template_document_tabs" if document_id.nil?
      # verify the required parameter 'template_id' is set
      fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplatesApi.create_template_document_tabs" if template_id.nil?
      # resource path
      local_var_path = "/v2.1/accounts/{accountId}/templates/{templateId}/documents/{documentId}/tabs".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'documentId' + '}', document_id.to_s).sub('{' + 'templateId' + '}', template_id.to_s)

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = @api_client.object_to_http_body(template_tabs)
      auth_names = []
      data, status_code, headers = @api_client.call_api(:POST, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'Tabs')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TemplatesApi#create_template_document_tabs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Provides a URL to start a recipient view of the Envelope UI
    # This method returns a URL for a template recipient preview  in the DocuSign UI that you can embed in your application. You use this method to enable the sender to preview the recipients' experience.  For more information, see [Preview and Send](https://support.docusign.com/en/guides/ndse-user-guide-send-your-documents).
    # @param account_id The external account number (int) or account ID Guid.
    # @param template_id The ID of the template being accessed.
    # @param recipient_preview_request  (optional parameter)
    # @return [ViewUrl]
    def create_template_recipient_preview(account_id, template_id, recipient_preview_request)
      data, _status_code, _headers = create_template_recipient_preview_with_http_info(account_id, template_id,  recipient_preview_request)
      return data
    end

    # Provides a URL to start a recipient view of the Envelope UI
    # This method returns a URL for a template recipient preview  in the DocuSign UI that you can embed in your application. You use this method to enable the sender to preview the recipients&#39; experience.  For more information, see [Preview and Send](https://support.docusign.com/en/guides/ndse-user-guide-send-your-documents).
    # @param account_id The external account number (int) or account ID Guid.
    # @param template_id The ID of the template being accessed.
    # @param recipient_preview_request  (optional parameter)
    # @return [Array<(ViewUrl, Fixnum, Hash)>] ViewUrl data, response status code and response headers
    def create_template_recipient_preview_with_http_info(account_id, template_id, recipient_preview_request)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: TemplatesApi.create_template_recipient_preview ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling TemplatesApi.create_template_recipient_preview" if account_id.nil?
      # verify the required parameter 'template_id' is set
      fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplatesApi.create_template_recipient_preview" if template_id.nil?
      # resource path
      local_var_path = "/v2.1/accounts/{accountId}/templates/{templateId}/views/recipient_preview".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'templateId' + '}', template_id.to_s)

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = @api_client.object_to_http_body(recipient_preview_request)
      auth_names = []
      data, status_code, headers = @api_client.call_api(:POST, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'ViewUrl')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TemplatesApi#create_template_recipient_preview\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Get Responsive HTML Preview for all documents in a template.
    # Creates a preview of the [responsive](/docs/esign-rest-api/esign101/concepts/responsive/), HTML versions of all of the documents associated with a template. This method enables you to preview the PDF document conversions to responsive HTML across device types prior to sending.  The request body is a `documentHtmlDefinition` object, which holds the responsive signing parameters that define how to generate the HTML version of the documents.
    # @param account_id The external account number (int) or account ID Guid.
    # @param template_id The ID of the template being accessed.
    # @param document_html_definition  (optional parameter)
    # @return [DocumentHtmlDefinitions]
    def create_template_responsive_html_preview(account_id, template_id, document_html_definition)
      data, _status_code, _headers = create_template_responsive_html_preview_with_http_info(account_id, template_id,  document_html_definition)
      return data
    end

    # Get Responsive HTML Preview for all documents in a template.
    # Creates a preview of the [responsive](/docs/esign-rest-api/esign101/concepts/responsive/), HTML versions of all of the documents associated with a template. This method enables you to preview the PDF document conversions to responsive HTML across device types prior to sending.  The request body is a &#x60;documentHtmlDefinition&#x60; object, which holds the responsive signing parameters that define how to generate the HTML version of the documents.
    # @param account_id The external account number (int) or account ID Guid.
    # @param template_id The ID of the template being accessed.
    # @param document_html_definition  (optional parameter)
    # @return [Array<(DocumentHtmlDefinitions, Fixnum, Hash)>] DocumentHtmlDefinitions data, response status code and response headers
    def create_template_responsive_html_preview_with_http_info(account_id, template_id, document_html_definition)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: TemplatesApi.create_template_responsive_html_preview ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling TemplatesApi.create_template_responsive_html_preview" if account_id.nil?
      # verify the required parameter 'template_id' is set
      fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplatesApi.create_template_responsive_html_preview" if template_id.nil?
      # resource path
      local_var_path = "/v2.1/accounts/{accountId}/templates/{templateId}/responsive_html_preview".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'templateId' + '}', template_id.to_s)

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = @api_client.object_to_http_body(document_html_definition)
      auth_names = []
      data, status_code, headers = @api_client.call_api(:POST, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'DocumentHtmlDefinitions')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TemplatesApi#create_template_responsive_html_preview\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Deletes envelope custom fields in a template.
    # Deletes envelope custom fields in a template.
    # @param account_id The external account number (int) or account ID Guid.
    # @param template_id The ID of the template being accessed.
    # @param template_custom_fields  (optional parameter)
    # @return [CustomFields]
    def delete_custom_fields(account_id, template_id, template_custom_fields)
      data, _status_code, _headers = delete_custom_fields_with_http_info(account_id, template_id,  template_custom_fields)
      return data
    end

    # Deletes envelope custom fields in a template.
    # Deletes envelope custom fields in a template.
    # @param account_id The external account number (int) or account ID Guid.
    # @param template_id The ID of the template being accessed.
    # @param template_custom_fields  (optional parameter)
    # @return [Array<(CustomFields, Fixnum, Hash)>] CustomFields data, response status code and response headers
    def delete_custom_fields_with_http_info(account_id, template_id, template_custom_fields)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: TemplatesApi.delete_custom_fields ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling TemplatesApi.delete_custom_fields" if account_id.nil?
      # verify the required parameter 'template_id' is set
      fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplatesApi.delete_custom_fields" if template_id.nil?
      # resource path
      local_var_path = "/v2.1/accounts/{accountId}/templates/{templateId}/custom_fields".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'templateId' + '}', template_id.to_s)

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = @api_client.object_to_http_body(template_custom_fields)
      auth_names = []
      data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'CustomFields')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TemplatesApi#delete_custom_fields\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Deletes custom document fields from an existing template document.
    # Deletes custom document fields from an existing template document.
    # @param account_id The external account number (int) or account ID Guid.
    # @param document_id The ID of the document being accessed.
    # @param template_id The ID of the template being accessed.
    # @param document_fields_information  (optional parameter)
    # @return [DocumentFieldsInformation]
    def delete_document_fields(account_id, document_id, template_id, document_fields_information)
      data, _status_code, _headers = delete_document_fields_with_http_info(account_id, document_id, template_id,  document_fields_information)
      return data
    end

    # Deletes custom document fields from an existing template document.
    # Deletes custom document fields from an existing template document.
    # @param account_id The external account number (int) or account ID Guid.
    # @param document_id The ID of the document being accessed.
    # @param template_id The ID of the template being accessed.
    # @param document_fields_information  (optional parameter)
    # @return [Array<(DocumentFieldsInformation, Fixnum, Hash)>] DocumentFieldsInformation data, response status code and response headers
    def delete_document_fields_with_http_info(account_id, document_id, template_id, document_fields_information)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: TemplatesApi.delete_document_fields ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling TemplatesApi.delete_document_fields" if account_id.nil?
      # verify the required parameter 'document_id' is set
      fail ArgumentError, "Missing the required parameter 'document_id' when calling TemplatesApi.delete_document_fields" if document_id.nil?
      # verify the required parameter 'template_id' is set
      fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplatesApi.delete_document_fields" if template_id.nil?
      # resource path
      local_var_path = "/v2.1/accounts/{accountId}/templates/{templateId}/documents/{documentId}/fields".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'documentId' + '}', document_id.to_s).sub('{' + 'templateId' + '}', template_id.to_s)

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = @api_client.object_to_http_body(document_fields_information)
      auth_names = []
      data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'DocumentFieldsInformation')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TemplatesApi#delete_document_fields\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Deletes a page from a document in an template.
    # Deletes a page from a document in a template based on the page number.
    # @param account_id The external account number (int) or account ID Guid.
    # @param document_id The ID of the document being accessed.
    # @param page_number The page number being accessed.
    # @param template_id The ID of the template being accessed.
    # @param page_request  (optional parameter)
    # @return [nil]
    def delete_document_page(account_id, document_id, page_number, template_id, page_request)
      delete_document_page_with_http_info(account_id, document_id, page_number, template_id,  page_request)
      return nil
    end

    # Deletes a page from a document in an template.
    # Deletes a page from a document in a template based on the page number.
    # @param account_id The external account number (int) or account ID Guid.
    # @param document_id The ID of the document being accessed.
    # @param page_number The page number being accessed.
    # @param template_id The ID of the template being accessed.
    # @param page_request  (optional parameter)
    # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
    def delete_document_page_with_http_info(account_id, document_id, page_number, template_id, page_request)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: TemplatesApi.delete_document_page ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling TemplatesApi.delete_document_page" if account_id.nil?
      # verify the required parameter 'document_id' is set
      fail ArgumentError, "Missing the required parameter 'document_id' when calling TemplatesApi.delete_document_page" if document_id.nil?
      # verify the required parameter 'page_number' is set
      fail ArgumentError, "Missing the required parameter 'page_number' when calling TemplatesApi.delete_document_page" if page_number.nil?
      # verify the required parameter 'template_id' is set
      fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplatesApi.delete_document_page" if template_id.nil?
      # resource path
      local_var_path = "/v2.1/accounts/{accountId}/templates/{templateId}/documents/{documentId}/pages/{pageNumber}".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'documentId' + '}', document_id.to_s).sub('{' + 'pageNumber' + '}', page_number.to_s).sub('{' + 'templateId' + '}', template_id.to_s)

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = @api_client.object_to_http_body(page_request)
      auth_names = []
      data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TemplatesApi#delete_document_page\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Deletes documents from a template.
    # Deletes one or more documents from an existing template.
    # @param account_id The external account number (int) or account ID Guid.
    # @param template_id The ID of the template being accessed.
    # @param envelope_definition  (optional parameter)
    # @return [TemplateDocumentsResult]
    def delete_documents(account_id, template_id, envelope_definition)
      data, _status_code, _headers = delete_documents_with_http_info(account_id, template_id,  envelope_definition)
      return data
    end

    # Deletes documents from a template.
    # Deletes one or more documents from an existing template.
    # @param account_id The external account number (int) or account ID Guid.
    # @param template_id The ID of the template being accessed.
    # @param envelope_definition  (optional parameter)
    # @return [Array<(TemplateDocumentsResult, Fixnum, Hash)>] TemplateDocumentsResult data, response status code and response headers
    def delete_documents_with_http_info(account_id, template_id, envelope_definition)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: TemplatesApi.delete_documents ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling TemplatesApi.delete_documents" if account_id.nil?
      # verify the required parameter 'template_id' is set
      fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplatesApi.delete_documents" if template_id.nil?
      # resource path
      local_var_path = "/v2.1/accounts/{accountId}/templates/{templateId}/documents".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'templateId' + '}', template_id.to_s)

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = @api_client.object_to_http_body(envelope_definition)
      auth_names = []
      data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'TemplateDocumentsResult')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TemplatesApi#delete_documents\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Removes a member group's sharing permissions for a template.
    # Removes a member group's sharing permissions for a specified template.
    # @param account_id The external account number (int) or account ID Guid.
    # @param template_id The ID of the template being accessed.
    # @param template_part Currently, the only defined part is **groups**.
    # @param group_information  (optional parameter)
    # @return [GroupInformation]
    def delete_group_share(account_id, template_id, template_part, group_information)
      data, _status_code, _headers = delete_group_share_with_http_info(account_id, template_id, template_part,  group_information)
      return data
    end

    # Removes a member group&#39;s sharing permissions for a template.
    # Removes a member group&#39;s sharing permissions for a specified template.
    # @param account_id The external account number (int) or account ID Guid.
    # @param template_id The ID of the template being accessed.
    # @param template_part Currently, the only defined part is **groups**.
    # @param group_information  (optional parameter)
    # @return [Array<(GroupInformation, Fixnum, Hash)>] GroupInformation data, response status code and response headers
    def delete_group_share_with_http_info(account_id, template_id, template_part, group_information)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: TemplatesApi.delete_group_share ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling TemplatesApi.delete_group_share" if account_id.nil?
      # verify the required parameter 'template_id' is set
      fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplatesApi.delete_group_share" if template_id.nil?
      # verify the required parameter 'template_part' is set
      fail ArgumentError, "Missing the required parameter 'template_part' when calling TemplatesApi.delete_group_share" if template_part.nil?
      # resource path
      local_var_path = "/v2.1/accounts/{accountId}/templates/{templateId}/{templatePart}".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'templateId' + '}', template_id.to_s).sub('{' + 'templatePart' + '}', template_part.to_s)

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = @api_client.object_to_http_body(group_information)
      auth_names = []
      data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'GroupInformation')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TemplatesApi#delete_group_share\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Deletes a template lock.
    # Deletes the lock from the specified template. The `X-DocuSign-Edit` header must be included in the request.
    # @param account_id The external account number (int) or account ID Guid.
    # @param template_id The ID of the template being accessed.
    # @param lock_request  (optional parameter)
    # @return [LockInformation]
    def delete_lock(account_id, template_id, lock_request)
      data, _status_code, _headers = delete_lock_with_http_info(account_id, template_id,  lock_request)
      return data
    end

    # Deletes a template lock.
    # Deletes the lock from the specified template. The &#x60;X-DocuSign-Edit&#x60; header must be included in the request.
    # @param account_id The external account number (int) or account ID Guid.
    # @param template_id The ID of the template being accessed.
    # @param lock_request  (optional parameter)
    # @return [Array<(LockInformation, Fixnum, Hash)>] LockInformation data, response status code and response headers
    def delete_lock_with_http_info(account_id, template_id, lock_request)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: TemplatesApi.delete_lock ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling TemplatesApi.delete_lock" if account_id.nil?
      # verify the required parameter 'template_id' is set
      fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplatesApi.delete_lock" if template_id.nil?
      # resource path
      local_var_path = "/v2.1/accounts/{accountId}/templates/{templateId}/lock".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'templateId' + '}', template_id.to_s)

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = @api_client.object_to_http_body(lock_request)
      auth_names = []
      data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'LockInformation')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TemplatesApi#delete_lock\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Deletes the specified recipient file from a template.
    # Deletes the specified recipient file from the specified template.
    # @param account_id The external account number (int) or account ID Guid.
    # @param recipient_id The ID of the recipient being accessed.
    # @param template_id The ID of the template being accessed.
    # @param template_recipients  (optional parameter)
    # @return [Recipients]
    def delete_recipient(account_id, recipient_id, template_id, template_recipients)
      data, _status_code, _headers = delete_recipient_with_http_info(account_id, recipient_id, template_id,  template_recipients)
      return data
    end

    # Deletes the specified recipient file from a template.
    # Deletes the specified recipient file from the specified template.
    # @param account_id The external account number (int) or account ID Guid.
    # @param recipient_id The ID of the recipient being accessed.
    # @param template_id The ID of the template being accessed.
    # @param template_recipients  (optional parameter)
    # @return [Array<(Recipients, Fixnum, Hash)>] Recipients data, response status code and response headers
    def delete_recipient_with_http_info(account_id, recipient_id, template_id, template_recipients)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: TemplatesApi.delete_recipient ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling TemplatesApi.delete_recipient" if account_id.nil?
      # verify the required parameter 'recipient_id' is set
      fail ArgumentError, "Missing the required parameter 'recipient_id' when calling TemplatesApi.delete_recipient" if recipient_id.nil?
      # verify the required parameter 'template_id' is set
      fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplatesApi.delete_recipient" if template_id.nil?
      # resource path
      local_var_path = "/v2.1/accounts/{accountId}/templates/{templateId}/recipients/{recipientId}".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'recipientId' + '}', recipient_id.to_s).sub('{' + 'templateId' + '}', template_id.to_s)

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = @api_client.object_to_http_body(template_recipients)
      auth_names = []
      data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'Recipients')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TemplatesApi#delete_recipient\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Deletes recipients from a template.
    # Deletes one or more recipients from a template. Recipients to be deleted are listed in the request, with the `recipientId` being used as the key for deleting recipients.
    # @param account_id The external account number (int) or account ID Guid.
    # @param template_id The ID of the template being accessed.
    # @param template_recipients  (optional parameter)
    # @return [Recipients]
    def delete_recipients(account_id, template_id, template_recipients)
      data, _status_code, _headers = delete_recipients_with_http_info(account_id, template_id,  template_recipients)
      return data
    end

    # Deletes recipients from a template.
    # Deletes one or more recipients from a template. Recipients to be deleted are listed in the request, with the &#x60;recipientId&#x60; being used as the key for deleting recipients.
    # @param account_id The external account number (int) or account ID Guid.
    # @param template_id The ID of the template being accessed.
    # @param template_recipients  (optional parameter)
    # @return [Array<(Recipients, Fixnum, Hash)>] Recipients data, response status code and response headers
    def delete_recipients_with_http_info(account_id, template_id, template_recipients)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: TemplatesApi.delete_recipients ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling TemplatesApi.delete_recipients" if account_id.nil?
      # verify the required parameter 'template_id' is set
      fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplatesApi.delete_recipients" if template_id.nil?
      # resource path
      local_var_path = "/v2.1/accounts/{accountId}/templates/{templateId}/recipients".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'templateId' + '}', template_id.to_s)

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = @api_client.object_to_http_body(template_recipients)
      auth_names = []
      data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'Recipients')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TemplatesApi#delete_recipients\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Deletes the tabs associated with a recipient in a template.
    # Deletes one or more tabs associated with a recipient in a template.
    # @param account_id The external account number (int) or account ID Guid.
    # @param recipient_id The ID of the recipient being accessed.
    # @param template_id The ID of the template being accessed.
    # @param template_tabs  (optional parameter)
    # @return [Tabs]
    def delete_tabs(account_id, recipient_id, template_id, template_tabs)
      data, _status_code, _headers = delete_tabs_with_http_info(account_id, recipient_id, template_id,  template_tabs)
      return data
    end

    # Deletes the tabs associated with a recipient in a template.
    # Deletes one or more tabs associated with a recipient in a template.
    # @param account_id The external account number (int) or account ID Guid.
    # @param recipient_id The ID of the recipient being accessed.
    # @param template_id The ID of the template being accessed.
    # @param template_tabs  (optional parameter)
    # @return [Array<(Tabs, Fixnum, Hash)>] Tabs data, response status code and response headers
    def delete_tabs_with_http_info(account_id, recipient_id, template_id, template_tabs)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: TemplatesApi.delete_tabs ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling TemplatesApi.delete_tabs" if account_id.nil?
      # verify the required parameter 'recipient_id' is set
      fail ArgumentError, "Missing the required parameter 'recipient_id' when calling TemplatesApi.delete_tabs" if recipient_id.nil?
      # verify the required parameter 'template_id' is set
      fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplatesApi.delete_tabs" if template_id.nil?
      # resource path
      local_var_path = "/v2.1/accounts/{accountId}/templates/{templateId}/recipients/{recipientId}/tabs".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'recipientId' + '}', recipient_id.to_s).sub('{' + 'templateId' + '}', template_id.to_s)

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = @api_client.object_to_http_body(template_tabs)
      auth_names = []
      data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'Tabs')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TemplatesApi#delete_tabs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Deletes tabs from an envelope document
    # Deletes tabs from the document specified by `documentId` in the template specified by `templateId`. 
    # @param account_id The external account number (int) or account ID Guid.
    # @param document_id The ID of the document being accessed.
    # @param template_id The ID of the template being accessed.
    # @param template_tabs  (optional parameter)
    # @return [Tabs]
    def delete_template_document_tabs(account_id, document_id, template_id, template_tabs)
      data, _status_code, _headers = delete_template_document_tabs_with_http_info(account_id, document_id, template_id,  template_tabs)
      return data
    end

    # Deletes tabs from an envelope document
    # Deletes tabs from the document specified by &#x60;documentId&#x60; in the template specified by &#x60;templateId&#x60;. 
    # @param account_id The external account number (int) or account ID Guid.
    # @param document_id The ID of the document being accessed.
    # @param template_id The ID of the template being accessed.
    # @param template_tabs  (optional parameter)
    # @return [Array<(Tabs, Fixnum, Hash)>] Tabs data, response status code and response headers
    def delete_template_document_tabs_with_http_info(account_id, document_id, template_id, template_tabs)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: TemplatesApi.delete_template_document_tabs ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling TemplatesApi.delete_template_document_tabs" if account_id.nil?
      # verify the required parameter 'document_id' is set
      fail ArgumentError, "Missing the required parameter 'document_id' when calling TemplatesApi.delete_template_document_tabs" if document_id.nil?
      # verify the required parameter 'template_id' is set
      fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplatesApi.delete_template_document_tabs" if template_id.nil?
      # resource path
      local_var_path = "/v2.1/accounts/{accountId}/templates/{templateId}/documents/{documentId}/tabs".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'documentId' + '}', document_id.to_s).sub('{' + 'templateId' + '}', template_id.to_s)

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = @api_client.object_to_http_body(template_tabs)
      auth_names = []
      data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'Tabs')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TemplatesApi#delete_template_document_tabs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Gets a list of templates for a specified account.
    # Retrieves the definition of the specified template.
    # @param account_id The external account number (int) or account ID Guid.
    # @param template_id The ID of the template being accessed.
    # @param DocuSign_eSign::GetOptions Options for modifying the behavior of the function.
    # @return [EnvelopeTemplate]
    def get(account_id, template_id, options = DocuSign_eSign::GetOptions.default)
      data, _status_code, _headers = get_with_http_info(account_id, template_id, options)
      return data
    end

    # Gets a list of templates for a specified account.
    # Retrieves the definition of the specified template.
    # @param account_id The external account number (int) or account ID Guid.
    # @param template_id The ID of the template being accessed.
    # @param DocuSign_eSign::GetOptions Options for modifying the behavior of the function.
    # @return [Array<(EnvelopeTemplate, Fixnum, Hash)>] EnvelopeTemplate data, response status code and response headers
    def get_with_http_info(account_id, template_id, options = DocuSign_eSign::GetOptions.default)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: TemplatesApi.get ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling TemplatesApi.get" if account_id.nil?
      # verify the required parameter 'template_id' is set
      fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplatesApi.get" if template_id.nil?
      # resource path
      local_var_path = "/v2.1/accounts/{accountId}/templates/{templateId}".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'templateId' + '}', template_id.to_s)

      # query parameters
      query_params = {}
      query_params[:'include'] = options.include if !options.include.nil?

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = []
      data, status_code, headers = @api_client.call_api(:GET, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'EnvelopeTemplate')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TemplatesApi#get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Gets PDF documents from a template.
    # Retrieves one or more PDF documents from the specified template.  You can specify the ID of the document to retrieve or can specify `combined` to retrieve all documents in the template as one pdf.
    # @param account_id The external account number (int) or account ID Guid.
    # @param document_id The ID of the document being accessed.
    # @param template_id The ID of the template being accessed.
    # @param DocuSign_eSign::GetDocumentOptions Options for modifying the behavior of the function.
    # @return [File]
    def get_document(account_id, document_id, template_id, options = DocuSign_eSign::GetDocumentOptions.default)
      data, _status_code, _headers = get_document_with_http_info(account_id, document_id, template_id, options)
      return data
    end

    # Gets PDF documents from a template.
    # Retrieves one or more PDF documents from the specified template.  You can specify the ID of the document to retrieve or can specify &#x60;combined&#x60; to retrieve all documents in the template as one pdf.
    # @param account_id The external account number (int) or account ID Guid.
    # @param document_id The ID of the document being accessed.
    # @param template_id The ID of the template being accessed.
    # @param DocuSign_eSign::GetDocumentOptions Options for modifying the behavior of the function.
    # @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
    def get_document_with_http_info(account_id, document_id, template_id, options = DocuSign_eSign::GetDocumentOptions.default)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: TemplatesApi.get_document ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling TemplatesApi.get_document" if account_id.nil?
      # verify the required parameter 'document_id' is set
      fail ArgumentError, "Missing the required parameter 'document_id' when calling TemplatesApi.get_document" if document_id.nil?
      # verify the required parameter 'template_id' is set
      fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplatesApi.get_document" if template_id.nil?
      # resource path
      local_var_path = "/v2.1/accounts/{accountId}/templates/{templateId}/documents/{documentId}".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'documentId' + '}', document_id.to_s).sub('{' + 'templateId' + '}', template_id.to_s)

      # query parameters
      query_params = {}
      query_params[:'encrypt'] = options.encrypt if !options.encrypt.nil?
      query_params[:'file_type'] = options.file_type if !options.file_type.nil?
      query_params[:'show_changes'] = options.show_changes if !options.show_changes.nil?

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/pdf'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = []
      data, status_code, headers = @api_client.call_api(:GET, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'File')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TemplatesApi#get_document\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Gets a page image from a template for display.
    # Retrieves a page image for display from the specified template.
    # @param account_id The external account number (int) or account ID Guid.
    # @param document_id The ID of the document being accessed.
    # @param page_number The page number being accessed.
    # @param template_id The ID of the template being accessed.
    # @param DocuSign_eSign::GetDocumentPageImageOptions Options for modifying the behavior of the function.
    # @return [File]
    def get_document_page_image(account_id, document_id, page_number, template_id, options = DocuSign_eSign::GetDocumentPageImageOptions.default)
      data, _status_code, _headers = get_document_page_image_with_http_info(account_id, document_id, page_number, template_id, options)
      return data
    end

    # Gets a page image from a template for display.
    # Retrieves a page image for display from the specified template.
    # @param account_id The external account number (int) or account ID Guid.
    # @param document_id The ID of the document being accessed.
    # @param page_number The page number being accessed.
    # @param template_id The ID of the template being accessed.
    # @param DocuSign_eSign::GetDocumentPageImageOptions Options for modifying the behavior of the function.
    # @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
    def get_document_page_image_with_http_info(account_id, document_id, page_number, template_id, options = DocuSign_eSign::GetDocumentPageImageOptions.default)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: TemplatesApi.get_document_page_image ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling TemplatesApi.get_document_page_image" if account_id.nil?
      # verify the required parameter 'document_id' is set
      fail ArgumentError, "Missing the required parameter 'document_id' when calling TemplatesApi.get_document_page_image" if document_id.nil?
      # verify the required parameter 'page_number' is set
      fail ArgumentError, "Missing the required parameter 'page_number' when calling TemplatesApi.get_document_page_image" if page_number.nil?
      # verify the required parameter 'template_id' is set
      fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplatesApi.get_document_page_image" if template_id.nil?
      # resource path
      local_var_path = "/v2.1/accounts/{accountId}/templates/{templateId}/documents/{documentId}/pages/{pageNumber}/page_image".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'documentId' + '}', document_id.to_s).sub('{' + 'pageNumber' + '}', page_number.to_s).sub('{' + 'templateId' + '}', template_id.to_s)

      # query parameters
      query_params = {}
      query_params[:'dpi'] = options.dpi if !options.dpi.nil?
      query_params[:'max_height'] = options.max_height if !options.max_height.nil?
      query_params[:'max_width'] = options.max_width if !options.max_width.nil?
      query_params[:'show_changes'] = options.show_changes if !options.show_changes.nil?

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['image/png'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = []
      data, status_code, headers = @api_client.call_api(:GET, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'File')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TemplatesApi#get_document_page_image\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Returns tabs on the document.
    # Returns the tabs on the document specified by `documentId` in the template specified by `templateId`.  
    # @param account_id The external account number (int) or account ID Guid.
    # @param document_id The ID of the document being accessed.
    # @param template_id The ID of the template being accessed.
    # @param DocuSign_eSign::GetDocumentTabsOptions Options for modifying the behavior of the function.
    # @return [Tabs]
    def get_document_tabs(account_id, document_id, template_id, options = DocuSign_eSign::GetDocumentTabsOptions.default)
      data, _status_code, _headers = get_document_tabs_with_http_info(account_id, document_id, template_id, options)
      return data
    end

    # Returns tabs on the document.
    # Returns the tabs on the document specified by &#x60;documentId&#x60; in the template specified by &#x60;templateId&#x60;.  
    # @param account_id The external account number (int) or account ID Guid.
    # @param document_id The ID of the document being accessed.
    # @param template_id The ID of the template being accessed.
    # @param DocuSign_eSign::GetDocumentTabsOptions Options for modifying the behavior of the function.
    # @return [Array<(Tabs, Fixnum, Hash)>] Tabs data, response status code and response headers
    def get_document_tabs_with_http_info(account_id, document_id, template_id, options = DocuSign_eSign::GetDocumentTabsOptions.default)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: TemplatesApi.get_document_tabs ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling TemplatesApi.get_document_tabs" if account_id.nil?
      # verify the required parameter 'document_id' is set
      fail ArgumentError, "Missing the required parameter 'document_id' when calling TemplatesApi.get_document_tabs" if document_id.nil?
      # verify the required parameter 'template_id' is set
      fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplatesApi.get_document_tabs" if template_id.nil?
      # resource path
      local_var_path = "/v2.1/accounts/{accountId}/templates/{templateId}/documents/{documentId}/tabs".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'documentId' + '}', document_id.to_s).sub('{' + 'templateId' + '}', template_id.to_s)

      # query parameters
      query_params = {}
      query_params[:'page_numbers'] = options.page_numbers if !options.page_numbers.nil?

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = []
      data, status_code, headers = @api_client.call_api(:GET, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'Tabs')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TemplatesApi#get_document_tabs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Gets template lock information.
    # Retrieves general information about the template lock.  If the call is made by the user who has the lock and the request has the same integrator key as original, then the `X-DocuSign-Edit` header  field and additional lock information is included in the response. This allows users to recover a lost editing session token and the `X-DocuSign-Edit` header.
    # @param account_id The external account number (int) or account ID Guid.
    # @param template_id The ID of the template being accessed.
    # @return [LockInformation]
    def get_lock(account_id, template_id)
      data, _status_code, _headers = get_lock_with_http_info(account_id, template_id)
      return data
    end

    # Gets template lock information.
    # Retrieves general information about the template lock.  If the call is made by the user who has the lock and the request has the same integrator key as original, then the &#x60;X-DocuSign-Edit&#x60; header  field and additional lock information is included in the response. This allows users to recover a lost editing session token and the &#x60;X-DocuSign-Edit&#x60; header.
    # @param account_id The external account number (int) or account ID Guid.
    # @param template_id The ID of the template being accessed.
    # @return [Array<(LockInformation, Fixnum, Hash)>] LockInformation data, response status code and response headers
    def get_lock_with_http_info(account_id, template_id)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: TemplatesApi.get_lock ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling TemplatesApi.get_lock" if account_id.nil?
      # verify the required parameter 'template_id' is set
      fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplatesApi.get_lock" if template_id.nil?
      # resource path
      local_var_path = "/v2.1/accounts/{accountId}/templates/{templateId}/lock".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'templateId' + '}', template_id.to_s)

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = []
      data, status_code, headers = @api_client.call_api(:GET, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'LockInformation')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TemplatesApi#get_lock\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Gets template notification information.
    # Retrieves the envelope notification, reminders and expirations, information for an existing template.
    # @param account_id The external account number (int) or account ID Guid.
    # @param template_id The ID of the template being accessed.
    # @return [Notification]
    def get_notification_settings(account_id, template_id)
      data, _status_code, _headers = get_notification_settings_with_http_info(account_id, template_id)
      return data
    end

    # Gets template notification information.
    # Retrieves the envelope notification, reminders and expirations, information for an existing template.
    # @param account_id The external account number (int) or account ID Guid.
    # @param template_id The ID of the template being accessed.
    # @return [Array<(Notification, Fixnum, Hash)>] Notification data, response status code and response headers
    def get_notification_settings_with_http_info(account_id, template_id)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: TemplatesApi.get_notification_settings ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling TemplatesApi.get_notification_settings" if account_id.nil?
      # verify the required parameter 'template_id' is set
      fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplatesApi.get_notification_settings" if template_id.nil?
      # resource path
      local_var_path = "/v2.1/accounts/{accountId}/templates/{templateId}/notification".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'templateId' + '}', template_id.to_s)

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = []
      data, status_code, headers = @api_client.call_api(:GET, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'Notification')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TemplatesApi#get_notification_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Returns tabs on the specified page.
    # Returns the tabs from the page specified by `pageNumber` of the document specified by `documentId` in the template specified by `templateId`. 
    # @param account_id The external account number (int) or account ID Guid.
    # @param document_id The ID of the document being accessed.
    # @param page_number The page number being accessed.
    # @param template_id The ID of the template being accessed.
    # @return [Tabs]
    def get_page_tabs(account_id, document_id, page_number, template_id)
      data, _status_code, _headers = get_page_tabs_with_http_info(account_id, document_id, page_number, template_id)
      return data
    end

    # Returns tabs on the specified page.
    # Returns the tabs from the page specified by &#x60;pageNumber&#x60; of the document specified by &#x60;documentId&#x60; in the template specified by &#x60;templateId&#x60;. 
    # @param account_id The external account number (int) or account ID Guid.
    # @param document_id The ID of the document being accessed.
    # @param page_number The page number being accessed.
    # @param template_id The ID of the template being accessed.
    # @return [Array<(Tabs, Fixnum, Hash)>] Tabs data, response status code and response headers
    def get_page_tabs_with_http_info(account_id, document_id, page_number, template_id)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: TemplatesApi.get_page_tabs ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling TemplatesApi.get_page_tabs" if account_id.nil?
      # verify the required parameter 'document_id' is set
      fail ArgumentError, "Missing the required parameter 'document_id' when calling TemplatesApi.get_page_tabs" if document_id.nil?
      # verify the required parameter 'page_number' is set
      fail ArgumentError, "Missing the required parameter 'page_number' when calling TemplatesApi.get_page_tabs" if page_number.nil?
      # verify the required parameter 'template_id' is set
      fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplatesApi.get_page_tabs" if template_id.nil?
      # resource path
      local_var_path = "/v2.1/accounts/{accountId}/templates/{templateId}/documents/{documentId}/pages/{pageNumber}/tabs".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'documentId' + '}', document_id.to_s).sub('{' + 'pageNumber' + '}', page_number.to_s).sub('{' + 'templateId' + '}', template_id.to_s)

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = []
      data, status_code, headers = @api_client.call_api(:GET, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'Tabs')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TemplatesApi#get_page_tabs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Returns document page image(s) based on input.
    # Returns images of the pages in a template document for display based on the parameters that you specify.
    # @param account_id The external account number (int) or account ID Guid.
    # @param document_id The ID of the document being accessed.
    # @param template_id The ID of the template being accessed.
    # @param DocuSign_eSign::GetPagesOptions Options for modifying the behavior of the function.
    # @return [PageImages]
    def get_pages(account_id, document_id, template_id, options = DocuSign_eSign::GetPagesOptions.default)
      data, _status_code, _headers = get_pages_with_http_info(account_id, document_id, template_id, options)
      return data
    end

    # Returns document page image(s) based on input.
    # Returns images of the pages in a template document for display based on the parameters that you specify.
    # @param account_id The external account number (int) or account ID Guid.
    # @param document_id The ID of the document being accessed.
    # @param template_id The ID of the template being accessed.
    # @param DocuSign_eSign::GetPagesOptions Options for modifying the behavior of the function.
    # @return [Array<(PageImages, Fixnum, Hash)>] PageImages data, response status code and response headers
    def get_pages_with_http_info(account_id, document_id, template_id, options = DocuSign_eSign::GetPagesOptions.default)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: TemplatesApi.get_pages ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling TemplatesApi.get_pages" if account_id.nil?
      # verify the required parameter 'document_id' is set
      fail ArgumentError, "Missing the required parameter 'document_id' when calling TemplatesApi.get_pages" if document_id.nil?
      # verify the required parameter 'template_id' is set
      fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplatesApi.get_pages" if template_id.nil?
      # resource path
      local_var_path = "/v2.1/accounts/{accountId}/templates/{templateId}/documents/{documentId}/pages".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'documentId' + '}', document_id.to_s).sub('{' + 'templateId' + '}', template_id.to_s)

      # query parameters
      query_params = {}
      query_params[:'count'] = options.count if !options.count.nil?
      query_params[:'dpi'] = options.dpi if !options.dpi.nil?
      query_params[:'max_height'] = options.max_height if !options.max_height.nil?
      query_params[:'max_width'] = options.max_width if !options.max_width.nil?
      query_params[:'nocache'] = options.nocache if !options.nocache.nil?
      query_params[:'show_changes'] = options.show_changes if !options.show_changes.nil?
      query_params[:'start_position'] = options.start_position if !options.start_position.nil?

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = []
      data, status_code, headers = @api_client.call_api(:GET, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'PageImages')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TemplatesApi#get_pages\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Get the Original HTML Definition used to generate the Responsive HTML for a given document in a template.
    # 
    # @param account_id The external account number (int) or account ID Guid.
    # @param document_id The ID of the document being accessed.
    # @param template_id The ID of the template being accessed.
    # @return [DocumentHtmlDefinitionOriginals]
    def get_template_document_html_definitions(account_id, document_id, template_id)
      data, _status_code, _headers = get_template_document_html_definitions_with_http_info(account_id, document_id, template_id)
      return data
    end

    # Get the Original HTML Definition used to generate the Responsive HTML for a given document in a template.
    # 
    # @param account_id The external account number (int) or account ID Guid.
    # @param document_id The ID of the document being accessed.
    # @param template_id The ID of the template being accessed.
    # @return [Array<(DocumentHtmlDefinitionOriginals, Fixnum, Hash)>] DocumentHtmlDefinitionOriginals data, response status code and response headers
    def get_template_document_html_definitions_with_http_info(account_id, document_id, template_id)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: TemplatesApi.get_template_document_html_definitions ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling TemplatesApi.get_template_document_html_definitions" if account_id.nil?
      # verify the required parameter 'document_id' is set
      fail ArgumentError, "Missing the required parameter 'document_id' when calling TemplatesApi.get_template_document_html_definitions" if document_id.nil?
      # verify the required parameter 'template_id' is set
      fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplatesApi.get_template_document_html_definitions" if template_id.nil?
      # resource path
      local_var_path = "/v2.1/accounts/{accountId}/templates/{templateId}/documents/{documentId}/html_definitions".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'documentId' + '}', document_id.to_s).sub('{' + 'templateId' + '}', template_id.to_s)

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = []
      data, status_code, headers = @api_client.call_api(:GET, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'DocumentHtmlDefinitionOriginals')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TemplatesApi#get_template_document_html_definitions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Get the Original HTML Definition used to generate the Responsive HTML for the template.
    # 
    # @param account_id The external account number (int) or account ID Guid.
    # @param template_id The ID of the template being accessed.
    # @return [DocumentHtmlDefinitionOriginals]
    def get_template_html_definitions(account_id, template_id)
      data, _status_code, _headers = get_template_html_definitions_with_http_info(account_id, template_id)
      return data
    end

    # Get the Original HTML Definition used to generate the Responsive HTML for the template.
    # 
    # @param account_id The external account number (int) or account ID Guid.
    # @param template_id The ID of the template being accessed.
    # @return [Array<(DocumentHtmlDefinitionOriginals, Fixnum, Hash)>] DocumentHtmlDefinitionOriginals data, response status code and response headers
    def get_template_html_definitions_with_http_info(account_id, template_id)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: TemplatesApi.get_template_html_definitions ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling TemplatesApi.get_template_html_definitions" if account_id.nil?
      # verify the required parameter 'template_id' is set
      fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplatesApi.get_template_html_definitions" if template_id.nil?
      # resource path
      local_var_path = "/v2.1/accounts/{accountId}/templates/{templateId}/html_definitions".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'templateId' + '}', template_id.to_s)

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = []
      data, status_code, headers = @api_client.call_api(:GET, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'DocumentHtmlDefinitionOriginals')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TemplatesApi#get_template_html_definitions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Gets the custom document fields from a template.
    # Retrieves the custom document field information from an existing template.
    # @param account_id The external account number (int) or account ID Guid.
    # @param template_id The ID of the template being accessed.
    # @return [CustomFields]
    def list_custom_fields(account_id, template_id)
      data, _status_code, _headers = list_custom_fields_with_http_info(account_id, template_id)
      return data
    end

    # Gets the custom document fields from a template.
    # Retrieves the custom document field information from an existing template.
    # @param account_id The external account number (int) or account ID Guid.
    # @param template_id The ID of the template being accessed.
    # @return [Array<(CustomFields, Fixnum, Hash)>] CustomFields data, response status code and response headers
    def list_custom_fields_with_http_info(account_id, template_id)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: TemplatesApi.list_custom_fields ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling TemplatesApi.list_custom_fields" if account_id.nil?
      # verify the required parameter 'template_id' is set
      fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplatesApi.list_custom_fields" if template_id.nil?
      # resource path
      local_var_path = "/v2.1/accounts/{accountId}/templates/{templateId}/custom_fields".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'templateId' + '}', template_id.to_s)

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = []
      data, status_code, headers = @api_client.call_api(:GET, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'CustomFields')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TemplatesApi#list_custom_fields\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Gets the custom document fields for a an existing template document.
    # Retrieves the custom document fields for an existing template document.
    # @param account_id The external account number (int) or account ID Guid.
    # @param document_id The ID of the document being accessed.
    # @param template_id The ID of the template being accessed.
    # @return [DocumentFieldsInformation]
    def list_document_fields(account_id, document_id, template_id)
      data, _status_code, _headers = list_document_fields_with_http_info(account_id, document_id, template_id)
      return data
    end

    # Gets the custom document fields for a an existing template document.
    # Retrieves the custom document fields for an existing template document.
    # @param account_id The external account number (int) or account ID Guid.
    # @param document_id The ID of the document being accessed.
    # @param template_id The ID of the template being accessed.
    # @return [Array<(DocumentFieldsInformation, Fixnum, Hash)>] DocumentFieldsInformation data, response status code and response headers
    def list_document_fields_with_http_info(account_id, document_id, template_id)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: TemplatesApi.list_document_fields ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling TemplatesApi.list_document_fields" if account_id.nil?
      # verify the required parameter 'document_id' is set
      fail ArgumentError, "Missing the required parameter 'document_id' when calling TemplatesApi.list_document_fields" if document_id.nil?
      # verify the required parameter 'template_id' is set
      fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplatesApi.list_document_fields" if template_id.nil?
      # resource path
      local_var_path = "/v2.1/accounts/{accountId}/templates/{templateId}/documents/{documentId}/fields".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'documentId' + '}', document_id.to_s).sub('{' + 'templateId' + '}', template_id.to_s)

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = []
      data, status_code, headers = @api_client.call_api(:GET, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'DocumentFieldsInformation')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TemplatesApi#list_document_fields\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Gets a list of documents associated with a template.
    # Retrieves a list of documents associated with the specified template.
    # @param account_id The external account number (int) or account ID Guid.
    # @param template_id The ID of the template being accessed.
    # @param DocuSign_eSign::ListDocumentsOptions Options for modifying the behavior of the function.
    # @return [TemplateDocumentsResult]
    def list_documents(account_id, template_id, options = DocuSign_eSign::ListDocumentsOptions.default)
      data, _status_code, _headers = list_documents_with_http_info(account_id, template_id, options)
      return data
    end

    # Gets a list of documents associated with a template.
    # Retrieves a list of documents associated with the specified template.
    # @param account_id The external account number (int) or account ID Guid.
    # @param template_id The ID of the template being accessed.
    # @param DocuSign_eSign::ListDocumentsOptions Options for modifying the behavior of the function.
    # @return [Array<(TemplateDocumentsResult, Fixnum, Hash)>] TemplateDocumentsResult data, response status code and response headers
    def list_documents_with_http_info(account_id, template_id, options = DocuSign_eSign::ListDocumentsOptions.default)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: TemplatesApi.list_documents ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling TemplatesApi.list_documents" if account_id.nil?
      # verify the required parameter 'template_id' is set
      fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplatesApi.list_documents" if template_id.nil?
      # resource path
      local_var_path = "/v2.1/accounts/{accountId}/templates/{templateId}/documents".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'templateId' + '}', template_id.to_s)

      # query parameters
      query_params = {}
      query_params[:'include_agreement_type'] = options.include_agreement_type if !options.include_agreement_type.nil?
      query_params[:'include_tabs'] = options.include_tabs if !options.include_tabs.nil?

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = []
      data, status_code, headers = @api_client.call_api(:GET, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'TemplateDocumentsResult')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TemplatesApi#list_documents\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Gets recipient information from a template.
    # Retrieves the information for all recipients in the specified template.
    # @param account_id The external account number (int) or account ID Guid.
    # @param template_id The ID of the template being accessed.
    # @param DocuSign_eSign::ListRecipientsOptions Options for modifying the behavior of the function.
    # @return [Recipients]
    def list_recipients(account_id, template_id, options = DocuSign_eSign::ListRecipientsOptions.default)
      data, _status_code, _headers = list_recipients_with_http_info(account_id, template_id, options)
      return data
    end

    # Gets recipient information from a template.
    # Retrieves the information for all recipients in the specified template.
    # @param account_id The external account number (int) or account ID Guid.
    # @param template_id The ID of the template being accessed.
    # @param DocuSign_eSign::ListRecipientsOptions Options for modifying the behavior of the function.
    # @return [Array<(Recipients, Fixnum, Hash)>] Recipients data, response status code and response headers
    def list_recipients_with_http_info(account_id, template_id, options = DocuSign_eSign::ListRecipientsOptions.default)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: TemplatesApi.list_recipients ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling TemplatesApi.list_recipients" if account_id.nil?
      # verify the required parameter 'template_id' is set
      fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplatesApi.list_recipients" if template_id.nil?
      # resource path
      local_var_path = "/v2.1/accounts/{accountId}/templates/{templateId}/recipients".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'templateId' + '}', template_id.to_s)

      # query parameters
      query_params = {}
      query_params[:'include_anchor_tab_locations'] = options.include_anchor_tab_locations if !options.include_anchor_tab_locations.nil?
      query_params[:'include_extended'] = options.include_extended if !options.include_extended.nil?
      query_params[:'include_tabs'] = options.include_tabs if !options.include_tabs.nil?

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = []
      data, status_code, headers = @api_client.call_api(:GET, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'Recipients')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TemplatesApi#list_recipients\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Gets the tabs information for a signer or sign-in-person recipient in a template.
    # Gets the tabs information for a signer or sign-in-person recipient in a template.
    # @param account_id The external account number (int) or account ID Guid.
    # @param recipient_id The ID of the recipient being accessed.
    # @param template_id The ID of the template being accessed.
    # @param DocuSign_eSign::ListTabsOptions Options for modifying the behavior of the function.
    # @return [Tabs]
    def list_tabs(account_id, recipient_id, template_id, options = DocuSign_eSign::ListTabsOptions.default)
      data, _status_code, _headers = list_tabs_with_http_info(account_id, recipient_id, template_id, options)
      return data
    end

    # Gets the tabs information for a signer or sign-in-person recipient in a template.
    # Gets the tabs information for a signer or sign-in-person recipient in a template.
    # @param account_id The external account number (int) or account ID Guid.
    # @param recipient_id The ID of the recipient being accessed.
    # @param template_id The ID of the template being accessed.
    # @param DocuSign_eSign::ListTabsOptions Options for modifying the behavior of the function.
    # @return [Array<(Tabs, Fixnum, Hash)>] Tabs data, response status code and response headers
    def list_tabs_with_http_info(account_id, recipient_id, template_id, options = DocuSign_eSign::ListTabsOptions.default)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: TemplatesApi.list_tabs ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling TemplatesApi.list_tabs" if account_id.nil?
      # verify the required parameter 'recipient_id' is set
      fail ArgumentError, "Missing the required parameter 'recipient_id' when calling TemplatesApi.list_tabs" if recipient_id.nil?
      # verify the required parameter 'template_id' is set
      fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplatesApi.list_tabs" if template_id.nil?
      # resource path
      local_var_path = "/v2.1/accounts/{accountId}/templates/{templateId}/recipients/{recipientId}/tabs".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'recipientId' + '}', recipient_id.to_s).sub('{' + 'templateId' + '}', template_id.to_s)

      # query parameters
      query_params = {}
      query_params[:'include_anchor_tab_locations'] = options.include_anchor_tab_locations if !options.include_anchor_tab_locations.nil?
      query_params[:'include_metadata'] = options.include_metadata if !options.include_metadata.nil?

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = []
      data, status_code, headers = @api_client.call_api(:GET, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'Tabs')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TemplatesApi#list_tabs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Gets the definition of a template.
    # Retrieves the list of templates for the specified account. The request can be limited to a specific folder.
    # @param account_id The external account number (int) or account ID Guid.
    # @param DocuSign_eSign::ListTemplatesOptions Options for modifying the behavior of the function.
    # @return [EnvelopeTemplateResults]
    def list_templates(account_id, options = DocuSign_eSign::ListTemplatesOptions.default)
      data, _status_code, _headers = list_templates_with_http_info(account_id, options)
      return data
    end

    # Gets the definition of a template.
    # Retrieves the list of templates for the specified account. The request can be limited to a specific folder.
    # @param account_id The external account number (int) or account ID Guid.
    # @param DocuSign_eSign::ListTemplatesOptions Options for modifying the behavior of the function.
    # @return [Array<(EnvelopeTemplateResults, Fixnum, Hash)>] EnvelopeTemplateResults data, response status code and response headers
    def list_templates_with_http_info(account_id, options = DocuSign_eSign::ListTemplatesOptions.default)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: TemplatesApi.list_templates ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling TemplatesApi.list_templates" if account_id.nil?
      # resource path
      local_var_path = "/v2.1/accounts/{accountId}/templates".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s)

      # query parameters
      query_params = {}
      query_params[:'count'] = options.count if !options.count.nil?
      query_params[:'created_from_date'] = options.created_from_date if !options.created_from_date.nil?
      query_params[:'created_to_date'] = options.created_to_date if !options.created_to_date.nil?
      query_params[:'folder_ids'] = options.folder_ids if !options.folder_ids.nil?
      query_params[:'folder_types'] = options.folder_types if !options.folder_types.nil?
      query_params[:'from_date'] = options.from_date if !options.from_date.nil?
      query_params[:'include'] = options.include if !options.include.nil?
      query_params[:'is_deleted_template_only'] = options.is_deleted_template_only if !options.is_deleted_template_only.nil?
      query_params[:'is_download'] = options.is_download if !options.is_download.nil?
      query_params[:'modified_from_date'] = options.modified_from_date if !options.modified_from_date.nil?
      query_params[:'modified_to_date'] = options.modified_to_date if !options.modified_to_date.nil?
      query_params[:'order'] = options.order if !options.order.nil?
      query_params[:'order_by'] = options.order_by if !options.order_by.nil?
      query_params[:'search_fields'] = options.search_fields if !options.search_fields.nil?
      query_params[:'search_text'] = options.search_text if !options.search_text.nil?
      query_params[:'shared_by_me'] = options.shared_by_me if !options.shared_by_me.nil?
      query_params[:'start_position'] = options.start_position if !options.start_position.nil?
      query_params[:'template_ids'] = options.template_ids if !options.template_ids.nil?
      query_params[:'to_date'] = options.to_date if !options.to_date.nil?
      query_params[:'used_from_date'] = options.used_from_date if !options.used_from_date.nil?
      query_params[:'used_to_date'] = options.used_to_date if !options.used_to_date.nil?
      query_params[:'user_filter'] = options.user_filter if !options.user_filter.nil?
      query_params[:'user_id'] = options.user_id if !options.user_id.nil?

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = []
      data, status_code, headers = @api_client.call_api(:GET, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'EnvelopeTemplateResults')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TemplatesApi#list_templates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Rotates page image from a template for display.
    # Rotates page image from a template for display. The page image can be rotated to the left or right.
    # @param account_id The external account number (int) or account ID Guid.
    # @param document_id The ID of the document being accessed.
    # @param page_number The page number being accessed.
    # @param template_id The ID of the template being accessed.
    # @param page_request  (optional parameter)
    # @return [nil]
    def rotate_document_page(account_id, document_id, page_number, template_id, page_request)
      rotate_document_page_with_http_info(account_id, document_id, page_number, template_id,  page_request)
      return nil
    end

    # Rotates page image from a template for display.
    # Rotates page image from a template for display. The page image can be rotated to the left or right.
    # @param account_id The external account number (int) or account ID Guid.
    # @param document_id The ID of the document being accessed.
    # @param page_number The page number being accessed.
    # @param template_id The ID of the template being accessed.
    # @param page_request  (optional parameter)
    # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
    def rotate_document_page_with_http_info(account_id, document_id, page_number, template_id, page_request)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: TemplatesApi.rotate_document_page ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling TemplatesApi.rotate_document_page" if account_id.nil?
      # verify the required parameter 'document_id' is set
      fail ArgumentError, "Missing the required parameter 'document_id' when calling TemplatesApi.rotate_document_page" if document_id.nil?
      # verify the required parameter 'page_number' is set
      fail ArgumentError, "Missing the required parameter 'page_number' when calling TemplatesApi.rotate_document_page" if page_number.nil?
      # verify the required parameter 'template_id' is set
      fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplatesApi.rotate_document_page" if template_id.nil?
      # resource path
      local_var_path = "/v2.1/accounts/{accountId}/templates/{templateId}/documents/{documentId}/pages/{pageNumber}/page_image".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'documentId' + '}', document_id.to_s).sub('{' + 'pageNumber' + '}', page_number.to_s).sub('{' + 'templateId' + '}', template_id.to_s)

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = @api_client.object_to_http_body(page_request)
      auth_names = []
      data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TemplatesApi#rotate_document_page\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Updates an existing template.
    # Updates an existing template.
    # @param account_id The external account number (int) or account ID Guid.
    # @param template_id The ID of the template being accessed.
    # @param envelope_template  (optional parameter)
    # @return [TemplateUpdateSummary]
    def update(account_id, template_id, envelope_template)
      data, _status_code, _headers = update_with_http_info(account_id, template_id,  envelope_template)
      return data
    end

    # Updates an existing template.
    # Updates an existing template.
    # @param account_id The external account number (int) or account ID Guid.
    # @param template_id The ID of the template being accessed.
    # @param envelope_template  (optional parameter)
    # @return [Array<(TemplateUpdateSummary, Fixnum, Hash)>] TemplateUpdateSummary data, response status code and response headers
    def update_with_http_info(account_id, template_id, envelope_template)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: TemplatesApi.update ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling TemplatesApi.update" if account_id.nil?
      # verify the required parameter 'template_id' is set
      fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplatesApi.update" if template_id.nil?
      # resource path
      local_var_path = "/v2.1/accounts/{accountId}/templates/{templateId}".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'templateId' + '}', template_id.to_s)

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = @api_client.object_to_http_body(envelope_template)
      auth_names = []
      data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'TemplateUpdateSummary')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TemplatesApi#update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Updates envelope custom fields in a template.
    # Updates the custom fields in a template.  Each custom field used in a template must have a unique name.
    # @param account_id The external account number (int) or account ID Guid.
    # @param template_id The ID of the template being accessed.
    # @param template_custom_fields  (optional parameter)
    # @return [CustomFields]
    def update_custom_fields(account_id, template_id, template_custom_fields)
      data, _status_code, _headers = update_custom_fields_with_http_info(account_id, template_id,  template_custom_fields)
      return data
    end

    # Updates envelope custom fields in a template.
    # Updates the custom fields in a template.  Each custom field used in a template must have a unique name.
    # @param account_id The external account number (int) or account ID Guid.
    # @param template_id The ID of the template being accessed.
    # @param template_custom_fields  (optional parameter)
    # @return [Array<(CustomFields, Fixnum, Hash)>] CustomFields data, response status code and response headers
    def update_custom_fields_with_http_info(account_id, template_id, template_custom_fields)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: TemplatesApi.update_custom_fields ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling TemplatesApi.update_custom_fields" if account_id.nil?
      # verify the required parameter 'template_id' is set
      fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplatesApi.update_custom_fields" if template_id.nil?
      # resource path
      local_var_path = "/v2.1/accounts/{accountId}/templates/{templateId}/custom_fields".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'templateId' + '}', template_id.to_s)

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = @api_client.object_to_http_body(template_custom_fields)
      auth_names = []
      data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'CustomFields')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TemplatesApi#update_custom_fields\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Adds a document to a template document.
    # Adds the specified document to an existing template document.
    # @param account_id The external account number (int) or account ID Guid.
    # @param document_id The ID of the document being accessed.
    # @param template_id The ID of the template being accessed.
    # @param envelope_definition  (optional parameter)
    # @param DocuSign_eSign::UpdateDocumentOptions Options for modifying the behavior of the function.
    # @return [EnvelopeDocument]
    def update_document(account_id, document_id, template_id, envelope_definition, options = DocuSign_eSign::UpdateDocumentOptions.default)
      data, _status_code, _headers = update_document_with_http_info(account_id, document_id, template_id,  envelope_definition, options)
      return data
    end

    # Adds a document to a template document.
    # Adds the specified document to an existing template document.
    # @param account_id The external account number (int) or account ID Guid.
    # @param document_id The ID of the document being accessed.
    # @param template_id The ID of the template being accessed.
    # @param envelope_definition  (optional parameter)
    # @param DocuSign_eSign::UpdateDocumentOptions Options for modifying the behavior of the function.
    # @return [Array<(EnvelopeDocument, Fixnum, Hash)>] EnvelopeDocument data, response status code and response headers
    def update_document_with_http_info(account_id, document_id, template_id, envelope_definition, options = DocuSign_eSign::UpdateDocumentOptions.default)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: TemplatesApi.update_document ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling TemplatesApi.update_document" if account_id.nil?
      # verify the required parameter 'document_id' is set
      fail ArgumentError, "Missing the required parameter 'document_id' when calling TemplatesApi.update_document" if document_id.nil?
      # verify the required parameter 'template_id' is set
      fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplatesApi.update_document" if template_id.nil?
      # resource path
      local_var_path = "/v2.1/accounts/{accountId}/templates/{templateId}/documents/{documentId}".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'documentId' + '}', document_id.to_s).sub('{' + 'templateId' + '}', template_id.to_s)

      # query parameters
      query_params = {}
      query_params[:'is_envelope_definition'] = options.is_envelope_definition if !options.is_envelope_definition.nil?

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = @api_client.object_to_http_body(envelope_definition)
      auth_names = []
      data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'EnvelopeDocument')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TemplatesApi#update_document\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Updates existing custom document fields in an existing template document.
    # Updates existing custom document fields in an existing template document.
    # @param account_id The external account number (int) or account ID Guid.
    # @param document_id The ID of the document being accessed.
    # @param template_id The ID of the template being accessed.
    # @param document_fields_information  (optional parameter)
    # @return [DocumentFieldsInformation]
    def update_document_fields(account_id, document_id, template_id, document_fields_information)
      data, _status_code, _headers = update_document_fields_with_http_info(account_id, document_id, template_id,  document_fields_information)
      return data
    end

    # Updates existing custom document fields in an existing template document.
    # Updates existing custom document fields in an existing template document.
    # @param account_id The external account number (int) or account ID Guid.
    # @param document_id The ID of the document being accessed.
    # @param template_id The ID of the template being accessed.
    # @param document_fields_information  (optional parameter)
    # @return [Array<(DocumentFieldsInformation, Fixnum, Hash)>] DocumentFieldsInformation data, response status code and response headers
    def update_document_fields_with_http_info(account_id, document_id, template_id, document_fields_information)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: TemplatesApi.update_document_fields ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling TemplatesApi.update_document_fields" if account_id.nil?
      # verify the required parameter 'document_id' is set
      fail ArgumentError, "Missing the required parameter 'document_id' when calling TemplatesApi.update_document_fields" if document_id.nil?
      # verify the required parameter 'template_id' is set
      fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplatesApi.update_document_fields" if template_id.nil?
      # resource path
      local_var_path = "/v2.1/accounts/{accountId}/templates/{templateId}/documents/{documentId}/fields".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'documentId' + '}', document_id.to_s).sub('{' + 'templateId' + '}', template_id.to_s)

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = @api_client.object_to_http_body(document_fields_information)
      auth_names = []
      data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'DocumentFieldsInformation')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TemplatesApi#update_document_fields\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Adds documents to a template document.
    # Adds one or more documents to an existing template document.
    # @param account_id The external account number (int) or account ID Guid.
    # @param template_id The ID of the template being accessed.
    # @param envelope_definition  (optional parameter)
    # @return [TemplateDocumentsResult]
    def update_documents(account_id, template_id, envelope_definition)
      data, _status_code, _headers = update_documents_with_http_info(account_id, template_id,  envelope_definition)
      return data
    end

    # Adds documents to a template document.
    # Adds one or more documents to an existing template document.
    # @param account_id The external account number (int) or account ID Guid.
    # @param template_id The ID of the template being accessed.
    # @param envelope_definition  (optional parameter)
    # @return [Array<(TemplateDocumentsResult, Fixnum, Hash)>] TemplateDocumentsResult data, response status code and response headers
    def update_documents_with_http_info(account_id, template_id, envelope_definition)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: TemplatesApi.update_documents ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling TemplatesApi.update_documents" if account_id.nil?
      # verify the required parameter 'template_id' is set
      fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplatesApi.update_documents" if template_id.nil?
      # resource path
      local_var_path = "/v2.1/accounts/{accountId}/templates/{templateId}/documents".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'templateId' + '}', template_id.to_s)

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = @api_client.object_to_http_body(envelope_definition)
      auth_names = []
      data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'TemplateDocumentsResult')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TemplatesApi#update_documents\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Shares a template with a group
    # Shares a template with the specified members group.
    # @param account_id The external account number (int) or account ID Guid.
    # @param template_id The ID of the template being accessed.
    # @param template_part Currently, the only defined part is **groups**.
    # @param group_information  (optional parameter)
    # @return [GroupInformation]
    def update_group_share(account_id, template_id, template_part, group_information)
      data, _status_code, _headers = update_group_share_with_http_info(account_id, template_id, template_part,  group_information)
      return data
    end

    # Shares a template with a group
    # Shares a template with the specified members group.
    # @param account_id The external account number (int) or account ID Guid.
    # @param template_id The ID of the template being accessed.
    # @param template_part Currently, the only defined part is **groups**.
    # @param group_information  (optional parameter)
    # @return [Array<(GroupInformation, Fixnum, Hash)>] GroupInformation data, response status code and response headers
    def update_group_share_with_http_info(account_id, template_id, template_part, group_information)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: TemplatesApi.update_group_share ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling TemplatesApi.update_group_share" if account_id.nil?
      # verify the required parameter 'template_id' is set
      fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplatesApi.update_group_share" if template_id.nil?
      # verify the required parameter 'template_part' is set
      fail ArgumentError, "Missing the required parameter 'template_part' when calling TemplatesApi.update_group_share" if template_part.nil?
      # resource path
      local_var_path = "/v2.1/accounts/{accountId}/templates/{templateId}/{templatePart}".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'templateId' + '}', template_id.to_s).sub('{' + 'templatePart' + '}', template_part.to_s)

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = @api_client.object_to_http_body(group_information)
      auth_names = []
      data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'GroupInformation')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TemplatesApi#update_group_share\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Updates a template lock.
    # Updates the lock duration time or update the `lockedByApp` property information for the specified template. The user and integrator key must match the user specified by the `lockByUser` property and integrator key information and the `X-DocuSign-Edit` header must be included or an error will be generated.
    # @param account_id The external account number (int) or account ID Guid.
    # @param template_id The ID of the template being accessed.
    # @param lock_request  (optional parameter)
    # @return [LockInformation]
    def update_lock(account_id, template_id, lock_request)
      data, _status_code, _headers = update_lock_with_http_info(account_id, template_id,  lock_request)
      return data
    end

    # Updates a template lock.
    # Updates the lock duration time or update the &#x60;lockedByApp&#x60; property information for the specified template. The user and integrator key must match the user specified by the &#x60;lockByUser&#x60; property and integrator key information and the &#x60;X-DocuSign-Edit&#x60; header must be included or an error will be generated.
    # @param account_id The external account number (int) or account ID Guid.
    # @param template_id The ID of the template being accessed.
    # @param lock_request  (optional parameter)
    # @return [Array<(LockInformation, Fixnum, Hash)>] LockInformation data, response status code and response headers
    def update_lock_with_http_info(account_id, template_id, lock_request)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: TemplatesApi.update_lock ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling TemplatesApi.update_lock" if account_id.nil?
      # verify the required parameter 'template_id' is set
      fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplatesApi.update_lock" if template_id.nil?
      # resource path
      local_var_path = "/v2.1/accounts/{accountId}/templates/{templateId}/lock".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'templateId' + '}', template_id.to_s)

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = @api_client.object_to_http_body(lock_request)
      auth_names = []
      data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'LockInformation')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TemplatesApi#update_lock\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Updates the notification  structure for an existing template.
    # Updates the notification structure for an existing template. Use this endpoint to set reminder and expiration notifications.
    # @param account_id The external account number (int) or account ID Guid.
    # @param template_id The ID of the template being accessed.
    # @param template_notification_request  (optional parameter)
    # @return [Notification]
    def update_notification_settings(account_id, template_id, template_notification_request)
      data, _status_code, _headers = update_notification_settings_with_http_info(account_id, template_id,  template_notification_request)
      return data
    end

    # Updates the notification  structure for an existing template.
    # Updates the notification structure for an existing template. Use this endpoint to set reminder and expiration notifications.
    # @param account_id The external account number (int) or account ID Guid.
    # @param template_id The ID of the template being accessed.
    # @param template_notification_request  (optional parameter)
    # @return [Array<(Notification, Fixnum, Hash)>] Notification data, response status code and response headers
    def update_notification_settings_with_http_info(account_id, template_id, template_notification_request)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: TemplatesApi.update_notification_settings ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling TemplatesApi.update_notification_settings" if account_id.nil?
      # verify the required parameter 'template_id' is set
      fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplatesApi.update_notification_settings" if template_id.nil?
      # resource path
      local_var_path = "/v2.1/accounts/{accountId}/templates/{templateId}/notification".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'templateId' + '}', template_id.to_s)

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = @api_client.object_to_http_body(template_notification_request)
      auth_names = []
      data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'Notification')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TemplatesApi#update_notification_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Updates recipients in a template.
    # Updates recipients in a template.   You can edit the following properties: `email`, `userName`, `routingOrder`, `faxNumber`, `deliveryMethod`, `accessCode`, and `requireIdLookup`.
    # @param account_id The external account number (int) or account ID Guid.
    # @param template_id The ID of the template being accessed.
    # @param template_recipients  (optional parameter)
    # @param DocuSign_eSign::UpdateRecipientsOptions Options for modifying the behavior of the function.
    # @return [RecipientsUpdateSummary]
    def update_recipients(account_id, template_id, template_recipients, options = DocuSign_eSign::UpdateRecipientsOptions.default)
      data, _status_code, _headers = update_recipients_with_http_info(account_id, template_id,  template_recipients, options)
      return data
    end

    # Updates recipients in a template.
    # Updates recipients in a template.   You can edit the following properties: &#x60;email&#x60;, &#x60;userName&#x60;, &#x60;routingOrder&#x60;, &#x60;faxNumber&#x60;, &#x60;deliveryMethod&#x60;, &#x60;accessCode&#x60;, and &#x60;requireIdLookup&#x60;.
    # @param account_id The external account number (int) or account ID Guid.
    # @param template_id The ID of the template being accessed.
    # @param template_recipients  (optional parameter)
    # @param DocuSign_eSign::UpdateRecipientsOptions Options for modifying the behavior of the function.
    # @return [Array<(RecipientsUpdateSummary, Fixnum, Hash)>] RecipientsUpdateSummary data, response status code and response headers
    def update_recipients_with_http_info(account_id, template_id, template_recipients, options = DocuSign_eSign::UpdateRecipientsOptions.default)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: TemplatesApi.update_recipients ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling TemplatesApi.update_recipients" if account_id.nil?
      # verify the required parameter 'template_id' is set
      fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplatesApi.update_recipients" if template_id.nil?
      # resource path
      local_var_path = "/v2.1/accounts/{accountId}/templates/{templateId}/recipients".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'templateId' + '}', template_id.to_s)

      # query parameters
      query_params = {}
      query_params[:'resend_envelope'] = options.resend_envelope if !options.resend_envelope.nil?

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = @api_client.object_to_http_body(template_recipients)
      auth_names = []
      data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'RecipientsUpdateSummary')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TemplatesApi#update_recipients\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Updates the tabs for a recipient.
    # Updates one or more tabs for a recipient in a template.
    # @param account_id The external account number (int) or account ID Guid.
    # @param recipient_id The ID of the recipient being accessed.
    # @param template_id The ID of the template being accessed.
    # @param template_tabs  (optional parameter)
    # @return [Tabs]
    def update_tabs(account_id, recipient_id, template_id, template_tabs)
      data, _status_code, _headers = update_tabs_with_http_info(account_id, recipient_id, template_id,  template_tabs)
      return data
    end

    # Updates the tabs for a recipient.
    # Updates one or more tabs for a recipient in a template.
    # @param account_id The external account number (int) or account ID Guid.
    # @param recipient_id The ID of the recipient being accessed.
    # @param template_id The ID of the template being accessed.
    # @param template_tabs  (optional parameter)
    # @return [Array<(Tabs, Fixnum, Hash)>] Tabs data, response status code and response headers
    def update_tabs_with_http_info(account_id, recipient_id, template_id, template_tabs)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: TemplatesApi.update_tabs ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling TemplatesApi.update_tabs" if account_id.nil?
      # verify the required parameter 'recipient_id' is set
      fail ArgumentError, "Missing the required parameter 'recipient_id' when calling TemplatesApi.update_tabs" if recipient_id.nil?
      # verify the required parameter 'template_id' is set
      fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplatesApi.update_tabs" if template_id.nil?
      # resource path
      local_var_path = "/v2.1/accounts/{accountId}/templates/{templateId}/recipients/{recipientId}/tabs".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'recipientId' + '}', recipient_id.to_s).sub('{' + 'templateId' + '}', template_id.to_s)

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = @api_client.object_to_http_body(template_tabs)
      auth_names = []
      data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'Tabs')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TemplatesApi#update_tabs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Updates the tabs for a template
    # Updates tabs in the document specified by `documentId` in the template specified by `templateId`. 
    # @param account_id The external account number (int) or account ID Guid.
    # @param document_id The ID of the document being accessed.
    # @param template_id The ID of the template being accessed.
    # @param template_tabs  (optional parameter)
    # @return [Tabs]
    def update_template_document_tabs(account_id, document_id, template_id, template_tabs)
      data, _status_code, _headers = update_template_document_tabs_with_http_info(account_id, document_id, template_id,  template_tabs)
      return data
    end

    # Updates the tabs for a template
    # Updates tabs in the document specified by &#x60;documentId&#x60; in the template specified by &#x60;templateId&#x60;. 
    # @param account_id The external account number (int) or account ID Guid.
    # @param document_id The ID of the document being accessed.
    # @param template_id The ID of the template being accessed.
    # @param template_tabs  (optional parameter)
    # @return [Array<(Tabs, Fixnum, Hash)>] Tabs data, response status code and response headers
    def update_template_document_tabs_with_http_info(account_id, document_id, template_id, template_tabs)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: TemplatesApi.update_template_document_tabs ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling TemplatesApi.update_template_document_tabs" if account_id.nil?
      # verify the required parameter 'document_id' is set
      fail ArgumentError, "Missing the required parameter 'document_id' when calling TemplatesApi.update_template_document_tabs" if document_id.nil?
      # verify the required parameter 'template_id' is set
      fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplatesApi.update_template_document_tabs" if template_id.nil?
      # resource path
      local_var_path = "/v2.1/accounts/{accountId}/templates/{templateId}/documents/{documentId}/tabs".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'documentId' + '}', document_id.to_s).sub('{' + 'templateId' + '}', template_id.to_s)

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = @api_client.object_to_http_body(template_tabs)
      auth_names = []
      data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'Tabs')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TemplatesApi#update_template_document_tabs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Update template autoMatch setting.
    # 
    # @param account_id The external account number (int) or account ID Guid.
    # @param template_auto_match_list  (optional parameter)
    # @return [TemplateAutoMatchList]
    def update_templates(account_id, template_auto_match_list)
      data, _status_code, _headers = update_templates_with_http_info(account_id,  template_auto_match_list)
      return data
    end

    # Update template autoMatch setting.
    # 
    # @param account_id The external account number (int) or account ID Guid.
    # @param template_auto_match_list  (optional parameter)
    # @return [Array<(TemplateAutoMatchList, Fixnum, Hash)>] TemplateAutoMatchList data, response status code and response headers
    def update_templates_with_http_info(account_id, template_auto_match_list)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: TemplatesApi.update_templates ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling TemplatesApi.update_templates" if account_id.nil?
      # resource path
      local_var_path = "/v2.1/accounts/{accountId}/templates".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s)

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = @api_client.object_to_http_body(template_auto_match_list)
      auth_names = []
      data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'TemplateAutoMatchList')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TemplatesApi#update_templates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Update template autoMatch setting.
    # 
    # @param account_id The external account number (int) or account ID Guid.
    # @param template_auto_match_list  (optional parameter)
    # @return [TemplateAutoMatchList]
    def update_templates_auto_match(account_id, template_auto_match_list)
      data, _status_code, _headers = update_templates_auto_match_with_http_info(account_id,  template_auto_match_list)
      return data
    end

    # Update template autoMatch setting.
    # 
    # @param account_id The external account number (int) or account ID Guid.
    # @param template_auto_match_list  (optional parameter)
    # @return [Array<(TemplateAutoMatchList, Fixnum, Hash)>] TemplateAutoMatchList data, response status code and response headers
    def update_templates_auto_match_with_http_info(account_id, template_auto_match_list)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: TemplatesApi.update_templates_auto_match ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling TemplatesApi.update_templates_auto_match" if account_id.nil?
      # resource path
      local_var_path = "/v2.1/accounts/{accountId}/templates/auto_match".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s)

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = @api_client.object_to_http_body(template_auto_match_list)
      auth_names = []
      data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'TemplateAutoMatchList')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TemplatesApi#update_templates_auto_match\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
  end
end