diff --git a/internal/build/cmd/generate/commands/gensource/generator.go b/internal/build/cmd/generate/commands/gensource/generator.go index 40e75077a2..19a366e6b3 100644 --- a/internal/build/cmd/generate/commands/gensource/generator.go +++ b/internal/build/cmd/generate/commands/gensource/generator.go @@ -526,6 +526,15 @@ func (r ` + g.Endpoint.MethodWithNamespace() + `Request) Do(providedCtx context. method = "POST" }`) g.w("\n\n") + case "security.create_service_token": + g.w("\t") + g.w(`if r.Name != "" { + method = "POST" + } else { + method = "PUT" + }`) + g.w("\n\n") + default: var httpMethod string // If endpoint has both GET and POST available