=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 GetPowerFormDataOptions
    # 
    attr_accessor :data_layout

    # 
    attr_accessor :from_date

    # 
    attr_accessor :to_date

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

  class ListPowerFormSendersOptions
    # 
    attr_accessor :start_position

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

  class ListPowerFormsOptions
    # 
    attr_accessor :count

    # 
    attr_accessor :from_date

    # 
    attr_accessor :order

    # 
    attr_accessor :order_by

    # 
    attr_accessor :search_fields

    # 
    attr_accessor :search_text

    # 
    attr_accessor :start_position

    # 
    attr_accessor :to_date

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


  class PowerFormsApi
    attr_accessor :api_client

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

    # Creates a new PowerForm.
    # This method creates a new PowerForm.  You create a PowerForm from an existing DocuSign [template](/docs/esign-rest-api/reference/templates/templates/create/), based on the `templateId` in the request body.   PowerForms that you create from a template are referred to as *web PowerForms*.  **Note:** The DocuSign Admin console also supports creating a PowerForm by uploading a PDF file that has active form fields (referred to as a *PDF PowerForm*). However, PDF PowerForms are deprecated and are not supported in the API.  **Note:** A PowerForm can have only one sender. (Because PowerForms are not necessarily sent by email, this user is also referred to as the PowerForm *initiator*.) If you need to associate multiple senders with a PowerForm, create multiple copies of the PowerForm by using the same template (one copy for each sender). By default, the sender is the PowerForm Administrator who creates the PowerForm.   ### Signing modes  You can use one of the following signing modes for a PowerForm:  **`email`**  This mode verifies the recipient's identity by using email authentication before the recipient can sign a document. The recipient enters their email address on the landing page and then clicks **Begin Signing** to begin the signing process. The system then sends an email message with a validation code to the recipient. If the recipient does not provide a valid email address, they do not receive the email message containing the access code and are not able to open and sign the document.  Alternatively, you can make the process easier for signers by using email authentication only and omitting the access code. To do this, you append the `activateonly` flag to the PowerForm URL and set it to true by passing in the value `1`.  When the flag is active, the first recipient receives an email with a link that initiates the signing session without having to enter access code.  Example: `activateonly=1`  **`direct`**  This mode does not require any verification. After a recipient enters their email address on the landing page and clicks **Begin Signing,** a new browser tab opens and the recipient can immediately begin the signing process.  Because the `direct` signing mode does not verify the recipient's identity by using email authentication, we strongly recommend that you use this mode only when the PowerForm is accessible behind a secure portal where the recipient's identity is already authenticated, or where another form of authentication is specified for the recipient in the DocuSign template (for example, an access code, phone authentication, or ID check).  **Note:** In the account settings, `enablePowerFormDirect` must be **true** to use `direct` as the `signingMode`.  ### Redirect URLs  You can control the URL to which signers are redirected after signing your PowerForm. However, the URL is specified elsewhere, outside of the PowerForm creation process. For details, see [How do I specify a URL to redirect to when a PowerForm is completed?](https://support.docusign.com/en/articles/How-do-I-specify-a-URL-to-redirect-to-when-a-Powerform-is-completed).  ### More information  For more information about creating PowerForms, see [Create a PowerForm](https://support.docusign.com/en/guides/ndse-user-guide-create-a-powerform).  
    # @param account_id The external account number (int) or account ID Guid.
    # @param power_form  (optional parameter)
    # @return [PowerForm]
    def create_power_form(account_id, power_form)
      data, _status_code, _headers = create_power_form_with_http_info(account_id,  power_form)
      return data
    end

    # Creates a new PowerForm.
    # This method creates a new PowerForm.  You create a PowerForm from an existing DocuSign [template](/docs/esign-rest-api/reference/templates/templates/create/), based on the &#x60;templateId&#x60; in the request body.   PowerForms that you create from a template are referred to as *web PowerForms*.  **Note:** The DocuSign Admin console also supports creating a PowerForm by uploading a PDF file that has active form fields (referred to as a *PDF PowerForm*). However, PDF PowerForms are deprecated and are not supported in the API.  **Note:** A PowerForm can have only one sender. (Because PowerForms are not necessarily sent by email, this user is also referred to as the PowerForm *initiator*.) If you need to associate multiple senders with a PowerForm, create multiple copies of the PowerForm by using the same template (one copy for each sender). By default, the sender is the PowerForm Administrator who creates the PowerForm.   ### Signing modes  You can use one of the following signing modes for a PowerForm:  **&#x60;email&#x60;**  This mode verifies the recipient&#39;s identity by using email authentication before the recipient can sign a document. The recipient enters their email address on the landing page and then clicks **Begin Signing** to begin the signing process. The system then sends an email message with a validation code to the recipient. If the recipient does not provide a valid email address, they do not receive the email message containing the access code and are not able to open and sign the document.  Alternatively, you can make the process easier for signers by using email authentication only and omitting the access code. To do this, you append the &#x60;activateonly&#x60; flag to the PowerForm URL and set it to true by passing in the value &#x60;1&#x60;.  When the flag is active, the first recipient receives an email with a link that initiates the signing session without having to enter access code.  Example: &#x60;activateonly&#x3D;1&#x60;  **&#x60;direct&#x60;**  This mode does not require any verification. After a recipient enters their email address on the landing page and clicks **Begin Signing,** a new browser tab opens and the recipient can immediately begin the signing process.  Because the &#x60;direct&#x60; signing mode does not verify the recipient&#39;s identity by using email authentication, we strongly recommend that you use this mode only when the PowerForm is accessible behind a secure portal where the recipient&#39;s identity is already authenticated, or where another form of authentication is specified for the recipient in the DocuSign template (for example, an access code, phone authentication, or ID check).  **Note:** In the account settings, &#x60;enablePowerFormDirect&#x60; must be **true** to use &#x60;direct&#x60; as the &#x60;signingMode&#x60;.  ### Redirect URLs  You can control the URL to which signers are redirected after signing your PowerForm. However, the URL is specified elsewhere, outside of the PowerForm creation process. For details, see [How do I specify a URL to redirect to when a PowerForm is completed?](https://support.docusign.com/en/articles/How-do-I-specify-a-URL-to-redirect-to-when-a-Powerform-is-completed).  ### More information  For more information about creating PowerForms, see [Create a PowerForm](https://support.docusign.com/en/guides/ndse-user-guide-create-a-powerform).  
    # @param account_id The external account number (int) or account ID Guid.
    # @param power_form  (optional parameter)
    # @return [Array<(PowerForm, Fixnum, Hash)>] PowerForm data, response status code and response headers
    def create_power_form_with_http_info(account_id, power_form)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: PowerFormsApi.create_power_form ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling PowerFormsApi.create_power_form" if account_id.nil?
      # resource path
      local_var_path = "/v2.1/accounts/{accountId}/powerforms".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(power_form)
      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 => 'PowerForm')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: PowerFormsApi#create_power_form\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Delete a PowerForm.
    # This method deletes a PowerForm.
    # @param account_id The external account number (int) or account ID Guid.
    # @param power_form_id 
    # @return [nil]
    def delete_power_form(account_id, power_form_id)
      delete_power_form_with_http_info(account_id, power_form_id)
      return nil
    end

    # Delete a PowerForm.
    # This method deletes a PowerForm.
    # @param account_id The external account number (int) or account ID Guid.
    # @param power_form_id 
    # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
    def delete_power_form_with_http_info(account_id, power_form_id)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: PowerFormsApi.delete_power_form ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling PowerFormsApi.delete_power_form" if account_id.nil?
      # verify the required parameter 'power_form_id' is set
      fail ArgumentError, "Missing the required parameter 'power_form_id' when calling PowerFormsApi.delete_power_form" if power_form_id.nil?
      # resource path
      local_var_path = "/v2.1/accounts/{accountId}/powerforms/{powerFormId}".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'powerFormId' + '}', power_form_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(: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: PowerFormsApi#delete_power_form\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Deletes one or more PowerForms
    # This method deletes one or more PowerForms. The request body takes an array of PowerForm objects that are deleted based on the `powerFormId`.
    # @param account_id The external account number (int) or account ID Guid.
    # @param power_forms_request  (optional parameter)
    # @return [PowerFormsResponse]
    def delete_power_forms(account_id, power_forms_request)
      data, _status_code, _headers = delete_power_forms_with_http_info(account_id,  power_forms_request)
      return data
    end

    # Deletes one or more PowerForms
    # This method deletes one or more PowerForms. The request body takes an array of PowerForm objects that are deleted based on the &#x60;powerFormId&#x60;.
    # @param account_id The external account number (int) or account ID Guid.
    # @param power_forms_request  (optional parameter)
    # @return [Array<(PowerFormsResponse, Fixnum, Hash)>] PowerFormsResponse data, response status code and response headers
    def delete_power_forms_with_http_info(account_id, power_forms_request)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: PowerFormsApi.delete_power_forms ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling PowerFormsApi.delete_power_forms" if account_id.nil?
      # resource path
      local_var_path = "/v2.1/accounts/{accountId}/powerforms".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(power_forms_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 => 'PowerFormsResponse')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: PowerFormsApi#delete_power_forms\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Returns a single PowerForm.
    # This method returns detailed information about a specific PowerForm.
    # @param account_id The external account number (int) or account ID Guid.
    # @param power_form_id 
    # @return [PowerForm]
    def get_power_form(account_id, power_form_id)
      data, _status_code, _headers = get_power_form_with_http_info(account_id, power_form_id)
      return data
    end

    # Returns a single PowerForm.
    # This method returns detailed information about a specific PowerForm.
    # @param account_id The external account number (int) or account ID Guid.
    # @param power_form_id 
    # @return [Array<(PowerForm, Fixnum, Hash)>] PowerForm data, response status code and response headers
    def get_power_form_with_http_info(account_id, power_form_id)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: PowerFormsApi.get_power_form ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling PowerFormsApi.get_power_form" if account_id.nil?
      # verify the required parameter 'power_form_id' is set
      fail ArgumentError, "Missing the required parameter 'power_form_id' when calling PowerFormsApi.get_power_form" if power_form_id.nil?
      # resource path
      local_var_path = "/v2.1/accounts/{accountId}/powerforms/{powerFormId}".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'powerFormId' + '}', power_form_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 => 'PowerForm')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: PowerFormsApi#get_power_form\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Returns the form data associated with the usage of a PowerForm.
    # This method enables Powerform Administrators or the sender of a PowerForm to download the data that recipients have entered into a PowerForm.  You specify the format in which you want to retrieve the data in the `Accept` header. This header accepts the following values:   - `application/json`: JSON format - `application/xml`: XML format - `text/csv`: Comma-separated value (CSV) format  **Note:** Only PowerForm Administrators or the PowerForm Sender can download the data associated with a PowerForm.
    # @param account_id The external account number (int) or account ID Guid.
    # @param power_form_id 
    # @param DocuSign_eSign::GetPowerFormDataOptions Options for modifying the behavior of the function.
    # @return [PowerFormsFormDataResponse]
    def get_power_form_data(account_id, power_form_id, options = DocuSign_eSign::GetPowerFormDataOptions.default)
      data, _status_code, _headers = get_power_form_data_with_http_info(account_id, power_form_id, options)
      return data
    end

    # Returns the form data associated with the usage of a PowerForm.
    # This method enables Powerform Administrators or the sender of a PowerForm to download the data that recipients have entered into a PowerForm.  You specify the format in which you want to retrieve the data in the &#x60;Accept&#x60; header. This header accepts the following values:   - &#x60;application/json&#x60;: JSON format - &#x60;application/xml&#x60;: XML format - &#x60;text/csv&#x60;: Comma-separated value (CSV) format  **Note:** Only PowerForm Administrators or the PowerForm Sender can download the data associated with a PowerForm.
    # @param account_id The external account number (int) or account ID Guid.
    # @param power_form_id 
    # @param DocuSign_eSign::GetPowerFormDataOptions Options for modifying the behavior of the function.
    # @return [Array<(PowerFormsFormDataResponse, Fixnum, Hash)>] PowerFormsFormDataResponse data, response status code and response headers
    def get_power_form_data_with_http_info(account_id, power_form_id, options = DocuSign_eSign::GetPowerFormDataOptions.default)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: PowerFormsApi.get_power_form_data ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling PowerFormsApi.get_power_form_data" if account_id.nil?
      # verify the required parameter 'power_form_id' is set
      fail ArgumentError, "Missing the required parameter 'power_form_id' when calling PowerFormsApi.get_power_form_data" if power_form_id.nil?
      # resource path
      local_var_path = "/v2.1/accounts/{accountId}/powerforms/{powerFormId}/form_data".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'powerFormId' + '}', power_form_id.to_s)

      # query parameters
      query_params = {}
      query_params[:'data_layout'] = options.data_layout if !options.data_layout.nil?
      query_params[:'from_date'] = options.from_date if !options.from_date.nil?
      query_params[:'to_date'] = options.to_date if !options.to_date.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 => 'PowerFormsFormDataResponse')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: PowerFormsApi#get_power_form_data\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Returns the list of PowerForms available to the user.
    # This method returns a list of users who have sent PowerForms.
    # @param account_id The external account number (int) or account ID Guid.
    # @param DocuSign_eSign::ListPowerFormSendersOptions Options for modifying the behavior of the function.
    # @return [PowerFormSendersResponse]
    def list_power_form_senders(account_id, options = DocuSign_eSign::ListPowerFormSendersOptions.default)
      data, _status_code, _headers = list_power_form_senders_with_http_info(account_id, options)
      return data
    end

    # Returns the list of PowerForms available to the user.
    # This method returns a list of users who have sent PowerForms.
    # @param account_id The external account number (int) or account ID Guid.
    # @param DocuSign_eSign::ListPowerFormSendersOptions Options for modifying the behavior of the function.
    # @return [Array<(PowerFormSendersResponse, Fixnum, Hash)>] PowerFormSendersResponse data, response status code and response headers
    def list_power_form_senders_with_http_info(account_id, options = DocuSign_eSign::ListPowerFormSendersOptions.default)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: PowerFormsApi.list_power_form_senders ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling PowerFormsApi.list_power_form_senders" if account_id.nil?
      # resource path
      local_var_path = "/v2.1/accounts/{accountId}/powerforms/senders".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s)

      # query parameters
      query_params = {}
      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 => 'PowerFormSendersResponse')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: PowerFormsApi#list_power_form_senders\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Returns the list of PowerForms available to the user.
    # This method returns a list of PowerForms that are available to the user.
    # @param account_id The external account number (int) or account ID Guid.
    # @param DocuSign_eSign::ListPowerFormsOptions Options for modifying the behavior of the function.
    # @return [PowerFormsResponse]
    def list_power_forms(account_id, options = DocuSign_eSign::ListPowerFormsOptions.default)
      data, _status_code, _headers = list_power_forms_with_http_info(account_id, options)
      return data
    end

    # Returns the list of PowerForms available to the user.
    # This method returns a list of PowerForms that are available to the user.
    # @param account_id The external account number (int) or account ID Guid.
    # @param DocuSign_eSign::ListPowerFormsOptions Options for modifying the behavior of the function.
    # @return [Array<(PowerFormsResponse, Fixnum, Hash)>] PowerFormsResponse data, response status code and response headers
    def list_power_forms_with_http_info(account_id, options = DocuSign_eSign::ListPowerFormsOptions.default)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: PowerFormsApi.list_power_forms ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling PowerFormsApi.list_power_forms" if account_id.nil?
      # resource path
      local_var_path = "/v2.1/accounts/{accountId}/powerforms".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s)

      # query parameters
      query_params = {}
      query_params[:'count'] = options.count if !options.count.nil?
      query_params[:'from_date'] = options.from_date if !options.from_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[:'start_position'] = options.start_position if !options.start_position.nil?
      query_params[:'to_date'] = options.to_date if !options.to_date.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 => 'PowerFormsResponse')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: PowerFormsApi#list_power_forms\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Creates a new PowerForm.
    # This method updates an existing PowerForm.
    # @param account_id The external account number (int) or account ID Guid.
    # @param power_form_id 
    # @param power_form  (optional parameter)
    # @return [PowerForm]
    def update_power_form(account_id, power_form_id, power_form)
      data, _status_code, _headers = update_power_form_with_http_info(account_id, power_form_id,  power_form)
      return data
    end

    # Creates a new PowerForm.
    # This method updates an existing PowerForm.
    # @param account_id The external account number (int) or account ID Guid.
    # @param power_form_id 
    # @param power_form  (optional parameter)
    # @return [Array<(PowerForm, Fixnum, Hash)>] PowerForm data, response status code and response headers
    def update_power_form_with_http_info(account_id, power_form_id, power_form)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: PowerFormsApi.update_power_form ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling PowerFormsApi.update_power_form" if account_id.nil?
      # verify the required parameter 'power_form_id' is set
      fail ArgumentError, "Missing the required parameter 'power_form_id' when calling PowerFormsApi.update_power_form" if power_form_id.nil?
      # resource path
      local_var_path = "/v2.1/accounts/{accountId}/powerforms/{powerFormId}".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'powerFormId' + '}', power_form_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(power_form)
      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 => 'PowerForm')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: PowerFormsApi#update_power_form\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
  end
end