def _create_embedded_unclaimed_draft_with_template(self, test_mode=False, client_id=None, is_for_embedded_signing=False, template_id=None, template_ids=None, requester_email_address=None, title=None, subject=None, message=None, signers=None, ccs=None, signing_redirect_url=None, requesting_redirect_url=None, metadata=None, custom_fields=None, allow_decline=False):
        ''' Helper method for creating unclaimed drafts from templates
            See public function for params.
        '''

        #single params
        payload = {
            "test_mode": self._boolean(test_mode),
            "client_id": client_id,
            "is_for_embedded_signing": self._boolean(is_for_embedded_signing),
            "template_id": template_id,
            "requester_email_address": requester_email_address,
            "title": title,
            "subject": subject,
            "message": message,
            "signing_redirect_url": signing_redirect_url,
            "requesting_redirect_url": requesting_redirect_url,
            "allow_decline": self._boolean(allow_decline)
        }

        #format multi params
        template_ids_payload = HSFormat.format_param_list(template_ids, 'template_ids')
        signers_payload = HSFormat.format_dict_list(signers, 'signers', 'role_name')
        ccs_payload = HSFormat.format_dict_list(ccs, 'ccs', 'role_name')
        metadata_payload = HSFormat.format_single_dict(metadata, 'metadata')
        custom_fields_payload = HSFormat.format_custom_fields(custom_fields)

        #assemble payload
        data = {}
        data.update(payload)
        data.update(template_ids_payload)
        data.update(signers_payload)
        data.update(ccs_payload)
        data.update(metadata_payload)
        data.update(custom_fields_payload)
        data = HSFormat.strip_none_values(data)

        #send call
        url = self.UNCLAIMED_DRAFT_CREATE_EMBEDDED_WITH_TEMPLATE_URL
        request = self._get_request()
        response = request.post(url, data=data)

        return response
def _create_embedded_unclaimed_draft_with_template ( self , test_mode = False , client_id = None , is_for_embedded_signing = False , template_id = None , template_ids = None , requester_email_address = None , title = None , subject = None , message = None , signers = None , ccs = None , signing_redirect_url = None , requesting_redirect_url = None , metadata = None , custom_fields = None , allow_decline = False ) : payload = { "test_mode" : self . _boolean ( test_mode ) , "client_id" : client_id , "is_for_embedded_signing" : self . _boolean ( is_for_embedded_signing ) , "template_id" : template_id , "requester_email_address" : requester_email_address , "title" : title , "subject" : subject , "message" : message , "signing_redirect_url" : signing_redirect_url , "requesting_redirect_url" : requesting_redirect_url , "allow_decline" : self . _boolean ( allow_decline ) } template_ids_payload = HSFormat . format_param_list ( template_ids , 'template_ids' ) signers_payload = HSFormat . format_dict_list ( signers , 'signers' , 'role_name' ) ccs_payload = HSFormat . format_dict_list ( ccs , 'ccs' , 'role_name' ) metadata_payload = HSFormat . format_single_dict ( metadata , 'metadata' ) custom_fields_payload = HSFormat . format_custom_fields ( custom_fields ) data = { } data . update ( payload ) data . update ( template_ids_payload ) data . update ( signers_payload ) data . update ( ccs_payload ) data . update ( metadata_payload ) data . update ( custom_fields_payload ) data = HSFormat . strip_none_values ( data ) url = self . UNCLAIMED_DRAFT_CREATE_EMBEDDED_WITH_TEMPLATE_URL request = self . _get_request ( ) response = request . post ( url , data = data ) return response
Helper method for creating unclaimed drafts from templates
            See public function for params.