// CreateOrUpdateACL sets an Apache Kafka Access Control List.
// Use the defined types when needed, example:
// `client.CreateOrUpdateACL(lenses.ACL{lenses.ACLResourceTopic, "transactions", "principalType:principalName", lenses.ACLPermissionAllow, "*", lenses.OpRead})`
//
// Note that on the "host" input argument you should use IP addresses as domain names are not supported at the moment by Apache Kafka.
CreateOrUpdateACL sets an Apache Kafka Access Control List.
Use the defined types when needed, example:
`client.CreateOrUpdateACL(lenses.ACL{lenses.ACLResourceTopic, "transactions", "principalType:principalName", lenses.ACLPermissionAllow, "*", lenses.OpRead})`

Note that on the "host" input argument you should use IP addresses as domain names are not supported at the moment by Apache Kafka.
// CreateOrUpdateACL sets an Apache Kafka Access Control List . // Use the defined types when needed example : // ` client . CreateOrUpdateACL ( lenses . ACL { lenses . ACLResourceTopic " transactions " " principalType : principalName " lenses . ACLPermissionAllow " * " lenses . OpRead } ) ` // // Note that on the " host " input argument you should use IP addresses as domain names are not supported at the moment by Apache Kafka .
func (c *Client) CreateOrUpdateACL(acl ACL) error {
	if err := acl.Validate(); err != nil {
		return err
	}
	send, err := json.Marshal(acl)
	if err != nil {
		return err
	}
	resp, err := c.Do(http.MethodPut, aclPath, contentTypeJSON, send)
	if err != nil {
		return err
	}
	if resp.StatusCode == http.StatusBadRequest {
		return fmt.Errorf("no authorizer is configured on the broker")
	}
	return resp.Body.Close()
}
func ( c * Client ) CreateOrUpdateACL ( acl ACL ) error { if err := acl . Validate ( ) ; err != nil { return err } send , err := json . Marshal ( acl ) if err != nil { return err } resp , err := c . Do ( http . MethodPut , aclPath , contentTypeJSON , send ) if err != nil { return err } if resp . StatusCode == http . StatusBadRequest { return fmt . Errorf ( " " ) } return resp . Body . Close ( ) }
CreateOrUpdateACL sets an Apache Kafka Access Control List.
CreateOrUpdateACL sets an Apache Kafka Access Control List .
// unlike with other calls this one returns a plain text with no authorize-type error message // instead of 403, so make that check only on the acl API: // note: the status code errors are checked in the `do` on every request.