From b87af2dffd6a75fdd2af3ece37f331311236e9d6 Mon Sep 17 00:00:00 2001 From: Travis Bischel Date: Mon, 13 Sep 2021 12:52:52 -0600 Subject: [PATCH] generate / kmsg: name the incremental config alter op int8 --- .../definitions/44_incremental_alter_configs | 2 +- generate/definitions/enums | 8 +++ pkg/kmsg/generated.go | 50 +++++++++++++++++-- 3 files changed, 56 insertions(+), 4 deletions(-) diff --git a/generate/definitions/44_incremental_alter_configs b/generate/definitions/44_incremental_alter_configs index 8e89911c..a394cbe7 100644 --- a/generate/definitions/44_incremental_alter_configs +++ b/generate/definitions/44_incremental_alter_configs @@ -40,7 +40,7 @@ IncrementalAlterConfigsRequest => key 44, max version 1, flexible v1+ // // SUBTRACT (3) is to remove a value from a list of values (if the key // is for a list of values). - Op: int8 + Op: enum-IncrementalAlterConfigOp // Value is a value to set for the key (e.g. 10). Value: nullable-string // ValidateOnly validates the request but does not apply it. diff --git a/generate/definitions/enums b/generate/definitions/enums index b9f77654..a376b477 100644 --- a/generate/definitions/enums +++ b/generate/definitions/enums @@ -39,6 +39,14 @@ ConfigType int8 ( 9: PASSWORD ) +// An incremental configuration operation. +IncrementalAlterConfigOp int8 ( + 0: SET + 1: DELETE + 2: APPEND + 3: SUBTRACT +) + ////////// // ACLS // ////////// diff --git a/pkg/kmsg/generated.go b/pkg/kmsg/generated.go index d1ef54ac..2199d2aa 100644 --- a/pkg/kmsg/generated.go +++ b/pkg/kmsg/generated.go @@ -27154,7 +27154,7 @@ type IncrementalAlterConfigsRequestResourceConfig struct { // // SUBTRACT (3) is to remove a value from a list of values (if the key // is for a list of values). - Op int8 + Op IncrementalAlterConfigOp // Value is a value to set for the key (e.g. 10). Value *string @@ -27303,7 +27303,10 @@ func (v *IncrementalAlterConfigsRequest) AppendTo(dst []byte) []byte { } { v := v.Op - dst = kbin.AppendInt8(dst, v) + { + v := int8(v) + dst = kbin.AppendInt8(dst, v) + } } { v := v.Value @@ -27410,7 +27413,12 @@ func (v *IncrementalAlterConfigsRequest) ReadFrom(src []byte) error { s.Name = v } { - v := b.Int8() + var t IncrementalAlterConfigOp + { + v := b.Int8() + t = IncrementalAlterConfigOp(v) + } + v := t s.Op = v } { @@ -39250,6 +39258,42 @@ const ( ConfigTypePassword ConfigType = 9 ) +// An incremental configuration operation. +// +// Possible values and their meanings: +// +// * 0 (SET) +// +// * 1 (DELETE) +// +// * 2 (APPEND) +// +// * 3 (SUBTRACT) +// +type IncrementalAlterConfigOp int8 + +func (v IncrementalAlterConfigOp) String() string { + switch v { + default: + return "UNKNOWN" + case 0: + return "SET" + case 1: + return "DELETE" + case 2: + return "APPEND" + case 3: + return "SUBTRACT" + } +} + +const ( + IncrementalAlterConfigOpSet IncrementalAlterConfigOp = 0 + IncrementalAlterConfigOpDelete IncrementalAlterConfigOp = 1 + IncrementalAlterConfigOpAppend IncrementalAlterConfigOp = 2 + IncrementalAlterConfigOpSubtract IncrementalAlterConfigOp = 3 +) + // ACLResourceType is a type of resource to use for ACLs. // // Possible values and their meanings: