@staticmethod
def convert_doc_to_pb(doc, pb):
    '\n        Convert from database document to protobuf.\n\n        :param dict doc: Database document.\n        :param pb: An empty protobuf.\n        :type pb: starbelly.starbelly_pb2.PolicyMimeTypeRules\n        '
    for doc_mime in doc:
        pb_mime = pb.add()
        if ('pattern' in doc_mime):
            pb_mime.pattern = doc_mime['pattern']
        if ('match' in doc_mime):
            pb_mime.match = MATCH_ENUM.Value(doc_mime['match'])
        if ('save' in doc_mime):
            pb_mime.save = doc_mime['save']
Convert from database document to protobuf.

:param dict doc: Database document.
:param pb: An empty protobuf.
:type pb: starbelly.starbelly_pb2.PolicyMimeTypeRules
@staticmethod
def convert_doc_to_pb(doc, pb):
    '\n        Convert from database document to protobuf.\n\n        :param dict doc: Database document.\n        :param pb: An empty protobuf.\n        :type pb: starbelly.starbelly_pb2.PolicyMimeTypeRules\n        '
    for doc_mime in doc:
        pb_mime = pb.add()
        if ('pattern' in doc_mime):
            pb_mime.pattern = doc_mime['pattern']
        if ('match' in doc_mime):
            pb_mime.match = MATCH_ENUM.Value(doc_mime['match'])
        if ('save' in doc_mime):
            pb_mime.save = doc_mime['save']