// SetWebhook sets the Webhook field's value.
961299
func (s *CreateWebhookOutput) SetWebhook(v *Webhook) *CreateWebhookOutput {
	s.Webhook = v
	return s
}
1366306
func GetWebhookByOrgID(orgID, id int64) (*Webhook, error) {
	return getWebhook(&Webhook{
		ID:    id,
		OrgID: orgID,
	})
}
1244427
func (s *Session) Webhook(webhookID string) (st *Webhook, err error) {

	body, err := s.RequestWithBucketID("GET", EndpointWebhook(webhookID), nil, EndpointWebhooks)
	if err != nil {
		return
	}

	err = unmarshal(body, &st)

	return
}
133906
func (s *DescribeWebsiteCertificateAuthorityInput) SetWebsiteCaId(v string) *DescribeWebsiteCertificateAuthorityInput {
	s.WebsiteCaId = &v
	return s
}
54273
func (s *GetIntentOutput) SetDialogCodeHook(v *CodeHook) *GetIntentOutput {
	s.DialogCodeHook = v
	return s
}
364009
func (bot TgBot) SetWebhookNoQuery(urlw string) ResultSetWebhook {
	q := SetWebhookQuery{&urlw}
	url := bot.buildPath("setWebhook")
	body, error := postPetition(url, q, nil)

	if error != nil {
		errc := 500
		err := "Some error happened while sending the message"
		return ResultSetWebhook{false, err, nil, &errc}
	}
	var result ResultSetWebhook
	json.Unmarshal([]byte(body), &result)
	return result
}
1320464
func (s *WebhooksService) ListWebhooks(accountID string, _ *ListOptions) (*webhooksResponse, error) {
	path := versioned(webhookPath(accountID, 0))
	webhooksResponse := &webhooksResponse{}

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

	webhooksResponse.HttpResponse = resp
	return webhooksResponse, nil
}
1129733
func (v *version) MutatingWebhookConfigurations() MutatingWebhookConfigurationInformer {
	return &mutatingWebhookConfigurationInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
}
1350529
func (s *Run) SetWebUrl(v string) *Run {
	s.WebUrl = &v
	return s
}
1188179
func (mg *MailgunImpl) UpdateWebhook(ctx context.Context, t string, urls []string) error {
	r := newHTTPRequest(generateDomainApiUrl(mg, webhooksEndpoint) + "/" + t)
	r.setClient(mg.Client())
	r.setBasicAuth(basicAuthUser, mg.APIKey())
	p := newUrlEncodedPayload()
	for _, url := range urls {
		p.addValue("url", url)
	}
	_, err := makePutRequest(ctx, r, p)
	return err
}
1305210
func (s *CampaignHook) SetWebUrl(v string) *CampaignHook {
	s.WebUrl = &v
	return s
}
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
}
297107
func (s *Session) WebhookDelete(webhookID string) (err error) {

	_, err = s.RequestWithBucketID("DELETE", EndpointWebhook(webhookID), nil, EndpointWebhooks)

	return
}
1099513
func NewWebhook(link string) WebhookConfig {
	u, _ := url.Parse(link)

	return WebhookConfig{
		URL: u,
	}
}
1127922
func (bot *BotAPI) GetWebhookInfo() (WebhookInfo, error) {
	resp, err := bot.MakeRequest("getWebhookInfo", url.Values{})
	if err != nil {
		return WebhookInfo{}, err
	}

	var info WebhookInfo
	err = json.Unmarshal(resp.Result, &info)

	return info, err
}
950456
func (s *CampaignResponse) SetHook(v *CampaignHook) *CampaignResponse {
	s.Hook = v
	return s
}
1266559
func (s *Session) GuildWebhooks(guildID string) (st []*Webhook, err error) {

	body, err := s.RequestWithBucketID("GET", EndpointGuildWebhooks(guildID), nil, EndpointGuildWebhooks(guildID))
	if err != nil {
		return
	}

	err = unmarshal(body, &st)

	return
}