code: public function onInsert(ResourceEventInterface $event)
      {
          $method = $this->getShipmentMethodFromEvent($event);
  
          if (0 == strlen($method->getGatewayName())) {
              $method->setGatewayName(sprintf(
                  '%s-%s',
                  Transliterator::transliterate($method->getPlatformName()),
                  uniqid()
              ));
  
              // TODO check uniqueness
  
              $this->persistenceHelper->persistAndRecompute($method);
          }
      }
docs: Insert event handler.
  
  @param ResourceEventInterface $event