def recurring_invoice_history_list(self, response):
        """This method parses the json object and returns list of comments 
            object.

        Args: 
            response(dict): Response containing json object.
 
        Returns:
            instance: Comments list object.

        """
        comments = CommentList()
        for value in response['comments']:
            comment = Comment()
            comment.set_comment_id(value['comment_id'])
            comment.set_recurring_invoice_id(value['recurring_invoice_id'])
            comment.set_description(value['description'])
            comment.set_commented_by_id(value['commented_by_id'])
            comment.set_commented_by(value['commented_by'])
            comment.set_comment_type(value['comment_type'])
            comment.set_date(value['date'])
            comment.set_date_description(value['date_description'])
            comment.set_time(value['time'])
            comment.set_operation_type(value['operation_type'])
            comment.set_transaction_id(value['transaction_id'])
            comment.set_transaction_type(value['transaction_type'])
            comments.set_comments(comment)
        return comments
Exemple #2
0
    def get_comments(self, resp):
        """This method parses the given response and returns comments list.

        Args:
            resp(dict): Response containing comments list.

        Returns:
            instance: Comments List object.

        """
        comments_list = CommentList()
        for value in resp['comments']:
            comment = Comment()
            comment.set_comment_id(value['comment_id'])
            comment.set_recurring_expense_id(value['recurring_expense_id'])
            comment.set_description(value['description'])
            comment.set_commented_by_id(value['commented_by_id'])
            comment.set_commented_by(value['commented_by'])
            comment.set_date(value['date'])
            comment.set_date_description(value['date_description'])
            comment.set_time(value['time'])
            comment.set_operation_type(value['operation_type'])
            comment.set_transaction_id(value['transaction_id'])
            comment.set_transaction_type(value['transaction_type'])
            comments_list.set_comments(comment)
        return comments_list
    def get_comments(self, resp):
        """This method parses the given json string and returns comments list.

        Args:
            resp(dict): Response containing json object for comments.

        Returns:
            instance: Comments list object.

        """
        comments = CommentList()
        for value in resp['comments']:
            comment = Comment()
            comment.set_comment_id(value['comment_id'])
            comment.set_expense_id(value['expense_id'])
            comment.set_description(value['description'])
            comment.set_commented_by_id(value['commented_by_id'])
            comment.set_commented_by(value['commented_by'])
            comment.set_date(value['date'])
            comment.set_date_description(value['date_description'])
            comment.set_time(value['time'])
            comment.set_operation_type(value['operation_type'])
            comment.set_transaction_id(value['transaction_id'])
            comment.set_transaction_type(value['transaction_type'])
            comments.set_comments(comment)
        return comments
    def comments_list(self,response):
        """This method parses the given response and returns the comments list.

        Args:
            response(dict): Response containing json object for comments list.
 
        Returns:
            list of instance: List of comments object.

        """ 
        comments_list = CommentList()
        for value in response['comments']:
            comment = Comment() 
            comment.set_comment_id(value['comment_id'])
            comment.set_creditnote_id(value['creditnote_id'])
            comment.set_description(value['description'])
            comment.set_commented_by_id(value['commented_by_id'])
            comment.set_commented_by(value['commented_by'])
            comment.set_comment_type(value['comment_type'])
            comment.set_date(value['date'])
            comment.set_date_description(value['date_description'])
            comment.set_time(value['time'])
            comment.set_operation_type(value['operation_type'])
            comment.set_transaction_id(value['transaction_id'])
            comment.set_transaction_type(value['transaction_type'])
            comments_list.set_comments(comment)
        return comments_list
    def get_comments(self, resp):
        """This method parses the given response and returns comments list 
            object.

        Args: 
            resp(dict): Response containing json object for comments list.

        Returns:
            list of instance: Comments list object.

        """
        comments = CommentList()
        for value in resp['comments']:
            comment = Comment()
            comment.set_comment_id(value['comment_id'])
            comment.set_project_id(value['project_id'])
            comment.set_description(value['description'])
            comment.set_commented_by_id(value['commented_by_id'])
            comment.set_commented_by(value['commented_by'])
            comment.set_is_current_user(value['is_current_user'])
            comment.set_date(value['date'])
            comment.set_date_description(value['date_description'])
            comment.set_time(value['time'])
            comments.set_comments(comment)
        return comments
    def get_comments(self, resp):
        """This method parses the given response and returns comments list 
            object.

        Args: 
            resp(dict): Response containing json object for comments list.

        Returns:
            list of instance: Comments list object.

        """
        comments = CommentList()
        for value in resp['comments']:
            comment = Comment()
            comment.set_comment_id(value['comment_id'])
            comment.set_project_id(value['project_id'])
            comment.set_description(value['description'])
            comment.set_commented_by_id(value['commented_by_id'])
            comment.set_commented_by(value['commented_by'])
            comment.set_is_current_user(value['is_current_user'])
            comment.set_date(value['date'])
            comment.set_date_description(value['date_description'])
            comment.set_time(value['time'])
            comments.set_comments(comment)
        return comments
    def recurring_invoice_history_list(self, response):
        """This method parses the json object and returns list of comments 
            object.

        Args: 
            response(dict): Response containing json object.
 
        Returns:
            instance: Comments list object.

        """
        comments = CommentList()
        for value in response['comments']:
            comment = Comment()
            comment.set_comment_id(value['comment_id'])
            comment.set_recurring_invoice_id(value['recurring_invoice_id'])
            comment.set_description(value['description'])
            comment.set_commented_by_id(value['commented_by_id'])
            comment.set_commented_by(value['commented_by'])
            comment.set_comment_type(value['comment_type'])
            comment.set_date(value['date'])
            comment.set_date_description(value['date_description'])
            comment.set_time(value['time'])
            comment.set_operation_type(value['operation_type'])
            comment.set_transaction_id(value['transaction_id'])
            comment.set_transaction_type(value['transaction_type'])
            comments.set_comments(comment)
        return comments
 def get_comments(self, resp):
     comments = CommentList()
     for value in resp['comments']:
         comment = Comment()
         comment.set_comment_id(value['comment_id'])
         comment.set_bill_id(value['bill_id'])
         comment.set_description(value['description'])
         comment.set_commented_by_id(value['commented_by_id'])
         comment.set_commented_by(value['commented_by'])
         comment.set_comment_type(value['comment_type'])
         comment.set_date(value['date'])
         comment.set_date_description(value['date_description'])
         comment.set_time(value['time'])
         comment.set_operation_type(value['operation_type'])
         comment.set_transaction_id(value['transaction_id'])
         comment.set_transaction_type(value['transaction_type'])
         comments.set_comments(comment)
     return comments
 def get_comments(self, resp):
     comments = CommentList()
     for value in resp['comments']:
         comment = Comment()
         comment.set_comment_id(value['comment_id'])
         comment.set_bill_id(value['bill_id'])
         comment.set_description(value['description'])
         comment.set_commented_by_id(value['commented_by_id'])
         comment.set_commented_by(value['commented_by'])
         comment.set_comment_type(value['comment_type'])
         comment.set_date(value['date'])
         comment.set_date_description(value['date_description'])
         comment.set_time(value['time'])
         comment.set_operation_type(value['operation_type'])
         comment.set_transaction_id(value['transaction_id'])
         comment.set_transaction_type(value['transaction_type'])
         comments.set_comments(comment)
     return comments
    def get_comment_list(self, response):
        """This method parses the given response and creates object for 
            comments list.

        Args:
            response(dict): Response containing json object for comments list.

        Returns:
            instance: cComments list object.

        """
        comment_list = CommentList()
        contact_comments = response['contact_comments']
        for value in contact_comments:
            contact_comment = Comment() 
            contact_comment.set_comment_id(value['comment_id'])
            contact_comment.set_contact_id(value['contact_id'])
            contact_comment.set_contact_name(value['contact_name'])
            contact_comment.set_description(value['description'])
            contact_comment.set_commented_by_id(value['commented_by_id'])
            contact_comment.set_commented_by(value['commented_by'])
            contact_comment.set_date(value['date'])
            contact_comment.set_date_description(value['date_description'])
            contact_comment.set_time(value['time'])
            contact_comment.set_transaction_id(value['transaction_id'])
            contact_comment.set_transaction_type(value['transaction_type'])
            contact_comment.set_is_entity_deleted(value['is_entity_deleted'])
            contact_comment.set_operation_type(value['operation_type'])
            comment_list.set_comments(contact_comment)
        page_context = response['page_context']
        page_context_object = PageContext()
        page_context_object.set_page(page_context['page'])
        page_context_object.set_per_page(page_context['per_page'])
        page_context_object.set_has_more_page(page_context['has_more_page'])
        page_context_object.set_applied_filter(page_context['applied_filter'])
        page_context_object.set_sort_column(page_context['sort_column'])
        page_context_object.set_sort_order(page_context['sort_order'])
        comment_list.set_page_context(page_context_object)
    
        return comment_list
Exemple #11
0
    def get_comment_list(self, response):
        """This method parses the given response and creates object for
            comments list.

        Args:
            response(dict): Response containing json object for comments list.

        Returns:
            instance: cComments list object.

        """
        comment_list = CommentList()
        contact_comments = response['contact_comments']
        for value in contact_comments:
            contact_comment = Comment()
            contact_comment.set_comment_id(value['comment_id'])
            contact_comment.set_contact_id(value['contact_id'])
            contact_comment.set_contact_name(value['contact_name'])
            contact_comment.set_description(value['description'])
            contact_comment.set_commented_by_id(value['commented_by_id'])
            contact_comment.set_commented_by(value['commented_by'])
            contact_comment.set_date(value['date'])
            contact_comment.set_date_description(value['date_description'])
            contact_comment.set_time(value['time'])
            contact_comment.set_transaction_id(value['transaction_id'])
            contact_comment.set_transaction_type(value['transaction_type'])
            contact_comment.set_is_entity_deleted(value['is_entity_deleted'])
            contact_comment.set_operation_type(value['operation_type'])
            comment_list.set_comments(contact_comment)
        page_context = response['page_context']
        page_context_object = PageContext()
        page_context_object.set_page(page_context['page'])
        page_context_object.set_per_page(page_context['per_page'])
        page_context_object.set_has_more_page(page_context['has_more_page'])
        page_context_object.set_applied_filter(page_context['applied_filter'])
        page_context_object.set_sort_column(page_context['sort_column'])
        page_context_object.set_sort_order(page_context['sort_order'])
        comment_list.set_page_context(page_context_object)

        return comment_list