@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.PolicyProxyRules\n        :returns: Database document.\n        :rtype: dict\n        '
    for pb_proxy in pb:
        doc_proxy = dict()
        if pb_proxy.HasField('pattern'):
            doc_proxy['pattern'] = pb_proxy.pattern
        if pb_proxy.HasField('match'):
            doc_proxy['match'] = MATCH_ENUM.Name(pb_proxy.match)
        if pb_proxy.HasField('proxy_url'):
            doc_proxy['proxy_url'] = pb_proxy.proxy_url
        doc.append(doc_proxy)
Convert protobuf to database document.

:param pb: A protobuf
:type pb: starbelly.starbelly_pb2.PolicyProxyRules
: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.PolicyProxyRules\n        :returns: Database document.\n        :rtype: dict\n        '
    for pb_proxy in pb:
        doc_proxy = dict()
        if pb_proxy.HasField('pattern'):
            doc_proxy['pattern'] = pb_proxy.pattern
        if pb_proxy.HasField('match'):
            doc_proxy['match'] = MATCH_ENUM.Name(pb_proxy.match)
        if pb_proxy.HasField('proxy_url'):
            doc_proxy['proxy_url'] = pb_proxy.proxy_url
        doc.append(doc_proxy)