docusign_esign.apis.power_forms_api

Docusign eSignature REST API

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

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

  1# coding: utf-8
  2
  3"""
  4    Docusign eSignature REST API
  5
  6    The Docusign eSignature REST API provides you with a powerful, convenient, and simple Web services API for interacting with Docusign.  # noqa: E501
  7
  8    OpenAPI spec version: v2.1
  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 PowerFormsApi(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 create_power_form(self, account_id, **kwargs):
 44        """
 45        Creates a new PowerForm.
 46        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).  
 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.create_power_form(account_id, callback=callback_function)
 54
 55        :param callback function: The callback function
 56            for asynchronous request. (optional)
 57        :param str account_id: The external account number (int) or account ID Guid. (required)
 58        :param PowerForm power_form:
 59        :return: PowerForm
 60                 If the method is called asynchronously,
 61                 returns the request thread.
 62        """
 63        kwargs['_return_http_data_only'] = True
 64        if kwargs.get('callback'):
 65            return self.create_power_form_with_http_info(account_id, **kwargs)
 66        else:
 67            (data) = self.create_power_form_with_http_info(account_id, **kwargs)
 68            return data
 69
 70    def create_power_form_with_http_info(self, account_id, **kwargs):
 71        """
 72        Creates a new PowerForm.
 73        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).  
 74        This method makes a synchronous HTTP request by default. To make an
 75        asynchronous HTTP request, please define a `callback` function
 76        to be invoked when receiving the response.
 77        >>> def callback_function(response):
 78        >>>     pprint(response)
 79        >>>
 80        >>> thread = api.create_power_form_with_http_info(account_id, callback=callback_function)
 81
 82        :param callback function: The callback function
 83            for asynchronous request. (optional)
 84        :param str account_id: The external account number (int) or account ID Guid. (required)
 85        :param PowerForm power_form:
 86        :return: PowerForm
 87                 If the method is called asynchronously,
 88                 returns the request thread.
 89        """
 90
 91        all_params = ['account_id', 'power_form']
 92        all_params.append('callback')
 93        all_params.append('_return_http_data_only')
 94        all_params.append('_preload_content')
 95        all_params.append('_request_timeout')
 96
 97        params = locals()
 98        for key, val in iteritems(params['kwargs']):
 99            if key not in all_params:
100                raise TypeError(
101                    "Got an unexpected keyword argument '%s'"
102                    " to method create_power_form" % key
103                )
104            params[key] = val
105        del params['kwargs']
106        # verify the required parameter 'account_id' is set
107        if ('account_id' not in params) or (params['account_id'] is None):
108            raise ValueError("Missing the required parameter `account_id` when calling `create_power_form`")
109
110
111        collection_formats = {}
112
113        resource_path = '/v2.1/accounts/{accountId}/powerforms'.replace('{format}', 'json')
114        path_params = {}
115        if 'account_id' in params:
116            path_params['accountId'] = params['account_id']
117
118        query_params = {}
119
120        header_params = {}
121
122        form_params = []
123        local_var_files = {}
124
125        body_params = None
126        if 'power_form' in params:
127            body_params = params['power_form']
128        # HTTP header `Accept`
129        header_params['Accept'] = self.api_client.\
130            select_header_accept(['application/json'])
131
132        # Authentication setting
133        auth_settings = []
134
135        return self.api_client.call_api(resource_path, 'POST',
136                                        path_params,
137                                        query_params,
138                                        header_params,
139                                        body=body_params,
140                                        post_params=form_params,
141                                        files=local_var_files,
142                                        response_type='PowerForm',
143                                        auth_settings=auth_settings,
144                                        callback=params.get('callback'),
145                                        _return_http_data_only=params.get('_return_http_data_only'),
146                                        _preload_content=params.get('_preload_content', True),
147                                        _request_timeout=params.get('_request_timeout'),
148                                        collection_formats=collection_formats)
149
150    def delete_power_form(self, account_id, power_form_id, **kwargs):
151        """
152        Delete a PowerForm.
153        This method deletes a PowerForm.
154        This method makes a synchronous HTTP request by default. To make an
155        asynchronous HTTP request, please define a `callback` function
156        to be invoked when receiving the response.
157        >>> def callback_function(response):
158        >>>     pprint(response)
159        >>>
160        >>> thread = api.delete_power_form(account_id, power_form_id, callback=callback_function)
161
162        :param callback function: The callback function
163            for asynchronous request. (optional)
164        :param str account_id: The external account number (int) or account ID Guid. (required)
165        :param str power_form_id: (required)
166        :return: None
167                 If the method is called asynchronously,
168                 returns the request thread.
169        """
170        kwargs['_return_http_data_only'] = True
171        if kwargs.get('callback'):
172            return self.delete_power_form_with_http_info(account_id, power_form_id, **kwargs)
173        else:
174            (data) = self.delete_power_form_with_http_info(account_id, power_form_id, **kwargs)
175            return data
176
177    def delete_power_form_with_http_info(self, account_id, power_form_id, **kwargs):
178        """
179        Delete a PowerForm.
180        This method deletes a PowerForm.
181        This method makes a synchronous HTTP request by default. To make an
182        asynchronous HTTP request, please define a `callback` function
183        to be invoked when receiving the response.
184        >>> def callback_function(response):
185        >>>     pprint(response)
186        >>>
187        >>> thread = api.delete_power_form_with_http_info(account_id, power_form_id, callback=callback_function)
188
189        :param callback function: The callback function
190            for asynchronous request. (optional)
191        :param str account_id: The external account number (int) or account ID Guid. (required)
192        :param str power_form_id: (required)
193        :return: None
194                 If the method is called asynchronously,
195                 returns the request thread.
196        """
197
198        all_params = ['account_id', 'power_form_id']
199        all_params.append('callback')
200        all_params.append('_return_http_data_only')
201        all_params.append('_preload_content')
202        all_params.append('_request_timeout')
203
204        params = locals()
205        for key, val in iteritems(params['kwargs']):
206            if key not in all_params:
207                raise TypeError(
208                    "Got an unexpected keyword argument '%s'"
209                    " to method delete_power_form" % key
210                )
211            params[key] = val
212        del params['kwargs']
213        # verify the required parameter 'account_id' is set
214        if ('account_id' not in params) or (params['account_id'] is None):
215            raise ValueError("Missing the required parameter `account_id` when calling `delete_power_form`")
216        # verify the required parameter 'power_form_id' is set
217        if ('power_form_id' not in params) or (params['power_form_id'] is None):
218            raise ValueError("Missing the required parameter `power_form_id` when calling `delete_power_form`")
219
220
221        collection_formats = {}
222
223        resource_path = '/v2.1/accounts/{accountId}/powerforms/{powerFormId}'.replace('{format}', 'json')
224        path_params = {}
225        if 'account_id' in params:
226            path_params['accountId'] = params['account_id']
227        if 'power_form_id' in params:
228            path_params['powerFormId'] = params['power_form_id']
229
230        query_params = {}
231
232        header_params = {}
233
234        form_params = []
235        local_var_files = {}
236
237        body_params = None
238        # HTTP header `Accept`
239        header_params['Accept'] = self.api_client.\
240            select_header_accept(['application/json'])
241
242        # Authentication setting
243        auth_settings = []
244
245        return self.api_client.call_api(resource_path, 'DELETE',
246                                        path_params,
247                                        query_params,
248                                        header_params,
249                                        body=body_params,
250                                        post_params=form_params,
251                                        files=local_var_files,
252                                        response_type=None,
253                                        auth_settings=auth_settings,
254                                        callback=params.get('callback'),
255                                        _return_http_data_only=params.get('_return_http_data_only'),
256                                        _preload_content=params.get('_preload_content', True),
257                                        _request_timeout=params.get('_request_timeout'),
258                                        collection_formats=collection_formats)
259
260    def delete_power_forms(self, account_id, **kwargs):
261        """
262        Deletes one or more PowerForms
263        This method deletes one or more PowerForms. The request body takes an array of PowerForm objects that are deleted based on the `powerFormId`.
264        This method makes a synchronous HTTP request by default. To make an
265        asynchronous HTTP request, please define a `callback` function
266        to be invoked when receiving the response.
267        >>> def callback_function(response):
268        >>>     pprint(response)
269        >>>
270        >>> thread = api.delete_power_forms(account_id, callback=callback_function)
271
272        :param callback function: The callback function
273            for asynchronous request. (optional)
274        :param str account_id: The external account number (int) or account ID Guid. (required)
275        :param PowerFormsRequest power_forms_request:
276        :return: PowerFormsResponse
277                 If the method is called asynchronously,
278                 returns the request thread.
279        """
280        kwargs['_return_http_data_only'] = True
281        if kwargs.get('callback'):
282            return self.delete_power_forms_with_http_info(account_id, **kwargs)
283        else:
284            (data) = self.delete_power_forms_with_http_info(account_id, **kwargs)
285            return data
286
287    def delete_power_forms_with_http_info(self, account_id, **kwargs):
288        """
289        Deletes one or more PowerForms
290        This method deletes one or more PowerForms. The request body takes an array of PowerForm objects that are deleted based on the `powerFormId`.
291        This method makes a synchronous HTTP request by default. To make an
292        asynchronous HTTP request, please define a `callback` function
293        to be invoked when receiving the response.
294        >>> def callback_function(response):
295        >>>     pprint(response)
296        >>>
297        >>> thread = api.delete_power_forms_with_http_info(account_id, callback=callback_function)
298
299        :param callback function: The callback function
300            for asynchronous request. (optional)
301        :param str account_id: The external account number (int) or account ID Guid. (required)
302        :param PowerFormsRequest power_forms_request:
303        :return: PowerFormsResponse
304                 If the method is called asynchronously,
305                 returns the request thread.
306        """
307
308        all_params = ['account_id', 'power_forms_request']
309        all_params.append('callback')
310        all_params.append('_return_http_data_only')
311        all_params.append('_preload_content')
312        all_params.append('_request_timeout')
313
314        params = locals()
315        for key, val in iteritems(params['kwargs']):
316            if key not in all_params:
317                raise TypeError(
318                    "Got an unexpected keyword argument '%s'"
319                    " to method delete_power_forms" % key
320                )
321            params[key] = val
322        del params['kwargs']
323        # verify the required parameter 'account_id' is set
324        if ('account_id' not in params) or (params['account_id'] is None):
325            raise ValueError("Missing the required parameter `account_id` when calling `delete_power_forms`")
326
327
328        collection_formats = {}
329
330        resource_path = '/v2.1/accounts/{accountId}/powerforms'.replace('{format}', 'json')
331        path_params = {}
332        if 'account_id' in params:
333            path_params['accountId'] = params['account_id']
334
335        query_params = {}
336
337        header_params = {}
338
339        form_params = []
340        local_var_files = {}
341
342        body_params = None
343        if 'power_forms_request' in params:
344            body_params = params['power_forms_request']
345        # HTTP header `Accept`
346        header_params['Accept'] = self.api_client.\
347            select_header_accept(['application/json'])
348
349        # Authentication setting
350        auth_settings = []
351
352        return self.api_client.call_api(resource_path, 'DELETE',
353                                        path_params,
354                                        query_params,
355                                        header_params,
356                                        body=body_params,
357                                        post_params=form_params,
358                                        files=local_var_files,
359                                        response_type='PowerFormsResponse',
360                                        auth_settings=auth_settings,
361                                        callback=params.get('callback'),
362                                        _return_http_data_only=params.get('_return_http_data_only'),
363                                        _preload_content=params.get('_preload_content', True),
364                                        _request_timeout=params.get('_request_timeout'),
365                                        collection_formats=collection_formats)
366
367    def get_power_form(self, account_id, power_form_id, **kwargs):
368        """
369        Returns a single PowerForm.
370        This method returns detailed information about a specific PowerForm.
371        This method makes a synchronous HTTP request by default. To make an
372        asynchronous HTTP request, please define a `callback` function
373        to be invoked when receiving the response.
374        >>> def callback_function(response):
375        >>>     pprint(response)
376        >>>
377        >>> thread = api.get_power_form(account_id, power_form_id, callback=callback_function)
378
379        :param callback function: The callback function
380            for asynchronous request. (optional)
381        :param str account_id: The external account number (int) or account ID Guid. (required)
382        :param str power_form_id: (required)
383        :return: PowerForm
384                 If the method is called asynchronously,
385                 returns the request thread.
386        """
387        kwargs['_return_http_data_only'] = True
388        if kwargs.get('callback'):
389            return self.get_power_form_with_http_info(account_id, power_form_id, **kwargs)
390        else:
391            (data) = self.get_power_form_with_http_info(account_id, power_form_id, **kwargs)
392            return data
393
394    def get_power_form_with_http_info(self, account_id, power_form_id, **kwargs):
395        """
396        Returns a single PowerForm.
397        This method returns detailed information about a specific PowerForm.
398        This method makes a synchronous HTTP request by default. To make an
399        asynchronous HTTP request, please define a `callback` function
400        to be invoked when receiving the response.
401        >>> def callback_function(response):
402        >>>     pprint(response)
403        >>>
404        >>> thread = api.get_power_form_with_http_info(account_id, power_form_id, callback=callback_function)
405
406        :param callback function: The callback function
407            for asynchronous request. (optional)
408        :param str account_id: The external account number (int) or account ID Guid. (required)
409        :param str power_form_id: (required)
410        :return: PowerForm
411                 If the method is called asynchronously,
412                 returns the request thread.
413        """
414
415        all_params = ['account_id', 'power_form_id']
416        all_params.append('callback')
417        all_params.append('_return_http_data_only')
418        all_params.append('_preload_content')
419        all_params.append('_request_timeout')
420
421        params = locals()
422        for key, val in iteritems(params['kwargs']):
423            if key not in all_params:
424                raise TypeError(
425                    "Got an unexpected keyword argument '%s'"
426                    " to method get_power_form" % key
427                )
428            params[key] = val
429        del params['kwargs']
430        # verify the required parameter 'account_id' is set
431        if ('account_id' not in params) or (params['account_id'] is None):
432            raise ValueError("Missing the required parameter `account_id` when calling `get_power_form`")
433        # verify the required parameter 'power_form_id' is set
434        if ('power_form_id' not in params) or (params['power_form_id'] is None):
435            raise ValueError("Missing the required parameter `power_form_id` when calling `get_power_form`")
436
437
438        collection_formats = {}
439
440        resource_path = '/v2.1/accounts/{accountId}/powerforms/{powerFormId}'.replace('{format}', 'json')
441        path_params = {}
442        if 'account_id' in params:
443            path_params['accountId'] = params['account_id']
444        if 'power_form_id' in params:
445            path_params['powerFormId'] = params['power_form_id']
446
447        query_params = {}
448
449        header_params = {}
450
451        form_params = []
452        local_var_files = {}
453
454        body_params = None
455        # HTTP header `Accept`
456        header_params['Accept'] = self.api_client.\
457            select_header_accept(['application/json'])
458
459        # Authentication setting
460        auth_settings = []
461
462        return self.api_client.call_api(resource_path, 'GET',
463                                        path_params,
464                                        query_params,
465                                        header_params,
466                                        body=body_params,
467                                        post_params=form_params,
468                                        files=local_var_files,
469                                        response_type='PowerForm',
470                                        auth_settings=auth_settings,
471                                        callback=params.get('callback'),
472                                        _return_http_data_only=params.get('_return_http_data_only'),
473                                        _preload_content=params.get('_preload_content', True),
474                                        _request_timeout=params.get('_request_timeout'),
475                                        collection_formats=collection_formats)
476
477    def get_power_form_data(self, account_id, power_form_id, **kwargs):
478        """
479        Returns the form data associated with the usage of a PowerForm.
480        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.
481        This method makes a synchronous HTTP request by default. To make an
482        asynchronous HTTP request, please define a `callback` function
483        to be invoked when receiving the response.
484        >>> def callback_function(response):
485        >>>     pprint(response)
486        >>>
487        >>> thread = api.get_power_form_data(account_id, power_form_id, callback=callback_function)
488
489        :param callback function: The callback function
490            for asynchronous request. (optional)
491        :param str account_id: The external account number (int) or account ID Guid. (required)
492        :param str power_form_id: (required)
493        :param str data_layout:
494        :param str from_date:
495        :param str to_date:
496        :return: PowerFormsFormDataResponse
497                 If the method is called asynchronously,
498                 returns the request thread.
499        """
500        kwargs['_return_http_data_only'] = True
501        if kwargs.get('callback'):
502            return self.get_power_form_data_with_http_info(account_id, power_form_id, **kwargs)
503        else:
504            (data) = self.get_power_form_data_with_http_info(account_id, power_form_id, **kwargs)
505            return data
506
507    def get_power_form_data_with_http_info(self, account_id, power_form_id, **kwargs):
508        """
509        Returns the form data associated with the usage of a PowerForm.
510        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.
511        This method makes a synchronous HTTP request by default. To make an
512        asynchronous HTTP request, please define a `callback` function
513        to be invoked when receiving the response.
514        >>> def callback_function(response):
515        >>>     pprint(response)
516        >>>
517        >>> thread = api.get_power_form_data_with_http_info(account_id, power_form_id, callback=callback_function)
518
519        :param callback function: The callback function
520            for asynchronous request. (optional)
521        :param str account_id: The external account number (int) or account ID Guid. (required)
522        :param str power_form_id: (required)
523        :param str data_layout:
524        :param str from_date:
525        :param str to_date:
526        :return: PowerFormsFormDataResponse
527                 If the method is called asynchronously,
528                 returns the request thread.
529        """
530
531        all_params = ['account_id', 'power_form_id', 'data_layout', 'from_date', 'to_date']
532        all_params.append('callback')
533        all_params.append('_return_http_data_only')
534        all_params.append('_preload_content')
535        all_params.append('_request_timeout')
536
537        params = locals()
538        for key, val in iteritems(params['kwargs']):
539            if key not in all_params:
540                raise TypeError(
541                    "Got an unexpected keyword argument '%s'"
542                    " to method get_power_form_data" % key
543                )
544            params[key] = val
545        del params['kwargs']
546        # verify the required parameter 'account_id' is set
547        if ('account_id' not in params) or (params['account_id'] is None):
548            raise ValueError("Missing the required parameter `account_id` when calling `get_power_form_data`")
549        # verify the required parameter 'power_form_id' is set
550        if ('power_form_id' not in params) or (params['power_form_id'] is None):
551            raise ValueError("Missing the required parameter `power_form_id` when calling `get_power_form_data`")
552
553
554        collection_formats = {}
555
556        resource_path = '/v2.1/accounts/{accountId}/powerforms/{powerFormId}/form_data'.replace('{format}', 'json')
557        path_params = {}
558        if 'account_id' in params:
559            path_params['accountId'] = params['account_id']
560        if 'power_form_id' in params:
561            path_params['powerFormId'] = params['power_form_id']
562
563        query_params = {}
564        if 'data_layout' in params:
565            query_params['data_layout'] = params['data_layout']
566        if 'from_date' in params:
567            query_params['from_date'] = params['from_date']
568        if 'to_date' in params:
569            query_params['to_date'] = params['to_date']
570
571        header_params = {}
572
573        form_params = []
574        local_var_files = {}
575
576        body_params = None
577        # HTTP header `Accept`
578        header_params['Accept'] = self.api_client.\
579            select_header_accept(['application/json'])
580
581        # Authentication setting
582        auth_settings = []
583
584        return self.api_client.call_api(resource_path, 'GET',
585                                        path_params,
586                                        query_params,
587                                        header_params,
588                                        body=body_params,
589                                        post_params=form_params,
590                                        files=local_var_files,
591                                        response_type='PowerFormsFormDataResponse',
592                                        auth_settings=auth_settings,
593                                        callback=params.get('callback'),
594                                        _return_http_data_only=params.get('_return_http_data_only'),
595                                        _preload_content=params.get('_preload_content', True),
596                                        _request_timeout=params.get('_request_timeout'),
597                                        collection_formats=collection_formats)
598
599    def list_power_form_senders(self, account_id, **kwargs):
600        """
601        Returns the list of PowerForms available to the user.
602        This method returns a list of users who have sent PowerForms.
603        This method makes a synchronous HTTP request by default. To make an
604        asynchronous HTTP request, please define a `callback` function
605        to be invoked when receiving the response.
606        >>> def callback_function(response):
607        >>>     pprint(response)
608        >>>
609        >>> thread = api.list_power_form_senders(account_id, callback=callback_function)
610
611        :param callback function: The callback function
612            for asynchronous request. (optional)
613        :param str account_id: The external account number (int) or account ID Guid. (required)
614        :param str start_position:
615        :return: PowerFormSendersResponse
616                 If the method is called asynchronously,
617                 returns the request thread.
618        """
619        kwargs['_return_http_data_only'] = True
620        if kwargs.get('callback'):
621            return self.list_power_form_senders_with_http_info(account_id, **kwargs)
622        else:
623            (data) = self.list_power_form_senders_with_http_info(account_id, **kwargs)
624            return data
625
626    def list_power_form_senders_with_http_info(self, account_id, **kwargs):
627        """
628        Returns the list of PowerForms available to the user.
629        This method returns a list of users who have sent PowerForms.
630        This method makes a synchronous HTTP request by default. To make an
631        asynchronous HTTP request, please define a `callback` function
632        to be invoked when receiving the response.
633        >>> def callback_function(response):
634        >>>     pprint(response)
635        >>>
636        >>> thread = api.list_power_form_senders_with_http_info(account_id, callback=callback_function)
637
638        :param callback function: The callback function
639            for asynchronous request. (optional)
640        :param str account_id: The external account number (int) or account ID Guid. (required)
641        :param str start_position:
642        :return: PowerFormSendersResponse
643                 If the method is called asynchronously,
644                 returns the request thread.
645        """
646
647        all_params = ['account_id', 'start_position']
648        all_params.append('callback')
649        all_params.append('_return_http_data_only')
650        all_params.append('_preload_content')
651        all_params.append('_request_timeout')
652
653        params = locals()
654        for key, val in iteritems(params['kwargs']):
655            if key not in all_params:
656                raise TypeError(
657                    "Got an unexpected keyword argument '%s'"
658                    " to method list_power_form_senders" % key
659                )
660            params[key] = val
661        del params['kwargs']
662        # verify the required parameter 'account_id' is set
663        if ('account_id' not in params) or (params['account_id'] is None):
664            raise ValueError("Missing the required parameter `account_id` when calling `list_power_form_senders`")
665
666
667        collection_formats = {}
668
669        resource_path = '/v2.1/accounts/{accountId}/powerforms/senders'.replace('{format}', 'json')
670        path_params = {}
671        if 'account_id' in params:
672            path_params['accountId'] = params['account_id']
673
674        query_params = {}
675        if 'start_position' in params:
676            query_params['start_position'] = params['start_position']
677
678        header_params = {}
679
680        form_params = []
681        local_var_files = {}
682
683        body_params = None
684        # HTTP header `Accept`
685        header_params['Accept'] = self.api_client.\
686            select_header_accept(['application/json'])
687
688        # Authentication setting
689        auth_settings = []
690
691        return self.api_client.call_api(resource_path, 'GET',
692                                        path_params,
693                                        query_params,
694                                        header_params,
695                                        body=body_params,
696                                        post_params=form_params,
697                                        files=local_var_files,
698                                        response_type='PowerFormSendersResponse',
699                                        auth_settings=auth_settings,
700                                        callback=params.get('callback'),
701                                        _return_http_data_only=params.get('_return_http_data_only'),
702                                        _preload_content=params.get('_preload_content', True),
703                                        _request_timeout=params.get('_request_timeout'),
704                                        collection_formats=collection_formats)
705
706    def list_power_forms(self, account_id, **kwargs):
707        """
708        Returns the list of PowerForms available to the user.
709        This method returns a list of PowerForms that are available to the user.
710        This method makes a synchronous HTTP request by default. To make an
711        asynchronous HTTP request, please define a `callback` function
712        to be invoked when receiving the response.
713        >>> def callback_function(response):
714        >>>     pprint(response)
715        >>>
716        >>> thread = api.list_power_forms(account_id, callback=callback_function)
717
718        :param callback function: The callback function
719            for asynchronous request. (optional)
720        :param str account_id: The external account number (int) or account ID Guid. (required)
721        :param str from_date:
722        :param str order:
723        :param str order_by:
724        :param str search_fields:
725        :param str search_text:
726        :param str to_date:
727        :return: PowerFormsResponse
728                 If the method is called asynchronously,
729                 returns the request thread.
730        """
731        kwargs['_return_http_data_only'] = True
732        if kwargs.get('callback'):
733            return self.list_power_forms_with_http_info(account_id, **kwargs)
734        else:
735            (data) = self.list_power_forms_with_http_info(account_id, **kwargs)
736            return data
737
738    def list_power_forms_with_http_info(self, account_id, **kwargs):
739        """
740        Returns the list of PowerForms available to the user.
741        This method returns a list of PowerForms that are available to the user.
742        This method makes a synchronous HTTP request by default. To make an
743        asynchronous HTTP request, please define a `callback` function
744        to be invoked when receiving the response.
745        >>> def callback_function(response):
746        >>>     pprint(response)
747        >>>
748        >>> thread = api.list_power_forms_with_http_info(account_id, callback=callback_function)
749
750        :param callback function: The callback function
751            for asynchronous request. (optional)
752        :param str account_id: The external account number (int) or account ID Guid. (required)
753        :param str from_date:
754        :param str order:
755        :param str order_by:
756        :param str search_fields:
757        :param str search_text:
758        :param str to_date:
759        :return: PowerFormsResponse
760                 If the method is called asynchronously,
761                 returns the request thread.
762        """
763
764        all_params = ['account_id', 'from_date', 'order', 'order_by', 'search_fields', 'search_text', 'to_date']
765        all_params.append('callback')
766        all_params.append('_return_http_data_only')
767        all_params.append('_preload_content')
768        all_params.append('_request_timeout')
769
770        params = locals()
771        for key, val in iteritems(params['kwargs']):
772            if key not in all_params:
773                raise TypeError(
774                    "Got an unexpected keyword argument '%s'"
775                    " to method list_power_forms" % key
776                )
777            params[key] = val
778        del params['kwargs']
779        # verify the required parameter 'account_id' is set
780        if ('account_id' not in params) or (params['account_id'] is None):
781            raise ValueError("Missing the required parameter `account_id` when calling `list_power_forms`")
782
783
784        collection_formats = {}
785
786        resource_path = '/v2.1/accounts/{accountId}/powerforms'.replace('{format}', 'json')
787        path_params = {}
788        if 'account_id' in params:
789            path_params['accountId'] = params['account_id']
790
791        query_params = {}
792        if 'from_date' in params:
793            query_params['from_date'] = params['from_date']
794        if 'order' in params:
795            query_params['order'] = params['order']
796        if 'order_by' in params:
797            query_params['order_by'] = params['order_by']
798        if 'search_fields' in params:
799            query_params['search_fields'] = params['search_fields']
800        if 'search_text' in params:
801            query_params['search_text'] = params['search_text']
802        if 'to_date' in params:
803            query_params['to_date'] = params['to_date']
804
805        header_params = {}
806
807        form_params = []
808        local_var_files = {}
809
810        body_params = None
811        # HTTP header `Accept`
812        header_params['Accept'] = self.api_client.\
813            select_header_accept(['application/json'])
814
815        # Authentication setting
816        auth_settings = []
817
818        return self.api_client.call_api(resource_path, 'GET',
819                                        path_params,
820                                        query_params,
821                                        header_params,
822                                        body=body_params,
823                                        post_params=form_params,
824                                        files=local_var_files,
825                                        response_type='PowerFormsResponse',
826                                        auth_settings=auth_settings,
827                                        callback=params.get('callback'),
828                                        _return_http_data_only=params.get('_return_http_data_only'),
829                                        _preload_content=params.get('_preload_content', True),
830                                        _request_timeout=params.get('_request_timeout'),
831                                        collection_formats=collection_formats)
832
833    def update_power_form(self, account_id, power_form_id, **kwargs):
834        """
835        Creates a new PowerForm.
836        This method updates an existing PowerForm.
837        This method makes a synchronous HTTP request by default. To make an
838        asynchronous HTTP request, please define a `callback` function
839        to be invoked when receiving the response.
840        >>> def callback_function(response):
841        >>>     pprint(response)
842        >>>
843        >>> thread = api.update_power_form(account_id, power_form_id, callback=callback_function)
844
845        :param callback function: The callback function
846            for asynchronous request. (optional)
847        :param str account_id: The external account number (int) or account ID Guid. (required)
848        :param str power_form_id: (required)
849        :param PowerForm power_form:
850        :return: PowerForm
851                 If the method is called asynchronously,
852                 returns the request thread.
853        """
854        kwargs['_return_http_data_only'] = True
855        if kwargs.get('callback'):
856            return self.update_power_form_with_http_info(account_id, power_form_id, **kwargs)
857        else:
858            (data) = self.update_power_form_with_http_info(account_id, power_form_id, **kwargs)
859            return data
860
861    def update_power_form_with_http_info(self, account_id, power_form_id, **kwargs):
862        """
863        Creates a new PowerForm.
864        This method updates an existing PowerForm.
865        This method makes a synchronous HTTP request by default. To make an
866        asynchronous HTTP request, please define a `callback` function
867        to be invoked when receiving the response.
868        >>> def callback_function(response):
869        >>>     pprint(response)
870        >>>
871        >>> thread = api.update_power_form_with_http_info(account_id, power_form_id, callback=callback_function)
872
873        :param callback function: The callback function
874            for asynchronous request. (optional)
875        :param str account_id: The external account number (int) or account ID Guid. (required)
876        :param str power_form_id: (required)
877        :param PowerForm power_form:
878        :return: PowerForm
879                 If the method is called asynchronously,
880                 returns the request thread.
881        """
882
883        all_params = ['account_id', 'power_form_id', 'power_form']
884        all_params.append('callback')
885        all_params.append('_return_http_data_only')
886        all_params.append('_preload_content')
887        all_params.append('_request_timeout')
888
889        params = locals()
890        for key, val in iteritems(params['kwargs']):
891            if key not in all_params:
892                raise TypeError(
893                    "Got an unexpected keyword argument '%s'"
894                    " to method update_power_form" % key
895                )
896            params[key] = val
897        del params['kwargs']
898        # verify the required parameter 'account_id' is set
899        if ('account_id' not in params) or (params['account_id'] is None):
900            raise ValueError("Missing the required parameter `account_id` when calling `update_power_form`")
901        # verify the required parameter 'power_form_id' is set
902        if ('power_form_id' not in params) or (params['power_form_id'] is None):
903            raise ValueError("Missing the required parameter `power_form_id` when calling `update_power_form`")
904
905
906        collection_formats = {}
907
908        resource_path = '/v2.1/accounts/{accountId}/powerforms/{powerFormId}'.replace('{format}', 'json')
909        path_params = {}
910        if 'account_id' in params:
911            path_params['accountId'] = params['account_id']
912        if 'power_form_id' in params:
913            path_params['powerFormId'] = params['power_form_id']
914
915        query_params = {}
916
917        header_params = {}
918
919        form_params = []
920        local_var_files = {}
921
922        body_params = None
923        if 'power_form' in params:
924            body_params = params['power_form']
925        # HTTP header `Accept`
926        header_params['Accept'] = self.api_client.\
927            select_header_accept(['application/json'])
928
929        # Authentication setting
930        auth_settings = []
931
932        return self.api_client.call_api(resource_path, 'PUT',
933                                        path_params,
934                                        query_params,
935                                        header_params,
936                                        body=body_params,
937                                        post_params=form_params,
938                                        files=local_var_files,
939                                        response_type='PowerForm',
940                                        auth_settings=auth_settings,
941                                        callback=params.get('callback'),
942                                        _return_http_data_only=params.get('_return_http_data_only'),
943                                        _preload_content=params.get('_preload_content', True),
944                                        _request_timeout=params.get('_request_timeout'),
945                                        collection_formats=collection_formats)
class PowerFormsApi:
 28class PowerFormsApi(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 create_power_form(self, account_id, **kwargs):
 45        """
 46        Creates a new PowerForm.
 47        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).  
 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.create_power_form(account_id, callback=callback_function)
 55
 56        :param callback function: The callback function
 57            for asynchronous request. (optional)
 58        :param str account_id: The external account number (int) or account ID Guid. (required)
 59        :param PowerForm power_form:
 60        :return: PowerForm
 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.create_power_form_with_http_info(account_id, **kwargs)
 67        else:
 68            (data) = self.create_power_form_with_http_info(account_id, **kwargs)
 69            return data
 70
 71    def create_power_form_with_http_info(self, account_id, **kwargs):
 72        """
 73        Creates a new PowerForm.
 74        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).  
 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.create_power_form_with_http_info(account_id, callback=callback_function)
 82
 83        :param callback function: The callback function
 84            for asynchronous request. (optional)
 85        :param str account_id: The external account number (int) or account ID Guid. (required)
 86        :param PowerForm power_form:
 87        :return: PowerForm
 88                 If the method is called asynchronously,
 89                 returns the request thread.
 90        """
 91
 92        all_params = ['account_id', 'power_form']
 93        all_params.append('callback')
 94        all_params.append('_return_http_data_only')
 95        all_params.append('_preload_content')
 96        all_params.append('_request_timeout')
 97
 98        params = locals()
 99        for key, val in iteritems(params['kwargs']):
100            if key not in all_params:
101                raise TypeError(
102                    "Got an unexpected keyword argument '%s'"
103                    " to method create_power_form" % key
104                )
105            params[key] = val
106        del params['kwargs']
107        # verify the required parameter 'account_id' is set
108        if ('account_id' not in params) or (params['account_id'] is None):
109            raise ValueError("Missing the required parameter `account_id` when calling `create_power_form`")
110
111
112        collection_formats = {}
113
114        resource_path = '/v2.1/accounts/{accountId}/powerforms'.replace('{format}', 'json')
115        path_params = {}
116        if 'account_id' in params:
117            path_params['accountId'] = params['account_id']
118
119        query_params = {}
120
121        header_params = {}
122
123        form_params = []
124        local_var_files = {}
125
126        body_params = None
127        if 'power_form' in params:
128            body_params = params['power_form']
129        # HTTP header `Accept`
130        header_params['Accept'] = self.api_client.\
131            select_header_accept(['application/json'])
132
133        # Authentication setting
134        auth_settings = []
135
136        return self.api_client.call_api(resource_path, 'POST',
137                                        path_params,
138                                        query_params,
139                                        header_params,
140                                        body=body_params,
141                                        post_params=form_params,
142                                        files=local_var_files,
143                                        response_type='PowerForm',
144                                        auth_settings=auth_settings,
145                                        callback=params.get('callback'),
146                                        _return_http_data_only=params.get('_return_http_data_only'),
147                                        _preload_content=params.get('_preload_content', True),
148                                        _request_timeout=params.get('_request_timeout'),
149                                        collection_formats=collection_formats)
150
151    def delete_power_form(self, account_id, power_form_id, **kwargs):
152        """
153        Delete a PowerForm.
154        This method deletes a PowerForm.
155        This method makes a synchronous HTTP request by default. To make an
156        asynchronous HTTP request, please define a `callback` function
157        to be invoked when receiving the response.
158        >>> def callback_function(response):
159        >>>     pprint(response)
160        >>>
161        >>> thread = api.delete_power_form(account_id, power_form_id, callback=callback_function)
162
163        :param callback function: The callback function
164            for asynchronous request. (optional)
165        :param str account_id: The external account number (int) or account ID Guid. (required)
166        :param str power_form_id: (required)
167        :return: None
168                 If the method is called asynchronously,
169                 returns the request thread.
170        """
171        kwargs['_return_http_data_only'] = True
172        if kwargs.get('callback'):
173            return self.delete_power_form_with_http_info(account_id, power_form_id, **kwargs)
174        else:
175            (data) = self.delete_power_form_with_http_info(account_id, power_form_id, **kwargs)
176            return data
177
178    def delete_power_form_with_http_info(self, account_id, power_form_id, **kwargs):
179        """
180        Delete a PowerForm.
181        This method deletes a PowerForm.
182        This method makes a synchronous HTTP request by default. To make an
183        asynchronous HTTP request, please define a `callback` function
184        to be invoked when receiving the response.
185        >>> def callback_function(response):
186        >>>     pprint(response)
187        >>>
188        >>> thread = api.delete_power_form_with_http_info(account_id, power_form_id, callback=callback_function)
189
190        :param callback function: The callback function
191            for asynchronous request. (optional)
192        :param str account_id: The external account number (int) or account ID Guid. (required)
193        :param str power_form_id: (required)
194        :return: None
195                 If the method is called asynchronously,
196                 returns the request thread.
197        """
198
199        all_params = ['account_id', 'power_form_id']
200        all_params.append('callback')
201        all_params.append('_return_http_data_only')
202        all_params.append('_preload_content')
203        all_params.append('_request_timeout')
204
205        params = locals()
206        for key, val in iteritems(params['kwargs']):
207            if key not in all_params:
208                raise TypeError(
209                    "Got an unexpected keyword argument '%s'"
210                    " to method delete_power_form" % key
211                )
212            params[key] = val
213        del params['kwargs']
214        # verify the required parameter 'account_id' is set
215        if ('account_id' not in params) or (params['account_id'] is None):
216            raise ValueError("Missing the required parameter `account_id` when calling `delete_power_form`")
217        # verify the required parameter 'power_form_id' is set
218        if ('power_form_id' not in params) or (params['power_form_id'] is None):
219            raise ValueError("Missing the required parameter `power_form_id` when calling `delete_power_form`")
220
221
222        collection_formats = {}
223
224        resource_path = '/v2.1/accounts/{accountId}/powerforms/{powerFormId}'.replace('{format}', 'json')
225        path_params = {}
226        if 'account_id' in params:
227            path_params['accountId'] = params['account_id']
228        if 'power_form_id' in params:
229            path_params['powerFormId'] = params['power_form_id']
230
231        query_params = {}
232
233        header_params = {}
234
235        form_params = []
236        local_var_files = {}
237
238        body_params = None
239        # HTTP header `Accept`
240        header_params['Accept'] = self.api_client.\
241            select_header_accept(['application/json'])
242
243        # Authentication setting
244        auth_settings = []
245
246        return self.api_client.call_api(resource_path, 'DELETE',
247                                        path_params,
248                                        query_params,
249                                        header_params,
250                                        body=body_params,
251                                        post_params=form_params,
252                                        files=local_var_files,
253                                        response_type=None,
254                                        auth_settings=auth_settings,
255                                        callback=params.get('callback'),
256                                        _return_http_data_only=params.get('_return_http_data_only'),
257                                        _preload_content=params.get('_preload_content', True),
258                                        _request_timeout=params.get('_request_timeout'),
259                                        collection_formats=collection_formats)
260
261    def delete_power_forms(self, account_id, **kwargs):
262        """
263        Deletes one or more PowerForms
264        This method deletes one or more PowerForms. The request body takes an array of PowerForm objects that are deleted based on the `powerFormId`.
265        This method makes a synchronous HTTP request by default. To make an
266        asynchronous HTTP request, please define a `callback` function
267        to be invoked when receiving the response.
268        >>> def callback_function(response):
269        >>>     pprint(response)
270        >>>
271        >>> thread = api.delete_power_forms(account_id, callback=callback_function)
272
273        :param callback function: The callback function
274            for asynchronous request. (optional)
275        :param str account_id: The external account number (int) or account ID Guid. (required)
276        :param PowerFormsRequest power_forms_request:
277        :return: PowerFormsResponse
278                 If the method is called asynchronously,
279                 returns the request thread.
280        """
281        kwargs['_return_http_data_only'] = True
282        if kwargs.get('callback'):
283            return self.delete_power_forms_with_http_info(account_id, **kwargs)
284        else:
285            (data) = self.delete_power_forms_with_http_info(account_id, **kwargs)
286            return data
287
288    def delete_power_forms_with_http_info(self, account_id, **kwargs):
289        """
290        Deletes one or more PowerForms
291        This method deletes one or more PowerForms. The request body takes an array of PowerForm objects that are deleted based on the `powerFormId`.
292        This method makes a synchronous HTTP request by default. To make an
293        asynchronous HTTP request, please define a `callback` function
294        to be invoked when receiving the response.
295        >>> def callback_function(response):
296        >>>     pprint(response)
297        >>>
298        >>> thread = api.delete_power_forms_with_http_info(account_id, callback=callback_function)
299
300        :param callback function: The callback function
301            for asynchronous request. (optional)
302        :param str account_id: The external account number (int) or account ID Guid. (required)
303        :param PowerFormsRequest power_forms_request:
304        :return: PowerFormsResponse
305                 If the method is called asynchronously,
306                 returns the request thread.
307        """
308
309        all_params = ['account_id', 'power_forms_request']
310        all_params.append('callback')
311        all_params.append('_return_http_data_only')
312        all_params.append('_preload_content')
313        all_params.append('_request_timeout')
314
315        params = locals()
316        for key, val in iteritems(params['kwargs']):
317            if key not in all_params:
318                raise TypeError(
319                    "Got an unexpected keyword argument '%s'"
320                    " to method delete_power_forms" % key
321                )
322            params[key] = val
323        del params['kwargs']
324        # verify the required parameter 'account_id' is set
325        if ('account_id' not in params) or (params['account_id'] is None):
326            raise ValueError("Missing the required parameter `account_id` when calling `delete_power_forms`")
327
328
329        collection_formats = {}
330
331        resource_path = '/v2.1/accounts/{accountId}/powerforms'.replace('{format}', 'json')
332        path_params = {}
333        if 'account_id' in params:
334            path_params['accountId'] = params['account_id']
335
336        query_params = {}
337
338        header_params = {}
339
340        form_params = []
341        local_var_files = {}
342
343        body_params = None
344        if 'power_forms_request' in params:
345            body_params = params['power_forms_request']
346        # HTTP header `Accept`
347        header_params['Accept'] = self.api_client.\
348            select_header_accept(['application/json'])
349
350        # Authentication setting
351        auth_settings = []
352
353        return self.api_client.call_api(resource_path, 'DELETE',
354                                        path_params,
355                                        query_params,
356                                        header_params,
357                                        body=body_params,
358                                        post_params=form_params,
359                                        files=local_var_files,
360                                        response_type='PowerFormsResponse',
361                                        auth_settings=auth_settings,
362                                        callback=params.get('callback'),
363                                        _return_http_data_only=params.get('_return_http_data_only'),
364                                        _preload_content=params.get('_preload_content', True),
365                                        _request_timeout=params.get('_request_timeout'),
366                                        collection_formats=collection_formats)
367
368    def get_power_form(self, account_id, power_form_id, **kwargs):
369        """
370        Returns a single PowerForm.
371        This method returns detailed information about a specific PowerForm.
372        This method makes a synchronous HTTP request by default. To make an
373        asynchronous HTTP request, please define a `callback` function
374        to be invoked when receiving the response.
375        >>> def callback_function(response):
376        >>>     pprint(response)
377        >>>
378        >>> thread = api.get_power_form(account_id, power_form_id, callback=callback_function)
379
380        :param callback function: The callback function
381            for asynchronous request. (optional)
382        :param str account_id: The external account number (int) or account ID Guid. (required)
383        :param str power_form_id: (required)
384        :return: PowerForm
385                 If the method is called asynchronously,
386                 returns the request thread.
387        """
388        kwargs['_return_http_data_only'] = True
389        if kwargs.get('callback'):
390            return self.get_power_form_with_http_info(account_id, power_form_id, **kwargs)
391        else:
392            (data) = self.get_power_form_with_http_info(account_id, power_form_id, **kwargs)
393            return data
394
395    def get_power_form_with_http_info(self, account_id, power_form_id, **kwargs):
396        """
397        Returns a single PowerForm.
398        This method returns detailed information about a specific PowerForm.
399        This method makes a synchronous HTTP request by default. To make an
400        asynchronous HTTP request, please define a `callback` function
401        to be invoked when receiving the response.
402        >>> def callback_function(response):
403        >>>     pprint(response)
404        >>>
405        >>> thread = api.get_power_form_with_http_info(account_id, power_form_id, callback=callback_function)
406
407        :param callback function: The callback function
408            for asynchronous request. (optional)
409        :param str account_id: The external account number (int) or account ID Guid. (required)
410        :param str power_form_id: (required)
411        :return: PowerForm
412                 If the method is called asynchronously,
413                 returns the request thread.
414        """
415
416        all_params = ['account_id', 'power_form_id']
417        all_params.append('callback')
418        all_params.append('_return_http_data_only')
419        all_params.append('_preload_content')
420        all_params.append('_request_timeout')
421
422        params = locals()
423        for key, val in iteritems(params['kwargs']):
424            if key not in all_params:
425                raise TypeError(
426                    "Got an unexpected keyword argument '%s'"
427                    " to method get_power_form" % key
428                )
429            params[key] = val
430        del params['kwargs']
431        # verify the required parameter 'account_id' is set
432        if ('account_id' not in params) or (params['account_id'] is None):
433            raise ValueError("Missing the required parameter `account_id` when calling `get_power_form`")
434        # verify the required parameter 'power_form_id' is set
435        if ('power_form_id' not in params) or (params['power_form_id'] is None):
436            raise ValueError("Missing the required parameter `power_form_id` when calling `get_power_form`")
437
438
439        collection_formats = {}
440
441        resource_path = '/v2.1/accounts/{accountId}/powerforms/{powerFormId}'.replace('{format}', 'json')
442        path_params = {}
443        if 'account_id' in params:
444            path_params['accountId'] = params['account_id']
445        if 'power_form_id' in params:
446            path_params['powerFormId'] = params['power_form_id']
447
448        query_params = {}
449
450        header_params = {}
451
452        form_params = []
453        local_var_files = {}
454
455        body_params = None
456        # HTTP header `Accept`
457        header_params['Accept'] = self.api_client.\
458            select_header_accept(['application/json'])
459
460        # Authentication setting
461        auth_settings = []
462
463        return self.api_client.call_api(resource_path, 'GET',
464                                        path_params,
465                                        query_params,
466                                        header_params,
467                                        body=body_params,
468                                        post_params=form_params,
469                                        files=local_var_files,
470                                        response_type='PowerForm',
471                                        auth_settings=auth_settings,
472                                        callback=params.get('callback'),
473                                        _return_http_data_only=params.get('_return_http_data_only'),
474                                        _preload_content=params.get('_preload_content', True),
475                                        _request_timeout=params.get('_request_timeout'),
476                                        collection_formats=collection_formats)
477
478    def get_power_form_data(self, account_id, power_form_id, **kwargs):
479        """
480        Returns the form data associated with the usage of a PowerForm.
481        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.
482        This method makes a synchronous HTTP request by default. To make an
483        asynchronous HTTP request, please define a `callback` function
484        to be invoked when receiving the response.
485        >>> def callback_function(response):
486        >>>     pprint(response)
487        >>>
488        >>> thread = api.get_power_form_data(account_id, power_form_id, callback=callback_function)
489
490        :param callback function: The callback function
491            for asynchronous request. (optional)
492        :param str account_id: The external account number (int) or account ID Guid. (required)
493        :param str power_form_id: (required)
494        :param str data_layout:
495        :param str from_date:
496        :param str to_date:
497        :return: PowerFormsFormDataResponse
498                 If the method is called asynchronously,
499                 returns the request thread.
500        """
501        kwargs['_return_http_data_only'] = True
502        if kwargs.get('callback'):
503            return self.get_power_form_data_with_http_info(account_id, power_form_id, **kwargs)
504        else:
505            (data) = self.get_power_form_data_with_http_info(account_id, power_form_id, **kwargs)
506            return data
507
508    def get_power_form_data_with_http_info(self, account_id, power_form_id, **kwargs):
509        """
510        Returns the form data associated with the usage of a PowerForm.
511        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.
512        This method makes a synchronous HTTP request by default. To make an
513        asynchronous HTTP request, please define a `callback` function
514        to be invoked when receiving the response.
515        >>> def callback_function(response):
516        >>>     pprint(response)
517        >>>
518        >>> thread = api.get_power_form_data_with_http_info(account_id, power_form_id, callback=callback_function)
519
520        :param callback function: The callback function
521            for asynchronous request. (optional)
522        :param str account_id: The external account number (int) or account ID Guid. (required)
523        :param str power_form_id: (required)
524        :param str data_layout:
525        :param str from_date:
526        :param str to_date:
527        :return: PowerFormsFormDataResponse
528                 If the method is called asynchronously,
529                 returns the request thread.
530        """
531
532        all_params = ['account_id', 'power_form_id', 'data_layout', 'from_date', 'to_date']
533        all_params.append('callback')
534        all_params.append('_return_http_data_only')
535        all_params.append('_preload_content')
536        all_params.append('_request_timeout')
537
538        params = locals()
539        for key, val in iteritems(params['kwargs']):
540            if key not in all_params:
541                raise TypeError(
542                    "Got an unexpected keyword argument '%s'"
543                    " to method get_power_form_data" % key
544                )
545            params[key] = val
546        del params['kwargs']
547        # verify the required parameter 'account_id' is set
548        if ('account_id' not in params) or (params['account_id'] is None):
549            raise ValueError("Missing the required parameter `account_id` when calling `get_power_form_data`")
550        # verify the required parameter 'power_form_id' is set
551        if ('power_form_id' not in params) or (params['power_form_id'] is None):
552            raise ValueError("Missing the required parameter `power_form_id` when calling `get_power_form_data`")
553
554
555        collection_formats = {}
556
557        resource_path = '/v2.1/accounts/{accountId}/powerforms/{powerFormId}/form_data'.replace('{format}', 'json')
558        path_params = {}
559        if 'account_id' in params:
560            path_params['accountId'] = params['account_id']
561        if 'power_form_id' in params:
562            path_params['powerFormId'] = params['power_form_id']
563
564        query_params = {}
565        if 'data_layout' in params:
566            query_params['data_layout'] = params['data_layout']
567        if 'from_date' in params:
568            query_params['from_date'] = params['from_date']
569        if 'to_date' in params:
570            query_params['to_date'] = params['to_date']
571
572        header_params = {}
573
574        form_params = []
575        local_var_files = {}
576
577        body_params = None
578        # HTTP header `Accept`
579        header_params['Accept'] = self.api_client.\
580            select_header_accept(['application/json'])
581
582        # Authentication setting
583        auth_settings = []
584
585        return self.api_client.call_api(resource_path, 'GET',
586                                        path_params,
587                                        query_params,
588                                        header_params,
589                                        body=body_params,
590                                        post_params=form_params,
591                                        files=local_var_files,
592                                        response_type='PowerFormsFormDataResponse',
593                                        auth_settings=auth_settings,
594                                        callback=params.get('callback'),
595                                        _return_http_data_only=params.get('_return_http_data_only'),
596                                        _preload_content=params.get('_preload_content', True),
597                                        _request_timeout=params.get('_request_timeout'),
598                                        collection_formats=collection_formats)
599
600    def list_power_form_senders(self, account_id, **kwargs):
601        """
602        Returns the list of PowerForms available to the user.
603        This method returns a list of users who have sent PowerForms.
604        This method makes a synchronous HTTP request by default. To make an
605        asynchronous HTTP request, please define a `callback` function
606        to be invoked when receiving the response.
607        >>> def callback_function(response):
608        >>>     pprint(response)
609        >>>
610        >>> thread = api.list_power_form_senders(account_id, callback=callback_function)
611
612        :param callback function: The callback function
613            for asynchronous request. (optional)
614        :param str account_id: The external account number (int) or account ID Guid. (required)
615        :param str start_position:
616        :return: PowerFormSendersResponse
617                 If the method is called asynchronously,
618                 returns the request thread.
619        """
620        kwargs['_return_http_data_only'] = True
621        if kwargs.get('callback'):
622            return self.list_power_form_senders_with_http_info(account_id, **kwargs)
623        else:
624            (data) = self.list_power_form_senders_with_http_info(account_id, **kwargs)
625            return data
626
627    def list_power_form_senders_with_http_info(self, account_id, **kwargs):
628        """
629        Returns the list of PowerForms available to the user.
630        This method returns a list of users who have sent PowerForms.
631        This method makes a synchronous HTTP request by default. To make an
632        asynchronous HTTP request, please define a `callback` function
633        to be invoked when receiving the response.
634        >>> def callback_function(response):
635        >>>     pprint(response)
636        >>>
637        >>> thread = api.list_power_form_senders_with_http_info(account_id, callback=callback_function)
638
639        :param callback function: The callback function
640            for asynchronous request. (optional)
641        :param str account_id: The external account number (int) or account ID Guid. (required)
642        :param str start_position:
643        :return: PowerFormSendersResponse
644                 If the method is called asynchronously,
645                 returns the request thread.
646        """
647
648        all_params = ['account_id', 'start_position']
649        all_params.append('callback')
650        all_params.append('_return_http_data_only')
651        all_params.append('_preload_content')
652        all_params.append('_request_timeout')
653
654        params = locals()
655        for key, val in iteritems(params['kwargs']):
656            if key not in all_params:
657                raise TypeError(
658                    "Got an unexpected keyword argument '%s'"
659                    " to method list_power_form_senders" % key
660                )
661            params[key] = val
662        del params['kwargs']
663        # verify the required parameter 'account_id' is set
664        if ('account_id' not in params) or (params['account_id'] is None):
665            raise ValueError("Missing the required parameter `account_id` when calling `list_power_form_senders`")
666
667
668        collection_formats = {}
669
670        resource_path = '/v2.1/accounts/{accountId}/powerforms/senders'.replace('{format}', 'json')
671        path_params = {}
672        if 'account_id' in params:
673            path_params['accountId'] = params['account_id']
674
675        query_params = {}
676        if 'start_position' in params:
677            query_params['start_position'] = params['start_position']
678
679        header_params = {}
680
681        form_params = []
682        local_var_files = {}
683
684        body_params = None
685        # HTTP header `Accept`
686        header_params['Accept'] = self.api_client.\
687            select_header_accept(['application/json'])
688
689        # Authentication setting
690        auth_settings = []
691
692        return self.api_client.call_api(resource_path, 'GET',
693                                        path_params,
694                                        query_params,
695                                        header_params,
696                                        body=body_params,
697                                        post_params=form_params,
698                                        files=local_var_files,
699                                        response_type='PowerFormSendersResponse',
700                                        auth_settings=auth_settings,
701                                        callback=params.get('callback'),
702                                        _return_http_data_only=params.get('_return_http_data_only'),
703                                        _preload_content=params.get('_preload_content', True),
704                                        _request_timeout=params.get('_request_timeout'),
705                                        collection_formats=collection_formats)
706
707    def list_power_forms(self, account_id, **kwargs):
708        """
709        Returns the list of PowerForms available to the user.
710        This method returns a list of PowerForms that are available to the user.
711        This method makes a synchronous HTTP request by default. To make an
712        asynchronous HTTP request, please define a `callback` function
713        to be invoked when receiving the response.
714        >>> def callback_function(response):
715        >>>     pprint(response)
716        >>>
717        >>> thread = api.list_power_forms(account_id, callback=callback_function)
718
719        :param callback function: The callback function
720            for asynchronous request. (optional)
721        :param str account_id: The external account number (int) or account ID Guid. (required)
722        :param str from_date:
723        :param str order:
724        :param str order_by:
725        :param str search_fields:
726        :param str search_text:
727        :param str to_date:
728        :return: PowerFormsResponse
729                 If the method is called asynchronously,
730                 returns the request thread.
731        """
732        kwargs['_return_http_data_only'] = True
733        if kwargs.get('callback'):
734            return self.list_power_forms_with_http_info(account_id, **kwargs)
735        else:
736            (data) = self.list_power_forms_with_http_info(account_id, **kwargs)
737            return data
738
739    def list_power_forms_with_http_info(self, account_id, **kwargs):
740        """
741        Returns the list of PowerForms available to the user.
742        This method returns a list of PowerForms that are available to the user.
743        This method makes a synchronous HTTP request by default. To make an
744        asynchronous HTTP request, please define a `callback` function
745        to be invoked when receiving the response.
746        >>> def callback_function(response):
747        >>>     pprint(response)
748        >>>
749        >>> thread = api.list_power_forms_with_http_info(account_id, callback=callback_function)
750
751        :param callback function: The callback function
752            for asynchronous request. (optional)
753        :param str account_id: The external account number (int) or account ID Guid. (required)
754        :param str from_date:
755        :param str order:
756        :param str order_by:
757        :param str search_fields:
758        :param str search_text:
759        :param str to_date:
760        :return: PowerFormsResponse
761                 If the method is called asynchronously,
762                 returns the request thread.
763        """
764
765        all_params = ['account_id', 'from_date', 'order', 'order_by', 'search_fields', 'search_text', 'to_date']
766        all_params.append('callback')
767        all_params.append('_return_http_data_only')
768        all_params.append('_preload_content')
769        all_params.append('_request_timeout')
770
771        params = locals()
772        for key, val in iteritems(params['kwargs']):
773            if key not in all_params:
774                raise TypeError(
775                    "Got an unexpected keyword argument '%s'"
776                    " to method list_power_forms" % key
777                )
778            params[key] = val
779        del params['kwargs']
780        # verify the required parameter 'account_id' is set
781        if ('account_id' not in params) or (params['account_id'] is None):
782            raise ValueError("Missing the required parameter `account_id` when calling `list_power_forms`")
783
784
785        collection_formats = {}
786
787        resource_path = '/v2.1/accounts/{accountId}/powerforms'.replace('{format}', 'json')
788        path_params = {}
789        if 'account_id' in params:
790            path_params['accountId'] = params['account_id']
791
792        query_params = {}
793        if 'from_date' in params:
794            query_params['from_date'] = params['from_date']
795        if 'order' in params:
796            query_params['order'] = params['order']
797        if 'order_by' in params:
798            query_params['order_by'] = params['order_by']
799        if 'search_fields' in params:
800            query_params['search_fields'] = params['search_fields']
801        if 'search_text' in params:
802            query_params['search_text'] = params['search_text']
803        if 'to_date' in params:
804            query_params['to_date'] = params['to_date']
805
806        header_params = {}
807
808        form_params = []
809        local_var_files = {}
810
811        body_params = None
812        # HTTP header `Accept`
813        header_params['Accept'] = self.api_client.\
814            select_header_accept(['application/json'])
815
816        # Authentication setting
817        auth_settings = []
818
819        return self.api_client.call_api(resource_path, 'GET',
820                                        path_params,
821                                        query_params,
822                                        header_params,
823                                        body=body_params,
824                                        post_params=form_params,
825                                        files=local_var_files,
826                                        response_type='PowerFormsResponse',
827                                        auth_settings=auth_settings,
828                                        callback=params.get('callback'),
829                                        _return_http_data_only=params.get('_return_http_data_only'),
830                                        _preload_content=params.get('_preload_content', True),
831                                        _request_timeout=params.get('_request_timeout'),
832                                        collection_formats=collection_formats)
833
834    def update_power_form(self, account_id, power_form_id, **kwargs):
835        """
836        Creates a new PowerForm.
837        This method updates an existing PowerForm.
838        This method makes a synchronous HTTP request by default. To make an
839        asynchronous HTTP request, please define a `callback` function
840        to be invoked when receiving the response.
841        >>> def callback_function(response):
842        >>>     pprint(response)
843        >>>
844        >>> thread = api.update_power_form(account_id, power_form_id, callback=callback_function)
845
846        :param callback function: The callback function
847            for asynchronous request. (optional)
848        :param str account_id: The external account number (int) or account ID Guid. (required)
849        :param str power_form_id: (required)
850        :param PowerForm power_form:
851        :return: PowerForm
852                 If the method is called asynchronously,
853                 returns the request thread.
854        """
855        kwargs['_return_http_data_only'] = True
856        if kwargs.get('callback'):
857            return self.update_power_form_with_http_info(account_id, power_form_id, **kwargs)
858        else:
859            (data) = self.update_power_form_with_http_info(account_id, power_form_id, **kwargs)
860            return data
861
862    def update_power_form_with_http_info(self, account_id, power_form_id, **kwargs):
863        """
864        Creates a new PowerForm.
865        This method updates an existing PowerForm.
866        This method makes a synchronous HTTP request by default. To make an
867        asynchronous HTTP request, please define a `callback` function
868        to be invoked when receiving the response.
869        >>> def callback_function(response):
870        >>>     pprint(response)
871        >>>
872        >>> thread = api.update_power_form_with_http_info(account_id, power_form_id, callback=callback_function)
873
874        :param callback function: The callback function
875            for asynchronous request. (optional)
876        :param str account_id: The external account number (int) or account ID Guid. (required)
877        :param str power_form_id: (required)
878        :param PowerForm power_form:
879        :return: PowerForm
880                 If the method is called asynchronously,
881                 returns the request thread.
882        """
883
884        all_params = ['account_id', 'power_form_id', 'power_form']
885        all_params.append('callback')
886        all_params.append('_return_http_data_only')
887        all_params.append('_preload_content')
888        all_params.append('_request_timeout')
889
890        params = locals()
891        for key, val in iteritems(params['kwargs']):
892            if key not in all_params:
893                raise TypeError(
894                    "Got an unexpected keyword argument '%s'"
895                    " to method update_power_form" % key
896                )
897            params[key] = val
898        del params['kwargs']
899        # verify the required parameter 'account_id' is set
900        if ('account_id' not in params) or (params['account_id'] is None):
901            raise ValueError("Missing the required parameter `account_id` when calling `update_power_form`")
902        # verify the required parameter 'power_form_id' is set
903        if ('power_form_id' not in params) or (params['power_form_id'] is None):
904            raise ValueError("Missing the required parameter `power_form_id` when calling `update_power_form`")
905
906
907        collection_formats = {}
908
909        resource_path = '/v2.1/accounts/{accountId}/powerforms/{powerFormId}'.replace('{format}', 'json')
910        path_params = {}
911        if 'account_id' in params:
912            path_params['accountId'] = params['account_id']
913        if 'power_form_id' in params:
914            path_params['powerFormId'] = params['power_form_id']
915
916        query_params = {}
917
918        header_params = {}
919
920        form_params = []
921        local_var_files = {}
922
923        body_params = None
924        if 'power_form' in params:
925            body_params = params['power_form']
926        # HTTP header `Accept`
927        header_params['Accept'] = self.api_client.\
928            select_header_accept(['application/json'])
929
930        # Authentication setting
931        auth_settings = []
932
933        return self.api_client.call_api(resource_path, 'PUT',
934                                        path_params,
935                                        query_params,
936                                        header_params,
937                                        body=body_params,
938                                        post_params=form_params,
939                                        files=local_var_files,
940                                        response_type='PowerForm',
941                                        auth_settings=auth_settings,
942                                        callback=params.get('callback'),
943                                        _return_http_data_only=params.get('_return_http_data_only'),
944                                        _preload_content=params.get('_preload_content', True),
945                                        _request_timeout=params.get('_request_timeout'),
946                                        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

PowerFormsApi(api_client=None)
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
def create_power_form(self, account_id, **kwargs)
44    def create_power_form(self, account_id, **kwargs):
45        """
46        Creates a new PowerForm.
47        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).  
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.create_power_form(account_id, callback=callback_function)
55
56        :param callback function: The callback function
57            for asynchronous request. (optional)
58        :param str account_id: The external account number (int) or account ID Guid. (required)
59        :param PowerForm power_form:
60        :return: PowerForm
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.create_power_form_with_http_info(account_id, **kwargs)
67        else:
68            (data) = self.create_power_form_with_http_info(account_id, **kwargs)
69            return data

Creates a new PowerForm. This method creates a new PowerForm. You create a PowerForm from an existing DocuSign template, 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?. ### More information For more information about creating PowerForms, see Create a PowerForm.
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.create_power_form(account_id, callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
  • str account_id: The external account number (int) or account ID Guid. (required)
  • PowerForm power_form:
Returns

PowerForm If the method is called asynchronously, returns the request thread.

def create_power_form_with_http_info(self, account_id, **kwargs)
 71    def create_power_form_with_http_info(self, account_id, **kwargs):
 72        """
 73        Creates a new PowerForm.
 74        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).  
 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.create_power_form_with_http_info(account_id, callback=callback_function)
 82
 83        :param callback function: The callback function
 84            for asynchronous request. (optional)
 85        :param str account_id: The external account number (int) or account ID Guid. (required)
 86        :param PowerForm power_form:
 87        :return: PowerForm
 88                 If the method is called asynchronously,
 89                 returns the request thread.
 90        """
 91
 92        all_params = ['account_id', 'power_form']
 93        all_params.append('callback')
 94        all_params.append('_return_http_data_only')
 95        all_params.append('_preload_content')
 96        all_params.append('_request_timeout')
 97
 98        params = locals()
 99        for key, val in iteritems(params['kwargs']):
100            if key not in all_params:
101                raise TypeError(
102                    "Got an unexpected keyword argument '%s'"
103                    " to method create_power_form" % key
104                )
105            params[key] = val
106        del params['kwargs']
107        # verify the required parameter 'account_id' is set
108        if ('account_id' not in params) or (params['account_id'] is None):
109            raise ValueError("Missing the required parameter `account_id` when calling `create_power_form`")
110
111
112        collection_formats = {}
113
114        resource_path = '/v2.1/accounts/{accountId}/powerforms'.replace('{format}', 'json')
115        path_params = {}
116        if 'account_id' in params:
117            path_params['accountId'] = params['account_id']
118
119        query_params = {}
120
121        header_params = {}
122
123        form_params = []
124        local_var_files = {}
125
126        body_params = None
127        if 'power_form' in params:
128            body_params = params['power_form']
129        # HTTP header `Accept`
130        header_params['Accept'] = self.api_client.\
131            select_header_accept(['application/json'])
132
133        # Authentication setting
134        auth_settings = []
135
136        return self.api_client.call_api(resource_path, 'POST',
137                                        path_params,
138                                        query_params,
139                                        header_params,
140                                        body=body_params,
141                                        post_params=form_params,
142                                        files=local_var_files,
143                                        response_type='PowerForm',
144                                        auth_settings=auth_settings,
145                                        callback=params.get('callback'),
146                                        _return_http_data_only=params.get('_return_http_data_only'),
147                                        _preload_content=params.get('_preload_content', True),
148                                        _request_timeout=params.get('_request_timeout'),
149                                        collection_formats=collection_formats)

Creates a new PowerForm. This method creates a new PowerForm. You create a PowerForm from an existing DocuSign template, 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?. ### More information For more information about creating PowerForms, see Create a PowerForm.
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.create_power_form_with_http_info(account_id, callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
  • str account_id: The external account number (int) or account ID Guid. (required)
  • PowerForm power_form:
Returns

PowerForm If the method is called asynchronously, returns the request thread.

def delete_power_form(self, account_id, power_form_id, **kwargs)
151    def delete_power_form(self, account_id, power_form_id, **kwargs):
152        """
153        Delete a PowerForm.
154        This method deletes a PowerForm.
155        This method makes a synchronous HTTP request by default. To make an
156        asynchronous HTTP request, please define a `callback` function
157        to be invoked when receiving the response.
158        >>> def callback_function(response):
159        >>>     pprint(response)
160        >>>
161        >>> thread = api.delete_power_form(account_id, power_form_id, callback=callback_function)
162
163        :param callback function: The callback function
164            for asynchronous request. (optional)
165        :param str account_id: The external account number (int) or account ID Guid. (required)
166        :param str power_form_id: (required)
167        :return: None
168                 If the method is called asynchronously,
169                 returns the request thread.
170        """
171        kwargs['_return_http_data_only'] = True
172        if kwargs.get('callback'):
173            return self.delete_power_form_with_http_info(account_id, power_form_id, **kwargs)
174        else:
175            (data) = self.delete_power_form_with_http_info(account_id, power_form_id, **kwargs)
176            return data

Delete a PowerForm. This method deletes a PowerForm. 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.delete_power_form(account_id, power_form_id, callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
  • str account_id: The external account number (int) or account ID Guid. (required)
  • str power_form_id: (required)
Returns

None If the method is called asynchronously, returns the request thread.

def delete_power_form_with_http_info(self, account_id, power_form_id, **kwargs)
178    def delete_power_form_with_http_info(self, account_id, power_form_id, **kwargs):
179        """
180        Delete a PowerForm.
181        This method deletes a PowerForm.
182        This method makes a synchronous HTTP request by default. To make an
183        asynchronous HTTP request, please define a `callback` function
184        to be invoked when receiving the response.
185        >>> def callback_function(response):
186        >>>     pprint(response)
187        >>>
188        >>> thread = api.delete_power_form_with_http_info(account_id, power_form_id, callback=callback_function)
189
190        :param callback function: The callback function
191            for asynchronous request. (optional)
192        :param str account_id: The external account number (int) or account ID Guid. (required)
193        :param str power_form_id: (required)
194        :return: None
195                 If the method is called asynchronously,
196                 returns the request thread.
197        """
198
199        all_params = ['account_id', 'power_form_id']
200        all_params.append('callback')
201        all_params.append('_return_http_data_only')
202        all_params.append('_preload_content')
203        all_params.append('_request_timeout')
204
205        params = locals()
206        for key, val in iteritems(params['kwargs']):
207            if key not in all_params:
208                raise TypeError(
209                    "Got an unexpected keyword argument '%s'"
210                    " to method delete_power_form" % key
211                )
212            params[key] = val
213        del params['kwargs']
214        # verify the required parameter 'account_id' is set
215        if ('account_id' not in params) or (params['account_id'] is None):
216            raise ValueError("Missing the required parameter `account_id` when calling `delete_power_form`")
217        # verify the required parameter 'power_form_id' is set
218        if ('power_form_id' not in params) or (params['power_form_id'] is None):
219            raise ValueError("Missing the required parameter `power_form_id` when calling `delete_power_form`")
220
221
222        collection_formats = {}
223
224        resource_path = '/v2.1/accounts/{accountId}/powerforms/{powerFormId}'.replace('{format}', 'json')
225        path_params = {}
226        if 'account_id' in params:
227            path_params['accountId'] = params['account_id']
228        if 'power_form_id' in params:
229            path_params['powerFormId'] = params['power_form_id']
230
231        query_params = {}
232
233        header_params = {}
234
235        form_params = []
236        local_var_files = {}
237
238        body_params = None
239        # HTTP header `Accept`
240        header_params['Accept'] = self.api_client.\
241            select_header_accept(['application/json'])
242
243        # Authentication setting
244        auth_settings = []
245
246        return self.api_client.call_api(resource_path, 'DELETE',
247                                        path_params,
248                                        query_params,
249                                        header_params,
250                                        body=body_params,
251                                        post_params=form_params,
252                                        files=local_var_files,
253                                        response_type=None,
254                                        auth_settings=auth_settings,
255                                        callback=params.get('callback'),
256                                        _return_http_data_only=params.get('_return_http_data_only'),
257                                        _preload_content=params.get('_preload_content', True),
258                                        _request_timeout=params.get('_request_timeout'),
259                                        collection_formats=collection_formats)

Delete a PowerForm. This method deletes a PowerForm. 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.delete_power_form_with_http_info(account_id, power_form_id, callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
  • str account_id: The external account number (int) or account ID Guid. (required)
  • str power_form_id: (required)
Returns

None If the method is called asynchronously, returns the request thread.

def delete_power_forms(self, account_id, **kwargs)
261    def delete_power_forms(self, account_id, **kwargs):
262        """
263        Deletes one or more PowerForms
264        This method deletes one or more PowerForms. The request body takes an array of PowerForm objects that are deleted based on the `powerFormId`.
265        This method makes a synchronous HTTP request by default. To make an
266        asynchronous HTTP request, please define a `callback` function
267        to be invoked when receiving the response.
268        >>> def callback_function(response):
269        >>>     pprint(response)
270        >>>
271        >>> thread = api.delete_power_forms(account_id, callback=callback_function)
272
273        :param callback function: The callback function
274            for asynchronous request. (optional)
275        :param str account_id: The external account number (int) or account ID Guid. (required)
276        :param PowerFormsRequest power_forms_request:
277        :return: PowerFormsResponse
278                 If the method is called asynchronously,
279                 returns the request thread.
280        """
281        kwargs['_return_http_data_only'] = True
282        if kwargs.get('callback'):
283            return self.delete_power_forms_with_http_info(account_id, **kwargs)
284        else:
285            (data) = self.delete_power_forms_with_http_info(account_id, **kwargs)
286            return data

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. 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.delete_power_forms(account_id, callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
  • str account_id: The external account number (int) or account ID Guid. (required)
  • PowerFormsRequest power_forms_request:
Returns

PowerFormsResponse If the method is called asynchronously, returns the request thread.

def delete_power_forms_with_http_info(self, account_id, **kwargs)
288    def delete_power_forms_with_http_info(self, account_id, **kwargs):
289        """
290        Deletes one or more PowerForms
291        This method deletes one or more PowerForms. The request body takes an array of PowerForm objects that are deleted based on the `powerFormId`.
292        This method makes a synchronous HTTP request by default. To make an
293        asynchronous HTTP request, please define a `callback` function
294        to be invoked when receiving the response.
295        >>> def callback_function(response):
296        >>>     pprint(response)
297        >>>
298        >>> thread = api.delete_power_forms_with_http_info(account_id, callback=callback_function)
299
300        :param callback function: The callback function
301            for asynchronous request. (optional)
302        :param str account_id: The external account number (int) or account ID Guid. (required)
303        :param PowerFormsRequest power_forms_request:
304        :return: PowerFormsResponse
305                 If the method is called asynchronously,
306                 returns the request thread.
307        """
308
309        all_params = ['account_id', 'power_forms_request']
310        all_params.append('callback')
311        all_params.append('_return_http_data_only')
312        all_params.append('_preload_content')
313        all_params.append('_request_timeout')
314
315        params = locals()
316        for key, val in iteritems(params['kwargs']):
317            if key not in all_params:
318                raise TypeError(
319                    "Got an unexpected keyword argument '%s'"
320                    " to method delete_power_forms" % key
321                )
322            params[key] = val
323        del params['kwargs']
324        # verify the required parameter 'account_id' is set
325        if ('account_id' not in params) or (params['account_id'] is None):
326            raise ValueError("Missing the required parameter `account_id` when calling `delete_power_forms`")
327
328
329        collection_formats = {}
330
331        resource_path = '/v2.1/accounts/{accountId}/powerforms'.replace('{format}', 'json')
332        path_params = {}
333        if 'account_id' in params:
334            path_params['accountId'] = params['account_id']
335
336        query_params = {}
337
338        header_params = {}
339
340        form_params = []
341        local_var_files = {}
342
343        body_params = None
344        if 'power_forms_request' in params:
345            body_params = params['power_forms_request']
346        # HTTP header `Accept`
347        header_params['Accept'] = self.api_client.\
348            select_header_accept(['application/json'])
349
350        # Authentication setting
351        auth_settings = []
352
353        return self.api_client.call_api(resource_path, 'DELETE',
354                                        path_params,
355                                        query_params,
356                                        header_params,
357                                        body=body_params,
358                                        post_params=form_params,
359                                        files=local_var_files,
360                                        response_type='PowerFormsResponse',
361                                        auth_settings=auth_settings,
362                                        callback=params.get('callback'),
363                                        _return_http_data_only=params.get('_return_http_data_only'),
364                                        _preload_content=params.get('_preload_content', True),
365                                        _request_timeout=params.get('_request_timeout'),
366                                        collection_formats=collection_formats)

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. 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.delete_power_forms_with_http_info(account_id, callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
  • str account_id: The external account number (int) or account ID Guid. (required)
  • PowerFormsRequest power_forms_request:
Returns

PowerFormsResponse If the method is called asynchronously, returns the request thread.

def get_power_form(self, account_id, power_form_id, **kwargs)
368    def get_power_form(self, account_id, power_form_id, **kwargs):
369        """
370        Returns a single PowerForm.
371        This method returns detailed information about a specific PowerForm.
372        This method makes a synchronous HTTP request by default. To make an
373        asynchronous HTTP request, please define a `callback` function
374        to be invoked when receiving the response.
375        >>> def callback_function(response):
376        >>>     pprint(response)
377        >>>
378        >>> thread = api.get_power_form(account_id, power_form_id, callback=callback_function)
379
380        :param callback function: The callback function
381            for asynchronous request. (optional)
382        :param str account_id: The external account number (int) or account ID Guid. (required)
383        :param str power_form_id: (required)
384        :return: PowerForm
385                 If the method is called asynchronously,
386                 returns the request thread.
387        """
388        kwargs['_return_http_data_only'] = True
389        if kwargs.get('callback'):
390            return self.get_power_form_with_http_info(account_id, power_form_id, **kwargs)
391        else:
392            (data) = self.get_power_form_with_http_info(account_id, power_form_id, **kwargs)
393            return data

Returns a single PowerForm. This method returns detailed information about a specific PowerForm. 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_power_form(account_id, power_form_id, callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
  • str account_id: The external account number (int) or account ID Guid. (required)
  • str power_form_id: (required)
Returns

PowerForm If the method is called asynchronously, returns the request thread.

def get_power_form_with_http_info(self, account_id, power_form_id, **kwargs)
395    def get_power_form_with_http_info(self, account_id, power_form_id, **kwargs):
396        """
397        Returns a single PowerForm.
398        This method returns detailed information about a specific PowerForm.
399        This method makes a synchronous HTTP request by default. To make an
400        asynchronous HTTP request, please define a `callback` function
401        to be invoked when receiving the response.
402        >>> def callback_function(response):
403        >>>     pprint(response)
404        >>>
405        >>> thread = api.get_power_form_with_http_info(account_id, power_form_id, callback=callback_function)
406
407        :param callback function: The callback function
408            for asynchronous request. (optional)
409        :param str account_id: The external account number (int) or account ID Guid. (required)
410        :param str power_form_id: (required)
411        :return: PowerForm
412                 If the method is called asynchronously,
413                 returns the request thread.
414        """
415
416        all_params = ['account_id', 'power_form_id']
417        all_params.append('callback')
418        all_params.append('_return_http_data_only')
419        all_params.append('_preload_content')
420        all_params.append('_request_timeout')
421
422        params = locals()
423        for key, val in iteritems(params['kwargs']):
424            if key not in all_params:
425                raise TypeError(
426                    "Got an unexpected keyword argument '%s'"
427                    " to method get_power_form" % key
428                )
429            params[key] = val
430        del params['kwargs']
431        # verify the required parameter 'account_id' is set
432        if ('account_id' not in params) or (params['account_id'] is None):
433            raise ValueError("Missing the required parameter `account_id` when calling `get_power_form`")
434        # verify the required parameter 'power_form_id' is set
435        if ('power_form_id' not in params) or (params['power_form_id'] is None):
436            raise ValueError("Missing the required parameter `power_form_id` when calling `get_power_form`")
437
438
439        collection_formats = {}
440
441        resource_path = '/v2.1/accounts/{accountId}/powerforms/{powerFormId}'.replace('{format}', 'json')
442        path_params = {}
443        if 'account_id' in params:
444            path_params['accountId'] = params['account_id']
445        if 'power_form_id' in params:
446            path_params['powerFormId'] = params['power_form_id']
447
448        query_params = {}
449
450        header_params = {}
451
452        form_params = []
453        local_var_files = {}
454
455        body_params = None
456        # HTTP header `Accept`
457        header_params['Accept'] = self.api_client.\
458            select_header_accept(['application/json'])
459
460        # Authentication setting
461        auth_settings = []
462
463        return self.api_client.call_api(resource_path, 'GET',
464                                        path_params,
465                                        query_params,
466                                        header_params,
467                                        body=body_params,
468                                        post_params=form_params,
469                                        files=local_var_files,
470                                        response_type='PowerForm',
471                                        auth_settings=auth_settings,
472                                        callback=params.get('callback'),
473                                        _return_http_data_only=params.get('_return_http_data_only'),
474                                        _preload_content=params.get('_preload_content', True),
475                                        _request_timeout=params.get('_request_timeout'),
476                                        collection_formats=collection_formats)

Returns a single PowerForm. This method returns detailed information about a specific PowerForm. 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_power_form_with_http_info(account_id, power_form_id, callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
  • str account_id: The external account number (int) or account ID Guid. (required)
  • str power_form_id: (required)
Returns

PowerForm If the method is called asynchronously, returns the request thread.

def get_power_form_data(self, account_id, power_form_id, **kwargs)
478    def get_power_form_data(self, account_id, power_form_id, **kwargs):
479        """
480        Returns the form data associated with the usage of a PowerForm.
481        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.
482        This method makes a synchronous HTTP request by default. To make an
483        asynchronous HTTP request, please define a `callback` function
484        to be invoked when receiving the response.
485        >>> def callback_function(response):
486        >>>     pprint(response)
487        >>>
488        >>> thread = api.get_power_form_data(account_id, power_form_id, callback=callback_function)
489
490        :param callback function: The callback function
491            for asynchronous request. (optional)
492        :param str account_id: The external account number (int) or account ID Guid. (required)
493        :param str power_form_id: (required)
494        :param str data_layout:
495        :param str from_date:
496        :param str to_date:
497        :return: PowerFormsFormDataResponse
498                 If the method is called asynchronously,
499                 returns the request thread.
500        """
501        kwargs['_return_http_data_only'] = True
502        if kwargs.get('callback'):
503            return self.get_power_form_data_with_http_info(account_id, power_form_id, **kwargs)
504        else:
505            (data) = self.get_power_form_data_with_http_info(account_id, power_form_id, **kwargs)
506            return data

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. 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_power_form_data(account_id, power_form_id, callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
  • str account_id: The external account number (int) or account ID Guid. (required)
  • str power_form_id: (required)
  • str data_layout:
  • str from_date:
  • str to_date:
Returns

PowerFormsFormDataResponse If the method is called asynchronously, returns the request thread.

def get_power_form_data_with_http_info(self, account_id, power_form_id, **kwargs)
508    def get_power_form_data_with_http_info(self, account_id, power_form_id, **kwargs):
509        """
510        Returns the form data associated with the usage of a PowerForm.
511        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.
512        This method makes a synchronous HTTP request by default. To make an
513        asynchronous HTTP request, please define a `callback` function
514        to be invoked when receiving the response.
515        >>> def callback_function(response):
516        >>>     pprint(response)
517        >>>
518        >>> thread = api.get_power_form_data_with_http_info(account_id, power_form_id, callback=callback_function)
519
520        :param callback function: The callback function
521            for asynchronous request. (optional)
522        :param str account_id: The external account number (int) or account ID Guid. (required)
523        :param str power_form_id: (required)
524        :param str data_layout:
525        :param str from_date:
526        :param str to_date:
527        :return: PowerFormsFormDataResponse
528                 If the method is called asynchronously,
529                 returns the request thread.
530        """
531
532        all_params = ['account_id', 'power_form_id', 'data_layout', 'from_date', 'to_date']
533        all_params.append('callback')
534        all_params.append('_return_http_data_only')
535        all_params.append('_preload_content')
536        all_params.append('_request_timeout')
537
538        params = locals()
539        for key, val in iteritems(params['kwargs']):
540            if key not in all_params:
541                raise TypeError(
542                    "Got an unexpected keyword argument '%s'"
543                    " to method get_power_form_data" % key
544                )
545            params[key] = val
546        del params['kwargs']
547        # verify the required parameter 'account_id' is set
548        if ('account_id' not in params) or (params['account_id'] is None):
549            raise ValueError("Missing the required parameter `account_id` when calling `get_power_form_data`")
550        # verify the required parameter 'power_form_id' is set
551        if ('power_form_id' not in params) or (params['power_form_id'] is None):
552            raise ValueError("Missing the required parameter `power_form_id` when calling `get_power_form_data`")
553
554
555        collection_formats = {}
556
557        resource_path = '/v2.1/accounts/{accountId}/powerforms/{powerFormId}/form_data'.replace('{format}', 'json')
558        path_params = {}
559        if 'account_id' in params:
560            path_params['accountId'] = params['account_id']
561        if 'power_form_id' in params:
562            path_params['powerFormId'] = params['power_form_id']
563
564        query_params = {}
565        if 'data_layout' in params:
566            query_params['data_layout'] = params['data_layout']
567        if 'from_date' in params:
568            query_params['from_date'] = params['from_date']
569        if 'to_date' in params:
570            query_params['to_date'] = params['to_date']
571
572        header_params = {}
573
574        form_params = []
575        local_var_files = {}
576
577        body_params = None
578        # HTTP header `Accept`
579        header_params['Accept'] = self.api_client.\
580            select_header_accept(['application/json'])
581
582        # Authentication setting
583        auth_settings = []
584
585        return self.api_client.call_api(resource_path, 'GET',
586                                        path_params,
587                                        query_params,
588                                        header_params,
589                                        body=body_params,
590                                        post_params=form_params,
591                                        files=local_var_files,
592                                        response_type='PowerFormsFormDataResponse',
593                                        auth_settings=auth_settings,
594                                        callback=params.get('callback'),
595                                        _return_http_data_only=params.get('_return_http_data_only'),
596                                        _preload_content=params.get('_preload_content', True),
597                                        _request_timeout=params.get('_request_timeout'),
598                                        collection_formats=collection_formats)

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. 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_power_form_data_with_http_info(account_id, power_form_id, callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
  • str account_id: The external account number (int) or account ID Guid. (required)
  • str power_form_id: (required)
  • str data_layout:
  • str from_date:
  • str to_date:
Returns

PowerFormsFormDataResponse If the method is called asynchronously, returns the request thread.

def list_power_form_senders(self, account_id, **kwargs)
600    def list_power_form_senders(self, account_id, **kwargs):
601        """
602        Returns the list of PowerForms available to the user.
603        This method returns a list of users who have sent PowerForms.
604        This method makes a synchronous HTTP request by default. To make an
605        asynchronous HTTP request, please define a `callback` function
606        to be invoked when receiving the response.
607        >>> def callback_function(response):
608        >>>     pprint(response)
609        >>>
610        >>> thread = api.list_power_form_senders(account_id, callback=callback_function)
611
612        :param callback function: The callback function
613            for asynchronous request. (optional)
614        :param str account_id: The external account number (int) or account ID Guid. (required)
615        :param str start_position:
616        :return: PowerFormSendersResponse
617                 If the method is called asynchronously,
618                 returns the request thread.
619        """
620        kwargs['_return_http_data_only'] = True
621        if kwargs.get('callback'):
622            return self.list_power_form_senders_with_http_info(account_id, **kwargs)
623        else:
624            (data) = self.list_power_form_senders_with_http_info(account_id, **kwargs)
625            return data

Returns the list of PowerForms available to the user. This method returns a list of users who have sent PowerForms. 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_power_form_senders(account_id, callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
  • str account_id: The external account number (int) or account ID Guid. (required)
  • str start_position:
Returns

PowerFormSendersResponse If the method is called asynchronously, returns the request thread.

def list_power_form_senders_with_http_info(self, account_id, **kwargs)
627    def list_power_form_senders_with_http_info(self, account_id, **kwargs):
628        """
629        Returns the list of PowerForms available to the user.
630        This method returns a list of users who have sent PowerForms.
631        This method makes a synchronous HTTP request by default. To make an
632        asynchronous HTTP request, please define a `callback` function
633        to be invoked when receiving the response.
634        >>> def callback_function(response):
635        >>>     pprint(response)
636        >>>
637        >>> thread = api.list_power_form_senders_with_http_info(account_id, callback=callback_function)
638
639        :param callback function: The callback function
640            for asynchronous request. (optional)
641        :param str account_id: The external account number (int) or account ID Guid. (required)
642        :param str start_position:
643        :return: PowerFormSendersResponse
644                 If the method is called asynchronously,
645                 returns the request thread.
646        """
647
648        all_params = ['account_id', 'start_position']
649        all_params.append('callback')
650        all_params.append('_return_http_data_only')
651        all_params.append('_preload_content')
652        all_params.append('_request_timeout')
653
654        params = locals()
655        for key, val in iteritems(params['kwargs']):
656            if key not in all_params:
657                raise TypeError(
658                    "Got an unexpected keyword argument '%s'"
659                    " to method list_power_form_senders" % key
660                )
661            params[key] = val
662        del params['kwargs']
663        # verify the required parameter 'account_id' is set
664        if ('account_id' not in params) or (params['account_id'] is None):
665            raise ValueError("Missing the required parameter `account_id` when calling `list_power_form_senders`")
666
667
668        collection_formats = {}
669
670        resource_path = '/v2.1/accounts/{accountId}/powerforms/senders'.replace('{format}', 'json')
671        path_params = {}
672        if 'account_id' in params:
673            path_params['accountId'] = params['account_id']
674
675        query_params = {}
676        if 'start_position' in params:
677            query_params['start_position'] = params['start_position']
678
679        header_params = {}
680
681        form_params = []
682        local_var_files = {}
683
684        body_params = None
685        # HTTP header `Accept`
686        header_params['Accept'] = self.api_client.\
687            select_header_accept(['application/json'])
688
689        # Authentication setting
690        auth_settings = []
691
692        return self.api_client.call_api(resource_path, 'GET',
693                                        path_params,
694                                        query_params,
695                                        header_params,
696                                        body=body_params,
697                                        post_params=form_params,
698                                        files=local_var_files,
699                                        response_type='PowerFormSendersResponse',
700                                        auth_settings=auth_settings,
701                                        callback=params.get('callback'),
702                                        _return_http_data_only=params.get('_return_http_data_only'),
703                                        _preload_content=params.get('_preload_content', True),
704                                        _request_timeout=params.get('_request_timeout'),
705                                        collection_formats=collection_formats)

Returns the list of PowerForms available to the user. This method returns a list of users who have sent PowerForms. 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_power_form_senders_with_http_info(account_id, callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
  • str account_id: The external account number (int) or account ID Guid. (required)
  • str start_position:
Returns

PowerFormSendersResponse If the method is called asynchronously, returns the request thread.

def list_power_forms(self, account_id, **kwargs)
707    def list_power_forms(self, account_id, **kwargs):
708        """
709        Returns the list of PowerForms available to the user.
710        This method returns a list of PowerForms that are available to the user.
711        This method makes a synchronous HTTP request by default. To make an
712        asynchronous HTTP request, please define a `callback` function
713        to be invoked when receiving the response.
714        >>> def callback_function(response):
715        >>>     pprint(response)
716        >>>
717        >>> thread = api.list_power_forms(account_id, callback=callback_function)
718
719        :param callback function: The callback function
720            for asynchronous request. (optional)
721        :param str account_id: The external account number (int) or account ID Guid. (required)
722        :param str from_date:
723        :param str order:
724        :param str order_by:
725        :param str search_fields:
726        :param str search_text:
727        :param str to_date:
728        :return: PowerFormsResponse
729                 If the method is called asynchronously,
730                 returns the request thread.
731        """
732        kwargs['_return_http_data_only'] = True
733        if kwargs.get('callback'):
734            return self.list_power_forms_with_http_info(account_id, **kwargs)
735        else:
736            (data) = self.list_power_forms_with_http_info(account_id, **kwargs)
737            return data

Returns the list of PowerForms available to the user. This method returns a list of PowerForms that are available to the user. 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_power_forms(account_id, callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
  • str account_id: The external account number (int) or account ID Guid. (required)
  • str from_date:
  • str order:
  • str order_by:
  • str search_fields:
  • str search_text:
  • str to_date:
Returns

PowerFormsResponse If the method is called asynchronously, returns the request thread.

def list_power_forms_with_http_info(self, account_id, **kwargs)
739    def list_power_forms_with_http_info(self, account_id, **kwargs):
740        """
741        Returns the list of PowerForms available to the user.
742        This method returns a list of PowerForms that are available to the user.
743        This method makes a synchronous HTTP request by default. To make an
744        asynchronous HTTP request, please define a `callback` function
745        to be invoked when receiving the response.
746        >>> def callback_function(response):
747        >>>     pprint(response)
748        >>>
749        >>> thread = api.list_power_forms_with_http_info(account_id, callback=callback_function)
750
751        :param callback function: The callback function
752            for asynchronous request. (optional)
753        :param str account_id: The external account number (int) or account ID Guid. (required)
754        :param str from_date:
755        :param str order:
756        :param str order_by:
757        :param str search_fields:
758        :param str search_text:
759        :param str to_date:
760        :return: PowerFormsResponse
761                 If the method is called asynchronously,
762                 returns the request thread.
763        """
764
765        all_params = ['account_id', 'from_date', 'order', 'order_by', 'search_fields', 'search_text', 'to_date']
766        all_params.append('callback')
767        all_params.append('_return_http_data_only')
768        all_params.append('_preload_content')
769        all_params.append('_request_timeout')
770
771        params = locals()
772        for key, val in iteritems(params['kwargs']):
773            if key not in all_params:
774                raise TypeError(
775                    "Got an unexpected keyword argument '%s'"
776                    " to method list_power_forms" % key
777                )
778            params[key] = val
779        del params['kwargs']
780        # verify the required parameter 'account_id' is set
781        if ('account_id' not in params) or (params['account_id'] is None):
782            raise ValueError("Missing the required parameter `account_id` when calling `list_power_forms`")
783
784
785        collection_formats = {}
786
787        resource_path = '/v2.1/accounts/{accountId}/powerforms'.replace('{format}', 'json')
788        path_params = {}
789        if 'account_id' in params:
790            path_params['accountId'] = params['account_id']
791
792        query_params = {}
793        if 'from_date' in params:
794            query_params['from_date'] = params['from_date']
795        if 'order' in params:
796            query_params['order'] = params['order']
797        if 'order_by' in params:
798            query_params['order_by'] = params['order_by']
799        if 'search_fields' in params:
800            query_params['search_fields'] = params['search_fields']
801        if 'search_text' in params:
802            query_params['search_text'] = params['search_text']
803        if 'to_date' in params:
804            query_params['to_date'] = params['to_date']
805
806        header_params = {}
807
808        form_params = []
809        local_var_files = {}
810
811        body_params = None
812        # HTTP header `Accept`
813        header_params['Accept'] = self.api_client.\
814            select_header_accept(['application/json'])
815
816        # Authentication setting
817        auth_settings = []
818
819        return self.api_client.call_api(resource_path, 'GET',
820                                        path_params,
821                                        query_params,
822                                        header_params,
823                                        body=body_params,
824                                        post_params=form_params,
825                                        files=local_var_files,
826                                        response_type='PowerFormsResponse',
827                                        auth_settings=auth_settings,
828                                        callback=params.get('callback'),
829                                        _return_http_data_only=params.get('_return_http_data_only'),
830                                        _preload_content=params.get('_preload_content', True),
831                                        _request_timeout=params.get('_request_timeout'),
832                                        collection_formats=collection_formats)

Returns the list of PowerForms available to the user. This method returns a list of PowerForms that are available to the user. 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_power_forms_with_http_info(account_id, callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
  • str account_id: The external account number (int) or account ID Guid. (required)
  • str from_date:
  • str order:
  • str order_by:
  • str search_fields:
  • str search_text:
  • str to_date:
Returns

PowerFormsResponse If the method is called asynchronously, returns the request thread.

def update_power_form(self, account_id, power_form_id, **kwargs)
834    def update_power_form(self, account_id, power_form_id, **kwargs):
835        """
836        Creates a new PowerForm.
837        This method updates an existing PowerForm.
838        This method makes a synchronous HTTP request by default. To make an
839        asynchronous HTTP request, please define a `callback` function
840        to be invoked when receiving the response.
841        >>> def callback_function(response):
842        >>>     pprint(response)
843        >>>
844        >>> thread = api.update_power_form(account_id, power_form_id, callback=callback_function)
845
846        :param callback function: The callback function
847            for asynchronous request. (optional)
848        :param str account_id: The external account number (int) or account ID Guid. (required)
849        :param str power_form_id: (required)
850        :param PowerForm power_form:
851        :return: PowerForm
852                 If the method is called asynchronously,
853                 returns the request thread.
854        """
855        kwargs['_return_http_data_only'] = True
856        if kwargs.get('callback'):
857            return self.update_power_form_with_http_info(account_id, power_form_id, **kwargs)
858        else:
859            (data) = self.update_power_form_with_http_info(account_id, power_form_id, **kwargs)
860            return data

Creates a new PowerForm. This method updates an existing PowerForm. 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.update_power_form(account_id, power_form_id, callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
  • str account_id: The external account number (int) or account ID Guid. (required)
  • str power_form_id: (required)
  • PowerForm power_form:
Returns

PowerForm If the method is called asynchronously, returns the request thread.

def update_power_form_with_http_info(self, account_id, power_form_id, **kwargs)
862    def update_power_form_with_http_info(self, account_id, power_form_id, **kwargs):
863        """
864        Creates a new PowerForm.
865        This method updates an existing PowerForm.
866        This method makes a synchronous HTTP request by default. To make an
867        asynchronous HTTP request, please define a `callback` function
868        to be invoked when receiving the response.
869        >>> def callback_function(response):
870        >>>     pprint(response)
871        >>>
872        >>> thread = api.update_power_form_with_http_info(account_id, power_form_id, callback=callback_function)
873
874        :param callback function: The callback function
875            for asynchronous request. (optional)
876        :param str account_id: The external account number (int) or account ID Guid. (required)
877        :param str power_form_id: (required)
878        :param PowerForm power_form:
879        :return: PowerForm
880                 If the method is called asynchronously,
881                 returns the request thread.
882        """
883
884        all_params = ['account_id', 'power_form_id', 'power_form']
885        all_params.append('callback')
886        all_params.append('_return_http_data_only')
887        all_params.append('_preload_content')
888        all_params.append('_request_timeout')
889
890        params = locals()
891        for key, val in iteritems(params['kwargs']):
892            if key not in all_params:
893                raise TypeError(
894                    "Got an unexpected keyword argument '%s'"
895                    " to method update_power_form" % key
896                )
897            params[key] = val
898        del params['kwargs']
899        # verify the required parameter 'account_id' is set
900        if ('account_id' not in params) or (params['account_id'] is None):
901            raise ValueError("Missing the required parameter `account_id` when calling `update_power_form`")
902        # verify the required parameter 'power_form_id' is set
903        if ('power_form_id' not in params) or (params['power_form_id'] is None):
904            raise ValueError("Missing the required parameter `power_form_id` when calling `update_power_form`")
905
906
907        collection_formats = {}
908
909        resource_path = '/v2.1/accounts/{accountId}/powerforms/{powerFormId}'.replace('{format}', 'json')
910        path_params = {}
911        if 'account_id' in params:
912            path_params['accountId'] = params['account_id']
913        if 'power_form_id' in params:
914            path_params['powerFormId'] = params['power_form_id']
915
916        query_params = {}
917
918        header_params = {}
919
920        form_params = []
921        local_var_files = {}
922
923        body_params = None
924        if 'power_form' in params:
925            body_params = params['power_form']
926        # HTTP header `Accept`
927        header_params['Accept'] = self.api_client.\
928            select_header_accept(['application/json'])
929
930        # Authentication setting
931        auth_settings = []
932
933        return self.api_client.call_api(resource_path, 'PUT',
934                                        path_params,
935                                        query_params,
936                                        header_params,
937                                        body=body_params,
938                                        post_params=form_params,
939                                        files=local_var_files,
940                                        response_type='PowerForm',
941                                        auth_settings=auth_settings,
942                                        callback=params.get('callback'),
943                                        _return_http_data_only=params.get('_return_http_data_only'),
944                                        _preload_content=params.get('_preload_content', True),
945                                        _request_timeout=params.get('_request_timeout'),
946                                        collection_formats=collection_formats)

Creates a new PowerForm. This method updates an existing PowerForm. 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.update_power_form_with_http_info(account_id, power_form_id, callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
  • str account_id: The external account number (int) or account ID Guid. (required)
  • str power_form_id: (required)
  • PowerForm power_form:
Returns

PowerForm If the method is called asynchronously, returns the request thread.