code: func (req *GenerateTokenRequest) CheckAndSetDefaults() error {
  	for _, role := range req.Roles {
  		if err := role.Check(); err != nil {
  			return trace.Wrap(err)
  		}
  	}
  	if req.TTL == 0 {
  		req.TTL = defaults.ProvisioningTokenTTL
  	}
  	if req.Token == "" {
  		token, err := utils.CryptoRandomHex(TokenLenBytes)
  		if err != nil {
  			return trace.Wrap(err)
  		}
  		req.Token = token
  	}
  	return nil
  }
docs: // CheckAndSetDefaults checks and sets default values of request