code: func (s *Service) GetCompressedMasterJSON(c context.Context, req *milo.MasterRequest) (
  	*milo.CompressedMasterJSON, error) {
  
  	if req.Name == "" {
  		return nil, status.Errorf(codes.InvalidArgument, "No master specified")
  	}
  
  	apiUsage.Add(c, 1, "GetCompressedMasterJSON", req.Name, "", req.ExcludeDeprecated, req.NoEmulation)
  
  	cu := auth.CurrentUser(c)
  	logging.Debugf(c, "%s is making a master request for %s", cu.Identity, req.Name)
  
  	if err := buildstore.CanAccessMaster(c, req.Name); err != nil {
  		return nil, err
  	}
  
  	master, err := buildstore.GetMaster(c, req.Name, true)
  
  	switch code := grpcutil.Code(err); {
  	case code == codes.NotFound, code == codes.PermissionDenied:
  		return nil, errNotFoundGRPC
  	case err != nil:
  		return nil, err
  	}
  
  	for _, builder := range master.Builders {
  		// Nobody uses PendingBuildStates.
  		// Exclude them from the response
  		// because they are hard to emulate.
  		builder.PendingBuildStates = nil
  	}
  
  	if req.ExcludeDeprecated {
  		excludeDeprecatedFromMaster(&master.Master)
  	}
  
  	// Compress it.
  	gzbs := bytes.Buffer{}
  	gsw := gzip.NewWriter(&gzbs)
  	cw := iotools.CountingWriter{Writer: gsw}
  	e := json.NewEncoder(&cw)
  	if err := e.Encode(master); err != nil {
  		gsw.Close()
  		return nil, err
  	}
  	gsw.Close()
  
  	logging.Infof(c, "Returning %d bytes", cw.Count)
  
  	return &milo.CompressedMasterJSON{
  		Internal: master.Internal,
  		Modified: google.NewTimestamp(master.Modified),
  		Data:     gzbs.Bytes(),
  	}, nil
  }
docs: // GetCompressedMasterJSON assembles a CompressedMasterJSON object from the
  // provided MasterRequest.