docusign_webforms.apis.form_management_api
Web Forms API version 1.1
The Web Forms API facilitates generating semantic HTML forms around everyday contracts. # noqa: E501
OpenAPI spec version: 1.1.0 Contact: devcenter@docusign.com Generated by: https://github.com/swagger-api/swagger-codegen.git
1# coding: utf-8 2 3""" 4 Web Forms API version 1.1 5 6 The Web Forms API facilitates generating semantic HTML forms around everyday contracts. # noqa: E501 7 8 OpenAPI spec version: 1.1.0 9 Contact: devcenter@docusign.com 10 Generated by: https://github.com/swagger-api/swagger-codegen.git 11""" 12 13 14from __future__ import absolute_import 15 16import sys 17import os 18import re 19 20# python 2 and python 3 compatibility library 21from six import iteritems 22 23from ..client.configuration import Configuration 24from ..client.api_client import ApiClient 25 26 27class FormManagementApi(object): 28 """ 29 NOTE: This class is auto generated by the swagger code generator program. 30 Do not edit the class manually. 31 Ref: https://github.com/swagger-api/swagger-codegen 32 """ 33 34 def __init__(self, api_client=None): 35 config = Configuration() 36 if api_client: 37 self.api_client = api_client 38 else: 39 if not config.api_client: 40 config.api_client = ApiClient() 41 self.api_client = config.api_client 42 43 def get_form(self, account_id, form_id, **kwargs): 44 """ 45 Get Form 46 Retrieves form information filter by form id and state. The `state` parameter is optional and can accept value from `draft, active`. 47 This method makes a synchronous HTTP request by default. To make an 48 asynchronous HTTP request, please define a `callback` function 49 to be invoked when receiving the response. 50 >>> def callback_function(response): 51 >>> pprint(response) 52 >>> 53 >>> thread = api.get_form(account_id, form_id, callback=callback_function) 54 55 :param callback function: The callback function 56 for asynchronous request. (optional) 57 :param str account_id: Account identifier in which the web form resides (required) 58 :param str form_id: Unique identifier for a web form that is consistent for it's lifetime (required) 59 :param str state: The state of the web form configuration 60 :return: WebForm 61 If the method is called asynchronously, 62 returns the request thread. 63 """ 64 kwargs['_return_http_data_only'] = True 65 if kwargs.get('callback'): 66 return self.get_form_with_http_info(account_id, form_id, **kwargs) 67 else: 68 (data) = self.get_form_with_http_info(account_id, form_id, **kwargs) 69 return data 70 71 def get_form_with_http_info(self, account_id, form_id, **kwargs): 72 """ 73 Get Form 74 Retrieves form information filter by form id and state. The `state` parameter is optional and can accept value from `draft, active`. 75 This method makes a synchronous HTTP request by default. To make an 76 asynchronous HTTP request, please define a `callback` function 77 to be invoked when receiving the response. 78 >>> def callback_function(response): 79 >>> pprint(response) 80 >>> 81 >>> thread = api.get_form_with_http_info(account_id, form_id, callback=callback_function) 82 83 :param callback function: The callback function 84 for asynchronous request. (optional) 85 :param str account_id: Account identifier in which the web form resides (required) 86 :param str form_id: Unique identifier for a web form that is consistent for it's lifetime (required) 87 :param str state: The state of the web form configuration 88 :return: WebForm 89 If the method is called asynchronously, 90 returns the request thread. 91 """ 92 93 all_params = ['account_id', 'form_id', 'state'] 94 all_params.append('callback') 95 all_params.append('_return_http_data_only') 96 all_params.append('_preload_content') 97 all_params.append('_request_timeout') 98 99 params = locals() 100 for key, val in iteritems(params['kwargs']): 101 if key not in all_params: 102 raise TypeError( 103 "Got an unexpected keyword argument '%s'" 104 " to method get_form" % key 105 ) 106 params[key] = val 107 del params['kwargs'] 108 # verify the required parameter 'account_id' is set 109 if ('account_id' not in params) or (params['account_id'] is None): 110 raise ValueError("Missing the required parameter `account_id` when calling `get_form`") 111 # verify the required parameter 'form_id' is set 112 if ('form_id' not in params) or (params['form_id'] is None): 113 raise ValueError("Missing the required parameter `form_id` when calling `get_form`") 114 115 if 'state' in params and len(params['state']) > 15: 116 raise ValueError("Invalid value for parameter `state` when calling `get_form`, length must be less than or equal to `15`") 117 118 collection_formats = {} 119 120 resource_path = '/v1.1/accounts/{accountId}/forms/{formId}'.replace('{format}', 'json') 121 path_params = {} 122 if 'account_id' in params: 123 path_params['accountId'] = params['account_id'] 124 if 'form_id' in params: 125 path_params['formId'] = params['form_id'] 126 127 query_params = {} 128 if 'state' in params: 129 query_params['state'] = params['state'] 130 131 header_params = {} 132 133 form_params = [] 134 local_var_files = {} 135 136 body_params = None 137 # HTTP header `Accept` 138 header_params['Accept'] = self.api_client.\ 139 select_header_accept(['application/json']) 140 141 # HTTP header `Content-Type` 142 header_params['Content-Type'] = self.api_client.\ 143 select_header_content_type(['application/json']) 144 145 # Authentication setting 146 auth_settings = [] 147 148 return self.api_client.call_api(resource_path, 'GET', 149 path_params, 150 query_params, 151 header_params, 152 body=body_params, 153 post_params=form_params, 154 files=local_var_files, 155 response_type='WebForm', 156 auth_settings=auth_settings, 157 callback=params.get('callback'), 158 _return_http_data_only=params.get('_return_http_data_only'), 159 _preload_content=params.get('_preload_content', True), 160 _request_timeout=params.get('_request_timeout'), 161 collection_formats=collection_formats) 162 163 def list_forms(self, account_id, **kwargs): 164 """ 165 List Forms 166 List all the forms for the active user that can be in an active or draft state 167 This method makes a synchronous HTTP request by default. To make an 168 asynchronous HTTP request, please define a `callback` function 169 to be invoked when receiving the response. 170 >>> def callback_function(response): 171 >>> pprint(response) 172 >>> 173 >>> thread = api.list_forms(account_id, callback=callback_function) 174 175 :param callback function: The callback function 176 for asynchronous request. (optional) 177 :param str account_id: Account identifier in which the webform resides (required) 178 :param str user_filter: Filter which forms are returned 179 :param bool is_standalone: Is the form a standalone form 180 :param bool is_published: Has the form been published 181 :param str sort_by: Sort result set in mentioned sort property:order. Default is lastModifiedDateTime:desc. Default sort is descending if not mentioned. 182 :param str search: Search through form names 183 :param str start_position: Starting position for desired page of results. 184 :param str count: Number of results to return per page. 185 :return: WebFormSummaryList 186 If the method is called asynchronously, 187 returns the request thread. 188 """ 189 kwargs['_return_http_data_only'] = True 190 if kwargs.get('callback'): 191 return self.list_forms_with_http_info(account_id, **kwargs) 192 else: 193 (data) = self.list_forms_with_http_info(account_id, **kwargs) 194 return data 195 196 def list_forms_with_http_info(self, account_id, **kwargs): 197 """ 198 List Forms 199 List all the forms for the active user that can be in an active or draft state 200 This method makes a synchronous HTTP request by default. To make an 201 asynchronous HTTP request, please define a `callback` function 202 to be invoked when receiving the response. 203 >>> def callback_function(response): 204 >>> pprint(response) 205 >>> 206 >>> thread = api.list_forms_with_http_info(account_id, callback=callback_function) 207 208 :param callback function: The callback function 209 for asynchronous request. (optional) 210 :param str account_id: Account identifier in which the webform resides (required) 211 :param str user_filter: Filter which forms are returned 212 :param bool is_standalone: Is the form a standalone form 213 :param bool is_published: Has the form been published 214 :param str sort_by: Sort result set in mentioned sort property:order. Default is lastModifiedDateTime:desc. Default sort is descending if not mentioned. 215 :param str search: Search through form names 216 :param str start_position: Starting position for desired page of results. 217 :param str count: Number of results to return per page. 218 :return: WebFormSummaryList 219 If the method is called asynchronously, 220 returns the request thread. 221 """ 222 223 all_params = ['account_id', 'user_filter', 'is_standalone', 'is_published', 'sort_by', 'search', 'start_position', 'count'] 224 all_params.append('callback') 225 all_params.append('_return_http_data_only') 226 all_params.append('_preload_content') 227 all_params.append('_request_timeout') 228 229 params = locals() 230 for key, val in iteritems(params['kwargs']): 231 if key not in all_params: 232 raise TypeError( 233 "Got an unexpected keyword argument '%s'" 234 " to method list_forms" % key 235 ) 236 params[key] = val 237 del params['kwargs'] 238 # verify the required parameter 'account_id' is set 239 if ('account_id' not in params) or (params['account_id'] is None): 240 raise ValueError("Missing the required parameter `account_id` when calling `list_forms`") 241 242 if 'sort_by' in params and len(params['sort_by']) > 50: 243 raise ValueError("Invalid value for parameter `sort_by` when calling `list_forms`, length must be less than or equal to `50`") 244 245 collection_formats = {} 246 247 resource_path = '/v1.1/accounts/{accountId}/forms'.replace('{format}', 'json') 248 path_params = {} 249 if 'account_id' in params: 250 path_params['accountId'] = params['account_id'] 251 252 query_params = {} 253 if 'user_filter' in params: 254 query_params['user_filter'] = params['user_filter'] 255 if 'is_standalone' in params: 256 query_params['is_standalone'] = params['is_standalone'] 257 if 'is_published' in params: 258 query_params['is_published'] = params['is_published'] 259 if 'sort_by' in params: 260 query_params['sort_by'] = params['sort_by'] 261 if 'search' in params: 262 query_params['search'] = params['search'] 263 if 'start_position' in params: 264 query_params['start_position'] = params['start_position'] 265 if 'count' in params: 266 query_params['count'] = params['count'] 267 268 header_params = {} 269 270 form_params = [] 271 local_var_files = {} 272 273 body_params = None 274 # HTTP header `Accept` 275 header_params['Accept'] = self.api_client.\ 276 select_header_accept(['application/json']) 277 278 # HTTP header `Content-Type` 279 header_params['Content-Type'] = self.api_client.\ 280 select_header_content_type(['application/json']) 281 282 # Authentication setting 283 auth_settings = [] 284 285 return self.api_client.call_api(resource_path, 'GET', 286 path_params, 287 query_params, 288 header_params, 289 body=body_params, 290 post_params=form_params, 291 files=local_var_files, 292 response_type='WebFormSummaryList', 293 auth_settings=auth_settings, 294 callback=params.get('callback'), 295 _return_http_data_only=params.get('_return_http_data_only'), 296 _preload_content=params.get('_preload_content', True), 297 _request_timeout=params.get('_request_timeout'), 298 collection_formats=collection_formats)
28class FormManagementApi(object): 29 """ 30 NOTE: This class is auto generated by the swagger code generator program. 31 Do not edit the class manually. 32 Ref: https://github.com/swagger-api/swagger-codegen 33 """ 34 35 def __init__(self, api_client=None): 36 config = Configuration() 37 if api_client: 38 self.api_client = api_client 39 else: 40 if not config.api_client: 41 config.api_client = ApiClient() 42 self.api_client = config.api_client 43 44 def get_form(self, account_id, form_id, **kwargs): 45 """ 46 Get Form 47 Retrieves form information filter by form id and state. The `state` parameter is optional and can accept value from `draft, active`. 48 This method makes a synchronous HTTP request by default. To make an 49 asynchronous HTTP request, please define a `callback` function 50 to be invoked when receiving the response. 51 >>> def callback_function(response): 52 >>> pprint(response) 53 >>> 54 >>> thread = api.get_form(account_id, form_id, callback=callback_function) 55 56 :param callback function: The callback function 57 for asynchronous request. (optional) 58 :param str account_id: Account identifier in which the web form resides (required) 59 :param str form_id: Unique identifier for a web form that is consistent for it's lifetime (required) 60 :param str state: The state of the web form configuration 61 :return: WebForm 62 If the method is called asynchronously, 63 returns the request thread. 64 """ 65 kwargs['_return_http_data_only'] = True 66 if kwargs.get('callback'): 67 return self.get_form_with_http_info(account_id, form_id, **kwargs) 68 else: 69 (data) = self.get_form_with_http_info(account_id, form_id, **kwargs) 70 return data 71 72 def get_form_with_http_info(self, account_id, form_id, **kwargs): 73 """ 74 Get Form 75 Retrieves form information filter by form id and state. The `state` parameter is optional and can accept value from `draft, active`. 76 This method makes a synchronous HTTP request by default. To make an 77 asynchronous HTTP request, please define a `callback` function 78 to be invoked when receiving the response. 79 >>> def callback_function(response): 80 >>> pprint(response) 81 >>> 82 >>> thread = api.get_form_with_http_info(account_id, form_id, callback=callback_function) 83 84 :param callback function: The callback function 85 for asynchronous request. (optional) 86 :param str account_id: Account identifier in which the web form resides (required) 87 :param str form_id: Unique identifier for a web form that is consistent for it's lifetime (required) 88 :param str state: The state of the web form configuration 89 :return: WebForm 90 If the method is called asynchronously, 91 returns the request thread. 92 """ 93 94 all_params = ['account_id', 'form_id', 'state'] 95 all_params.append('callback') 96 all_params.append('_return_http_data_only') 97 all_params.append('_preload_content') 98 all_params.append('_request_timeout') 99 100 params = locals() 101 for key, val in iteritems(params['kwargs']): 102 if key not in all_params: 103 raise TypeError( 104 "Got an unexpected keyword argument '%s'" 105 " to method get_form" % key 106 ) 107 params[key] = val 108 del params['kwargs'] 109 # verify the required parameter 'account_id' is set 110 if ('account_id' not in params) or (params['account_id'] is None): 111 raise ValueError("Missing the required parameter `account_id` when calling `get_form`") 112 # verify the required parameter 'form_id' is set 113 if ('form_id' not in params) or (params['form_id'] is None): 114 raise ValueError("Missing the required parameter `form_id` when calling `get_form`") 115 116 if 'state' in params and len(params['state']) > 15: 117 raise ValueError("Invalid value for parameter `state` when calling `get_form`, length must be less than or equal to `15`") 118 119 collection_formats = {} 120 121 resource_path = '/v1.1/accounts/{accountId}/forms/{formId}'.replace('{format}', 'json') 122 path_params = {} 123 if 'account_id' in params: 124 path_params['accountId'] = params['account_id'] 125 if 'form_id' in params: 126 path_params['formId'] = params['form_id'] 127 128 query_params = {} 129 if 'state' in params: 130 query_params['state'] = params['state'] 131 132 header_params = {} 133 134 form_params = [] 135 local_var_files = {} 136 137 body_params = None 138 # HTTP header `Accept` 139 header_params['Accept'] = self.api_client.\ 140 select_header_accept(['application/json']) 141 142 # HTTP header `Content-Type` 143 header_params['Content-Type'] = self.api_client.\ 144 select_header_content_type(['application/json']) 145 146 # Authentication setting 147 auth_settings = [] 148 149 return self.api_client.call_api(resource_path, 'GET', 150 path_params, 151 query_params, 152 header_params, 153 body=body_params, 154 post_params=form_params, 155 files=local_var_files, 156 response_type='WebForm', 157 auth_settings=auth_settings, 158 callback=params.get('callback'), 159 _return_http_data_only=params.get('_return_http_data_only'), 160 _preload_content=params.get('_preload_content', True), 161 _request_timeout=params.get('_request_timeout'), 162 collection_formats=collection_formats) 163 164 def list_forms(self, account_id, **kwargs): 165 """ 166 List Forms 167 List all the forms for the active user that can be in an active or draft state 168 This method makes a synchronous HTTP request by default. To make an 169 asynchronous HTTP request, please define a `callback` function 170 to be invoked when receiving the response. 171 >>> def callback_function(response): 172 >>> pprint(response) 173 >>> 174 >>> thread = api.list_forms(account_id, callback=callback_function) 175 176 :param callback function: The callback function 177 for asynchronous request. (optional) 178 :param str account_id: Account identifier in which the webform resides (required) 179 :param str user_filter: Filter which forms are returned 180 :param bool is_standalone: Is the form a standalone form 181 :param bool is_published: Has the form been published 182 :param str sort_by: Sort result set in mentioned sort property:order. Default is lastModifiedDateTime:desc. Default sort is descending if not mentioned. 183 :param str search: Search through form names 184 :param str start_position: Starting position for desired page of results. 185 :param str count: Number of results to return per page. 186 :return: WebFormSummaryList 187 If the method is called asynchronously, 188 returns the request thread. 189 """ 190 kwargs['_return_http_data_only'] = True 191 if kwargs.get('callback'): 192 return self.list_forms_with_http_info(account_id, **kwargs) 193 else: 194 (data) = self.list_forms_with_http_info(account_id, **kwargs) 195 return data 196 197 def list_forms_with_http_info(self, account_id, **kwargs): 198 """ 199 List Forms 200 List all the forms for the active user that can be in an active or draft state 201 This method makes a synchronous HTTP request by default. To make an 202 asynchronous HTTP request, please define a `callback` function 203 to be invoked when receiving the response. 204 >>> def callback_function(response): 205 >>> pprint(response) 206 >>> 207 >>> thread = api.list_forms_with_http_info(account_id, callback=callback_function) 208 209 :param callback function: The callback function 210 for asynchronous request. (optional) 211 :param str account_id: Account identifier in which the webform resides (required) 212 :param str user_filter: Filter which forms are returned 213 :param bool is_standalone: Is the form a standalone form 214 :param bool is_published: Has the form been published 215 :param str sort_by: Sort result set in mentioned sort property:order. Default is lastModifiedDateTime:desc. Default sort is descending if not mentioned. 216 :param str search: Search through form names 217 :param str start_position: Starting position for desired page of results. 218 :param str count: Number of results to return per page. 219 :return: WebFormSummaryList 220 If the method is called asynchronously, 221 returns the request thread. 222 """ 223 224 all_params = ['account_id', 'user_filter', 'is_standalone', 'is_published', 'sort_by', 'search', 'start_position', 'count'] 225 all_params.append('callback') 226 all_params.append('_return_http_data_only') 227 all_params.append('_preload_content') 228 all_params.append('_request_timeout') 229 230 params = locals() 231 for key, val in iteritems(params['kwargs']): 232 if key not in all_params: 233 raise TypeError( 234 "Got an unexpected keyword argument '%s'" 235 " to method list_forms" % key 236 ) 237 params[key] = val 238 del params['kwargs'] 239 # verify the required parameter 'account_id' is set 240 if ('account_id' not in params) or (params['account_id'] is None): 241 raise ValueError("Missing the required parameter `account_id` when calling `list_forms`") 242 243 if 'sort_by' in params and len(params['sort_by']) > 50: 244 raise ValueError("Invalid value for parameter `sort_by` when calling `list_forms`, length must be less than or equal to `50`") 245 246 collection_formats = {} 247 248 resource_path = '/v1.1/accounts/{accountId}/forms'.replace('{format}', 'json') 249 path_params = {} 250 if 'account_id' in params: 251 path_params['accountId'] = params['account_id'] 252 253 query_params = {} 254 if 'user_filter' in params: 255 query_params['user_filter'] = params['user_filter'] 256 if 'is_standalone' in params: 257 query_params['is_standalone'] = params['is_standalone'] 258 if 'is_published' in params: 259 query_params['is_published'] = params['is_published'] 260 if 'sort_by' in params: 261 query_params['sort_by'] = params['sort_by'] 262 if 'search' in params: 263 query_params['search'] = params['search'] 264 if 'start_position' in params: 265 query_params['start_position'] = params['start_position'] 266 if 'count' in params: 267 query_params['count'] = params['count'] 268 269 header_params = {} 270 271 form_params = [] 272 local_var_files = {} 273 274 body_params = None 275 # HTTP header `Accept` 276 header_params['Accept'] = self.api_client.\ 277 select_header_accept(['application/json']) 278 279 # HTTP header `Content-Type` 280 header_params['Content-Type'] = self.api_client.\ 281 select_header_content_type(['application/json']) 282 283 # Authentication setting 284 auth_settings = [] 285 286 return self.api_client.call_api(resource_path, 'GET', 287 path_params, 288 query_params, 289 header_params, 290 body=body_params, 291 post_params=form_params, 292 files=local_var_files, 293 response_type='WebFormSummaryList', 294 auth_settings=auth_settings, 295 callback=params.get('callback'), 296 _return_http_data_only=params.get('_return_http_data_only'), 297 _preload_content=params.get('_preload_content', True), 298 _request_timeout=params.get('_request_timeout'), 299 collection_formats=collection_formats)
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. Ref: https://github.com/swagger-api/swagger-codegen
44 def get_form(self, account_id, form_id, **kwargs): 45 """ 46 Get Form 47 Retrieves form information filter by form id and state. The `state` parameter is optional and can accept value from `draft, active`. 48 This method makes a synchronous HTTP request by default. To make an 49 asynchronous HTTP request, please define a `callback` function 50 to be invoked when receiving the response. 51 >>> def callback_function(response): 52 >>> pprint(response) 53 >>> 54 >>> thread = api.get_form(account_id, form_id, callback=callback_function) 55 56 :param callback function: The callback function 57 for asynchronous request. (optional) 58 :param str account_id: Account identifier in which the web form resides (required) 59 :param str form_id: Unique identifier for a web form that is consistent for it's lifetime (required) 60 :param str state: The state of the web form configuration 61 :return: WebForm 62 If the method is called asynchronously, 63 returns the request thread. 64 """ 65 kwargs['_return_http_data_only'] = True 66 if kwargs.get('callback'): 67 return self.get_form_with_http_info(account_id, form_id, **kwargs) 68 else: 69 (data) = self.get_form_with_http_info(account_id, form_id, **kwargs) 70 return data
Get Form
Retrieves form information filter by form id and state. The state parameter is optional and can accept value from draft, active.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a callback function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.get_form(account_id, form_id, callback=callback_function)
Parameters
- callback function: The callback function for asynchronous request. (optional)
- str account_id: Account identifier in which the web form resides (required)
- str form_id: Unique identifier for a web form that is consistent for it's lifetime (required)
- str state: The state of the web form configuration
Returns
WebForm If the method is called asynchronously, returns the request thread.
72 def get_form_with_http_info(self, account_id, form_id, **kwargs): 73 """ 74 Get Form 75 Retrieves form information filter by form id and state. The `state` parameter is optional and can accept value from `draft, active`. 76 This method makes a synchronous HTTP request by default. To make an 77 asynchronous HTTP request, please define a `callback` function 78 to be invoked when receiving the response. 79 >>> def callback_function(response): 80 >>> pprint(response) 81 >>> 82 >>> thread = api.get_form_with_http_info(account_id, form_id, callback=callback_function) 83 84 :param callback function: The callback function 85 for asynchronous request. (optional) 86 :param str account_id: Account identifier in which the web form resides (required) 87 :param str form_id: Unique identifier for a web form that is consistent for it's lifetime (required) 88 :param str state: The state of the web form configuration 89 :return: WebForm 90 If the method is called asynchronously, 91 returns the request thread. 92 """ 93 94 all_params = ['account_id', 'form_id', 'state'] 95 all_params.append('callback') 96 all_params.append('_return_http_data_only') 97 all_params.append('_preload_content') 98 all_params.append('_request_timeout') 99 100 params = locals() 101 for key, val in iteritems(params['kwargs']): 102 if key not in all_params: 103 raise TypeError( 104 "Got an unexpected keyword argument '%s'" 105 " to method get_form" % key 106 ) 107 params[key] = val 108 del params['kwargs'] 109 # verify the required parameter 'account_id' is set 110 if ('account_id' not in params) or (params['account_id'] is None): 111 raise ValueError("Missing the required parameter `account_id` when calling `get_form`") 112 # verify the required parameter 'form_id' is set 113 if ('form_id' not in params) or (params['form_id'] is None): 114 raise ValueError("Missing the required parameter `form_id` when calling `get_form`") 115 116 if 'state' in params and len(params['state']) > 15: 117 raise ValueError("Invalid value for parameter `state` when calling `get_form`, length must be less than or equal to `15`") 118 119 collection_formats = {} 120 121 resource_path = '/v1.1/accounts/{accountId}/forms/{formId}'.replace('{format}', 'json') 122 path_params = {} 123 if 'account_id' in params: 124 path_params['accountId'] = params['account_id'] 125 if 'form_id' in params: 126 path_params['formId'] = params['form_id'] 127 128 query_params = {} 129 if 'state' in params: 130 query_params['state'] = params['state'] 131 132 header_params = {} 133 134 form_params = [] 135 local_var_files = {} 136 137 body_params = None 138 # HTTP header `Accept` 139 header_params['Accept'] = self.api_client.\ 140 select_header_accept(['application/json']) 141 142 # HTTP header `Content-Type` 143 header_params['Content-Type'] = self.api_client.\ 144 select_header_content_type(['application/json']) 145 146 # Authentication setting 147 auth_settings = [] 148 149 return self.api_client.call_api(resource_path, 'GET', 150 path_params, 151 query_params, 152 header_params, 153 body=body_params, 154 post_params=form_params, 155 files=local_var_files, 156 response_type='WebForm', 157 auth_settings=auth_settings, 158 callback=params.get('callback'), 159 _return_http_data_only=params.get('_return_http_data_only'), 160 _preload_content=params.get('_preload_content', True), 161 _request_timeout=params.get('_request_timeout'), 162 collection_formats=collection_formats)
Get Form
Retrieves form information filter by form id and state. The state parameter is optional and can accept value from draft, active.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a callback function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.get_form_with_http_info(account_id, form_id, callback=callback_function)
Parameters
- callback function: The callback function for asynchronous request. (optional)
- str account_id: Account identifier in which the web form resides (required)
- str form_id: Unique identifier for a web form that is consistent for it's lifetime (required)
- str state: The state of the web form configuration
Returns
WebForm If the method is called asynchronously, returns the request thread.
164 def list_forms(self, account_id, **kwargs): 165 """ 166 List Forms 167 List all the forms for the active user that can be in an active or draft state 168 This method makes a synchronous HTTP request by default. To make an 169 asynchronous HTTP request, please define a `callback` function 170 to be invoked when receiving the response. 171 >>> def callback_function(response): 172 >>> pprint(response) 173 >>> 174 >>> thread = api.list_forms(account_id, callback=callback_function) 175 176 :param callback function: The callback function 177 for asynchronous request. (optional) 178 :param str account_id: Account identifier in which the webform resides (required) 179 :param str user_filter: Filter which forms are returned 180 :param bool is_standalone: Is the form a standalone form 181 :param bool is_published: Has the form been published 182 :param str sort_by: Sort result set in mentioned sort property:order. Default is lastModifiedDateTime:desc. Default sort is descending if not mentioned. 183 :param str search: Search through form names 184 :param str start_position: Starting position for desired page of results. 185 :param str count: Number of results to return per page. 186 :return: WebFormSummaryList 187 If the method is called asynchronously, 188 returns the request thread. 189 """ 190 kwargs['_return_http_data_only'] = True 191 if kwargs.get('callback'): 192 return self.list_forms_with_http_info(account_id, **kwargs) 193 else: 194 (data) = self.list_forms_with_http_info(account_id, **kwargs) 195 return data
List Forms
List all the forms for the active user that can be in an active or draft state
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a callback function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.list_forms(account_id, callback=callback_function)
Parameters
- callback function: The callback function for asynchronous request. (optional)
- str account_id: Account identifier in which the webform resides (required)
- str user_filter: Filter which forms are returned
- bool is_standalone: Is the form a standalone form
- bool is_published: Has the form been published
- str sort_by: Sort result set in mentioned sort property:order. Default is lastModifiedDateTime: desc. Default sort is descending if not mentioned.
- str search: Search through form names
- str start_position: Starting position for desired page of results.
- str count: Number of results to return per page.
Returns
WebFormSummaryList If the method is called asynchronously, returns the request thread.
197 def list_forms_with_http_info(self, account_id, **kwargs): 198 """ 199 List Forms 200 List all the forms for the active user that can be in an active or draft state 201 This method makes a synchronous HTTP request by default. To make an 202 asynchronous HTTP request, please define a `callback` function 203 to be invoked when receiving the response. 204 >>> def callback_function(response): 205 >>> pprint(response) 206 >>> 207 >>> thread = api.list_forms_with_http_info(account_id, callback=callback_function) 208 209 :param callback function: The callback function 210 for asynchronous request. (optional) 211 :param str account_id: Account identifier in which the webform resides (required) 212 :param str user_filter: Filter which forms are returned 213 :param bool is_standalone: Is the form a standalone form 214 :param bool is_published: Has the form been published 215 :param str sort_by: Sort result set in mentioned sort property:order. Default is lastModifiedDateTime:desc. Default sort is descending if not mentioned. 216 :param str search: Search through form names 217 :param str start_position: Starting position for desired page of results. 218 :param str count: Number of results to return per page. 219 :return: WebFormSummaryList 220 If the method is called asynchronously, 221 returns the request thread. 222 """ 223 224 all_params = ['account_id', 'user_filter', 'is_standalone', 'is_published', 'sort_by', 'search', 'start_position', 'count'] 225 all_params.append('callback') 226 all_params.append('_return_http_data_only') 227 all_params.append('_preload_content') 228 all_params.append('_request_timeout') 229 230 params = locals() 231 for key, val in iteritems(params['kwargs']): 232 if key not in all_params: 233 raise TypeError( 234 "Got an unexpected keyword argument '%s'" 235 " to method list_forms" % key 236 ) 237 params[key] = val 238 del params['kwargs'] 239 # verify the required parameter 'account_id' is set 240 if ('account_id' not in params) or (params['account_id'] is None): 241 raise ValueError("Missing the required parameter `account_id` when calling `list_forms`") 242 243 if 'sort_by' in params and len(params['sort_by']) > 50: 244 raise ValueError("Invalid value for parameter `sort_by` when calling `list_forms`, length must be less than or equal to `50`") 245 246 collection_formats = {} 247 248 resource_path = '/v1.1/accounts/{accountId}/forms'.replace('{format}', 'json') 249 path_params = {} 250 if 'account_id' in params: 251 path_params['accountId'] = params['account_id'] 252 253 query_params = {} 254 if 'user_filter' in params: 255 query_params['user_filter'] = params['user_filter'] 256 if 'is_standalone' in params: 257 query_params['is_standalone'] = params['is_standalone'] 258 if 'is_published' in params: 259 query_params['is_published'] = params['is_published'] 260 if 'sort_by' in params: 261 query_params['sort_by'] = params['sort_by'] 262 if 'search' in params: 263 query_params['search'] = params['search'] 264 if 'start_position' in params: 265 query_params['start_position'] = params['start_position'] 266 if 'count' in params: 267 query_params['count'] = params['count'] 268 269 header_params = {} 270 271 form_params = [] 272 local_var_files = {} 273 274 body_params = None 275 # HTTP header `Accept` 276 header_params['Accept'] = self.api_client.\ 277 select_header_accept(['application/json']) 278 279 # HTTP header `Content-Type` 280 header_params['Content-Type'] = self.api_client.\ 281 select_header_content_type(['application/json']) 282 283 # Authentication setting 284 auth_settings = [] 285 286 return self.api_client.call_api(resource_path, 'GET', 287 path_params, 288 query_params, 289 header_params, 290 body=body_params, 291 post_params=form_params, 292 files=local_var_files, 293 response_type='WebFormSummaryList', 294 auth_settings=auth_settings, 295 callback=params.get('callback'), 296 _return_http_data_only=params.get('_return_http_data_only'), 297 _preload_content=params.get('_preload_content', True), 298 _request_timeout=params.get('_request_timeout'), 299 collection_formats=collection_formats)
List Forms
List all the forms for the active user that can be in an active or draft state
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a callback function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.list_forms_with_http_info(account_id, callback=callback_function)
Parameters
- callback function: The callback function for asynchronous request. (optional)
- str account_id: Account identifier in which the webform resides (required)
- str user_filter: Filter which forms are returned
- bool is_standalone: Is the form a standalone form
- bool is_published: Has the form been published
- str sort_by: Sort result set in mentioned sort property:order. Default is lastModifiedDateTime: desc. Default sort is descending if not mentioned.
- str search: Search through form names
- str start_position: Starting position for desired page of results.
- str count: Number of results to return per page.
Returns
WebFormSummaryList If the method is called asynchronously, returns the request thread.