@staticmethod
def convert_pb_to_doc(pb, doc):
    '\n        Convert protobuf to database document.\n\n        :param pb: A protobuf\n        :type pb: starbelly.starbelly_pb2.PolicyUrlRules\n        :returns: Database document.\n        :rtype: dict\n        '
    for pb_url in pb:
        doc_url = dict()
        if pb_url.HasField('pattern'):
            doc_url['pattern'] = pb_url.pattern
        if pb_url.HasField('match'):
            doc_url['match'] = MATCH_ENUM.Name(pb_url.match)
        if pb_url.HasField('action'):
            doc_url['action'] = ACTION_ENUM.Name(pb_url.action)
        if pb_url.HasField('amount'):
            doc_url['amount'] = pb_url.amount
        doc.append(doc_url)
Convert protobuf to database document.

:param pb: A protobuf
:type pb: starbelly.starbelly_pb2.PolicyUrlRules
:returns: Database document.
:rtype: dict
@staticmethod
def convert_pb_to_doc(pb, doc):
    '\n        Convert protobuf to database document.\n\n        :param pb: A protobuf\n        :type pb: starbelly.starbelly_pb2.PolicyUrlRules\n        :returns: Database document.\n        :rtype: dict\n        '
    for pb_url in pb:
        doc_url = dict()
        if pb_url.HasField('pattern'):
            doc_url['pattern'] = pb_url.pattern
        if pb_url.HasField('match'):
            doc_url['match'] = MATCH_ENUM.Name(pb_url.match)
        if pb_url.HasField('action'):
            doc_url['action'] = ACTION_ENUM.Name(pb_url.action)
        if pb_url.HasField('amount'):
            doc_url['amount'] = pb_url.amount
        doc.append(doc_url)