def comments_list(self,response): """This method parses the given response and returns list of comments. Args: response(dict): Response containing json object for comments list. Returns: instance: Comments list object. """ comments = CommentList() for value in response['comments']: comment = Comment() comment.set_comment_id(value['comment_id']) comment.set_invoice_id(value['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_operation_type(value['operation_type']) comment.set_date(value['date']) comment.set_date_description(value['date_description']) comment.set_time(value['time']) 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 list of comments. Args: response(dict): Response containing json object for comments list. Returns: instance: Comments list object. """ comments = CommentList() for value in response['comments']: comment = Comment() comment.set_comment_id(value['comment_id']) comment.set_invoice_id(value['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_operation_type(value['operation_type']) comment.set_date(value['date']) comment.set_date_description(value['date_description']) comment.set_time(value['time']) comment.set_transaction_id(value['transaction_id']) comment.set_transaction_type(value['transaction_type']) comments.set_comments(comment) return comments
def get_comment(self,response): """This method parses the given response and returns comments object. Args: response(dict): Response containing json object for comments. Returns: instance: Comments object. """ comment = response['comment'] comment_obj = Comment() comment_obj.set_comment_id(comment['comment_id']) comment_obj.set_invoice_id(comment['invoice_id']) comment_obj.set_description(comment['description']) comment_obj.set_commented_by_id(comment['commented_by_id']) comment_obj.set_commented_by(comment['commented_by']) comment_obj.set_date(comment['date']) comment_obj.set_date_description(comment['date_description']) comment_obj.set_time(comment['time']) comment_obj.set_comment_type(comment['comment_type']) return comment_obj
def get_comment(self, response): """This method parses the given response and returns comments object. Args: response(dict): Response containing json object for comments. Returns: instance: Comments object. """ comment = response['comment'] comment_obj = Comment() comment_obj.set_comment_id(comment['comment_id']) comment_obj.set_invoice_id(comment['invoice_id']) comment_obj.set_description(comment['description']) comment_obj.set_commented_by_id(comment['commented_by_id']) comment_obj.set_commented_by(comment['commented_by']) comment_obj.set_date(comment['date']) comment_obj.set_date_description(comment['date_description']) comment_obj.set_time(comment['time']) comment_obj.set_comment_type(comment['comment_type']) return comment_obj