code: func validateMachineForUpdate(m *crimson.Machine, mask *field_mask.FieldMask) error {
  	switch err := validateUpdateMask(mask); {
  	case m == nil:
  		return status.Error(codes.InvalidArgument, "machine specification is required")
  	case m.Name == "":
  		return status.Error(codes.InvalidArgument, "machine name is required and must be non-empty")
  	case err != nil:
  		return err
  	}
  	for _, path := range mask.Paths {
  		switch path {
  		case "name":
  			return status.Error(codes.InvalidArgument, "machine name cannot be updated, delete and create a new machine instead")
  		case "platform":
  			if m.Platform == "" {
  				return status.Error(codes.InvalidArgument, "platform is required and must be non-empty")
  			}
  		case "rack":
  			if m.Rack == "" {
  				return status.Error(codes.InvalidArgument, "rack is required and must be non-empty")
  			}
  		case "datacenter":
  			return status.Error(codes.InvalidArgument, "datacenter cannot be updated, update rack instead")
  		case "state":
  			if m.State == common.State_STATE_UNSPECIFIED {
  				return status.Error(codes.InvalidArgument, "state is required")
  			}
  		case "description":
  			// Empty description is allowed, nothing to validate.
  		case "asset_tag":
  			// Empty asset tag is allowed, nothing to validate.
  		case "service_tag":
  			// Empty service tag is allowed, nothing to validate.
  		case "deployment_ticket":
  			// Empty deployment ticket is allowed, nothing to validate.
  		case "drac_password":
  			// Empty DRAC password is allowed, nothing to validate.
  		default:
  			return status.Errorf(codes.InvalidArgument, "unsupported update mask path %q", path)
  		}
  	}
  	return nil
  }
docs: // validateMachineForUpdate validates a machine for update.