func UpdateSegment(segment *Segment, segID, apiKey string) (*Segment, error) {
	payload, err := json.Marshal(segment)
	if err != nil {
		return nil, err
	}

	response, err := SendPATCHRequest(apiKey, "/contactdb/segments/"+segID, string(payload))
	if err != nil {
		return nil, err
	}

	newSeg := &Segment{}
	err = json.Unmarshal(response, newSeg)
	if err != nil {
		return nil, err
	}

	return newSeg, nil
}
// UpdateSegment will update a specific segment with new values. (PATCH)
UpdateSegment will update a specific segment with new values. (PATCH)
// UpdateSegment will update a specific segment with new values . ( PATCH )
func UpdateSegment(segment *Segment, segID, apiKey string) (*Segment, error) {
	payload, err := json.Marshal(segment)
	if err != nil {
		return nil, err
	}
	response, err := SendPATCHRequest(apiKey, "/contactdb/segments/"+segID, string(payload))
	if err != nil {
		return nil, err
	}
	newSeg := &Segment{}
	err = json.Unmarshal(response, newSeg)
	if err != nil {
		return nil, err
	}
	return newSeg, nil
}
func UpdateSegment ( segment * Segment , segID , apiKey string ) ( * Segment , error ) { payload , err := json . Marshal ( segment ) if err != nil { return nil , err } response , err := SendPATCHRequest ( apiKey , " " + segID , string ( payload ) ) if err != nil { return nil , err } newSeg := & Segment { } err = json . Unmarshal ( response , newSeg ) if err != nil { return nil , err } return newSeg , nil }
UpdateSegment will update a specific segment with new values.
UpdateSegment will update a specific segment with new values .