code: def validate(cls, mapper_spec):
      
      if mapper_spec.output_writer_class() != cls:
        raise errors.BadWriterParamsError("Output writer class mismatch")
      params = output_writers._get_params(mapper_spec)
      # Bucket Name is required
      if cls.BUCKET_NAME_PARAM not in params:
        raise errors.BadWriterParamsError(
            "%s is required for the _HashingGCSOutputWriter" %
            cls.BUCKET_NAME_PARAM)
docs: Validates mapper specification.
  
      Args:
        mapper_spec: an instance of model.MapperSpec to validate.
      Raises:
        BadWriterParamsError: when Output writer class mismatch.