@classmethod
  def MessageEntriesToJson(cls, cors_message):
    json_text = ''
    # Because CORS is a MessageField, serialize/deserialize as JSON list.
    json_text += '['
    printed_one = False
    for cors_entry in cors_message:
      if printed_one:
        json_text += ','
      else:
        printed_one = True
      json_text += encoding.MessageToJson(cors_entry)
    json_text += ']\n'
    return json_text
Translates an apitools message to CORS JSON.
dataset/ETHPy150Open GoogleCloudPlatform/gsutil/gslib/translation_helper.py/CorsTranslation.MessageEntriesToJson