/*
UpdatePrice calls the price update API endpoint with an UpdateRequest model in the body.
*/
UpdatePrice calls the price update API endpoint with an UpdateRequest model in the body.
/ * UpdatePrice calls the price update API endpoint with an UpdateRequest model in the body . * /
func UpdatePrice(update *UpdateRequest) error {
	client := &http.Client{}
	rBody, err := json.Marshal(update)
	if err != nil {
		return err
	}
	res, err := client.Post(Host+"/prices/update/"+strconv.Itoa(update.ID), "application/json", bytes.NewBuffer(rBody))
	if err != nil {
		return err
	}
	defer res.Body.Close()
	if res.StatusCode > 200 {
		return fmt.Errorf("could not update price, status code %s returned", strconv.Itoa(res.StatusCode))
	}
	return nil
}
func UpdatePrice ( update * UpdateRequest ) error { client := & http . Client { } rBody , err := json . Marshal ( update ) if err != nil { return err } res , err := client . Post ( Host + " " + strconv . Itoa ( update . ID ) , " " , bytes . NewBuffer ( rBody ) ) if err != nil { return err } defer res . Body . Close ( ) if res . StatusCode > 200 { return fmt . Errorf ( " " , strconv . Itoa ( res . StatusCode ) ) } return nil }
UpdatePrice calls the price update API endpoint with an UpdateRequest model in the body.
UpdatePrice calls the price update API endpoint with an UpdateRequest model in the body .