Skip to content

Commit cc7b460

Browse files
committed
feat(opensearchapi)!: regenerate with typed string enums
Regenerate opensearchapi and plugins after the osgen string-enum change. Enum-like fields and query parameters that were plain string are now named types with exported consts: NodeRole (cat-nodes, nodes-info), Result and VersionType (write ops), TimeUnit (cat time params), OpType, SearchType, and the rest. NodeRole now carries the search and warm roles. BREAKING CHANGE: fields and query params across opensearchapi and plugins change from string to named enum types (e.g. Roles []string -> []NodeRole, Result string -> Result). Values still assign and compare as strings via the named type; type-strict comparisons against untyped string literals need the const (e.g. opensearchapi.ResultUpdated). Updates the one such hand-written assertion in api_document_lifecycle_test.go. Signed-off-by: Sean Chittenden <sean.chittenden@crowdstrike.com>
1 parent 3df8570 commit cc7b460

76 files changed

Lines changed: 984 additions & 228 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

opensearchapi/api_document_lifecycle_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ func TestManual_DocumentUpdate(t *testing.T) {
193193
BodyReader: strings.NewReader(tt.body),
194194
})
195195
require.NoError(t, err)
196-
require.Equal(t, "updated", resp.Result)
196+
require.Equal(t, opensearchapi.ResultUpdated, resp.Result)
197197
require.Equal(t, index, resp.Index)
198198
require.Equal(t, tt.id, resp.ID)
199199
testutil.CompareRawJSONwithParsedJSON(t, resp, resp.Inspect().Response)

opensearchapi/cat-health_gen.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

opensearchapi/cat-indices_gen.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

opensearchapi/cat-nodes_gen.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

opensearchapi/cat-pending_tasks_gen.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

opensearchapi/cat-recovery_gen.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

opensearchapi/cat-segment_replication_gen.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

opensearchapi/cat-shards_gen.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

opensearchapi/cat-snapshots_gen.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

opensearchapi/cat-tasks_gen.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)