code: func (s *Server) CreateConfig(ctx context.Context, request *api.CreateConfigRequest) (*api.CreateConfigResponse, error) {
  	if err := validateConfigSpec(request.Spec); err != nil {
  		return nil, err
  	}
  
  	config := configFromConfigSpec(request.Spec) // the store will handle name conflicts
  	err := s.store.Update(func(tx store.Tx) error {
  		return store.CreateConfig(tx, config)
  	})
  
  	switch err {
  	case store.ErrNameConflict:
  		return nil, status.Errorf(codes.AlreadyExists, "config %s already exists", request.Spec.Annotations.Name)
  	case nil:
  		log.G(ctx).WithFields(logrus.Fields{
  			"config.Name": request.Spec.Annotations.Name,
  			"method":      "CreateConfig",
  		}).Debugf("config created")
  
  		return &api.CreateConfigResponse{Config: config}, nil
  	default:
  		return nil, err
  	}
  }
docs: // CreateConfig creates and returns a `CreateConfigResponse` with a `Config` based
  // on the provided `CreateConfigRequest.ConfigSpec`.
  // - Returns `InvalidArgument` if the `CreateConfigRequest.ConfigSpec` is malformed,
  //   or if the config data is too long or contains invalid characters.
  // - Returns an error if the creation fails.