// SetWebhook sets the Webhook field's value.
763532
func (s *UpdateWebhookOutput) SetWebhook(v *Webhook) *UpdateWebhookOutput {
	s.Webhook = v
	return s
}
1130479
func (s *Service) AppWebhookInfo(ctx context.Context, appIdentity string, appWebhookIdentity string) (*AppWebhookInfoResult, error) {
	var appWebhook AppWebhookInfoResult
	return &appWebhook, s.Get(ctx, &appWebhook, fmt.Sprintf("/apps/%v/webhooks/%v", appIdentity, appWebhookIdentity), nil, nil)
}
1211520
func UpdateWebhook(w *Webhook) error {
	_, err := x.Id(w.ID).AllCols().Update(w)
	return err
}
958052
func (bot TgBot) SetWebhookQuery(url *string, cert *string) ResultSetWebhook {
	if cert == nil {
		return bot.SetWebhookNoQuery(*url)
	}
	return bot.SetWebhookWithCert(*url, *cert)
}
1366306
func GetWebhookByOrgID(orgID, id int64) (*Webhook, error) {
	return getWebhook(&Webhook{
		ID:    id,
		OrgID: orgID,
	})
}
1119104
func (s *Service) AppWebhookEventInfo(ctx context.Context, appIdentity string, appWebhookEventIdentity string) (*AppWebhookEvent, error) {
	var appWebhookEvent AppWebhookEvent
	return &appWebhookEvent, s.Get(ctx, &appWebhookEvent, fmt.Sprintf("/apps/%v/webhook-events/%v", appIdentity, appWebhookEventIdentity), nil, nil)
}
1108920
func NewValidatingAdmissionWebhook(configFile io.Reader) (*Plugin, error) {
	handler := admission.NewHandler(admission.Connect, admission.Create, admission.Delete, admission.Update)
	webhook, err := generic.NewWebhook(handler, configFile, configuration.NewValidatingWebhookConfigurationManager, newValidatingDispatcher)
	if err != nil {
		return nil, err
	}
	return &Plugin{webhook}, nil
}
193469
func (v *version) ValidatingWebhookConfigurations() ValidatingWebhookConfigurationInformer {
	return &validatingWebhookConfigurationInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
}
23560
func PrepareWebhooks(repo *Repository, event HookEventType, p api.Payloader) error {
	return prepareWebhooks(x, repo, event, p)
}
916464
func (s *WebhooksService) GetWebhook(accountID string, webhookID int64) (*webhookResponse, error) {
	path := versioned(webhookPath(accountID, webhookID))
	webhookResponse := &webhookResponse{}

	resp, err := s.client.get(path, webhookResponse)
	if err != nil {
		return nil, err
	}

	webhookResponse.HttpResponse = resp
	return webhookResponse, nil
}
626069
func DeleteWebhookOfOrgByID(orgID, id int64) error {
	return deleteWebhook(&Webhook{
		ID:    id,
		OrgID: orgID,
	})
}
135620
func NewWebHookREST(buildConfigClient buildclienttyped.BuildV1Interface, secretsClient kubetypedclient.SecretsGetter, groupVersion schema.GroupVersion, plugins map[string]webhook.Plugin) *WebHook {
	return newWebHookREST(buildConfigClient, secretsClient, client.BuildConfigInstantiatorClient{Client: buildConfigClient}, groupVersion, plugins)
}
1271072
func (mg *MailgunImpl) ListWebhooks(ctx context.Context) (map[string]string, error) {
	r := newHTTPRequest(generateDomainApiUrl(mg, webhooksEndpoint))
	r.setClient(mg.Client())
	r.setBasicAuth(basicAuthUser, mg.APIKey())
	var envelope struct {
		Webhooks map[string]interface{} `json:"webhooks"`
	}
	err := getResponseFromJSON(ctx, r, &envelope)
	hooks := make(map[string]string, 0)
	if err != nil {
		return hooks, err
	}
	for k, v := range envelope.Webhooks {
		object := v.(map[string]interface{})
		url := object["url"]
		hooks[k] = url.(string)
	}
	return hooks, nil
}
129476
func (writer *ConsoleWriter) SetHook(hook Hook) {
	writer.lock.Lock()
	defer writer.lock.Unlock()

	writer.hook = hook
}
1181722
func (mg *MailgunImpl) DeleteWebhook(ctx context.Context, t string) error {
	r := newHTTPRequest(generateDomainApiUrl(mg, webhooksEndpoint) + "/" + t)
	r.setClient(mg.Client())
	r.setBasicAuth(basicAuthUser, mg.APIKey())
	_, err := makeDeleteRequest(ctx, r)
	return err
}
1013227
func (s *ListWebhooksOutput) SetWebhooks(v []*ListWebhookItem) *ListWebhooksOutput {
	s.Webhooks = v
	return s
}
325548
func (bot TgBot) SetWebhook(url string) (ResultSetWebhook, error) {
	// pet := SetWebhookQuery{&url}
	// req := bot.SetWebhookQuery(pet)
	req := bot.SetWebhookQuery(&url, nil)
	if !req.Ok {
		return req, errors.New(req.Description)
	}
	return req, nil
}