Create a new webhook

@link   https://help.shopify.com/api/reference/webhook#create
@param  Webhook $webhook
@return void
509367
public function create(Webhook &$webhook)
    {
        $data = $webhook->exportData();
        $response = $this->request(
            '/admin/webhooks.json', 'POST', array(
            'webhook' => $data
            )
        );
        $webhook->setData($response['webhook']);
    }
761405
public function addHook(Hook $hook)
    {
        if (isset($this->hooks[$hook->name]) === false) {
            $this->logger->debug(
                "Adding definition for hook '{$hook->name}' for the first time."
            );
            $this->hooks[$hook->name] = [];
        }

        $this->hooks[$hook->name][] = $hook->definition;
    }
701537
public WebhookResponseData createWebHook(Webhook webhook) throws UnauthorizedException, GeneralException {
        if (webhook.getTitle() == null) {
            throw new IllegalArgumentException("Title of webhook must be specified.");
        }

        if (webhook.getUrl() == null) {
            throw new IllegalArgumentException("URL of webhook must be specified.");
        }

        String url = String.format("%s%s", VOICE_CALLS_BASE_URL, WEBHOOKS);
        return messageBirdService.sendPayLoad(url, webhook, WebhookResponseData.class);
    }
21746
public function registerConfiguredHooks(string $config = '')
    {
        if (empty($config)) {
            $config = 'app.hooks';
        }

        $hooks = Collection::make($this->config[$config]);

        (new HooksRepository($this))->load($hooks->all());
    }
59750
public function webhook(): void
	{
		//$log = new Logger('botlog');
		//$log->pushHandler(new StreamHandler(__DIR__ . "/../log/botlog.log", Logger::DEBUG));

		if ($data = BotApi::jsonValidate(file_get_contents('php://input'), true)) {
			//$log->debug(file_get_contents('php://input'));
			$update = Update::fromResponse($data);
			$this->processUpdate($update);
		}
	}
1153078
public function create($data, $websiteId = null)
    {
        if (isset($websiteId)) {
            return $this->client()->put($data, 'websites/{websiteId}', ['websiteId' => $websiteId]);
        }

        return $this->client()->post($data, 'websites');
    }
803768
def create_webhook_app(self, path, loop=None):
        
        app = web.Application(loop=loop)
        app.router.add_route("POST", path, self.webhook_handle)
        return app
669279
public function createHook(string $name, string $config, array $events = ['push'], bool $active = true): array
    {
        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/hooks',
            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo()), Request::METHOD_POST, [
                'name'   => $name,
                'config' => $config,
                'events' => $events,
                'active' => $active
            ]);
    }
439174
public function setWebhook($webhook)
    {
        $this->webhook = $webhook;
        $this->id = Carbon::now()->toDateTimeString();

        return $this;
    }
665734
public function update(Webhook $webhook)
    {
        $data = $webhook->exportData();
        $response = $this->request(
            '/admin/webhooks/'.$webhook->id.'.json', 'PUT', array(
            'webhook' => $data
            )
        );
        $webhook->setData($response['webhook']);
    }
1139944
function verifyWebhook(hookDef, webhook) {
    logger(hookDef.name + ': Webhook already registered: ' + webhook.id + ': ' + webhook.status);
    if (webhook.status !== 'active') {
      logger(hookDef.name + ': Enabling webhook');
      webhooksClient.enable(webhook.id);
    }
  }
200090
public function addHook(Hook $hook)
  {
    # Attempt to find it first
    $exists = $this->getHook($hook->getName());

    # If it exists, return with null
    if (!\is_null($exists)) {
      return false;
    }

    # Add it to the list
    $this->hooks[$hook];

    return $this;
  }
167834
public function addHook(\CampaignChain\CoreBundle\Entity\Hook $hooks)
    {
        $this->hooks[] = $hooks;

        return $this;
    }
1237745
public function createHooks()
	{
		global $context;

		// Get the hooks.
		$hooks = $this['config']->get('availableHooks');
		$overwriteHooks = $this['config']->get('overwriteHooks');

		// Don't execute on uninstall.
		if (!empty($context['uninstalling']) || $this['data']->get('sa') == 'uninstall2' || !$hooks)
			return;

		foreach ($hooks as $hook => $hook_name)
		{
			// The $hook_name value acts as an "enable" check, empty means you do not want to use this hook.
			if (empty($hook_name))
				continue;

			// Gotta replace our tokens.
			if ($overwriteHooks && !empty($overwriteHooks[$hook]))
				$overwriteHooks[$hook]['file'] = $this['tools']->parser($overwriteHooks[$hook]['file'], array(
					'$sourcedir' => $this->sourceDir,
					'$scripturl' => $this->scriptUrl,
					'$boarddir' => $this->boardDir,
					'$boardurl' => $this->boardUrl,
				));

			else
				$overwriteHooks[$hook] = [];

			// Set some default values.
			$defaultValues = array(
				'hookName' => $hook_name,
				'func' => $this->name .'::add'. ucfirst($hook),
				'permanent' => false,
				'file' => '$sourcedir/'. $this->name .'.php',
				'object' => true,
			);

			// You might or might not want to overwrite this...
			extract(array_merge($defaultValues, $overwriteHooks[$hook]));

			// You can also disable any hook used by this mod from the mod's admin settings if the mod has that feature.
			$hookAction = ($this->enable('disable_hook_'. $hook_name) ? 'remove' : 'add') .'_integration_function';

			$hookAction($hookName, $func, $permanent, $file, $object);
		}
	}
960728
public function create($data, $webhookId = null)
    {
        if (isset($webhookId)) {
            return $this->client()->put($data, 'webhooks/{webhookId}', ['webhookId' => $webhookId]);
        }

        return $this->client()->post($data, 'webhooks');
    }
1014568
public static function sendingFailed($webhook, $payload)
    {
        if (! is_string($payload)) {
            $payload = json_encode($payload, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT);
        }

        return new static("Failed sending to BearyChat with webhook {$webhook} .\n{$payload}", 4);
    }
936668
def start_webhook(self, webhook_path=None, request_handler=WebhookRequestHandler, route_name=DEFAULT_ROUTE_NAME,
                      **kwargs):
        
        self.set_webhook(webhook_path=webhook_path, request_handler=request_handler, route_name=route_name)
        self.run_app(**kwargs)