func (api *API) UpdateWebhook(addrHash hash.Hash, ID string, wh webhook.Type) error {
	if wh.ID != ID {
		return errNoSuccess
	}

	data, err := json.Marshal(wh)
	if err != nil {
		return err
	}

	url := fmt.Sprintf("/account/%s/webhook/%s", addrHash.String(), ID)
	body, statusCode, err := api.Post(url, data)
	if err != nil {
		return err
	}

	if statusCode < 200 || statusCode > 299 {
		return errNoSuccess
	}

	if isErrorResponse(body) {
		return GetErrorFromResponse(body)
	}

	return nil
}
// UpdateWebhook will update a webhook
UpdateWebhook will update a webhook
// UpdateWebhook will update a webhook
func (api *API) UpdateWebhook(addrHash hash.Hash, ID string, wh webhook.Type) error {
	if wh.ID != ID {
		return errNoSuccess
	}
	data, err := json.Marshal(wh)
	if err != nil {
		return err
	}
	url := fmt.Sprintf("/account/%s/webhook/%s", addrHash.String(), ID)
	body, statusCode, err := api.Post(url, data)
	if err != nil {
		return err
	}
	if statusCode < 200 || statusCode > 299 {
		return errNoSuccess
	}
	if isErrorResponse(body) {
		return GetErrorFromResponse(body)
	}
	return nil
}
func ( api * API ) UpdateWebhook ( addrHash hash . Hash , ID string , wh webhook . Type ) error { if wh . ID != ID { return errNoSuccess } data , err := json . Marshal ( wh ) if err != nil { return err } url := fmt . Sprintf ( " " , addrHash . String ( ) , ID ) body , statusCode , err := api . Post ( url , data ) if err != nil { return err } if statusCode < 200 || statusCode > 299 { return errNoSuccess } if isErrorResponse ( body ) { return GetErrorFromResponse ( body ) } return nil }
UpdateWebhook will update a webhook
UpdateWebhook will update a webhook