code: func (s *StateV2) CheckAndSetDefaults() error {
  	s.Kind = services.KindState
  	s.Version = services.V2
  	// for state resource name does not matter
  	if s.Metadata.Name == "" {
  		s.Metadata.Name = stateName
  	}
  	if err := s.Metadata.CheckAndSetDefaults(); err != nil {
  		return trace.Wrap(err)
  	}
  	return nil
  }
docs: // CheckAndSetDefaults checks and sets defaults values.