Send an Event object to datadog

@param Event $event

@return Client
973581
public function sendEvent(Event $event) {
        $this->send(
            self::ENDPOINT_EVENT . $this->getApiKey(),
            $event->toArray()
        );

        return $this;
    }
177871
public function serializeEvent($name, Event $event)
    {
        $context = SerializationContext::create();

        return serialize(array(
            'name' => $name,
            'class' => get_class($event),
            'event' => $this->serializer->serialize($event, 'json', $context),
        ));
    }
213131
protected function getPayloadFromEvent($event)
    {
        if (method_exists($event, 'broadcastWith')) {
            return $event->broadcastWith();
        }

        $payload = array();

        //
        $reflection = new ReflectionClass($event);

        foreach ($reflection->getProperties(ReflectionProperty::IS_PUBLIC) as $property) {
            $key = $property->getName();

            $value = $property->getValue($event);

            $payload[$key] = $this->formatProperty($value);
        }

        return $payload;
    }
857846
protected function dispatch($name, Event $event)
    {
        $this->assertEventName($name);
        $this->getEventDispatcher()->dispatch($name, $event);
        return $this;
    }
804921
public static function create(Event $event): EventMessage
    {
        $timestamp = DateTime::now();
        $id = MessageId::generate();
        $metaData = MetaData::create();

        return new static($id, $timestamp, $event, $metaData);
    }
347043
public function addEvent(Event $event): self
    {
        $event->setSchedule($this);
        $this->events[] = $event;

        return $this;
    }
703850
protected function fireEvent($event, $data)
    {
        $fireableEvent = isset($this->fireEvents[$event]) ? $this->fireEvents[$event] : null;

        if (! is_null($fireableEvent)) {
            return $this->event->fire($fireableEvent, $data);
        }

        return null;
    }
51563
public function emitEvent($event)
    {
        if (array_key_exists($event, $this->listeners)) {
            $arg_list = func_get_args();
            array_shift($arg_list);
            foreach ($this->listeners[$event] as $callback) {
                call_user_func_array($callback, $arg_list);
            }
        }

        return $this;
    }
106234
public function onRequestPoll(Event $event)
    {
        $request = $event['request'];
        $delay = $request->getParams()->get(self::DELAY_PARAM);

        // If the duration of the delay has passed, retry the request using the pool
        if (null !== $delay && microtime(true) >= $delay) {
            // Remove the request from the pool and then add it back again. This is required for cURL to know that we
            // want to retry sending the easy handle.
            $request->getParams()->remove(self::DELAY_PARAM);
            // Rewind the request body if possible
            if ($request instanceof EntityEnclosingRequestInterface && $request->getBody()) {
                $request->getBody()->seek(0);
            }
            $multi = $event['curl_multi'];
            $multi->remove($request);
            $multi->add($request);
        }
    }
177832
public function trigger(Event $event) {
    $request = $event->getTarget();
    
    $cachedRequest = new CachedRequest($request->getURL());
    $cachedRequest->setCachedResponse($event->getData()->response);
    $cachedRequest->setHeaders($event->getData()->headers);
    
    $this->addCachedRequest($cachedRequest);
  }
162212
protected function sendEventThroughSenders(Event $event)
    {
        foreach ($this->eventSenders as $sender) {
            try {
                $sender->send($event);
            } catch (\Exception $exception) {
                $this->logException($exception);
            }
        }

        return $this;
    }
602119
public function setEvent(\Spatie\ServerMonitor\Events\Event $event): self
    {
        $this->event = $event;

        return $this;
    }
1011092
final private function replayChange(Event $event)
    {
        $this->apply($event->payload());
        $this->lastCommittedEventSequenceNumber = $event->sequenceNumber();
    }
913931
public function urlSecret(Event $event)
    {
        $query = $event['request']->getQuery();

        $query->set('client_id', $this->auth['client_id']);
        $query->set('client_secret', $this->auth['client_secret']);
    }
195226
public function onDelete(Event\Delete $event)
    {
        $success = $event->getUser()->delete();
        $event->setResult( (bool)$success );
        if( $event->getResult() === false )
        {
            $event->stopPropagation(true);
        }
        return $event;
    }
325619
public static function execute(Event $event) {
    $composer = $event->getComposer();
    $handler = new static(
      $composer->getPackage(),
      $composer->getLocker()
    );
    $encoder = new IniEncoder();
    $make = $handler->make();
    $core = $handler->makeCore($make);
    file_put_contents('drupal-org-core.make', $encoder->encode($core));
    file_put_contents('drupal-org.make', $encoder->encode($make));
  }
785891
public function onRequestBeforeSend(Event $event)
    {
        $request = $event['request'];

        $request->setHeader('Accept',(string) $this->config['accept-header']);

        return $this->config['accept-header'];
    }