# Path: apitools/base/py/exceptions.py
# class Error(Exception):
# class TypecheckError(Error, TypeError):
# class NotFoundError(Error):
# class UserError(Error):
# class InvalidDataError(Error):
# class CommunicationError(Error):
# class HttpError(CommunicationError):
# class InvalidUserInputError(InvalidDataError):
# class InvalidDataFromServerError(InvalidDataError, CommunicationError):
# class BatchError(Error):
# class ConfigurationError(Error):
# class GeneratedClientError(Error):
# class ConfigurationValueError(UserError):
# class ResourceUnavailableError(Error):
# class CredentialsError(Error):
# class TransferError(CommunicationError):
# class TransferRetryError(TransferError):
# class TransferInvalidError(TransferError):
# class RequestError(CommunicationError):
# class RetryAfterError(HttpError):
# class BadStatusCodeError(HttpError):
# class NotYetImplementedError(GeneratedClientError):
# class StreamExhausted(Error):
#   def __init__(self, response, content, url):
#   def __str__(self):
#   def status_code(self):
#   def FromResponse(cls, http_response):
#   def __init__(self, response, content, url, retry_after):
#   def FromResponse(cls, http_response):


import base64
import collections
import datetime
import json
import logging
import six
from protorpc import message_types
from protorpc import messages
from protorpc import protojson
from apitools.base.py import exceptions
  return repr(msg)


def _GetField(message, field_path):
  for field in field_path:
    if field not in dir(message):
      raise KeyError('no field "%s"' % field)
    message = getattr(message, field)
  return message


def _SetField(dictblob, field_path, value):
  for field in field_path[:-1]:
    dictblob[field] = {}
    dictblob = dictblob[field]
  dictblob[field_path[-1]] = value


def _IncludeFields(encoded_message, message, include_fields):
  """Add the requested fields to the encoded message."""
  if include_fields is None:
    return encoded_message
  result = json.loads(encoded_message)
  for field_name in include_fields:
    try:
      value = _GetField(message, field_name.split('.'))
      nullvalue = None
      if isinstance(value, list):
        nullvalue = []
    except KeyError:

# Path: apitools/base/py/exceptions.py
# class Error(Exception):
# class TypecheckError(Error, TypeError):
# class NotFoundError(Error):
# class UserError(Error):
# class InvalidDataError(Error):
# class CommunicationError(Error):
# class HttpError(CommunicationError):
# class InvalidUserInputError(InvalidDataError):
# class InvalidDataFromServerError(InvalidDataError, CommunicationError):
# class BatchError(Error):
# class ConfigurationError(Error):
# class GeneratedClientError(Error):
# class ConfigurationValueError(UserError):
# class ResourceUnavailableError(Error):
# class CredentialsError(Error):
# class TransferError(CommunicationError):
# class TransferRetryError(TransferError):
# class TransferInvalidError(TransferError):
# class RequestError(CommunicationError):
# class RetryAfterError(HttpError):
# class BadStatusCodeError(HttpError):
# class NotYetImplementedError(GeneratedClientError):
# class StreamExhausted(Error):
#   def __init__(self, response, content, url):
#   def __str__(self):
#   def status_code(self):
#   def FromResponse(cls, http_response):
#   def __init__(self, response, content, url, retry_after):
#   def FromResponse(cls, http_response):


# Path: apitools/base/py/encoding.py
import base64
import collections
import datetime
import json
import logging
import six
from protorpc import message_types
from protorpc import messages
from protorpc import protojson
from apitools.base.py import exceptions

  return repr(msg)


def _GetField(message, field_path):
  for field in field_path:
    if field not in dir(message):
      raise KeyError('no field "%s"' % field)
    message = getattr(message, field)
  return message


def _SetField(dictblob, field_path, value):
  for field in field_path[:-1]:
    dictblob[field] = {}
    dictblob = dictblob[field]
  dictblob[field_path[-1]] = value


def _IncludeFields(encoded_message, message, include_fields):
  """Add the requested fields to the encoded message."""
  if include_fields is None:
    return encoded_message
  result = json.loads(encoded_message)
  for field_name in include_fields:
    try:
      value = _GetField(message, field_name.split('.'))
      nullvalue = None
      if isinstance(value, list):
        nullvalue = []
    except KeyError:

      raise exceptions.InvalidDataError(