Class: DocuSign_WebForms::FormManagementApi
- Inherits:
-
Object
- Object
- DocuSign_WebForms::FormManagementApi
- Defined in:
- lib/docusign_webforms/api/form_management_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#get_form(account_id, form_id, options = DocuSign_WebForms::GetFormOptions.default) ⇒ WebForm
Get Form Retrieves form information filter by form id and state.
-
#get_form_with_http_info(account_id, form_id, options = DocuSign_WebForms::GetFormOptions.default) ⇒ Array<(WebForm, Fixnum, Hash)>
Get Form Retrieves form information filter by form id and state.
-
#initialize(api_client = FormManagementApi.default) ⇒ FormManagementApi
constructor
A new instance of FormManagementApi.
-
#list_forms(account_id, options = DocuSign_WebForms::ListFormsOptions.default) ⇒ WebFormSummaryList
List Forms List all the forms for the active user that can be in an active or draft state.
-
#list_forms_with_http_info(account_id, options = DocuSign_WebForms::ListFormsOptions.default) ⇒ Array<(WebFormSummaryList, Fixnum, Hash)>
List Forms List all the forms for the active user that can be in an active or draft state.
Constructor Details
#initialize(api_client = FormManagementApi.default) ⇒ FormManagementApi
Returns a new instance of FormManagementApi.
56 57 58 |
# File 'lib/docusign_webforms/api/form_management_api.rb', line 56 def initialize(api_client = FormManagementApi.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
54 55 56 |
# File 'lib/docusign_webforms/api/form_management_api.rb', line 54 def api_client @api_client end |
Instance Method Details
#get_form(account_id, form_id, options = DocuSign_WebForms::GetFormOptions.default) ⇒ WebForm
Get Form Retrieves form information filter by form id and state. The ‘state` parameter is optional and can accept value from `draft, active`.
66 67 68 69 |
# File 'lib/docusign_webforms/api/form_management_api.rb', line 66 def get_form(account_id, form_id, = DocuSign_WebForms::GetFormOptions.default) data, _status_code, _headers = get_form_with_http_info(account_id, form_id, ) return data end |
#get_form_with_http_info(account_id, form_id, options = DocuSign_WebForms::GetFormOptions.default) ⇒ Array<(WebForm, Fixnum, Hash)>
Get Form Retrieves form information filter by form id and state. The `state` parameter is optional and can accept value from `draft, active`.
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
# File 'lib/docusign_webforms/api/form_management_api.rb', line 77 def get_form_with_http_info(account_id, form_id, = 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 .state && !['active', 'draft'].include?(.state) fail ArgumentError, 'invalid value for "state", must be one of active, draft' end if !.state.nil? && .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'] = .state if !.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(account_id, options = DocuSign_WebForms::ListFormsOptions.default) ⇒ WebFormSummaryList
List Forms List all the forms for the active user that can be in an active or draft state
130 131 132 133 |
# File 'lib/docusign_webforms/api/form_management_api.rb', line 130 def list_forms(account_id, = DocuSign_WebForms::ListFormsOptions.default) data, _status_code, _headers = list_forms_with_http_info(account_id, ) return data end |
#list_forms_with_http_info(account_id, options = DocuSign_WebForms::ListFormsOptions.default) ⇒ Array<(WebFormSummaryList, Fixnum, Hash)>
List Forms List all the forms for the active user that can be in an active or draft state
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 |
# File 'lib/docusign_webforms/api/form_management_api.rb', line 140 def list_forms_with_http_info(account_id, = 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 .user_filter && !['owned_by_me', 'all'].include?(.user_filter) fail ArgumentError, 'invalid value for "user_filter", must be one of owned_by_me, all' end if !.sort_by.nil? && .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'] = .user_filter if !.user_filter.nil? query_params[:'is_standalone'] = .is_standalone if !.is_standalone.nil? query_params[:'is_published'] = .is_published if !.is_published.nil? query_params[:'sort_by'] = .sort_by if !.sort_by.nil? query_params[:'search'] = .search if !.search.nil? query_params[:'start_position'] = .start_position if !.start_position.nil? query_params[:'count'] = .count if !.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 |