func()

in utterance.go [71:96]


func (c *Client) DeleteUtterances(texts []string) (*TrainingResponse, error) {
	type text struct {
		Text string `json:"text"`
	}
	reqTexts := make([]text, len(texts))
	for i, t := range texts {
		reqTexts[i] = text{Text: t}
	}

	utterancesJSON, err := json.Marshal(reqTexts)
	if err != nil {
		return nil, err
	}

	resp, err := c.request(http.MethodDelete, "/utterances", "application/json", bytes.NewBuffer(utterancesJSON))
	if err != nil {
		return nil, err
	}

	defer resp.Close()

	var r *TrainingResponse
	decoder := json.NewDecoder(resp)
	err = decoder.Decode(&r)
	return r, err
}