class DocuSign_WebForms::FormManagementApi
Attributes
Public Class Methods
# File lib/docusign_webforms/api/form_management_api.rb, line 56 def initialize(api_client = FormManagementApi.default) @api_client = api_client end
Public Instance Methods
Get Form Retrieves form information filter by form id and state. The `state` parameter is optional and can accept value from `draft, active`. @param account_id Account identifier in which the web form resides @param form_id Unique identifier for a web form that is consistent for it's lifetime @param DocuSign_WebForms::GetFormOptions Options for modifying the behavior of the function. @return [WebForm]
# File lib/docusign_webforms/api/form_management_api.rb, line 66 def get_form(account_id, form_id, options = DocuSign_WebForms::GetFormOptions.default) data, _status_code, _headers = get_form_with_http_info(account_id, form_id, options) return data end
Get Form Retrieves form information filter by form id and state. The `state` parameter is optional and can accept value from `draft, active`. @param account_id Account identifier in which the web form resides @param form_id Unique identifier for a web form that is consistent for it's lifetime @param DocuSign_WebForms::GetFormOptions Options for modifying the behavior of the function. @return [Array<(WebForm, Fixnum, Hash)>] WebForm data, response status code and response headers
# File lib/docusign_webforms/api/form_management_api.rb, line 77 def get_form_with_http_info(account_id, form_id, options = DocuSign_WebForms::GetFormOptions.default) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: FormManagementApi.get_form ..." end # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling FormManagementApi.get_form" if account_id.nil? # verify the required parameter 'form_id' is set fail ArgumentError, "Missing the required parameter 'form_id' when calling FormManagementApi.get_form" if form_id.nil? if options.state && !['active', 'draft'].include?(options.state) fail ArgumentError, 'invalid value for "state", must be one of active, draft' end if !options.state.nil? && options.state.to_s.length > 15 fail ArgumentError, 'invalid value for "options[:"state"]" when calling FormManagementApi.get_form, the character length must be smaller than or equal to 15.' end # resource path local_var_path = "/v1.1/accounts/{accountId}/forms/{formId}".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'formId' + '}', form_id.to_s) # query parameters query_params = {} query_params[:'state'] = options.state if !options.state.nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['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 => 'WebForm') if @api_client.config.debugging @api_client.config.logger.debug "API called: FormManagementApi#get_form\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
List Forms List all the forms for the active user that can be in an active or draft state @param account_id Account identifier in which the webform resides @param DocuSign_WebForms::ListFormsOptions Options for modifying the behavior of the function. @return [WebFormSummaryList]
# File lib/docusign_webforms/api/form_management_api.rb, line 130 def list_forms(account_id, options = DocuSign_WebForms::ListFormsOptions.default) data, _status_code, _headers = list_forms_with_http_info(account_id, options) return data end
List Forms List all the forms for the active user that can be in an active or draft state @param account_id Account identifier in which the webform resides @param DocuSign_WebForms::ListFormsOptions Options for modifying the behavior of the function. @return [Array<(WebFormSummaryList, Fixnum, Hash)>] WebFormSummaryList data, response status code and response headers
# File lib/docusign_webforms/api/form_management_api.rb, line 140 def list_forms_with_http_info(account_id, options = DocuSign_WebForms::ListFormsOptions.default) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: FormManagementApi.list_forms ..." end # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling FormManagementApi.list_forms" if account_id.nil? if options.user_filter && !['owned_by_me', 'all'].include?(options.user_filter) fail ArgumentError, 'invalid value for "user_filter", must be one of owned_by_me, all' end if !options.sort_by.nil? && options.sort_by.to_s.length > 50 fail ArgumentError, 'invalid value for "options[:"sort_by"]" when calling FormManagementApi.list_forms, the character length must be smaller than or equal to 50.' end # resource path local_var_path = "/v1.1/accounts/{accountId}/forms".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s) # query parameters query_params = {} query_params[:'user_filter'] = options.user_filter if !options.user_filter.nil? query_params[:'is_standalone'] = options.is_standalone if !options.is_standalone.nil? query_params[:'is_published'] = options.is_published if !options.is_published.nil? query_params[:'sort_by'] = options.sort_by if !options.sort_by.nil? query_params[:'search'] = options.search if !options.search.nil? query_params[:'start_position'] = options.start_position if !options.start_position.nil? query_params[:'count'] = options.count if !options.count.nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['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 => 'WebFormSummaryList') if @api_client.config.debugging @api_client.config.logger.debug "API called: FormManagementApi#list_forms\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end