def __init__(self, data, options, data_type):
        # it would be nice to have some json schemas or something to validate
        # for now here are some docs
        """
        data: Can be any array of dicts
        options: {
          mappings: "a dict: converts keys matching key of the mappings dict
              to the value in the mapping dict",
          additionalFields: "a dict:
              key value pairs will be added into the returned data",
          idMapping: "a list of keys or single key string: for each key
              the corresponding values will be concatenated in order to create
              a unique _humanId field on the returned data and base64
              encoded in order to create an _id field. If no idMapping
              are provided then the item start_date and any avaiable
              'dimensions' will be used instead",
          dataType: "a value to be set on a dataType attribute.
              Overrides the data_type argument"
          plugins: "a list of string respresentations of python classes being
              instantiated. e.g. ComputeIdFrom('_timestamp', '_timespan').
              To be run on the passed in data to mutate it.
              See performanceplatform.collector.ga.plugins for more details"
        }
        data_type: "a string - the data_type to be set as a data_type
            attribute on the returned data unless it is overridden in options"
        """
        self.data = list(data)
        if "plugins" in options:
            self.plugins = options["plugins"]
        else:
            self.plugins = None
        self.data_type = options.get('dataType', data_type)
        self.mappings = options.get("mappings", {})
        self.idMapping = options.get("idMapping", None)
        self.additionalFields = options.get('additionalFields', {})
def __init__ ( self , data , options , data_type ) : self . data = list ( data ) if "plugins" in options : self . plugins = options [ "plugins" ] else : self . plugins = None self . data_type = options . get ( 'dataType' , data_type ) self . mappings = options . get ( "mappings" , { } ) self . idMapping = options . get ( "idMapping" , None ) self . additionalFields = options . get ( 'additionalFields' , { } )
data: Can be any array of dicts
        options: {
          mappings: "a dict: converts keys matching key of the mappings dict
              to the value in the mapping dict",
          additionalFields: "a dict:
              key value pairs will be added into the returned data",
          idMapping: "a list of keys or single key string: for each key
              the corresponding values will be concatenated in order to create
              a unique _humanId field on the returned data and base64
              encoded in order to create an _id field. If no idMapping
              are provided then the item start_date and any avaiable
              'dimensions' will be used instead",
          dataType: "a value to be set on a dataType attribute.
              Overrides the data_type argument"
          plugins: "a list of string respresentations of python classes being
              instantiated. e.g. ComputeIdFrom('_timestamp', '_timespan').
              To be run on the passed in data to mutate it.
              See performanceplatform.collector.ga.plugins for more details"
        }
        data_type: "a string - the data_type to be set as a data_type
            attribute on the returned data unless it is overridden in options"