// UpdateTopicPartitions updates a topics partition number
UpdateTopicPartitions updates a topics partition number
// UpdateTopicPartitions updates a topics partition number
func (c *Client) UpdateTopicPartitions(topicName string, partitions int) error {
	if topicName == "" {
		return errRequired("topicName")
	}
	type PartitionUpdatePayload struct {
		Partitions int `json:"partitions"`
	}
	path := fmt.Sprintf("api/v1/kafka/topics/%s/partitions", topicName)
	payload, err := json.Marshal(PartitionUpdatePayload{Partitions: partitions})
	if err != nil {
		return err
	}
	resp, err := c.Do(http.MethodPut, path, contentTypeJSON, payload)
	if err != nil {
		return err
	}
	resp.Body.Close()
	return nil
}
func ( c * Client ) UpdateTopicPartitions ( topicName string , partitions int ) error { if topicName == " " { return errRequired ( " " ) } type PartitionUpdatePayload struct { Partitions int `json:"partitions"` } path := fmt . Sprintf ( " " , topicName ) payload , err := json . Marshal ( PartitionUpdatePayload { Partitions : partitions } ) if err != nil { return err } resp , err := c . Do ( http . MethodPut , path , contentTypeJSON , payload ) if err != nil { return err } resp . Body . Close ( ) return nil }
UpdateTopicPartitions updates a topics partition number
UpdateTopicPartitions updates a topics partition number